pdf.min.js 442 KB

12345678910111213141516171819202122
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * Javascript code in this page
  4. *
  5. * Copyright 2020 Mozilla Foundation
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * @licend The above is the entire license notice for the
  20. * Javascript code in this page
  21. */
  22. !function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],r):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=r():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=r()}(this,(function(){return(()=>{var __webpack_modules__=[(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});Object.defineProperty(r,"addLinkAttributes",{enumerable:!0,get:function get(){return o.addLinkAttributes}});Object.defineProperty(r,"getFilenameFromUrl",{enumerable:!0,get:function get(){return o.getFilenameFromUrl}});Object.defineProperty(r,"LinkTarget",{enumerable:!0,get:function get(){return o.LinkTarget}});Object.defineProperty(r,"loadScript",{enumerable:!0,get:function get(){return o.loadScript}});Object.defineProperty(r,"PDFDateString",{enumerable:!0,get:function get(){return o.PDFDateString}});Object.defineProperty(r,"RenderingCancelledException",{enumerable:!0,get:function get(){return o.RenderingCancelledException}});Object.defineProperty(r,"build",{enumerable:!0,get:function get(){return i.build}});Object.defineProperty(r,"getDocument",{enumerable:!0,get:function get(){return i.getDocument}});Object.defineProperty(r,"LoopbackPort",{enumerable:!0,get:function get(){return i.LoopbackPort}});Object.defineProperty(r,"PDFDataRangeTransport",{enumerable:!0,get:function get(){return i.PDFDataRangeTransport}});Object.defineProperty(r,"PDFWorker",{enumerable:!0,get:function get(){return i.PDFWorker}});Object.defineProperty(r,"version",{enumerable:!0,get:function get(){return i.version}});Object.defineProperty(r,"CMapCompressionType",{enumerable:!0,get:function get(){return l.CMapCompressionType}});Object.defineProperty(r,"createObjectURL",{enumerable:!0,get:function get(){return l.createObjectURL}});Object.defineProperty(r,"createPromiseCapability",{enumerable:!0,get:function get(){return l.createPromiseCapability}});Object.defineProperty(r,"createValidAbsoluteUrl",{enumerable:!0,get:function get(){return l.createValidAbsoluteUrl}});Object.defineProperty(r,"InvalidPDFException",{enumerable:!0,get:function get(){return l.InvalidPDFException}});Object.defineProperty(r,"MissingPDFException",{enumerable:!0,get:function get(){return l.MissingPDFException}});Object.defineProperty(r,"OPS",{enumerable:!0,get:function get(){return l.OPS}});Object.defineProperty(r,"PasswordResponses",{enumerable:!0,get:function get(){return l.PasswordResponses}});Object.defineProperty(r,"PermissionFlag",{enumerable:!0,get:function get(){return l.PermissionFlag}});Object.defineProperty(r,"removeNullCharacters",{enumerable:!0,get:function get(){return l.removeNullCharacters}});Object.defineProperty(r,"shadow",{enumerable:!0,get:function get(){return l.shadow}});Object.defineProperty(r,"UnexpectedResponseException",{enumerable:!0,get:function get(){return l.UnexpectedResponseException}});Object.defineProperty(r,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function get(){return l.UNSUPPORTED_FEATURES}});Object.defineProperty(r,"Util",{enumerable:!0,get:function get(){return l.Util}});Object.defineProperty(r,"VerbosityLevel",{enumerable:!0,get:function get(){return l.VerbosityLevel}});Object.defineProperty(r,"AnnotationLayer",{enumerable:!0,get:function get(){return u.AnnotationLayer}});Object.defineProperty(r,"apiCompatibilityParams",{enumerable:!0,get:function get(){return c.apiCompatibilityParams}});Object.defineProperty(r,"GlobalWorkerOptions",{enumerable:!0,get:function get(){return d.GlobalWorkerOptions}});Object.defineProperty(r,"renderTextLayer",{enumerable:!0,get:function get(){return h.renderTextLayer}});Object.defineProperty(r,"SVGGraphics",{enumerable:!0,get:function get(){return p.SVGGraphics}});var o=a(1),i=a(135),l=a(4),u=a(149),c=a(139),d=a(142),h=a(151),p=a(152);if(a(6).isNodeJS){var m=a(153).PDFNodeStream;(0,i.setPDFNetworkStreamFactory)((function(t){return new m(t)}))}else{var v,g=a(156).PDFNetworkStream;(0,o.isFetchSupported)()&&(v=a(157).PDFFetchStream);(0,i.setPDFNetworkStreamFactory)((function(t){return v&&(0,o.isValidFetchUrl)(t.url)?new v(t):new g(t)}))}},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.addLinkAttributes=function addLinkAttributes(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.url,o=r.target,u=r.rel,c=r.enabled,d=void 0===c||c;(0,i.assert)(a&&"string"==typeof a,'addLinkAttributes: A valid "url" parameter must provided.');var h=(0,i.removeNullCharacters)(a);if(d)t.href=t.title=h;else{t.href="";t.title="Disabled: ".concat(h);t.onclick=function(){return!1}}var p="";switch(o){case y.NONE:break;case y.SELF:p="_self";break;case y.BLANK:p="_blank";break;case y.PARENT:p="_parent";break;case y.TOP:p="_top"}t.target=p;t.rel="string"==typeof u?u:l};r.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};r.getFilenameFromUrl=function getFilenameFromUrl(t){var r=t.indexOf("#"),a=t.indexOf("?"),o=Math.min(r>0?r:t.length,a>0?a:t.length);return t.substring(t.lastIndexOf("/",o)+1,o)};r.isFetchSupported=isFetchSupported;r.isValidFetchUrl=isValidFetchUrl;r.loadScript=function loadScript(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(a,o){var i=document.createElement("script");i.src=t;i.onload=function(t){r&&i.remove();a(t)};i.onerror=function(){o(new Error("Cannot load script at: ".concat(i.src)))};(document.head||document.documentElement).appendChild(i)}))};r.StatTimer=r.RenderingCancelledException=r.PDFDateString=r.PageViewport=r.LinkTarget=r.DOMSVGFactory=r.DOMCMapReaderFactory=r.DOMCanvasFactory=r.DEFAULT_LINK_REL=r.BaseCMapReaderFactory=r.BaseCanvasFactory=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4);function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var l="noopener noreferrer nofollow";r.DEFAULT_LINK_REL=l;var u="http://www.w3.org/2000/svg",c=function(){function BaseCanvasFactory(){_classCallCheck(this,BaseCanvasFactory);this.constructor===BaseCanvasFactory&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}_createClass(BaseCanvasFactory,[{key:"create",value:function create(t,r){(0,i.unreachable)("Abstract method `create` called.")}},{key:"reset",value:function reset(t,r,a){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||a<=0)throw new Error("Invalid canvas size");t.canvas.width=r;t.canvas.height=a}},{key:"destroy",value:function destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}}]);return BaseCanvasFactory}();r.BaseCanvasFactory=c;var d=function(t){_inherits(DOMCanvasFactory,t);var r=_createSuper(DOMCanvasFactory);function DOMCanvasFactory(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=a.ownerDocument,i=void 0===o?globalThis.document:o;_classCallCheck(this,DOMCanvasFactory);(t=r.call(this))._document=i;return t}_createClass(DOMCanvasFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");var a=this._document.createElement("canvas"),o=a.getContext("2d");a.width=t;a.height=r;return{canvas:a,context:o}}}]);return DOMCanvasFactory}(c);r.DOMCanvasFactory=d;var h=function(){function BaseCMapReaderFactory(t){var r=t.baseUrl,a=void 0===r?null:r,o=t.isCompressed,l=void 0!==o&&o;_classCallCheck(this,BaseCMapReaderFactory);this.constructor===BaseCMapReaderFactory&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=a;this.isCompressed=l}_createClass(BaseCMapReaderFactory,[{key:"fetch",value:(t=_asyncToGenerator(o.default.mark((function _callee(t){var r,a,l,u=this;return o.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:r=t.name;if(this.baseUrl){o.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(r){o.next=5;break}throw new Error("CMap name must be specified.");case 5:a=this.baseUrl+r+(this.isCompressed?".bcmap":"");l=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return o.abrupt("return",this._fetchData(a,l).catch((function(t){throw new Error("Unable to load ".concat(u.isCompressed?"binary ":"","CMap at: ").concat(a))})));case 8:case"end":return o.stop()}}),_callee,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t,r){(0,i.unreachable)("Abstract method `_fetchData` called.")}}]);var t;return BaseCMapReaderFactory}();r.BaseCMapReaderFactory=h;var p=function(t){_inherits(DOMCMapReaderFactory,t);var r=_createSuper(DOMCMapReaderFactory);function DOMCMapReaderFactory(){_classCallCheck(this,DOMCMapReaderFactory);return r.apply(this,arguments)}_createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){var a=this;return isFetchSupported()&&isValidFetchUrl(t,document.baseURI)?fetch(t).then(function(){var t=_asyncToGenerator(o.default.mark((function _callee2(t){var l;return o.default.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:if(t.ok){o.next=2;break}throw new Error(t.statusText);case 2:if(!a.isCompressed){o.next=10;break}o.t0=Uint8Array;o.next=6;return t.arrayBuffer();case 6:o.t1=o.sent;l=new o.t0(o.t1);o.next=15;break;case 10:o.t2=i.stringToBytes;o.next=13;return t.text();case 13:o.t3=o.sent;l=(0,o.t2)(o.t3);case 15:return o.abrupt("return",{cMapData:l,compressionType:r});case 16:case"end":return o.stop()}}),_callee2)})));return function(r){return t.apply(this,arguments)}}()):new Promise((function(o,l){var u=new XMLHttpRequest;u.open("GET",t,!0);a.isCompressed&&(u.responseType="arraybuffer");u.onreadystatechange=function(){if(u.readyState===XMLHttpRequest.DONE){if(200===u.status||0===u.status){var t;a.isCompressed&&u.response?t=new Uint8Array(u.response):!a.isCompressed&&u.responseText&&(t=(0,i.stringToBytes)(u.responseText));if(t){o({cMapData:t,compressionType:r});return}}l(new Error(u.statusText))}};u.send(null)}))}}]);return DOMCMapReaderFactory}(h);r.DOMCMapReaderFactory=p;var m=function(){function DOMSVGFactory(){_classCallCheck(this,DOMSVGFactory)}_createClass(DOMSVGFactory,[{key:"create",value:function create(t,r){(0,i.assert)(t>0&&r>0,"Invalid SVG dimensions");var a=document.createElementNS(u,"svg:svg");a.setAttribute("version","1.1");a.setAttribute("width",t+"px");a.setAttribute("height",r+"px");a.setAttribute("preserveAspectRatio","none");a.setAttribute("viewBox","0 0 "+t+" "+r);return a}},{key:"createElement",value:function createElement(t){(0,i.assert)("string"==typeof t,"Invalid SVG element type");return document.createElementNS(u,t)}}]);return DOMSVGFactory}();r.DOMSVGFactory=m;var v=function(){function PageViewport(t){var r=t.viewBox,a=t.scale,o=t.rotation,i=t.offsetX,l=void 0===i?0:i,u=t.offsetY,c=void 0===u?0:u,d=t.dontFlip,h=void 0!==d&&d;_classCallCheck(this,PageViewport);this.viewBox=r;this.scale=a;this.rotation=o;this.offsetX=l;this.offsetY=c;var p,m,v,g,y,b,_,S,C=(r[2]+r[0])/2,A=(r[3]+r[1])/2;switch(o=(o%=360)<0?o+360:o){case 180:p=-1;m=0;v=0;g=1;break;case 90:p=0;m=1;v=1;g=0;break;case 270:p=0;m=-1;v=-1;g=0;break;case 0:p=1;m=0;v=0;g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(h){v=-v;g=-g}if(0===p){y=Math.abs(A-r[1])*a+l;b=Math.abs(C-r[0])*a+c;_=Math.abs(r[3]-r[1])*a;S=Math.abs(r[2]-r[0])*a}else{y=Math.abs(C-r[0])*a+l;b=Math.abs(A-r[1])*a+c;_=Math.abs(r[2]-r[0])*a;S=Math.abs(r[3]-r[1])*a}this.transform=[p*a,m*a,v*a,g*a,y-p*a*C-v*a*A,b-m*a*C-g*a*A];this.width=_;this.height=S}_createClass(PageViewport,[{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=void 0===r?this.scale:r,o=t.rotation,i=void 0===o?this.rotation:o,l=t.offsetX,u=void 0===l?this.offsetX:l,c=t.offsetY,d=void 0===c?this.offsetY:c,h=t.dontFlip,p=void 0!==h&&h;return new PageViewport({viewBox:this.viewBox.slice(),scale:a,rotation:i,offsetX:u,offsetY:d,dontFlip:p})}},{key:"convertToViewportPoint",value:function convertToViewportPoint(t,r){return i.Util.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function convertToViewportRectangle(t){var r=i.Util.applyTransform([t[0],t[1]],this.transform),a=i.Util.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],a[0],a[1]]}},{key:"convertToPdfPoint",value:function convertToPdfPoint(t,r){return i.Util.applyInverseTransform([t,r],this.transform)}}]);return PageViewport}();r.PageViewport=v;var g=function(t){_inherits(RenderingCancelledException,t);var r=_createSuper(RenderingCancelledException);function RenderingCancelledException(t,a){var o;_classCallCheck(this,RenderingCancelledException);(o=r.call(this,t)).type=a;return o}return RenderingCancelledException}(i.BaseException);r.RenderingCancelledException=g;var y={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};r.LinkTarget=y;var b,_=function(){function StatTimer(){_classCallCheck(this,StatTimer);this.started=Object.create(null);this.times=[]}_createClass(StatTimer,[{key:"time",value:function time(t){t in this.started&&(0,i.warn)("Timer is already running for ".concat(t));this.started[t]=Date.now()}},{key:"timeEnd",value:function timeEnd(t){t in this.started||(0,i.warn)("Timer has not been started for ".concat(t));this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}},{key:"toString",value:function toString(){var t,r=[],a=0,o=_createForOfIteratorHelper(this.times);try{for(o.s();!(t=o.n()).done;){var i=t.value.name;i.length>a&&(a=i.length)}}catch(t){o.e(t)}finally{o.f()}var l,u=_createForOfIteratorHelper(this.times);try{for(u.s();!(l=u.n()).done;){var c=l.value,d=c.end-c.start;r.push("".concat(c.name.padEnd(a)," ").concat(d,"ms\n"))}}catch(t){u.e(t)}finally{u.f()}return r.join("")}}]);return StatTimer}();r.StatTimer=_;function isFetchSupported(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&"undefined"!=typeof ReadableStream}function isValidFetchUrl(t,r){try{var a=(r?new URL(t,r):new URL(t)).protocol;return"http:"===a||"https:"===a}catch(t){return!1}}var S=function(){function PDFDateString(){_classCallCheck(this,PDFDateString)}_createClass(PDFDateString,null,[{key:"toDateObject",value:function toDateObject(t){if(!t||!(0,i.isString)(t))return null;b||(b=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var r=b.exec(t);if(!r)return null;var a=parseInt(r[1],10),o=parseInt(r[2],10);o=o>=1&&o<=12?o-1:0;var l=parseInt(r[3],10);l=l>=1&&l<=31?l:1;var u=parseInt(r[4],10);u=u>=0&&u<=23?u:0;var c=parseInt(r[5],10);c=c>=0&&c<=59?c:0;var d=parseInt(r[6],10);d=d>=0&&d<=59?d:0;var h=r[7]||"Z",p=parseInt(r[8],10);p=p>=0&&p<=23?p:0;var m=parseInt(r[9],10)||0;m=m>=0&&m<=59?m:0;if("-"===h){u+=p;c+=m}else if("+"===h){u-=p;c-=m}return new Date(Date.UTC(a,o,l,u,c,d))}}]);return PDFDateString}();r.PDFDateString=S},(t,r,a)=>{"use strict";t.exports=a(3)},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=function(t){var r,a=Object.prototype,o=a.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function define(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0});return t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,o){var i=r&&r.prototype instanceof Generator?r:Generator,l=Object.create(i.prototype),u=new Context(o||[]);l._invoke=function makeInvokeMethod(t,r,a){var o=d;return function invoke(i,l){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw l;return doneResult()}a.method=i;a.arg=l;for(;;){var u=a.delegate;if(u){var c=maybeInvokeDelegate(u,a);if(c){if(c===v)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===d){o=m;throw a.arg}a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=p;var g=tryCatch(t,r,a);if("normal"===g.type){o=a.done?m:h;if(g.arg===v)continue;return{value:g.arg,done:a.done}}if("throw"===g.type){o=m;a.method="throw";a.arg=g.arg}}}}(t,a,u);return l}t.wrap=wrap;function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};g[l]=function(){return this};var y=Object.getPrototypeOf,b=y&&y(y(values([])));b&&b!==a&&o.call(b,l)&&(g=b);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);GeneratorFunction.prototype=_.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction");function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))};t.mark=function(t){if(Object.setPrototypeOf)Object.setPrototypeOf(t,GeneratorFunctionPrototype);else{t.__proto__=GeneratorFunctionPrototype;define(t,c,"GeneratorFunction")}t.prototype=Object.create(_);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,r){function invoke(a,i,l,u){var c=tryCatch(t[a],t,i);if("throw"!==c.type){var d=c.arg,h=d.value;return h&&"object"===_typeof(h)&&o.call(h,"__await")?r.resolve(h.__await).then((function(t){invoke("next",t,l,u)}),(function(t){invoke("throw",t,l,u)})):r.resolve(h).then((function(t){d.value=t;l(d)}),(function(t){return invoke("throw",t,l,u)}))}u(c.arg)}var a;this._invoke=function enqueue(t,o){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,o,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}defineIteratorMethods(AsyncIterator.prototype);AsyncIterator.prototype[u]=function(){return this};t.AsyncIterator=AsyncIterator;t.async=function(r,a,o,i,l){void 0===l&&(l=Promise);var u=new AsyncIterator(wrap(r,a,o,i),l);return t.isGeneratorFunction(a)?u:u.next().then((function(t){return t.done?t.value:u.next()}))};function maybeInvokeDelegate(t,a){var o=t.iterator[a.method];if(o===r){a.delegate=null;if("throw"===a.method){if(t.iterator.return){a.method="return";a.arg=r;maybeInvokeDelegate(t,a);if("throw"===a.method)return v}a.method="throw";a.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=tryCatch(o,t.iterator,a.arg);if("throw"===i.type){a.method="throw";a.arg=i.arg;a.delegate=null;return v}var l=i.arg;if(!l){a.method="throw";a.arg=new TypeError("iterator result is not an object");a.delegate=null;return v}if(!l.done)return l;a[t.resultName]=l.value;a.next=t.nextLoc;if("return"!==a.method){a.method="next";a.arg=r}a.delegate=null;return v}defineIteratorMethods(_);define(_,c,"Generator");_[l]=function(){return this};_.toString=function(){return"[object Generator]"};function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]);if(2 in t){r.finallyLoc=t[2];r.afterLoc=t[3]}this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal";delete r.arg;t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(!0)}t.keys=function(t){var r=[];for(var a in t)r.push(a);r.reverse();return function next(){for(;r.length;){var a=r.pop();if(a in t){next.value=a;next.done=!1;return next}}next.done=!0;return next}};function values(t){if(t){var a=t[l];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,u=function next(){for(;++i<t.length;)if(o.call(t,i)){next.value=t[i];next.done=!1;return next}next.value=r;next.done=!0;return next};return u.next=u}}return{next:doneResult}}t.values=values;function doneResult(){return{value:r,done:!0}}Context.prototype={constructor:Context,reset:function reset(t){this.prev=0;this.next=0;this.sent=this._sent=r;this.done=!1;this.delegate=null;this.method="next";this.arg=r;this.tryEntries.forEach(resetTryEntry);if(!t)for(var a in this)"t"===a.charAt(0)&&o.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=r)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(o,i){u.type="throw";u.arg=t;a.next=o;if(i){a.method="next";a.arg=r}return!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],u=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var c=o.call(l,"catchLoc"),d=o.call(l,"finallyLoc");if(c&&d){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(c){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var l=i;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var u=l?l.completion:{};u.type=t;u.arg=r;if(l){this.method="next";this.next=l.finallyLoc;return v}return this.complete(u)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;if("break"===t.type||"continue"===t.type)this.next=t.arg;else if("return"===t.type){this.rval=this.arg=t.arg;this.method="return";this.next="end"}else"normal"===t.type&&r&&(this.next=r);return v},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t){this.complete(a.completion,a.afterLoc);resetTryEntry(a);return v}}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var o=a.completion;if("throw"===o.type){var i=o.arg;resetTryEntry(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,o){this.delegate={iterator:values(t),resultName:a,nextLoc:o};"next"===this.method&&(this.arg=r);return v}};return t}("object"===_typeof(t=a.nmd(t))?t.exports:{});try{regeneratorRuntime=o}catch(t){Function("r","regeneratorRuntime = r")(o)}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var a=0,o=0;o<r;o++)a+=arrayByteLength(t[o]);for(var i=0,l=new Uint8Array(a),u=0;u<r;u++){var c=t[u];c instanceof Uint8Array||(c="string"==typeof c?stringToBytes(c):new Uint8Array(c));var d=c.byteLength;l.set(c,i);i+=d}return l};r.assert=assert;r.bytesToString=function bytesToString(t){assert(null!==t&&"object"===_typeof(t)&&void 0!==t.length,"Invalid argument for bytesToString");var r=t.length,a=8192;if(r<a)return String.fromCharCode.apply(null,t);for(var o=[],i=0;i<r;i+=a){var l=Math.min(i+a,r),u=t.subarray(i,l);o.push(String.fromCharCode.apply(null,u))}return o.join("")};r.createPromiseCapability=function createPromiseCapability(){var t=Object.create(null),r=!1;Object.defineProperty(t,"settled",{get:function get(){return r}});t.promise=new Promise((function(a,o){t.resolve=function(t){r=!0;a(t)};t.reject=function(t){r=!0;o(t)}}));return t};r.createValidAbsoluteUrl=function createValidAbsoluteUrl(t,r){if(!t)return null;try{var a=r?new URL(t,r):new URL(t);if(function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch(t){}return null};r.encodeToXmlString=function encodeToXmlString(t){for(var r=[],a=0,o=0,i=t.length;o<i;o++){var l=t.codePointAt(o);if(32<=l&&l<=126){var u=R[l];if(u){a<o&&r.push(t.substring(a,o));r.push(u);a=o+1}}else{a<o&&r.push(t.substring(a,o));r.push("&#x".concat(l.toString(16).toUpperCase(),";"));l>55295&&(l<57344||l>65533)&&o++;a=o+1}}if(0===r.length)return t;a<t.length&&r.push(t.substring(a,t.length));return r.join("")};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return i};r.info=function info(t){i>=o.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;return t.every((function(t,a){return t===r[a]}))};r.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};r.isBool=function isBool(t){return"boolean"==typeof t};r.isNum=function isNum(t){return"number"==typeof t};r.isSameOrigin=function isSameOrigin(t,r){var a;try{if(!(a=new URL(t)).origin||"null"===a.origin)return!1}catch(t){return!1}var o=new URL(r,a);return a.origin===o.origin};r.isString=function isString(t){return"string"==typeof t};r.objectFromEntries=function objectFromEntries(t){return Object.assign(Object.create(null),Object.fromEntries(t))};r.objectSize=function objectSize(t){return Object.keys(t).length};r.removeNullCharacters=function removeNullCharacters(t){if("string"!=typeof t){warn("The argument for removeNullCharacters must be a string.");return t}return t.replace(g,"")};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(i=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){var r=t.length,a=[];if("þ"===t[0]&&"ÿ"===t[1])for(var o=2;o<r;o+=2)a.push(String.fromCharCode(t.charCodeAt(o)<<8|t.charCodeAt(o+1)));else if("ÿ"===t[0]&&"þ"===t[1])for(var i=2;i<r;i+=2)a.push(String.fromCharCode(t.charCodeAt(i+1)<<8|t.charCodeAt(i)));else for(var l=0;l<r;++l){var u=C[t.charCodeAt(l)];a.push(u?String.fromCharCode(u):t.charAt(l))}return a.join("")};r.stringToUTF16BEString=function stringToUTF16BEString(t){for(var r=["þÿ"],a=0,o=t.length;a<o;a++){var i=t.charCodeAt(a);r.push(String.fromCharCode(i>>8&255));r.push(String.fromCharCode(255&i))}return r.join("")};r.stringToUTF8String=function stringToUTF8String(t){return decodeURIComponent(escape(t))};r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;r.VerbosityLevel=r.Util=r.UNSUPPORTED_FEATURES=r.UnknownErrorException=r.UnexpectedResponseException=r.TextRenderingMode=r.StreamType=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.createObjectURL=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;a(5);function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r.IDENTITY_MATRIX=[1,0,0,1,0,0];r.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];r.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};r.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReplyType={GROUP:"Group",REPLY:"R"};r.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.PageActionEventType={O:"PageOpen",C:"PageClose"};r.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};var o={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=o;r.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};r.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent"};r.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var i=o.WARNINGS;function warn(t){i>=o.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function assert(t,r){t||unreachable(r)}function shadow(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!1});return a}var l=function BaseExceptionClosure(){function BaseException(t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=this.constructor.name}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=l;var u=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,a){var o;_classCallCheck(this,PasswordException);(o=r.call(this,t)).code=a;return o}return PasswordException}(l);r.PasswordException=u;var c=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,a){var o;_classCallCheck(this,UnknownErrorException);(o=r.call(this,t)).details=a;return o}return UnknownErrorException}(l);r.UnknownErrorException=c;var d=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(){_classCallCheck(this,InvalidPDFException);return r.apply(this,arguments)}return InvalidPDFException}(l);r.InvalidPDFException=d;var h=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(){_classCallCheck(this,MissingPDFException);return r.apply(this,arguments)}return MissingPDFException}(l);r.MissingPDFException=h;var p=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,a){var o;_classCallCheck(this,UnexpectedResponseException);(o=r.call(this,t)).status=a;return o}return UnexpectedResponseException}(l);r.UnexpectedResponseException=p;var m=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(){_classCallCheck(this,FormatError);return r.apply(this,arguments)}return FormatError}(l);r.FormatError=m;var v=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(){_classCallCheck(this,AbortException);return r.apply(this,arguments)}return AbortException}(l);r.AbortException=v;var g=/\x00/g;function stringToBytes(t){assert("string"==typeof t,"Invalid argument for stringToBytes");for(var r=t.length,a=new Uint8Array(r),o=0;o<r;++o)a[o]=255&t.charCodeAt(o);return a}function arrayByteLength(t){if(void 0!==t.length)return t.length;assert(void 0!==t.byteLength,"arrayByteLength - invalid argument.");return t.byteLength}var y={get value(){return shadow(this,"value",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}};r.IsLittleEndianCached=y;var b={get value(){return shadow(this,"value",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}};r.IsEvalSupportedCached=b;var _=function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),S=function(){function Util(){_classCallCheck(this,Util)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,a){return"#".concat(_[t]).concat(_[r]).concat(_[a])}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var a=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/a,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/a]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var a=Util.applyTransform(t,r),o=Util.applyTransform(t.slice(2,4),r),i=Util.applyTransform([t[0],t[3]],r),l=Util.applyTransform([t[2],t[1]],r);return[Math.min(a[0],o[0],i[0],l[0]),Math.min(a[1],o[1],i[1],l[1]),Math.max(a[0],o[0],i[0],l[0]),Math.max(a[1],o[1],i[1],l[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"apply3dTransform",value:function apply3dTransform(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],a=t[0]*r[0]+t[1]*r[2],o=t[0]*r[1]+t[1]*r[3],i=t[2]*r[0]+t[3]*r[2],l=t[2]*r[1]+t[3]*r[3],u=(a+l)/2,c=Math.sqrt((a+l)*(a+l)-4*(a*l-i*o))/2,d=u+c||1,h=u-c||1;return[Math.sqrt(d),Math.sqrt(h)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){function compare(t,r){return t-r}var a=[t[0],t[2],r[0],r[2]].sort(compare),o=[t[1],t[3],r[1],r[3]].sort(compare),i=[];t=Util.normalizeRect(t);r=Util.normalizeRect(r);if(!(a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]))return null;i[0]=a[1];i[2]=a[2];if(!(o[0]===t[1]&&o[1]===r[1]||o[0]===r[1]&&o[1]===t[1]))return null;i[1]=o[1];i[3]=o[2];return i}}]);return Util}();r.Util=S;var C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,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,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];var A=function createObjectURLClosure(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function createObjectURL(r,a){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!o&&URL.createObjectURL){var i=new Blob([r],{type:a});return URL.createObjectURL(i)}for(var l="data:".concat(a,";base64,"),u=0,c=r.length;u<c;u+=3){var d=255&r[u],h=255&r[u+1],p=255&r[u+2],m=d>>2,v=(3&d)<<4|h>>4,g=u+1<c?(15&h)<<2|p>>6:64,y=u+2<c?63&p:64;l+=t[m]+t[v]+t[g]+t[y]}return l}}();r.createObjectURL=A;var R={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"}},(t,r,a)=>{"use strict";var o=a(6);if("undefined"==typeof globalThis||!globalThis._pdfjsCompatibilityChecked){"undefined"!=typeof globalThis&&globalThis.Math===Math||(globalThis=a(7));globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&o.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&o.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkObjectFromEntries(){Object.fromEntries||a(52)}();!function checkPromise(){globalThis.Promise.allSettled||(globalThis.Promise=a(82))}();!function checkURL(){globalThis.URL=a(111)}();!function checkReadableStream(){var t=!1;if("undefined"!=typeof ReadableStream)try{new ReadableStream({start:function start(t){t.close()}});t=!0}catch(t){}t||(globalThis.ReadableStream=a(121).ReadableStream)}();!function checkStringPadStart(){String.prototype.padStart||a(122)}();!function checkStringPadEnd(){String.prototype.padEnd||a(128)}();!function checkObjectValues(){Object.values||(Object.values=a(130))}();!function checkObjectEntries(){Object.entries||(Object.entries=a(133))}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=a},(t,r,a)=>{a(8);t.exports=a(10)},(t,r,a)=>{a(9)({global:!0},{globalThis:a(10)})},(t,r,a)=>{var o=a(10),i=a(11).f,l=a(25),u=a(28),c=a(29),d=a(39),h=a(51);t.exports=function(t,r){var a,p,m,v,g,y=t.target,b=t.global,_=t.stat;if(a=b?o:_?o[y]||c(y,{}):(o[y]||{}).prototype)for(p in r){v=r[p];m=t.noTargetGet?(g=i(a,p))&&g.value:a[p];if(!h(b?p:y+(_?".":"#")+p,t.forced)&&void 0!==m){if(typeof v==typeof m)continue;d(v,m)}(t.sham||m&&m.sham)&&l(v,"sham",!0);u(a,p,v,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,a)=>{var o=a(12),i=a(14),l=a(15),u=a(16),c=a(20),d=a(22),h=a(23),p=Object.getOwnPropertyDescriptor;r.f=o?p:function getOwnPropertyDescriptor(t,r){t=u(t);r=c(r,!0);if(h)try{return p(t,r)}catch(t){}if(d(t,r))return l(!i.f.call(t,r),t[r])}},(t,r,a)=>{var o=a(13);t.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,r)=>{"use strict";var a={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!a.call({1:2},1);r.f=i?function propertyIsEnumerable(t){var r=o(this,t);return!!r&&r.enumerable}:a},t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},(t,r,a)=>{var o=a(17),i=a(19);t.exports=function(t){return o(i(t))}},(t,r,a)=>{var o=a(13),i=a(18),l="".split;t.exports=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?l.call(t,""):Object(t)}:Object},t=>{var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},(t,r,a)=>{var o=a(21);t.exports=function(t,r){if(!o(t))return t;var a,i;if(r&&"function"==typeof(a=t.toString)&&!o(i=a.call(t)))return i;if("function"==typeof(a=t.valueOf)&&!o(i=a.call(t)))return i;if(!r&&"function"==typeof(a=t.toString)&&!o(i=a.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},t=>{var r={}.hasOwnProperty;t.exports=function(t,a){return r.call(t,a)}},(t,r,a)=>{var o=a(12),i=a(13),l=a(24);t.exports=!o&&!i((function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}))},(t,r,a)=>{var o=a(10),i=a(21),l=o.document,u=i(l)&&i(l.createElement);t.exports=function(t){return u?l.createElement(t):{}}},(t,r,a)=>{var o=a(12),i=a(26),l=a(15);t.exports=o?function(t,r,a){return i.f(t,r,l(1,a))}:function(t,r,a){t[r]=a;return t}},(t,r,a)=>{var o=a(12),i=a(23),l=a(27),u=a(20),c=Object.defineProperty;r.f=o?c:function defineProperty(t,r,a){l(t);r=u(r,!0);l(a);if(i)try{return c(t,r,a)}catch(t){}if("get"in a||"set"in a)throw TypeError("Accessors not supported");"value"in a&&(t[r]=a.value);return t}},(t,r,a)=>{var o=a(21);t.exports=function(t){if(!o(t))throw TypeError(String(t)+" is not an object");return t}},(t,r,a)=>{var o=a(10),i=a(25),l=a(22),u=a(29),c=a(30),d=a(32),h=d.get,p=d.enforce,m=String(String).split("String");(t.exports=function(t,r,a,c){var d,h=!!c&&!!c.unsafe,v=!!c&&!!c.enumerable,g=!!c&&!!c.noTargetGet;if("function"==typeof a){"string"!=typeof r||l(a,"name")||i(a,"name",r);(d=p(a)).source||(d.source=m.join("string"==typeof r?r:""))}if(t!==o){h?!g&&t[r]&&(v=!0):delete t[r];v?t[r]=a:i(t,r,a)}else v?t[r]=a:u(r,a)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&h(this).source||c(this)}))},(t,r,a)=>{var o=a(10),i=a(25);t.exports=function(t,r){try{i(o,t,r)}catch(a){o[t]=r}return r}},(t,r,a)=>{var o=a(31),i=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(t){return i.call(t)});t.exports=o.inspectSource},(t,r,a)=>{var o=a(10),i=a(29),l="__core-js_shared__",u=o[l]||i(l,{});t.exports=u},(t,r,a)=>{var o,i,l,u=a(33),c=a(10),d=a(21),h=a(25),p=a(22),m=a(31),v=a(34),g=a(38),y=c.WeakMap;if(u){var b=m.state||(m.state=new y),_=b.get,S=b.has,C=b.set;o=function(t,r){r.facade=t;C.call(b,t,r);return r};i=function(t){return _.call(b,t)||{}};l=function(t){return S.call(b,t)}}else{var A=v("state");g[A]=!0;o=function(t,r){r.facade=t;h(t,A,r);return r};i=function(t){return p(t,A)?t[A]:{}};l=function(t){return p(t,A)}}t.exports={set:o,get:i,has:l,enforce:function(t){return l(t)?i(t):o(t,{})},getterFor:function(t){return function(r){var a;if(!d(r)||(a=i(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return a}}}},(t,r,a)=>{var o=a(10),i=a(30),l=o.WeakMap;t.exports="function"==typeof l&&/native code/.test(i(l))},(t,r,a)=>{var o=a(35),i=a(37),l=o("keys");t.exports=function(t){return l[t]||(l[t]=i(t))}},(t,r,a)=>{var o=a(36),i=a(31);(t.exports=function(t,r){return i[t]||(i[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.8.3",mode:o?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},t=>{t.exports=!1},t=>{var r=0,a=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+a).toString(36)}},t=>{t.exports={}},(t,r,a)=>{var o=a(22),i=a(40),l=a(11),u=a(26);t.exports=function(t,r){for(var a=i(r),c=u.f,d=l.f,h=0;h<a.length;h++){var p=a[h];o(t,p)||c(t,p,d(r,p))}}},(t,r,a)=>{var o=a(41),i=a(43),l=a(50),u=a(27);t.exports=o("Reflect","ownKeys")||function ownKeys(t){var r=i.f(u(t)),a=l.f;return a?r.concat(a(t)):r}},(t,r,a)=>{var o=a(42),i=a(10),aFunction=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,r){return arguments.length<2?aFunction(o[t])||aFunction(i[t]):o[t]&&o[t][r]||i[t]&&i[t][r]}},(t,r,a)=>{var o=a(10);t.exports=o},(t,r,a)=>{var o=a(44),i=a(49).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return o(t,i)}},(t,r,a)=>{var o=a(22),i=a(16),l=a(45).indexOf,u=a(38);t.exports=function(t,r){var a,c=i(t),d=0,h=[];for(a in c)!o(u,a)&&o(c,a)&&h.push(a);for(;r.length>d;)o(c,a=r[d++])&&(~l(h,a)||h.push(a));return h}},(t,r,a)=>{var o=a(16),i=a(46),l=a(48),createMethod=function(t){return function(r,a,u){var c,d=o(r),h=i(d.length),p=l(u,h);if(t&&a!=a){for(;h>p;)if((c=d[p++])!=c)return!0}else for(;h>p;p++)if((t||p in d)&&d[p]===a)return t||p||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,r,a)=>{var o=a(47),i=Math.min;t.exports=function(t){return t>0?i(o(t),9007199254740991):0}},t=>{var r=Math.ceil,a=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?a:r)(t)}},(t,r,a)=>{var o=a(47),i=Math.max,l=Math.min;t.exports=function(t,r){var a=o(t);return a<0?i(a+r,0):l(a,r)}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,r)=>{r.f=Object.getOwnPropertySymbols},(t,r,a)=>{var o=a(13),i=/#|\.prototype\./,isForced=function(t,r){var a=u[l(t)];return a==d||a!=c&&("function"==typeof r?o(r):!!r)},l=isForced.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=isForced.data={},c=isForced.NATIVE="N",d=isForced.POLYFILL="P";t.exports=isForced},(t,r,a)=>{a(53);a(72);var o=a(42);t.exports=o.Object.fromEntries},(t,r,a)=>{"use strict";var o=a(16),i=a(54),l=a(62),u=a(32),c=a(63),d="Array Iterator",h=u.set,p=u.getterFor(d);t.exports=c(Array,"Array",(function(t,r){h(this,{type:d,target:o(t),index:0,kind:r})}),(function(){var t=p(this),r=t.target,a=t.kind,o=t.index++;if(!r||o>=r.length){t.target=void 0;return{value:void 0,done:!0}}return"keys"==a?{value:o,done:!1}:"values"==a?{value:r[o],done:!1}:{value:[o,r[o]],done:!1}}),"values");l.Arguments=l.Array;i("keys");i("values");i("entries")},(t,r,a)=>{var o=a(55),i=a(58),l=a(26),u=o("unscopables"),c=Array.prototype;null==c[u]&&l.f(c,u,{configurable:!0,value:i(null)});t.exports=function(t){c[u][t]=!0}},(t,r,a)=>{var o=a(10),i=a(35),l=a(22),u=a(37),c=a(56),d=a(57),h=i("wks"),p=o.Symbol,m=d?p:p&&p.withoutSetter||u;t.exports=function(t){l(h,t)||(c&&l(p,t)?h[t]=p[t]:h[t]=m("Symbol."+t));return h[t]}},(t,r,a)=>{var o=a(13);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())}))},(t,r,a)=>{var o=a(56);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,r,a)=>{var o,i=a(27),l=a(59),u=a(49),c=a(38),d=a(61),h=a(24),p=a(34),m=p("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObject=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(t){}NullProtoObject=o?function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r}(o):function(){var t,r=h("iframe");r.style.display="none";d.appendChild(r);r.src=String("javascript:");(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}();for(var t=u.length;t--;)delete NullProtoObject.prototype[u[t]];return NullProtoObject()};c[m]=!0;t.exports=Object.create||function create(t,r){var a;if(null!==t){EmptyConstructor.prototype=i(t);a=new EmptyConstructor;EmptyConstructor.prototype=null;a[m]=t}else a=NullProtoObject();return void 0===r?a:l(a,r)}},(t,r,a)=>{var o=a(12),i=a(26),l=a(27),u=a(60);t.exports=o?Object.defineProperties:function defineProperties(t,r){l(t);for(var a,o=u(r),c=o.length,d=0;c>d;)i.f(t,a=o[d++],r[a]);return t}},(t,r,a)=>{var o=a(44),i=a(49);t.exports=Object.keys||function keys(t){return o(t,i)}},(t,r,a)=>{var o=a(41);t.exports=o("document","documentElement")},t=>{t.exports={}},(t,r,a)=>{"use strict";var o=a(9),i=a(64),l=a(66),u=a(70),c=a(69),d=a(25),h=a(28),p=a(55),m=a(36),v=a(62),g=a(65),y=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,_=p("iterator"),S="keys",C="values",A="entries",returnThis=function(){return this};t.exports=function(t,r,a,p,g,R,k){i(a,r,p);var P,w,x,getIterationMethod=function(t){if(t===g&&D)return D;if(!b&&t in O)return O[t];switch(t){case S:return function keys(){return new a(this,t)};case C:return function values(){return new a(this,t)};case A:return function entries(){return new a(this,t)}}return function(){return new a(this)}},T=r+" Iterator",E=!1,O=t.prototype,I=O[_]||O["@@iterator"]||g&&O[g],D=!b&&I||getIterationMethod(g),L="Array"==r&&O.entries||I;if(L){P=l(L.call(new t));if(y!==Object.prototype&&P.next){m||l(P)===y||(u?u(P,y):"function"!=typeof P[_]&&d(P,_,returnThis));c(P,T,!0,!0);m&&(v[T]=returnThis)}}if(g==C&&I&&I.name!==C){E=!0;D=function values(){return I.call(this)}}m&&!k||O[_]===D||d(O,_,D);v[r]=D;if(g){w={values:getIterationMethod(C),keys:R?D:getIterationMethod(S),entries:getIterationMethod(A)};if(k)for(x in w)(b||E||!(x in O))&&h(O,x,w[x]);else o({target:r,proto:!0,forced:b||E},w)}return w}},(t,r,a)=>{"use strict";var o=a(65).IteratorPrototype,i=a(58),l=a(15),u=a(69),c=a(62),returnThis=function(){return this};t.exports=function(t,r,a){var d=r+" Iterator";t.prototype=i(o,{next:l(1,a)});u(t,d,!1,!0);c[d]=returnThis;return t}},(t,r,a)=>{"use strict";var o,i,l,u=a(13),c=a(66),d=a(25),h=a(22),p=a(55),m=a(36),v=p("iterator"),g=!1;[].keys&&("next"in(l=[].keys())?(i=c(c(l)))!==Object.prototype&&(o=i):g=!0);var y=null==o||u((function(){var t={};return o[v].call(t)!==t}));y&&(o={});m&&!y||h(o,v)||d(o,v,(function(){return this}));t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:g}},(t,r,a)=>{var o=a(22),i=a(67),l=a(34),u=a(68),c=l("IE_PROTO"),d=Object.prototype;t.exports=u?Object.getPrototypeOf:function(t){t=i(t);return o(t,c)?t[c]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?d:null}},(t,r,a)=>{var o=a(19);t.exports=function(t){return Object(o(t))}},(t,r,a)=>{var o=a(13);t.exports=!o((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,r,a)=>{var o=a(26).f,i=a(22),l=a(55)("toStringTag");t.exports=function(t,r,a){t&&!i(t=a?t:t.prototype,l)&&o(t,l,{configurable:!0,value:r})}},(t,r,a)=>{var o=a(27),i=a(71);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,a={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(a,[]);r=a instanceof Array}catch(t){}return function setPrototypeOf(a,l){o(a);i(l);r?t.call(a,l):a.__proto__=l;return a}}():void 0)},(t,r,a)=>{var o=a(21);t.exports=function(t){if(!o(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},(t,r,a)=>{var o=a(9),i=a(73),l=a(81);o({target:"Object",stat:!0},{fromEntries:function fromEntries(t){var r={};i(t,(function(t,a){l(r,t,a)}),{AS_ENTRIES:!0});return r}})},(t,r,a)=>{var o=a(27),i=a(74),l=a(46),u=a(75),c=a(77),d=a(80),Result=function(t,r){this.stopped=t;this.result=r};t.exports=function(t,r,a){var h,p,m,v,g,y,b,_=a&&a.that,S=!(!a||!a.AS_ENTRIES),C=!(!a||!a.IS_ITERATOR),A=!(!a||!a.INTERRUPTED),R=u(r,_,1+S+A),stop=function(t){h&&d(h);return new Result(!0,t)},callFn=function(t){if(S){o(t);return A?R(t[0],t[1],stop):R(t[0],t[1])}return A?R(t,stop):R(t)};if(C)h=t;else{if("function"!=typeof(p=c(t)))throw TypeError("Target is not iterable");if(i(p)){for(m=0,v=l(t.length);v>m;m++)if((g=callFn(t[m]))&&g instanceof Result)return g;return new Result(!1)}h=p.call(t)}y=h.next;for(;!(b=y.call(h)).done;){try{g=callFn(b.value)}catch(t){d(h);throw t}if("object"==typeof g&&g&&g instanceof Result)return g}return new Result(!1)}},(t,r,a)=>{var o=a(55),i=a(62),l=o("iterator"),u=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||u[l]===t)}},(t,r,a)=>{var o=a(76);t.exports=function(t,r,a){o(t);if(void 0===r)return t;switch(a){case 0:return function(){return t.call(r)};case 1:return function(a){return t.call(r,a)};case 2:return function(a,o){return t.call(r,a,o)};case 3:return function(a,o,i){return t.call(r,a,o,i)}}return function(){return t.apply(r,arguments)}}},t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},(t,r,a)=>{var o=a(78),i=a(62),l=a(55)("iterator");t.exports=function(t){if(null!=t)return t[l]||t["@@iterator"]||i[o(t)]}},(t,r,a)=>{var o=a(79),i=a(18),l=a(55)("toStringTag"),u="Arguments"==i(function(){return arguments}());t.exports=o?i:function(t){var r,a,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),l))?a:u?i(r):"Object"==(o=i(r))&&"function"==typeof r.callee?"Arguments":o}},(t,r,a)=>{var o={};o[a(55)("toStringTag")]="z";t.exports="[object z]"===String(o)},(t,r,a)=>{var o=a(27);t.exports=function(t){var r=t.return;if(void 0!==r)return o(r.call(t)).value}},(t,r,a)=>{"use strict";var o=a(20),i=a(26),l=a(15);t.exports=function(t,r,a){var u=o(r);u in t?i.f(t,u,l(0,a)):t[u]=a}},(t,r,a)=>{a(83);a(84);a(86);a(104);a(105);a(106);a(107);a(109);var o=a(42);t.exports=o.Promise},(t,r,a)=>{"use strict";var o=a(9),i=a(66),l=a(70),u=a(58),c=a(25),d=a(15),h=a(73),p=function AggregateError(t,r){var a=this;if(!(a instanceof p))return new p(t,r);l&&(a=l(new Error(void 0),i(a)));void 0!==r&&c(a,"message",String(r));var o=[];h(t,o.push,{that:o});c(a,"errors",o);return a};p.prototype=u(Error.prototype,{constructor:d(5,p),message:d(5,""),name:d(5,"AggregateError")});o({global:!0},{AggregateError:p})},(t,r,a)=>{var o=a(79),i=a(28),l=a(85);o||i(Object.prototype,"toString",l,{unsafe:!0})},(t,r,a)=>{"use strict";var o=a(79),i=a(78);t.exports=o?{}.toString:function toString(){return"[object "+i(this)+"]"}},(t,r,a)=>{"use strict";var o,i,l,u,c=a(9),d=a(36),h=a(10),p=a(41),m=a(87),v=a(28),g=a(88),y=a(69),b=a(89),_=a(21),S=a(76),C=a(90),A=a(30),R=a(73),k=a(91),P=a(92),w=a(93).set,x=a(97),T=a(99),E=a(101),O=a(100),I=a(102),D=a(32),L=a(51),M=a(55),W=a(96),j=a(103),N=M("species"),B="Promise",q=D.get,G=D.set,U=D.getterFor(B),H=m,z=h.TypeError,V=h.document,Y=h.process,X=p("fetch"),Q=O.f,J=Q,K=!!(V&&V.createEvent&&h.dispatchEvent),$="function"==typeof PromiseRejectionEvent,Z="unhandledrejection",ee=L(B,(function(){if(!(A(H)!==String(H))){if(66===j)return!0;if(!W&&!$)return!0}if(d&&!H.prototype.finally)return!0;if(j>=51&&/native code/.test(H))return!1;var t=H.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};(t.constructor={})[N]=FakePromise;return!(t.then((function(){}))instanceof FakePromise)})),te=ee||!k((function(t){H.all(t).catch((function(){}))})),isThenable=function(t){var r;return!(!_(t)||"function"!=typeof(r=t.then))&&r},notify=function(t,r){if(!t.notified){t.notified=!0;var a=t.reactions;x((function(){for(var o=t.value,i=1==t.state,l=0;a.length>l;){var u,c,d,h=a[l++],p=i?h.ok:h.fail,m=h.resolve,v=h.reject,g=h.domain;try{if(p){if(!i){2===t.rejection&&onHandleUnhandled(t);t.rejection=1}if(!0===p)u=o;else{g&&g.enter();u=p(o);if(g){g.exit();d=!0}}u===h.promise?v(z("Promise-chain cycle")):(c=isThenable(u))?c.call(u,m,v):m(u)}else v(o)}catch(t){g&&!d&&g.exit();v(t)}}t.reactions=[];t.notified=!1;r&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,r,a){var o,i;if(K){(o=V.createEvent("Event")).promise=r;o.reason=a;o.initEvent(t,!1,!0);h.dispatchEvent(o)}else o={promise:r,reason:a};!$&&(i=h["on"+t])?i(o):t===Z&&E("Unhandled promise rejection",a)},onUnhandled=function(t){w.call(h,(function(){var r,a=t.facade,o=t.value;if(isUnhandled(t)){r=I((function(){W?Y.emit("unhandledRejection",o,a):dispatchEvent(Z,a,o)}));t.rejection=W||isUnhandled(t)?2:1;if(r.error)throw r.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){w.call(h,(function(){var r=t.facade;W?Y.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)}))},bind=function(t,r,a){return function(o){t(r,o,a)}},internalReject=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);t.value=r;t.state=2;notify(t,!0)}},internalResolve=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);try{if(t.facade===r)throw z("Promise can't be resolved itself");var o=isThenable(r);if(o)x((function(){var a={done:!1};try{o.call(r,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(r){internalReject(a,r,t)}}));else{t.value=r;t.state=1;notify(t,!1)}}catch(r){internalReject({done:!1},r,t)}}};if(ee){H=function Promise(t){C(this,H,B);S(t);o.call(this);var r=q(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(t){internalReject(r,t)}};(o=function Promise(t){G(this,{type:B,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=g(H.prototype,{then:function then(t,r){var a=U(this),o=Q(P(this,H));o.ok="function"!=typeof t||t;o.fail="function"==typeof r&&r;o.domain=W?Y.domain:void 0;a.parent=!0;a.reactions.push(o);0!=a.state&&notify(a,!1);return o.promise},catch:function(t){return this.then(void 0,t)}});i=function(){var t=new o,r=q(t);this.promise=t;this.resolve=bind(internalResolve,r);this.reject=bind(internalReject,r)};O.f=Q=function(t){return t===H||t===l?new i(t):J(t)};if(!d&&"function"==typeof m){u=m.prototype.then;v(m.prototype,"then",(function then(t,r){var a=this;return new H((function(t,r){u.call(a,t,r)})).then(t,r)}),{unsafe:!0});"function"==typeof X&&c({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return T(H,X.apply(h,arguments))}})}}c({global:!0,wrap:!0,forced:ee},{Promise:H});y(H,B,!1,!0);b(B);l=p(B);c({target:B,stat:!0,forced:ee},{reject:function reject(t){var r=Q(this);r.reject.call(void 0,t);return r.promise}});c({target:B,stat:!0,forced:d||ee},{resolve:function resolve(t){return T(d&&this===l?H:this,t)}});c({target:B,stat:!0,forced:te},{all:function all(t){var r=this,a=Q(r),o=a.resolve,i=a.reject,l=I((function(){var a=S(r.resolve),l=[],u=0,c=1;R(t,(function(t){var d=u++,h=!1;l.push(void 0);c++;a.call(r,t).then((function(t){if(!h){h=!0;l[d]=t;--c||o(l)}}),i)}));--c||o(l)}));l.error&&i(l.value);return a.promise},race:function race(t){var r=this,a=Q(r),o=a.reject,i=I((function(){var i=S(r.resolve);R(t,(function(t){i.call(r,t).then(a.resolve,o)}))}));i.error&&o(i.value);return a.promise}})},(t,r,a)=>{var o=a(10);t.exports=o.Promise},(t,r,a)=>{var o=a(28);t.exports=function(t,r,a){for(var i in r)o(t,i,r[i],a);return t}},(t,r,a)=>{"use strict";var o=a(41),i=a(26),l=a(55),u=a(12),c=l("species");t.exports=function(t){var r=o(t),a=i.f;u&&r&&!r[c]&&a(r,c,{configurable:!0,get:function(){return this}})}},t=>{t.exports=function(t,r,a){if(!(t instanceof r))throw TypeError("Incorrect "+(a?a+" ":"")+"invocation");return t}},(t,r,a)=>{var o=a(55)("iterator"),i=!1;try{var l=0,u={next:function(){return{done:!!l++}},return:function(){i=!0}};u[o]=function(){return this};Array.from(u,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!i)return!1;var a=!1;try{var l={};l[o]=function(){return{next:function(){return{done:a=!0}}}};t(l)}catch(t){}return a}},(t,r,a)=>{var o=a(27),i=a(76),l=a(55)("species");t.exports=function(t,r){var a,u=o(t).constructor;return void 0===u||null==(a=o(u)[l])?r:i(a)}},(t,r,a)=>{var o,i,l,u=a(10),c=a(13),d=a(75),h=a(61),p=a(24),m=a(94),v=a(96),g=u.location,y=u.setImmediate,b=u.clearImmediate,_=u.process,S=u.MessageChannel,C=u.Dispatch,A=0,R={},k="onreadystatechange",run=function(t){if(R.hasOwnProperty(t)){var r=R[t];delete R[t];r()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){u.postMessage(t+"",g.protocol+"//"+g.host)};if(!y||!b){y=function setImmediate(t){for(var r=[],a=1;arguments.length>a;)r.push(arguments[a++]);R[++A]=function(){("function"==typeof t?t:Function(t)).apply(void 0,r)};o(A);return A};b=function clearImmediate(t){delete R[t]};if(v)o=function(t){_.nextTick(runner(t))};else if(C&&C.now)o=function(t){C.now(runner(t))};else if(S&&!m){l=(i=new S).port2;i.port1.onmessage=listener;o=d(l.postMessage,l,1)}else if(u.addEventListener&&"function"==typeof postMessage&&!u.importScripts&&g&&"file:"!==g.protocol&&!c(post)){o=post;u.addEventListener("message",listener,!1)}else o=k in p("script")?function(t){h.appendChild(p("script")).onreadystatechange=function(){h.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:y,clear:b}},(t,r,a)=>{var o=a(95);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(o)},(t,r,a)=>{var o=a(41);t.exports=o("navigator","userAgent")||""},(t,r,a)=>{var o=a(18),i=a(10);t.exports="process"==o(i.process)},(t,r,a)=>{var o,i,l,u,c,d,h,p,m=a(10),v=a(11).f,g=a(93).set,y=a(94),b=a(98),_=a(96),S=m.MutationObserver||m.WebKitMutationObserver,C=m.document,A=m.process,R=m.Promise,k=v(m,"queueMicrotask"),P=k&&k.value;if(!P){o=function(){var t,r;_&&(t=A.domain)&&t.exit();for(;i;){r=i.fn;i=i.next;try{r()}catch(t){i?u():l=void 0;throw t}}l=void 0;t&&t.enter()};if(y||_||b||!S||!C)if(R&&R.resolve){h=R.resolve(void 0);p=h.then;u=function(){p.call(h,o)}}else u=_?function(){A.nextTick(o)}:function(){g.call(m,o)};else{c=!0;d=C.createTextNode("");new S(o).observe(d,{characterData:!0});u=function(){d.data=c=!c}}}t.exports=P||function(t){var r={fn:t,next:void 0};l&&(l.next=r);if(!i){i=r;u()}l=r}},(t,r,a)=>{var o=a(95);t.exports=/web0s(?!.*chrome)/i.test(o)},(t,r,a)=>{var o=a(27),i=a(21),l=a(100);t.exports=function(t,r){o(t);if(i(r)&&r.constructor===t)return r;var a=l.f(t);(0,a.resolve)(r);return a.promise}},(t,r,a)=>{"use strict";var o=a(76),PromiseCapability=function(t){var r,a;this.promise=new t((function(t,o){if(void 0!==r||void 0!==a)throw TypeError("Bad Promise constructor");r=t;a=o}));this.resolve=o(r);this.reject=o(a)};t.exports.f=function(t){return new PromiseCapability(t)}},(t,r,a)=>{var o=a(10);t.exports=function(t,r){var a=o.console;a&&a.error&&(1===arguments.length?a.error(t):a.error(t,r))}},t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},(t,r,a)=>{var o,i,l=a(10),u=a(95),c=l.process,d=c&&c.versions,h=d&&d.v8;h?i=(o=h.split("."))[0]+o[1]:u&&(!(o=u.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=u.match(/Chrome\/(\d+)/))&&(i=o[1]);t.exports=i&&+i},(t,r,a)=>{"use strict";var o=a(9),i=a(76),l=a(100),u=a(102),c=a(73);o({target:"Promise",stat:!0},{allSettled:function allSettled(t){var r=this,a=l.f(r),o=a.resolve,d=a.reject,h=u((function(){var a=i(r.resolve),l=[],u=0,d=1;c(t,(function(t){var i=u++,c=!1;l.push(void 0);d++;a.call(r,t).then((function(t){if(!c){c=!0;l[i]={status:"fulfilled",value:t};--d||o(l)}}),(function(t){if(!c){c=!0;l[i]={status:"rejected",reason:t};--d||o(l)}}))}));--d||o(l)}));h.error&&d(h.value);return a.promise}})},(t,r,a)=>{"use strict";var o=a(9),i=a(76),l=a(41),u=a(100),c=a(102),d=a(73),h="No one promise resolved";o({target:"Promise",stat:!0},{any:function any(t){var r=this,a=u.f(r),o=a.resolve,p=a.reject,m=c((function(){var a=i(r.resolve),u=[],c=0,m=1,v=!1;d(t,(function(t){var i=c++,d=!1;u.push(void 0);m++;a.call(r,t).then((function(t){if(!d&&!v){v=!0;o(t)}}),(function(t){if(!d&&!v){d=!0;u[i]=t;--m||p(new(l("AggregateError"))(u,h))}}))}));--m||p(new(l("AggregateError"))(u,h))}));m.error&&p(m.value);return a.promise}})},(t,r,a)=>{"use strict";var o=a(9),i=a(36),l=a(87),u=a(13),c=a(41),d=a(92),h=a(99),p=a(28);o({target:"Promise",proto:!0,real:!0,forced:!!l&&u((function(){l.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=d(this,c("Promise")),a="function"==typeof t;return this.then(a?function(a){return h(r,t()).then((function(){return a}))}:t,a?function(a){return h(r,t()).then((function(){throw a}))}:t)}});i||"function"!=typeof l||l.prototype.finally||p(l.prototype,"finally",c("Promise").prototype.finally)},(t,r,a)=>{"use strict";var o=a(108).charAt,i=a(32),l=a(63),u="String Iterator",c=i.set,d=i.getterFor(u);l(String,"String",(function(t){c(this,{type:u,string:String(t),index:0})}),(function next(){var t,r=d(this),a=r.string,i=r.index;if(i>=a.length)return{value:void 0,done:!0};t=o(a,i);r.index+=t.length;return{value:t,done:!1}}))},(t,r,a)=>{var o=a(47),i=a(19),createMethod=function(t){return function(r,a){var l,u,c=String(i(r)),d=o(a),h=c.length;return d<0||d>=h?t?"":void 0:(l=c.charCodeAt(d))<55296||l>56319||d+1===h||(u=c.charCodeAt(d+1))<56320||u>57343?t?c.charAt(d):l:t?c.slice(d,d+2):u-56320+(l-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},(t,r,a)=>{var o=a(10),i=a(110),l=a(53),u=a(25),c=a(55),d=c("iterator"),h=c("toStringTag"),p=l.values;for(var m in i){var v=o[m],g=v&&v.prototype;if(g){if(g[d]!==p)try{u(g,d,p)}catch(t){g[d]=p}g[h]||u(g,h,m);if(i[m])for(var y in l)if(g[y]!==l[y])try{u(g,y,l[y])}catch(t){g[y]=l[y]}}}},t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},(t,r,a)=>{a(112);a(120);a(118);var o=a(42);t.exports=o.URL},(t,r,a)=>{"use strict";a(107);var o,i=a(9),l=a(12),u=a(113),c=a(10),d=a(59),h=a(28),p=a(90),m=a(22),v=a(114),g=a(115),y=a(108).codeAt,b=a(117),_=a(69),S=a(118),C=a(32),A=c.URL,R=S.URLSearchParams,k=S.getState,P=C.set,w=C.getterFor("URL"),x=Math.floor,T=Math.pow,E="Invalid scheme",O="Invalid host",I="Invalid port",D=/[A-Za-z]/,L=/[\d+-.A-Za-z]/,M=/\d/,W=/^(0x|0X)/,j=/^[0-7]+$/,N=/^\d+$/,B=/^[\dA-Fa-f]+$/,q=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,G=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,U=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,H=/[\u0009\u000A\u000D]/g,parseHost=function(t,r){var a,o,i;if("["==r.charAt(0)){if("]"!=r.charAt(r.length-1))return O;if(!(a=parseIPv6(r.slice(1,-1))))return O;t.host=a}else if(isSpecial(t)){r=b(r);if(q.test(r))return O;if(null===(a=parseIPv4(r)))return O;t.host=a}else{if(G.test(r))return O;a="";o=g(r);for(i=0;i<o.length;i++)a+=percentEncode(o[i],z);t.host=a}},parseIPv4=function(t){var r,a,o,i,l,u,c,d=t.split(".");d.length&&""==d[d.length-1]&&d.pop();if((r=d.length)>4)return t;a=[];for(o=0;o<r;o++){if(""==(i=d[o]))return t;l=10;if(i.length>1&&"0"==i.charAt(0)){l=W.test(i)?16:8;i=i.slice(8==l?1:2)}if(""===i)u=0;else{if(!(10==l?N:8==l?j:B).test(i))return t;u=parseInt(i,l)}a.push(u)}for(o=0;o<r;o++){u=a[o];if(o==r-1){if(u>=T(256,5-r))return null}else if(u>255)return null}c=a.pop();for(o=0;o<a.length;o++)c+=a[o]*T(256,3-o);return c},parseIPv6=function(t){var r,a,o,i,l,u,c,d=[0,0,0,0,0,0,0,0],h=0,p=null,m=0,char=function(){return t.charAt(m)};if(":"==char()){if(":"!=t.charAt(1))return;m+=2;p=++h}for(;char();){if(8==h)return;if(":"!=char()){r=a=0;for(;a<4&&B.test(char());){r=16*r+parseInt(char(),16);m++;a++}if("."==char()){if(0==a)return;m-=a;if(h>6)return;o=0;for(;char();){i=null;if(o>0){if(!("."==char()&&o<4))return;m++}if(!M.test(char()))return;for(;M.test(char());){l=parseInt(char(),10);if(null===i)i=l;else{if(0==i)return;i=10*i+l}if(i>255)return;m++}d[h]=256*d[h]+i;2!=++o&&4!=o||h++}if(4!=o)return;break}if(":"==char()){m++;if(!char())return}else if(char())return;d[h++]=r}else{if(null!==p)return;m++;p=++h}}if(null!==p){u=h-p;h=7;for(;0!=h&&u>0;){c=d[h];d[h--]=d[p+u-1];d[p+--u]=c}}else if(8!=h)return;return d},serializeHost=function(t){var r,a,o,i;if("number"==typeof t){r=[];for(a=0;a<4;a++){r.unshift(t%256);t=x(t/256)}return r.join(".")}if("object"==typeof t){r="";o=function(t){for(var r=null,a=1,o=null,i=0,l=0;l<8;l++)if(0!==t[l]){if(i>a){r=o;a=i}o=null;i=0}else{null===o&&(o=l);++i}if(i>a){r=o;a=i}return r}(t);for(a=0;a<8;a++)if(!i||0!==t[a]){i&&(i=!1);if(o===a){r+=a?":":"::";i=!0}else{r+=t[a].toString(16);a<7&&(r+=":")}}return"["+r+"]"}return t},z={},V=v({},z,{" ":1,'"':1,"<":1,">":1,"`":1}),Y=v({},V,{"#":1,"?":1,"{":1,"}":1}),X=v({},Y,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,r){var a=y(t,0);return a>32&&a<127&&!m(r,t)?t:encodeURIComponent(t)},Q={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(t){return m(Q,t.scheme)},includesCredentials=function(t){return""!=t.username||""!=t.password},cannotHaveUsernamePasswordPort=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},isWindowsDriveLetter=function(t,r){var a;return 2==t.length&&D.test(t.charAt(0))&&(":"==(a=t.charAt(1))||!r&&"|"==a)},startsWithWindowsDriveLetter=function(t){var r;return t.length>1&&isWindowsDriveLetter(t.slice(0,2))&&(2==t.length||"/"===(r=t.charAt(2))||"\\"===r||"?"===r||"#"===r)},shortenURLsPath=function(t){var r=t.path,a=r.length;!a||"file"==t.scheme&&1==a&&isWindowsDriveLetter(r[0],!0)||r.pop()},isSingleDot=function(t){return"."===t||"%2e"===t.toLowerCase()},J={},K={},$={},Z={},ee={},te={},re={},ne={},ae={},oe={},ie={},se={},le={},ue={},ce={},de={},fe={},he={},pe={},me={},ve={},parseURL=function(t,r,a,i){var l,u,c,d,h,p=a||J,v=0,y="",b=!1,_=!1,S=!1;if(!a){t.scheme="";t.username="";t.password="";t.host=null;t.port=null;t.path=[];t.query=null;t.fragment=null;t.cannotBeABaseURL=!1;r=r.replace(U,"")}r=r.replace(H,"");l=g(r);for(;v<=l.length;){u=l[v];switch(p){case J:if(!u||!D.test(u)){if(a)return E;p=$;continue}y+=u.toLowerCase();p=K;break;case K:if(u&&(L.test(u)||"+"==u||"-"==u||"."==u))y+=u.toLowerCase();else{if(":"!=u){if(a)return E;y="";p=$;v=0;continue}if(a&&(isSpecial(t)!=m(Q,y)||"file"==y&&(includesCredentials(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;t.scheme=y;if(a){isSpecial(t)&&Q[t.scheme]==t.port&&(t.port=null);return}y="";if("file"==t.scheme)p=ue;else if(isSpecial(t)&&i&&i.scheme==t.scheme)p=Z;else if(isSpecial(t))p=ne;else if("/"==l[v+1]){p=ee;v++}else{t.cannotBeABaseURL=!0;t.path.push("");p=pe}}break;case $:if(!i||i.cannotBeABaseURL&&"#"!=u)return E;if(i.cannotBeABaseURL&&"#"==u){t.scheme=i.scheme;t.path=i.path.slice();t.query=i.query;t.fragment="";t.cannotBeABaseURL=!0;p=ve;break}p="file"==i.scheme?ue:te;continue;case Z:if("/"!=u||"/"!=l[v+1]){p=te;continue}p=ae;v++;break;case ee:if("/"==u){p=oe;break}p=he;continue;case te:t.scheme=i.scheme;if(u==o){t.username=i.username;t.password=i.password;t.host=i.host;t.port=i.port;t.path=i.path.slice();t.query=i.query}else if("/"==u||"\\"==u&&isSpecial(t))p=re;else if("?"==u){t.username=i.username;t.password=i.password;t.host=i.host;t.port=i.port;t.path=i.path.slice();t.query="";p=me}else{if("#"!=u){t.username=i.username;t.password=i.password;t.host=i.host;t.port=i.port;t.path=i.path.slice();t.path.pop();p=he;continue}t.username=i.username;t.password=i.password;t.host=i.host;t.port=i.port;t.path=i.path.slice();t.query=i.query;t.fragment="";p=ve}break;case re:if(!isSpecial(t)||"/"!=u&&"\\"!=u){if("/"!=u){t.username=i.username;t.password=i.password;t.host=i.host;t.port=i.port;p=he;continue}p=oe}else p=ae;break;case ne:p=ae;if("/"!=u||"/"!=y.charAt(v+1))continue;v++;break;case ae:if("/"!=u&&"\\"!=u){p=oe;continue}break;case oe:if("@"==u){b&&(y="%40"+y);b=!0;c=g(y);for(var C=0;C<c.length;C++){var A=c[C];if(":"!=A||S){var R=percentEncode(A,X);S?t.password+=R:t.username+=R}else S=!0}y=""}else if(u==o||"/"==u||"?"==u||"#"==u||"\\"==u&&isSpecial(t)){if(b&&""==y)return"Invalid authority";v-=g(y).length+1;y="";p=ie}else y+=u;break;case ie:case se:if(a&&"file"==t.scheme){p=de;continue}if(":"!=u||_){if(u==o||"/"==u||"?"==u||"#"==u||"\\"==u&&isSpecial(t)){if(isSpecial(t)&&""==y)return O;if(a&&""==y&&(includesCredentials(t)||null!==t.port))return;if(d=parseHost(t,y))return d;y="";p=fe;if(a)return;continue}"["==u?_=!0:"]"==u&&(_=!1);y+=u}else{if(""==y)return O;if(d=parseHost(t,y))return d;y="";p=le;if(a==se)return}break;case le:if(!M.test(u)){if(u==o||"/"==u||"?"==u||"#"==u||"\\"==u&&isSpecial(t)||a){if(""!=y){var k=parseInt(y,10);if(k>65535)return I;t.port=isSpecial(t)&&k===Q[t.scheme]?null:k;y=""}if(a)return;p=fe;continue}return I}y+=u;break;case ue:t.scheme="file";if("/"==u||"\\"==u)p=ce;else{if(!i||"file"!=i.scheme){p=he;continue}if(u==o){t.host=i.host;t.path=i.path.slice();t.query=i.query}else if("?"==u){t.host=i.host;t.path=i.path.slice();t.query="";p=me}else{if("#"!=u){if(!startsWithWindowsDriveLetter(l.slice(v).join(""))){t.host=i.host;t.path=i.path.slice();shortenURLsPath(t)}p=he;continue}t.host=i.host;t.path=i.path.slice();t.query=i.query;t.fragment="";p=ve}}break;case ce:if("/"==u||"\\"==u){p=de;break}i&&"file"==i.scheme&&!startsWithWindowsDriveLetter(l.slice(v).join(""))&&(isWindowsDriveLetter(i.path[0],!0)?t.path.push(i.path[0]):t.host=i.host);p=he;continue;case de:if(u==o||"/"==u||"\\"==u||"?"==u||"#"==u){if(!a&&isWindowsDriveLetter(y))p=he;else if(""==y){t.host="";if(a)return;p=fe}else{if(d=parseHost(t,y))return d;"localhost"==t.host&&(t.host="");if(a)return;y="";p=fe}continue}y+=u;break;case fe:if(isSpecial(t)){p=he;if("/"!=u&&"\\"!=u)continue}else if(a||"?"!=u)if(a||"#"!=u){if(u!=o){p=he;if("/"!=u)continue}}else{t.fragment="";p=ve}else{t.query="";p=me}break;case he:if(u==o||"/"==u||"\\"==u&&isSpecial(t)||!a&&("?"==u||"#"==u)){if(".."===(h=(h=y).toLowerCase())||"%2e."===h||".%2e"===h||"%2e%2e"===h){shortenURLsPath(t);"/"==u||"\\"==u&&isSpecial(t)||t.path.push("")}else if(isSingleDot(y))"/"==u||"\\"==u&&isSpecial(t)||t.path.push("");else{if("file"==t.scheme&&!t.path.length&&isWindowsDriveLetter(y)){t.host&&(t.host="");y=y.charAt(0)+":"}t.path.push(y)}y="";if("file"==t.scheme&&(u==o||"?"==u||"#"==u))for(;t.path.length>1&&""===t.path[0];)t.path.shift();if("?"==u){t.query="";p=me}else if("#"==u){t.fragment="";p=ve}}else y+=percentEncode(u,Y);break;case pe:if("?"==u){t.query="";p=me}else if("#"==u){t.fragment="";p=ve}else u!=o&&(t.path[0]+=percentEncode(u,z));break;case me:if(a||"#"!=u)u!=o&&("'"==u&&isSpecial(t)?t.query+="%27":t.query+="#"==u?"%23":percentEncode(u,z));else{t.fragment="";p=ve}break;case ve:u!=o&&(t.fragment+=percentEncode(u,V))}v++}},ge=function URL(t){var r,a,o=p(this,ge,"URL"),i=arguments.length>1?arguments[1]:void 0,u=String(t),c=P(o,{type:"URL"});if(void 0!==i)if(i instanceof ge)r=w(i);else if(a=parseURL(r={},String(i)))throw TypeError(a);if(a=parseURL(c,u,null,r))throw TypeError(a);var d=c.searchParams=new R,h=k(d);h.updateSearchParams(c.query);h.updateURL=function(){c.query=String(d)||null};if(!l){o.href=serializeURL.call(o);o.origin=getOrigin.call(o);o.protocol=getProtocol.call(o);o.username=getUsername.call(o);o.password=getPassword.call(o);o.host=getHost.call(o);o.hostname=getHostname.call(o);o.port=getPort.call(o);o.pathname=getPathname.call(o);o.search=getSearch.call(o);o.searchParams=getSearchParams.call(o);o.hash=getHash.call(o)}},ye=ge.prototype,serializeURL=function(){var t=w(this),r=t.scheme,a=t.username,o=t.password,i=t.host,l=t.port,u=t.path,c=t.query,d=t.fragment,h=r+":";if(null!==i){h+="//";includesCredentials(t)&&(h+=a+(o?":"+o:"")+"@");h+=serializeHost(i);null!==l&&(h+=":"+l)}else"file"==r&&(h+="//");h+=t.cannotBeABaseURL?u[0]:u.length?"/"+u.join("/"):"";null!==c&&(h+="?"+c);null!==d&&(h+="#"+d);return h},getOrigin=function(){var t=w(this),r=t.scheme,a=t.port;if("blob"==r)try{return new URL(r.path[0]).origin}catch(t){return"null"}return"file"!=r&&isSpecial(t)?r+"://"+serializeHost(t.host)+(null!==a?":"+a:""):"null"},getProtocol=function(){return w(this).scheme+":"},getUsername=function(){return w(this).username},getPassword=function(){return w(this).password},getHost=function(){var t=w(this),r=t.host,a=t.port;return null===r?"":null===a?serializeHost(r):serializeHost(r)+":"+a},getHostname=function(){var t=w(this).host;return null===t?"":serializeHost(t)},getPort=function(){var t=w(this).port;return null===t?"":String(t)},getPathname=function(){var t=w(this),r=t.path;return t.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):""},getSearch=function(){var t=w(this).query;return t?"?"+t:""},getSearchParams=function(){return w(this).searchParams},getHash=function(){var t=w(this).fragment;return t?"#"+t:""},accessorDescriptor=function(t,r){return{get:t,set:r,configurable:!0,enumerable:!0}};l&&d(ye,{href:accessorDescriptor(serializeURL,(function(t){var r=w(this),a=String(t),o=parseURL(r,a);if(o)throw TypeError(o);k(r.searchParams).updateSearchParams(r.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(t){var r=w(this);parseURL(r,String(t)+":",J)})),username:accessorDescriptor(getUsername,(function(t){var r=w(this),a=g(String(t));if(!cannotHaveUsernamePasswordPort(r)){r.username="";for(var o=0;o<a.length;o++)r.username+=percentEncode(a[o],X)}})),password:accessorDescriptor(getPassword,(function(t){var r=w(this),a=g(String(t));if(!cannotHaveUsernamePasswordPort(r)){r.password="";for(var o=0;o<a.length;o++)r.password+=percentEncode(a[o],X)}})),host:accessorDescriptor(getHost,(function(t){var r=w(this);r.cannotBeABaseURL||parseURL(r,String(t),ie)})),hostname:accessorDescriptor(getHostname,(function(t){var r=w(this);r.cannotBeABaseURL||parseURL(r,String(t),se)})),port:accessorDescriptor(getPort,(function(t){var r=w(this);cannotHaveUsernamePasswordPort(r)||(""==(t=String(t))?r.port=null:parseURL(r,t,le))})),pathname:accessorDescriptor(getPathname,(function(t){var r=w(this);if(!r.cannotBeABaseURL){r.path=[];parseURL(r,t+"",fe)}})),search:accessorDescriptor(getSearch,(function(t){var r=w(this);if(""==(t=String(t)))r.query=null;else{"?"==t.charAt(0)&&(t=t.slice(1));r.query="";parseURL(r,t,me)}k(r.searchParams).updateSearchParams(r.query)})),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,(function(t){var r=w(this);if(""!=(t=String(t))){"#"==t.charAt(0)&&(t=t.slice(1));r.fragment="";parseURL(r,t,ve)}else r.fragment=null}))});h(ye,"toJSON",(function toJSON(){return serializeURL.call(this)}),{enumerable:!0});h(ye,"toString",(function toString(){return serializeURL.call(this)}),{enumerable:!0});if(A){var be=A.createObjectURL,_e=A.revokeObjectURL;be&&h(ge,"createObjectURL",(function createObjectURL(t){return be.apply(A,arguments)}));_e&&h(ge,"revokeObjectURL",(function revokeObjectURL(t){return _e.apply(A,arguments)}))}_(ge,"URL");i({global:!0,forced:!u,sham:!l},{URL:ge})},(t,r,a)=>{var o=a(13),i=a(55),l=a(36),u=i("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,a="";t.pathname="c%20d";r.forEach((function(t,o){r.delete("b");a+=o+t}));return l&&!t.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==a||"x"!==new URL("http://x",void 0).host}))},(t,r,a)=>{"use strict";var o=a(12),i=a(13),l=a(60),u=a(50),c=a(14),d=a(67),h=a(17),p=Object.assign,m=Object.defineProperty;t.exports=!p||i((function(){if(o&&1!==p({b:1},p(m({},"a",{enumerable:!0,get:function(){m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},a=Symbol(),i="abcdefghijklmnopqrst";t[a]=7;i.split("").forEach((function(t){r[t]=t}));return 7!=p({},t)[a]||l(p({},r)).join("")!=i}))?function assign(t,r){for(var a=d(t),i=arguments.length,p=1,m=u.f,v=c.f;i>p;)for(var g,y=h(arguments[p++]),b=m?l(y).concat(m(y)):l(y),_=b.length,S=0;_>S;){g=b[S++];o&&!v.call(y,g)||(a[g]=y[g])}return a}:p},(t,r,a)=>{"use strict";var o=a(75),i=a(67),l=a(116),u=a(74),c=a(46),d=a(81),h=a(77);t.exports=function from(t){var r,a,p,m,v,g,y=i(t),b="function"==typeof this?this:Array,_=arguments.length,S=_>1?arguments[1]:void 0,C=void 0!==S,A=h(y),R=0;C&&(S=o(S,_>2?arguments[2]:void 0,2));if(null==A||b==Array&&u(A)){a=new b(r=c(y.length));for(;r>R;R++){g=C?S(y[R],R):y[R];d(a,R,g)}}else{v=(m=A.call(y)).next;a=new b;for(;!(p=v.call(m)).done;R++){g=C?l(m,S,[p.value,R],!0):p.value;d(a,R,g)}}a.length=R;return a}},(t,r,a)=>{var o=a(27),i=a(80);t.exports=function(t,r,a,l){try{return l?r(o(a)[0],a[1]):r(a)}catch(r){i(t);throw r}}},t=>{"use strict";var r=2147483647,a=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",l=Math.floor,u=String.fromCharCode,digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,r,a){var o=0;t=a?l(t/700):t>>1;t+=l(t/r);for(;t>455;o+=36)t=l(t/35);return l(o+36*t/(t+38))},encode=function(t){var a,o,c=[],d=(t=function(t){for(var r=[],a=0,o=t.length;a<o;){var i=t.charCodeAt(a++);if(i>=55296&&i<=56319&&a<o){var l=t.charCodeAt(a++);if(56320==(64512&l))r.push(((1023&i)<<10)+(1023&l)+65536);else{r.push(i);a--}}else r.push(i)}return r}(t)).length,h=128,p=0,m=72;for(a=0;a<t.length;a++)(o=t[a])<128&&c.push(u(o));var v=c.length,g=v;v&&c.push("-");for(;g<d;){var y=r;for(a=0;a<t.length;a++)(o=t[a])>=h&&o<y&&(y=o);var b=g+1;if(y-h>l((r-p)/b))throw RangeError(i);p+=(y-h)*b;h=y;for(a=0;a<t.length;a++){if((o=t[a])<h&&++p>r)throw RangeError(i);if(o==h){for(var _=p,S=36;;S+=36){var C=S<=m?1:S>=m+26?26:S-m;if(_<C)break;var A=_-C,R=36-C;c.push(u(digitToBasic(C+A%R)));_=l(A/R)}c.push(u(digitToBasic(_)));m=adapt(p,b,g==v);p=0;++g}}++p;++h}return c.join("")};t.exports=function(t){var r,i,l=[],u=t.toLowerCase().replace(o,".").split(".");for(r=0;r<u.length;r++){i=u[r];l.push(a.test(i)?"xn--"+encode(i):i)}return l.join(".")}},(t,r,a)=>{"use strict";a(53);var o=a(9),i=a(41),l=a(113),u=a(28),c=a(88),d=a(69),h=a(64),p=a(32),m=a(90),v=a(22),g=a(75),y=a(78),b=a(27),_=a(21),S=a(58),C=a(15),A=a(119),R=a(77),k=a(55),P=i("fetch"),w=i("Headers"),x=k("iterator"),T="URLSearchParams",E="URLSearchParamsIterator",O=p.set,I=p.getterFor(T),D=p.getterFor(E),L=/\+/g,M=Array(4),percentSequence=function(t){return M[t-1]||(M[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},percentDecode=function(t){try{return decodeURIComponent(t)}catch(r){return t}},deserialize=function(t){var r=t.replace(L," "),a=4;try{return decodeURIComponent(r)}catch(t){for(;a;)r=r.replace(percentSequence(a--),percentDecode);return r}},W=/[!'()~]|%20/g,j={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return j[t]},serialize=function(t){return encodeURIComponent(t).replace(W,replacer)},parseSearchParams=function(t,r){if(r)for(var a,o,i=r.split("&"),l=0;l<i.length;)if((a=i[l++]).length){o=a.split("=");t.push({key:deserialize(o.shift()),value:deserialize(o.join("="))})}},updateSearchParams=function(t){this.entries.length=0;parseSearchParams(this.entries,t)},validateArgumentsLength=function(t,r){if(t<r)throw TypeError("Not enough arguments")},N=h((function Iterator(t,r){O(this,{type:E,iterator:A(I(t).entries),kind:r})}),"Iterator",(function next(){var t=D(this),r=t.kind,a=t.iterator.next(),o=a.value;a.done||(a.value="keys"===r?o.key:"values"===r?o.value:[o.key,o.value]);return a})),B=function URLSearchParams(){m(this,B,T);var t,r,a,o,i,l,u,c,d,h=arguments.length>0?arguments[0]:void 0,p=this,g=[];O(p,{type:T,entries:g,updateURL:function(){},updateSearchParams:updateSearchParams});if(void 0!==h)if(_(h))if("function"==typeof(t=R(h))){a=(r=t.call(h)).next;for(;!(o=a.call(r)).done;){if((u=(l=(i=A(b(o.value))).next).call(i)).done||(c=l.call(i)).done||!l.call(i).done)throw TypeError("Expected sequence with length 2");g.push({key:u.value+"",value:c.value+""})}}else for(d in h)v(h,d)&&g.push({key:d,value:h[d]+""});else parseSearchParams(g,"string"==typeof h?"?"===h.charAt(0)?h.slice(1):h:h+"")},q=B.prototype;c(q,{append:function append(t,r){validateArgumentsLength(arguments.length,2);var a=I(this);a.entries.push({key:t+"",value:r+""});a.updateURL()},delete:function(t){validateArgumentsLength(arguments.length,1);for(var r=I(this),a=r.entries,o=t+"",i=0;i<a.length;)a[i].key===o?a.splice(i,1):i++;r.updateURL()},get:function get(t){validateArgumentsLength(arguments.length,1);for(var r=I(this).entries,a=t+"",o=0;o<r.length;o++)if(r[o].key===a)return r[o].value;return null},getAll:function getAll(t){validateArgumentsLength(arguments.length,1);for(var r=I(this).entries,a=t+"",o=[],i=0;i<r.length;i++)r[i].key===a&&o.push(r[i].value);return o},has:function has(t){validateArgumentsLength(arguments.length,1);for(var r=I(this).entries,a=t+"",o=0;o<r.length;)if(r[o++].key===a)return!0;return!1},set:function set(t,r){validateArgumentsLength(arguments.length,1);for(var a,o=I(this),i=o.entries,l=!1,u=t+"",c=r+"",d=0;d<i.length;d++)if((a=i[d]).key===u)if(l)i.splice(d--,1);else{l=!0;a.value=c}l||i.push({key:u,value:c});o.updateURL()},sort:function sort(){var t,r,a,o=I(this),i=o.entries,l=i.slice();i.length=0;for(a=0;a<l.length;a++){t=l[a];for(r=0;r<a;r++)if(i[r].key>t.key){i.splice(r,0,t);break}r===a&&i.push(t)}o.updateURL()},forEach:function forEach(t){for(var r,a=I(this).entries,o=g(t,arguments.length>1?arguments[1]:void 0,3),i=0;i<a.length;)o((r=a[i++]).value,r.key,this)},keys:function keys(){return new N(this,"keys")},values:function values(){return new N(this,"values")},entries:function entries(){return new N(this,"entries")}},{enumerable:!0});u(q,x,q.entries);u(q,"toString",(function toString(){for(var t,r=I(this).entries,a=[],o=0;o<r.length;){t=r[o++];a.push(serialize(t.key)+"="+serialize(t.value))}return a.join("&")}),{enumerable:!0});d(B,T);o({global:!0,forced:!l},{URLSearchParams:B});l||"function"!=typeof P||"function"!=typeof w||o({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){var r,a,o,i=[t];if(arguments.length>1){if(_(r=arguments[1])){a=r.body;if(y(a)===T){(o=r.headers?new w(r.headers):new w).has("content-type")||o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8");r=S(r,{body:C(0,String(a)),headers:C(0,o)})}}i.push(r)}return P.apply(this,i)}});t.exports={URLSearchParams:B,getState:I}},(t,r,a)=>{var o=a(27),i=a(77);t.exports=function(t){var r=i(t);if("function"!=typeof r)throw TypeError(String(t)+" is not iterable");return o(r.call(t))}},(t,r,a)=>{"use strict";a(9)({target:"URL",proto:!0,enumerable:!0},{toJSON:function toJSON(){return URL.prototype.toString.call(this)}})},function(t,r){(function(t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(t){return"Symbol("+t+")"};function noop(){}var a=function getGlobals(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}();function typeIsObject(t){return"object"==typeof t&&null!==t||"function"==typeof t}var o=noop,i=Promise,l=Promise.prototype.then,u=Promise.resolve.bind(i),c=Promise.reject.bind(i);function newPromise(t){return new i(t)}function promiseResolvedWith(t){return u(t)}function promiseRejectedWith(t){return c(t)}function PerformPromiseThen(t,r,a){return l.call(t,r,a)}function uponPromise(t,r,a){PerformPromiseThen(PerformPromiseThen(t,r,a),void 0,o)}function uponFulfillment(t,r){uponPromise(t,r)}function uponRejection(t,r){uponPromise(t,void 0,r)}function transformPromiseWith(t,r,a){return PerformPromiseThen(t,r,a)}function setPromiseIsHandledToTrue(t){PerformPromiseThen(t,void 0,o)}var d=function(){var t=a&&a.queueMicrotask;if("function"==typeof t)return t;var r=promiseResolvedWith(void 0);return function(t){return PerformPromiseThen(r,t)}}();function reflectCall(t,r,a){if("function"!=typeof t)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,r,a)}function promiseCall(t,r,a){try{return promiseResolvedWith(reflectCall(t,r,a))}catch(t){return promiseRejectedWith(t)}}var h=function(){function SimpleQueue(){this._cursor=0;this._size=0;this._front={_elements:[],_next:void 0};this._back=this._front;this._cursor=0;this._size=0}Object.defineProperty(SimpleQueue.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0});SimpleQueue.prototype.push=function(t){var r=this._back,a=r;16383===r._elements.length&&(a={_elements:[],_next:void 0});r._elements.push(t);if(a!==r){this._back=a;r._next=a}++this._size};SimpleQueue.prototype.shift=function(){var t=this._front,r=t,a=this._cursor,o=a+1,i=t._elements,l=i[a];if(16384===o){r=t._next;o=0}--this._size;this._cursor=o;t!==r&&(this._front=r);i[a]=void 0;return l};SimpleQueue.prototype.forEach=function(t){for(var r=this._cursor,a=this._front,o=a._elements;r!==o.length||void 0!==a._next;){if(r===o.length){r=0;if(0===(o=(a=a._next)._elements).length)break}t(o[r]);++r}};SimpleQueue.prototype.peek=function(){var t=this._front,r=this._cursor;return t._elements[r]};return SimpleQueue}();function ReadableStreamReaderGenericInitialize(t,r){t._ownerReadableStream=r;r._reader=t;"readable"===r._state?defaultReaderClosedPromiseInitialize(t):"closed"===r._state?function defaultReaderClosedPromiseInitializeAsResolved(t){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseResolve(t)}(t):defaultReaderClosedPromiseInitializeAsRejected(t,r._storedError)}function ReadableStreamReaderGenericCancel(t,r){return ReadableStreamCancel(t._ownerReadableStream,r)}function ReadableStreamReaderGenericRelease(t){"readable"===t._ownerReadableStream._state?defaultReaderClosedPromiseReject(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function defaultReaderClosedPromiseResetToRejected(t,r){defaultReaderClosedPromiseInitializeAsRejected(t,r)}(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness"));t._ownerReadableStream._reader=void 0;t._ownerReadableStream=void 0}function readerLockException(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(t){t._closedPromise=newPromise((function(r,a){t._closedPromise_resolve=r;t._closedPromise_reject=a}))}function defaultReaderClosedPromiseInitializeAsRejected(t,r){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseReject(t,r)}function defaultReaderClosedPromiseReject(t,r){if(void 0!==t._closedPromise_reject){setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=void 0;t._closedPromise_reject=void 0}}function defaultReaderClosedPromiseResolve(t){if(void 0!==t._closedPromise_resolve){t._closedPromise_resolve(void 0);t._closedPromise_resolve=void 0;t._closedPromise_reject=void 0}}var p=r("[[AbortSteps]]"),m=r("[[ErrorSteps]]"),v=r("[[CancelSteps]]"),g=r("[[PullSteps]]"),y=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},b=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function assertDictionary(t,r){if(void 0!==t&&!function isDictionary(t){return"object"==typeof t||"function"==typeof t}(t))throw new TypeError(r+" is not an object.")}function assertFunction(t,r){if("function"!=typeof t)throw new TypeError(r+" is not a function.")}function assertObject(t,r){if(!function isObject(t){return"object"==typeof t&&null!==t||"function"==typeof t}(t))throw new TypeError(r+" is not an object.")}function assertRequiredArgument(t,r,a){if(void 0===t)throw new TypeError("Parameter "+r+" is required in '"+a+"'.")}function assertRequiredField(t,r,a){if(void 0===t)throw new TypeError(r+" is required in '"+a+"'.")}function convertUnrestrictedDouble(t){return Number(t)}function censorNegativeZero(t){return 0===t?0:t}function convertUnsignedLongLongWithEnforceRange(t,r){var a=Number.MAX_SAFE_INTEGER,o=Number(t);o=censorNegativeZero(o);if(!y(o))throw new TypeError(r+" is not a finite number");if((o=function integerPart(t){return censorNegativeZero(b(t))}(o))<0||o>a)throw new TypeError(r+" is outside the accepted range of 0 to "+a+", inclusive");return y(o)&&0!==o?o:0}function assertReadableStream(t,r){if(!IsReadableStream(t))throw new TypeError(r+" is not a ReadableStream.")}function AcquireReadableStreamDefaultReader(t){return new C(t)}function ReadableStreamAddReadRequest(t,r){t._reader._readRequests.push(r)}function ReadableStreamFulfillReadRequest(t,r,a){var o=t._reader._readRequests.shift();a?o._closeSteps():o._chunkSteps(r)}function ReadableStreamGetNumReadRequests(t){return t._reader._readRequests.length}function ReadableStreamHasDefaultReader(t){var r=t._reader;return void 0!==r&&!!IsReadableStreamDefaultReader(r)}var _,S,C=function(){function ReadableStreamDefaultReader(t){assertRequiredArgument(t,1,"ReadableStreamDefaultReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ReadableStreamReaderGenericInitialize(this,t);this._readRequests=new h}Object.defineProperty(ReadableStreamDefaultReader.prototype,"closed",{get:function(){return IsReadableStreamDefaultReader(this)?this._closedPromise:promiseRejectedWith(defaultReaderBrandCheckException("closed"))},enumerable:!1,configurable:!0});ReadableStreamDefaultReader.prototype.cancel=function(t){void 0===t&&(t=void 0);return IsReadableStreamDefaultReader(this)?void 0===this._ownerReadableStream?promiseRejectedWith(readerLockException("cancel")):ReadableStreamReaderGenericCancel(this,t):promiseRejectedWith(defaultReaderBrandCheckException("cancel"))};ReadableStreamDefaultReader.prototype.read=function(){if(!IsReadableStreamDefaultReader(this))return promiseRejectedWith(defaultReaderBrandCheckException("read"));if(void 0===this._ownerReadableStream)return promiseRejectedWith(readerLockException("read from"));var t,r,a=newPromise((function(a,o){t=a;r=o}));ReadableStreamDefaultReaderRead(this,{_chunkSteps:function(r){return t({value:r,done:!1})},_closeSteps:function(){return t({value:void 0,done:!0})},_errorSteps:function(t){return r(t)}});return a};ReadableStreamDefaultReader.prototype.releaseLock=function(){if(!IsReadableStreamDefaultReader(this))throw defaultReaderBrandCheckException("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");ReadableStreamReaderGenericRelease(this)}};return ReadableStreamDefaultReader}();Object.defineProperties(C.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(C.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function IsReadableStreamDefaultReader(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function ReadableStreamDefaultReaderRead(t,r){var a=t._ownerReadableStream;a._disturbed=!0;"closed"===a._state?r._closeSteps():"errored"===a._state?r._errorSteps(a._storedError):a._readableStreamController[g](r)}function defaultReaderBrandCheckException(t){return new TypeError("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}if("symbol"==typeof r.asyncIterator){S=((_={})[r.asyncIterator]=function(){return this},_);Object.defineProperty(S,r.asyncIterator,{enumerable:!1})}var A=function(){function ReadableStreamAsyncIteratorImpl(t,r){this._ongoingPromise=void 0;this._isFinished=!1;this._reader=t;this._preventCancel=r}ReadableStreamAsyncIteratorImpl.prototype.next=function(){var t=this,nextSteps=function(){return t._nextSteps()};this._ongoingPromise=this._ongoingPromise?transformPromiseWith(this._ongoingPromise,nextSteps,nextSteps):nextSteps();return this._ongoingPromise};ReadableStreamAsyncIteratorImpl.prototype.return=function(t){var r=this,returnSteps=function(){return r._returnSteps(t)};return this._ongoingPromise?transformPromiseWith(this._ongoingPromise,returnSteps,returnSteps):returnSteps()};ReadableStreamAsyncIteratorImpl.prototype._nextSteps=function(){var t=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var r,a,o=this._reader;if(void 0===o._ownerReadableStream)return promiseRejectedWith(readerLockException("iterate"));var i=newPromise((function(t,o){r=t;a=o}));ReadableStreamDefaultReaderRead(o,{_chunkSteps:function(a){t._ongoingPromise=void 0;d((function(){return r({value:a,done:!1})}))},_closeSteps:function(){t._ongoingPromise=void 0;t._isFinished=!0;ReadableStreamReaderGenericRelease(o);r({value:void 0,done:!0})},_errorSteps:function(r){t._ongoingPromise=void 0;t._isFinished=!0;ReadableStreamReaderGenericRelease(o);a(r)}});return i};ReadableStreamAsyncIteratorImpl.prototype._returnSteps=function(t){if(this._isFinished)return Promise.resolve({value:t,done:!0});this._isFinished=!0;var r=this._reader;if(void 0===r._ownerReadableStream)return promiseRejectedWith(readerLockException("finish iterating"));if(!this._preventCancel){var a=ReadableStreamReaderGenericCancel(r,t);ReadableStreamReaderGenericRelease(r);return transformPromiseWith(a,(function(){return{value:t,done:!0}}))}ReadableStreamReaderGenericRelease(r);return promiseResolvedWith({value:t,done:!0})};return ReadableStreamAsyncIteratorImpl}(),R={next:function(){return IsReadableStreamAsyncIterator(this)?this._asyncIteratorImpl.next():promiseRejectedWith(streamAsyncIteratorBrandCheckException("next"))},return:function(t){return IsReadableStreamAsyncIterator(this)?this._asyncIteratorImpl.return(t):promiseRejectedWith(streamAsyncIteratorBrandCheckException("return"))}};void 0!==S&&Object.setPrototypeOf(R,S);function IsReadableStreamAsyncIterator(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl")}function streamAsyncIteratorBrandCheckException(t){return new TypeError("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}var k=Number.isNaN||function(t){return t!=t};function IsFiniteNonNegativeNumber(t){return!!function IsNonNegativeNumber(t){return"number"==typeof t&&(!k(t)&&!(t<0))}(t)&&t!==1/0}function DequeueValue(t){var r=t._queue.shift();t._queueTotalSize-=r.size;t._queueTotalSize<0&&(t._queueTotalSize=0);return r.value}function EnqueueValueWithSize(t,r,a){if(!IsFiniteNonNegativeNumber(a=Number(a)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:r,size:a});t._queueTotalSize+=a}function ResetQueue(t){t._queue=new h;t._queueTotalSize=0}function CreateArrayFromList(t){return t.slice()}var P=function(){function ReadableStreamBYOBRequest(){throw new TypeError("Illegal constructor")}Object.defineProperty(ReadableStreamBYOBRequest.prototype,"view",{get:function(){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("view");return this._view},enumerable:!1,configurable:!0});ReadableStreamBYOBRequest.prototype.respond=function(t){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("respond");assertRequiredArgument(t,1,"respond");t=convertUnsignedLongLongWithEnforceRange(t,"First parameter");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer;!function ReadableByteStreamControllerRespond(t,r){if(!IsFiniteNonNegativeNumber(r=Number(r)))throw new RangeError("bytesWritten must be a finite");ReadableByteStreamControllerRespondInternal(t,r)}(this._associatedReadableByteStreamController,t)};ReadableStreamBYOBRequest.prototype.respondWithNewView=function(t){if(!IsReadableStreamBYOBRequest(this))throw byobRequestBrandCheckException("respondWithNewView");assertRequiredArgument(t,1,"respondWithNewView");if(!ArrayBuffer.isView(t))throw new TypeError("You can only respond with array buffer views");if(0===t.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===t.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");!function ReadableByteStreamControllerRespondWithNewView(t,r){var a=t._pendingPullIntos.peek();if(a.byteOffset+a.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(a.byteLength!==r.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");a.buffer=r.buffer;ReadableByteStreamControllerRespondInternal(t,r.byteLength)}(this._associatedReadableByteStreamController,t)};return ReadableStreamBYOBRequest}();Object.defineProperties(P.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(P.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var w=function(){function ReadableByteStreamController(){throw new TypeError("Illegal constructor")}Object.defineProperty(ReadableByteStreamController.prototype,"byobRequest",{get:function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("byobRequest");if(null===this._byobRequest&&this._pendingPullIntos.length>0){var t=this._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),a=Object.create(P.prototype);!function SetUpReadableStreamBYOBRequest(t,r,a){t._associatedReadableByteStreamController=r;t._view=a}(a,this,r);this._byobRequest=a}return this._byobRequest},enumerable:!1,configurable:!0});Object.defineProperty(ReadableByteStreamController.prototype,"desiredSize",{get:function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("desiredSize");return ReadableByteStreamControllerGetDesiredSize(this)},enumerable:!1,configurable:!0});ReadableByteStreamController.prototype.close=function(){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function ReadableByteStreamControllerClose(t){var r=t._controlledReadableByteStream;if(!t._closeRequested&&"readable"===r._state)if(t._queueTotalSize>0)t._closeRequested=!0;else{if(t._pendingPullIntos.length>0&&t._pendingPullIntos.peek().bytesFilled>0){var a=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,a);throw a}ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(r)}}(this)};ReadableByteStreamController.prototype.enqueue=function(t){if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("enqueue");assertRequiredArgument(t,1,"enqueue");if(!ArrayBuffer.isView(t))throw new TypeError("chunk must be an array buffer view");if(0===t.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===t.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var r=this._controlledReadableByteStream._state;if("readable"!==r)throw new TypeError("The stream (in "+r+" state) is not in the readable state and cannot be enqueued to");!function ReadableByteStreamControllerEnqueue(t,r){var a=t._controlledReadableByteStream;if(!t._closeRequested&&"readable"===a._state){var o=r.buffer,i=r.byteOffset,l=r.byteLength,u=o;if(ReadableStreamHasDefaultReader(a))0===ReadableStreamGetNumReadRequests(a)?ReadableByteStreamControllerEnqueueChunkToQueue(t,u,i,l):ReadableStreamFulfillReadRequest(a,new Uint8Array(u,i,l),!1);else if(ReadableStreamHasBYOBReader(a)){ReadableByteStreamControllerEnqueueChunkToQueue(t,u,i,l);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}else ReadableByteStreamControllerEnqueueChunkToQueue(t,u,i,l);ReadableByteStreamControllerCallPullIfNeeded(t)}}(this,t)};ReadableByteStreamController.prototype.error=function(t){void 0===t&&(t=void 0);if(!IsReadableByteStreamController(this))throw byteStreamControllerBrandCheckException("error");ReadableByteStreamControllerError(this,t)};ReadableByteStreamController.prototype[v]=function(t){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0);ResetQueue(this);var r=this._cancelAlgorithm(t);ReadableByteStreamControllerClearAlgorithms(this);return r};ReadableByteStreamController.prototype[g]=function(t){var r=this._controlledReadableByteStream;if(this._queueTotalSize>0){var a=this._queue.shift();this._queueTotalSize-=a.byteLength;ReadableByteStreamControllerHandleQueueDrain(this);var o=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);t._chunkSteps(o)}else{var i=this._autoAllocateChunkSize;if(void 0!==i){var l=void 0;try{l=new ArrayBuffer(i)}catch(r){t._errorSteps(r);return}var u={buffer:l,byteOffset:0,byteLength:i,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(u)}ReadableStreamAddReadRequest(r,t);ReadableByteStreamControllerCallPullIfNeeded(this)}};return ReadableByteStreamController}();Object.defineProperties(w.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(w.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function IsReadableByteStreamController(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function IsReadableStreamBYOBRequest(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function ReadableByteStreamControllerCallPullIfNeeded(t){if(function ReadableByteStreamControllerShouldCallPull(t){var r=t._controlledReadableByteStream;return"readable"===r._state&&(!t._closeRequested&&(!!t._started&&(!!(ReadableStreamHasDefaultReader(r)&&ReadableStreamGetNumReadRequests(r)>0)||(!!(ReadableStreamHasBYOBReader(r)&&ReadableStreamGetNumReadIntoRequests(r)>0)||ReadableByteStreamControllerGetDesiredSize(t)>0))))}(t))if(t._pulling)t._pullAgain=!0;else{t._pulling=!0;uponPromise(t._pullAlgorithm(),(function(){t._pulling=!1;if(t._pullAgain){t._pullAgain=!1;ReadableByteStreamControllerCallPullIfNeeded(t)}}),(function(r){ReadableByteStreamControllerError(t,r)}))}}function ReadableByteStreamControllerCommitPullIntoDescriptor(t,r){var a=!1;"closed"===t._state&&(a=!0);var o=ReadableByteStreamControllerConvertPullIntoDescriptor(r);"default"===r.readerType?ReadableStreamFulfillReadRequest(t,o,a):function ReadableStreamFulfillReadIntoRequest(t,r,a){var o=t._reader._readIntoRequests.shift();a?o._closeSteps(r):o._chunkSteps(r)}(t,o,a)}function ReadableByteStreamControllerConvertPullIntoDescriptor(t){var r=t.bytesFilled,a=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,r/a)}function ReadableByteStreamControllerEnqueueChunkToQueue(t,r,a,o){t._queue.push({buffer:r,byteOffset:a,byteLength:o});t._queueTotalSize+=o}function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r){var a=r.elementSize,o=r.bytesFilled-r.bytesFilled%a,i=Math.min(t._queueTotalSize,r.byteLength-r.bytesFilled),l=r.bytesFilled+i,u=l-l%a,c=i,d=!1;if(u>o){c=u-r.bytesFilled;d=!0}for(var h,p,m,v,g,y=t._queue;c>0;){var b=y.peek(),_=Math.min(c,b.byteLength),S=r.byteOffset+r.bytesFilled;h=r.buffer,p=S,m=b.buffer,v=b.byteOffset,g=_,new Uint8Array(h).set(new Uint8Array(m,v,g),p);if(b.byteLength===_)y.shift();else{b.byteOffset+=_;b.byteLength-=_}t._queueTotalSize-=_;ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,_,r);c-=_}return d}function ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,a){ReadableByteStreamControllerInvalidateBYOBRequest(t);a.bytesFilled+=r}function ReadableByteStreamControllerHandleQueueDrain(t){if(0===t._queueTotalSize&&t._closeRequested){ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(t._controlledReadableByteStream)}else ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerInvalidateBYOBRequest(t){if(null!==t._byobRequest){t._byobRequest._associatedReadableByteStreamController=void 0;t._byobRequest._view=null;t._byobRequest=null}}function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t){for(;t._pendingPullIntos.length>0;){if(0===t._queueTotalSize)return;var r=t._pendingPullIntos.peek();if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r)){ReadableByteStreamControllerShiftPendingPullInto(t);ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,r)}}}function ReadableByteStreamControllerRespondInternal(t,r){var a=t._pendingPullIntos.peek();if("closed"===t._controlledReadableByteStream._state){if(0!==r)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function ReadableByteStreamControllerRespondInClosedState(t,r){r.buffer=r.buffer;var a=t._controlledReadableByteStream;if(ReadableStreamHasBYOBReader(a))for(;ReadableStreamGetNumReadIntoRequests(a)>0;)ReadableByteStreamControllerCommitPullIntoDescriptor(a,ReadableByteStreamControllerShiftPendingPullInto(t))}(t,a)}else!function ReadableByteStreamControllerRespondInReadableState(t,r,a){if(a.bytesFilled+r>a.byteLength)throw new RangeError("bytesWritten out of range");ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,a);if(!(a.bytesFilled<a.elementSize)){ReadableByteStreamControllerShiftPendingPullInto(t);var o=a.bytesFilled%a.elementSize;if(o>0){var i=a.byteOffset+a.bytesFilled,l=a.buffer.slice(i-o,i);ReadableByteStreamControllerEnqueueChunkToQueue(t,l,0,l.byteLength)}a.buffer=a.buffer;a.bytesFilled-=o;ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,a);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}}(t,r,a);ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerShiftPendingPullInto(t){var r=t._pendingPullIntos.shift();ReadableByteStreamControllerInvalidateBYOBRequest(t);return r}function ReadableByteStreamControllerClearAlgorithms(t){t._pullAlgorithm=void 0;t._cancelAlgorithm=void 0}function ReadableByteStreamControllerError(t,r){var a=t._controlledReadableByteStream;if("readable"===a._state){!function ReadableByteStreamControllerClearPendingPullIntos(t){ReadableByteStreamControllerInvalidateBYOBRequest(t);t._pendingPullIntos=new h}(t);ResetQueue(t);ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamError(a,r)}}function ReadableByteStreamControllerGetDesiredSize(t){var r=t._controlledReadableByteStream._state;return"errored"===r?null:"closed"===r?0:t._strategyHWM-t._queueTotalSize}function SetUpReadableByteStreamControllerFromUnderlyingSource(t,r,a){var o=Object.create(w.prototype),startAlgorithm=function(){},pullAlgorithm=function(){return promiseResolvedWith(void 0)},cancelAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==r.start&&(startAlgorithm=function(){return r.start(o)});void 0!==r.pull&&(pullAlgorithm=function(){return r.pull(o)});void 0!==r.cancel&&(cancelAlgorithm=function(t){return r.cancel(t)});var i=r.autoAllocateChunkSize;!function SetUpReadableByteStreamController(t,r,a,o,i,l,u){r._controlledReadableByteStream=t;r._pullAgain=!1;r._pulling=!1;r._byobRequest=null;r._queue=r._queueTotalSize=void 0;ResetQueue(r);r._closeRequested=!1;r._started=!1;r._strategyHWM=l;r._pullAlgorithm=o;r._cancelAlgorithm=i;r._autoAllocateChunkSize=u;r._pendingPullIntos=new h;t._readableStreamController=r;uponPromise(promiseResolvedWith(a()),(function(){r._started=!0;ReadableByteStreamControllerCallPullIfNeeded(r)}),(function(t){ReadableByteStreamControllerError(r,t)}))}(t,o,startAlgorithm,pullAlgorithm,cancelAlgorithm,a,i)}function byobRequestBrandCheckException(t){return new TypeError("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function byteStreamControllerBrandCheckException(t){return new TypeError("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function ReadableStreamAddReadIntoRequest(t,r){t._reader._readIntoRequests.push(r)}function ReadableStreamGetNumReadIntoRequests(t){return t._reader._readIntoRequests.length}function ReadableStreamHasBYOBReader(t){var r=t._reader;return void 0!==r&&!!IsReadableStreamBYOBReader(r)}var x=function(){function ReadableStreamBYOBReader(t){assertRequiredArgument(t,1,"ReadableStreamBYOBReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!IsReadableByteStreamController(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ReadableStreamReaderGenericInitialize(this,t);this._readIntoRequests=new h}Object.defineProperty(ReadableStreamBYOBReader.prototype,"closed",{get:function(){return IsReadableStreamBYOBReader(this)?this._closedPromise:promiseRejectedWith(byobReaderBrandCheckException("closed"))},enumerable:!1,configurable:!0});ReadableStreamBYOBReader.prototype.cancel=function(t){void 0===t&&(t=void 0);return IsReadableStreamBYOBReader(this)?void 0===this._ownerReadableStream?promiseRejectedWith(readerLockException("cancel")):ReadableStreamReaderGenericCancel(this,t):promiseRejectedWith(byobReaderBrandCheckException("cancel"))};ReadableStreamBYOBReader.prototype.read=function(t){if(!IsReadableStreamBYOBReader(this))return promiseRejectedWith(byobReaderBrandCheckException("read"));if(!ArrayBuffer.isView(t))return promiseRejectedWith(new TypeError("view must be an array buffer view"));if(0===t.byteLength)return promiseRejectedWith(new TypeError("view must have non-zero byteLength"));if(0===t.buffer.byteLength)return promiseRejectedWith(new TypeError("view's buffer must have non-zero byteLength"));if(void 0===this._ownerReadableStream)return promiseRejectedWith(readerLockException("read from"));var r,a,o=newPromise((function(t,o){r=t;a=o}));!function ReadableStreamBYOBReaderRead(t,r,a){var o=t._ownerReadableStream;o._disturbed=!0;"errored"===o._state?a._errorSteps(o._storedError):function ReadableByteStreamControllerPullInto(t,r,a){var o=t._controlledReadableByteStream,i=1;r.constructor!==DataView&&(i=r.constructor.BYTES_PER_ELEMENT);var l=r.constructor,u={buffer:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength,bytesFilled:0,elementSize:i,viewConstructor:l,readerType:"byob"};if(t._pendingPullIntos.length>0){t._pendingPullIntos.push(u);ReadableStreamAddReadIntoRequest(o,a)}else if("closed"!==o._state){if(t._queueTotalSize>0){if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,u)){var c=ReadableByteStreamControllerConvertPullIntoDescriptor(u);ReadableByteStreamControllerHandleQueueDrain(t);a._chunkSteps(c);return}if(t._closeRequested){var d=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,d);a._errorSteps(d);return}}t._pendingPullIntos.push(u);ReadableStreamAddReadIntoRequest(o,a);ReadableByteStreamControllerCallPullIfNeeded(t)}else{var h=new l(u.buffer,u.byteOffset,0);a._closeSteps(h)}}(o._readableStreamController,r,a)}(this,t,{_chunkSteps:function(t){return r({value:t,done:!1})},_closeSteps:function(t){return r({value:t,done:!0})},_errorSteps:function(t){return a(t)}});return o};ReadableStreamBYOBReader.prototype.releaseLock=function(){if(!IsReadableStreamBYOBReader(this))throw byobReaderBrandCheckException("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");ReadableStreamReaderGenericRelease(this)}};return ReadableStreamBYOBReader}();Object.defineProperties(x.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(x.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function IsReadableStreamBYOBReader(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function byobReaderBrandCheckException(t){return new TypeError("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}function ExtractHighWaterMark(t,r){var a=t.highWaterMark;if(void 0===a)return r;if(k(a)||a<0)throw new RangeError("Invalid highWaterMark");return a}function ExtractSizeAlgorithm(t){var r=t.size;return r||function(){return 1}}function convertQueuingStrategy(t,r){assertDictionary(t,r);var a=null==t?void 0:t.highWaterMark,o=null==t?void 0:t.size;return{highWaterMark:void 0===a?void 0:convertUnrestrictedDouble(a),size:void 0===o?void 0:convertQueuingStrategySize(o,r+" has member 'size' that")}}function convertQueuingStrategySize(t,r){assertFunction(t,r);return function(r){return convertUnrestrictedDouble(t(r))}}function convertUnderlyingSinkAbortCallback(t,r,a){assertFunction(t,a);return function(a){return promiseCall(t,r,[a])}}function convertUnderlyingSinkCloseCallback(t,r,a){assertFunction(t,a);return function(){return promiseCall(t,r,[])}}function convertUnderlyingSinkStartCallback(t,r,a){assertFunction(t,a);return function(a){return reflectCall(t,r,[a])}}function convertUnderlyingSinkWriteCallback(t,r,a){assertFunction(t,a);return function(a,o){return promiseCall(t,r,[a,o])}}function assertWritableStream(t,r){if(!IsWritableStream(t))throw new TypeError(r+" is not a WritableStream.")}var T=function(){function WritableStream(t,r){void 0===t&&(t={});void 0===r&&(r={});void 0===t?t=null:assertObject(t,"First parameter");var a=convertQueuingStrategy(r,"Second parameter"),o=function convertUnderlyingSink(t,r){assertDictionary(t,r);var a=null==t?void 0:t.abort,o=null==t?void 0:t.close,i=null==t?void 0:t.start,l=null==t?void 0:t.type,u=null==t?void 0:t.write;return{abort:void 0===a?void 0:convertUnderlyingSinkAbortCallback(a,t,r+" has member 'abort' that"),close:void 0===o?void 0:convertUnderlyingSinkCloseCallback(o,t,r+" has member 'close' that"),start:void 0===i?void 0:convertUnderlyingSinkStartCallback(i,t,r+" has member 'start' that"),write:void 0===u?void 0:convertUnderlyingSinkWriteCallback(u,t,r+" has member 'write' that"),type:l}}(t,"First parameter");InitializeWritableStream(this);if(void 0!==o.type)throw new RangeError("Invalid type is specified");var i=ExtractSizeAlgorithm(a);!function SetUpWritableStreamDefaultControllerFromUnderlyingSink(t,r,a,o){var i=Object.create(I.prototype),startAlgorithm=function(){},writeAlgorithm=function(){return promiseResolvedWith(void 0)},closeAlgorithm=function(){return promiseResolvedWith(void 0)},abortAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==r.start&&(startAlgorithm=function(){return r.start(i)});void 0!==r.write&&(writeAlgorithm=function(t){return r.write(t,i)});void 0!==r.close&&(closeAlgorithm=function(){return r.close()});void 0!==r.abort&&(abortAlgorithm=function(t){return r.abort(t)});SetUpWritableStreamDefaultController(t,i,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,a,o)}(this,o,ExtractHighWaterMark(a,1),i)}Object.defineProperty(WritableStream.prototype,"locked",{get:function(){if(!IsWritableStream(this))throw streamBrandCheckException("locked");return IsWritableStreamLocked(this)},enumerable:!1,configurable:!0});WritableStream.prototype.abort=function(t){void 0===t&&(t=void 0);return IsWritableStream(this)?IsWritableStreamLocked(this)?promiseRejectedWith(new TypeError("Cannot abort a stream that already has a writer")):WritableStreamAbort(this,t):promiseRejectedWith(streamBrandCheckException("abort"))};WritableStream.prototype.close=function(){return IsWritableStream(this)?IsWritableStreamLocked(this)?promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer")):WritableStreamCloseQueuedOrInFlight(this)?promiseRejectedWith(new TypeError("Cannot close an already-closing stream")):WritableStreamClose(this):promiseRejectedWith(streamBrandCheckException("close"))};WritableStream.prototype.getWriter=function(){if(!IsWritableStream(this))throw streamBrandCheckException("getWriter");return AcquireWritableStreamDefaultWriter(this)};return WritableStream}();Object.defineProperties(T.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(T.prototype,r.toStringTag,{value:"WritableStream",configurable:!0});function AcquireWritableStreamDefaultWriter(t){return new E(t)}function InitializeWritableStream(t){t._state="writable";t._storedError=void 0;t._writer=void 0;t._writableStreamController=void 0;t._writeRequests=new h;t._inFlightWriteRequest=void 0;t._closeRequest=void 0;t._inFlightCloseRequest=void 0;t._pendingAbortRequest=void 0;t._backpressure=!1}function IsWritableStream(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function IsWritableStreamLocked(t){return void 0!==t._writer}function WritableStreamAbort(t,r){var a=t._state;if("closed"===a||"errored"===a)return promiseResolvedWith(void 0);if(void 0!==t._pendingAbortRequest)return t._pendingAbortRequest._promise;var o=!1;if("erroring"===a){o=!0;r=void 0}var i=newPromise((function(a,i){t._pendingAbortRequest={_promise:void 0,_resolve:a,_reject:i,_reason:r,_wasAlreadyErroring:o}}));t._pendingAbortRequest._promise=i;o||WritableStreamStartErroring(t,r);return i}function WritableStreamClose(t){var r=t._state;if("closed"===r||"errored"===r)return promiseRejectedWith(new TypeError("The stream (in "+r+" state) is not in the writable state and cannot be closed"));var a=newPromise((function(r,a){var o={_resolve:r,_reject:a};t._closeRequest=o})),o=t._writer;void 0!==o&&t._backpressure&&"writable"===r&&defaultWriterReadyPromiseResolve(o);!function WritableStreamDefaultControllerClose(t){EnqueueValueWithSize(t,O,0);WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}(t._writableStreamController);return a}function WritableStreamDealWithRejection(t,r){"writable"!==t._state?WritableStreamFinishErroring(t):WritableStreamStartErroring(t,r)}function WritableStreamStartErroring(t,r){var a=t._writableStreamController;t._state="erroring";t._storedError=r;var o=t._writer;void 0!==o&&WritableStreamDefaultWriterEnsureReadyPromiseRejected(o,r);!function WritableStreamHasOperationMarkedInFlight(t){return void 0!==t._inFlightWriteRequest||void 0!==t._inFlightCloseRequest}(t)&&a._started&&WritableStreamFinishErroring(t)}function WritableStreamFinishErroring(t){t._state="errored";t._writableStreamController[m]();var r=t._storedError;t._writeRequests.forEach((function(t){t._reject(r)}));t._writeRequests=new h;if(void 0!==t._pendingAbortRequest){var a=t._pendingAbortRequest;t._pendingAbortRequest=void 0;if(a._wasAlreadyErroring){a._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}else uponPromise(t._writableStreamController[p](a._reason),(function(){a._resolve();WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}),(function(r){a._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}))}else WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}function WritableStreamCloseQueuedOrInFlight(t){return void 0!==t._closeRequest||void 0!==t._inFlightCloseRequest}function WritableStreamRejectCloseAndClosedPromiseIfNeeded(t){if(void 0!==t._closeRequest){t._closeRequest._reject(t._storedError);t._closeRequest=void 0}var r=t._writer;void 0!==r&&defaultWriterClosedPromiseReject(r,t._storedError)}function WritableStreamUpdateBackpressure(t,r){var a=t._writer;void 0!==a&&r!==t._backpressure&&(r?function defaultWriterReadyPromiseReset(t){defaultWriterReadyPromiseInitialize(t)}(a):defaultWriterReadyPromiseResolve(a));t._backpressure=r}var E=function(){function WritableStreamDefaultWriter(t){assertRequiredArgument(t,1,"WritableStreamDefaultWriter");assertWritableStream(t,"First parameter");if(IsWritableStreamLocked(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t;t._writer=this;var r=t._state;if("writable"===r){!WritableStreamCloseQueuedOrInFlight(t)&&t._backpressure?defaultWriterReadyPromiseInitialize(this):defaultWriterReadyPromiseInitializeAsResolved(this);defaultWriterClosedPromiseInitialize(this)}else if("erroring"===r){defaultWriterReadyPromiseInitializeAsRejected(this,t._storedError);defaultWriterClosedPromiseInitialize(this)}else if("closed"===r){defaultWriterReadyPromiseInitializeAsResolved(this);!function defaultWriterClosedPromiseInitializeAsResolved(t){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseResolve(t)}(this)}else{var a=t._storedError;defaultWriterReadyPromiseInitializeAsRejected(this,a);defaultWriterClosedPromiseInitializeAsRejected(this,a)}}Object.defineProperty(WritableStreamDefaultWriter.prototype,"closed",{get:function(){return IsWritableStreamDefaultWriter(this)?this._closedPromise:promiseRejectedWith(defaultWriterBrandCheckException("closed"))},enumerable:!1,configurable:!0});Object.defineProperty(WritableStreamDefaultWriter.prototype,"desiredSize",{get:function(){if(!IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("desiredSize");if(void 0===this._ownerWritableStream)throw defaultWriterLockException("desiredSize");return function WritableStreamDefaultWriterGetDesiredSize(t){var r=t._ownerWritableStream,a=r._state;return"errored"===a||"erroring"===a?null:"closed"===a?0:WritableStreamDefaultControllerGetDesiredSize(r._writableStreamController)}(this)},enumerable:!1,configurable:!0});Object.defineProperty(WritableStreamDefaultWriter.prototype,"ready",{get:function(){return IsWritableStreamDefaultWriter(this)?this._readyPromise:promiseRejectedWith(defaultWriterBrandCheckException("ready"))},enumerable:!1,configurable:!0});WritableStreamDefaultWriter.prototype.abort=function(t){void 0===t&&(t=void 0);return IsWritableStreamDefaultWriter(this)?void 0===this._ownerWritableStream?promiseRejectedWith(defaultWriterLockException("abort")):function WritableStreamDefaultWriterAbort(t,r){return WritableStreamAbort(t._ownerWritableStream,r)}(this,t):promiseRejectedWith(defaultWriterBrandCheckException("abort"))};WritableStreamDefaultWriter.prototype.close=function(){if(!IsWritableStreamDefaultWriter(this))return promiseRejectedWith(defaultWriterBrandCheckException("close"));var t=this._ownerWritableStream;return void 0===t?promiseRejectedWith(defaultWriterLockException("close")):WritableStreamCloseQueuedOrInFlight(t)?promiseRejectedWith(new TypeError("Cannot close an already-closing stream")):WritableStreamDefaultWriterClose(this)};WritableStreamDefaultWriter.prototype.releaseLock=function(){if(!IsWritableStreamDefaultWriter(this))throw defaultWriterBrandCheckException("releaseLock");void 0!==this._ownerWritableStream&&WritableStreamDefaultWriterRelease(this)};WritableStreamDefaultWriter.prototype.write=function(t){void 0===t&&(t=void 0);return IsWritableStreamDefaultWriter(this)?void 0===this._ownerWritableStream?promiseRejectedWith(defaultWriterLockException("write to")):WritableStreamDefaultWriterWrite(this,t):promiseRejectedWith(defaultWriterBrandCheckException("write"))};return WritableStreamDefaultWriter}();Object.defineProperties(E.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(E.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function IsWritableStreamDefaultWriter(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")}function WritableStreamDefaultWriterClose(t){return WritableStreamClose(t._ownerWritableStream)}function WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,r){"pending"===t._closedPromiseState?defaultWriterClosedPromiseReject(t,r):function defaultWriterClosedPromiseResetToRejected(t,r){defaultWriterClosedPromiseInitializeAsRejected(t,r)}(t,r)}function WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,r){"pending"===t._readyPromiseState?defaultWriterReadyPromiseReject(t,r):function defaultWriterReadyPromiseResetToRejected(t,r){defaultWriterReadyPromiseInitializeAsRejected(t,r)}(t,r)}function WritableStreamDefaultWriterRelease(t){var r=t._ownerWritableStream,a=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,a);WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,a);r._writer=void 0;t._ownerWritableStream=void 0}function WritableStreamDefaultWriterWrite(t,r){var a=t._ownerWritableStream,o=a._writableStreamController,i=function WritableStreamDefaultControllerGetChunkSize(t,r){try{return t._strategySizeAlgorithm(r)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return 1}}(o,r);if(a!==t._ownerWritableStream)return promiseRejectedWith(defaultWriterLockException("write to"));var l=a._state;if("errored"===l)return promiseRejectedWith(a._storedError);if(WritableStreamCloseQueuedOrInFlight(a)||"closed"===l)return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===l)return promiseRejectedWith(a._storedError);var u=function WritableStreamAddWriteRequest(t){return newPromise((function(r,a){var o={_resolve:r,_reject:a};t._writeRequests.push(o)}))}(a);!function WritableStreamDefaultControllerWrite(t,r,a){try{EnqueueValueWithSize(t,r,a)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return}var o=t._controlledWritableStream;WritableStreamCloseQueuedOrInFlight(o)||"writable"!==o._state||WritableStreamUpdateBackpressure(o,WritableStreamDefaultControllerGetBackpressure(t));WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}(o,r,i);return u}var O={},I=function(){function WritableStreamDefaultController(){throw new TypeError("Illegal constructor")}WritableStreamDefaultController.prototype.error=function(t){void 0===t&&(t=void 0);if(!function IsWritableStreamDefaultController(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")}(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&WritableStreamDefaultControllerError(this,t)};WritableStreamDefaultController.prototype[p]=function(t){var r=this._abortAlgorithm(t);WritableStreamDefaultControllerClearAlgorithms(this);return r};WritableStreamDefaultController.prototype[m]=function(){ResetQueue(this)};return WritableStreamDefaultController}();Object.defineProperties(I.prototype,{error:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(I.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function SetUpWritableStreamDefaultController(t,r,a,o,i,l,u,c){r._controlledWritableStream=t;t._writableStreamController=r;r._queue=void 0;r._queueTotalSize=void 0;ResetQueue(r);r._started=!1;r._strategySizeAlgorithm=c;r._strategyHWM=u;r._writeAlgorithm=o;r._closeAlgorithm=i;r._abortAlgorithm=l;var d=WritableStreamDefaultControllerGetBackpressure(r);WritableStreamUpdateBackpressure(t,d);uponPromise(promiseResolvedWith(a()),(function(){r._started=!0;WritableStreamDefaultControllerAdvanceQueueIfNeeded(r)}),(function(a){r._started=!0;WritableStreamDealWithRejection(t,a)}))}function WritableStreamDefaultControllerClearAlgorithms(t){t._writeAlgorithm=void 0;t._closeAlgorithm=void 0;t._abortAlgorithm=void 0;t._strategySizeAlgorithm=void 0}function WritableStreamDefaultControllerGetDesiredSize(t){return t._strategyHWM-t._queueTotalSize}function WritableStreamDefaultControllerAdvanceQueueIfNeeded(t){var r=t._controlledWritableStream;if(t._started&&void 0===r._inFlightWriteRequest)if("erroring"!==r._state){if(0!==t._queue.length){var a=function PeekQueueValue(t){return t._queue.peek().value}(t);a===O?function WritableStreamDefaultControllerProcessClose(t){var r=t._controlledWritableStream;!function WritableStreamMarkCloseRequestInFlight(t){t._inFlightCloseRequest=t._closeRequest;t._closeRequest=void 0}(r);DequeueValue(t);var a=t._closeAlgorithm();WritableStreamDefaultControllerClearAlgorithms(t);uponPromise(a,(function(){!function WritableStreamFinishInFlightClose(t){t._inFlightCloseRequest._resolve(void 0);t._inFlightCloseRequest=void 0;if("erroring"===t._state){t._storedError=void 0;if(void 0!==t._pendingAbortRequest){t._pendingAbortRequest._resolve();t._pendingAbortRequest=void 0}}t._state="closed";var r=t._writer;void 0!==r&&defaultWriterClosedPromiseResolve(r)}(r)}),(function(t){!function WritableStreamFinishInFlightCloseWithError(t,r){t._inFlightCloseRequest._reject(r);t._inFlightCloseRequest=void 0;if(void 0!==t._pendingAbortRequest){t._pendingAbortRequest._reject(r);t._pendingAbortRequest=void 0}WritableStreamDealWithRejection(t,r)}(r,t)}))}(t):function WritableStreamDefaultControllerProcessWrite(t,r){var a=t._controlledWritableStream;!function WritableStreamMarkFirstWriteRequestInFlight(t){t._inFlightWriteRequest=t._writeRequests.shift()}(a);uponPromise(t._writeAlgorithm(r),(function(){!function WritableStreamFinishInFlightWrite(t){t._inFlightWriteRequest._resolve(void 0);t._inFlightWriteRequest=void 0}(a);var r=a._state;DequeueValue(t);if(!WritableStreamCloseQueuedOrInFlight(a)&&"writable"===r){var o=WritableStreamDefaultControllerGetBackpressure(t);WritableStreamUpdateBackpressure(a,o)}WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}),(function(r){"writable"===a._state&&WritableStreamDefaultControllerClearAlgorithms(t);!function WritableStreamFinishInFlightWriteWithError(t,r){t._inFlightWriteRequest._reject(r);t._inFlightWriteRequest=void 0;WritableStreamDealWithRejection(t,r)}(a,r)}))}(t,a)}}else WritableStreamFinishErroring(r)}function WritableStreamDefaultControllerErrorIfNeeded(t,r){"writable"===t._controlledWritableStream._state&&WritableStreamDefaultControllerError(t,r)}function WritableStreamDefaultControllerGetBackpressure(t){return WritableStreamDefaultControllerGetDesiredSize(t)<=0}function WritableStreamDefaultControllerError(t,r){var a=t._controlledWritableStream;WritableStreamDefaultControllerClearAlgorithms(t);WritableStreamStartErroring(a,r)}function streamBrandCheckException(t){return new TypeError("WritableStream.prototype."+t+" can only be used on a WritableStream")}function defaultWriterBrandCheckException(t){return new TypeError("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function defaultWriterLockException(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function defaultWriterClosedPromiseInitialize(t){t._closedPromise=newPromise((function(r,a){t._closedPromise_resolve=r;t._closedPromise_reject=a;t._closedPromiseState="pending"}))}function defaultWriterClosedPromiseInitializeAsRejected(t,r){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseReject(t,r)}function defaultWriterClosedPromiseReject(t,r){if(void 0!==t._closedPromise_reject){setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=void 0;t._closedPromise_reject=void 0;t._closedPromiseState="rejected"}}function defaultWriterClosedPromiseResolve(t){if(void 0!==t._closedPromise_resolve){t._closedPromise_resolve(void 0);t._closedPromise_resolve=void 0;t._closedPromise_reject=void 0;t._closedPromiseState="resolved"}}function defaultWriterReadyPromiseInitialize(t){t._readyPromise=newPromise((function(r,a){t._readyPromise_resolve=r;t._readyPromise_reject=a}));t._readyPromiseState="pending"}function defaultWriterReadyPromiseInitializeAsRejected(t,r){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseReject(t,r)}function defaultWriterReadyPromiseInitializeAsResolved(t){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseResolve(t)}function defaultWriterReadyPromiseReject(t,r){if(void 0!==t._readyPromise_reject){setPromiseIsHandledToTrue(t._readyPromise);t._readyPromise_reject(r);t._readyPromise_resolve=void 0;t._readyPromise_reject=void 0;t._readyPromiseState="rejected"}}function defaultWriterReadyPromiseResolve(t){if(void 0!==t._readyPromise_resolve){t._readyPromise_resolve(void 0);t._readyPromise_resolve=void 0;t._readyPromise_reject=void 0;t._readyPromiseState="fulfilled"}}var D="undefined"!=typeof DOMException?DOMException:void 0,L=function isDOMExceptionConstructor(t){if("function"!=typeof t&&"object"!=typeof t)return!1;try{new t;return!0}catch(t){return!1}}(D)?D:function createDOMExceptionPolyfill(){var t=function DOMException(t,r){this.message=t||"";this.name=r||"Error";Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};t.prototype=Object.create(Error.prototype);Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0});return t}();function ReadableStreamPipeTo(t,r,a,o,i,l){var u=AcquireReadableStreamDefaultReader(t),c=AcquireWritableStreamDefaultWriter(r);t._disturbed=!0;var d=!1,h=promiseResolvedWith(void 0);return newPromise((function(p,m){var v;if(void 0!==l){v=function(){var a=new L("Aborted","AbortError"),l=[];o||l.push((function(){return"writable"===r._state?WritableStreamAbort(r,a):promiseResolvedWith(void 0)}));i||l.push((function(){return"readable"===t._state?ReadableStreamCancel(t,a):promiseResolvedWith(void 0)}));shutdownWithAction((function(){return Promise.all(l.map((function(t){return t()})))}),!0,a)};if(l.aborted){v();return}l.addEventListener("abort",v)}isOrBecomesErrored(t,u._closedPromise,(function(t){o?shutdown(!0,t):shutdownWithAction((function(){return WritableStreamAbort(r,t)}),!0,t)}));isOrBecomesErrored(r,c._closedPromise,(function(r){i?shutdown(!0,r):shutdownWithAction((function(){return ReadableStreamCancel(t,r)}),!0,r)}));!function isOrBecomesClosed(t,r,a){"closed"===t._state?a():uponFulfillment(r,a)}(t,u._closedPromise,(function(){a?shutdown():shutdownWithAction((function(){return function WritableStreamDefaultWriterCloseWithErrorPropagation(t){var r=t._ownerWritableStream,a=r._state;return WritableStreamCloseQueuedOrInFlight(r)||"closed"===a?promiseResolvedWith(void 0):"errored"===a?promiseRejectedWith(r._storedError):WritableStreamDefaultWriterClose(t)}(c)}))}));if(WritableStreamCloseQueuedOrInFlight(r)||"closed"===r._state){var g=new TypeError("the destination writable stream closed before all data could be piped to it");i?shutdown(!0,g):shutdownWithAction((function(){return ReadableStreamCancel(t,g)}),!0,g)}setPromiseIsHandledToTrue(function pipeLoop(){return newPromise((function(t,r){!function next(a){a?t():PerformPromiseThen(function pipeStep(){return d?promiseResolvedWith(!0):PerformPromiseThen(c._readyPromise,(function(){return newPromise((function(t,r){ReadableStreamDefaultReaderRead(u,{_chunkSteps:function(r){h=PerformPromiseThen(WritableStreamDefaultWriterWrite(c,r),void 0,noop);t(!1)},_closeSteps:function(){return t(!0)},_errorSteps:r})}))}))}(),next,r)}(!1)}))}());function waitForWritesToFinish(){var t=h;return PerformPromiseThen(h,(function(){return t!==h?waitForWritesToFinish():void 0}))}function isOrBecomesErrored(t,r,a){"errored"===t._state?a(t._storedError):uponRejection(r,a)}function shutdownWithAction(t,a,o){if(!d){d=!0;"writable"!==r._state||WritableStreamCloseQueuedOrInFlight(r)?doTheRest():uponFulfillment(waitForWritesToFinish(),doTheRest)}function doTheRest(){uponPromise(t(),(function(){return finalize(a,o)}),(function(t){return finalize(!0,t)}))}}function shutdown(t,a){if(!d){d=!0;"writable"!==r._state||WritableStreamCloseQueuedOrInFlight(r)?finalize(t,a):uponFulfillment(waitForWritesToFinish(),(function(){return finalize(t,a)}))}}function finalize(t,r){WritableStreamDefaultWriterRelease(c);ReadableStreamReaderGenericRelease(u);void 0!==l&&l.removeEventListener("abort",v);t?m(r):p(void 0)}}))}var M=function(){function ReadableStreamDefaultController(){throw new TypeError("Illegal constructor")}Object.defineProperty(ReadableStreamDefaultController.prototype,"desiredSize",{get:function(){if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException("desiredSize");return ReadableStreamDefaultControllerGetDesiredSize(this)},enumerable:!1,configurable:!0});ReadableStreamDefaultController.prototype.close=function(){if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException("close");if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this))throw new TypeError("The stream is not in a state that permits close");ReadableStreamDefaultControllerClose(this)};ReadableStreamDefaultController.prototype.enqueue=function(t){void 0===t&&(t=void 0);if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException("enqueue");if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this))throw new TypeError("The stream is not in a state that permits enqueue");return ReadableStreamDefaultControllerEnqueue(this,t)};ReadableStreamDefaultController.prototype.error=function(t){void 0===t&&(t=void 0);if(!IsReadableStreamDefaultController(this))throw defaultControllerBrandCheckException("error");ReadableStreamDefaultControllerError(this,t)};ReadableStreamDefaultController.prototype[v]=function(t){ResetQueue(this);var r=this._cancelAlgorithm(t);ReadableStreamDefaultControllerClearAlgorithms(this);return r};ReadableStreamDefaultController.prototype[g]=function(t){var r=this._controlledReadableStream;if(this._queue.length>0){var a=DequeueValue(this);if(this._closeRequested&&0===this._queue.length){ReadableStreamDefaultControllerClearAlgorithms(this);ReadableStreamClose(r)}else ReadableStreamDefaultControllerCallPullIfNeeded(this);t._chunkSteps(a)}else{ReadableStreamAddReadRequest(r,t);ReadableStreamDefaultControllerCallPullIfNeeded(this)}};return ReadableStreamDefaultController}();Object.defineProperties(M.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(M.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function IsReadableStreamDefaultController(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function ReadableStreamDefaultControllerCallPullIfNeeded(t){if(ReadableStreamDefaultControllerShouldCallPull(t))if(t._pulling)t._pullAgain=!0;else{t._pulling=!0;uponPromise(t._pullAlgorithm(),(function(){t._pulling=!1;if(t._pullAgain){t._pullAgain=!1;ReadableStreamDefaultControllerCallPullIfNeeded(t)}}),(function(r){ReadableStreamDefaultControllerError(t,r)}))}}function ReadableStreamDefaultControllerShouldCallPull(t){var r=t._controlledReadableStream;return!!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)&&!!t._started&&(!!(IsReadableStreamLocked(r)&&ReadableStreamGetNumReadRequests(r)>0)||ReadableStreamDefaultControllerGetDesiredSize(t)>0)}function ReadableStreamDefaultControllerClearAlgorithms(t){t._pullAlgorithm=void 0;t._cancelAlgorithm=void 0;t._strategySizeAlgorithm=void 0}function ReadableStreamDefaultControllerClose(t){if(ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){var r=t._controlledReadableStream;t._closeRequested=!0;if(0===t._queue.length){ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamClose(r)}}}function ReadableStreamDefaultControllerEnqueue(t,r){if(ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){var a=t._controlledReadableStream;if(IsReadableStreamLocked(a)&&ReadableStreamGetNumReadRequests(a)>0)ReadableStreamFulfillReadRequest(a,r,!1);else{var o=void 0;try{o=t._strategySizeAlgorithm(r)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}try{EnqueueValueWithSize(t,r,o)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}}ReadableStreamDefaultControllerCallPullIfNeeded(t)}}function ReadableStreamDefaultControllerError(t,r){var a=t._controlledReadableStream;if("readable"===a._state){ResetQueue(t);ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamError(a,r)}}function ReadableStreamDefaultControllerGetDesiredSize(t){var r=t._controlledReadableStream._state;return"errored"===r?null:"closed"===r?0:t._strategyHWM-t._queueTotalSize}function ReadableStreamDefaultControllerCanCloseOrEnqueue(t){var r=t._controlledReadableStream._state;return!t._closeRequested&&"readable"===r}function SetUpReadableStreamDefaultController(t,r,a,o,i,l,u){r._controlledReadableStream=t;r._queue=void 0;r._queueTotalSize=void 0;ResetQueue(r);r._started=!1;r._closeRequested=!1;r._pullAgain=!1;r._pulling=!1;r._strategySizeAlgorithm=u;r._strategyHWM=l;r._pullAlgorithm=o;r._cancelAlgorithm=i;t._readableStreamController=r;uponPromise(promiseResolvedWith(a()),(function(){r._started=!0;ReadableStreamDefaultControllerCallPullIfNeeded(r)}),(function(t){ReadableStreamDefaultControllerError(r,t)}))}function defaultControllerBrandCheckException(t){return new TypeError("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}function convertUnderlyingSourceCancelCallback(t,r,a){assertFunction(t,a);return function(a){return promiseCall(t,r,[a])}}function convertUnderlyingSourcePullCallback(t,r,a){assertFunction(t,a);return function(a){return promiseCall(t,r,[a])}}function convertUnderlyingSourceStartCallback(t,r,a){assertFunction(t,a);return function(a){return reflectCall(t,r,[a])}}function convertReadableStreamType(t,r){if("bytes"!=(t=""+t))throw new TypeError(r+" '"+t+"' is not a valid enumeration value for ReadableStreamType");return t}function convertReadableStreamReaderMode(t,r){if("byob"!=(t=""+t))throw new TypeError(r+" '"+t+"' is not a valid enumeration value for ReadableStreamReaderMode");return t}function convertPipeOptions(t,r){assertDictionary(t,r);var a=null==t?void 0:t.preventAbort,o=null==t?void 0:t.preventCancel,i=null==t?void 0:t.preventClose,l=null==t?void 0:t.signal;void 0!==l&&function assertAbortSignal(t,r){if(!function isAbortSignal(t){if("object"!=typeof t||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}(t))throw new TypeError(r+" is not an AbortSignal.")}(l,r+" has member 'signal' that");return{preventAbort:Boolean(a),preventCancel:Boolean(o),preventClose:Boolean(i),signal:l}}var W=function(){function ReadableStream(t,r){void 0===t&&(t={});void 0===r&&(r={});void 0===t?t=null:assertObject(t,"First parameter");var a=convertQueuingStrategy(r,"Second parameter"),o=function convertUnderlyingDefaultOrByteSource(t,r){assertDictionary(t,r);var a=t,o=null==a?void 0:a.autoAllocateChunkSize,i=null==a?void 0:a.cancel,l=null==a?void 0:a.pull,u=null==a?void 0:a.start,c=null==a?void 0:a.type;return{autoAllocateChunkSize:void 0===o?void 0:convertUnsignedLongLongWithEnforceRange(o,r+" has member 'autoAllocateChunkSize' that"),cancel:void 0===i?void 0:convertUnderlyingSourceCancelCallback(i,a,r+" has member 'cancel' that"),pull:void 0===l?void 0:convertUnderlyingSourcePullCallback(l,a,r+" has member 'pull' that"),start:void 0===u?void 0:convertUnderlyingSourceStartCallback(u,a,r+" has member 'start' that"),type:void 0===c?void 0:convertReadableStreamType(c,r+" has member 'type' that")}}(t,"First parameter");InitializeReadableStream(this);if("bytes"===o.type){if(void 0!==a.size)throw new RangeError("The strategy for a byte stream cannot have a size function");SetUpReadableByteStreamControllerFromUnderlyingSource(this,o,ExtractHighWaterMark(a,0))}else{var i=ExtractSizeAlgorithm(a);!function SetUpReadableStreamDefaultControllerFromUnderlyingSource(t,r,a,o){var i=Object.create(M.prototype),startAlgorithm=function(){},pullAlgorithm=function(){return promiseResolvedWith(void 0)},cancelAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==r.start&&(startAlgorithm=function(){return r.start(i)});void 0!==r.pull&&(pullAlgorithm=function(){return r.pull(i)});void 0!==r.cancel&&(cancelAlgorithm=function(t){return r.cancel(t)});SetUpReadableStreamDefaultController(t,i,startAlgorithm,pullAlgorithm,cancelAlgorithm,a,o)}(this,o,ExtractHighWaterMark(a,1),i)}}Object.defineProperty(ReadableStream.prototype,"locked",{get:function(){if(!IsReadableStream(this))throw streamBrandCheckException$1("locked");return IsReadableStreamLocked(this)},enumerable:!1,configurable:!0});ReadableStream.prototype.cancel=function(t){void 0===t&&(t=void 0);return IsReadableStream(this)?IsReadableStreamLocked(this)?promiseRejectedWith(new TypeError("Cannot cancel a stream that already has a reader")):ReadableStreamCancel(this,t):promiseRejectedWith(streamBrandCheckException$1("cancel"))};ReadableStream.prototype.getReader=function(t){void 0===t&&(t=void 0);if(!IsReadableStream(this))throw streamBrandCheckException$1("getReader");return void 0===function convertReaderOptions(t,r){assertDictionary(t,r);var a=null==t?void 0:t.mode;return{mode:void 0===a?void 0:convertReadableStreamReaderMode(a,r+" has member 'mode' that")}}(t,"First parameter").mode?AcquireReadableStreamDefaultReader(this):function AcquireReadableStreamBYOBReader(t){return new x(t)}(this)};ReadableStream.prototype.pipeThrough=function(t,r){void 0===r&&(r={});if(!IsReadableStream(this))throw streamBrandCheckException$1("pipeThrough");assertRequiredArgument(t,1,"pipeThrough");var a=function convertReadableWritablePair(t,r){assertDictionary(t,r);var a=null==t?void 0:t.readable;assertRequiredField(a,"readable","ReadableWritablePair");assertReadableStream(a,r+" has member 'readable' that");var o=null==t?void 0:t.writable;assertRequiredField(o,"writable","ReadableWritablePair");assertWritableStream(o,r+" has member 'writable' that");return{readable:a,writable:o}}(t,"First parameter"),o=convertPipeOptions(r,"Second parameter");if(IsReadableStreamLocked(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(IsWritableStreamLocked(a.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");setPromiseIsHandledToTrue(ReadableStreamPipeTo(this,a.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal));return a.readable};ReadableStream.prototype.pipeTo=function(t,r){void 0===r&&(r={});if(!IsReadableStream(this))return promiseRejectedWith(streamBrandCheckException$1("pipeTo"));if(void 0===t)return promiseRejectedWith("Parameter 1 is required in 'pipeTo'.");if(!IsWritableStream(t))return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var a;try{a=convertPipeOptions(r,"Second parameter")}catch(t){return promiseRejectedWith(t)}return IsReadableStreamLocked(this)?promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):IsWritableStreamLocked(t)?promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ReadableStreamPipeTo(this,t,a.preventClose,a.preventAbort,a.preventCancel,a.signal)};ReadableStream.prototype.tee=function(){if(!IsReadableStream(this))throw streamBrandCheckException$1("tee");var t=function ReadableStreamTee(t,r){var a,o,i,l,u,c=AcquireReadableStreamDefaultReader(t),h=!1,p=!1,m=!1,v=newPromise((function(t){u=t}));function pullAlgorithm(){if(h)return promiseResolvedWith(void 0);h=!0;ReadableStreamDefaultReaderRead(c,{_chunkSteps:function(t){d((function(){h=!1;var r=t,a=t;p||ReadableStreamDefaultControllerEnqueue(i._readableStreamController,r);m||ReadableStreamDefaultControllerEnqueue(l._readableStreamController,a);u(void 0)}))},_closeSteps:function(){h=!1;p||ReadableStreamDefaultControllerClose(i._readableStreamController);m||ReadableStreamDefaultControllerClose(l._readableStreamController)},_errorSteps:function(){h=!1}});return promiseResolvedWith(void 0)}function startAlgorithm(){}i=CreateReadableStream(startAlgorithm,pullAlgorithm,(function cancel1Algorithm(r){p=!0;a=r;if(m){var i=CreateArrayFromList([a,o]),l=ReadableStreamCancel(t,i);u(l)}return v}));l=CreateReadableStream(startAlgorithm,pullAlgorithm,(function cancel2Algorithm(r){m=!0;o=r;if(p){var i=CreateArrayFromList([a,o]),l=ReadableStreamCancel(t,i);u(l)}return v}));uponRejection(c._closedPromise,(function(t){ReadableStreamDefaultControllerError(i._readableStreamController,t);ReadableStreamDefaultControllerError(l._readableStreamController,t);u(void 0)}));return[i,l]}(this);return CreateArrayFromList(t)};ReadableStream.prototype.values=function(t){void 0===t&&(t=void 0);if(!IsReadableStream(this))throw streamBrandCheckException$1("values");return function AcquireReadableStreamAsyncIterator(t,r){var a=AcquireReadableStreamDefaultReader(t),o=new A(a,r),i=Object.create(R);i._asyncIteratorImpl=o;return i}(this,function convertIteratorOptions(t,r){assertDictionary(t,r);var a=null==t?void 0:t.preventCancel;return{preventCancel:Boolean(a)}}(t,"First parameter").preventCancel)};return ReadableStream}();Object.defineProperties(W.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(W.prototype,r.toStringTag,{value:"ReadableStream",configurable:!0});"symbol"==typeof r.asyncIterator&&Object.defineProperty(W.prototype,r.asyncIterator,{value:W.prototype.values,writable:!0,configurable:!0});function CreateReadableStream(t,r,a,o,i){void 0===o&&(o=1);void 0===i&&(i=function(){return 1});var l=Object.create(W.prototype);InitializeReadableStream(l);SetUpReadableStreamDefaultController(l,Object.create(M.prototype),t,r,a,o,i);return l}function InitializeReadableStream(t){t._state="readable";t._reader=void 0;t._storedError=void 0;t._disturbed=!1}function IsReadableStream(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function IsReadableStreamLocked(t){return void 0!==t._reader}function ReadableStreamCancel(t,r){t._disturbed=!0;if("closed"===t._state)return promiseResolvedWith(void 0);if("errored"===t._state)return promiseRejectedWith(t._storedError);ReadableStreamClose(t);return transformPromiseWith(t._readableStreamController[v](r),noop)}function ReadableStreamClose(t){t._state="closed";var r=t._reader;if(void 0!==r){if(IsReadableStreamDefaultReader(r)){r._readRequests.forEach((function(t){t._closeSteps()}));r._readRequests=new h}defaultReaderClosedPromiseResolve(r)}}function ReadableStreamError(t,r){t._state="errored";t._storedError=r;var a=t._reader;if(void 0!==a){if(IsReadableStreamDefaultReader(a)){a._readRequests.forEach((function(t){t._errorSteps(r)}));a._readRequests=new h}else{a._readIntoRequests.forEach((function(t){t._errorSteps(r)}));a._readIntoRequests=new h}defaultReaderClosedPromiseReject(a,r)}}function streamBrandCheckException$1(t){return new TypeError("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}function convertQueuingStrategyInit(t,r){assertDictionary(t,r);var a=null==t?void 0:t.highWaterMark;assertRequiredField(a,"highWaterMark","QueuingStrategyInit");return{highWaterMark:convertUnrestrictedDouble(a)}}var j=function size(t){return t.byteLength},N=function(){function ByteLengthQueuingStrategy(t){assertRequiredArgument(t,1,"ByteLengthQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._byteLengthQueuingStrategyHighWaterMark=t.highWaterMark}Object.defineProperty(ByteLengthQueuingStrategy.prototype,"highWaterMark",{get:function(){if(!IsByteLengthQueuingStrategy(this))throw byteLengthBrandCheckException("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0});Object.defineProperty(ByteLengthQueuingStrategy.prototype,"size",{get:function(){if(!IsByteLengthQueuingStrategy(this))throw byteLengthBrandCheckException("size");return j},enumerable:!1,configurable:!0});return ByteLengthQueuingStrategy}();Object.defineProperties(N.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(N.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function byteLengthBrandCheckException(t){return new TypeError("ByteLengthQueuingStrategy.prototype."+t+" can only be used on a ByteLengthQueuingStrategy")}function IsByteLengthQueuingStrategy(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")}var B=function size(){return 1},q=function(){function CountQueuingStrategy(t){assertRequiredArgument(t,1,"CountQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._countQueuingStrategyHighWaterMark=t.highWaterMark}Object.defineProperty(CountQueuingStrategy.prototype,"highWaterMark",{get:function(){if(!IsCountQueuingStrategy(this))throw countBrandCheckException("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0});Object.defineProperty(CountQueuingStrategy.prototype,"size",{get:function(){if(!IsCountQueuingStrategy(this))throw countBrandCheckException("size");return B},enumerable:!1,configurable:!0});return CountQueuingStrategy}();Object.defineProperties(q.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(q.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function countBrandCheckException(t){return new TypeError("CountQueuingStrategy.prototype."+t+" can only be used on a CountQueuingStrategy")}function IsCountQueuingStrategy(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")}function convertTransformerFlushCallback(t,r,a){assertFunction(t,a);return function(a){return promiseCall(t,r,[a])}}function convertTransformerStartCallback(t,r,a){assertFunction(t,a);return function(a){return reflectCall(t,r,[a])}}function convertTransformerTransformCallback(t,r,a){assertFunction(t,a);return function(a,o){return promiseCall(t,r,[a,o])}}var G=function(){function TransformStream(t,r,a){void 0===t&&(t={});void 0===r&&(r={});void 0===a&&(a={});void 0===t&&(t=null);var o=convertQueuingStrategy(r,"Second parameter"),i=convertQueuingStrategy(a,"Third parameter"),l=function convertTransformer(t,r){assertDictionary(t,r);var a=null==t?void 0:t.flush,o=null==t?void 0:t.readableType,i=null==t?void 0:t.start,l=null==t?void 0:t.transform,u=null==t?void 0:t.writableType;return{flush:void 0===a?void 0:convertTransformerFlushCallback(a,t,r+" has member 'flush' that"),readableType:o,start:void 0===i?void 0:convertTransformerStartCallback(i,t,r+" has member 'start' that"),transform:void 0===l?void 0:convertTransformerTransformCallback(l,t,r+" has member 'transform' that"),writableType:u}}(t,"First parameter");if(void 0!==l.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==l.writableType)throw new RangeError("Invalid writableType specified");var u,c=ExtractHighWaterMark(i,0),d=ExtractSizeAlgorithm(i),h=ExtractHighWaterMark(o,1),p=ExtractSizeAlgorithm(o);!function InitializeTransformStream(t,r,a,o,i,l){function startAlgorithm(){return r}function writeAlgorithm(r){return function TransformStreamDefaultSinkWriteAlgorithm(t,r){var a=t._transformStreamController;return t._backpressure?transformPromiseWith(t._backpressureChangePromise,(function(){var o=t._writable;if("erroring"===o._state)throw o._storedError;return TransformStreamDefaultControllerPerformTransform(a,r)})):TransformStreamDefaultControllerPerformTransform(a,r)}(t,r)}function abortAlgorithm(r){return function TransformStreamDefaultSinkAbortAlgorithm(t,r){TransformStreamError(t,r);return promiseResolvedWith(void 0)}(t,r)}function closeAlgorithm(){return function TransformStreamDefaultSinkCloseAlgorithm(t){var r=t._readable,a=t._transformStreamController,o=a._flushAlgorithm();TransformStreamDefaultControllerClearAlgorithms(a);return transformPromiseWith(o,(function(){if("errored"===r._state)throw r._storedError;ReadableStreamDefaultControllerClose(r._readableStreamController)}),(function(a){TransformStreamError(t,a);throw r._storedError}))}(t)}t._writable=function CreateWritableStream(t,r,a,o,i,l){void 0===i&&(i=1);void 0===l&&(l=function(){return 1});var u=Object.create(T.prototype);InitializeWritableStream(u);SetUpWritableStreamDefaultController(u,Object.create(I.prototype),t,r,a,o,i,l);return u}(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,a,o);function pullAlgorithm(){return function TransformStreamDefaultSourcePullAlgorithm(t){TransformStreamSetBackpressure(t,!1);return t._backpressureChangePromise}(t)}function cancelAlgorithm(r){TransformStreamErrorWritableAndUnblockWrite(t,r);return promiseResolvedWith(void 0)}t._readable=CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,i,l);t._backpressure=void 0;t._backpressureChangePromise=void 0;t._backpressureChangePromise_resolve=void 0;TransformStreamSetBackpressure(t,!0);t._transformStreamController=void 0}(this,newPromise((function(t){u=t})),h,p,c,d);!function SetUpTransformStreamDefaultControllerFromTransformer(t,r){var a=Object.create(U.prototype),transformAlgorithm=function(t){try{TransformStreamDefaultControllerEnqueue(a,t);return promiseResolvedWith(void 0)}catch(t){return promiseRejectedWith(t)}},flushAlgorithm=function(){return promiseResolvedWith(void 0)};void 0!==r.transform&&(transformAlgorithm=function(t){return r.transform(t,a)});void 0!==r.flush&&(flushAlgorithm=function(){return r.flush(a)});!function SetUpTransformStreamDefaultController(t,r,a,o){r._controlledTransformStream=t;t._transformStreamController=r;r._transformAlgorithm=a;r._flushAlgorithm=o}(t,a,transformAlgorithm,flushAlgorithm)}(this,l);void 0!==l.start?u(l.start(this._transformStreamController)):u(void 0)}Object.defineProperty(TransformStream.prototype,"readable",{get:function(){if(!IsTransformStream(this))throw streamBrandCheckException$2("readable");return this._readable},enumerable:!1,configurable:!0});Object.defineProperty(TransformStream.prototype,"writable",{get:function(){if(!IsTransformStream(this))throw streamBrandCheckException$2("writable");return this._writable},enumerable:!1,configurable:!0});return TransformStream}();Object.defineProperties(G.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(G.prototype,r.toStringTag,{value:"TransformStream",configurable:!0});function IsTransformStream(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")}function TransformStreamError(t,r){ReadableStreamDefaultControllerError(t._readable._readableStreamController,r);TransformStreamErrorWritableAndUnblockWrite(t,r)}function TransformStreamErrorWritableAndUnblockWrite(t,r){TransformStreamDefaultControllerClearAlgorithms(t._transformStreamController);WritableStreamDefaultControllerErrorIfNeeded(t._writable._writableStreamController,r);t._backpressure&&TransformStreamSetBackpressure(t,!1)}function TransformStreamSetBackpressure(t,r){void 0!==t._backpressureChangePromise&&t._backpressureChangePromise_resolve();t._backpressureChangePromise=newPromise((function(r){t._backpressureChangePromise_resolve=r}));t._backpressure=r}var U=function(){function TransformStreamDefaultController(){throw new TypeError("Illegal constructor")}Object.defineProperty(TransformStreamDefaultController.prototype,"desiredSize",{get:function(){if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException$1("desiredSize");return ReadableStreamDefaultControllerGetDesiredSize(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0});TransformStreamDefaultController.prototype.enqueue=function(t){void 0===t&&(t=void 0);if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException$1("enqueue");TransformStreamDefaultControllerEnqueue(this,t)};TransformStreamDefaultController.prototype.error=function(t){void 0===t&&(t=void 0);if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException$1("error");!function TransformStreamDefaultControllerError(t,r){TransformStreamError(t._controlledTransformStream,r)}(this,t)};TransformStreamDefaultController.prototype.terminate=function(){if(!IsTransformStreamDefaultController(this))throw defaultControllerBrandCheckException$1("terminate");!function TransformStreamDefaultControllerTerminate(t){var r=t._controlledTransformStream;ReadableStreamDefaultControllerClose(r._readable._readableStreamController);var a=new TypeError("TransformStream terminated");TransformStreamErrorWritableAndUnblockWrite(r,a)}(this)};return TransformStreamDefaultController}();Object.defineProperties(U.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}});"symbol"==typeof r.toStringTag&&Object.defineProperty(U.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function IsTransformStreamDefaultController(t){return!!typeIsObject(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")}function TransformStreamDefaultControllerClearAlgorithms(t){t._transformAlgorithm=void 0;t._flushAlgorithm=void 0}function TransformStreamDefaultControllerEnqueue(t,r){var a=t._controlledTransformStream,o=a._readable._readableStreamController;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(o))throw new TypeError("Readable side is not in a state that permits enqueue");try{ReadableStreamDefaultControllerEnqueue(o,r)}catch(t){TransformStreamErrorWritableAndUnblockWrite(a,t);throw a._readable._storedError}(function ReadableStreamDefaultControllerHasBackpressure(t){return!ReadableStreamDefaultControllerShouldCallPull(t)})(o)!==a._backpressure&&TransformStreamSetBackpressure(a,!0)}function TransformStreamDefaultControllerPerformTransform(t,r){return transformPromiseWith(t._transformAlgorithm(r),void 0,(function(r){TransformStreamError(t._controlledTransformStream,r);throw r}))}function defaultControllerBrandCheckException$1(t){return new TypeError("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function streamBrandCheckException$2(t){return new TypeError("TransformStream.prototype."+t+" can only be used on a TransformStream")}t.ByteLengthQueuingStrategy=N;t.CountQueuingStrategy=q;t.ReadableByteStreamController=w;t.ReadableStream=W;t.ReadableStreamBYOBReader=x;t.ReadableStreamBYOBRequest=P;t.ReadableStreamDefaultController=M;t.ReadableStreamDefaultReader=C;t.TransformStream=G;t.TransformStreamDefaultController=U;t.WritableStream=T;t.WritableStreamDefaultController=I;t.WritableStreamDefaultWriter=E;Object.defineProperty(t,"__esModule",{value:!0})})(r)},(t,r,a)=>{a(123);var o=a(127);t.exports=o("String","padStart")},(t,r,a)=>{"use strict";var o=a(9),i=a(124).start;o({target:"String",proto:!0,forced:a(126)},{padStart:function padStart(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},(t,r,a)=>{var o=a(46),i=a(125),l=a(19),u=Math.ceil,createMethod=function(t){return function(r,a,c){var d,h,p=String(l(r)),m=p.length,v=void 0===c?" ":String(c),g=o(a);if(g<=m||""==v)return p;d=g-m;(h=i.call(v,u(d/v.length))).length>d&&(h=h.slice(0,d));return t?p+h:h+p}};t.exports={start:createMethod(!1),end:createMethod(!0)}},(t,r,a)=>{"use strict";var o=a(47),i=a(19);t.exports="".repeat||function repeat(t){var r=String(i(this)),a="",l=o(t);if(l<0||l==1/0)throw RangeError("Wrong number of repetitions");for(;l>0;(l>>>=1)&&(r+=r))1&l&&(a+=r);return a}},(t,r,a)=>{var o=a(95);t.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o)},(t,r,a)=>{var o=a(10),i=a(75),l=Function.call;t.exports=function(t,r,a){return i(l,o[t].prototype[r],a)}},(t,r,a)=>{a(129);var o=a(127);t.exports=o("String","padEnd")},(t,r,a)=>{"use strict";var o=a(9),i=a(124).end;o({target:"String",proto:!0,forced:a(126)},{padEnd:function padEnd(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},(t,r,a)=>{a(131);var o=a(42);t.exports=o.Object.values},(t,r,a)=>{var o=a(9),i=a(132).values;o({target:"Object",stat:!0},{values:function values(t){return i(t)}})},(t,r,a)=>{var o=a(12),i=a(60),l=a(16),u=a(14).f,createMethod=function(t){return function(r){for(var a,c=l(r),d=i(c),h=d.length,p=0,m=[];h>p;){a=d[p++];o&&!u.call(c,a)||m.push(t?[a,c[a]]:c[a])}return m}};t.exports={entries:createMethod(!0),values:createMethod(!1)}},(t,r,a)=>{a(134);var o=a(42);t.exports=o.Object.entries},(t,r,a)=>{var o=a(9),i=a(132).entries;o({target:"Object",stat:!0},{entries:function entries(t){return i(t)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getDocument=getDocument;exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory;exports.version=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultCMapReaderFactory=exports.DefaultCanvasFactory=exports.build=void 0;var _regenerator=_interopRequireDefault(__w_pdfjs_require__(2)),_util=__w_pdfjs_require__(4),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(136),_node_utils=__w_pdfjs_require__(137),_annotation_storage=__w_pdfjs_require__(138),_api_compatibility=__w_pdfjs_require__(139),_canvas=__w_pdfjs_require__(140),_worker_options=__w_pdfjs_require__(142),_is_node=__w_pdfjs_require__(6),_message_handler=__w_pdfjs_require__(143),_metadata=__w_pdfjs_require__(144),_optional_content_config=__w_pdfjs_require__(146),_transport_stream=__w_pdfjs_require__(147),_webgl=__w_pdfjs_require__(148);function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}function _slicedToArray(t,r){return _arrayWithHoles(t)||_iterableToArrayLimit(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _iterableToArrayLimit(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;var DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory,createPDFNetworkStream;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){var r,a=new PDFDocumentLoadingTask;if("string"==typeof t)r={url:t};else if((0,_util.isArrayBuffer)(t))r={data:t};else if(t instanceof PDFDataRangeTransport)r={range:t};else{if("object"!==_typeof(t))throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=t}var o=Object.create(null),i=null,l=null;for(var u in r)if("url"!==u||"undefined"==typeof window)if("range"!==u)if("worker"!==u)if("data"!==u||r[u]instanceof Uint8Array)o[u]=r[u];else{var c=r[u];if("string"==typeof c)o[u]=(0,_util.stringToBytes)(c);else if("object"!==_typeof(c)||null===c||isNaN(c.length)){if(!(0,_util.isArrayBuffer)(c))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");o[u]=new Uint8Array(c)}else o[u]=new Uint8Array(c)}else l=r[u];else i=r[u];else o[u]=new URL(r[u],window.location).href;o.rangeChunkSize=o.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE;o.CMapReaderFactory=o.CMapReaderFactory||DefaultCMapReaderFactory;o.ignoreErrors=!0!==o.stopAtErrors;o.fontExtraProperties=!0===o.fontExtraProperties;o.pdfBug=!0===o.pdfBug;Number.isInteger(o.maxImageSize)||(o.maxImageSize=-1);"boolean"!=typeof o.isEvalSupported&&(o.isEvalSupported=!0);"boolean"!=typeof o.disableFontFace&&(o.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1);void 0===o.ownerDocument&&(o.ownerDocument=globalThis.document);"boolean"!=typeof o.disableRange&&(o.disableRange=!1);"boolean"!=typeof o.disableStream&&(o.disableStream=!1);"boolean"!=typeof o.disableAutoFetch&&(o.disableAutoFetch=!1);(0,_util.setVerbosityLevel)(o.verbosity);if(!l){var d={verbosity:o.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};l=d.port?PDFWorker.fromPort(d):new PDFWorker(d);a._worker=l}var h=a.docId;l.promise.then((function(){if(a.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(l,o,i,h),r=new Promise((function(t){var r;i?r=new _transport_stream.PDFDataTransportStream({length:o.length,initialData:o.initialData,progressiveDone:o.progressiveDone,disableRange:o.disableRange,disableStream:o.disableStream},i):o.data||(r=createPDFNetworkStream({url:o.url,length:o.length,httpHeaders:o.httpHeaders,withCredentials:o.withCredentials,rangeChunkSize:o.rangeChunkSize,disableRange:o.disableRange,disableStream:o.disableStream}));t(r)}));return Promise.all([t,r]).then((function(t){var r=_slicedToArray(t,2),i=r[0],u=r[1];if(a.destroyed)throw new Error("Loading aborted");var c=new _message_handler.MessageHandler(h,i,l.port);c.postMessageTransfers=l.postMessageTransfers;var d=new WorkerTransport(c,a,u,o);a._transport=d;c.send("Ready",null)}))})).catch(a._capability.reject);return a}function _fetchDocument(t,r,a,o){if(t.destroyed)return Promise.reject(new Error("Worker was destroyed"));if(a){r.length=a.length;r.initialData=a.initialData;r.progressiveDone=a.progressiveDone}return t.messageHandler.sendWithPromise("GetDocRequest",{docId:o,apiVersion:"2.7.570",source:{data:r.data,url:r.url,password:r.password,disableAutoFetch:r.disableAutoFetch,rangeChunkSize:r.rangeChunkSize,length:r.length},maxImageSize:r.maxImageSize,disableFontFace:r.disableFontFace,postMessageTransfers:t.postMessageTransfers,docBaseUrl:r.docBaseUrl,ignoreErrors:r.ignoreErrors,isEvalSupported:r.isEvalSupported,fontExtraProperties:r.fontExtraProperties}).then((function(r){if(t.destroyed)throw new Error("Worker was destroyed");return r}))}var PDFDocumentLoadingTask=function PDFDocumentLoadingTaskClosure(){var t=0;return function(){function PDFDocumentLoadingTask(){_classCallCheck(this,PDFDocumentLoadingTask);this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d"+t++;this.destroyed=!1;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=null}_createClass(PDFDocumentLoadingTask,[{key:"destroy",value:function destroy(){var t=this;this.destroyed=!0;return(this._transport?this._transport.destroy():Promise.resolve()).then((function(){t._transport=null;if(t._worker){t._worker.destroy();t._worker=null}}))}},{key:"promise",get:function get(){return this._capability.promise}}]);return PDFDocumentLoadingTask}()}(),PDFDataRangeTransport=function(){function PDFDataRangeTransport(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,PDFDataRangeTransport);this.length=t;this.initialData=r;this.progressiveDone=a;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}_createClass(PDFDataRangeTransport,[{key:"addRangeListener",value:function addRangeListener(t){this._rangeListeners.push(t)}},{key:"addProgressListener",value:function addProgressListener(t){this._progressListeners.push(t)}},{key:"addProgressiveReadListener",value:function addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}},{key:"addProgressiveDoneListener",value:function addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}},{key:"onDataRange",value:function onDataRange(t,r){var a,o=_createForOfIteratorHelper(this._rangeListeners);try{for(o.s();!(a=o.n()).done;){(0,a.value)(t,r)}}catch(t){o.e(t)}finally{o.f()}}},{key:"onDataProgress",value:function onDataProgress(t,r){var a=this;this._readyCapability.promise.then((function(){var o,i=_createForOfIteratorHelper(a._progressListeners);try{for(i.s();!(o=i.n()).done;){(0,o.value)(t,r)}}catch(t){i.e(t)}finally{i.f()}}))}},{key:"onDataProgressiveRead",value:function onDataProgressiveRead(t){var r=this;this._readyCapability.promise.then((function(){var a,o=_createForOfIteratorHelper(r._progressiveReadListeners);try{for(o.s();!(a=o.n()).done;){(0,a.value)(t)}}catch(t){o.e(t)}finally{o.f()}}))}},{key:"onDataProgressiveDone",value:function onDataProgressiveDone(){var t=this;this._readyCapability.promise.then((function(){var r,a=_createForOfIteratorHelper(t._progressiveDoneListeners);try{for(a.s();!(r=a.n()).done;){(0,r.value)()}}catch(t){a.e(t)}finally{a.f()}}))}},{key:"transportReady",value:function transportReady(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function requestDataRange(t,r){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function abort(){}}]);return PDFDataRangeTransport}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function PDFDocumentProxy(t,r){_classCallCheck(this,PDFDocumentProxy);this._pdfInfo=t;this._transport=r}_createClass(PDFDocumentProxy,[{key:"getPage",value:function getPage(t){return this._transport.getPage(t)}},{key:"getPageIndex",value:function getPageIndex(t){return this._transport.getPageIndex(t)}},{key:"getDestinations",value:function getDestinations(){return this._transport.getDestinations()}},{key:"getDestination",value:function getDestination(t){return this._transport.getDestination(t)}},{key:"getPageLabels",value:function getPageLabels(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function getPageLayout(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function getPageMode(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function getOpenAction(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function getAttachments(){return this._transport.getAttachments()}},{key:"getJavaScript",value:function getJavaScript(){return this._transport.getJavaScript()}},{key:"getJSActions",value:function getJSActions(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function getOutline(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function getPermissions(){return this._transport.getPermissions()}},{key:"getMetadata",value:function getMetadata(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function getMarkInfo(){return this._transport.getMarkInfo()}},{key:"getData",value:function getData(){return this._transport.getData()}},{key:"getDownloadInfo",value:function getDownloadInfo(){return this._transport.downloadInfoCapability.promise}},{key:"getStats",value:function getStats(){return this._transport.getStats()}},{key:"cleanup",value:function cleanup(){return this._transport.startCleanup()}},{key:"destroy",value:function destroy(){return this.loadingTask.destroy()}},{key:"saveDocument",value:function saveDocument(t){return this._transport.saveDocument(t)}},{key:"getFieldObjects",value:function getFieldObjects(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function hasJSActions(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},{key:"annotationStorage",get:function get(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}},{key:"numPages",get:function get(){return this._pdfInfo.numPages}},{key:"fingerprint",get:function get(){return this._pdfInfo.fingerprint}},{key:"loadingParams",get:function get(){return this._transport.loadingParams}},{key:"loadingTask",get:function get(){return this._transport.loadingTask}}]);return PDFDocumentProxy}();exports.PDFDocumentProxy=PDFDocumentProxy;var PDFPageProxy=function(){function PDFPageProxy(t,r,a,o){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_classCallCheck(this,PDFPageProxy);this._pageIndex=t;this._pageInfo=r;this._ownerDocument=o;this._transport=a;this._stats=i?new _display_utils.StatTimer:null;this._pdfBug=i;this.commonObjs=a.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this.destroyed=!1}_createClass(PDFPageProxy,[{key:"getViewport",value:function getViewport(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=t.rotation,o=void 0===a?this.rotate:a,i=t.offsetX,l=void 0===i?0:i,u=t.offsetY,c=void 0===u?0:u,d=t.dontFlip,h=void 0!==d&&d;return new _display_utils.PageViewport({viewBox:this.view,scale:r,rotation:o,offsetX:l,offsetY:c,dontFlip:h})}},{key:"getAnnotations",value:function getAnnotations(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.intent,a=void 0===r?null:r;if(!this.annotationsPromise||this.annotationsIntent!==a){this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,a);this.annotationsIntent=a}return this.annotationsPromise}},{key:"getJSActions",value:function getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}},{key:"render",value:function render(t){var r=this,a=t.canvasContext,o=t.viewport,i=t.intent,l=void 0===i?"display":i,u=t.enableWebGL,c=void 0!==u&&u,d=t.renderInteractiveForms,h=void 0!==d&&d,p=t.transform,m=void 0===p?null:p,v=t.imageLayer,g=void 0===v?null:v,y=t.canvasFactory,b=void 0===y?null:y,_=t.background,S=void 0===_?null:_,C=t.annotationStorage,A=void 0===C?null:C,R=t.optionalContentConfigPromise,k=void 0===R?null:R;this._stats&&this._stats.time("Overall");var P="print"===l?"print":"display";this.pendingCleanup=!1;k||(k=this._transport.getOptionalContentConfig());var w=this._intentStates.get(P);if(!w){w=Object.create(null);this._intentStates.set(P,w)}if(w.streamReaderCancelTimeout){clearTimeout(w.streamReaderCancelTimeout);w.streamReaderCancelTimeout=null}var x=b||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),T=new _webgl.WebGLContext({enable:c});if(!w.displayReadyCapability){w.displayReadyCapability=(0,_util.createPromiseCapability)();w.operatorList={fnArray:[],argsArray:[],lastChunk:!1};this._stats&&this._stats.time("Page Request");this._pumpOperatorList({pageIndex:this._pageIndex,intent:P,renderInteractiveForms:!0===h,annotationStorage:(null==A?void 0:A.getAll())||null})}var E=function complete(t){var a=w.renderTasks.indexOf(O);a>=0&&w.renderTasks.splice(a,1);(r.cleanupAfterRender||"print"===P)&&(r.pendingCleanup=!0);r._tryCleanup();if(t){O.capability.reject(t);r._abortOperatorList({intentState:w,reason:t})}else O.capability.resolve();if(r._stats){r._stats.timeEnd("Rendering");r._stats.timeEnd("Overall")}},O=new InternalRenderTask({callback:E,params:{canvasContext:a,viewport:o,transform:m,imageLayer:g,background:S},objs:this.objs,commonObjs:this.commonObjs,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:x,webGLContext:T,useRequestAnimationFrame:"print"!==P,pdfBug:this._pdfBug});w.renderTasks||(w.renderTasks=[]);w.renderTasks.push(O);var I=O.task;Promise.all([w.displayReadyCapability.promise,k]).then((function(t){var a=_slicedToArray(t,2),o=a[0],i=a[1];if(r.pendingCleanup)E();else{r._stats&&r._stats.time("Rendering");O.initializeGraphics({transparency:o,optionalContentConfig:i});O.operatorListChanged()}})).catch(E);return I}},{key:"getOperatorList",value:function getOperatorList(){var t,r="oplist",a=this._intentStates.get(r);if(!a){a=Object.create(null);this._intentStates.set(r,a)}if(!a.opListReadCapability){(t=Object.create(null)).operatorListChanged=function operatorListChanged(){if(a.operatorList.lastChunk){a.opListReadCapability.resolve(a.operatorList);var r=a.renderTasks.indexOf(t);r>=0&&a.renderTasks.splice(r,1)}};a.opListReadCapability=(0,_util.createPromiseCapability)();a.renderTasks=[];a.renderTasks.push(t);a.operatorList={fnArray:[],argsArray:[],lastChunk:!1};this._stats&&this._stats.time("Page Request");this._pumpOperatorList({pageIndex:this._pageIndex,intent:r})}return a.opListReadCapability.promise}},{key:"streamTextContent",value:function streamTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.normalizeWhitespace,a=void 0!==r&&r,o=t.disableCombineTextItems,i=void 0!==o&&o,l=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===a,combineTextItems:!0!==i},{highWaterMark:l,size:function size(t){return t.items.length}})}},{key:"getTextContent",value:function getTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.streamTextContent(t);return new Promise((function(t,a){var o=r.getReader(),i={items:[],styles:Object.create(null)};!function pump(){o.read().then((function(r){var a,o=r.value;if(r.done)t(i);else{Object.assign(i.styles,o.styles);(a=i.items).push.apply(a,_toConsumableArray(o.items));pump()}}),a)}()}))}},{key:"_destroy",value:function _destroy(){this.destroyed=!0;this._transport.pageCache[this._pageIndex]=null;var t,r=[],a=_createForOfIteratorHelper(this._intentStates);try{for(a.s();!(t=a.n()).done;){var o=_slicedToArray(t.value,2),i=o[0],l=o[1];this._abortOperatorList({intentState:l,reason:new Error("Page was destroyed."),force:!0});if("oplist"!==i){var u,c=_createForOfIteratorHelper(l.renderTasks);try{for(c.s();!(u=c.n()).done;){var d=u.value;r.push(d.completed);d.cancel()}}catch(t){c.e(t)}finally{c.f()}}}}catch(t){a.e(t)}finally{a.f()}this.objs.clear();this.annotationsPromise=null;this._jsActionsPromise=null;this.pendingCleanup=!1;return Promise.all(r)}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0;return this._tryCleanup(t)}},{key:"_tryCleanup",value:function _tryCleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;var r,a=_createForOfIteratorHelper(this._intentStates.values());try{for(a.s();!(r=a.n()).done;){var o=r.value,i=o.renderTasks,l=o.operatorList;if(0!==i.length||!l.lastChunk)return!1}}catch(t){a.e(t)}finally{a.f()}this._intentStates.clear();this.objs.clear();this.annotationsPromise=null;this._jsActionsPromise=null;t&&this._stats&&(this._stats=new _display_utils.StatTimer);this.pendingCleanup=!1;return!0}},{key:"_startRenderPage",value:function _startRenderPage(t,r){var a=this._intentStates.get(r);if(a){this._stats&&this._stats.timeEnd("Page Request");a.displayReadyCapability&&a.displayReadyCapability.resolve(t)}}},{key:"_renderPageChunk",value:function _renderPageChunk(t,r){for(var a=0,o=t.length;a<o;a++){r.operatorList.fnArray.push(t.fnArray[a]);r.operatorList.argsArray.push(t.argsArray[a])}r.operatorList.lastChunk=t.lastChunk;for(var i=0;i<r.renderTasks.length;i++)r.renderTasks[i].operatorListChanged();t.lastChunk&&this._tryCleanup()}},{key:"_pumpOperatorList",value:function _pumpOperatorList(t){var r=this;(0,_util.assert)(t.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');var a=this._transport.messageHandler.sendWithStream("GetOperatorList",t).getReader(),o=this._intentStates.get(t.intent);o.streamReader=a;!function pump(){a.read().then((function(t){var a=t.value;if(t.done)o.streamReader=null;else if(!r._transport.destroyed){r._renderPageChunk(a,o);pump()}}),(function(t){o.streamReader=null;if(!r._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(var a=0;a<o.renderTasks.length;a++)o.renderTasks[a].operatorListChanged();r._tryCleanup()}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))}()}},{key:"_abortOperatorList",value:function _abortOperatorList(t){var r=this,a=t.intentState,o=t.reason,i=t.force,l=void 0!==i&&i;(0,_util.assert)(o instanceof Error||"object"===_typeof(o)&&null!==o,'PDFPageProxy._abortOperatorList: Expected "reason" argument.');if(a.streamReader){if(!l){if(0!==a.renderTasks.length)return;if(o instanceof _display_utils.RenderingCancelledException){a.streamReaderCancelTimeout=setTimeout((function(){r._abortOperatorList({intentState:a,reason:o,force:!0});a.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT);return}}a.streamReader.cancel(new _util.AbortException(null==o?void 0:o.message));a.streamReader=null;if(!this._transport.destroyed){var u,c=_createForOfIteratorHelper(this._intentStates);try{for(c.s();!(u=c.n()).done;){var d=_slicedToArray(u.value,2),h=d[0];if(d[1]===a){this._intentStates.delete(h);break}}}catch(t){c.e(t)}finally{c.f()}this.cleanup()}}}},{key:"pageNumber",get:function get(){return this._pageIndex+1}},{key:"rotate",get:function get(){return this._pageInfo.rotate}},{key:"ref",get:function get(){return this._pageInfo.ref}},{key:"userUnit",get:function get(){return this._pageInfo.userUnit}},{key:"view",get:function get(){return this._pageInfo.view}},{key:"stats",get:function get(){return this._stats}}]);return PDFPageProxy}();exports.PDFPageProxy=PDFPageProxy;var LoopbackPort=function(){function LoopbackPort(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];_classCallCheck(this,LoopbackPort);this._listeners=[];this._defer=t;this._deferred=Promise.resolve(void 0)}_createClass(LoopbackPort,[{key:"postMessage",value:function postMessage(t,r){var a=this;if(this._defer){var o=new WeakMap,i={data:function cloneValue(t){if("object"!==_typeof(t)||null===t)return t;if(o.has(t))return o.get(t);var a,i;if((a=t.buffer)&&(0,_util.isArrayBuffer)(a)){i=null!=r&&r.includes(a)?new t.constructor(a,t.byteOffset,t.byteLength):new t.constructor(t);o.set(t,i);return i}i=Array.isArray(t)?[]:{};o.set(t,i);for(var l in t){for(var u=void 0,c=t;!(u=Object.getOwnPropertyDescriptor(c,l));)c=Object.getPrototypeOf(c);if(void 0!==u.value)if("function"!=typeof u.value)i[l]=cloneValue(u.value);else if(t.hasOwnProperty&&t.hasOwnProperty(l))throw new Error("LoopbackPort.postMessage - cannot clone: ".concat(t[l]))}return i}(t)};this._deferred.then((function(){a._listeners.forEach((function(t){t.call(a,i)}))}))}else this._listeners.forEach((function(r){r.call(a,{data:t})}))}},{key:"addEventListener",value:function addEventListener(t,r){this._listeners.push(r)}},{key:"removeEventListener",value:function removeEventListener(t,r){var a=this._listeners.indexOf(r);this._listeners.splice(a,1)}},{key:"terminate",value:function terminate(){this._listeners.length=0}}]);return LoopbackPort}();exports.LoopbackPort=LoopbackPort;var PDFWorker=function PDFWorkerClosure(){var pdfWorkerPorts=new WeakMap,isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS&&"function"==typeof require){isWorkerDisabled=!0;fallbackWorkerSrc="./pdf.worker.js"}else if("object"===("undefined"==typeof document?"undefined":_typeof(document))&&"currentScript"in document){var _document$currentScri,pdfjsFilePath=null===(_document$currentScri=document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;pdfjsFilePath&&(fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function _getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(void 0!==fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){var t;try{var r;t=null===(r=globalThis.pdfjsWorker)||void 0===r?void 0:r.WorkerMessageHandler}catch(t){}return t||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();var loader=function(){var _ref12=_asyncToGenerator(_regenerator.default.mark((function _callee(){var mainWorkerMessageHandler,worker;return _regenerator.default.wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(!mainWorkerMessageHandler){_context.next=3;break}return _context.abrupt("return",mainWorkerMessageHandler);case 3:if(!_is_node.isNodeJS||"function"!=typeof require){_context.next=6;break}worker=eval("require")(_getWorkerSrc());return _context.abrupt("return",worker.WorkerMessageHandler);case 6:_context.next=8;return(0,_display_utils.loadScript)(_getWorkerSrc());case 8:return _context.abrupt("return",window.pdfjsWorker.WorkerMessageHandler);case 9:case"end":return _context.stop()}}),_callee)})));return function loader(){return _ref12.apply(this,arguments)}}();loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject);return fakeWorkerCapability.promise}function createCDNWrapper(t){var r="importScripts('"+t+"');";return URL.createObjectURL(new Blob([r]))}var PDFWorker=function(){function PDFWorker(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.name,a=void 0===r?null:r,o=t.port,i=void 0===o?null:o,l=t.verbosity,u=void 0===l?(0,_util.getVerbosityLevel)():l;_classCallCheck(this,PDFWorker);if(i&&pdfWorkerPorts.has(i))throw new Error("Cannot use more than one PDFWorker per port");this.name=a;this.destroyed=!1;this.postMessageTransfers=!0;this.verbosity=u;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(i){pdfWorkerPorts.set(i,this);this._initializeFromPort(i)}else this._initialize()}_createClass(PDFWorker,[{key:"_initializeFromPort",value:function _initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve()}},{key:"_initialize",value:function _initialize(){var t=this;if("undefined"!=typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){var r=_getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,r)||(r=createCDNWrapper(new URL(r,window.location).href));var a=new Worker(r),o=new _message_handler.MessageHandler("main","worker",a),i=function terminateEarly(){a.removeEventListener("error",l);o.destroy();a.terminate();t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},l=function onWorkerError(){t._webWorker||i()};a.addEventListener("error",l);o.on("test",(function(r){a.removeEventListener("error",l);if(t.destroyed)i();else if(r){t._messageHandler=o;t._port=a;t._webWorker=a;r.supportTransfers||(t.postMessageTransfers=!1);t._readyCapability.resolve();o.send("configure",{verbosity:t.verbosity})}else{t._setupFakeWorker();o.destroy();a.terminate()}}));o.on("ready",(function(r){a.removeEventListener("error",l);if(t.destroyed)i();else try{u()}catch(r){t._setupFakeWorker()}}));var u=function sendTest(){var r=new Uint8Array([t.postMessageTransfers?255:0]);try{o.send("test",r,[r.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers.");r[0]=0;o.send("test",r)}};u();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function _setupFakeWorker(){var t=this;if(!isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");isWorkerDisabled=!0}setupFakeWorkerGlobal().then((function(r){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var a=new LoopbackPort;t._port=a;var o="fake"+nextFakeWorkerId++,i=new _message_handler.MessageHandler(o+"_worker",o,a);r.setup(i,a);var l=new _message_handler.MessageHandler(o,o+"_worker",a);t._messageHandler=l;t._readyCapability.resolve();l.send("configure",{verbosity:t.verbosity})}})).catch((function(r){t._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(r.message,'".')))}))}},{key:"destroy",value:function destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}pdfWorkerPorts.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}},{key:"promise",get:function get(){return this._readyCapability.promise}},{key:"port",get:function get(){return this._port}},{key:"messageHandler",get:function get(){return this._messageHandler}}],[{key:"fromPort",value:function fromPort(t){if(!t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(t.port)?pdfWorkerPorts.get(t.port):new PDFWorker(t)}},{key:"getWorkerSrc",value:function getWorkerSrc(){return _getWorkerSrc()}}]);return PDFWorker}();return PDFWorker}();exports.PDFWorker=PDFWorker;var WorkerTransport=function(){function WorkerTransport(t,r,a,o){_classCallCheck(this,WorkerTransport);this.messageHandler=t;this.loadingTask=r;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({docId:r.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:o.ownerDocument});this._params=o;this.CMapReaderFactory=new o.CMapReaderFactory({baseUrl:o.cMapUrl,isCompressed:o.cMapPacked});this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=a;this._fullReader=null;this._lastProgress=null;this.pageCache=[];this.pagePromises=[];this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}_createClass(WorkerTransport,[{key:"destroy",value:function destroy(){var t=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var r=[];this.pageCache.forEach((function(t){t&&r.push(t._destroy())}));this.pageCache.length=0;this.pagePromises.length=0;var a=this.messageHandler.sendWithPromise("Terminate",null);r.push(a);if(this.loadingTaskSettled){var o=this.loadingTask.promise.then((function(t){t.hasOwnProperty("annotationStorage")&&t.annotationStorage.resetModified()})).catch((function(){}));r.push(o)}Promise.all(r).then((function(){t.commonObjs.clear();t.fontLoader.clear();t._hasJSActionsPromise=null;t._networkStream&&t._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(t.messageHandler){t.messageHandler.destroy();t.messageHandler=null}t.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}},{key:"setupMessageHandler",value:function setupMessageHandler(){var t=this,r=this.messageHandler,a=this.loadingTask;r.on("GetReader",(function(r,a){(0,_util.assert)(t._networkStream,"GetReader - no `IPDFStream` instance available.");t._fullReader=t._networkStream.getFullReader();t._fullReader.onProgress=function(r){t._lastProgress={loaded:r.loaded,total:r.total}};a.onPull=function(){t._fullReader.read().then((function(t){var r=t.value;if(t.done)a.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){t._fullReader.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}));r.on("ReaderHeadersReady",(function(r){var o=(0,_util.createPromiseCapability)(),i=t._fullReader;i.headersReady.then((function(){if(!i.isStreamingSupported||!i.isRangeSupported){t._lastProgress&&a.onProgress&&a.onProgress(t._lastProgress);i.onProgress=function(t){a.onProgress&&a.onProgress({loaded:t.loaded,total:t.total})}}o.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),o.reject);return o.promise}));r.on("GetRangeReader",(function(r,a){(0,_util.assert)(t._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var o=t._networkStream.getRangeReader(r.begin,r.end);if(o){a.onPull=function(){o.read().then((function(t){var r=t.value;if(t.done)a.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetRangeReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){o.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}else a.close()}));r.on("GetDoc",(function(r){var o=r.pdfInfo;t._numPages=o.numPages;a._capability.resolve(new PDFDocumentProxy(o,t))}));r.on("DocException",(function(t){var r;switch(t.name){case"PasswordException":r=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":r=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(t.message,t.details)}if(!(r instanceof Error)){(0,_util.warn)("DocException - expected a valid Error.")}a._capability.reject(r)}));r.on("PasswordRequest",(function(r){t._passwordCapability=(0,_util.createPromiseCapability)();if(a.onPassword){try{a.onPassword((function updatePassword(r){t._passwordCapability.resolve({password:r})}),r.code)}catch(r){t._passwordCapability.reject(r)}}else t._passwordCapability.reject(new _util.PasswordException(r.message,r.code));return t._passwordCapability.promise}));r.on("DataLoaded",(function(r){a.onProgress&&a.onProgress({loaded:r.length,total:r.length});t.downloadInfoCapability.resolve(r)}));r.on("StartRenderPage",(function(r){if(!t.destroyed){t.pageCache[r.pageIndex]._startRenderPage(r.transparency,r.intent)}}));r.on("commonobj",(function(a){var o;if(!t.destroyed){var i=_slicedToArray(a,3),l=i[0],u=i[1],c=i[2];if(!t.commonObjs.has(l))switch(u){case"Font":var d=t._params;if("error"in c){var h=c.error;(0,_util.warn)("Error during font loading: ".concat(h));t.commonObjs.resolve(l,h);break}var p=null;d.pdfBug&&null!==(o=globalThis.FontInspector)&&void 0!==o&&o.enabled&&(p={registerFont:function registerFont(t,r){globalThis.FontInspector.fontAdded(t,r)}});var m=new _font_loader.FontFaceObject(c,{isEvalSupported:d.isEvalSupported,disableFontFace:d.disableFontFace,ignoreErrors:d.ignoreErrors,onUnsupportedFeature:t._onUnsupportedFeature.bind(t),fontRegistry:p});t.fontLoader.bind(m).catch((function(t){return r.sendWithPromise("FontFallback",{id:l})})).finally((function(){!d.fontExtraProperties&&m.data&&(m.data=null);t.commonObjs.resolve(l,m)}));break;case"FontPath":case"Image":t.commonObjs.resolve(l,c);break;default:throw new Error("Got unknown common object type ".concat(u))}}}));r.on("obj",(function(r){var a;if(!t.destroyed){var o=_slicedToArray(r,4),i=o[0],l=o[1],u=o[2],c=o[3],d=t.pageCache[l];if(!d.objs.has(i))switch(u){case"Image":d.objs.resolve(i,c);(null==c||null===(a=c.data)||void 0===a?void 0:a.length)>8e6&&(d.cleanupAfterRender=!0);break;default:throw new Error("Got unknown object type ".concat(u))}}}));r.on("DocProgress",(function(r){t.destroyed||a.onProgress&&a.onProgress({loaded:r.loaded,total:r.total})}));r.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));r.on("FetchBuiltInCMap",(function(r,a){if(t.destroyed)a.error(new Error("Worker was destroyed"));else{var o=!1;a.onPull=function(){if(o)a.close();else{o=!0;t.CMapReaderFactory.fetch(r).then((function(t){a.enqueue(t,1,[t.cMapData.buffer])})).catch((function(t){a.error(t)}))}}}}))}},{key:"_onUnsupportedFeature",value:function _onUnsupportedFeature(t){var r=t.featureId;this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(r)}},{key:"getData",value:function getData(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"getPage",value:function getPage(t){var r=this;if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request"));var a=t-1;if(a in this.pagePromises)return this.pagePromises[a];var o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:a}).then((function(t){if(r.destroyed)throw new Error("Transport destroyed");var o=new PDFPageProxy(a,t,r,r._params.ownerDocument,r._params.pdfBug);r.pageCache[a]=o;return o}));this.pagePromises[a]=o;return o}},{key:"getPageIndex",value:function getPageIndex(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t}).catch((function(t){return Promise.reject(new Error(t))}))}},{key:"getAnnotations",value:function getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}},{key:"saveDocument",value:function saveDocument(t){var r,a;return this.messageHandler.sendWithPromise("SaveDocument",{numPages:this._numPages,annotationStorage:(null==t?void 0:t.getAll())||null,filename:null!==(r=null===(a=this._fullReader)||void 0===a?void 0:a.filename)&&void 0!==r?r:null}).finally((function(){t&&t.resetModified()}))}},{key:"getFieldObjects",value:function getFieldObjects(){return this.messageHandler.sendWithPromise("GetFieldObjects",null)}},{key:"hasJSActions",value:function hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getDocJSActions",value:function getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}},{key:"getPageJSActions",value:function getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}},{key:"getOutline",value:function getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(t){return new _optional_content_config.OptionalContentConfig(t)}))}},{key:"getPermissions",value:function getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function getMetadata(){var t=this;return this.messageHandler.sendWithPromise("GetMetadata",null).then((function(r){var a,o,i,l;return{info:r[0],metadata:r[1]?new _metadata.Metadata(r[1]):null,contentDispositionFilename:null!==(a=null===(o=t._fullReader)||void 0===o?void 0:o.filename)&&void 0!==a?a:null,contentLength:null!==(i=null===(l=t._fullReader)||void 0===l?void 0:l.contentLength)&&void 0!==i?i:null}}))}},{key:"getMarkInfo",value:function getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"getStats",value:function getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}},{key:"startCleanup",value:function startCleanup(){var t=this;return this.messageHandler.sendWithPromise("Cleanup",null).then((function(){for(var r=0,a=t.pageCache.length;r<a;r++){var o=t.pageCache[r];if(o){if(!o.cleanup())throw new Error("startCleanup: Page ".concat(r+1," is currently rendering."))}}t.commonObjs.clear();t.fontLoader.clear();t._hasJSActionsPromise=null}))}},{key:"loadingTaskSettled",get:function get(){return this.loadingTask._capability.settled}},{key:"loadingParams",get:function get(){var t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,disableFontFace:t.disableFontFace})}}]);return WorkerTransport}(),PDFObjects=function(){function PDFObjects(){_classCallCheck(this,PDFObjects);this._objs=Object.create(null)}_createClass(PDFObjects,[{key:"_ensureObj",value:function _ensureObj(t){return this._objs[t]?this._objs[t]:this._objs[t]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}},{key:"get",value:function get(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){this._ensureObj(t).capability.promise.then(r);return null}var a=this._objs[t];if(!a||!a.resolved)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return a.data}},{key:"has",value:function has(t){var r=this._objs[t];return(null==r?void 0:r.resolved)||!1}},{key:"resolve",value:function resolve(t,r){var a=this._ensureObj(t);a.resolved=!0;a.data=r;a.capability.resolve(r)}},{key:"clear",value:function clear(){this._objs=Object.create(null)}}]);return PDFObjects}(),RenderTask=function(){function RenderTask(t){_classCallCheck(this,RenderTask);this._internalRenderTask=t;this.onContinue=null}_createClass(RenderTask,[{key:"cancel",value:function cancel(){this._internalRenderTask.cancel()}},{key:"promise",get:function get(){return this._internalRenderTask.capability.promise}}]);return RenderTask}(),InternalRenderTask=function InternalRenderTaskClosure(){var t=new WeakSet;return function(){function InternalRenderTask(t){var r=t.callback,a=t.params,o=t.objs,i=t.commonObjs,l=t.operatorList,u=t.pageIndex,c=t.canvasFactory,d=t.webGLContext,h=t.useRequestAnimationFrame,p=void 0!==h&&h,m=t.pdfBug,v=void 0!==m&&m;_classCallCheck(this,InternalRenderTask);this.callback=r;this.params=a;this.objs=o;this.commonObjs=i;this.operatorListIdx=null;this.operatorList=l;this._pageIndex=u;this.canvasFactory=c;this.webGLContext=d;this._pdfBug=v;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===p&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=a.canvasContext.canvas}_createClass(InternalRenderTask,[{key:"initializeGraphics",value:function initializeGraphics(r){var a,o=r.transparency,i=void 0!==o&&o,l=r.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");t.add(this._canvas)}if(this._pdfBug&&null!==(a=globalThis.StepperManager)&&void 0!==a&&a.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var u=this.params,c=u.canvasContext,d=u.viewport,h=u.transform,p=u.imageLayer,m=u.background;this.gfx=new _canvas.CanvasGraphics(c,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,p,l);this.gfx.beginDrawing({transform:h,viewport:d,transparency:i,background:m});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback&&this.graphicsReadyCallback()}}},{key:"cancel",value:function cancel(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1;this.cancelled=!0;this.gfx&&this.gfx.endDrawing();this._canvas&&t.delete(this._canvas);this.callback(r||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))}},{key:"operatorListChanged",value:function operatorListChanged(){if(this.graphicsReady){this.stepper&&this.stepper.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function _continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function _scheduleNext(){var t=this;this._useRequestAnimationFrame?window.requestAnimationFrame((function(){t._nextBound().catch(t.cancel.bind(t))})):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}},{key:"_next",value:(r=_asyncToGenerator(_regenerator.default.mark((function _callee2(){return _regenerator.default.wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:if(!this.cancelled){r.next=2;break}return r.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&t.delete(this._canvas);this.callback()}}case 4:case"end":return r.stop()}}),_callee2,this)}))),function _next(){return r.apply(this,arguments)})},{key:"completed",get:function get(){return this.capability.promise.catch((function(){}))}}]);var r;return InternalRenderTask}()}(),version="2.7.570";exports.version=version;var build="f2c7338b0";exports.build=build},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.FontLoader=r.FontFaceObject=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4);function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var l,u=function(){function BaseFontLoader(t){var r=t.docId,a=t.onUnsupportedFeature,o=t.ownerDocument,l=void 0===o?globalThis.document:o;_classCallCheck(this,BaseFontLoader);this.constructor===BaseFontLoader&&(0,i.unreachable)("Cannot initialize BaseFontLoader.");this.docId=r;this._onUnsupportedFeature=a;this._document=l;this.nativeFontFaces=[];this.styleElement=null}_createClass(BaseFontLoader,[{key:"addNativeFontFace",value:function addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}},{key:"insertRule",value:function insertRule(t){var r=this.styleElement;if(!r){(r=this.styleElement=this._document.createElement("style")).id="PDFJS_FONT_STYLE_TAG_".concat(this.docId);this._document.documentElement.getElementsByTagName("head")[0].appendChild(r)}var a=r.sheet;a.insertRule(t,a.cssRules.length)}},{key:"clear",value:function clear(){var t=this;this.nativeFontFaces.forEach((function(r){t._document.fonts.delete(r)}));this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}},{key:"bind",value:(t=function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}(o.default.mark((function _callee(t){var r,a,l=this;return o.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(!t.attached&&!t.missingFile){o.next=2;break}return o.abrupt("return");case 2:t.attached=!0;if(!this.isFontLoadingAPISupported){o.next=19;break}if(!(r=t.createNativeFontFace())){o.next=18;break}this.addNativeFontFace(r);o.prev=7;o.next=10;return r.loaded;case 10:o.next=18;break;case 12:o.prev=12;o.t0=o.catch(7);this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,i.warn)("Failed to load font '".concat(r.family,"': '").concat(o.t0,"'."));t.disableFontFace=!0;throw o.t0;case 18:return o.abrupt("return");case 19:if(!(a=t.createFontFaceRule())){o.next=26;break}this.insertRule(a);if(!this.isSyncFontLoadingSupported){o.next=24;break}return o.abrupt("return");case 24:o.next=26;return new Promise((function(r){var o=l._queueLoadingCallback(r);l._prepareFontLoadEvent([a],[t],o)}));case 26:case"end":return o.stop()}}),_callee,this,[[7,12]])}))),function bind(r){return t.apply(this,arguments)})},{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){(0,i.unreachable)("Abstract method `_queueLoadingCallback`.")}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r,a){(0,i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}},{key:"isFontLoadingAPISupported",get:function get(){var t;return(0,i.shadow)(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}},{key:"isSyncFontLoadingSupported",get:function get(){(0,i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}},{key:"_loadTestFont",get:function get(){(0,i.unreachable)("Abstract method `_loadTestFont`.")}}]);var t;return BaseFontLoader}();r.FontLoader=l;r.FontLoader=l=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}(GenericFontLoader,t);var r=_createSuper(GenericFontLoader);function GenericFontLoader(t){var a;_classCallCheck(this,GenericFontLoader);(a=r.call(this,t)).loadingContext={requests:[],nextRequestId:0};a.loadTestFontId=0;return a}_createClass(GenericFontLoader,[{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){var r=this.loadingContext,a={id:"pdfjs-font-loading-".concat(r.nextRequestId++),done:!1,complete:function completeRequest(){(0,i.assert)(!a.done,"completeRequest() cannot be called twice.");a.done=!0;for(;r.requests.length>0&&r.requests[0].done;){var t=r.requests.shift();setTimeout(t.callback,0)}},callback:t};r.requests.push(a);return a}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r,a){var o,l,u=this;function int32(t,r){return t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|255&t.charCodeAt(r+3)}function spliceString(t,r,a,o){return t.substring(0,r)+o+t.substring(r+a)}var c=this._document.createElement("canvas");c.width=1;c.height=1;var d=c.getContext("2d"),h=0;var p="lt".concat(Date.now()).concat(this.loadTestFontId++),m=this._loadTestFont,v=1482184792,g=int32(m=spliceString(m,976,p.length,p),16);for(o=0,l=p.length-3;o<l;o+=4)g=g-v+int32(p,o)|0;o<p.length&&(g=g-v+int32(p+"XXX",o)|0);m=spliceString(m,16,4,(0,i.string32)(g));var y="url(data:font/opentype;base64,".concat(btoa(m),");"),b='@font-face {font-family:"'.concat(p,'";src:').concat(y,"}");this.insertRule(b);var _=[];for(o=0,l=r.length;o<l;o++)_.push(r[o].loadedName);_.push(p);var S=this._document.createElement("div");S.style.visibility="hidden";S.style.width=S.style.height="10px";S.style.position="absolute";S.style.top=S.style.left="0px";for(o=0,l=_.length;o<l;++o){var C=this._document.createElement("span");C.textContent="Hi";C.style.fontFamily=_[o];S.appendChild(C)}this._document.body.appendChild(S);!function isFontReady(t,r){if(++h>30){(0,i.warn)("Load test font never loaded.");r()}else{d.font="30px "+t;d.fillText(".",0,20);d.getImageData(0,0,1,1).data[3]>0?r():setTimeout(isFontReady.bind(null,t,r))}}(p,(function(){u._document.body.removeChild(S);a.complete()}))}},{key:"isSyncFontLoadingSupported",get:function get(){var t=!1;if("undefined"==typeof navigator)t=!0;else{var r=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(null==r?void 0:r[1])>=14&&(t=!0)}return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}},{key:"_loadTestFont",get:function get(){return(0,i.shadow)(this,"_loadTestFont",function getLoadTestFont(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")}())}}]);return GenericFontLoader}(u);var c=function(){function FontFaceObject(t,r){var a=r.isEvalSupported,o=void 0===a||a,i=r.disableFontFace,l=void 0!==i&&i,u=r.ignoreErrors,c=void 0!==u&&u,d=r.onUnsupportedFeature,h=void 0===d?null:d,p=r.fontRegistry,m=void 0===p?null:p;_classCallCheck(this,FontFaceObject);this.compiledGlyphs=Object.create(null);for(var v in t)this[v]=t[v];this.isEvalSupported=!1!==o;this.disableFontFace=!0===l;this.ignoreErrors=!0===c;this._onUnsupportedFeature=h;this.fontRegistry=m}_createClass(FontFaceObject,[{key:"createNativeFontFace",value:function createNativeFontFace(){if(!this.data||this.disableFontFace)return null;var t=new FontFace(this.loadedName,this.data,{});this.fontRegistry&&this.fontRegistry.registerFont(this);return t}},{key:"createFontFaceRule",value:function createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var t=(0,i.bytesToString)(new Uint8Array(this.data)),r="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");"),a='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(r,"}");this.fontRegistry&&this.fontRegistry.registerFont(this,r);return a}},{key:"getPathGenerator",value:function getPathGenerator(t,r){if(void 0!==this.compiledGlyphs[r])return this.compiledGlyphs[r];var a,o;try{a=t.get(this.loadedName+"_path_"+r)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontGetPath});(0,i.warn)('getPathGenerator - ignoring character: "'.concat(t,'".'));return this.compiledGlyphs[r]=function(t,r){}}if(this.isEvalSupported&&i.IsEvalSupportedCached.value){for(var l,u="",c=0,d=a.length;c<d;c++){l=void 0!==(o=a[c]).args?o.args.join(","):"";u+="c."+o.cmd+"("+l+");\n"}return this.compiledGlyphs[r]=new Function("c","size",u)}return this.compiledGlyphs[r]=function(t,r){for(var i=0,l=a.length;i<l;i++){"scale"===(o=a[i]).cmd&&(o.args=[r,-r]);t[o.cmd].apply(t,o.args)}}}}]);return FontFaceObject}();r.FontFaceObject=c},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.NodeCMapReaderFactory=r.NodeCanvasFactory=void 0;var o=a(1),i=a(6),l=a(4);function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var u=function NodeCanvasFactory(){_classCallCheck(this,NodeCanvasFactory);(0,l.unreachable)("Not implemented: NodeCanvasFactory")};r.NodeCanvasFactory=u;var c=function NodeCMapReaderFactory(){_classCallCheck(this,NodeCMapReaderFactory);(0,l.unreachable)("Not implemented: NodeCMapReaderFactory")};r.NodeCMapReaderFactory=c;if(i.isNodeJS){r.NodeCanvasFactory=u=function(t){_inherits(NodeCanvasFactory,t);var r=_createSuper(NodeCanvasFactory);function NodeCanvasFactory(){_classCallCheck(this,NodeCanvasFactory);return r.apply(this,arguments)}_createClass(NodeCanvasFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");var a=require("canvas").createCanvas(t,r);return{canvas:a,context:a.getContext("2d")}}}]);return NodeCanvasFactory}(o.BaseCanvasFactory);r.NodeCMapReaderFactory=c=function(t){_inherits(NodeCMapReaderFactory,t);var r=_createSuper(NodeCMapReaderFactory);function NodeCMapReaderFactory(){_classCallCheck(this,NodeCMapReaderFactory);return r.apply(this,arguments)}_createClass(NodeCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return new Promise((function(a,o){require("fs").readFile(t,(function(t,i){!t&&i?a({cMapData:new Uint8Array(i),compressionType:r}):o(new Error(t))}))}))}}]);return NodeCMapReaderFactory}(o.BaseCMapReaderFactory)}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.AnnotationStorage=void 0;var o=a(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var i=function(){function AnnotationStorage(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AnnotationStorage);this._storage=new Map;this._modified=!1;this.onSetModified=null;this.onResetModified=null}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(AnnotationStorage,[{key:"getOrCreateValue",value:function getOrCreateValue(t,r){if(this._storage.has(t))return this._storage.get(t);this._storage.set(t,r);return r}},{key:"setValue",value:function setValue(t,r){var a=this._storage.get(t),o=!1;if(void 0!==a)for(var i=0,l=Object.entries(r);i<l.length;i++){var u=_slicedToArray(l[i],2),c=u[0],d=u[1];if(a[c]!==d){o=!0;a[c]=d}}else{this._storage.set(t,r);o=!0}o&&this._setModified()}},{key:"getAll",value:function getAll(){return 0===this._storage.size?null:(0,o.objectFromEntries)(this._storage)}},{key:"_setModified",value:function _setModified(){if(!this._modified){this._modified=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}},{key:"resetModified",value:function resetModified(){if(this._modified){this._modified=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}},{key:"size",get:function get(){return this._storage.size}}]);return AnnotationStorage}();r.AnnotationStorage=i},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.apiCompatibilityParams=void 0;var o=a(6),i=Object.create(null);!function checkFontFace(){o.isNodeJS&&(i.disableFontFace=!0)}();var l=Object.freeze(i);r.apiCompatibilityParams=l},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CanvasGraphics=void 0;var o=a(4),i=a(141);function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}var l=4096,u=16;function addContextCurrentTransform(t){if(!t.mozCurrentTransform){t._originalSave=t.save;t._originalRestore=t.restore;t._originalRotate=t.rotate;t._originalScale=t.scale;t._originalTranslate=t.translate;t._originalTransform=t.transform;t._originalSetTransform=t.setTransform;t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0];t._transformStack=[];Object.defineProperty(t,"mozCurrentTransform",{get:function getCurrentTransform(){return this._transformMatrix}});Object.defineProperty(t,"mozCurrentTransformInverse",{get:function getCurrentTransformInverse(){var t=this._transformMatrix,r=t[0],a=t[1],o=t[2],i=t[3],l=t[4],u=t[5],c=r*i-a*o,d=a*o-r*i;return[i/c,a/d,o/d,r/c,(i*l-o*u)/d,(a*l-r*u)/c]}});t.save=function ctxSave(){var t=this._transformMatrix;this._transformStack.push(t);this._transformMatrix=t.slice(0,6);this._originalSave()};t.restore=function ctxRestore(){var t=this._transformStack.pop();if(t){this._transformMatrix=t;this._originalRestore()}};t.translate=function ctxTranslate(t,r){var a=this._transformMatrix;a[4]=a[0]*t+a[2]*r+a[4];a[5]=a[1]*t+a[3]*r+a[5];this._originalTranslate(t,r)};t.scale=function ctxScale(t,r){var a=this._transformMatrix;a[0]=a[0]*t;a[1]=a[1]*t;a[2]=a[2]*r;a[3]=a[3]*r;this._originalScale(t,r)};t.transform=function ctxTransform(r,a,o,i,l,u){var c=this._transformMatrix;this._transformMatrix=[c[0]*r+c[2]*a,c[1]*r+c[3]*a,c[0]*o+c[2]*i,c[1]*o+c[3]*i,c[0]*l+c[2]*u+c[4],c[1]*l+c[3]*u+c[5]];t._originalTransform(r,a,o,i,l,u)};t.setTransform=function ctxSetTransform(r,a,o,i,l,u){this._transformMatrix=[r,a,o,i,l,u];t._originalSetTransform(r,a,o,i,l,u)};t.rotate=function ctxRotate(t){var r=Math.cos(t),a=Math.sin(t),o=this._transformMatrix;this._transformMatrix=[o[0]*r+o[2]*a,o[1]*r+o[3]*a,o[0]*-a+o[2]*r,o[1]*-a+o[3]*r,o[4],o[5]];this._originalRotate(t)}}}var c=function CachedCanvasesClosure(){function CachedCanvases(t){this.canvasFactory=t;this.cache=Object.create(null)}CachedCanvases.prototype={getCanvas:function CachedCanvases_getCanvas(t,r,a,o){var i;if(void 0!==this.cache[t]){i=this.cache[t];this.canvasFactory.reset(i,r,a);i.context.setTransform(1,0,0,1,0,0)}else{i=this.canvasFactory.create(r,a);this.cache[t]=i}o&&addContextCurrentTransform(i.context);return i},clear:function clear(){for(var t in this.cache){var r=this.cache[t];this.canvasFactory.destroy(r);delete this.cache[t]}}};return CachedCanvases}();var d=function CanvasExtraStateClosure(){function CanvasExtraState(){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=o.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=o.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=o.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.resumeSMaskCtx=null;this.transferMaps=null}CanvasExtraState.prototype={clone:function CanvasExtraState_clone(){return Object.create(this)},setCurrentPoint:function CanvasExtraState_setCurrentPoint(t,r){this.x=t;this.y=r}};return CanvasExtraState}(),h=function CanvasGraphicsClosure(){function CanvasGraphics(t,r,a,o,i,l,u){this.ctx=t;this.current=new d;this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=r;this.objs=a;this.canvasFactory=o;this.webGLContext=i;this.imageLayer=l;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.contentVisible=!0;this.markedContentStack=[];this.optionalContentConfig=u;this.cachedCanvases=new c(this.canvasFactory);t&&addContextCurrentTransform(t);this._cachedGetSinglePixelWidth=null}function putBinaryImageData(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&r instanceof ImageData)t.putImageData(r,0,0);else{var i,l,c,d,h,p,m,v,g,y=r.height,b=r.width,_=y%u,S=(y-_)/u,C=0===_?S:S+1,A=t.createImageData(b,u),R=0,k=r.data,P=A.data;if(a)switch(a.length){case 1:p=a[0];m=a[0];v=a[0];g=a[0];break;case 4:p=a[0];m=a[1];v=a[2];g=a[3]}if(r.kind===o.ImageKind.GRAYSCALE_1BPP){var w=k.byteLength,x=new Uint32Array(P.buffer,0,P.byteLength>>2),T=x.length,E=b+7>>3,O=4294967295,I=o.IsLittleEndianCached.value?4278190080:255;if(g&&255===g[0]&&0===g[255]){var D=[I,O];O=D[0];I=D[1]}for(l=0;l<C;l++){d=l<S?u:_;i=0;for(c=0;c<d;c++){for(var L=w-R,M=0,W=L>E?b:8*L-7,j=-8&W,N=0,B=0;M<j;M+=8){B=k[R++];x[i++]=128&B?O:I;x[i++]=64&B?O:I;x[i++]=32&B?O:I;x[i++]=16&B?O:I;x[i++]=8&B?O:I;x[i++]=4&B?O:I;x[i++]=2&B?O:I;x[i++]=1&B?O:I}for(;M<W;M++){if(0===N){B=k[R++];N=128}x[i++]=B&N?O:I;N>>=1}}for(;i<T;)x[i++]=0;t.putImageData(A,0,l*u)}}else if(r.kind===o.ImageKind.RGBA_32BPP){var q=!!(p||m||v);c=0;h=b*u*4;for(l=0;l<S;l++){P.set(k.subarray(R,R+h));R+=h;if(q)for(var G=0;G<h;G+=4){p&&(P[G+0]=p[P[G+0]]);m&&(P[G+1]=m[P[G+1]]);v&&(P[G+2]=v[P[G+2]])}t.putImageData(A,0,c);c+=u}if(l<C){h=b*_*4;P.set(k.subarray(R,R+h));if(q)for(var U=0;U<h;U+=4){p&&(P[U+0]=p[P[U+0]]);m&&(P[U+1]=m[P[U+1]]);v&&(P[U+2]=v[P[U+2]])}t.putImageData(A,0,c)}}else{if(r.kind!==o.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(r.kind));var H=!!(p||m||v);h=b*(d=u);for(l=0;l<C;l++){l>=S&&(h=b*(d=_));i=0;for(c=h;c--;){P[i++]=k[R++];P[i++]=k[R++];P[i++]=k[R++];P[i++]=255}if(H)for(var z=0;z<i;z+=4){p&&(P[z+0]=p[P[z+0]]);m&&(P[z+1]=m[P[z+1]]);v&&(P[z+2]=v[P[z+2]])}t.putImageData(A,0,l*u)}}}}function putBinaryImageMask(t,r){for(var a=r.height,o=r.width,i=a%u,l=(a-i)/u,c=0===i?l:l+1,d=t.createImageData(o,u),h=0,p=r.data,m=d.data,v=0;v<c;v++){for(var g=v<l?u:i,y=3,b=0;b<g;b++)for(var _=void 0,S=0,C=0;C<o;C++){if(!S){_=p[h++];S=128}m[y]=_&S?0:255;y+=4;S>>=1}t.putImageData(d,0,v*u)}}function copyCtxState(t,r){for(var a=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],o=0,i=a.length;o<i;o++){var l=a[o];void 0!==t[l]&&(r[l]=t[l])}if(void 0!==t.setLineDash){r.setLineDash(t.getLineDash());r.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t){t.strokeStyle="#000000";t.fillStyle="#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,r,a,o){for(var i=t.length,l=3;l<i;l+=4){var u=t[l];if(0===u){t[l-3]=r;t[l-2]=a;t[l-1]=o}else if(u<255){var c=255-u;t[l-3]=t[l-3]*u+r*c>>8;t[l-2]=t[l-2]*u+a*c>>8;t[l-1]=t[l-1]*u+o*c>>8}}}function composeSMaskAlpha(t,r,a){for(var o=t.length,i=3;i<o;i+=4){var l=a?a[t[i]]:t[i];r[i]=r[i]*l*.00392156862745098|0}}function composeSMaskLuminosity(t,r,a){for(var o=t.length,i=3;i<o;i+=4){var l=77*t[i-3]+152*t[i-2]+28*t[i-1];r[i]=a?r[i]*a[l>>8]>>8:r[i]*l>>16}}function composeSMask(t,r,a,o){var i=r.canvas,l=r.context;t.setTransform(r.scaleX,0,0,r.scaleY,r.offsetX,r.offsetY);var u=r.backdrop||null;if(r.transferMap||!o.isEnabled){!function genericComposeSMask(t,r,a,o,i,l,u){var c,d=!!l,h=d?l[0]:0,p=d?l[1]:0,m=d?l[2]:0;c="Luminosity"===i?composeSMaskLuminosity:composeSMaskAlpha;for(var v=Math.min(o,Math.ceil(1048576/a)),g=0;g<o;g+=v){var y=Math.min(v,o-g),b=t.getImageData(0,g,a,y),_=r.getImageData(0,g,a,y);d&&composeSMaskBackdrop(b.data,h,p,m);c(b.data,_.data,u);t.putImageData(_,0,g)}}(l,a,i.width,i.height,r.subtype,u,r.transferMap);t.drawImage(i,0,0)}else{var c=o.composeSMask({layer:a.canvas,mask:i,properties:{subtype:r.subtype,backdrop:u}});t.setTransform(1,0,0,1,0,0);t.drawImage(c,r.offsetX,r.offsetY)}}var t=["butt","round","square"],r=["miter","round","bevel"],a={},h={};CanvasGraphics.prototype={beginDrawing:function beginDrawing(t){var r=t.transform,a=t.viewport,o=t.transparency,i=void 0!==o&&o,l=t.background,u=void 0===l?null:l,c=this.ctx.canvas.width,d=this.ctx.canvas.height;this.ctx.save();this.ctx.fillStyle=u||"rgb(255, 255, 255)";this.ctx.fillRect(0,0,c,d);this.ctx.restore();if(i){var h=this.cachedCanvases.getCanvas("transparent",c,d,!0);this.compositeCtx=this.ctx;this.transparentCanvas=h.canvas;this.ctx=h.context;this.ctx.save();this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save();resetCtxToDefault(this.ctx);r&&this.ctx.transform.apply(this.ctx,r);this.ctx.transform.apply(this.ctx,a.transform);this.baseTransform=this.ctx.mozCurrentTransform.slice();this._combinedScaleFactor=Math.hypot(this.baseTransform[0],this.baseTransform[2]);this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function CanvasGraphics_executeOperatorList(t,r,a,i){var l=t.argsArray,u=t.fnArray,c=r||0,d=l.length;if(d===c)return c;for(var h,p=d-c>10&&"function"==typeof a,m=p?Date.now()+15:0,v=0,g=this.commonObjs,y=this.objs;;){if(void 0!==i&&c===i.nextBreakPoint){i.breakIt(c,a);return c}if((h=u[c])!==o.OPS.dependency)this[h].apply(this,l[c]);else{var b,_=_createForOfIteratorHelper(l[c]);try{for(_.s();!(b=_.n()).done;){var S=b.value,C=S.startsWith("g_")?g:y;if(!C.has(S)){C.get(S,a);return c}}}catch(t){_.e(t)}finally{_.f()}}if(++c===d)return c;if(p&&++v>10){if(Date.now()>m){a();return c}v=0}}},endDrawing:function CanvasGraphics_endDrawing(){for(;this.stateStack.length||null!==this.current.activeSMask;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}this.cachedCanvases.clear();this.webGLContext.clear();this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function CanvasGraphics_setLineWidth(t){this.current.lineWidth=t;this.ctx.lineWidth=t},setLineCap:function CanvasGraphics_setLineCap(r){this.ctx.lineCap=t[r]},setLineJoin:function CanvasGraphics_setLineJoin(t){this.ctx.lineJoin=r[t]},setMiterLimit:function CanvasGraphics_setMiterLimit(t){this.ctx.miterLimit=t},setDash:function CanvasGraphics_setDash(t,r){var a=this.ctx;if(void 0!==a.setLineDash){a.setLineDash(t);a.lineDashOffset=r}},setRenderingIntent:function setRenderingIntent(t){},setFlatness:function setFlatness(t){},setGState:function CanvasGraphics_setGState(t){for(var r=0,a=t.length;r<a;r++){var o=t[r],i=o[0],l=o[1];switch(i){case"LW":this.setLineWidth(l);break;case"LC":this.setLineCap(l);break;case"LJ":this.setLineJoin(l);break;case"ML":this.setMiterLimit(l);break;case"D":this.setDash(l[0],l[1]);break;case"RI":this.setRenderingIntent(l);break;case"FL":this.setFlatness(l);break;case"Font":this.setFont(l[0],l[1]);break;case"CA":this.current.strokeAlpha=o[1];break;case"ca":this.current.fillAlpha=o[1];this.ctx.globalAlpha=o[1];break;case"BM":this.ctx.globalCompositeOperation=l;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup());this.current.activeSMask=l?this.tempSMask:null;this.current.activeSMask&&this.beginSMaskGroup();this.tempSMask=null;break;case"TR":this.current.transferMaps=l}}},beginSMaskGroup:function CanvasGraphics_beginSMaskGroup(){var t=this.current.activeSMask,r=t.canvas.width,a=t.canvas.height,o="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(o,r,a,!0),l=this.ctx,u=l.mozCurrentTransform;this.ctx.save();var c=i.context;c.scale(1/t.scaleX,1/t.scaleY);c.translate(-t.offsetX,-t.offsetY);c.transform.apply(c,u);t.startTransformInverse=c.mozCurrentTransformInverse;copyCtxState(l,c);this.ctx=c;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(l);this.groupLevel++},suspendSMaskGroup:function CanvasGraphics_endSMaskGroup(){var t=this.ctx;this.groupLevel--;this.ctx=this.groupStack.pop();composeSMask(this.ctx,this.current.activeSMask,t,this.webGLContext);this.ctx.restore();this.ctx.save();copyCtxState(t,this.ctx);this.current.resumeSMaskCtx=t;var r=o.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,r);t.save();t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,t.canvas.width,t.canvas.height);t.restore()},resumeSMaskGroup:function CanvasGraphics_resumeSMaskGroup(){var t=this.current.resumeSMaskCtx,r=this.ctx;this.ctx=t;this.groupStack.push(r);this.groupLevel++},endSMaskGroup:function CanvasGraphics_endSMaskGroup(){var t=this.ctx;this.groupLevel--;this.ctx=this.groupStack.pop();composeSMask(this.ctx,this.current.activeSMask,t,this.webGLContext);this.ctx.restore();copyCtxState(t,this.ctx);var r=o.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,r)},save:function CanvasGraphics_save(){this.ctx.save();var t=this.current;this.stateStack.push(t);this.current=t.clone();this.current.resumeSMaskCtx=null},restore:function CanvasGraphics_restore(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup();null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup();if(0!==this.stateStack.length){this.current=this.stateStack.pop();this.ctx.restore();this.pendingClip=null;this._cachedGetSinglePixelWidth=null}else this.current.activeSMask=null},transform:function CanvasGraphics_transform(t,r,a,o,i,l){this.ctx.transform(t,r,a,o,i,l);this._cachedGetSinglePixelWidth=null},constructPath:function CanvasGraphics_constructPath(t,r){for(var a=this.ctx,i=this.current,l=i.x,u=i.y,c=0,d=0,h=t.length;c<h;c++)switch(0|t[c]){case o.OPS.rectangle:l=r[d++];u=r[d++];var p=r[d++],m=r[d++],v=l+p,g=u+m;a.moveTo(l,u);if(0===p||0===m)a.lineTo(v,g);else{a.lineTo(v,u);a.lineTo(v,g);a.lineTo(l,g)}a.closePath();break;case o.OPS.moveTo:l=r[d++];u=r[d++];a.moveTo(l,u);break;case o.OPS.lineTo:l=r[d++];u=r[d++];a.lineTo(l,u);break;case o.OPS.curveTo:l=r[d+4];u=r[d+5];a.bezierCurveTo(r[d],r[d+1],r[d+2],r[d+3],l,u);d+=6;break;case o.OPS.curveTo2:a.bezierCurveTo(l,u,r[d],r[d+1],r[d+2],r[d+3]);l=r[d+2];u=r[d+3];d+=4;break;case o.OPS.curveTo3:l=r[d+2];u=r[d+3];a.bezierCurveTo(r[d],r[d+1],l,u,l,u);d+=4;break;case o.OPS.closePath:a.closePath()}i.setCurrentPoint(l,u)},closePath:function CanvasGraphics_closePath(){this.ctx.closePath()},stroke:function CanvasGraphics_stroke(t){t=void 0===t||t;var r=this.ctx,a=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"===_typeof(a)&&null!=a&&a.getPattern){r.save();var i=r.mozCurrentTransform,l=o.Util.singularValueDecompose2dScale(i)[0];r.strokeStyle=a.getPattern(r,this);var u=this.getSinglePixelWidth(),c=this.current.lineWidth*l;if(u<0&&-u>=c){r.resetTransform();r.lineWidth=Math.round(this._combinedScaleFactor)}else r.lineWidth=Math.max(u,c);r.stroke();r.restore()}else{var d=this.getSinglePixelWidth();if(d<0&&-d>=this.current.lineWidth){r.save();r.resetTransform();r.lineWidth=Math.round(this._combinedScaleFactor);r.stroke();r.restore()}else{r.lineWidth=Math.max(d,this.current.lineWidth);r.stroke()}}t&&this.consumePath();r.globalAlpha=this.current.fillAlpha},closeStroke:function CanvasGraphics_closeStroke(){this.closePath();this.stroke()},fill:function CanvasGraphics_fill(t){t=void 0===t||t;var r=this.ctx,a=this.current.fillColor,o=!1;if(this.current.patternFill){r.save();this.baseTransform&&r.setTransform.apply(r,this.baseTransform);r.fillStyle=a.getPattern(r,this);o=!0}if(this.contentVisible)if(this.pendingEOFill){r.fill("evenodd");this.pendingEOFill=!1}else r.fill();o&&r.restore();t&&this.consumePath()},eoFill:function CanvasGraphics_eoFill(){this.pendingEOFill=!0;this.fill()},fillStroke:function CanvasGraphics_fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()},eoFillStroke:function CanvasGraphics_eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()},closeFillStroke:function CanvasGraphics_closeFillStroke(){this.closePath();this.fillStroke()},closeEOFillStroke:function CanvasGraphics_closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()},endPath:function CanvasGraphics_endPath(){this.consumePath()},clip:function CanvasGraphics_clip(){this.pendingClip=a},eoClip:function CanvasGraphics_eoClip(){this.pendingClip=h},beginText:function CanvasGraphics_beginText(){this.current.textMatrix=o.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0},endText:function CanvasGraphics_endText(){var t=this.pendingTextPaths,r=this.ctx;if(void 0!==t){r.save();r.beginPath();for(var a=0;a<t.length;a++){var o=t[a];r.setTransform.apply(r,o.transform);r.translate(o.x,o.y);o.addToPath(r,o.fontSize)}r.restore();r.clip();r.beginPath();delete this.pendingTextPaths}else r.beginPath()},setCharSpacing:function CanvasGraphics_setCharSpacing(t){this.current.charSpacing=t},setWordSpacing:function CanvasGraphics_setWordSpacing(t){this.current.wordSpacing=t},setHScale:function CanvasGraphics_setHScale(t){this.current.textHScale=t/100},setLeading:function CanvasGraphics_setLeading(t){this.current.leading=-t},setFont:function CanvasGraphics_setFont(t,r){var a=this.commonObjs.get(t),i=this.current;if(!a)throw new Error("Can't find font for ".concat(t));i.fontMatrix=a.fontMatrix||o.FONT_IDENTITY_MATRIX;0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,o.warn)("Invalid font matrix for font "+t);if(r<0){r=-r;i.fontDirection=-1}else i.fontDirection=1;this.current.font=a;this.current.fontSize=r;if(!a.isType3Font){var l=a.loadedName||"sans-serif",u="normal";a.black?u="900":a.bold&&(u="bold");var c=a.italic?"italic":"normal",d='"'.concat(l,'", ').concat(a.fallbackName),h=r;r<16?h=16:r>100&&(h=100);this.current.fontSizeScale=r/h;this.ctx.font="".concat(c," ").concat(u," ").concat(h,"px ").concat(d)}},setTextRenderingMode:function CanvasGraphics_setTextRenderingMode(t){this.current.textRenderingMode=t},setTextRise:function CanvasGraphics_setTextRise(t){this.current.textRise=t},moveText:function CanvasGraphics_moveText(t,r){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=r},setLeadingMoveText:function CanvasGraphics_setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)},setTextMatrix:function CanvasGraphics_setTextMatrix(t,r,a,o,i,l){this.current.textMatrix=[t,r,a,o,i,l];this.current.textMatrixScale=Math.sqrt(t*t+r*r);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0},nextLine:function CanvasGraphics_nextLine(){this.moveText(0,this.current.leading)},paintChar:function paintChar(t,r,a,i,l){var u,c=this.ctx,d=this.current,h=d.font,p=d.textRenderingMode,m=d.fontSize/d.fontSizeScale,v=p&o.TextRenderingMode.FILL_STROKE_MASK,g=!!(p&o.TextRenderingMode.ADD_TO_PATH_FLAG),y=d.patternFill&&!h.missingFile;(h.disableFontFace||g||y)&&(u=h.getPathGenerator(this.commonObjs,t));if(h.disableFontFace||y){c.save();c.translate(r,a);c.beginPath();u(c,m);i&&c.setTransform.apply(c,i);v!==o.TextRenderingMode.FILL&&v!==o.TextRenderingMode.FILL_STROKE||c.fill();if(v===o.TextRenderingMode.STROKE||v===o.TextRenderingMode.FILL_STROKE){if(l){c.resetTransform();c.lineWidth=Math.round(this._combinedScaleFactor)}c.stroke()}c.restore()}else{v!==o.TextRenderingMode.FILL&&v!==o.TextRenderingMode.FILL_STROKE||c.fillText(t,r,a);if(v===o.TextRenderingMode.STROKE||v===o.TextRenderingMode.FILL_STROKE)if(l){c.save();c.moveTo(r,a);c.resetTransform();c.lineWidth=Math.round(this._combinedScaleFactor);c.strokeText(t,0,0);c.restore()}else c.strokeText(t,r,a)}if(g){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:c.mozCurrentTransform,x:r,y:a,fontSize:m,addToPath:u})}},get isFontSubpixelAAEnabled(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;t.scale(1.5,1);t.fillText("I",0,10);for(var r=t.getImageData(0,0,10,10).data,a=!1,i=3;i<r.length;i+=4)if(r[i]>0&&r[i]<255){a=!0;break}return(0,o.shadow)(this,"isFontSubpixelAAEnabled",a)},showText:function CanvasGraphics_showText(t){var r=this.current,a=r.font;if(a.isType3Font)return this.showType3Text(t);var i=r.fontSize;if(0!==i){var l,u=this.ctx,c=r.fontSizeScale,d=r.charSpacing,h=r.wordSpacing,p=r.fontDirection,m=r.textHScale*p,v=t.length,g=a.vertical,y=g?1:-1,b=a.defaultVMetrics,_=i*r.fontMatrix[0],S=r.textRenderingMode===o.TextRenderingMode.FILL&&!a.disableFontFace&&!r.patternFill;u.save();if(r.patternFill){u.save();var C=r.fillColor.getPattern(u,this);l=u.mozCurrentTransform;u.restore();u.fillStyle=C}u.transform.apply(u,r.textMatrix);u.translate(r.x,r.y+r.textRise);p>0?u.scale(m,-1):u.scale(m,1);var A=r.lineWidth,R=!1,k=r.textMatrixScale;if(0===k||0===A){var P=r.textRenderingMode&o.TextRenderingMode.FILL_STROKE_MASK;if(P===o.TextRenderingMode.STROKE||P===o.TextRenderingMode.FILL_STROKE){this._cachedGetSinglePixelWidth=null;R=(A=this.getSinglePixelWidth())<0}}else A/=k;if(1!==c){u.scale(c,c);A/=c}u.lineWidth=A;var w,x=0;for(w=0;w<v;++w){var T=t[w];if((0,o.isNum)(T))x+=y*T*i/1e3;else{var E=!1,O=(T.isSpace?h:0)+d,I=T.fontChar,D=T.accent,L=void 0,M=void 0,W=T.width;if(g){var j=T.vmetric||b,N=-(T.vmetric?j[1]:.5*W)*_,B=j[2]*_;W=j?-j[0]:W;L=N/c;M=(x+B)/c}else{L=x/c;M=0}if(a.remeasure&&W>0){var q=1e3*u.measureText(I).width/i*c;if(W<q&&this.isFontSubpixelAAEnabled){var G=W/q;E=!0;u.save();u.scale(G,1);L/=G}else W!==q&&(L+=(W-q)/2e3*i/c)}if(this.contentVisible&&(T.isInFont||a.missingFile))if(S&&!D)u.fillText(I,L,M);else{this.paintChar(I,L,M,l,R);if(D){var U=L+i*D.offset.x/c,H=M-i*D.offset.y/c;this.paintChar(D.fontChar,U,H,l,R)}}x+=g?W*_-O*p:W*_+O*p;E&&u.restore()}}g?r.y-=x:r.x+=x*m;u.restore()}},showType3Text:function CanvasGraphics_showType3Text(t){var r,a,i,l,u=this.ctx,c=this.current,d=c.font,h=c.fontSize,p=c.fontDirection,m=d.vertical?1:-1,v=c.charSpacing,g=c.wordSpacing,y=c.textHScale*p,b=c.fontMatrix||o.FONT_IDENTITY_MATRIX,_=t.length;if(!(c.textRenderingMode===o.TextRenderingMode.INVISIBLE)&&0!==h){this._cachedGetSinglePixelWidth=null;u.save();u.transform.apply(u,c.textMatrix);u.translate(c.x,c.y);u.scale(y,p);for(r=0;r<_;++r){a=t[r];if((0,o.isNum)(a)){l=m*a*h/1e3;this.ctx.translate(l,0);c.x+=l*y}else{var S=(a.isSpace?g:0)+v,C=d.charProcOperatorList[a.operatorListId];if(C){if(this.contentVisible){this.processingType3=a;this.save();u.scale(h,h);u.transform.apply(u,b);this.executeOperatorList(C);this.restore()}i=o.Util.applyTransform([a.width,0],b)[0]*h+S;u.translate(i,0);c.x+=i*y}else(0,o.warn)('Type3 character "'.concat(a.operatorListId,'" is not available.'))}}u.restore();this.processingType3=null}},setCharWidth:function CanvasGraphics_setCharWidth(t,r){},setCharWidthAndBounds:function CanvasGraphics_setCharWidthAndBounds(t,r,a,o,i,l){this.ctx.rect(a,o,i-a,l-o);this.clip();this.endPath()},getColorN_Pattern:function CanvasGraphics_getColorN_Pattern(t){var r,a=this;if("TilingPattern"===t[0]){var o=t[1],l=this.baseTransform||this.ctx.mozCurrentTransform.slice(),u={createCanvasGraphics:function createCanvasGraphics(t){return new CanvasGraphics(t,a.commonObjs,a.objs,a.canvasFactory,a.webGLContext)}};r=new i.TilingPattern(t,o,this.ctx,u,l)}else r=(0,i.getShadingPatternFromIR)(t);return r},setStrokeColorN:function CanvasGraphics_setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function CanvasGraphics_setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0},setStrokeRGBColor:function CanvasGraphics_setStrokeRGBColor(t,r,a){var i=o.Util.makeHexColor(t,r,a);this.ctx.strokeStyle=i;this.current.strokeColor=i},setFillRGBColor:function CanvasGraphics_setFillRGBColor(t,r,a){var i=o.Util.makeHexColor(t,r,a);this.ctx.fillStyle=i;this.current.fillColor=i;this.current.patternFill=!1},shadingFill:function CanvasGraphics_shadingFill(t){if(this.contentVisible){var r=this.ctx;this.save();var a=(0,i.getShadingPatternFromIR)(t);r.fillStyle=a.getPattern(r,this,!0);var l=r.mozCurrentTransformInverse;if(l){var u=r.canvas,c=u.width,d=u.height,h=o.Util.applyTransform([0,0],l),p=o.Util.applyTransform([0,d],l),m=o.Util.applyTransform([c,0],l),v=o.Util.applyTransform([c,d],l),g=Math.min(h[0],p[0],m[0],v[0]),y=Math.min(h[1],p[1],m[1],v[1]),b=Math.max(h[0],p[0],m[0],v[0]),_=Math.max(h[1],p[1],m[1],v[1]);this.ctx.fillRect(g,y,b-g,_-y)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()}},beginInlineImage:function CanvasGraphics_beginInlineImage(){(0,o.unreachable)("Should not call beginInlineImage")},beginImageData:function CanvasGraphics_beginImageData(){(0,o.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function CanvasGraphics_paintFormXObjectBegin(t,r){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform.apply(this,t);this.baseTransform=this.ctx.mozCurrentTransform;if(r){var a=r[2]-r[0],o=r[3]-r[1];this.ctx.rect(r[0],r[1],a,o);this.clip();this.endPath()}}},paintFormXObjectEnd:function CanvasGraphics_paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}},beginGroup:function CanvasGraphics_beginGroup(t){if(this.contentVisible){this.save();var r=this.ctx;t.isolated||(0,o.info)("TODO: Support non-isolated groups.");t.knockout&&(0,o.warn)("Knockout groups not supported.");var a=r.mozCurrentTransform;t.matrix&&r.transform.apply(r,t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");var i=o.Util.getAxialAlignedBoundingBox(t.bbox,r.mozCurrentTransform),u=[0,0,r.canvas.width,r.canvas.height];i=o.Util.intersect(i,u)||[0,0,0,0];var c=Math.floor(i[0]),d=Math.floor(i[1]),h=Math.max(Math.ceil(i[2])-c,1),p=Math.max(Math.ceil(i[3])-d,1),m=1,v=1;if(h>l){m=h/l;h=l}if(p>l){v=p/l;p=l}var g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);var y=this.cachedCanvases.getCanvas(g,h,p,!0),b=y.context;b.scale(1/m,1/v);b.translate(-c,-d);b.transform.apply(b,a);if(t.smask)this.smaskStack.push({canvas:y.canvas,context:b,offsetX:c,offsetY:d,scaleX:m,scaleY:v,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{r.setTransform(1,0,0,1,0,0);r.translate(c,d);r.scale(m,v)}copyCtxState(r,b);this.ctx=b;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(r);this.groupLevel++;this.current.activeSMask=null}},endGroup:function CanvasGraphics_endGroup(t){if(this.contentVisible){this.groupLevel--;var r=this.ctx;this.ctx=this.groupStack.pop();void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1;t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(r.canvas,0,0);this.restore()}},beginAnnotations:function CanvasGraphics_beginAnnotations(){this.save();this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function CanvasGraphics_endAnnotations(){this.restore()},beginAnnotation:function CanvasGraphics_beginAnnotation(t,r,a){this.save();resetCtxToDefault(this.ctx);this.current=new d;if(Array.isArray(t)&&4===t.length){var o=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],o,i);this.clip();this.endPath()}this.transform.apply(this,r);this.transform.apply(this,a)},endAnnotation:function CanvasGraphics_endAnnotation(){this.restore()},paintImageMaskXObject:function CanvasGraphics_paintImageMaskXObject(t){if(this.contentVisible){var r=this.ctx,a=t.width,o=t.height,i=this.current.fillColor,l=this.current.patternFill,u=this.processingType3;u&&void 0===u.compiled&&(u.compiled=a<=1e3&&o<=1e3?function compileType3Glyph(t){var r,a,o,i,l=t.width,u=t.height,c=l+1,d=new Uint8Array(c*(u+1)),h=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),p=l+7&-8,m=t.data,v=new Uint8Array(p*u),g=0;for(r=0,a=m.length;r<a;r++)for(var y=m[r],b=128;b>0;){v[g++]=y&b?0:255;b>>=1}var _=0;if(0!==v[g=0]){d[0]=1;++_}for(o=1;o<l;o++){if(v[g]!==v[g+1]){d[o]=v[g]?2:1;++_}g++}if(0!==v[g]){d[o]=2;++_}for(r=1;r<u;r++){i=r*c;if(v[(g=r*p)-p]!==v[g]){d[i]=v[g]?1:8;++_}var S=(v[g]?4:0)+(v[g-p]?8:0);for(o=1;o<l;o++){if(h[S=(S>>2)+(v[g+1]?4:0)+(v[g-p+1]?8:0)]){d[i+o]=h[S];++_}g++}if(v[g-p]!==v[g]){d[i+o]=v[g]?2:4;++_}if(_>1e3)return null}i=r*c;if(0!==v[g=p*(u-1)]){d[i]=8;++_}for(o=1;o<l;o++){if(v[g]!==v[g+1]){d[i+o]=v[g]?4:8;++_}g++}if(0!==v[g]){d[i+o]=4;++_}if(_>1e3)return null;var C=new Int32Array([0,c,-1,0,-c,0,0,0,1]),A=[];for(r=0;_&&r<=u;r++){for(var R=r*c,k=R+l;R<k&&!d[R];)R++;if(R!==k){var P=[R%c,r],w=R,x=d[R];do{var T=C[x];do{R+=T}while(!d[R]);var E=d[R];if(5!==E&&10!==E){x=E;d[R]=0}else{x=E&51*x>>4;d[R]&=x>>2|x<<2}P.push(R%c);P.push(R/c|0);d[R]||--_}while(w!==R);A.push(P);--r}}return function drawOutline(t){t.save();t.scale(1/l,-1/u);t.translate(0,-u);t.beginPath();for(var r=0,a=A.length;r<a;r++){var o=A[r];t.moveTo(o[0],o[1]);for(var i=2,c=o.length;i<c;i+=2)t.lineTo(o[i],o[i+1])}t.fill();t.beginPath();t.restore()}}({data:t.data,width:a,height:o}):null);if(null!=u&&u.compiled)u.compiled(r);else{var c=this.cachedCanvases.getCanvas("maskCanvas",a,o),d=c.context;d.save();putBinaryImageMask(d,t);d.globalCompositeOperation="source-in";d.fillStyle=l?i.getPattern(d,this):i;d.fillRect(0,0,a,o);d.restore();this.paintInlineImageXObject(c.canvas)}}},paintImageMaskXObjectRepeat:function paintImageMaskXObjectRepeat(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){var u=t.width,c=t.height,d=this.current.fillColor,h=this.current.patternFill,p=this.cachedCanvases.getCanvas("maskCanvas",u,c),m=p.context;m.save();putBinaryImageMask(m,t);m.globalCompositeOperation="source-in";m.fillStyle=h?d.getPattern(m,this):d;m.fillRect(0,0,u,c);m.restore();for(var v=this.ctx,g=0,y=l.length;g<y;g+=2){v.save();v.transform(r,a,o,i,l[g],l[g+1]);v.scale(1,-1);v.drawImage(p.canvas,0,0,u,c,0,-1,1,1);v.restore()}}},paintImageMaskXObjectGroup:function CanvasGraphics_paintImageMaskXObjectGroup(t){if(this.contentVisible)for(var r=this.ctx,a=this.current.fillColor,o=this.current.patternFill,i=0,l=t.length;i<l;i++){var u=t[i],c=u.width,d=u.height,h=this.cachedCanvases.getCanvas("maskCanvas",c,d),p=h.context;p.save();putBinaryImageMask(p,u);p.globalCompositeOperation="source-in";p.fillStyle=o?a.getPattern(p,this):a;p.fillRect(0,0,c,d);p.restore();r.save();r.transform.apply(r,u.transform);r.scale(1,-1);r.drawImage(h.canvas,0,0,c,d,0,-1,1,1);r.restore()}},paintImageXObject:function CanvasGraphics_paintImageXObject(t){if(this.contentVisible){var r=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);r?this.paintInlineImageXObject(r):(0,o.warn)("Dependent image isn't ready yet")}},paintImageXObjectRepeat:function CanvasGraphics_paintImageXObjectRepeat(t,r,a,i){if(this.contentVisible){var l=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(l){for(var u=l.width,c=l.height,d=[],h=0,p=i.length;h<p;h+=2)d.push({transform:[r,0,0,a,i[h],i[h+1]],x:0,y:0,w:u,h:c});this.paintInlineImageXObjectGroup(l,d)}else(0,o.warn)("Dependent image isn't ready yet")}},paintInlineImageXObject:function CanvasGraphics_paintInlineImageXObject(t){if(this.contentVisible){var r=t.width,a=t.height,o=this.ctx;this.save();o.scale(1/r,-1/a);var i,l,u,c=o.mozCurrentTransformInverse,d=c[0],h=c[1],p=Math.max(Math.sqrt(d*d+h*h),1),m=c[2],v=c[3],g=Math.max(Math.sqrt(m*m+v*v),1);if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)i=t;else{putBinaryImageData(u=(l=this.cachedCanvases.getCanvas("inlineImage",r,a)).context,t,this.current.transferMaps);i=l.canvas}for(var y=r,b=a,_="prescale1";p>2&&y>1||g>2&&b>1;){var S=y,C=b;p>2&&y>1&&(p/=y/(S=Math.ceil(y/2)));g>2&&b>1&&(g/=b/(C=Math.ceil(b/2)));(u=(l=this.cachedCanvases.getCanvas(_,S,C)).context).clearRect(0,0,S,C);u.drawImage(i,0,0,y,b,0,0,S,C);i=l.canvas;y=S;b=C;_="prescale1"===_?"prescale2":"prescale1"}o.drawImage(i,0,0,y,b,0,-a,r,a);if(this.imageLayer){var A=this.getCanvasPosition(0,-a);this.imageLayer.appendImage({imgData:t,left:A[0],top:A[1],width:r/c[0],height:a/c[3]})}this.restore()}},paintInlineImageXObjectGroup:function CanvasGraphics_paintInlineImageXObjectGroup(t,r){if(this.contentVisible){var a=this.ctx,o=t.width,i=t.height,l=this.cachedCanvases.getCanvas("inlineImage",o,i);putBinaryImageData(l.context,t,this.current.transferMaps);for(var u=0,c=r.length;u<c;u++){var d=r[u];a.save();a.transform.apply(a,d.transform);a.scale(1,-1);a.drawImage(l.canvas,d.x,d.y,d.w,d.h,0,-1,1,1);if(this.imageLayer){var h=this.getCanvasPosition(d.x,d.y);this.imageLayer.appendImage({imgData:t,left:h[0],top:h[1],width:o,height:i})}a.restore()}}},paintSolidColorImageMask:function CanvasGraphics_paintSolidColorImageMask(){this.contentVisible&&this.ctx.fillRect(0,0,1,1)},markPoint:function CanvasGraphics_markPoint(t){},markPointProps:function CanvasGraphics_markPointProps(t,r){},beginMarkedContent:function CanvasGraphics_beginMarkedContent(t){this.markedContentStack.push({visible:!0})},beginMarkedContentProps:function CanvasGraphics_beginMarkedContentProps(t,r){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()},endMarkedContent:function CanvasGraphics_endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()},beginCompat:function CanvasGraphics_beginCompat(){},endCompat:function CanvasGraphics_endCompat(){},consumePath:function CanvasGraphics_consumePath(){var t=this.ctx;if(this.pendingClip){this.pendingClip===h?t.clip("evenodd"):t.clip();this.pendingClip=null}t.beginPath()},getSinglePixelWidth:function getSinglePixelWidth(){if(null===this._cachedGetSinglePixelWidth){var t=this.ctx.mozCurrentTransform,r=Math.abs(t[0]*t[3]-t[2]*t[1]),a=Math.pow(t[0],2)+Math.pow(t[2],2),o=Math.pow(t[1],2)+Math.pow(t[3],2),i=Math.sqrt(Math.max(a,o))/r;a!==o&&this._combinedScaleFactor*i>1?this._cachedGetSinglePixelWidth=-this._combinedScaleFactor*i:r>Number.EPSILON?this._cachedGetSinglePixelWidth=1.0000001*i:this._cachedGetSinglePixelWidth=1}return this._cachedGetSinglePixelWidth},getCanvasPosition:function CanvasGraphics_getCanvasPosition(t,r){var a=this.ctx.mozCurrentTransform;return[a[0]*t+a[2]*r+a[4],a[1]*t+a[3]*r+a[5]]},isContentVisible:function CanvasGraphics_isContentVisible(){for(var t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};for(var p in o.OPS)CanvasGraphics.prototype[o.OPS[p]]=CanvasGraphics.prototype[p];return CanvasGraphics}();r.CanvasGraphics=h},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getShadingPatternFromIR=function getShadingPatternFromIR(t){var r=i[t[0]];if(!r)throw new Error("Unknown IR type: ".concat(t[0]));return r.fromIR(t)};r.TilingPattern=void 0;var o=a(4),i={};function applyBoundingBox(t,r){if(r&&"undefined"!=typeof Path2D){var a=r[2]-r[0],o=r[3]-r[1],i=new Path2D;i.rect(r[0],r[1],a,o);t.clip(i)}}i.RadialAxial={fromIR:function RadialAxial_fromIR(t){var r=t[1],a=t[2],o=t[3],i=t[4],l=t[5],u=t[6],c=t[7];return{getPattern:function RadialAxial_getPattern(t){applyBoundingBox(t,a);var d;"axial"===r?d=t.createLinearGradient(i[0],i[1],l[0],l[1]):"radial"===r&&(d=t.createRadialGradient(i[0],i[1],u,l[0],l[1],c));for(var h=0,p=o.length;h<p;++h){var m=o[h];d.addColorStop(m[0],m[1])}return d}}}};var l=function createMeshCanvasClosure(){function drawTriangle(t,r,a,o,i,l,u,c){var d,h=r.coords,p=r.colors,m=t.data,v=4*t.width;if(h[a+1]>h[o+1]){d=a;a=o;o=d;d=l;l=u;u=d}if(h[o+1]>h[i+1]){d=o;o=i;i=d;d=u;u=c;c=d}if(h[a+1]>h[o+1]){d=a;a=o;o=d;d=l;l=u;u=d}var g=(h[a]+r.offsetX)*r.scaleX,y=(h[a+1]+r.offsetY)*r.scaleY,b=(h[o]+r.offsetX)*r.scaleX,_=(h[o+1]+r.offsetY)*r.scaleY,S=(h[i]+r.offsetX)*r.scaleX,C=(h[i+1]+r.offsetY)*r.scaleY;if(!(y>=C))for(var A,R,k,P,w,x,T,E,O=p[l],I=p[l+1],D=p[l+2],L=p[u],M=p[u+1],W=p[u+2],j=p[c],N=p[c+1],B=p[c+2],q=Math.round(y),G=Math.round(C),U=q;U<=G;U++){if(U<_){var H=void 0;A=g-(g-b)*(H=U<y?0:y===_?1:(y-U)/(y-_));R=O-(O-L)*H;k=I-(I-M)*H;P=D-(D-W)*H}else{var z=void 0;A=b-(b-S)*(z=U>C?1:_===C?0:(_-U)/(_-C));R=L-(L-j)*z;k=M-(M-N)*z;P=W-(W-B)*z}var V=void 0;w=g-(g-S)*(V=U<y?0:U>C?1:(y-U)/(y-C));x=O-(O-j)*V;T=I-(I-N)*V;E=D-(D-B)*V;for(var Y=Math.round(Math.min(A,w)),X=Math.round(Math.max(A,w)),Q=v*U+4*Y,J=Y;J<=X;J++){(V=(A-J)/(A-w))<0?V=0:V>1&&(V=1);m[Q++]=R-(R-x)*V|0;m[Q++]=k-(k-T)*V|0;m[Q++]=P-(P-E)*V|0;m[Q++]=255}}}function drawFigure(t,r,a){var o,i,l=r.coords,u=r.colors;switch(r.type){case"lattice":var c=r.verticesPerRow,d=Math.floor(l.length/c)-1,h=c-1;for(o=0;o<d;o++)for(var p=o*c,m=0;m<h;m++,p++){drawTriangle(t,a,l[p],l[p+1],l[p+c],u[p],u[p+1],u[p+c]);drawTriangle(t,a,l[p+c+1],l[p+1],l[p+c],u[p+c+1],u[p+1],u[p+c])}break;case"triangles":for(o=0,i=l.length;o<i;o+=3)drawTriangle(t,a,l[o],l[o+1],l[o+2],u[o],u[o+1],u[o+2]);break;default:throw new Error("illegal figure")}}return function createMeshCanvas(t,r,a,o,i,l,u,c){var d,h,p,m,v=Math.floor(t[0]),g=Math.floor(t[1]),y=Math.ceil(t[2])-v,b=Math.ceil(t[3])-g,_=Math.min(Math.ceil(Math.abs(y*r[0]*1.1)),3e3),S=Math.min(Math.ceil(Math.abs(b*r[1]*1.1)),3e3),C=y/_,A=b/S,R={coords:a,colors:o,offsetX:-v,offsetY:-g,scaleX:1/C,scaleY:1/A},k=_+4,P=S+4;if(c.isEnabled){d=c.drawFigures({width:_,height:S,backgroundColor:l,figures:i,context:R});(h=u.getCanvas("mesh",k,P,!1)).context.drawImage(d,2,2);d=h.canvas}else{var w=(h=u.getCanvas("mesh",k,P,!1)).context,x=w.createImageData(_,S);if(l){var T=x.data;for(p=0,m=T.length;p<m;p+=4){T[p]=l[0];T[p+1]=l[1];T[p+2]=l[2];T[p+3]=255}}for(p=0;p<i.length;p++)drawFigure(x,i[p],R);w.putImageData(x,2,2);d=h.canvas}return{canvas:d,offsetX:v-2*C,offsetY:g-2*A,scaleX:C,scaleY:A}}}();i.Mesh={fromIR:function Mesh_fromIR(t){var r=t[2],a=t[3],i=t[4],u=t[5],c=t[6],d=t[7],h=t[8];return{getPattern:function Mesh_getPattern(t,p,m){applyBoundingBox(t,d);var v;if(m)v=o.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else{v=o.Util.singularValueDecompose2dScale(p.baseTransform);if(c){var g=o.Util.singularValueDecompose2dScale(c);v=[v[0]*g[0],v[1]*g[1]]}}var y=l(u,v,r,a,i,m?null:h,p.cachedCanvases,p.webGLContext);if(!m){t.setTransform.apply(t,p.baseTransform);c&&t.transform.apply(t,c)}t.translate(y.offsetX,y.offsetY);t.scale(y.scaleX,y.scaleY);return t.createPattern(y.canvas,"no-repeat")}}}};i.Dummy={fromIR:function Dummy_fromIR(){return{getPattern:function Dummy_fromIR_getPattern(){return"hotpink"}}}};var u=function TilingPatternClosure(){var t=1,r=2;function TilingPattern(t,r,a,o,i){this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=r;this.canvasGraphicsFactory=o;this.baseTransform=i;this.ctx=a}TilingPattern.prototype={createPatternCanvas:function TilinPattern_createPatternCanvas(t){var r=this.operatorList,a=this.bbox,i=this.xstep,l=this.ystep,u=this.paintType,c=this.tilingType,d=this.color,h=this.canvasGraphicsFactory;(0,o.info)("TilingType: "+c);var p=a[0],m=a[1],v=a[2],g=a[3],y=o.Util.singularValueDecompose2dScale(this.matrix),b=o.Util.singularValueDecompose2dScale(this.baseTransform),_=[y[0]*b[0],y[1]*b[1]],S=this.getSizeAndScale(i,this.ctx.canvas.width,_[0]),C=this.getSizeAndScale(l,this.ctx.canvas.height,_[1]),A=t.cachedCanvases.getCanvas("pattern",S.size,C.size,!0),R=A.context,k=h.createCanvasGraphics(R);k.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(k,u,d);k.transform(S.scale,0,0,C.scale,0,0);k.transform(1,0,0,1,-p,-m);this.clipBbox(k,a,p,m,v,g);k.executeOperatorList(r);this.ctx.transform(1,0,0,1,p,m);this.ctx.scale(1/S.scale,1/C.scale);return A.canvas},getSizeAndScale:function TilingPattern_getSizeAndScale(t,r,a){t=Math.abs(t);var o=Math.max(3e3,r),i=Math.ceil(t*a);i>=o?i=o:a=i/t;return{scale:a,size:i}},clipBbox:function clipBbox(t,r,a,o,i,l){if(Array.isArray(r)&&4===r.length){var u=i-a,c=l-o;t.ctx.rect(a,o,u,c);t.clip();t.endPath()}},setFillAndStrokeStyleToContext:function setFillAndStrokeStyleToContext(a,i,l){var u=a.ctx,c=a.current;switch(i){case t:var d=this.ctx;u.fillStyle=d.fillStyle;u.strokeStyle=d.strokeStyle;c.fillColor=d.fillStyle;c.strokeColor=d.strokeStyle;break;case r:var h=o.Util.makeHexColor(l[0],l[1],l[2]);u.fillStyle=h;u.strokeStyle=h;c.fillColor=h;c.strokeColor=h;break;default:throw new o.FormatError("Unsupported paint type: ".concat(i))}},getPattern:function TilingPattern_getPattern(t,r){(t=this.ctx).setTransform.apply(t,this.baseTransform);t.transform.apply(t,this.matrix);var a=this.createPatternCanvas(r);return t.createPattern(a,"repeat")}};return TilingPattern}();r.TilingPattern=u},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.GlobalWorkerOptions=void 0;var a=Object.create(null);r.GlobalWorkerOptions=a;a.workerPort=void 0===a.workerPort?null:a.workerPort;a.workerSrc=void 0===a.workerSrc?"":a.workerSrc},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MessageHandler=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4);function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var l=1,u=2,c=1,d=2,h=3,p=4,m=5,v=6,g=7,y=8;function wrapReason(t){if("object"!==_typeof(t)||null===t)return t;switch(t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}var b=function(){function MessageHandler(t,r,a){var o=this;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MessageHandler);this.sourceName=t;this.targetName=r;this.comObj=a;this.callbackId=1;this.streamId=1;this.postMessageTransfers=!0;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=function(t){var r=t.data;if(r.targetName===o.sourceName)if(r.stream)o._processStreamMessage(r);else if(r.callback){var i=r.callbackId,c=o.callbackCapabilities[i];if(!c)throw new Error("Cannot resolve callback ".concat(i));delete o.callbackCapabilities[i];if(r.callback===l)c.resolve(r.data);else{if(r.callback!==u)throw new Error("Unexpected callback case");c.reject(wrapReason(r.reason))}}else{var d=o.actionHandler[r.action];if(!d)throw new Error("Unknown action from worker: ".concat(r.action));if(r.callbackId){var h=o.sourceName,p=r.sourceName;new Promise((function(t){t(d(r.data))})).then((function(t){a.postMessage({sourceName:h,targetName:p,callback:l,callbackId:r.callbackId,data:t})}),(function(t){a.postMessage({sourceName:h,targetName:p,callback:u,callbackId:r.callbackId,reason:wrapReason(t)})}))}else r.streamId?o._createStreamSink(r):d(r.data)}};a.addEventListener("message",this._onComObjOnMessage)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(MessageHandler,[{key:"on",value:function on(t,r){var a=this.actionHandler;if(a[t])throw new Error('There is already an actionName called "'.concat(t,'"'));a[t]=r}},{key:"send",value:function send(t,r,a){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},a)}},{key:"sendWithPromise",value:function sendWithPromise(t,r,a){var o=this.callbackId++,l=(0,i.createPromiseCapability)();this.callbackCapabilities[o]=l;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:o,data:r},a)}catch(t){l.reject(t)}return l.promise}},{key:"sendWithStream",value:function sendWithStream(t,r,a,o){var l=this,u=this.streamId++,d=this.sourceName,h=this.targetName,p=this.comObj;return new ReadableStream({start:function start(a){var c=(0,i.createPromiseCapability)();l.streamControllers[u]={controller:a,startCall:c,pullCall:null,cancelCall:null,isClosed:!1};l._postMessage({sourceName:d,targetName:h,action:t,streamId:u,data:r,desiredSize:a.desiredSize},o);return c.promise},pull:function pull(t){var r=(0,i.createPromiseCapability)();l.streamControllers[u].pullCall=r;p.postMessage({sourceName:d,targetName:h,stream:v,streamId:u,desiredSize:t.desiredSize});return r.promise},cancel:function cancel(t){(0,i.assert)(t instanceof Error,"cancel must have a valid reason");var r=(0,i.createPromiseCapability)();l.streamControllers[u].cancelCall=r;l.streamControllers[u].isClosed=!0;p.postMessage({sourceName:d,targetName:h,stream:c,streamId:u,reason:wrapReason(t)});return r.promise}},a)}},{key:"_createStreamSink",value:function _createStreamSink(t){var r=this,a=this.actionHandler[t.action],o=t.streamId,l=this.sourceName,u=t.sourceName,c=this.comObj,d={enqueue:function enqueue(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,c=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var d=this.desiredSize;this.desiredSize-=a;if(d>0&&this.desiredSize<=0){this.sinkCapability=(0,i.createPromiseCapability)();this.ready=this.sinkCapability.promise}r._postMessage({sourceName:l,targetName:u,stream:p,streamId:o,chunk:t},c)}},close:function close(){if(!this.isCancelled){this.isCancelled=!0;c.postMessage({sourceName:l,targetName:u,stream:h,streamId:o});delete r.streamSinks[o]}},error:function error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;c.postMessage({sourceName:l,targetName:u,stream:m,streamId:o,reason:wrapReason(t)})}},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[o]=d;new Promise((function(r){r(a(t.data,d))})).then((function(){c.postMessage({sourceName:l,targetName:u,stream:y,streamId:o,success:!0})}),(function(t){c.postMessage({sourceName:l,targetName:u,stream:y,streamId:o,reason:wrapReason(t)})}))}},{key:"_processStreamMessage",value:function _processStreamMessage(t){var r=t.streamId,a=this.sourceName,o=t.sourceName,l=this.comObj;switch(t.stream){case y:t.success?this.streamControllers[r].startCall.resolve():this.streamControllers[r].startCall.reject(wrapReason(t.reason));break;case g:t.success?this.streamControllers[r].pullCall.resolve():this.streamControllers[r].pullCall.reject(wrapReason(t.reason));break;case v:if(!this.streamSinks[r]){l.postMessage({sourceName:a,targetName:o,stream:g,streamId:r,success:!0});break}this.streamSinks[r].desiredSize<=0&&t.desiredSize>0&&this.streamSinks[r].sinkCapability.resolve();this.streamSinks[r].desiredSize=t.desiredSize;var u=this.streamSinks[t.streamId].onPull;new Promise((function(t){t(u&&u())})).then((function(){l.postMessage({sourceName:a,targetName:o,stream:g,streamId:r,success:!0})}),(function(t){l.postMessage({sourceName:a,targetName:o,stream:g,streamId:r,reason:wrapReason(t)})}));break;case p:(0,i.assert)(this.streamControllers[r],"enqueue should have stream controller");if(this.streamControllers[r].isClosed)break;this.streamControllers[r].controller.enqueue(t.chunk);break;case h:(0,i.assert)(this.streamControllers[r],"close should have stream controller");if(this.streamControllers[r].isClosed)break;this.streamControllers[r].isClosed=!0;this.streamControllers[r].controller.close();this._deleteStreamController(r);break;case m:(0,i.assert)(this.streamControllers[r],"error should have stream controller");this.streamControllers[r].controller.error(wrapReason(t.reason));this._deleteStreamController(r);break;case d:t.success?this.streamControllers[r].cancelCall.resolve():this.streamControllers[r].cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(r);break;case c:if(!this.streamSinks[r])break;var b=this.streamSinks[t.streamId].onCancel;new Promise((function(r){r(b&&b(wrapReason(t.reason)))})).then((function(){l.postMessage({sourceName:a,targetName:o,stream:d,streamId:r,success:!0})}),(function(t){l.postMessage({sourceName:a,targetName:o,stream:d,streamId:r,reason:wrapReason(t)})}));this.streamSinks[r].sinkCapability.reject(wrapReason(t.reason));this.streamSinks[r].isCancelled=!0;delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:(t=function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}(o.default.mark((function _callee(t){return o.default.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:r.next=2;return Promise.allSettled([this.streamControllers[t].startCall,this.streamControllers[t].pullCall,this.streamControllers[t].cancelCall].map((function(t){return t&&t.promise})));case 2:delete this.streamControllers[t];case 3:case"end":return r.stop()}}),_callee,this)}))),function _deleteStreamController(r){return t.apply(this,arguments)})},{key:"_postMessage",value:function _postMessage(t,r){r&&this.postMessageTransfers?this.comObj.postMessage(t,r):this.comObj.postMessage(t)}},{key:"destroy",value:function destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]);var t;return MessageHandler}();r.MessageHandler=b},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Metadata=void 0;var o=a(4),i=a(145);function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var l=function(){function Metadata(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Metadata);(0,o.assert)("string"==typeof t,"Metadata: input is not a string");t=this._repair(t);var r=new i.SimpleXMLParser({lowerCaseName:!0}).parseFromString(t);this._metadataMap=new Map;r&&this._parse(r);this._data=t}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(Metadata,[{key:"_repair",value:function _repair(t){return t.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(t,r){for(var a=r.replace(/\\([0-3])([0-7])([0-7])/g,(function(t,r,a,o){return String.fromCharCode(64*r+8*a+1*o)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(t,r){switch(r){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(r," isn't defined."))})),o="",i=0,l=a.length;i<l;i+=2){var u=256*a.charCodeAt(i)+a.charCodeAt(i+1);o+=u>=32&&u<127&&60!==u&&62!==u&&38!==u?String.fromCharCode(u):"&#x"+(65536+u).toString(16).substring(1)+";"}return">"+o}))}},{key:"_getSequence",value:function _getSequence(t){var r=t.nodeName;return"rdf:bag"!==r&&"rdf:seq"!==r&&"rdf:alt"!==r?null:t.childNodes.filter((function(t){return"rdf:li"===t.nodeName}))}},{key:"_getCreators",value:function _getCreators(t){if("dc:creator"!==t.nodeName)return!1;if(!t.hasChildNodes())return!0;var r=t.childNodes[0],a=this._getSequence(r)||[];this._metadataMap.set(t.nodeName,a.map((function(t){return t.textContent.trim()})));return!0}},{key:"_parse",value:function _parse(t){var r=t.documentElement;if("rdf:rdf"!==r.nodeName){r=r.firstChild;for(;r&&"rdf:rdf"!==r.nodeName;)r=r.nextSibling}if(r&&"rdf:rdf"===r.nodeName&&r.hasChildNodes()){var a,o=_createForOfIteratorHelper(r.childNodes);try{for(o.s();!(a=o.n()).done;){var i=a.value;if("rdf:description"===i.nodeName){var l,u=_createForOfIteratorHelper(i.childNodes);try{for(u.s();!(l=u.n()).done;){var c=l.value,d=c.nodeName;"#text"!==d&&(this._getCreators(c)||this._metadataMap.set(d,c.textContent.trim()))}}catch(t){u.e(t)}finally{u.f()}}}}catch(t){o.e(t)}finally{o.f()}}}},{key:"getRaw",value:function getRaw(){return this._data}},{key:"get",value:function get(t){var r;return null!==(r=this._metadataMap.get(t))&&void 0!==r?r:null}},{key:"getAll",value:function getAll(){return(0,o.objectFromEntries)(this._metadataMap)}},{key:"has",value:function has(t){return this._metadataMap.has(t)}}]);return Metadata}();r.Metadata=l},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.SimpleXMLParser=r.SimpleDOMNode=void 0;var o=a(4);function _get(t,r,a){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,a){var o=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}(t,r);if(o){var i=Object.getOwnPropertyDescriptor(o,r);return i.get?i.get.call(a):i.value}})(t,r,a||t)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var i=0,l=-2,u=-3,c=-4,d=-5,h=-6,p=-9;function isWhitespace(t,r){var a=t[r];return" "===a||"\n"===a||"\r"===a||"\t"===a}var m=function(){function XMLParserBase(){_classCallCheck(this,XMLParserBase)}_createClass(XMLParserBase,[{key:"_resolveEntities",value:function _resolveEntities(t){var r=this;return t.replace(/&([^;]+);/g,(function(t,a){if("#x"===a.substring(0,2))return String.fromCodePoint(parseInt(a.substring(2),16));if("#"===a.substring(0,1))return String.fromCodePoint(parseInt(a.substring(1),10));switch(a){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return r.onResolveEntity(a)}))}},{key:"_parseContent",value:function _parseContent(t,r){var a=[],o=r;function skipWs(){for(;o<t.length&&isWhitespace(t,o);)++o}for(;o<t.length&&!isWhitespace(t,o)&&">"!==t[o]&&"/"!==t[o];)++o;var i=t.substring(r,o);skipWs();for(;o<t.length&&">"!==t[o]&&"/"!==t[o]&&"?"!==t[o];){skipWs();for(var l,u="";o<t.length&&!isWhitespace(t,o)&&"="!==t[o];){u+=t[o];++o}skipWs();if("="!==t[o])return null;++o;skipWs();var c=t[o];if('"'!==c&&"'"!==c)return null;var d=t.indexOf(c,++o);if(d<0)return null;l=t.substring(o,d);a.push({name:u,value:this._resolveEntities(l)});o=d+1;skipWs()}return{name:i,attributes:a,parsed:o-r}}},{key:"_parseProcessingInstruction",value:function _parseProcessingInstruction(t,r){var a=r;for(;a<t.length&&!isWhitespace(t,a)&&">"!==t[a]&&"/"!==t[a];)++a;var o=t.substring(r,a);!function skipWs(){for(;a<t.length&&isWhitespace(t,a);)++a}();for(var i=a;a<t.length&&("?"!==t[a]||">"!==t[a+1]);)++a;return{name:o,value:t.substring(i,a),parsed:a-r}}},{key:"parseXml",value:function parseXml(t){for(var r=0;r<t.length;){var a=r;if("<"===t[r]){var o=void 0;switch(t[++a]){case"/":++a;if((o=t.indexOf(">",a))<0){this.onError(p);return}this.onEndElement(t.substring(a,o));a=o+1;break;case"?":++a;var i=this._parseProcessingInstruction(t,a);if("?>"!==t.substring(a+i.parsed,a+i.parsed+2)){this.onError(u);return}this.onPi(i.name,i.value);a+=i.parsed+2;break;case"!":if("--"===t.substring(a+1,a+3)){if((o=t.indexOf("--\x3e",a+3))<0){this.onError(d);return}this.onComment(t.substring(a+3,o));a=o+3}else if("[CDATA["===t.substring(a+1,a+8)){if((o=t.indexOf("]]>",a+8))<0){this.onError(l);return}this.onCdata(t.substring(a+8,o));a=o+3}else{if("DOCTYPE"!==t.substring(a+1,a+8)){this.onError(h);return}var m=t.indexOf("[",a+8),v=!1;if((o=t.indexOf(">",a+8))<0){this.onError(c);return}if(m>0&&o>m){if((o=t.indexOf("]>",a+8))<0){this.onError(c);return}v=!0}var g=t.substring(a+8,o+(v?1:0));this.onDoctype(g);a=o+(v?2:1)}break;default:var y=this._parseContent(t,a);if(null===y){this.onError(h);return}var b=!1;if("/>"===t.substring(a+y.parsed,a+y.parsed+2))b=!0;else if(">"!==t.substring(a+y.parsed,a+y.parsed+1)){this.onError(p);return}this.onBeginElement(y.name,y.attributes,b);a+=y.parsed+(b?2:1)}}else{for(;a<t.length&&"<"!==t[a];)a++;var _=t.substring(r,a);this.onText(this._resolveEntities(_))}r=a}}},{key:"onResolveEntity",value:function onResolveEntity(t){return"&".concat(t,";")}},{key:"onPi",value:function onPi(t,r){}},{key:"onComment",value:function onComment(t){}},{key:"onCdata",value:function onCdata(t){}},{key:"onDoctype",value:function onDoctype(t){}},{key:"onText",value:function onText(t){}},{key:"onBeginElement",value:function onBeginElement(t,r,a){}},{key:"onEndElement",value:function onEndElement(t){}},{key:"onError",value:function onError(t){}}]);return XMLParserBase}(),v=function(){function SimpleDOMNode(t,r){_classCallCheck(this,SimpleDOMNode);this.nodeName=t;this.nodeValue=r;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}_createClass(SimpleDOMNode,[{key:"hasChildNodes",value:function hasChildNodes(){return this.childNodes&&this.childNodes.length>0}},{key:"searchNode",value:function searchNode(t,r){if(r>=t.length)return this;for(var a=t[r],o=[],i=this;;){if(a.name===i.nodeName){if(0!==a.pos){if(0===o.length)return null;var l,u=0,c=_createForOfIteratorHelper(_slicedToArray(o.pop(),1)[0].childNodes);try{for(c.s();!(l=c.n()).done;){var d=l.value;if(a.name===d.nodeName){if(u===a.pos)return d.searchNode(t,r+1);u++}}}catch(t){c.e(t)}finally{c.f()}return i.searchNode(t,r+1)}var h=i.searchNode(t,r+1);if(null!==h)return h}if(i.childNodes&&0!==i.childNodes.length){o.push([i,0]);i=i.childNodes[0]}else{if(0===o.length)return null;for(;0!==o.length;){var p=_slicedToArray(o.pop(),2),m=p[0],v=p[1]+1;if(v<m.childNodes.length){o.push([m,v]);i=m.childNodes[v];break}}if(0===o.length)return null}}}},{key:"dump",value:function dump(t){if("#text"!==this.nodeName){t.push("<".concat(this.nodeName));if(this.attributes){var r,a=_createForOfIteratorHelper(this.attributes);try{for(a.s();!(r=a.n()).done;){var i=r.value;t.push(" ".concat(i.name,'="').concat((0,o.encodeToXmlString)(i.value),'"'))}}catch(t){a.e(t)}finally{a.f()}}if(this.hasChildNodes()){t.push(">");var l,u=_createForOfIteratorHelper(this.childNodes);try{for(u.s();!(l=u.n()).done;){l.value.dump(t)}}catch(t){u.e(t)}finally{u.f()}t.push("</".concat(this.nodeName,">"))}else this.nodeValue?t.push(">".concat((0,o.encodeToXmlString)(this.nodeValue),"</").concat(this.nodeName,">")):t.push("/>")}else t.push((0,o.encodeToXmlString)(this.nodeValue))}},{key:"firstChild",get:function get(){return this.childNodes&&this.childNodes[0]}},{key:"nextSibling",get:function get(){var t=this.parentNode.childNodes;if(t){var r=t.indexOf(this);if(-1!==r)return t[r+1]}}},{key:"textContent",get:function get(){return this.childNodes?this.childNodes.map((function(t){return t.textContent})).join(""):this.nodeValue||""}}]);return SimpleDOMNode}();r.SimpleDOMNode=v;var g=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}(SimpleXMLParser,t);var r=_createSuper(SimpleXMLParser);function SimpleXMLParser(t){var a,o=t.hasAttributes,l=void 0!==o&&o,u=t.lowerCaseName,c=void 0!==u&&u;_classCallCheck(this,SimpleXMLParser);(a=r.call(this))._currentFragment=null;a._stack=null;a._errorCode=i;a._hasAttributes=l;a._lowerCaseName=c;return a}_createClass(SimpleXMLParser,[{key:"parseFromString",value:function parseFromString(t){this._currentFragment=[];this._stack=[];this._errorCode=i;this.parseXml(t);if(this._errorCode===i){var r=_slicedToArray(this._currentFragment,1)[0];if(r)return{documentElement:r}}}},{key:"onResolveEntity",value:function onResolveEntity(t){switch(t){case"apos":return"'"}return _get(_getPrototypeOf(SimpleXMLParser.prototype),"onResolveEntity",this).call(this,t)}},{key:"onText",value:function onText(t){if(!function isWhitespaceString(t){for(var r=0,a=t.length;r<a;r++)if(!isWhitespace(t,r))return!1;return!0}(t)){var r=new v("#text",t);this._currentFragment.push(r)}}},{key:"onCdata",value:function onCdata(t){var r=new v("#text",t);this._currentFragment.push(r)}},{key:"onBeginElement",value:function onBeginElement(t,r,a){this._lowerCaseName&&(t=t.toLowerCase());var o=new v(t);o.childNodes=[];this._hasAttributes&&(o.attributes=r);this._currentFragment.push(o);if(!a){this._stack.push(this._currentFragment);this._currentFragment=o.childNodes}}},{key:"onEndElement",value:function onEndElement(t){this._currentFragment=this._stack.pop()||[];var r=this._currentFragment[this._currentFragment.length-1];if(r)for(var a=0,o=r.childNodes.length;a<o;a++)r.childNodes[a].parentNode=r}},{key:"onError",value:function onError(t){this._errorCode=t}}]);return SimpleXMLParser}(m);r.SimpleXMLParser=g},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OptionalContentConfig=void 0;var o=a(4);function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var i=function OptionalContentGroup(t,r){_classCallCheck(this,OptionalContentGroup);this.visible=!0;this.name=t;this.intent=r},l=function(){function OptionalContentConfig(t){_classCallCheck(this,OptionalContentConfig);this.name=null;this.creator=null;this._order=null;this._groups=new Map;if(null!==t){this.name=t.name;this.creator=t.creator;this._order=t.order;var r,a=_createForOfIteratorHelper(t.groups);try{for(a.s();!(r=a.n()).done;){var o=r.value;this._groups.set(o.id,new i(o.name,o.intent))}}catch(t){a.e(t)}finally{a.f()}if("OFF"===t.baseState){var l,u=_createForOfIteratorHelper(this._groups);try{for(u.s();!(l=u.n()).done;){l.value.visible=!1}}catch(t){u.e(t)}finally{u.f()}}var c,d=_createForOfIteratorHelper(t.on);try{for(d.s();!(c=d.n()).done;){var h=c.value;this._groups.get(h).visible=!0}}catch(t){d.e(t)}finally{d.f()}var p,m=_createForOfIteratorHelper(t.off);try{for(m.s();!(p=m.n()).done;){var v=p.value;this._groups.get(v).visible=!1}}catch(t){m.e(t)}finally{m.f()}}}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(OptionalContentConfig,[{key:"isVisible",value:function isVisible(t){if("OCG"===t.type){if(!this._groups.has(t.id)){(0,o.warn)("Optional content group not found: ".concat(t.id));return!0}return this._groups.get(t.id).visible}if("OCMD"===t.type){t.expression&&(0,o.warn)("Visibility expression not supported yet.");if(!t.policy||"AnyOn"===t.policy){var r,a=_createForOfIteratorHelper(t.ids);try{for(a.s();!(r=a.n()).done;){var i=r.value;if(!this._groups.has(i)){(0,o.warn)("Optional content group not found: ".concat(i));return!0}if(this._groups.get(i).visible)return!0}}catch(t){a.e(t)}finally{a.f()}return!1}if("AllOn"===t.policy){var l,u=_createForOfIteratorHelper(t.ids);try{for(u.s();!(l=u.n()).done;){var c=l.value;if(!this._groups.has(c)){(0,o.warn)("Optional content group not found: ".concat(c));return!0}if(!this._groups.get(c).visible)return!1}}catch(t){u.e(t)}finally{u.f()}return!0}if("AnyOff"===t.policy){var d,h=_createForOfIteratorHelper(t.ids);try{for(h.s();!(d=h.n()).done;){var p=d.value;if(!this._groups.has(p)){(0,o.warn)("Optional content group not found: ".concat(p));return!0}if(!this._groups.get(p).visible)return!0}}catch(t){h.e(t)}finally{h.f()}return!1}if("AllOff"===t.policy){var m,v=_createForOfIteratorHelper(t.ids);try{for(v.s();!(m=v.n()).done;){var g=m.value;if(!this._groups.has(g)){(0,o.warn)("Optional content group not found: ".concat(g));return!0}if(this._groups.get(g).visible)return!1}}catch(t){v.e(t)}finally{v.f()}return!0}(0,o.warn)("Unknown optional content policy ".concat(t.policy,"."));return!0}(0,o.warn)("Unknown group type ".concat(t.type,"."));return!0}},{key:"setVisibility",value:function setVisibility(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._groups.has(t)?this._groups.get(t).visible=!!r:(0,o.warn)("Optional content group not found: ".concat(t))}},{key:"getOrder",value:function getOrder(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}},{key:"getGroups",value:function getGroups(){return this._groups.size?(0,o.objectFromEntries)(this._groups):null}},{key:"getGroup",value:function getGroup(t){return this._groups.get(t)||null}}]);return OptionalContentConfig}();r.OptionalContentConfig=l},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFDataTransportStream=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4);function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var l=function(){function PDFDataTransportStream(t,r){var a=this;_classCallCheck(this,PDFDataTransportStream);(0,i.assert)(r,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=t.progressiveDone||!1;var o=t.initialData;if((null==o?void 0:o.length)>0){var l=new Uint8Array(o).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=r;this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._contentLength=t.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener((function(t,r){a._onReceiveData({begin:t,chunk:r})}));this._pdfDataRangeTransport.addProgressListener((function(t,r){a._onProgress({loaded:t,total:r})}));this._pdfDataRangeTransport.addProgressiveReadListener((function(t){a._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((function(){a._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_createClass(PDFDataTransportStream,[{key:"_onReceiveData",value:function _onReceiveData(t){var r=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{var a=this._rangeReaders.some((function(a){if(a._begin!==t.begin)return!1;a._enqueue(r);return!0}));(0,i.assert)(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_onProgress",value:function _onProgress(t){if(void 0===t.total){var r=this._rangeReaders[0];null!=r&&r.onProgress&&r.onProgress({loaded:t.loaded})}else{var a=this._fullRequestReader;null!=a&&a.onProgress&&a.onProgress({loaded:t.loaded,total:t.total})}}},{key:"_onProgressiveDone",value:function _onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone();this._progressiveDone=!0}},{key:"_removeRangeReader",value:function _removeRangeReader(t){var r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;this._queuedChunks=null;return new u(this,t,this._progressiveDone)}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new c(this,t,r);this._pdfDataRangeTransport.requestDataRange(t,r);this._rangeReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);this._rangeReaders.slice(0).forEach((function(r){r.cancel(t)}));this._pdfDataRangeTransport.abort()}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}}]);return PDFDataTransportStream}();r.PDFDataTransportStream=l;var u=function(){function PDFDataTransportStreamReader(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,PDFDataTransportStreamReader);this._stream=t;this._done=a||!1;this._filename=null;this._queuedChunks=r||[];this._loaded=0;var o,i=_createForOfIteratorHelper(this._queuedChunks);try{for(i.s();!(o=i.n()).done;){var l=o.value;this._loaded+=l.byteLength}}catch(t){i.e(t)}finally{i.f()}this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_createClass(PDFDataTransportStreamReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}},{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee(){var t,r;return o.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!(this._queuedChunks.length>0)){a.next=3;break}t=this._queuedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 3:if(!this._done){a.next=5;break}return a.abrupt("return",{value:void 0,done:!0});case 5:r=(0,i.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 8:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[]}},{key:"progressiveDone",value:function progressiveDone(){this._done||(this._done=!0)}},{key:"headersReady",get:function get(){return this._headersReady}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function get(){return this._stream._contentLength}}]);var t;return PDFDataTransportStreamReader}(),c=function(){function PDFDataTransportStreamRangeReader(t,r,a){_classCallCheck(this,PDFDataTransportStreamRangeReader);this._stream=t;this._begin=r;this._end=a;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_createClass(PDFDataTransportStreamRangeReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[]}this._done=!0;this._stream._removeRangeReader(this)}}},{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee2(){var t,r;return o.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._queuedChunk){a.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 4:if(!this._done){a.next=6;break}return a.abrupt("return",{value:void 0,done:!0});case 6:r=(0,i.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 9:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[];this._stream._removeRangeReader(this)}},{key:"isStreamingSupported",get:function get(){return!1}}]);var t;return PDFDataTransportStreamRangeReader}()},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.WebGLContext=void 0;var o=a(4);function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}var i=function(){function WebGLContext(t){var r=t.enable,a=void 0!==r&&r;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,WebGLContext);this._enabled=!0===a}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(WebGLContext,[{key:"composeSMask",value:function composeSMask(t){var r=t.layer,a=t.mask,o=t.properties;return l.composeSMask(r,a,o)}},{key:"drawFigures",value:function drawFigures(t){var r=t.width,a=t.height,o=t.backgroundColor,i=t.figures,u=t.context;return l.drawFigures(r,a,o,i,u)}},{key:"clear",value:function clear(){l.cleanup()}},{key:"isEnabled",get:function get(){var t=this._enabled;t&&(t=l.tryInitGL());return(0,o.shadow)(this,"isEnabled",t)}}]);return WebGLContext}();r.WebGLContext=i;var l=function WebGLUtilsClosure(){function loadShader(t,r,a){var o=t.createShader(a);t.shaderSource(o,r);t.compileShader(o);if(!t.getShaderParameter(o,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(o);throw new Error("Error during shader compilation: "+i)}return o}function createVertexShader(t,r){return loadShader(t,r,t.VERTEX_SHADER)}function createFragmentShader(t,r){return loadShader(t,r,t.FRAGMENT_SHADER)}function createProgram(t,r){for(var a=t.createProgram(),o=0,i=r.length;o<i;++o)t.attachShader(a,r[o]);t.linkProgram(a);if(!t.getProgramParameter(a,t.LINK_STATUS)){var l=t.getProgramInfoLog(a);throw new Error("Error during program linking: "+l)}return a}function createTexture(t,r,a){t.activeTexture(a);var o=t.createTexture();t.bindTexture(t.TEXTURE_2D,o);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r);return o}var t,r;function generateGL(){if(!t){r=document.createElement("canvas");t=r.getContext("webgl",{premultipliedalpha:!1})}}var a=null;var o=null;return{tryInitGL:function tryInitGL(){try{generateGL();return!!t}catch(t){}return!1},composeSMask:function composeSMask(o,i,l){var u=o.width,c=o.height;a||function initSmaskGL(){generateGL();var o=r;r=null;var i=t;t=null;var l=createProgram(i,[createVertexShader(i," attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } "),createFragmentShader(i," precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ")]);i.useProgram(l);var u={};u.gl=i;u.canvas=o;u.resolutionLocation=i.getUniformLocation(l,"u_resolution");u.positionLocation=i.getAttribLocation(l,"a_position");u.backdropLocation=i.getUniformLocation(l,"u_backdrop");u.subtypeLocation=i.getUniformLocation(l,"u_subtype");var c=i.getAttribLocation(l,"a_texCoord"),d=i.getUniformLocation(l,"u_image"),h=i.getUniformLocation(l,"u_mask"),p=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,p);i.bufferData(i.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),i.STATIC_DRAW);i.enableVertexAttribArray(c);i.vertexAttribPointer(c,2,i.FLOAT,!1,0,0);i.uniform1i(d,0);i.uniform1i(h,1);a=u}();var d=a,h=d.canvas,p=d.gl;h.width=u;h.height=c;p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight);p.uniform2f(d.resolutionLocation,u,c);l.backdrop?p.uniform4f(d.resolutionLocation,l.backdrop[0],l.backdrop[1],l.backdrop[2],1):p.uniform4f(d.resolutionLocation,0,0,0,0);p.uniform1i(d.subtypeLocation,"Luminosity"===l.subtype?1:0);var m=createTexture(p,o,p.TEXTURE0),v=createTexture(p,i,p.TEXTURE1),g=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,g);p.bufferData(p.ARRAY_BUFFER,new Float32Array([0,0,u,0,0,c,0,c,u,0,u,c]),p.STATIC_DRAW);p.enableVertexAttribArray(d.positionLocation);p.vertexAttribPointer(d.positionLocation,2,p.FLOAT,!1,0,0);p.clearColor(0,0,0,0);p.enable(p.BLEND);p.blendFunc(p.ONE,p.ONE_MINUS_SRC_ALPHA);p.clear(p.COLOR_BUFFER_BIT);p.drawArrays(p.TRIANGLES,0,6);p.flush();p.deleteTexture(m);p.deleteTexture(v);p.deleteBuffer(g);return h},drawFigures:function drawFigures(a,i,l,u,c){o||function initFiguresGL(){generateGL();var a=r;r=null;var i=t;t=null;var l=createProgram(i,[createVertexShader(i," attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } "),createFragmentShader(i," precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ")]);i.useProgram(l);var u={};u.gl=i;u.canvas=a;u.resolutionLocation=i.getUniformLocation(l,"u_resolution");u.scaleLocation=i.getUniformLocation(l,"u_scale");u.offsetLocation=i.getUniformLocation(l,"u_offset");u.positionLocation=i.getAttribLocation(l,"a_position");u.colorLocation=i.getAttribLocation(l,"a_color");o=u}();var d=o,h=d.canvas,p=d.gl;h.width=a;h.height=i;p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight);p.uniform2f(d.resolutionLocation,a,i);for(var m=0,v=0,g=u.length;v<g;v++)switch(u[v].type){case"lattice":m+=((u[v].coords.length/u[v].verticesPerRow|0)-1)*(u[v].verticesPerRow-1)*6;break;case"triangles":m+=u[v].coords.length}for(var y=new Float32Array(2*m),b=new Uint8Array(3*m),_=c.coords,S=c.colors,C=0,A=0,R=0,k=u.length;R<k;R++){var P=u[R],w=P.coords,x=P.colors;switch(P.type){case"lattice":for(var T=P.verticesPerRow,E=w.length/T|0,O=1;O<E;O++)for(var I=O*T+1,D=1;D<T;D++,I++){y[C]=_[w[I-T-1]];y[C+1]=_[w[I-T-1]+1];y[C+2]=_[w[I-T]];y[C+3]=_[w[I-T]+1];y[C+4]=_[w[I-1]];y[C+5]=_[w[I-1]+1];b[A]=S[x[I-T-1]];b[A+1]=S[x[I-T-1]+1];b[A+2]=S[x[I-T-1]+2];b[A+3]=S[x[I-T]];b[A+4]=S[x[I-T]+1];b[A+5]=S[x[I-T]+2];b[A+6]=S[x[I-1]];b[A+7]=S[x[I-1]+1];b[A+8]=S[x[I-1]+2];y[C+6]=y[C+2];y[C+7]=y[C+3];y[C+8]=y[C+4];y[C+9]=y[C+5];y[C+10]=_[w[I]];y[C+11]=_[w[I]+1];b[A+9]=b[A+3];b[A+10]=b[A+4];b[A+11]=b[A+5];b[A+12]=b[A+6];b[A+13]=b[A+7];b[A+14]=b[A+8];b[A+15]=S[x[I]];b[A+16]=S[x[I]+1];b[A+17]=S[x[I]+2];C+=12;A+=18}break;case"triangles":for(var L=0,M=w.length;L<M;L++){y[C]=_[w[L]];y[C+1]=_[w[L]+1];b[A]=S[x[L]];b[A+1]=S[x[L]+1];b[A+2]=S[x[L]+2];C+=2;A+=3}}}l?p.clearColor(l[0]/255,l[1]/255,l[2]/255,1):p.clearColor(0,0,0,0);p.clear(p.COLOR_BUFFER_BIT);var W=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,W);p.bufferData(p.ARRAY_BUFFER,y,p.STATIC_DRAW);p.enableVertexAttribArray(d.positionLocation);p.vertexAttribPointer(d.positionLocation,2,p.FLOAT,!1,0,0);var j=p.createBuffer();p.bindBuffer(p.ARRAY_BUFFER,j);p.bufferData(p.ARRAY_BUFFER,b,p.STATIC_DRAW);p.enableVertexAttribArray(d.colorLocation);p.vertexAttribPointer(d.colorLocation,3,p.UNSIGNED_BYTE,!1,0,0);p.uniform2f(d.scaleLocation,c.scaleX,c.scaleY);p.uniform2f(d.offsetLocation,c.offsetX,c.offsetY);p.drawArrays(p.TRIANGLES,0,m);p.flush();p.deleteBuffer(W);p.deleteBuffer(j);return h},cleanup:function cleanup(){var t,r;if(null!==(t=a)&&void 0!==t&&t.canvas){a.canvas.width=0;a.canvas.height=0}if(null!==(r=o)&&void 0!==r&&r.canvas){o.canvas.width=0;o.canvas.height=0}a=null;o=null}}}()},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.AnnotationLayer=void 0;var o=a(1),i=a(4),l=a(138),u=a(150);function _get(t,r,a){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,a){var o=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}(t,r);if(o){var i=Object.getOwnPropertyDescriptor(o,r);return i.get?i.get.call(a):i.value}})(t,r,a||t)}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?_assertThisInitialized(t):r}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var c=function(){function AnnotationElementFactory(){_classCallCheck(this,AnnotationElementFactory)}_createClass(AnnotationElementFactory,null,[{key:"create",value:function create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new h(t);case i.AnnotationType.TEXT:return new p(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new v(t);case"Btn":return t.data.radioButton?new y(t):t.data.checkBox?new g(t):new b(t);case"Ch":return new _(t)}return new m(t);case i.AnnotationType.POPUP:return new S(t);case i.AnnotationType.FREETEXT:return new A(t);case i.AnnotationType.LINE:return new R(t);case i.AnnotationType.SQUARE:return new k(t);case i.AnnotationType.CIRCLE:return new P(t);case i.AnnotationType.POLYLINE:return new w(t);case i.AnnotationType.CARET:return new T(t);case i.AnnotationType.INK:return new E(t);case i.AnnotationType.POLYGON:return new x(t);case i.AnnotationType.HIGHLIGHT:return new O(t);case i.AnnotationType.UNDERLINE:return new I(t);case i.AnnotationType.SQUIGGLY:return new D(t);case i.AnnotationType.STRIKEOUT:return new L(t);case i.AnnotationType.STAMP:return new M(t);case i.AnnotationType.FILEATTACHMENT:return new W(t);default:return new d(t)}}}]);return AnnotationElementFactory}(),d=function(){function AnnotationElement(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.isRenderable,o=void 0!==a&&a,i=r.ignoreBorder,l=void 0!==i&&i,u=r.createQuadrilaterals,c=void 0!==u&&u;_classCallCheck(this,AnnotationElement);this.isRenderable=o;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderInteractiveForms=t.renderInteractiveForms;this.svgFactory=t.svgFactory;this.annotationStorage=t.annotationStorage;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._mouseState=t.mouseState;o&&(this.container=this._createContainer(l));c&&(this.quadrilaterals=this._createQuadrilaterals(l))}_createClass(AnnotationElement,[{key:"_createContainer",value:function _createContainer(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.data,a=this.page,o=this.viewport,l=document.createElement("section"),u=r.rect[2]-r.rect[0],c=r.rect[3]-r.rect[1];l.setAttribute("data-annotation-id",r.id);var d=i.Util.normalizeRect([r.rect[0],a.view[3]-r.rect[1]+a.view[1],r.rect[2],a.view[3]-r.rect[3]+a.view[1]]);l.style.transform="matrix(".concat(o.transform.join(","),")");l.style.transformOrigin="".concat(-d[0],"px ").concat(-d[1],"px");if(!t&&r.borderStyle.width>0){l.style.borderWidth="".concat(r.borderStyle.width,"px");if(r.borderStyle.style!==i.AnnotationBorderStyleType.UNDERLINE){u-=2*r.borderStyle.width;c-=2*r.borderStyle.width}var h=r.borderStyle.horizontalCornerRadius,p=r.borderStyle.verticalCornerRadius;if(h>0||p>0){var m="".concat(h,"px / ").concat(p,"px");l.style.borderRadius=m}switch(r.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:l.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:l.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:l.style.borderBottomStyle="solid"}r.color?l.style.borderColor=i.Util.makeHexColor(0|r.color[0],0|r.color[1],0|r.color[2]):l.style.borderWidth=0}l.style.left="".concat(d[0],"px");l.style.top="".concat(d[1],"px");l.style.width="".concat(u,"px");l.style.height="".concat(c,"px");return l}},{key:"_createQuadrilaterals",value:function _createQuadrilaterals(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;var r,a=[],o=this.data.rect,i=_createForOfIteratorHelper(this.data.quadPoints);try{for(i.s();!(r=i.n()).done;){var l=r.value;this.data.rect=[l[2].x,l[2].y,l[1].x,l[1].y];a.push(this._createContainer(t))}}catch(t){i.e(t)}finally{i.f()}this.data.rect=o;return a}},{key:"_createPopup",value:function _createPopup(t,r){var a=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;a=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).style.height=a.style.height;t.style.width=a.style.width;a.appendChild(t)}var o=new C({container:a,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}).render();o.style.left=a.style.width;a.appendChild(o)}},{key:"_renderQuadrilaterals",value:function _renderQuadrilaterals(t){this.quadrilaterals.forEach((function(r){r.className=t}));return this.quadrilaterals}},{key:"render",value:function render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}}]);return AnnotationElement}(),h=function(t){_inherits(LinkAnnotationElement,t);var r=_createSuper(LinkAnnotationElement);function LinkAnnotationElement(t){_classCallCheck(this,LinkAnnotationElement);var a=!!(t.data.url||t.data.dest||t.data.action||t.data.isTooltipOnly||t.data.actions&&(t.data.actions.Action||t.data.actions["Mouse Up"]||t.data.actions["Mouse Down"]));return r.call(this,t,{isRenderable:a,createQuadrilaterals:!0})}_createClass(LinkAnnotationElement,[{key:"render",value:function render(){var t=this.data,r=this.linkService,a=document.createElement("a");t.url?(0,o.addLinkAttributes)(a,{url:t.url,target:t.newWindow?o.LinkTarget.BLANK:r.externalLinkTarget,rel:r.externalLinkRel,enabled:r.externalLinkEnabled}):t.action?this._bindNamedAction(a,t.action):t.dest?this._bindLink(a,t.dest):t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions?this._bindJSAction(a,t):this._bindLink(a,"");if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map((function(t,r){var o=0===r?a:a.cloneNode();t.appendChild(o);return t}));this.container.className="linkAnnotation";this.container.appendChild(a);return this.container}},{key:"_bindLink",value:function _bindLink(t,r){var a=this;t.href=this.linkService.getDestinationHash(r);t.onclick=function(){r&&a.linkService.goToDestination(r);return!1};(r||""===r)&&(t.className="internalLink")}},{key:"_bindNamedAction",value:function _bindNamedAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeNamedAction(r);return!1};t.className="internalLink"}},{key:"_bindJSAction",value:function _bindJSAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");for(var o=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),i=function _loop(){var i=u[l],c=o.get(i);if(!c)return"continue";t[c]=function(){var t;null===(t=a.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:r.id,name:i}});return!1}},l=0,u=Object.keys(r.actions);l<u.length;l++)i();t.className="internalLink"}}]);return LinkAnnotationElement}(d),p=function(t){_inherits(TextAnnotationElement,t);var r=_createSuper(TextAnnotationElement);function TextAnnotationElement(t){_classCallCheck(this,TextAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a})}_createClass(TextAnnotationElement,[{key:"render",value:function render(){this.container.className="textAnnotation";var t=document.createElement("img");t.style.height=this.container.style.height;t.style.width=this.container.style.width;t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(t,this.data);this.container.appendChild(t);return this.container}}]);return TextAnnotationElement}(d),m=function(t){_inherits(WidgetAnnotationElement,t);var r=_createSuper(WidgetAnnotationElement);function WidgetAnnotationElement(){_classCallCheck(this,WidgetAnnotationElement);return r.apply(this,arguments)}_createClass(WidgetAnnotationElement,[{key:"render",value:function render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}},{key:"_getKeyModifier",value:function _getKeyModifier(t){return navigator.platform.includes("Win")&&t.ctrlKey||navigator.platform.includes("Mac")&&t.metaKey}},{key:"_setEventListener",value:function _setEventListener(t,r,a,o){var i=this;r.includes("mouse")?t.addEventListener(r,(function(t){var r;null===(r=i.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:i,detail:{id:i.data.id,name:a,value:o(t),shift:t.shiftKey,modifier:i._getKeyModifier(t)}})})):t.addEventListener(r,(function(t){var r;null===(r=i.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:i,detail:{id:i.data.id,name:a,value:t.target.checked}})}))}},{key:"_setEventListeners",value:function _setEventListeners(t,r,a){var o,i=_createForOfIteratorHelper(r);try{for(i.s();!(o=i.n()).done;){var l,u=_slicedToArray(o.value,2),c=u[0],d=u[1];("Action"===d||null!==(l=this.data.actions)&&void 0!==l&&l[d])&&this._setEventListener(t,c,d,a)}}catch(t){i.e(t)}finally{i.f()}}}]);return WidgetAnnotationElement}(d),v=function(t){_inherits(TextWidgetAnnotationElement,t);var r=_createSuper(TextWidgetAnnotationElement);function TextWidgetAnnotationElement(t){_classCallCheck(this,TextWidgetAnnotationElement);var a=t.renderInteractiveForms||!t.data.hasAppearance&&!!t.data.fieldValue;return r.call(this,t,{isRenderable:a})}_createClass(TextWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data.id;this.container.className="textWidgetAnnotation";var o=null;if(this.renderInteractiveForms){var i=r.getOrCreateValue(a,{value:this.data.fieldValue}).value,l={userValue:null,formattedValue:null,beforeInputSelectionRange:null,beforeInputValue:null};if(this.data.multiLine)(o=document.createElement("textarea")).textContent=i;else{(o=document.createElement("input")).type="text";o.setAttribute("value",i)}l.userValue=i;o.setAttribute("id",a);o.addEventListener("input",(function(t){r.setValue(a,{value:t.target.value})}));var c=function blurListener(t){l.formattedValue&&(t.target.value=l.formattedValue);t.target.setSelectionRange(0,0);l.beforeInputSelectionRange=null};if(this.enableScripting&&this.hasJSActions){o.addEventListener("focus",(function(t){l.userValue&&(t.target.value=l.userValue)}));o.addEventListener("updatefromsandbox",(function(t){var o=t.detail,i={value:function value(){l.userValue=o.value||"";r.setValue(a,{value:l.userValue.toString()});l.formattedValue||(t.target.value=l.userValue)},valueAsString:function valueAsString(){l.formattedValue=o.valueAsString||"";t.target!==document.activeElement&&(t.target.value=l.formattedValue);r.setValue(a,{formattedValue:l.formattedValue})},focus:function focus(){setTimeout((function(){return t.target.focus({preventScroll:!1})}),0)},userName:function userName(){t.target.title=o.userName},hidden:function hidden(){t.target.style.visibility=o.hidden?"hidden":"visible";r.setValue(a,{hidden:o.hidden})},editable:function editable(){t.target.disabled=!o.editable},selRange:function selRange(){var r=_slicedToArray(o.selRange,2),a=r[0],i=r[1];a>=0&&i<t.target.value.length&&t.target.setSelectionRange(a,i)},strokeColor:function strokeColor(){var r=o.strokeColor;t.target.style.color=u.ColorConverters["".concat(r[0],"_HTML")](r.slice(1))}};Object.keys(o).filter((function(t){return t in i})).forEach((function(t){return i[t]()}))}));if(this.data.actions){o.addEventListener("keydown",(function(r){var o;l.beforeInputValue=r.target.value;var i=-1;"Escape"===r.key?i=0:"Enter"===r.key?i=2:"Tab"===r.key&&(i=3);if(-1!==i){l.userValue=r.target.value;null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:r.target.value,willCommit:!0,commitKey:i,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}}));var d=c;c=null;o.addEventListener("blur",(function(r){if(t._mouseState.isDown){var o;l.userValue=r.target.value;null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:r.target.value,willCommit:!0,commitKey:1,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}d(r)}));o.addEventListener("mousedown",(function(t){l.beforeInputValue=t.target.value;l.beforeInputSelectionRange=null}));o.addEventListener("keyup",(function(t){t.target.selectionStart===t.target.selectionEnd&&(l.beforeInputSelectionRange=null)}));o.addEventListener("select",(function(t){l.beforeInputSelectionRange=[t.target.selectionStart,t.target.selectionEnd]}));"Keystroke"in this.data.actions&&o.addEventListener("input",(function(r){var o,i=-1,u=-1;if(l.beforeInputSelectionRange){var c=_slicedToArray(l.beforeInputSelectionRange,2);i=c[0];u=c[1]}null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:l.beforeInputValue,change:r.data,willCommit:!1,selStart:i,selEnd:u}})}));this._setEventListeners(o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.value}))}}c&&o.addEventListener("blur",c);o.disabled=this.data.readOnly;o.name=this.data.fieldName;null!==this.data.maxLen&&(o.maxLength=this.data.maxLen);if(this.data.comb){var h=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;o.classList.add("comb");o.style.letterSpacing="calc(".concat(h,"px - 1ch)")}}else{(o=document.createElement("div")).textContent=this.data.fieldValue;o.style.verticalAlign="middle";o.style.display="table-cell"}this._setTextStyle(o);this.container.appendChild(o);return this.container}},{key:"_setTextStyle",value:function _setTextStyle(t){var r=this.data.defaultAppearanceData,a=r.fontSize,o=r.fontColor,l=t.style;a&&(l.fontSize="".concat(a,"px"));l.color=i.Util.makeHexColor(o[0],o[1],o[2]);null!==this.data.textAlignment&&(l.textAlign=["left","center","right"][this.data.textAlignment])}}]);return TextWidgetAnnotationElement}(m),g=function(t){_inherits(CheckboxWidgetAnnotationElement,t);var r=_createSuper(CheckboxWidgetAnnotationElement);function CheckboxWidgetAnnotationElement(t){_classCallCheck(this,CheckboxWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderInteractiveForms})}_createClass(CheckboxWidgetAnnotationElement,[{key:"render",value:function render(){var t=this.annotationStorage,r=this.data,a=r.id,o=t.getOrCreateValue(a,{value:r.fieldValue&&"Off"!==r.fieldValue}).value;this.container.className="buttonWidgetAnnotation checkBox";var i=document.createElement("input");i.disabled=r.readOnly;i.type="checkbox";i.name=this.data.fieldName;o&&i.setAttribute("checked",!0);i.setAttribute("id",a);i.addEventListener("change",(function(r){var o,i=r.target.name,l=_createForOfIteratorHelper(document.getElementsByName(i));try{for(l.s();!(o=l.n()).done;){var u=o.value;if(u!==r.target){u.checked=!1;t.setValue(u.parentNode.getAttribute("data-annotation-id"),{value:!1})}}}catch(t){l.e(t)}finally{l.f()}t.setValue(a,{value:r.target.checked})}));if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(function(r){var o=r.detail,i={value:function value(){r.target.checked="Off"!==o.value;t.setValue(a,{value:r.target.checked})},focus:function focus(){setTimeout((function(){return r.target.focus({preventScroll:!1})}),0)},hidden:function hidden(){r.target.style.visibility=o.hidden?"hidden":"visible";t.setValue(a,{hidden:o.hidden})},editable:function editable(){r.target.disabled=!o.editable}};Object.keys(o).filter((function(t){return t in i})).forEach((function(t){return i[t]()}))}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this.container.appendChild(i);return this.container}}]);return CheckboxWidgetAnnotationElement}(m),y=function(t){_inherits(RadioButtonWidgetAnnotationElement,t);var r=_createSuper(RadioButtonWidgetAnnotationElement);function RadioButtonWidgetAnnotationElement(t){_classCallCheck(this,RadioButtonWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderInteractiveForms})}_createClass(RadioButtonWidgetAnnotationElement,[{key:"render",value:function render(){this.container.className="buttonWidgetAnnotation radioButton";var t=this.annotationStorage,r=this.data,a=r.id,o=t.getOrCreateValue(a,{value:r.fieldValue===r.buttonValue}).value,i=document.createElement("input");i.disabled=r.readOnly;i.type="radio";i.name=r.fieldName;o&&i.setAttribute("checked",!0);i.setAttribute("pdfButtonValue",r.buttonValue);i.setAttribute("id",a);i.addEventListener("change",(function(r){var o,i=r.target,l=_createForOfIteratorHelper(document.getElementsByName(i.name));try{for(l.s();!(o=l.n()).done;){var u=o.value;u!==i&&t.setValue(u.getAttribute("id"),{value:!1})}}catch(t){l.e(t)}finally{l.f()}t.setValue(a,{value:i.checked})}));if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(function(r){var o=r.detail,i={value:function value(){var a,i=o.value,l=_createForOfIteratorHelper(document.getElementsByName(r.target.name));try{for(l.s();!(a=l.n()).done;){var u=a.value,c=u.getAttribute("id");if(i===u.getAttribute("pdfButtonValue")){u.setAttribute("checked",!0);t.setValue(c,{value:!0})}else t.setValue(c,{value:!1})}}catch(t){l.e(t)}finally{l.f()}},focus:function focus(){setTimeout((function(){return r.target.focus({preventScroll:!1})}),0)},hidden:function hidden(){r.target.style.visibility=o.hidden?"hidden":"visible";t.setValue(a,{hidden:o.hidden})},editable:function editable(){r.target.disabled=!o.editable}};Object.keys(o).filter((function(t){return t in i})).forEach((function(t){return i[t]()}))}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this.container.appendChild(i);return this.container}}]);return RadioButtonWidgetAnnotationElement}(m),b=function(t){_inherits(PushButtonWidgetAnnotationElement,t);var r=_createSuper(PushButtonWidgetAnnotationElement);function PushButtonWidgetAnnotationElement(){_classCallCheck(this,PushButtonWidgetAnnotationElement);return r.apply(this,arguments)}_createClass(PushButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t=_get(_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype),"render",this).call(this);t.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(t.title=this.data.alternativeText);return t}}]);return PushButtonWidgetAnnotationElement}(h),_=function(t){_inherits(ChoiceWidgetAnnotationElement,t);var r=_createSuper(ChoiceWidgetAnnotationElement);function ChoiceWidgetAnnotationElement(t){_classCallCheck(this,ChoiceWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderInteractiveForms})}_createClass(ChoiceWidgetAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.className="choiceWidgetAnnotation";var r=this.annotationStorage,a=this.data.id;r.getOrCreateValue(a,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:void 0});var o=document.createElement("select");o.disabled=this.data.readOnly;o.name=this.data.fieldName;o.setAttribute("id",a);if(!this.data.combo){o.size=this.data.options.length;this.data.multiSelect&&(o.multiple=!0)}var i,l=_createForOfIteratorHelper(this.data.options);try{for(l.s();!(i=l.n()).done;){var u=i.value,c=document.createElement("option");c.textContent=u.displayValue;c.value=u.exportValue;this.data.fieldValue.includes(u.exportValue)&&c.setAttribute("selected",!0);o.appendChild(c)}}catch(t){l.e(t)}finally{l.f()}function getValue(t){var r=t.target.options;return r[r.selectedIndex].value}if(this.enableScripting&&this.hasJSActions){o.addEventListener("updatefromsandbox",(function(t){var o=t.detail,i={value:function value(){var i=t.target.options,value=o.value,l=i.indexOf(value);if(-1!==l){i.selectedIndex=l;r.setValue(a,{value:value})}},focus:function focus(){setTimeout((function(){return t.target.focus({preventScroll:!1})}),0)},hidden:function hidden(){t.target.style.visibility=o.hidden?"hidden":"visible";r.setValue(a,{hidden:o.hidden})},editable:function editable(){t.target.disabled=!o.editable}};Object.keys(o).filter((function(t){return t in i})).forEach((function(t){return i[t]()}))}));o.addEventListener("input",(function(o){var i,l=getValue(o);r.setValue(a,{value:l});null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",changeEx:l,willCommit:!0,commitKey:1,keyDown:!1}})}));this._setEventListeners(o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}else o.addEventListener("input",(function(t){r.setValue(a,{value:getValue(t)})}));this.container.appendChild(o);return this.container}}]);return ChoiceWidgetAnnotationElement}(m),S=function(t){_inherits(PopupAnnotationElement,t);var r=_createSuper(PopupAnnotationElement);function PopupAnnotationElement(t){_classCallCheck(this,PopupAnnotationElement);var a=!(!t.data.title&&!t.data.contents);return r.call(this,t,{isRenderable:a})}_createClass(PopupAnnotationElement,[{key:"render",value:function render(){this.container.className="popupAnnotation";if(["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;var t='[data-annotation-id="'.concat(this.data.parentId,'"]'),r=this.layer.querySelectorAll(t);if(0===r.length)return this.container;var a=new C({container:this.container,trigger:Array.from(r),color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),o=this.page,l=i.Util.normalizeRect([this.data.parentRect[0],o.view[3]-this.data.parentRect[1]+o.view[1],this.data.parentRect[2],o.view[3]-this.data.parentRect[3]+o.view[1]]),u=l[0]+this.data.parentRect[2]-this.data.parentRect[0],c=l[1];this.container.style.transformOrigin="".concat(-u,"px ").concat(-c,"px");this.container.style.left="".concat(u,"px");this.container.style.top="".concat(c,"px");this.container.appendChild(a.render());return this.container}}]);return PopupAnnotationElement}(d),C=function(){function PopupElement(t){_classCallCheck(this,PopupElement);this.container=t.container;this.trigger=t.trigger;this.color=t.color;this.title=t.title;this.modificationDate=t.modificationDate;this.contents=t.contents;this.hideWrapper=t.hideWrapper||!1;this.pinned=!1}_createClass(PopupElement,[{key:"render",value:function render(){var t=this,r=document.createElement("div");r.className="popupWrapper";this.hideElement=this.hideWrapper?r:this.container;this.hideElement.setAttribute("hidden",!0);var a=document.createElement("div");a.className="popup";var l=this.color;if(l){var u=.7*(255-l[0])+l[0],c=.7*(255-l[1])+l[1],d=.7*(255-l[2])+l[2];a.style.backgroundColor=i.Util.makeHexColor(0|u,0|c,0|d)}var h=document.createElement("h1");h.textContent=this.title;a.appendChild(h);var p=o.PDFDateString.toDateObject(this.modificationDate);if(p){var m=document.createElement("span");m.textContent="{{date}}, {{time}}";m.dataset.l10nId="annotation_date_string";m.dataset.l10nArgs=JSON.stringify({date:p.toLocaleDateString(),time:p.toLocaleTimeString()});a.appendChild(m)}var v=this._formatContents(this.contents);a.appendChild(v);Array.isArray(this.trigger)||(this.trigger=[this.trigger]);this.trigger.forEach((function(r){r.addEventListener("click",t._toggle.bind(t));r.addEventListener("mouseover",t._show.bind(t,!1));r.addEventListener("mouseout",t._hide.bind(t,!1))}));a.addEventListener("click",this._hide.bind(this,!0));r.appendChild(a);return r}},{key:"_formatContents",value:function _formatContents(t){for(var r=document.createElement("p"),a=t.split(/(?:\r\n?|\n)/),o=0,i=a.length;o<i;++o){var l=a[o];r.appendChild(document.createTextNode(l));o<i-1&&r.appendChild(document.createElement("br"))}return r}},{key:"_toggle",value:function _toggle(){this.pinned?this._hide(!0):this._show(!0)}},{key:"_show",value:function _show(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(this.pinned=!0);if(this.hideElement.hasAttribute("hidden")){this.hideElement.removeAttribute("hidden");this.container.style.zIndex+=1}}},{key:"_hide",value:function _hide(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(this.pinned=!1);if(!this.hideElement.hasAttribute("hidden")&&!this.pinned){this.hideElement.setAttribute("hidden",!0);this.container.style.zIndex-=1}}}]);return PopupElement}(),A=function(t){_inherits(FreeTextAnnotationElement,t);var r=_createSuper(FreeTextAnnotationElement);function FreeTextAnnotationElement(t){_classCallCheck(this,FreeTextAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(FreeTextAnnotationElement,[{key:"render",value:function render(){this.container.className="freeTextAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return FreeTextAnnotationElement}(d),R=function(t){_inherits(LineAnnotationElement,t);var r=_createSuper(LineAnnotationElement);function LineAnnotationElement(t){_classCallCheck(this,LineAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(LineAnnotationElement,[{key:"render",value:function render(){this.container.className="lineAnnotation";var t=this.data,r=t.rect[2]-t.rect[0],a=t.rect[3]-t.rect[1],o=this.svgFactory.create(r,a),i=this.svgFactory.createElement("svg:line");i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);i.setAttribute("stroke-width",t.borderStyle.width||1);i.setAttribute("stroke","transparent");o.appendChild(i);this.container.append(o);this._createPopup(i,t);return this.container}}]);return LineAnnotationElement}(d),k=function(t){_inherits(SquareAnnotationElement,t);var r=_createSuper(SquareAnnotationElement);function SquareAnnotationElement(t){_classCallCheck(this,SquareAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(SquareAnnotationElement,[{key:"render",value:function render(){this.container.className="squareAnnotation";var t=this.data,r=t.rect[2]-t.rect[0],a=t.rect[3]-t.rect[1],o=this.svgFactory.create(r,a),i=t.borderStyle.width,l=this.svgFactory.createElement("svg:rect");l.setAttribute("x",i/2);l.setAttribute("y",i/2);l.setAttribute("width",r-i);l.setAttribute("height",a-i);l.setAttribute("stroke-width",i||1);l.setAttribute("stroke","transparent");l.setAttribute("fill","none");o.appendChild(l);this.container.append(o);this._createPopup(l,t);return this.container}}]);return SquareAnnotationElement}(d),P=function(t){_inherits(CircleAnnotationElement,t);var r=_createSuper(CircleAnnotationElement);function CircleAnnotationElement(t){_classCallCheck(this,CircleAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(CircleAnnotationElement,[{key:"render",value:function render(){this.container.className="circleAnnotation";var t=this.data,r=t.rect[2]-t.rect[0],a=t.rect[3]-t.rect[1],o=this.svgFactory.create(r,a),i=t.borderStyle.width,l=this.svgFactory.createElement("svg:ellipse");l.setAttribute("cx",r/2);l.setAttribute("cy",a/2);l.setAttribute("rx",r/2-i/2);l.setAttribute("ry",a/2-i/2);l.setAttribute("stroke-width",i||1);l.setAttribute("stroke","transparent");l.setAttribute("fill","none");o.appendChild(l);this.container.append(o);this._createPopup(l,t);return this.container}}]);return CircleAnnotationElement}(d),w=function(t){_inherits(PolylineAnnotationElement,t);var r=_createSuper(PolylineAnnotationElement);function PolylineAnnotationElement(t){var a;_classCallCheck(this,PolylineAnnotationElement);var o=!!(t.data.hasPopup||t.data.title||t.data.contents);(a=r.call(this,t,{isRenderable:o,ignoreBorder:!0})).containerClassName="polylineAnnotation";a.svgElementName="svg:polyline";return a}_createClass(PolylineAnnotationElement,[{key:"render",value:function render(){this.container.className=this.containerClassName;var t,r=this.data,a=r.rect[2]-r.rect[0],o=r.rect[3]-r.rect[1],i=this.svgFactory.create(a,o),l=[],u=_createForOfIteratorHelper(r.vertices);try{for(u.s();!(t=u.n()).done;){var c=t.value,d=c.x-r.rect[0],h=r.rect[3]-c.y;l.push(d+","+h)}}catch(t){u.e(t)}finally{u.f()}l=l.join(" ");var p=this.svgFactory.createElement(this.svgElementName);p.setAttribute("points",l);p.setAttribute("stroke-width",r.borderStyle.width||1);p.setAttribute("stroke","transparent");p.setAttribute("fill","none");i.appendChild(p);this.container.append(i);this._createPopup(p,r);return this.container}}]);return PolylineAnnotationElement}(d),x=function(t){_inherits(PolygonAnnotationElement,t);var r=_createSuper(PolygonAnnotationElement);function PolygonAnnotationElement(t){var a;_classCallCheck(this,PolygonAnnotationElement);(a=r.call(this,t)).containerClassName="polygonAnnotation";a.svgElementName="svg:polygon";return a}return PolygonAnnotationElement}(w),T=function(t){_inherits(CaretAnnotationElement,t);var r=_createSuper(CaretAnnotationElement);function CaretAnnotationElement(t){_classCallCheck(this,CaretAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(CaretAnnotationElement,[{key:"render",value:function render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return CaretAnnotationElement}(d),E=function(t){_inherits(InkAnnotationElement,t);var r=_createSuper(InkAnnotationElement);function InkAnnotationElement(t){var a;_classCallCheck(this,InkAnnotationElement);var o=!!(t.data.hasPopup||t.data.title||t.data.contents);(a=r.call(this,t,{isRenderable:o,ignoreBorder:!0})).containerClassName="inkAnnotation";a.svgElementName="svg:polyline";return a}_createClass(InkAnnotationElement,[{key:"render",value:function render(){this.container.className=this.containerClassName;var t,r=this.data,a=r.rect[2]-r.rect[0],o=r.rect[3]-r.rect[1],i=this.svgFactory.create(a,o),l=_createForOfIteratorHelper(r.inkLists);try{for(l.s();!(t=l.n()).done;){var u,c=t.value,d=[],h=_createForOfIteratorHelper(c);try{for(h.s();!(u=h.n()).done;){var p=u.value,m=p.x-r.rect[0],v=r.rect[3]-p.y;d.push("".concat(m,",").concat(v))}}catch(t){h.e(t)}finally{h.f()}d=d.join(" ");var g=this.svgFactory.createElement(this.svgElementName);g.setAttribute("points",d);g.setAttribute("stroke-width",r.borderStyle.width||1);g.setAttribute("stroke","transparent");g.setAttribute("fill","none");this._createPopup(g,r);i.appendChild(g)}}catch(t){l.e(t)}finally{l.f()}this.container.append(i);return this.container}}]);return InkAnnotationElement}(d),O=function(t){_inherits(HighlightAnnotationElement,t);var r=_createSuper(HighlightAnnotationElement);function HighlightAnnotationElement(t){_classCallCheck(this,HighlightAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(HighlightAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}]);return HighlightAnnotationElement}(d),I=function(t){_inherits(UnderlineAnnotationElement,t);var r=_createSuper(UnderlineAnnotationElement);function UnderlineAnnotationElement(t){_classCallCheck(this,UnderlineAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(UnderlineAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}]);return UnderlineAnnotationElement}(d),D=function(t){_inherits(SquigglyAnnotationElement,t);var r=_createSuper(SquigglyAnnotationElement);function SquigglyAnnotationElement(t){_classCallCheck(this,SquigglyAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(SquigglyAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}]);return SquigglyAnnotationElement}(d),L=function(t){_inherits(StrikeOutAnnotationElement,t);var r=_createSuper(StrikeOutAnnotationElement);function StrikeOutAnnotationElement(t){_classCallCheck(this,StrikeOutAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(StrikeOutAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}]);return StrikeOutAnnotationElement}(d),M=function(t){_inherits(StampAnnotationElement,t);var r=_createSuper(StampAnnotationElement);function StampAnnotationElement(t){_classCallCheck(this,StampAnnotationElement);var a=!!(t.data.hasPopup||t.data.title||t.data.contents);return r.call(this,t,{isRenderable:a,ignoreBorder:!0})}_createClass(StampAnnotationElement,[{key:"render",value:function render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return StampAnnotationElement}(d),W=function(t){_inherits(FileAttachmentAnnotationElement,t);var r=_createSuper(FileAttachmentAnnotationElement);function FileAttachmentAnnotationElement(t){var a,l;_classCallCheck(this,FileAttachmentAnnotationElement);var u=(l=r.call(this,t,{isRenderable:!0})).data.file,c=u.filename,d=u.content;l.filename=(0,o.getFilenameFromUrl)(c);l.content=d;null===(a=l.linkService.eventBus)||void 0===a||a.dispatch("fileattachmentannotation",{source:_assertThisInitialized(l),id:(0,i.stringToPDFString)(c),filename:c,content:d});return l}_createClass(FileAttachmentAnnotationElement,[{key:"render",value:function render(){this.container.className="fileAttachmentAnnotation";var t=document.createElement("div");t.style.height=this.container.style.height;t.style.width=this.container.style.width;t.addEventListener("dblclick",this._download.bind(this));this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(t,this.data);this.container.appendChild(t);return this.container}},{key:"_download",value:function _download(){this.downloadManager?this.downloadManager.downloadData(this.content,this.filename,""):(0,i.warn)("Download cannot be started due to unavailable download manager")}}]);return FileAttachmentAnnotationElement}(d),j=function(){function AnnotationLayer(){_classCallCheck(this,AnnotationLayer)}_createClass(AnnotationLayer,null,[{key:"render",value:function render(t){var r,a=[],u=[],d=_createForOfIteratorHelper(t.annotations);try{for(d.s();!(r=d.n()).done;){var h=r.value;h&&(h.annotationType!==i.AnnotationType.POPUP?a.push(h):u.push(h))}}catch(t){d.e(t)}finally{d.f()}u.length&&a.push.apply(a,u);for(var p=0,m=a;p<m.length;p++){var v=m[p],g=c.create({data:v,layer:t.div,page:t.page,viewport:t.viewport,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderInteractiveForms:"boolean"!=typeof t.renderInteractiveForms||t.renderInteractiveForms,svgFactory:new o.DOMSVGFactory,annotationStorage:t.annotationStorage||new l.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,mouseState:t.mouseState||{isDown:!1}});if(g.isRenderable){var y=g.render();v.hidden&&(y.style.visibility="hidden");if(Array.isArray(y)){var b,_=_createForOfIteratorHelper(y);try{for(_.s();!(b=_.n()).done;){var C=b.value;t.div.appendChild(C)}}catch(t){_.e(t)}finally{_.f()}}else g instanceof S?t.div.prepend(y):t.div.appendChild(y)}}}},{key:"update",value:function update(t){var r,a="matrix(".concat(t.viewport.transform.join(","),")"),o=_createForOfIteratorHelper(t.annotations);try{for(o.s();!(r=o.n()).done;){var i=r.value,l=t.div.querySelectorAll('[data-annotation-id="'.concat(i.id,'"]'));l&&l.forEach((function(t){t.style.transform=a}))}}catch(t){o.e(t)}finally{o.f()}t.div.removeAttribute("hidden")}}]);return AnnotationLayer}();r.AnnotationLayer=j},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ColorConverters=void 0;function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}var a=function(){function ColorConverters(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorConverters)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}(ColorConverters,null,[{key:"CMYK_G",value:function CMYK_G(t){var r=_slicedToArray(t,4),a=r[0],o=r[1],i=r[2],l=r[3];return["G",1-Math.min(1,.3*a+.59*i+.11*o+l)]}},{key:"G_CMYK",value:function G_CMYK(t){return["CMYK",0,0,0,1-_slicedToArray(t,1)[0]]}},{key:"G_RGB",value:function G_RGB(t){var r=_slicedToArray(t,1)[0];return["RGB",r,r,r]}},{key:"G_HTML",value:function G_HTML(t){var r=makeColorComp(_slicedToArray(t,1)[0]);return"#".concat(r).concat(r).concat(r)}},{key:"RGB_G",value:function RGB_G(t){var r=_slicedToArray(t,3);return["G",.3*r[0]+.59*r[1]+.11*r[2]]}},{key:"RGB_HTML",value:function RGB_HTML(t){var r=_slicedToArray(t,3),a=r[0],o=r[1],i=r[2],l=makeColorComp(a),u=makeColorComp(o),c=makeColorComp(i);return"#".concat(l).concat(u).concat(c)}},{key:"T_HTML",value:function T_HTML(){return"#00000000"}},{key:"CMYK_RGB",value:function CMYK_RGB(t){var r=_slicedToArray(t,4),a=r[0],o=r[1],i=r[2],l=r[3];return["RGB",1-Math.min(1,a+l),1-Math.min(1,i+l),1-Math.min(1,o+l)]}},{key:"CMYK_HTML",value:function CMYK_HTML(t){return this.RGB_HTML(this.CMYK_RGB(t))}},{key:"RGB_CMYK",value:function RGB_CMYK(t){var r=_slicedToArray(t,3),a=1-r[0],o=1-r[1],i=1-r[2];return["CMYK",a,o,i,Math.min(a,o,i)]}}]);return ColorConverters}();r.ColorConverters=a},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.renderTextLayer=void 0;var o=a(4),i=function renderTextLayerClosure(){var t=/\S/;function appendText(r,a,i){var l=document.createElement("span"),u={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};r._textDivs.push(l);if(function isAllWhitespace(r){return!t.test(r)}(a.str)){u.isWhitespace=!0;r._textDivProperties.set(l,u)}else{var c=o.Util.transform(r._viewport.transform,a.transform),d=Math.atan2(c[1],c[0]),h=i[a.fontName];h.vertical&&(d+=Math.PI/2);var p,m,v=Math.sqrt(c[2]*c[2]+c[3]*c[3]),g=v;h.ascent?g=h.ascent*g:h.descent&&(g=(1+h.descent)*g);if(0===d){p=c[4];m=c[5]-g}else{p=c[4]+g*Math.sin(d);m=c[5]-g*Math.cos(d)}l.style.left="".concat(p,"px");l.style.top="".concat(m,"px");l.style.fontSize="".concat(v,"px");l.style.fontFamily=h.fontFamily;l.textContent=a.str;r._fontInspectorEnabled&&(l.dataset.fontName=a.fontName);0!==d&&(u.angle=d*(180/Math.PI));var y=!1;if(a.str.length>1)y=!0;else if(a.transform[0]!==a.transform[3]){var b=Math.abs(a.transform[0]),_=Math.abs(a.transform[3]);b!==_&&Math.max(b,_)/Math.min(b,_)>1.5&&(y=!0)}y&&(h.vertical?u.canvasWidth=a.height*r._viewport.scale:u.canvasWidth=a.width*r._viewport.scale);r._textDivProperties.set(l,u);r._textContentStream&&r._layoutText(l);if(r._enhanceTextSelection){var S=1,C=0;if(0!==d){S=Math.cos(d);C=Math.sin(d)}var A,R,k=(h.vertical?a.height:a.width)*r._viewport.scale,P=v;if(0!==d){A=[S,C,-C,S,p,m];R=o.Util.getAxialAlignedBoundingBox([0,0,k,P],A)}else R=[p,m,p+k,m+P];r._bounds.push({left:R[0],top:R[1],right:R[2],bottom:R[3],div:l,size:[k,P],m:A})}}}function render(t){if(!t._canceled){var r=t._textDivs,a=t._capability,o=r.length;if(o>1e5){t._renderingDone=!0;a.resolve()}else{if(!t._textContentStream)for(var i=0;i<o;i++)t._layoutText(r[i]);t._renderingDone=!0;a.resolve()}}}function findPositiveMin(t,r,a){for(var o=0,i=0;i<a;i++){var l=t[r++];l>0&&(o=o?Math.min(l,o):l)}return o}function expand(t){for(var r=t._bounds,a=t._viewport,i=function expandBounds(t,r,a){var o=a.map((function(t,r){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:r,x1New:void 0,x2New:void 0}}));expandBoundsLTR(t,o);var i=new Array(a.length);o.forEach((function(t){var r=t.index;i[r]={left:t.x1New,top:0,right:t.x2New,bottom:0}}));a.map((function(r,a){var l=i[a],u=o[a];u.x1=r.top;u.y1=t-l.right;u.x2=r.bottom;u.y2=t-l.left;u.index=a;u.x1New=void 0;u.x2New=void 0}));expandBoundsLTR(r,o);o.forEach((function(t){var r=t.index;i[r].top=t.x1New;i[r].bottom=t.x2New}));return i}(a.width,a.height,r),l=function _loop(a){var l=r[a].div,u=t._textDivProperties.get(l);if(0===u.angle){u.paddingLeft=r[a].left-i[a].left;u.paddingTop=r[a].top-i[a].top;u.paddingRight=i[a].right-r[a].right;u.paddingBottom=i[a].bottom-r[a].bottom;t._textDivProperties.set(l,u);return"continue"}var c=i[a],d=r[a],h=d.m,p=h[0],m=h[1],v=[[0,0],[0,d.size[1]],[d.size[0],0],d.size],g=new Float64Array(64);v.forEach((function(t,r){var a=o.Util.applyTransform(t,h);g[r+0]=p&&(c.left-a[0])/p;g[r+4]=m&&(c.top-a[1])/m;g[r+8]=p&&(c.right-a[0])/p;g[r+12]=m&&(c.bottom-a[1])/m;g[r+16]=m&&(c.left-a[0])/-m;g[r+20]=p&&(c.top-a[1])/p;g[r+24]=m&&(c.right-a[0])/-m;g[r+28]=p&&(c.bottom-a[1])/p;g[r+32]=p&&(c.left-a[0])/-p;g[r+36]=m&&(c.top-a[1])/-m;g[r+40]=p&&(c.right-a[0])/-p;g[r+44]=m&&(c.bottom-a[1])/-m;g[r+48]=m&&(c.left-a[0])/m;g[r+52]=p&&(c.top-a[1])/-p;g[r+56]=m&&(c.right-a[0])/m;g[r+60]=p&&(c.bottom-a[1])/-p}));var y=1+Math.min(Math.abs(p),Math.abs(m));u.paddingLeft=findPositiveMin(g,32,16)/y;u.paddingTop=findPositiveMin(g,48,16)/y;u.paddingRight=findPositiveMin(g,0,16)/y;u.paddingBottom=findPositiveMin(g,16,16)/y;t._textDivProperties.set(l,u)},u=0;u<i.length;u++)l(u)}function expandBoundsLTR(t,r){r.sort((function(t,r){return t.x1-r.x1||t.index-r.index}));var a=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];r.forEach((function(t){for(var r=0;r<a.length&&a[r].end<=t.y1;)r++;for(var o,i,l=a.length-1;l>=0&&a[l].start>=t.y2;)l--;var u,c,d=-1/0;for(u=r;u<=l;u++){var h=void 0;(h=(i=(o=a[u]).boundary).x2>t.x1?i.index>t.index?i.x1New:t.x1:void 0===i.x2New?(i.x2+t.x1)/2:i.x2New)>d&&(d=h)}t.x1New=d;for(u=r;u<=l;u++)void 0===(i=(o=a[u]).boundary).x2New?i.x2>t.x1?i.index>t.index&&(i.x2New=i.x2):i.x2New=d:i.x2New>d&&(i.x2New=Math.max(d,i.x2));var p=[],m=null;for(u=r;u<=l;u++){var v=(i=(o=a[u]).boundary).x2>t.x2?i:t;if(m===v)p[p.length-1].end=o.end;else{p.push({start:o.start,end:o.end,boundary:v});m=v}}if(a[r].start<t.y1){p[0].start=t.y1;p.unshift({start:a[r].start,end:t.y1,boundary:a[r].boundary})}if(t.y2<a[l].end){p[p.length-1].end=t.y2;p.push({start:t.y2,end:a[l].end,boundary:a[l].boundary})}for(u=r;u<=l;u++)if(void 0===(i=(o=a[u]).boundary).x2New){var g=!1;for(c=r-1;!g&&c>=0&&a[c].start>=i.y1;c--)g=a[c].boundary===i;for(c=l+1;!g&&c<a.length&&a[c].end<=i.y2;c++)g=a[c].boundary===i;for(c=0;!g&&c<p.length;c++)g=p[c].boundary===i;g||(i.x2New=d)}Array.prototype.splice.apply(a,[r,l-r+1].concat(p))}));a.forEach((function(r){var a=r.boundary;void 0===a.x2New&&(a.x2New=Math.max(t,a.x2))}))}function TextLayerRenderTask(t){var r,a=this,i=t.textContent,l=t.textContentStream,u=t.container,c=t.viewport,d=t.textDivs,h=t.textContentItemsStr,p=t.enhanceTextSelection;this._textContent=i;this._textContentStream=l;this._container=u;this._document=u.ownerDocument;this._viewport=c;this._textDivs=d||[];this._textContentItemsStr=h||[];this._enhanceTextSelection=!!p;this._fontInspectorEnabled=!(null===(r=globalThis.FontInspector)||void 0===r||!r.enabled);this._reader=null;this._layoutTextLastFontSize=null;this._layoutTextLastFontFamily=null;this._layoutTextCtx=null;this._textDivProperties=new WeakMap;this._renderingDone=!1;this._canceled=!1;this._capability=(0,o.createPromiseCapability)();this._renderTimer=null;this._bounds=[];this._capability.promise.finally((function(){if(a._layoutTextCtx){a._layoutTextCtx.canvas.width=0;a._layoutTextCtx.canvas.height=0;a._layoutTextCtx=null}})).catch((function(){}))}TextLayerRenderTask.prototype={get promise(){return this._capability.promise},cancel:function TextLayer_cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new o.AbortException("TextLayer task cancelled."));this._reader=null}if(null!==this._renderTimer){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject(new Error("TextLayer task cancelled."))},_processItems:function _processItems(t,r){for(var a=0,o=t.length;a<o;a++){this._textContentItemsStr.push(t[a].str);appendText(this,t[a],r)}},_layoutText:function _layoutText(t){var r=this._textDivProperties.get(t);if(!r.isWhitespace){var a="";if(0!==r.canvasWidth){var o=t.style,i=o.fontSize,l=o.fontFamily;if(i!==this._layoutTextLastFontSize||l!==this._layoutTextLastFontFamily){this._layoutTextCtx.font="".concat(i," ").concat(l);this._layoutTextLastFontSize=i;this._layoutTextLastFontFamily=l}var u=this._layoutTextCtx.measureText(t.textContent).width;if(u>0){r.scale=r.canvasWidth/u;a="scaleX(".concat(r.scale,")")}}0!==r.angle&&(a="rotate(".concat(r.angle,"deg) ").concat(a));if(a.length>0){this._enhanceTextSelection&&(r.originalTransform=a);t.style.transform=a}this._textDivProperties.set(t,r);this._container.appendChild(t)}},_render:function TextLayer_render(t){var r=this,a=(0,o.createPromiseCapability)(),i=Object.create(null),l=this._document.createElement("canvas");l.mozOpaque=!0;this._layoutTextCtx=l.getContext("2d",{alpha:!1});if(this._textContent){var u=this._textContent.items,c=this._textContent.styles;this._processItems(u,c);a.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');this._reader=this._textContentStream.getReader();!function pump(){r._reader.read().then((function(t){var o=t.value;if(t.done)a.resolve();else{Object.assign(i,o.styles);r._processItems(o.items,i);pump()}}),a.reject)}()}a.promise.then((function(){i=null;t?r._renderTimer=setTimeout((function(){render(r);r._renderTimer=null}),t):render(r)}),this._capability.reject)},expandTextDivs:function TextLayer_expandTextDivs(t){if(this._enhanceTextSelection&&this._renderingDone){if(null!==this._bounds){expand(this);this._bounds=null}for(var r=[],a=[],o=0,i=this._textDivs.length;o<i;o++){var l=this._textDivs[o],u=this._textDivProperties.get(l);if(!u.isWhitespace)if(t){r.length=0;a.length=0;u.originalTransform&&r.push(u.originalTransform);if(u.paddingTop>0){a.push("".concat(u.paddingTop,"px"));r.push("translateY(".concat(-u.paddingTop,"px)"))}else a.push(0);u.paddingRight>0?a.push("".concat(u.paddingRight/u.scale,"px")):a.push(0);u.paddingBottom>0?a.push("".concat(u.paddingBottom,"px")):a.push(0);if(u.paddingLeft>0){a.push("".concat(u.paddingLeft/u.scale,"px"));r.push("translateX(".concat(-u.paddingLeft/u.scale,"px)"))}else a.push(0);l.style.padding=a.join(" ");r.length&&(l.style.transform=r.join(" "))}else{l.style.padding=null;l.style.transform=u.originalTransform}}}}};return function renderTextLayer(t){var r=new TextLayerRenderTask({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});r._render(t.timeout);return r}}();r.renderTextLayer=i},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SVGGraphics=void 0;var o=a(4),i=a(1),l=a(6);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var a;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var o=0,i=function F(){};return{s:i,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:i}}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 l,u=!0,c=!1;return{s:function s(){a=t[Symbol.iterator]()},n:function n(){var t=a.next();u=t.done;return t},e:function e(t){c=!0;l=t},f:function f(){try{u||null==a.return||a.return()}finally{if(c)throw l}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var u=function SVGGraphics(){throw new Error("Not implemented: SVGGraphics")};r.SVGGraphics=u;var c=function pf(t){if(Number.isInteger(t))return t.toString();var r=t.toFixed(10),a=r.length-1;if("0"!==r[a])return r;do{a--}while("0"===r[a]);return r.substring(0,"."===r[a]?a:a+1)},d=function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale(".concat(c(t[0])," ").concat(c(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){var r=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(c(r),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(c(t[4])," ").concat(c(t[5]),")");return"matrix(".concat(c(t[0])," ").concat(c(t[1])," ").concat(c(t[2])," ").concat(c(t[3])," ").concat(c(t[4])," ")+"".concat(c(t[5]),")")},h={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},p=["butt","round","square"],m=["miter","round","bevel"],v=function(){for(var t=new Uint8Array([137,80,78,71,13,10,26,10]),r=new Int32Array(256),a=0;a<256;a++){for(var i=a,u=0;u<8;u++)i=1&i?3988292384^i>>1&2147483647:i>>1&2147483647;r[a]=i}function writePngChunk(t,a,o,i){var l=i,u=a.length;o[l]=u>>24&255;o[l+1]=u>>16&255;o[l+2]=u>>8&255;o[l+3]=255&u;o[l+=4]=255&t.charCodeAt(0);o[l+1]=255&t.charCodeAt(1);o[l+2]=255&t.charCodeAt(2);o[l+3]=255&t.charCodeAt(3);l+=4;o.set(a,l);var c=function crc32(t,a,o){for(var i=-1,l=a;l<o;l++){var u=255&(i^t[l]);i=i>>>8^r[u]}return-1^i}(o,i+4,l+=a.length);o[l]=c>>24&255;o[l+1]=c>>16&255;o[l+2]=c>>8&255;o[l+3]=255&c}function deflateSyncUncompressed(t){var r=t.length,a=65535,o=Math.ceil(r/a),i=new Uint8Array(2+r+5*o+4),l=0;i[l++]=120;i[l++]=156;for(var u=0;r>a;){i[l++]=0;i[l++]=255;i[l++]=255;i[l++]=0;i[l++]=0;i.set(t.subarray(u,u+a),l);l+=a;u+=a;r-=a}i[l++]=1;i[l++]=255&r;i[l++]=r>>8&255;i[l++]=255&~r;i[l++]=(65535&~r)>>8&255;i.set(t.subarray(u),l);l+=t.length-u;var c=function adler32(t,r,a){for(var o=1,i=0,l=r;l<a;++l)i=(i+(o=(o+(255&t[l]))%65521))%65521;return i<<16|o}(t,0,t.length);i[l++]=c>>24&255;i[l++]=c>>16&255;i[l++]=c>>8&255;i[l++]=255&c;return i}function encode(r,a,i,u){var c,d,h,p=r.width,m=r.height,v=r.data;switch(a){case o.ImageKind.GRAYSCALE_1BPP:d=0;c=1;h=p+7>>3;break;case o.ImageKind.RGB_24BPP:d=2;c=8;h=3*p;break;case o.ImageKind.RGBA_32BPP:d=6;c=8;h=4*p;break;default:throw new Error("invalid format")}for(var g=new Uint8Array((1+h)*m),y=0,b=0,_=0;_<m;++_){g[y++]=0;g.set(v.subarray(b,b+h),y);b+=h;y+=h}if(a===o.ImageKind.GRAYSCALE_1BPP&&u){y=0;for(var S=0;S<m;S++){y++;for(var C=0;C<h;C++)g[y++]^=255}}var A=new Uint8Array([p>>24&255,p>>16&255,p>>8&255,255&p,m>>24&255,m>>16&255,m>>8&255,255&m,c,d,0,0,0]),R=function deflateSync(t){if(!l.isNodeJS)return deflateSyncUncompressed(t);try{var r;r=parseInt(process.versions.node)>=8?t:Buffer.from(t);var a=require("zlib").deflateSync(r,{level:9});return a instanceof Uint8Array?a:new Uint8Array(a)}catch(t){(0,o.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(g),k=t.length+36+A.length+R.length,P=new Uint8Array(k),w=0;P.set(t,w);writePngChunk("IHDR",A,P,w+=t.length);writePngChunk("IDATA",R,P,w+=12+A.length);w+=12+R.length;writePngChunk("IEND",new Uint8Array(0),P,w);return(0,o.createObjectURL)(P,"image/png",i)}return function convertImgDataToPng(t,r,a){return encode(t,void 0===t.kind?o.ImageKind.GRAYSCALE_1BPP:t.kind,r,a)}}(),g=function(){function SVGExtraState(){_classCallCheck(this,SVGExtraState);this.fontSizeScale=1;this.fontWeight=h.fontWeight;this.fontSize=0;this.textMatrix=o.IDENTITY_MATRIX;this.fontMatrix=o.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=o.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=h.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}_createClass(SVGExtraState,[{key:"clone",value:function clone(){return Object.create(this)}},{key:"setCurrentPoint",value:function setCurrentPoint(t,r){this.x=t;this.y=r}}]);return SVGExtraState}(),y=0,b=0,_=0;r.SVGGraphics=u=function(){function SVGGraphics(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,SVGGraphics);this.svgFactory=new i.DOMSVGFactory;this.current=new g;this.transformMatrix=o.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=r;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!a;this._operatorIdMapping=[];for(var l in o.OPS)this._operatorIdMapping[o.OPS[l]]=l}_createClass(SVGGraphics,[{key:"save",value:function save(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t);this.current=t.clone()}},{key:"restore",value:function restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}},{key:"group",value:function group(t){this.save();this.executeOpTree(t);this.restore()}},{key:"loadDependencies",value:function loadDependencies(t){for(var r=this,a=t.fnArray,i=t.argsArray,l=0,u=a.length;l<u;l++)if(a[l]===o.OPS.dependency){var c,d=_createForOfIteratorHelper(i[l]);try{var h=function _loop(){var t=c.value,a=t.startsWith("g_")?r.commonObjs:r.objs,o=new Promise((function(r){a.get(t,r)}));r.current.dependencies.push(o)};for(d.s();!(c=d.n()).done;)h()}catch(t){d.e(t)}finally{d.f()}}return Promise.all(this.current.dependencies)}},{key:"transform",value:function transform(t,r,a,i,l,u){var c=[t,r,a,i,l,u];this.transformMatrix=o.Util.transform(this.transformMatrix,c);this.tgrp=null}},{key:"getSVG",value:function getSVG(t,r){var a=this;this.viewport=r;var i=this._initialize(r);return this.loadDependencies(t).then((function(){a.transformMatrix=o.IDENTITY_MATRIX;a.executeOpTree(a.convertOpList(t));return i}))}},{key:"convertOpList",value:function convertOpList(t){for(var r=this._operatorIdMapping,a=t.argsArray,o=t.fnArray,i=[],l=0,u=o.length;l<u;l++){var c=o[l];i.push({fnId:c,fn:r[c],args:a[l]})}return function opListToTree(t){var r,a=[],o=[],i=_createForOfIteratorHelper(t);try{for(i.s();!(r=i.n()).done;){var l=r.value;if("save"!==l.fn)"restore"===l.fn?a=o.pop():a.push(l);else{a.push({fnId:92,fn:"group",items:[]});o.push(a);a=a[a.length-1].items}}}catch(t){i.e(t)}finally{i.f()}return a}(i)}},{key:"executeOpTree",value:function executeOpTree(t){var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var i=r.value,l=i.fn,u=i.fnId,c=i.args;switch(0|u){case o.OPS.beginText:this.beginText();break;case o.OPS.dependency:break;case o.OPS.setLeading:this.setLeading(c);break;case o.OPS.setLeadingMoveText:this.setLeadingMoveText(c[0],c[1]);break;case o.OPS.setFont:this.setFont(c);break;case o.OPS.showText:case o.OPS.showSpacedText:this.showText(c[0]);break;case o.OPS.endText:this.endText();break;case o.OPS.moveText:this.moveText(c[0],c[1]);break;case o.OPS.setCharSpacing:this.setCharSpacing(c[0]);break;case o.OPS.setWordSpacing:this.setWordSpacing(c[0]);break;case o.OPS.setHScale:this.setHScale(c[0]);break;case o.OPS.setTextMatrix:this.setTextMatrix(c[0],c[1],c[2],c[3],c[4],c[5]);break;case o.OPS.setTextRise:this.setTextRise(c[0]);break;case o.OPS.setTextRenderingMode:this.setTextRenderingMode(c[0]);break;case o.OPS.setLineWidth:this.setLineWidth(c[0]);break;case o.OPS.setLineJoin:this.setLineJoin(c[0]);break;case o.OPS.setLineCap:this.setLineCap(c[0]);break;case o.OPS.setMiterLimit:this.setMiterLimit(c[0]);break;case o.OPS.setFillRGBColor:this.setFillRGBColor(c[0],c[1],c[2]);break;case o.OPS.setStrokeRGBColor:this.setStrokeRGBColor(c[0],c[1],c[2]);break;case o.OPS.setStrokeColorN:this.setStrokeColorN(c);break;case o.OPS.setFillColorN:this.setFillColorN(c);break;case o.OPS.shadingFill:this.shadingFill(c[0]);break;case o.OPS.setDash:this.setDash(c[0],c[1]);break;case o.OPS.setRenderingIntent:this.setRenderingIntent(c[0]);break;case o.OPS.setFlatness:this.setFlatness(c[0]);break;case o.OPS.setGState:this.setGState(c[0]);break;case o.OPS.fill:this.fill();break;case o.OPS.eoFill:this.eoFill();break;case o.OPS.stroke:this.stroke();break;case o.OPS.fillStroke:this.fillStroke();break;case o.OPS.eoFillStroke:this.eoFillStroke();break;case o.OPS.clip:this.clip("nonzero");break;case o.OPS.eoClip:this.clip("evenodd");break;case o.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case o.OPS.paintImageXObject:this.paintImageXObject(c[0]);break;case o.OPS.paintInlineImageXObject:this.paintInlineImageXObject(c[0]);break;case o.OPS.paintImageMaskXObject:this.paintImageMaskXObject(c[0]);break;case o.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(c[0],c[1]);break;case o.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case o.OPS.closePath:this.closePath();break;case o.OPS.closeStroke:this.closeStroke();break;case o.OPS.closeFillStroke:this.closeFillStroke();break;case o.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case o.OPS.nextLine:this.nextLine();break;case o.OPS.transform:this.transform(c[0],c[1],c[2],c[3],c[4],c[5]);break;case o.OPS.constructPath:this.constructPath(c[0],c[1]);break;case o.OPS.endPath:this.endPath();break;case 92:this.group(i.items);break;default:(0,o.warn)("Unimplemented operator ".concat(l))}}}catch(t){a.e(t)}finally{a.f()}}},{key:"setWordSpacing",value:function setWordSpacing(t){this.current.wordSpacing=t}},{key:"setCharSpacing",value:function setCharSpacing(t){this.current.charSpacing=t}},{key:"nextLine",value:function nextLine(){this.moveText(0,this.current.leading)}},{key:"setTextMatrix",value:function setTextMatrix(t,r,a,o,i,l){var u=this.current;u.textMatrix=u.lineMatrix=[t,r,a,o,i,l];u.textMatrixScale=Math.sqrt(t*t+r*r);u.x=u.lineX=0;u.y=u.lineY=0;u.xcoords=[];u.ycoords=[];u.tspan=this.svgFactory.createElement("svg:tspan");u.tspan.setAttributeNS(null,"font-family",u.fontFamily);u.tspan.setAttributeNS(null,"font-size","".concat(c(u.fontSize),"px"));u.tspan.setAttributeNS(null,"y",c(-u.y));u.txtElement=this.svgFactory.createElement("svg:text");u.txtElement.appendChild(u.tspan)}},{key:"beginText",value:function beginText(){var t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=o.IDENTITY_MATRIX;t.lineMatrix=o.IDENTITY_MATRIX;t.textMatrixScale=1;t.tspan=this.svgFactory.createElement("svg:tspan");t.txtElement=this.svgFactory.createElement("svg:text");t.txtgrp=this.svgFactory.createElement("svg:g");t.xcoords=[];t.ycoords=[]}},{key:"moveText",value:function moveText(t,r){var a=this.current;a.x=a.lineX+=t;a.y=a.lineY+=r;a.xcoords=[];a.ycoords=[];a.tspan=this.svgFactory.createElement("svg:tspan");a.tspan.setAttributeNS(null,"font-family",a.fontFamily);a.tspan.setAttributeNS(null,"font-size","".concat(c(a.fontSize),"px"));a.tspan.setAttributeNS(null,"y",c(-a.y))}},{key:"showText",value:function showText(t){var r=this.current,a=r.font,i=r.fontSize;if(0!==i){var l,u=r.fontSizeScale,p=r.charSpacing,m=r.wordSpacing,v=r.fontDirection,g=r.textHScale*v,y=a.vertical,b=y?1:-1,_=a.defaultVMetrics,S=i*r.fontMatrix[0],C=0,A=_createForOfIteratorHelper(t);try{for(A.s();!(l=A.n()).done;){var R=l.value;if(null!==R)if((0,o.isNum)(R))C+=b*R*i/1e3;else{var k=(R.isSpace?m:0)+p,P=R.fontChar,w=void 0,x=void 0,T=R.width;if(y){var E=void 0,O=R.vmetric||_;E=-(E=R.vmetric?O[1]:.5*T)*S;var I=O[2]*S;T=O?-O[0]:T;w=E/u;x=(C+I)/u}else{w=C/u;x=0}if(R.isInFont||a.missingFile){r.xcoords.push(r.x+w);y&&r.ycoords.push(-r.y+x);r.tspan.textContent+=P}C+=y?T*S-k*v:T*S+k*v}else C+=v*m}}catch(t){A.e(t)}finally{A.f()}r.tspan.setAttributeNS(null,"x",r.xcoords.map(c).join(" "));y?r.tspan.setAttributeNS(null,"y",r.ycoords.map(c).join(" ")):r.tspan.setAttributeNS(null,"y",c(-r.y));y?r.y-=C:r.x+=C*g;r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size","".concat(c(r.fontSize),"px"));r.fontStyle!==h.fontStyle&&r.tspan.setAttributeNS(null,"font-style",r.fontStyle);r.fontWeight!==h.fontWeight&&r.tspan.setAttributeNS(null,"font-weight",r.fontWeight);var D=r.textRenderingMode&o.TextRenderingMode.FILL_STROKE_MASK;if(D===o.TextRenderingMode.FILL||D===o.TextRenderingMode.FILL_STROKE){r.fillColor!==h.fillColor&&r.tspan.setAttributeNS(null,"fill",r.fillColor);r.fillAlpha<1&&r.tspan.setAttributeNS(null,"fill-opacity",r.fillAlpha)}else r.textRenderingMode===o.TextRenderingMode.ADD_TO_PATH?r.tspan.setAttributeNS(null,"fill","transparent"):r.tspan.setAttributeNS(null,"fill","none");if(D===o.TextRenderingMode.STROKE||D===o.TextRenderingMode.FILL_STROKE){var L=1/(r.textMatrixScale||1);this._setStrokeAttributes(r.tspan,L)}var M=r.textMatrix;0!==r.textRise&&((M=M.slice())[5]+=r.textRise);r.txtElement.setAttributeNS(null,"transform","".concat(d(M)," scale(").concat(c(g),", -1)"));r.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");r.txtElement.appendChild(r.tspan);r.txtgrp.appendChild(r.txtElement);this._ensureTransformGroup().appendChild(r.txtElement)}}},{key:"setLeadingMoveText",value:function setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)}},{key:"addFontStyle",value:function addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.appendChild(this.cssStyle)}var r=(0,o.createObjectURL)(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(t.loadedName,'";')+" src: url(".concat(r,"); }\n")}},{key:"setFont",value:function setFont(t){var r=this.current,a=this.commonObjs.get(t[0]),i=t[1];r.font=a;if(this.embedFonts&&!a.missingFile&&!this.embeddedFonts[a.loadedName]){this.addFontStyle(a);this.embeddedFonts[a.loadedName]=a}r.fontMatrix=a.fontMatrix||o.FONT_IDENTITY_MATRIX;var l="normal";a.black?l="900":a.bold&&(l="bold");var u=a.italic?"italic":"normal";if(i<0){i=-i;r.fontDirection=-1}else r.fontDirection=1;r.fontSize=i;r.fontFamily=a.loadedName;r.fontWeight=l;r.fontStyle=u;r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"y",c(-r.y));r.xcoords=[];r.ycoords=[]}},{key:"endText",value:function endText(){var t,r=this.current;if(r.textRenderingMode&o.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=r.txtElement)&&void 0!==t&&t.hasChildNodes()){r.element=r.txtElement;this.clip("nonzero");this.endPath()}}},{key:"setLineWidth",value:function setLineWidth(t){t>0&&(this.current.lineWidth=t)}},{key:"setLineCap",value:function setLineCap(t){this.current.lineCap=p[t]}},{key:"setLineJoin",value:function setLineJoin(t){this.current.lineJoin=m[t]}},{key:"setMiterLimit",value:function setMiterLimit(t){this.current.miterLimit=t}},{key:"setStrokeAlpha",value:function setStrokeAlpha(t){this.current.strokeAlpha=t}},{key:"setStrokeRGBColor",value:function setStrokeRGBColor(t,r,a){this.current.strokeColor=o.Util.makeHexColor(t,r,a)}},{key:"setFillAlpha",value:function setFillAlpha(t){this.current.fillAlpha=t}},{key:"setFillRGBColor",value:function setFillRGBColor(t,r,a){this.current.fillColor=o.Util.makeHexColor(t,r,a);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}},{key:"setStrokeColorN",value:function setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}},{key:"setFillColorN",value:function setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}},{key:"shadingFill",value:function shadingFill(t){var r=this.viewport.width,a=this.viewport.height,i=o.Util.inverseTransform(this.transformMatrix),l=o.Util.applyTransform([0,0],i),u=o.Util.applyTransform([0,a],i),c=o.Util.applyTransform([r,0],i),d=o.Util.applyTransform([r,a],i),h=Math.min(l[0],u[0],c[0],d[0]),p=Math.min(l[1],u[1],c[1],d[1]),m=Math.max(l[0],u[0],c[0],d[0]),v=Math.max(l[1],u[1],c[1],d[1]),g=this.svgFactory.createElement("svg:rect");g.setAttributeNS(null,"x",h);g.setAttributeNS(null,"y",p);g.setAttributeNS(null,"width",m-h);g.setAttributeNS(null,"height",v-p);g.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&g.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().appendChild(g)}},{key:"_makeColorN_Pattern",value:function _makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}},{key:"_makeTilingPattern",value:function _makeTilingPattern(t){var r=t[1],a=t[2],i=t[3]||o.IDENTITY_MATRIX,l=_slicedToArray(t[4],4),u=l[0],c=l[1],d=l[2],h=l[3],p=t[5],m=t[6],v=t[7],g="shading".concat(_++),y=_slicedToArray(o.Util.applyTransform([u,c],i),2),b=y[0],S=y[1],C=_slicedToArray(o.Util.applyTransform([d,h],i),2),A=C[0],R=C[1],k=_slicedToArray(o.Util.singularValueDecompose2dScale(i),2),P=p*k[0],w=m*k[1],x=this.svgFactory.createElement("svg:pattern");x.setAttributeNS(null,"id",g);x.setAttributeNS(null,"patternUnits","userSpaceOnUse");x.setAttributeNS(null,"width",P);x.setAttributeNS(null,"height",w);x.setAttributeNS(null,"x","".concat(b));x.setAttributeNS(null,"y","".concat(S));var T=this.svg,E=this.transformMatrix,O=this.current.fillColor,I=this.current.strokeColor,D=this.svgFactory.create(A-b,R-S);this.svg=D;this.transformMatrix=i;if(2===v){var L=o.Util.makeHexColor.apply(o.Util,_toConsumableArray(r));this.current.fillColor=L;this.current.strokeColor=L}this.executeOpTree(this.convertOpList(a));this.svg=T;this.transformMatrix=E;this.current.fillColor=O;this.current.strokeColor=I;x.appendChild(D.childNodes[0]);this.defs.appendChild(x);return"url(#".concat(g,")")}},{key:"_makeShadingPattern",value:function _makeShadingPattern(t){switch(t[0]){case"RadialAxial":var r,a="shading".concat(_++),i=t[3];switch(t[1]){case"axial":var l=t[4],u=t[5];(r=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",a);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"x1",l[0]);r.setAttributeNS(null,"y1",l[1]);r.setAttributeNS(null,"x2",u[0]);r.setAttributeNS(null,"y2",u[1]);break;case"radial":var c=t[4],d=t[5],h=t[6],p=t[7];(r=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",a);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"cx",d[0]);r.setAttributeNS(null,"cy",d[1]);r.setAttributeNS(null,"r",p);r.setAttributeNS(null,"fx",c[0]);r.setAttributeNS(null,"fy",c[1]);r.setAttributeNS(null,"fr",h);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}var m,v=_createForOfIteratorHelper(i);try{for(v.s();!(m=v.n()).done;){var g=m.value,y=this.svgFactory.createElement("svg:stop");y.setAttributeNS(null,"offset",g[0]);y.setAttributeNS(null,"stop-color",g[1]);r.appendChild(y)}}catch(t){v.e(t)}finally{v.f()}this.defs.appendChild(r);return"url(#".concat(a,")");case"Mesh":(0,o.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}},{key:"setDash",value:function setDash(t,r){this.current.dashArray=t;this.current.dashPhase=r}},{key:"constructPath",value:function constructPath(t,r){var a,i=this.current,l=i.x,u=i.y,d=[],h=0,p=_createForOfIteratorHelper(t);try{for(p.s();!(a=p.n()).done;){switch(0|a.value){case o.OPS.rectangle:l=r[h++];u=r[h++];var m=r[h++],v=r[h++],g=l+m,y=u+v;d.push("M",c(l),c(u),"L",c(g),c(u),"L",c(g),c(y),"L",c(l),c(y),"Z");break;case o.OPS.moveTo:l=r[h++];u=r[h++];d.push("M",c(l),c(u));break;case o.OPS.lineTo:l=r[h++];u=r[h++];d.push("L",c(l),c(u));break;case o.OPS.curveTo:l=r[h+4];u=r[h+5];d.push("C",c(r[h]),c(r[h+1]),c(r[h+2]),c(r[h+3]),c(l),c(u));h+=6;break;case o.OPS.curveTo2:d.push("C",c(l),c(u),c(r[h]),c(r[h+1]),c(r[h+2]),c(r[h+3]));l=r[h+2];u=r[h+3];h+=4;break;case o.OPS.curveTo3:l=r[h+2];u=r[h+3];d.push("C",c(r[h]),c(r[h+1]),c(l),c(u),c(l),c(u));h+=4;break;case o.OPS.closePath:d.push("Z")}}}catch(t){p.e(t)}finally{p.f()}d=d.join(" ");if(i.path&&t.length>0&&t[0]!==o.OPS.rectangle&&t[0]!==o.OPS.moveTo)d=i.path.getAttributeNS(null,"d")+d;else{i.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().appendChild(i.path)}i.path.setAttributeNS(null,"d",d);i.path.setAttributeNS(null,"fill","none");i.element=i.path;i.setCurrentPoint(l,u)}},{key:"endPath",value:function endPath(){var t=this.current;t.path=null;if(this.pendingClip)if(t.element){var r="clippath".concat(y++),a=this.svgFactory.createElement("svg:clipPath");a.setAttributeNS(null,"id",r);a.setAttributeNS(null,"transform",d(this.transformMatrix));var o=t.element.cloneNode(!0);"evenodd"===this.pendingClip?o.setAttributeNS(null,"clip-rule","evenodd"):o.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;a.appendChild(o);this.defs.appendChild(a);if(t.activeClipUrl){t.clipGroup=null;this.extraStack.forEach((function(t){t.clipGroup=null}));a.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl="url(#".concat(r,")");this.tgrp=null}else this.pendingClip=null}},{key:"clip",value:function clip(t){this.pendingClip=t}},{key:"closePath",value:function closePath(){var t=this.current;if(t.path){var r="".concat(t.path.getAttributeNS(null,"d"),"Z");t.path.setAttributeNS(null,"d",r)}}},{key:"setLeading",value:function setLeading(t){this.current.leading=-t}},{key:"setTextRise",value:function setTextRise(t){this.current.textRise=t}},{key:"setTextRenderingMode",value:function setTextRenderingMode(t){this.current.textRenderingMode=t}},{key:"setHScale",value:function setHScale(t){this.current.textHScale=t/100}},{key:"setRenderingIntent",value:function setRenderingIntent(t){}},{key:"setFlatness",value:function setFlatness(t){}},{key:"setGState",value:function setGState(t){var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var i=_slicedToArray(r.value,2),l=i[0],u=i[1];switch(l){case"LW":this.setLineWidth(u);break;case"LC":this.setLineCap(u);break;case"LJ":this.setLineJoin(u);break;case"ML":this.setMiterLimit(u);break;case"D":this.setDash(u[0],u[1]);break;case"RI":this.setRenderingIntent(u);break;case"FL":this.setFlatness(u);break;case"Font":this.setFont(u);break;case"CA":this.setStrokeAlpha(u);break;case"ca":this.setFillAlpha(u);break;default:(0,o.warn)("Unimplemented graphic state operator ".concat(l))}}}catch(t){a.e(t)}finally{a.f()}}},{key:"fill",value:function fill(){var t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}},{key:"stroke",value:function stroke(){var t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}},{key:"_setStrokeAttributes",value:function _setStrokeAttributes(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=this.current,o=a.dashArray;1!==r&&o.length>0&&(o=o.map((function(t){return r*t})));t.setAttributeNS(null,"stroke",a.strokeColor);t.setAttributeNS(null,"stroke-opacity",a.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",c(a.miterLimit));t.setAttributeNS(null,"stroke-linecap",a.lineCap);t.setAttributeNS(null,"stroke-linejoin",a.lineJoin);t.setAttributeNS(null,"stroke-width",c(r*a.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",o.map(c).join(" "));t.setAttributeNS(null,"stroke-dashoffset",c(r*a.dashPhase)+"px")}},{key:"eoFill",value:function eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fill()}},{key:"fillStroke",value:function fillStroke(){this.stroke();this.fill()}},{key:"eoFillStroke",value:function eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}},{key:"closeStroke",value:function closeStroke(){this.closePath();this.stroke()}},{key:"closeFillStroke",value:function closeFillStroke(){this.closePath();this.fillStroke()}},{key:"closeEOFillStroke",value:function closeEOFillStroke(){this.closePath();this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function paintSolidColorImageMask(){var t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().appendChild(t)}},{key:"paintImageXObject",value:function paintImageXObject(t){var r=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);r?this.paintInlineImageXObject(r):(0,o.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}},{key:"paintInlineImageXObject",value:function paintInlineImageXObject(t,r){var a=t.width,o=t.height,i=v(t,this.forceDataSchema,!!r),l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",c(a));l.setAttributeNS(null,"height",c(o));this.current.element=l;this.clip("nonzero");var u=this.svgFactory.createElement("svg:image");u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);u.setAttributeNS(null,"x","0");u.setAttributeNS(null,"y",c(-o));u.setAttributeNS(null,"width",c(a)+"px");u.setAttributeNS(null,"height",c(o)+"px");u.setAttributeNS(null,"transform","scale(".concat(c(1/a)," ").concat(c(-1/o),")"));r?r.appendChild(u):this._ensureTransformGroup().appendChild(u)}},{key:"paintImageMaskXObject",value:function paintImageMaskXObject(t){var r=this.current,a=t.width,o=t.height,i=r.fillColor;r.maskId="mask".concat(b++);var l=this.svgFactory.createElement("svg:mask");l.setAttributeNS(null,"id",r.maskId);var u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x","0");u.setAttributeNS(null,"y","0");u.setAttributeNS(null,"width",c(a));u.setAttributeNS(null,"height",c(o));u.setAttributeNS(null,"fill",i);u.setAttributeNS(null,"mask","url(#".concat(r.maskId,")"));this.defs.appendChild(l);this._ensureTransformGroup().appendChild(u);this.paintInlineImageXObject(t,l)}},{key:"paintFormXObjectBegin",value:function paintFormXObjectBegin(t,r){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(r){var a=r[2]-r[0],o=r[3]-r[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",r[0]);i.setAttributeNS(null,"y",r[1]);i.setAttributeNS(null,"width",c(a));i.setAttributeNS(null,"height",c(o));this.current.element=i;this.clip("nonzero");this.endPath()}}},{key:"paintFormXObjectEnd",value:function paintFormXObjectEnd(){}},{key:"_initialize",value:function _initialize(t){var r=this.svgFactory.create(t.width,t.height),a=this.svgFactory.createElement("svg:defs");r.appendChild(a);this.defs=a;var o=this.svgFactory.createElement("svg:g");o.setAttributeNS(null,"transform",d(t.transform));r.appendChild(o);this.svg=o;return r}},{key:"_ensureClipGroup",value:function _ensureClipGroup(){if(!this.current.clipGroup){var t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.appendChild(t);this.current.clipGroup=t}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function _ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",d(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)}return this.tgrp}}]);return SVGGraphics}()},(t,r,a)=>{"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(r,"__esModule",{value:!0});r.PDFNodeStream=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4),l=a(154);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t})(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,o=_getPrototypeOf(t);if(r){var i=_getPrototypeOf(this).constructor;a=Reflect.construct(o,arguments,i)}else a=o.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){return!r||"object"!==_typeof(r)&&"function"!=typeof r?function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):r}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var u=require("fs"),c=require("http"),d=require("https"),h=require("url"),p=/^file:\/\/\/[a-zA-Z]:\//;var m=function(){function PDFNodeStream(t){_classCallCheck(this,PDFNodeStream);this.source=t;this.url=function parseUrl(t){var r=h.parse(t);if("file:"===r.protocol||r.host)return r;if(/^[a-z]:[/\\]/i.test(t))return h.parse("file:///".concat(t));r.host||(r.protocol="file:");return r}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFNodeStream,[{key:"getFullReader",value:function getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new _(this):new y(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=this.isFsUrl?new S(this,t,r):new b(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);this._rangeRequestReaders.slice(0).forEach((function(r){r.cancel(t)}))}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}}]);return PDFNodeStream}();r.PDFNodeStream=m;var v=function(){function BaseFullReader(t){_classCallCheck(this,BaseFullReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;var r=t.source;this._contentLength=r.length;this._loaded=0;this._filename=null;this._disableRange=r.disableRange||!1;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!r.disableStream;this._isRangeSupported=!r.disableRange;this._readableStream=null;this._readCapability=(0,i.createPromiseCapability)();this._headersCapability=(0,i.createPromiseCapability)()}_createClass(BaseFullReader,[{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee(){var t,r;return o.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:a.next=2;return this._readCapability.promise;case 2:if(!this._done){a.next=4;break}return a.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){a.next=6;break}throw this._storedError;case 6:if(null!==(t=this._readableStream.read())){a.next=10;break}this._readCapability=(0,i.createPromiseCapability)();return a.abrupt("return",this.read());case 10:this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});r=new Uint8Array(t).buffer;return a.abrupt("return",{value:r,done:!1});case 14:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}},{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}}]);var t;return BaseFullReader}(),g=function(){function BaseRangeReader(t){_classCallCheck(this,BaseRangeReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,i.createPromiseCapability)();var r=t.source;this._isStreamingSupported=!r.disableStream}_createClass(BaseRangeReader,[{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee2(){var t,r;return o.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:a.next=2;return this._readCapability.promise;case 2:if(!this._done){a.next=4;break}return a.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){a.next=6;break}throw this._storedError;case 6:if(null!==(t=this._readableStream.read())){a.next=10;break}this._readCapability=(0,i.createPromiseCapability)();return a.abrupt("return",this.read());case 10:this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded});r=new Uint8Array(t).buffer;return a.abrupt("return",{value:r,done:!1});case 14:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}}]);var t;return BaseRangeReader}();function createRequestOptions(t,r){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:r}}var y=function(t){_inherits(PDFNodeStreamFullReader,t);var r=_createSuper(PDFNodeStreamFullReader);function PDFNodeStreamFullReader(t){var a;_classCallCheck(this,PDFNodeStreamFullReader);var o=function handleResponse(r){if(404!==r.statusCode){a._headersCapability.resolve();a._setReadableStream(r);var o=function getResponseHeader(t){return a._readableStream.headers[t.toLowerCase()]},u=(0,l.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:t.isHttp,rangeChunkSize:a._rangeChunkSize,disableRange:a._disableRange}),c=u.allowRangeRequests,d=u.suggestedLength;a._isRangeSupported=c;a._contentLength=d||a._contentLength;a._filename=(0,l.extractFilenameFromHeader)(o)}else{var h=new i.MissingPDFException('Missing PDF "'.concat(a._url,'".'));a._storedError=h;a._headersCapability.reject(h)}};(a=r.call(this,t))._request=null;"http:"===a._url.protocol?a._request=c.request(createRequestOptions(a._url,t.httpHeaders),o):a._request=d.request(createRequestOptions(a._url,t.httpHeaders),o);a._request.on("error",(function(t){a._storedError=t;a._headersCapability.reject(t)}));a._request.end();return a}return PDFNodeStreamFullReader}(v),b=function(t){_inherits(PDFNodeStreamRangeReader,t);var r=_createSuper(PDFNodeStreamRangeReader);function PDFNodeStreamRangeReader(t,a,o){var l;_classCallCheck(this,PDFNodeStreamRangeReader);(l=r.call(this,t))._httpHeaders={};for(var u in t.httpHeaders){var h=t.httpHeaders[u];void 0!==h&&(l._httpHeaders[u]=h)}l._httpHeaders.Range="bytes=".concat(a,"-").concat(o-1);var p=function handleResponse(t){if(404!==t.statusCode)l._setReadableStream(t);else{var r=new i.MissingPDFException('Missing PDF "'.concat(l._url,'".'));l._storedError=r}};l._request=null;"http:"===l._url.protocol?l._request=c.request(createRequestOptions(l._url,l._httpHeaders),p):l._request=d.request(createRequestOptions(l._url,l._httpHeaders),p);l._request.on("error",(function(t){l._storedError=t}));l._request.end();return l}return PDFNodeStreamRangeReader}(g),_=function(t){_inherits(PDFNodeStreamFsFullReader,t);var r=_createSuper(PDFNodeStreamFsFullReader);function PDFNodeStreamFsFullReader(t){var a;_classCallCheck(this,PDFNodeStreamFsFullReader);a=r.call(this,t);var o=decodeURIComponent(a._url.path);p.test(a._url.href)&&(o=o.replace(/^\//,""));u.lstat(o,(function(t,r){if(t){"ENOENT"===t.code&&(t=new i.MissingPDFException('Missing PDF "'.concat(o,'".')));a._storedError=t;a._headersCapability.reject(t)}else{a._contentLength=r.size;a._setReadableStream(u.createReadStream(o));a._headersCapability.resolve()}}));return a}return PDFNodeStreamFsFullReader}(v),S=function(t){_inherits(PDFNodeStreamFsRangeReader,t);var r=_createSuper(PDFNodeStreamFsRangeReader);function PDFNodeStreamFsRangeReader(t,a,o){var i;_classCallCheck(this,PDFNodeStreamFsRangeReader);i=r.call(this,t);var l=decodeURIComponent(i._url.path);p.test(i._url.href)&&(l=l.replace(/^\//,""));i._setReadableStream(u.createReadStream(l,{start:a,end:o-1}));return i}return PDFNodeStreamFsRangeReader}(g)},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.createResponseStatusError=function createResponseStatusError(t,r){if(404===t||0===t&&r.startsWith("file:"))return new o.MissingPDFException('Missing PDF "'+r+'".');return new o.UnexpectedResponseException("Unexpected server response ("+t+') while retrieving PDF "'+r+'".',t)};r.extractFilenameFromHeader=function extractFilenameFromHeader(t){var r=t("Content-Disposition");if(r){var a=(0,i.getFilenameFromContentDispositionHeader)(r);if(a.includes("%"))try{a=decodeURIComponent(a)}catch(t){}if(/\.pdf$/i.test(a))return a}return null};r.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){var r=t.getResponseHeader,a=t.isHttp,i=t.rangeChunkSize,l=t.disableRange;(0,o.assert)(i>0,"Range chunk size must be larger than zero");var u={allowRangeRequests:!1,suggestedLength:void 0},c=parseInt(r("Content-Length"),10);if(!Number.isInteger(c))return u;u.suggestedLength=c;if(c<=2*i)return u;if(l||!a)return u;if("bytes"!==r("Accept-Ranges"))return u;if("identity"!==(r("Content-Encoding")||"identity"))return u;u.allowRangeRequests=!0;return u};r.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var o=a(4),i=a(155)},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){var r=!0,a=toParamRegExp("filename\\*","i").exec(t);if(a){var o=rfc2616unquote(a=a[1]);return fixupEncoding(o=rfc2047decode(o=rfc5987decode(o=unescape(o))))}if(a=function rfc2231getparam(t){var r,a=[],o=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=o.exec(t));){var i=_slicedToArray(r,4),l=i[1],u=i[2],c=i[3];if((l=parseInt(l,10))in a){if(0===l)break}else a[l]=[u,c]}for(var d=[],h=0;h<a.length&&h in a;++h){var p=_slicedToArray(a[h],2),m=p[0],v=p[1];v=rfc2616unquote(v);if(m){v=unescape(v);0===h&&(v=rfc5987decode(v))}d.push(v)}return d.join("")}(t)){return fixupEncoding(rfc2047decode(a))}if(a=toParamRegExp("filename","i").exec(t)){var i=rfc2616unquote(a=a[1]);return fixupEncoding(i=rfc2047decode(i))}function toParamRegExp(t,r){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',r)}function textdecode(t,a){if(t){if(!/^[\x00-\xFF]+$/.test(a))return a;try{var o=new TextDecoder(t,{fatal:!0}),i=Array.from(a,(function(t){return 255&t.charCodeAt(0)}));a=o.decode(new Uint8Array(i));r=!1}catch(o){if(/^utf-?8$/i.test(t))try{a=decodeURIComponent(escape(a));r=!1}catch(t){}}}return a}function fixupEncoding(t){if(r&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);r&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){for(var r=t.slice(1).split('\\"'),a=0;a<r.length;++a){var o=r[a].indexOf('"');if(-1!==o){r[a]=r[a].slice(0,o);r.length=a+1}r[a]=r[a].replace(/\\(.)/g,"$1")}t=r.join('"')}return t}function rfc5987decode(t){var r=t.indexOf("'");return-1===r?t:textdecode(t.slice(0,r),t.slice(r+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,r,a,o){if("q"===a||"Q"===a)return textdecode(r,o=(o=o.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})));try{o=atob(o)}catch(t){}return textdecode(r,o)}))}return""};function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var a=[],o=!0,i=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){a.push(u.value);if(r&&a.length===r)break}}catch(t){i=!0;l=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw l}}return a}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,o=new Array(r);a<r;a++)o[a]=t[a];return o}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFNetworkStream=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4),l=a(154);function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}var u=function(){function NetworkManager(t,r){_classCallCheck(this,NetworkManager);this.url=t;r=r||{};this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&r.httpHeaders||{};this.withCredentials=r.withCredentials||!1;this.getXhr=r.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}_createClass(NetworkManager,[{key:"requestRange",value:function requestRange(t,r,a){var o={begin:t,end:r};for(var i in a)o[i]=a[i];return this.request(o)}},{key:"requestFull",value:function requestFull(t){return this.request(t)}},{key:"request",value:function request(t){var r=this.getXhr(),a=this.currXhrId++,o=this.pendingRequests[a]={xhr:r};r.open("GET",this.url);r.withCredentials=this.withCredentials;for(var i in this.httpHeaders){var l=this.httpHeaders[i];void 0!==l&&r.setRequestHeader(i,l)}if(this.isHttp&&"begin"in t&&"end"in t){r.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1));o.expectedStatus=206}else o.expectedStatus=200;r.responseType="arraybuffer";t.onError&&(r.onerror=function(a){t.onError(r.status)});r.onreadystatechange=this.onStateChange.bind(this,a);r.onprogress=this.onProgress.bind(this,a);o.onHeadersReceived=t.onHeadersReceived;o.onDone=t.onDone;o.onError=t.onError;o.onProgress=t.onProgress;r.send(null);return a}},{key:"onProgress",value:function onProgress(t,r){var a=this.pendingRequests[t];a&&a.onProgress&&a.onProgress(r)}},{key:"onStateChange",value:function onStateChange(t,r){var a=this.pendingRequests[t];if(a){var o=a.xhr;if(o.readyState>=2&&a.onHeadersReceived){a.onHeadersReceived();delete a.onHeadersReceived}if(4===o.readyState&&t in this.pendingRequests){delete this.pendingRequests[t];if(0===o.status&&this.isHttp)a.onError&&a.onError(o.status);else{var l=o.status||200;if(200===l&&206===a.expectedStatus||l===a.expectedStatus){var u=function getArrayBuffer(t){var r=t.response;return"string"!=typeof r?r:(0,i.stringToBytes)(r).buffer}(o);if(206===l){var c=o.getResponseHeader("Content-Range"),d=/bytes (\d+)-(\d+)\/(\d+)/.exec(c);a.onDone({begin:parseInt(d[1],10),chunk:u})}else u?a.onDone({begin:0,chunk:u}):a.onError&&a.onError(o.status)}else a.onError&&a.onError(o.status)}}}}},{key:"getRequestXhr",value:function getRequestXhr(t){return this.pendingRequests[t].xhr}},{key:"isPendingRequest",value:function isPendingRequest(t){return t in this.pendingRequests}},{key:"abortRequest",value:function abortRequest(t){var r=this.pendingRequests[t].xhr;delete this.pendingRequests[t];r.abort()}}]);return NetworkManager}(),c=function(){function PDFNetworkStream(t){_classCallCheck(this,PDFNetworkStream);this._source=t;this._manager=new u(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFNetworkStream,[{key:"_onRangeRequestReaderClosed",value:function _onRangeRequestReaderClosed(t){var r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new d(this._manager,this._source);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){var a=new h(this._manager,t,r);a.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);this._rangeRequestReaders.slice(0).forEach((function(r){r.cancel(t)}))}}]);return PDFNetworkStream}();r.PDFNetworkStream=c;var d=function(){function PDFNetworkStreamFullRequestReader(t,r){_classCallCheck(this,PDFNetworkStreamFullRequestReader);this._manager=t;var a={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url;this._fullRequestId=t.requestFull(a);this._headersReceivedCapability=(0,i.createPromiseCapability)();this._disableRange=r.disableRange||!1;this._contentLength=r.length;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_createClass(PDFNetworkStreamFullRequestReader,[{key:"_onHeadersReceived",value:function _onHeadersReceived(){var t=this._fullRequestId,r=this._manager.getRequestXhr(t),a=function getResponseHeader(t){return r.getResponseHeader(t)},o=(0,l.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),i=o.allowRangeRequests,u=o.suggestedLength;i&&(this._isRangeSupported=!0);this._contentLength=u||this._contentLength;this._filename=(0,l.extractFilenameFromHeader)(a);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function _onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[]}}},{key:"_onError",value:function _onError(t){var r=this._url,a=(0,l.createResponseStatusError)(t,r);this._storedError=a;this._headersReceivedCapability.reject(a);this._requests.forEach((function(t){t.reject(a)}));this._requests=[];this._cachedChunks=[]}},{key:"_onProgress",value:function _onProgress(t){this.onProgress&&this.onProgress({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee(){var t,r;return o.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){a.next=5;break}t=this._cachedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 5:if(!this._done){a.next=7;break}return a.abrupt("return",{value:void 0,done:!0});case 7:r=(0,i.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 10:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[];this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"headersReady",get:function get(){return this._headersReceivedCapability.promise}}]);var t;return PDFNetworkStreamFullRequestReader}(),h=function(){function PDFNetworkStreamRangeRequestReader(t,r,a){_classCallCheck(this,PDFNetworkStreamRangeRequestReader);this._manager=t;var o={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=t.requestRange(r,a,o);this._requests=[];this._queuedChunk=null;this._done=!1;this.onProgress=null;this.onClosed=null}_createClass(PDFNetworkStreamRangeRequestReader,[{key:"_close",value:function _close(){this.onClosed&&this.onClosed(this)}},{key:"_onDone",value:function _onDone(t){var r=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:r,done:!1})}else this._queuedChunk=r;this._done=!0;this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[];this._close()}},{key:"_onProgress",value:function _onProgress(t){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:t.loaded})}},{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee2(){var t,r;return o.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(null===this._queuedChunk){a.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 4:if(!this._done){a.next=6;break}return a.abrupt("return",{value:void 0,done:!0});case 6:r=(0,i.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 9:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})}));this._requests=[];this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}},{key:"isStreamingSupported",get:function get(){return!1}}]);var t;return PDFNetworkStreamRangeRequestReader}()},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFFetchStream=void 0;var o=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(2)),i=a(4),l=a(154);function asyncGeneratorStep(t,r,a,o,i,l,u){try{var c=t[l](u),d=c.value}catch(t){a(t);return}c.done?r(d):Promise.resolve(d).then(o,i)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(o,i){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,o,i,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,i,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var o=r[a];o.enumerable=o.enumerable||!1;o.configurable=!0;"value"in o&&(o.writable=!0);Object.defineProperty(t,o.key,o)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);return t}function createFetchOptions(t,r,a){return{method:"GET",headers:t,signal:null==a?void 0:a.signal,mode:"cors",credentials:r?"include":"same-origin",redirect:"follow"}}function createHeaders(t){var r=new Headers;for(var a in t){var o=t[a];void 0!==o&&r.append(a,o)}return r}var u=function(){function PDFFetchStream(t){_classCallCheck(this,PDFFetchStream);this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFFetchStream,[{key:"getFullReader",value:function getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new c(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new d(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);this._rangeRequestReaders.slice(0).forEach((function(r){r.cancel(t)}))}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}}]);return PDFFetchStream}();r.PDFFetchStream=u;var c=function(){function PDFFetchStreamReader(t){var r=this;_classCallCheck(this,PDFFetchStreamReader);this._stream=t;this._reader=null;this._loaded=0;this._filename=null;var a=t.source;this._withCredentials=a.withCredentials||!1;this._contentLength=a.length;this._headersCapability=(0,i.createPromiseCapability)();this._disableRange=a.disableRange||!1;this._rangeChunkSize=a.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._isStreamingSupported=!a.disableStream;this._isRangeSupported=!a.disableRange;this._headers=createHeaders(this._stream.httpHeaders);var o=a.url;fetch(o,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,l.validateResponseStatus)(t.status))throw(0,l.createResponseStatusError)(t.status,o);r._reader=t.body.getReader();r._headersCapability.resolve();var a=function getResponseHeader(r){return t.headers.get(r)},u=(0,l.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:r._stream.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),c=u.allowRangeRequests,d=u.suggestedLength;r._isRangeSupported=c;r._contentLength=d||r._contentLength;r._filename=(0,l.extractFilenameFromHeader)(a);!r._isStreamingSupported&&r._isRangeSupported&&r.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}_createClass(PDFFetchStreamReader,[{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee(){var t,r,a,i;return o.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._headersCapability.promise;case 2:o.next=4;return this._reader.read();case 4:t=o.sent;r=t.value;if(!(a=t.done)){o.next=9;break}return o.abrupt("return",{value:r,done:a});case 9:this._loaded+=r.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});i=new Uint8Array(r).buffer;return o.abrupt("return",{value:i,done:!1});case 13:case"end":return o.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}},{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}}]);var t;return PDFFetchStreamReader}(),d=function(){function PDFFetchStreamRangeReader(t,r,a){var o=this;_classCallCheck(this,PDFFetchStreamRangeReader);this._stream=t;this._reader=null;this._loaded=0;var u=t.source;this._withCredentials=u.withCredentials||!1;this._readCapability=(0,i.createPromiseCapability)();this._isStreamingSupported=!u.disableStream;"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(r,"-").concat(a-1));var c=u.url;fetch(c,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,l.validateResponseStatus)(t.status))throw(0,l.createResponseStatusError)(t.status,c);o._readCapability.resolve();o._reader=t.body.getReader()})).catch((function(t){if("AbortError"!==(null==t?void 0:t.name))throw t}));this.onProgress=null}_createClass(PDFFetchStreamRangeReader,[{key:"read",value:(t=_asyncToGenerator(o.default.mark((function _callee2(){var t,r,a,i;return o.default.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._readCapability.promise;case 2:o.next=4;return this._reader.read();case 4:t=o.sent;r=t.value;if(!(a=t.done)){o.next=9;break}return o.abrupt("return",{value:r,done:a});case 9:this._loaded+=r.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded});i=new Uint8Array(r).buffer;return o.abrupt("return",{value:i,done:!1});case 13:case"end":return o.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}}]);var t;return PDFFetchStreamRangeReader}()}],__webpack_module_cache__={};function __w_pdfjs_require__(t){if(__webpack_module_cache__[t])return __webpack_module_cache__[t].exports;var r=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};__webpack_modules__[t].call(r.exports,r,r.exports,__w_pdfjs_require__);r.loaded=!0;return r.exports}__w_pdfjs_require__.nmd=t=>{t.paths=[];t.children||(t.children=[]);return t};return __w_pdfjs_require__(0)})()}));