text: /*! For license information please see 87392.b32b32d2650f7cc681c9.chunk.js.LICENSE.txt */
  (self.webpackChunkgeonode_mapstore_client=self.webpackChunkgeonode_mapstore_client||[]).push([[87392,31351],{967228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},222858:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},823646:(e,t,r)=>{var n=r(967228);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},281506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},348926:e=>{function t(e,t,r,n,s,a,i){try{var o=e[a](i),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,s)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(s,a){var i=e.apply(r,n);function o(e){t(i,s,a,o,l,"next",e)}function l(e){t(i,s,a,o,l,"throw",e)}o(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},334575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},993913:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},859713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},629754:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},502205:(e,t,r)=>{var n=r(799489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},820862:(e,t,r)=>{var n=r(750008).default;function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var a={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=i?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(a,o,l):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a},e.exports.__esModule=!0,e.exports.default=e.exports},246860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},713884:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,a=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){o=!0,s=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw s}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},580521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},398206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},506479:(e,t,r)=>{var n=r(337316);e.exports=function(e,t){if(null==e)return{};var r,s,a=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},337316:e=>{e.exports=function(e,t){if(null==e)return{};var r,n,s={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(s[r]=e[r]);return s},e.exports.__esModule=!0,e.exports.default=e.exports},178585:(e,t,r)=>{var n=r(750008).default,s=r(281506);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)},e.exports.__esModule=!0,e.exports.default=e.exports},799489:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},963038:(e,t,r)=>{var n=r(222858),s=r(713884),a=r(560379),i=r(580521);e.exports=function(e,t){return n(e)||s(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},319:(e,t,r)=>{var n=r(823646),s=r(246860),a=r(560379),i=r(398206);e.exports=function(e){return n(e)||s(e)||a(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},750008:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},560379:(e,t,r)=>{var n=r(967228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},887757:(e,t,r)=>{e.exports=r(535666)},531351:e=>{var t=Array.prototype.reverse;e.exports=function(e){return null==e?e:t.call(e)}},8094:(e,t,r)=>{"use strict";function n(e){var t=!1,r=new Promise((function(r,n){e.then((function(){return!t&&r.apply(void 0,arguments)})).catch((function(e){return!t&&n(e)}))}));return{promise:r,cancel:function(){t=!0}}}r.r(t),r.d(t,{default:()=>n})},684845:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clipboardEvents:()=>n,compositionEvents:()=>s,keyboardEvents:()=>a,focusEvents:()=>i,formEvents:()=>o,genericEvents:()=>l,mouseEvents:()=>c,pointerEvents:()=>u,selectionEvents:()=>d,touchEvents:()=>h,uiEvents:()=>p,wheelEvents:()=>f,mediaEvents:()=>g,imageEvents:()=>m,animationEvents:()=>v,transitionEvents:()=>b,otherEvents:()=>y,allEvents:()=>A,default:()=>_});var n=["onCopy","onCut","onPaste"],s=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],a=["onKeyDown","onKeyPress","onKeyUp"],i=["onFocus","onBlur"],o=["onChange","onInput","onInvalid","onReset","onSubmit"],l=["onError","onLoad"],c=["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],u=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],d=["onSelect"],h=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],p=["onScroll"],f=["onWheel"],g=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],m=["onLoad","onError"],v=["onAnimationStart","onAnimationEnd","onAnimationIteration"],b=["onTransitionEnd"],y=["onToggle"],A=[].concat(n,s,a,i,o,l,c,u,d,h,p,f,g,m,v,b,y);const _=function(e,t){var r={};return A.forEach((function(n){n in e&&(r[n]=t?function(r){return e[n](r,t(n))}:e[n])})),r}},289624:(e,t,r)=>{"use strict";function n(){return Array.prototype.slice.call(arguments).reduce((function(e,t){return e.concat(t)}),[]).filter((function(e){return"string"==typeof e})).join(" ")}r.r(t),r.d(t,{default:()=>n})},512324:(e,t,r)=>{"use strict";function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.filter(Boolean);return n.length<=1?n[0]:function(e){n.forEach((function(t){"function"==typeof t?t(e):t.current=e}))}}r.r(t),r.d(t,{default:()=>n})},299299:function(module,__unused_webpack_exports,__webpack_require__){var Buffer=__webpack_require__(348764).Buffer,factory;factory=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLinkAttributes",{enumerable:!0,get:function(){return n.addLinkAttributes}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return n.getFilenameFromUrl}}),Object.defineProperty(t,"LinkTarget",{enumerable:!0,get:function(){return n.LinkTarget}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return n.loadScript}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return n.PDFDateString}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return n.RenderingCancelledException}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return s.LoopbackPort}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return a.CMapCompressionType}}),Object.defineProperty(t,"createObjectURL",{enumerable:!0,get:function(){return a.createObjectURL}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return a.createPromiseCapability}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return a.createValidAbsoluteUrl}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return a.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return a.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return a.OPS}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return a.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return a.PermissionFlag}}),Object.defineProperty(t,"removeNullCharacters",{enumerable:!0,get:function(){return a.removeNullCharacters}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return a.shadow}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return a.UnexpectedResponseException}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return a.UNSUPPORTED_FEATURES}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return a.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return a.VerbosityLevel}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return i.AnnotationLayer}}),Object.defineProperty(t,"apiCompatibilityParams",{enumerable:!0,get:function(){return o.apiCompatibilityParams}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}});var n=r(1),s=r(5),a=r(2),i=r(16),o=r(7),l=r(10),c=r(17),u=r(18);{const{isNodeJS:e}=r(4);if(e){const e=r(19).PDFNodeStream;(0,s.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const e=r(22).PDFNetworkStream;let t;(0,n.isFetchSupported)()&&(t=r(23).PDFFetchStream),(0,s.setPDFNetworkStreamFactory)((r=>t&&(0,n.isValidFetchUrl)(r.url)?new t(r):new e(r)))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLinkAttributes=function(e,{url:t,target:r,rel:a,enabled:i=!0}={}){(0,n.assert)(t&&"string"==typeof t,'addLinkAttributes: A valid "url" parameter must provided.');const o=(0,n.removeNullCharacters)(t);i?e.href=e.title=o:(e.href="",e.title=`Disabled: ${o}`,e.onclick=()=>!1);let c="";switch(r){case l.NONE:break;case l.SELF:c="_self";break;case l.BLANK:c="_blank";break;case l.PARENT:c="_parent";break;case l.TOP:c="_top"}e.target=c,e.rel="string"==typeof a?a:s},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),r=e.indexOf("?"),n=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)},t.isFetchSupported=c,t.isValidFetchUrl=u,t.loadScript=function(e){return new Promise(((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=t,n.onerror=function(){r(new Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).appendChild(n)}))},t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.PDFDateString=t.StatTimer=t.DOMSVGFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=t.LinkTarget=t.RenderingCancelledException=t.PageViewport=void 0;var n=r(2);const s="noopener noreferrer nofollow";t.DEFAULT_LINK_REL=s;const a="http://www.w3.org/2000/svg";t.DOMCanvasFactory=class{create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=document.createElement("canvas"),n=r.getContext("2d");return r.width=e,r.height=t,{canvas:r,context:n}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}},t.DOMCMapReaderFactory=class{constructor({baseUrl:e=null,isCompressed:t=!1}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return c()&&u(t,document.baseURI)?fetch(t).then((async e=>{if(!e.ok)throw new Error(e.statusText);let t;return t=this.isCompressed?new Uint8Array(await e.arrayBuffer()):(0,n.stringToBytes)(await e.text()),{cMapData:t,compressionType:r}})).catch((e=>{throw new Error("Unable to load "+(this.isCompressed?"binary ":"")+`CMap at: ${t}`)})):new Promise(((e,s)=>{const a=new XMLHttpRequest;a.open("GET",t,!0),this.isCompressed&&(a.responseType="arraybuffer"),a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let t;if(this.isCompressed&&a.response?t=new Uint8Array(a.response):!this.isCompressed&&a.responseText&&(t=(0,n.stringToBytes)(a.responseText)),t)return void e({cMapData:t,compressionType:r})}s(new Error(a.statusText))}},a.send(null)})).catch((e=>{throw new Error("Unable to load "+(this.isCompressed?"binary ":"")+`CMap at: ${t}`)}))}},t.DOMSVGFactory=class{create(e,t){(0,n.assert)(e>0&&t>0,"Invalid SVG dimensions");const r=document.createElementNS(a,"svg:svg");return r.setAttribute("version","1.1"),r.setAttribute("width",e+"px"),r.setAttribute("height",t+"px"),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 "+e+" "+t),r}createElement(e){return(0,n.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(a,e)}};class i{constructor({viewBox:e,scale:t,rotation:r,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=n,this.offsetY=s;const i=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,u,d,h,p,f,g;switch(r=(r%=360)<0?r+360:r){case 180:l=-1,c=0,u=0,d=1;break;case 90:l=0,c=1,u=1,d=0;break;case 270:l=0,c=-1,u=-1,d=0;break;case 0:l=1,c=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(u=-u,d=-d),0===l?(h=Math.abs(o-e[1])*t+n,p=Math.abs(i-e[0])*t+s,f=Math.abs(e[3]-e[1])*t,g=Math.abs(e[2]-e[0])*t):(h=Math.abs(i-e[0])*t+n,p=Math.abs(o-e[1])*t+s,f=Math.abs(e[2]-e[0])*t,g=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,d*t,h-l*t*i-u*t*o,p-c*t*i-d*t*o],this.width=f,this.height=g}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}={}){return new i({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:s})}convertToViewportPoint(e,t){return n.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=n.Util.applyTransform([e[0],e[1]],this.transform),r=n.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return n.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=i;class o extends n.BaseException{constructor(e,t){super(e),this.type=t}}t.RenderingCancelledException=o;const l={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function c(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&"undefined"!=typeof ReadableStream}function u(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return"http:"===r||"https:"===r}catch(e){return!1}}let d;t.LinkTarget=l,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,n.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,n.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const e of this.times){const r=e.name;r.length>t&&(t=r.length)}for(const r of this.times){const n=r.end-r.start;e.push(`${r.name.padEnd(t)} ${n}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||!(0,n.isString)(e))return null;d||(d=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=d.exec(e);if(!t)return null;const r=parseInt(t[1],10);let s=parseInt(t[2],10);s=s>=1&&s<=12?s-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let i=parseInt(t[4],10);i=i>=0&&i<=23?i:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===c?(i+=u,o+=h):"+"===c&&(i-=u,o-=h),new Date(Date.UTC(r,s,a,i,o,l))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=h,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let n=0;n<t;n++)r+=h(e[n]);let n=0;const s=new Uint8Array(r);for(let r=0;r<t;r++){let t=e[r];t instanceof Uint8Array||(t="string"==typeof t?d(t):new Uint8Array(t));const a=t.byteLength;s.set(t,n),n+=a}return s},t.assert=o,t.bytesToString=function(e){o(null!==e&&"object"==typeof e&&void 0!==e.length,"Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let s=0;s<t;s+=r){const a=Math.min(s+r,t),i=e.subarray(s,a);n.push(String.fromCharCode.apply(null,i))}return n.join("")},t.createPromiseCapability=function(){const e=Object.create(null);let t=!1;return Object.defineProperty(e,"settled",{get:()=>t}),e.promise=new Promise((function(r,n){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,n(e)}})),e},t.getVerbosityLevel=function(){return s},t.info=function(e){s>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))},t.isBool=function(e){return"boolean"==typeof e},t.isEmptyObj=function(e){for(const t in e)return!1;return!0},t.isNum=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSameOrigin=function(e,t){let r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch(e){return!1}const n=new URL(t,r);return r.origin===n.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const r=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null},t.removeNullCharacters=function(e){return"string"!=typeof e?(a("The argument for removeNullCharacters must be a string."),e):e.replace(u,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(s=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=d,t.stringToPDFString=function(e){const t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(let n=2;n<t;n+=2)r.push(String.fromCharCode(e.charCodeAt(n)<<8|e.charCodeAt(n+1)));else if("ÿ"===e[0]&&"þ"===e[1])for(let n=2;n<t;n+=2)r.push(String.fromCharCode(e.charCodeAt(n+1)<<8|e.charCodeAt(n)));else for(let n=0;n<t;++n){const t=v[e.charCodeAt(n)];r.push(t?String.fromCharCode(t):e.charAt(n))}return r.join("")},t.stringToUTF8String=function(e){return decodeURIComponent(escape(e))},t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=a,t.unreachable=i,t.IsEvalSupportedCached=t.IsLittleEndianCached=t.createObjectURL=t.FormatError=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.MissingPDFException=t.InvalidPDFException=t.AbortException=t.CMapCompressionType=t.ImageKind=t.FontType=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.UNSUPPORTED_FEATURES=t.VerbosityLevel=t.OPS=t.IDENTITY_MATRIX=t.FONT_IDENTITY_MATRIX=t.BaseException=void 0,r(3),t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.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},t.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},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.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},t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.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},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n,t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},t.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},t.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"},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=n.WARNINGS;function a(e){s>=n.WARNINGS&&console.log(`Warning: ${e}`)}function i(e){throw new Error(e)}function o(e,t){e||i(t)}function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}const c=function(){function e(t){this.constructor===e&&i("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=c,t.PasswordException=class extends c{constructor(e,t){super(e),this.code=t}},t.UnknownErrorException=class extends c{constructor(e,t){super(e),this.details=t}},t.InvalidPDFException=class extends c{},t.MissingPDFException=class extends c{},t.UnexpectedResponseException=class extends c{constructor(e,t){super(e),this.status=t}},t.FormatError=class extends c{},t.AbortException=class extends c{};const u=/\x00/g;function d(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;++n)r[n]=255&e.charCodeAt(n);return r}function h(e){return void 0!==e.length?e.length:(o(void 0!==e.byteLength,"arrayByteLength - invalid argument."),e.byteLength)}const p={get value(){return l(this,"value",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}};t.IsLittleEndianCached=p;const f={get value(){return l(this,"value",function(){try{return new Function(""),!0}catch(e){return!1}}())}};t.IsEvalSupportedCached=f;const g=["rgb(",0,",",0,",",0,")"];class m{static makeCssRgb(e,t,r){return g[1]=e,g[3]=t,g[5]=r,g.join("")}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]}static getAxialAlignedBoundingBox(e,t){const r=m.applyTransform(e,t),n=m.applyTransform(e.slice(2,4),t),s=m.applyTransform([e[0],e[3]],t),a=m.applyTransform([e[2],e[1]],t);return[Math.min(r[0],n[0],s[0],a[0]),Math.min(r[1],n[1],s[1],a[1]),Math.max(r[0],n[0],s[0],a[0]),Math.max(r[1],n[1],s[1],a[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],s=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],i=(r+a)/2,o=Math.sqrt((r+a)*(r+a)-4*(r*a-s*n))/2,l=i+o||1,c=i-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function r(e,t){return e-t}const n=[e[0],e[2],t[0],t[2]].sort(r),s=[e[1],e[3],t[1],t[3]].sort(r),a=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),n[0]===e[0]&&n[1]===t[0]||n[0]===t[0]&&n[1]===e[0]?(a[0]=n[1],a[2]=n[2],s[0]===e[1]&&s[1]===t[1]||s[0]===t[1]&&s[1]===e[1]?(a[1]=s[1],a[3]=s[2],a):null):null}}t.Util=m;const v=[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],b=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r,n=!1){if(!n&&URL.createObjectURL){const e=new Blob([t],{type:r});return URL.createObjectURL(e)}let s=`data:${r};base64,`;for(let r=0,n=t.length;r<n;r+=3){const a=255&t[r],i=255&t[r+1],o=255&t[r+2];s+=e[a>>2]+e[(3&a)<<4|i>>4]+e[r+1<n?(15&i)<<2|o>>6:64]+e[r+2<n?63&o:64]}return s}}();t.createObjectURL=b},function(e,t,r){"use strict";r(4)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;t.isNodeJS=n},function(module,exports,__w_pdfjs_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.build=exports.version=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFWorker=exports.PDFDataRangeTransport=exports.LoopbackPort=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(6),_api_compatibility=__w_pdfjs_require__(7),_canvas=__w_pdfjs_require__(8),_worker_options=__w_pdfjs_require__(10),_is_node=__w_pdfjs_require__(4),_message_handler=__w_pdfjs_require__(11),_metadata=__w_pdfjs_require__(12),_transport_stream=__w_pdfjs_require__(14),_webgl=__w_pdfjs_require__(15);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let createPDFNetworkStream;function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){const t=new PDFDocumentLoadingTask;let r;if("string"==typeof e)r={url:e};else if((0,_util.isArrayBuffer)(e))r={data:e};else if(e instanceof PDFDataRangeTransport)r={range:e};else{if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=e}const n=Object.create(null);let s=null,a=null;for(const e in r)if("url"!==e||"undefined"==typeof window)if("range"!==e)if("worker"!==e)if("data"!==e||r[e]instanceof Uint8Array)n[e]=r[e];else{const t=r[e];if("string"==typeof t)n[e]=(0,_util.stringToBytes)(t);else if("object"!=typeof t||null===t||isNaN(t.length)){if(!(0,_util.isArrayBuffer)(t))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");n[e]=new Uint8Array(t)}else n[e]=new Uint8Array(t)}else a=r[e];else s=r[e];else n[e]=new URL(r[e],window.location).href;if(n.rangeChunkSize=n.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,n.CMapReaderFactory=n.CMapReaderFactory||_display_utils.DOMCMapReaderFactory,n.ignoreErrors=!0!==n.stopAtErrors,n.fontExtraProperties=!0===n.fontExtraProperties,n.pdfBug=!0===n.pdfBug,Number.isInteger(n.maxImageSize)||(n.maxImageSize=-1),"boolean"!=typeof n.isEvalSupported&&(n.isEvalSupported=!0),"boolean"!=typeof n.disableFontFace&&(n.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1),"boolean"!=typeof n.disableRange&&(n.disableRange=!1),"boolean"!=typeof n.disableStream&&(n.disableStream=!1),"boolean"!=typeof n.disableAutoFetch&&(n.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(n.verbosity),!a){const e={verbosity:n.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};a=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=a}const i=t.docId;return a.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(a,n,s,i),r=new Promise((function(e){let t;s?t=new _transport_stream.PDFDataTransportStream({length:n.length,initialData:n.initialData,progressiveDone:n.progressiveDone,disableRange:n.disableRange,disableStream:n.disableStream},s):n.data||(t=createPDFNetworkStream({url:n.url,length:n.length,httpHeaders:n.httpHeaders,withCredentials:n.withCredentials,rangeChunkSize:n.rangeChunkSize,disableRange:n.disableRange,disableStream:n.disableStream})),e(t)}));return Promise.all([e,r]).then((function([e,r]){if(t.destroyed)throw new Error("Loading aborted");const s=new _message_handler.MessageHandler(i,e,a.port);s.postMessageTransfers=a.postMessageTransfers;const o=new WorkerTransport(s,t,r,n);t._transport=o,s.send("Ready",null)}))})).catch(t._capability.reject),t}function _fetchDocument(e,t,r,n){return e.destroyed?Promise.reject(new Error("Worker was destroyed")):(r&&(t.length=r.length,t.initialData=r.initialData,t.progressiveDone=r.progressiveDone),e.messageHandler.sendWithPromise("GetDocRequest",{docId:n,apiVersion:"2.5.207",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,postMessageTransfers:e.postMessageTransfers,docBaseUrl:t.docBaseUrl,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties}).then((function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t})))}const PDFDocumentLoadingTask=function(){let e=0;return class{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then((()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}))}}}();class PDFDataRangeTransport{constructor(e,t,r=!1){this.length=e,this.initialData=t,this.progressiveDone=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const r of this._rangeListeners)r(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const r of this._progressListeners)r(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getOpenActionDestination(){return(0,_display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."),this.getOpenAction().then((function(e){return e&&e.dest?e.dest:null}))}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,t,r,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:r=0,offsetY:n=0,dontFlip:s=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:s})}getAnnotations({intent:e=null}={}){return this.annotationsPromise&&this.annotationsIntent===e||(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:t,intent:r="display",enableWebGL:n=!1,renderInteractiveForms:s=!1,transform:a=null,imageLayer:i=null,canvasFactory:o=null,background:l=null}){this._stats&&this._stats.time("Overall");const c="print"===r?"print":"display";this.pendingCleanup=!1,this.intentStates[c]||(this.intentStates[c]=Object.create(null));const u=this.intentStates[c];u.streamReaderCancelTimeout&&(clearTimeout(u.streamReaderCancelTimeout),u.streamReaderCancelTimeout=null);const d=o||new _display_utils.DOMCanvasFactory,h=new _webgl.WebGLContext({enable:n});u.displayReadyCapability||(u.displayReadyCapability=(0,_util.createPromiseCapability)(),u.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:c,renderInteractiveForms:!0===s}));const p=e=>{const t=u.renderTasks.indexOf(f);t>=0&&u.renderTasks.splice(t,1),(this.cleanupAfterRender||"print"===c)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(f.capability.reject(e),this._abortOperatorList({intentState:u,reason:e})):f.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:t,transform:a,imageLayer:i,background:l},objs:this.objs,commonObjs:this.commonObjs,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:d,webGLContext:h,useRequestAnimationFrame:"print"!==c,pdfBug:this._pdfBug});u.renderTasks||(u.renderTasks=[]),u.renderTasks.push(f);const g=f.task;return u.displayReadyCapability.promise.then((e=>{this.pendingCleanup?p():(this._stats&&this._stats.time("Rendering"),f.initializeGraphics(e),f.operatorListChanged())})).catch(p),g}getOperatorList(){this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));const e=this.intentStates.oplist;let t;return e.opListReadCapability||(t={},t.operatorListChanged=function(){if(e.operatorList.lastChunk){e.opListReadCapability.resolve(e.operatorList);const r=e.renderTasks.indexOf(t);r>=0&&e.renderTasks.splice(r,1)}},e.opListReadCapability=(0,_util.createPromiseCapability)(),e.renderTasks=[],e.renderTasks.push(t),e.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:"oplist"})),e.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===e,combineTextItems:!0!==t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){const t=this.streamTextContent(e);return new Promise((function(e,r){const n=t.getReader(),s={items:[],styles:Object.create(null)};!function t(){n.read().then((function({value:r,done:n}){n?e(s):(Object.assign(s.styles,r.styles),s.items.push(...r.items),t())}),r)}()}))}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];return Object.keys(this.intentStates).forEach((t=>{const r=this.intentStates[t];this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),"oplist"!==t&&r.renderTasks.forEach((function(t){const r=t.capability.promise.catch((function(){}));e.push(r),t.cancel()}))})),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){return!(!this.pendingCleanup||Object.keys(this.intentStates).some((e=>{const t=this.intentStates[e];return 0!==t.renderTasks.length||!t.operatorList.lastChunk}))||(Object.keys(this.intentStates).forEach((e=>{delete this.intentStates[e]})),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,0))}_startRenderPage(e,t){const r=this.intentStates[t];r&&(this._stats&&this._stats.timeEnd("Page Request"),r.displayReadyCapability&&r.displayReadyCapability.resolve(e))}_renderPageChunk(e,t){for(let r=0,n=e.length;r<n;r++)t.operatorList.fnArray.push(e.fnArray[r]),t.operatorList.argsArray.push(e.argsArray[r]);t.operatorList.lastChunk=e.lastChunk;for(let e=0;e<t.renderTasks.length;e++)t.renderTasks[e].operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){(0,_util.assert)(e.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');const t=this._transport.messageHandler.sendWithStream("GetOperatorList",e).getReader(),r=this.intentStates[e.intent];r.streamReader=t;const n=()=>{t.read().then((({value:e,done:t})=>{t?r.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,r),n())}),(e=>{if(r.streamReader=null,!this._transport.destroyed){if(r.operatorList){r.operatorList.lastChunk=!0;for(let e=0;e<r.renderTasks.length;e++)r.renderTasks[e].operatorListChanged();this._tryCleanup()}if(r.displayReadyCapability)r.displayReadyCapability.reject(e);else{if(!r.opListReadCapability)throw e;r.opListReadCapability.reject(e)}}}))};n()}_abortOperatorList({intentState:e,reason:t,force:r=!1}){if((0,_util.assert)(t instanceof Error||"object"==typeof t&&null!==t,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),e.streamReader){if(!r){if(0!==e.renderTasks.length)return;if(t instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}e.streamReader.cancel(new _util.AbortException(t&&t.message)),e.streamReader=null,this._transport.destroyed||(Object.keys(this.intentStates).some((t=>this.intentStates[t]===e&&(delete this.intentStates[t],!0))),this.cleanup())}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,t){if(!this._defer)return void this._listeners.forEach((t=>{t.call(this,{data:e})}));const r=new WeakMap,n={data:function e(n){if("object"!=typeof n||null===n)return n;if(r.has(n))return r.get(n);let s,a;if((s=n.buffer)&&(0,_util.isArrayBuffer)(s))return a=t&&t.includes(s)?new n.constructor(s,n.byteOffset,n.byteLength):new n.constructor(n),r.set(n,a),a;a=Array.isArray(n)?[]:{},r.set(n,a);for(const t in n){let r,s=n;for(;!(r=Object.getOwnPropertyDescriptor(s,t));)s=Object.getPrototypeOf(s);if(void 0!==r.value)if("function"!=typeof r.value)a[t]=e(r.value);else if(n.hasOwnProperty&&n.hasOwnProperty(t))throw new Error(`LoopbackPort.postMessage - cannot clone: ${n[t]}`)}return a}(e)};this._deferred.then((()=>{this._listeners.forEach((e=>{e.call(this,n)}))}))}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const r=this._listeners.indexOf(t);this._listeners.splice(r,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS)isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document&&"currentScript"in document){const e=document.currentScript&&document.currentScript.src;e&&(fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(void 0!==fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let e;try{e=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch(e){}return e||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(e){const t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}class PDFWorker{constructor({name:e=null,port:t=null,verbosity:r=(0,_util.getVerbosityLevel)()}={}){if(t&&pdfWorkerPorts.has(t))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=r,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return pdfWorkerPorts.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if("undefined"!=typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),r=new _message_handler.MessageHandler("main","worker",t),n=()=>{t.removeEventListener("error",s),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||n()};t.addEventListener("error",s),r.on("test",(e=>{t.removeEventListener("error",s),this.destroyed?n():e?(this._messageHandler=r,this._port=t,this._webWorker=t,e.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),t.terminate())})),r.on("ready",(e=>{if(t.removeEventListener("error",s),this.destroyed)n();else try{a()}catch(e){this._setupFakeWorker()}}));const a=()=>{const e=new Uint8Array([this.postMessageTransfers?255:0]);try{r.send("test",e,[e.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers."),e[0]=0,r.send("test",e)}};return void a()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const r="fake"+nextFakeWorkerId++,n=new _message_handler.MessageHandler(r+"_worker",r,t);e.setup(n,t);const s=new _message_handler.MessageHandler(r,r+"_worker",t);this._messageHandler=s,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,t,r,n){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=n,this.CMapReaderFactory=new n.CMapReaderFactory({baseUrl:n.cMapUrl,isCompressed:n.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}destroy(){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"));const e=[];this.pageCache.forEach((function(t){t&&e.push(t._destroy())})),this.pageCache.length=0,this.pagePromises.length=0;const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:r}){r?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e)}})),e.on("ReaderHeadersReady",(e=>{const r=(0,_util.createPromiseCapability)(),n=this._fullReader;return n.headersReady.then((()=>{n.isStreamingSupported&&n.isRangeSupported||(this._lastProgress&&t.onProgress&&t.onProgress(this._lastProgress),n.onProgress=e=>{t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),r.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),r.reject),r.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(e.begin,e.end);r?(t.onPull=()=>{r.read().then((function({value:e,done:r}){r?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{r.cancel(e)}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let r;switch(e.name){case"PasswordException":r=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":r=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(e.message,e.details)}t._capability.reject(r)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const r=e=>{this._passwordCapability.resolve({password:e})};try{t.onPassword(r,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress&&t.onProgress({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.pageCache[e.pageIndex]._startRenderPage(e.transparency,e.intent)})),e.on("commonobj",(t=>{if(this.destroyed)return;const[r,n,s]=t;if(!this.commonObjs.has(r))switch(n){case"Font":const t=this._params;if("error"in s){const e=s.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(r,e);break}let a=null;t.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(a={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const i=new _font_loader.FontFaceObject(s,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:a});this.fontLoader.bind(i).catch((t=>e.sendWithPromise("FontFallback",{id:r}))).finally((()=>{!t.fontExtraProperties&&i.data&&(i.data=null),this.commonObjs.resolve(r,i)}));break;case"FontPath":case"FontType3Res":case"Image":this.commonObjs.resolve(r,s);break;default:throw new Error(`Got unknown common object type ${n}`)}})),e.on("obj",(e=>{if(this.destroyed)return;const[t,r,n,s]=e,a=this.pageCache[r];if(!a.objs.has(t)){if("Image"!==n)throw new Error(`Got unknown object type ${n}`);{a.objs.resolve(t,s);const e=8e6;s&&"data"in s&&s.data.length>e&&(a.cleanupAfterRender=!0)}}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",((e,t)=>{if(this.destroyed)return void t.error(new Error("Worker was destroyed"));let r=!1;t.onPull=()=>{r?t.close():(r=!0,this.CMapReaderFactory.fetch(e).then((function(e){t.enqueue(e,1,[e.cMapData.buffer])})).catch((function(e){t.error(e)})))}}))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const t=e-1;if(t in this.pagePromises)return this.pagePromises[t];const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const r=new PDFPageProxy(t,e,this,this._params.pdfBug);return this.pageCache[t]=r,r}));return this.pagePromises[t]=r,r}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch((function(e){return Promise.reject(new Error(e))}))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null})))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then((()=>{for(let e=0,t=this.pageCache.length;e<t;e++){const t=this.pageCache[e];if(t&&!t.cleanup())throw new Error(`startCleanup: Page ${e+1} is currently rendering.`)}this.commonObjs.clear(),this.fontLoader.clear()}))}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,disableFontFace:e.disableFontFace})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(e){return this._objs[e]?this._objs[e]:this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(e,t=null){if(t)return this._ensureObj(e).capability.promise.then(t),null;const r=this._objs[e];if(!r||!r.resolved)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const t=this._objs[e];return!!t&&t.resolved}resolve(e,t){const r=this._ensureObj(e);r.resolved=!0,r.data=t,r.capability.resolve(t)}clear(){this._objs=Object.create(null)}}class RenderTask{constructor(e){this._internalRenderTask=e,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}const InternalRenderTask=function(){const e=new WeakSet;return class{constructor({callback:e,params:t,objs:r,commonObjs:n,operatorList:s,pageIndex:a,canvasFactory:i,webGLContext:o,useRequestAnimationFrame:l=!1,pdfBug:c=!1}){this.callback=e,this.params=t,this.objs=r,this.commonObjs=n,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=i,this.webGLContext=o,this._pdfBug=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"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=t.canvasContext.canvas}initializeGraphics(t=!1){if(this.cancelled)return;if(this._canvas){if(e.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.");e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager&&globalThis.StepperManager.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:n,transform:s,imageLayer:a,background:i}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,a),this.gfx.beginDrawing({transform:s,viewport:n,transparency:t,background:i}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(t=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this.cancel.bind(this))})):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback())))}}}(),version="2.5.207";exports.version=version;const build="0974d605";exports.build=build},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var n=r(2);class s{constructor({docId:e,onUnsupportedFeature:t}){this.constructor===s&&(0,n.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,document.documentElement.getElementsByTagName("head")[0].appendChild(t));const r=t.sheet;r.insertRule(e,r.cssRules.length)}clear(){this.nativeFontFaces.forEach((function(e){document.fonts.delete(e)})),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(r){throw this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,n.warn)(`Failed to load font '${t.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((r=>{const n=this._queueLoadingCallback(r);this._prepareFontLoadEvent([t],[e],n)}))}}_queueLoadingCallback(e){(0,n.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e="undefined"!=typeof document&&!!document.fonts;return(0,n.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,n.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,n.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,r){(0,n.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let a;t.FontLoader=a,t.FontLoader=a=class extends s{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;if("undefined"==typeof navigator)e=!0;else{const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t&&t[1]>=14&&(e=!0)}return(0,n.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,r={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,n.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(r),r}get _loadTestFont(){return(0,n.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,r){function s(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function a(e,t,r,n){return e.substring(0,t)+n+e.substring(t+r)}let i,o;const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let u=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=a(h,976,d.length,d);const p=1482184792;let f=s(h,16);for(i=0,o=d.length-3;i<o;i+=4)f=f-p+s(d,i)|0;i<d.length&&(f=f-p+s(d+"XXX",i)|0),h=a(h,16,4,(0,n.string32)(f));const g=`@font-face {font-family:"${d}";src:url(data:font/opentype;base64,${btoa(h)});}`;this.insertRule(g);const m=[];for(i=0,o=t.length;i<o;i++)m.push(t[i].loadedName);m.push(d);const v=document.createElement("div");for(v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px",i=0,o=m.length;i<o;++i){const e=document.createElement("span");e.textContent="Hi",e.style.fontFamily=m[i],v.appendChild(e)}document.body.appendChild(v),function e(t,r){if(u++,u>30)return(0,n.warn)("Load test font never loaded."),void r();c.font="30px "+t,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?r():setTimeout(e.bind(null,t,r))}(d,(function(){document.body.removeChild(v),r.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:r=!1,ignoreErrors:n=!1,onUnsupportedFeature:s=null,fontRegistry:a=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===r,this.ignoreErrors=!0===n,this._onUnsupportedFeature=s,this.fontRegistry=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,n.bytesToString)(new Uint8Array(this.data)),t=`url(data:${this.mimetype};base64,${btoa(e)});`,r=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),r}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let r,s;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,n.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&n.IsEvalSupportedCached.value){let e,n="";for(let t=0,a=r.length;t<a;t++)s=r[t],e=void 0!==s.args?s.args.join(","):"",n+="c."+s.cmd+"("+e+");\n";return this.compiledGlyphs[t]=new Function("c","size",n)}return this.compiledGlyphs[t]=function(e,t){for(let n=0,a=r.length;n<a;n++)s=r[n],"scale"===s.cmd&&(s.args=[t,-t]),e[s.cmd].apply(e,s.args)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.apiCompatibilityParams=void 0;var n=r(4);const s=Object.create(null);n.isNodeJS&&(s.disableFontFace=!0);const a=Object.freeze(s);t.apiCompatibilityParams=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var n=r(2),s=r(9),a=4096,i=.65,o=16;function l(e){e.mozCurrentTransform||(e._originalSave=e.save,e._originalRestore=e.restore,e._originalRotate=e.rotate,e._originalScale=e.scale,e._originalTranslate=e.translate,e._originalTransform=e.transform,e._originalSetTransform=e.setTransform,e._transformMatrix=e._transformMatrix||[1,0,0,1,0,0],e._transformStack=[],Object.defineProperty(e,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(e,"mozCurrentTransformInverse",{get:function(){var e=this._transformMatrix,t=e[0],r=e[1],n=e[2],s=e[3],a=e[4],i=e[5],o=t*s-r*n,l=r*n-t*s;return[s/o,r/l,n/l,t/o,(s*a-n*i)/l,(r*a-t*i)/o]}}),e.save=function(){var e=this._transformMatrix;this._transformStack.push(e),this._transformMatrix=e.slice(0,6),this._originalSave()},e.restore=function(){var e=this._transformStack.pop();e&&(this._transformMatrix=e,this._originalRestore())},e.translate=function(e,t){var r=this._transformMatrix;r[4]=r[0]*e+r[2]*t+r[4],r[5]=r[1]*e+r[3]*t+r[5],this._originalTranslate(e,t)},e.scale=function(e,t){var r=this._transformMatrix;r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*t,r[3]=r[3]*t,this._originalScale(e,t)},e.transform=function(t,r,n,s,a,i){var o=this._transformMatrix;this._transformMatrix=[o[0]*t+o[2]*r,o[1]*t+o[3]*r,o[0]*n+o[2]*s,o[1]*n+o[3]*s,o[0]*a+o[2]*i+o[4],o[1]*a+o[3]*i+o[5]],e._originalTransform(t,r,n,s,a,i)},e.setTransform=function(t,r,n,s,a,i){this._transformMatrix=[t,r,n,s,a,i],e._originalSetTransform(t,r,n,s,a,i)},e.rotate=function(e){var t=Math.cos(e),r=Math.sin(e),n=this._transformMatrix;this._transformMatrix=[n[0]*t+n[2]*r,n[1]*t+n[3]*r,n[0]*-r+n[2]*t,n[1]*-r+n[3]*t,n[4],n[5]],this._originalRotate(e)})}var c=function(){function e(e){this.canvasFactory=e,this.cache=Object.create(null)}return e.prototype={getCanvas:function(e,t,r,n){var s;return void 0!==this.cache[e]?(s=this.cache[e],this.canvasFactory.reset(s,t,r),s.context.setTransform(1,0,0,1,0,0)):(s=this.canvasFactory.create(t,r),this.cache[e]=s),n&&l(s.context),s},clear(){for(var e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}},e}(),u=function(){function e(){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=n.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=n.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=n.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}return e.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(e,t){this.x=e,this.y=t}},e}(),d=function(){function e(e,t,r,n,s,a){this.ctx=e,this.current=new u,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=r,this.canvasFactory=n,this.webGLContext=s,this.imageLayer=a,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.cachedCanvases=new c(this.canvasFactory),e&&l(e),this._cachedGetSinglePixelWidth=null}function t(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)e.putImageData(t,0,0);else{var r,s,a,i,l,c=t.height,u=t.width,d=c%o,h=(c-d)/o,p=0===d?h:h+1,f=e.createImageData(u,o),g=0,m=t.data,v=f.data;if(t.kind===n.ImageKind.GRAYSCALE_1BPP){var b=m.byteLength,y=new Uint32Array(v.buffer,0,v.byteLength>>2),A=y.length,_=u+7>>3,x=4294967295,S=n.IsLittleEndianCached.value?4278190080:255;for(s=0;s<p;s++){for(i=s<h?o:d,r=0,a=0;a<i;a++){for(var w=b-g,P=0,C=w>_?u:8*w-7,k=-8&C,R=0,E=0;P<k;P+=8)E=m[g++],y[r++]=128&E?x:S,y[r++]=64&E?x:S,y[r++]=32&E?x:S,y[r++]=16&E?x:S,y[r++]=8&E?x:S,y[r++]=4&E?x:S,y[r++]=2&E?x:S,y[r++]=1&E?x:S;for(;P<C;P++)0===R&&(E=m[g++],R=128),y[r++]=E&R?x:S,R>>=1}for(;r<A;)y[r++]=0;e.putImageData(f,0,s*o)}}else if(t.kind===n.ImageKind.RGBA_32BPP){for(a=0,l=u*o*4,s=0;s<h;s++)v.set(m.subarray(g,g+l)),g+=l,e.putImageData(f,0,a),a+=o;s<p&&(l=u*d*4,v.set(m.subarray(g,g+l)),e.putImageData(f,0,a))}else{if(t.kind!==n.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(l=u*(i=o),s=0;s<p;s++){for(s>=h&&(l=u*(i=d)),r=0,a=l;a--;)v[r++]=m[g++],v[r++]=m[g++],v[r++]=m[g++],v[r++]=255;e.putImageData(f,0,s*o)}}}}function r(e,t){for(var r=t.height,n=t.width,s=r%o,a=(r-s)/o,i=0===s?a:a+1,l=e.createImageData(n,o),c=0,u=t.data,d=l.data,h=0;h<i;h++){for(var p=h<a?o:s,f=3,g=0;g<p;g++)for(var m=0,v=0;v<n;v++){if(!m){var b=u[c++];m=128}d[f]=b&m?0:255,f+=4,m>>=1}e.putImageData(l,0,h*o)}}function d(e,t){for(var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],n=0,s=r.length;n<s;n++){var a=r[n];void 0!==e[a]&&(t[a]=e[a])}void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function h(e){e.strokeStyle="#000000",e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0)}function p(e,t,r,n){for(var s=e.length,a=3;a<s;a+=4){var i=e[a];if(0===i)e[a-3]=t,e[a-2]=r,e[a-1]=n;else if(i<255){var o=255-i;e[a-3]=e[a-3]*i+t*o>>8,e[a-2]=e[a-2]*i+r*o>>8,e[a-1]=e[a-1]*i+n*o>>8}}}function f(e,t,r){for(var n=e.length,s=3;s<n;s+=4){var a=r?r[e[s]]:e[s];t[s]=t[s]*a*.00392156862745098|0}}function g(e,t,r){for(var n=e.length,s=3;s<n;s+=4){var a=77*e[s-3]+152*e[s-2]+28*e[s-1];t[s]=r?t[s]*r[a>>8]>>8:t[s]*a>>16}}function m(e,t,r,n){var s=t.canvas,a=t.context;e.setTransform(t.scaleX,0,0,t.scaleY,t.offsetX,t.offsetY);var i=t.backdrop||null;if(!t.transferMap&&n.isEnabled){const a=n.composeSMask({layer:r.canvas,mask:s,properties:{subtype:t.subtype,backdrop:i}});return e.setTransform(1,0,0,1,0,0),void e.drawImage(a,t.offsetX,t.offsetY)}!function(e,t,r,n,s,a,i){var o,l=!!a,c=l?a[0]:0,u=l?a[1]:0,d=l?a[2]:0;o="Luminosity"===s?g:f;for(var h=Math.min(n,Math.ceil(1048576/r)),m=0;m<n;m+=h){var v=Math.min(h,n-m),b=e.getImageData(0,m,r,v),y=t.getImageData(0,m,r,v);l&&p(b.data,c,u,d),o(b.data,y.data,i),e.putImageData(y,0,m)}}(a,r,s.width,s.height,t.subtype,i,t.transferMap),e.drawImage(s,0,0)}var v=["butt","round","square"],b=["miter","round","bevel"],y={},A={};for(var _ in e.prototype={beginDrawing({transform:e,viewport:t,transparency:r=!1,background:n=null}){var s=this.ctx.canvas.width,a=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=n||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,s,a),this.ctx.restore(),r){var i=this.cachedCanvases.getCanvas("transparent",s,a,!0);this.compositeCtx=this.ctx,this.transparentCanvas=i.canvas,this.ctx=i.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),h(this.ctx),e&&this.ctx.transform.apply(this.ctx,e),this.ctx.transform.apply(this.ctx,t.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(e,t,r,s){var a=e.argsArray,i=e.fnArray,o=t||0,l=a.length;if(l===o)return o;for(var c,u=l-o>10&&"function"==typeof r,d=u?Date.now()+15:0,h=0,p=this.commonObjs,f=this.objs;;){if(void 0!==s&&o===s.nextBreakPoint)return s.breakIt(o,r),o;if((c=i[o])!==n.OPS.dependency)this[c].apply(this,a[o]);else for(const e of a[o]){const t=e.startsWith("g_")?p:f;if(!t.has(e))return t.get(e,r),o}if(++o===l)return o;if(u&&++h>10){if(Date.now()>d)return r(),o;h=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),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(e){this.current.lineWidth=e,this.ctx.lineWidth=e},setLineCap:function(e){this.ctx.lineCap=v[e]},setLineJoin:function(e){this.ctx.lineJoin=b[e]},setMiterLimit:function(e){this.ctx.miterLimit=e},setDash:function(e,t){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(e),r.lineDashOffset=t)},setRenderingIntent(e){},setFlatness(e){},setGState:function(e){for(var t=0,r=e.length;t<r;t++){var n=e[t],s=n[0],a=n[1];switch(s){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=n[1];break;case"ca":this.current.fillAlpha=n[1],this.ctx.globalAlpha=n[1];break;case"BM":this.ctx.globalCompositeOperation=a;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=a?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var e=this.current.activeSMask,t=e.canvas.width,r=e.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,t,r,!0),a=this.ctx,i=a.mozCurrentTransform;this.ctx.save();var o=s.context;o.scale(1/e.scaleX,1/e.scaleY),o.translate(-e.offsetX,-e.offsetY),o.transform.apply(o,i),e.startTransformInverse=o.mozCurrentTransformInverse,d(a,o),this.ctx=o,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++},suspendSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),m(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),this.ctx.save(),d(e,this.ctx),this.current.resumeSMaskCtx=e;var t=n.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()},resumeSMaskGroup:function(){var e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++},endSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),m(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),d(e,this.ctx);var t=n.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)},save:function(){this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null},restore:function(){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(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(e,t,r,n,s,a){this.ctx.transform(e,t,r,n,s,a),this._cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var r=this.ctx,s=this.current,a=s.x,i=s.y,o=0,l=0,c=e.length;o<c;o++)switch(0|e[o]){case n.OPS.rectangle:a=t[l++],i=t[l++];var u=t[l++],d=t[l++];0===u&&(u=this.getSinglePixelWidth()),0===d&&(d=this.getSinglePixelWidth());var h=a+u,p=i+d;this.ctx.moveTo(a,i),this.ctx.lineTo(h,i),this.ctx.lineTo(h,p),this.ctx.lineTo(a,p),this.ctx.lineTo(a,i),this.ctx.closePath();break;case n.OPS.moveTo:a=t[l++],i=t[l++],r.moveTo(a,i);break;case n.OPS.lineTo:a=t[l++],i=t[l++],r.lineTo(a,i);break;case n.OPS.curveTo:a=t[l+4],i=t[l+5],r.bezierCurveTo(t[l],t[l+1],t[l+2],t[l+3],a,i),l+=6;break;case n.OPS.curveTo2:r.bezierCurveTo(a,i,t[l],t[l+1],t[l+2],t[l+3]),a=t[l+2],i=t[l+3],l+=4;break;case n.OPS.curveTo3:a=t[l+2],i=t[l+3],r.bezierCurveTo(t[l],t[l+1],a,i,a,i),l+=4;break;case n.OPS.closePath:r.closePath()}s.setCurrentPoint(a,i)},closePath:function(){this.ctx.closePath()},stroke:function(e){e=void 0===e||e;var t=this.ctx,r=this.current.strokeColor;if(t.globalAlpha=this.current.strokeAlpha,r&&r.hasOwnProperty("type")&&"Pattern"===r.type){t.save();const e=t.mozCurrentTransform,s=n.Util.singularValueDecompose2dScale(e)[0];t.strokeStyle=r.getPattern(t,this),t.lineWidth=Math.max(this.getSinglePixelWidth()*i,this.current.lineWidth*s),t.stroke(),t.restore()}else t.lineWidth=Math.max(this.getSinglePixelWidth()*i,this.current.lineWidth),t.stroke();e&&this.consumePath(),t.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(e){e=void 0===e||e;var t=this.ctx,r=this.current.fillColor,n=!1;this.current.patternFill&&(t.save(),this.baseTransform&&t.setTransform.apply(t,this.baseTransform),t.fillStyle=r.getPattern(t,this),n=!0),this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill(),n&&t.restore(),e&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=y},eoClip:function(){this.pendingClip=A},beginText:function(){this.current.textMatrix=n.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(var r=0;r<e.length;r++){var n=e[r];t.setTransform.apply(t,n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize)}t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()},setCharSpacing:function(e){this.current.charSpacing=e},setWordSpacing:function(e){this.current.wordSpacing=e},setHScale:function(e){this.current.textHScale=e/100},setLeading:function(e){this.current.leading=-e},setFont:function(e,t){var r=this.commonObjs.get(e),s=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(s.fontMatrix=r.fontMatrix?r.fontMatrix:n.FONT_IDENTITY_MATRIX,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,n.warn)("Invalid font matrix for font "+e),t<0?(t=-t,s.fontDirection=-1):s.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;var a=r.loadedName||"sans-serif";let i="normal";r.black?i="900":r.bold&&(i="bold");var o=r.italic?"italic":"normal",l=`"${a}", ${r.fallbackName}`;let c=t;t<16?c=16:t>100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${o} ${i} ${c}px ${l}`},setTextRenderingMode:function(e){this.current.textRenderingMode=e},setTextRise:function(e){this.current.textRise=e},moveText:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t},setLeadingMoveText:function(e,t){this.setLeading(-t),this.moveText(e,t)},setTextMatrix:function(e,t,r,n,s,a){this.current.textMatrix=[e,t,r,n,s,a],this.current.textMatrixScale=Math.sqrt(e*e+t*t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(e,t,r,s){var a=this.ctx,i=this.current,o=i.font,l=i.textRenderingMode,c=i.fontSize/i.fontSizeScale,u=l&n.TextRenderingMode.FILL_STROKE_MASK,d=!!(l&n.TextRenderingMode.ADD_TO_PATH_FLAG);const h=i.patternFill&&!o.missingFile;var p;(o.disableFontFace||d||h)&&(p=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||h?(a.save(),a.translate(t,r),a.beginPath(),p(a,c),s&&a.setTransform.apply(a,s),u!==n.TextRenderingMode.FILL&&u!==n.TextRenderingMode.FILL_STROKE||a.fill(),u!==n.TextRenderingMode.STROKE&&u!==n.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore()):(u!==n.TextRenderingMode.FILL&&u!==n.TextRenderingMode.FILL_STROKE||a.fillText(e,t,r),u!==n.TextRenderingMode.STROKE&&u!==n.TextRenderingMode.FILL_STROKE||a.strokeText(e,t,r)),d&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:a.mozCurrentTransform,x:t,y:r,fontSize:c,addToPath:p})},get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);for(var t=e.getImageData(0,0,10,10).data,r=!1,s=3;s<t.length;s+=4)if(t[s]>0&&t[s]<255){r=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",r)},showText:function(e){var t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);var s=t.fontSize;if(0===s)return;var a=this.ctx,o=t.fontSizeScale,l=t.charSpacing,c=t.wordSpacing,u=t.fontDirection,d=t.textHScale*u,h=e.length,p=r.vertical,f=p?1:-1,g=r.defaultVMetrics,m=s*t.fontMatrix[0],v=t.textRenderingMode===n.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;let b;if(a.save(),t.patternFill){a.save();const e=t.fillColor.getPattern(a,this);b=a.mozCurrentTransform,a.restore(),a.fillStyle=e}a.transform.apply(a,t.textMatrix),a.translate(t.x,t.y+t.textRise),u>0?a.scale(d,-1):a.scale(d,1);var y=t.lineWidth,A=t.textMatrixScale;if(0===A||0===y){var _=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;_!==n.TextRenderingMode.STROKE&&_!==n.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,y=this.getSinglePixelWidth()*i)}else y/=A;1!==o&&(a.scale(o,o),y/=o),a.lineWidth=y;var x,S=0;for(x=0;x<h;++x){var w=e[x];if((0,n.isNum)(w))S+=f*w*s/1e3;else{var P,C,k,R,E,T,L,F=!1,O=(w.isSpace?c:0)+l,D=w.fontChar,I=w.accent,M=w.width;if(p?(E=w.vmetric||g,T=-(T=w.vmetric?E[1]:.5*M)*m,L=E[2]*m,M=E?-E[0]:M,P=T/o,C=(S+L)/o):(P=S/o,C=0),r.remeasure&&M>0){var N=1e3*a.measureText(D).width/s*o;if(M<N&&this.isFontSubpixelAAEnabled){var j=M/N;F=!0,a.save(),a.scale(j,1),P/=j}else M!==N&&(P+=(M-N)/2e3*s/o)}(w.isInFont||r.missingFile)&&(v&&!I?a.fillText(D,P,C):(this.paintChar(D,P,C,b),I&&(k=P+I.offset.x/o,R=C-I.offset.y/o,this.paintChar(I.fontChar,k,R,b)))),S+=p?M*m-O*u:M*m+O*u,F&&a.restore()}}p?t.y-=S:t.x+=S*d,a.restore()},showType3Text:function(e){var t,r,s,a,i=this.ctx,o=this.current,l=o.font,c=o.fontSize,u=o.fontDirection,d=l.vertical?1:-1,h=o.charSpacing,p=o.wordSpacing,f=o.textHScale*u,g=o.fontMatrix||n.FONT_IDENTITY_MATRIX,m=e.length;if(o.textRenderingMode!==n.TextRenderingMode.INVISIBLE&&0!==c){for(this._cachedGetSinglePixelWidth=null,i.save(),i.transform.apply(i,o.textMatrix),i.translate(o.x,o.y),i.scale(f,u),t=0;t<m;++t)if(r=e[t],(0,n.isNum)(r))a=d*r*c/1e3,this.ctx.translate(a,0),o.x+=a*f;else{var v=(r.isSpace?p:0)+h,b=l.charProcOperatorList[r.operatorListId];b?(this.processingType3=r,this.save(),i.scale(c,c),i.transform.apply(i,g),this.executeOperatorList(b),this.restore(),s=n.Util.applyTransform([r.width,0],g)[0]*c+v,i.translate(s,0),o.x+=s*f):(0,n.warn)(`Type3 character "${r.operatorListId}" is not available.`)}i.restore(),this.processingType3=null}},setCharWidth:function(e,t){},setCharWidthAndBounds:function(e,t,r,n,s,a){this.ctx.rect(r,n,s-r,a-n),this.clip(),this.endPath()},getColorN_Pattern:function(t){var r;if("TilingPattern"===t[0]){var n=t[1],a=this.baseTransform||this.ctx.mozCurrentTransform.slice(),i={createCanvasGraphics:t=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};r=new s.TilingPattern(t,n,this.ctx,i,a)}else r=(0,s.getShadingPatternFromIR)(t);return r},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(e,t,r){var s=n.Util.makeCssRgb(e,t,r);this.ctx.strokeStyle=s,this.current.strokeColor=s},setFillRGBColor:function(e,t,r){var s=n.Util.makeCssRgb(e,t,r);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1},shadingFill:function(e){var t=this.ctx;this.save();var r=(0,s.getShadingPatternFromIR)(e);t.fillStyle=r.getPattern(t,this,!0);var a=t.mozCurrentTransformInverse;if(a){var i=t.canvas,o=i.width,l=i.height,c=n.Util.applyTransform([0,0],a),u=n.Util.applyTransform([0,l],a),d=n.Util.applyTransform([o,0],a),h=n.Util.applyTransform([o,l],a),p=Math.min(c[0],u[0],d[0],h[0]),f=Math.min(c[1],u[1],d[1],h[1]),g=Math.max(c[0],u[0],d[0],h[0]),m=Math.max(c[1],u[1],d[1],h[1]);this.ctx.fillRect(p,f,g-p,m-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,n.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,n.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(e,t){if(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform.apply(this,e),this.baseTransform=this.ctx.mozCurrentTransform,t){var r=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],r,n),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(e){this.save();var t=this.ctx;e.isolated||(0,n.info)("TODO: Support non-isolated groups."),e.knockout&&(0,n.warn)("Knockout groups not supported.");var r=t.mozCurrentTransform;if(e.matrix&&t.transform.apply(t,e.matrix),!e.bbox)throw new Error("Bounding box is required.");var s=n.Util.getAxialAlignedBoundingBox(e.bbox,t.mozCurrentTransform),i=[0,0,t.canvas.width,t.canvas.height];s=n.Util.intersect(s,i)||[0,0,0,0];var o=Math.floor(s[0]),l=Math.floor(s[1]),c=Math.max(Math.ceil(s[2])-o,1),u=Math.max(Math.ceil(s[3])-l,1),h=1,p=1;c>a&&(h=c/a,c=a),u>a&&(p=u/a,u=a);var f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);var g=this.cachedCanvases.getCanvas(f,c,u,!0),m=g.context;m.scale(1/h,1/p),m.translate(-o,-l),m.transform.apply(m,r),e.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:l,scaleX:h,scaleY:p,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,l),t.scale(h,p)),d(t,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null},endGroup:function(e){this.groupLevel--;var t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(e,t,r){if(this.save(),h(this.ctx),this.current=new u,Array.isArray(e)&&4===e.length){var n=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],n,s),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,r)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(e){var t=this.ctx,n=e.width,s=e.height,a=this.current.fillColor,i=this.current.patternFill,o=this.processingType3;if(o&&void 0===o.compiled&&(o.compiled=n<=1e3&&s<=1e3?function(e){var t,r,n,s,a=e.width,i=e.height,o=a+1,l=new Uint8Array(o*(i+1)),c=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=a+7&-8,d=e.data,h=new Uint8Array(u*i),p=0;for(t=0,s=d.length;t<s;t++)for(var f=128,g=d[t];f>0;)h[p++]=g&f?0:255,f>>=1;var m=0;for(0!==h[p=0]&&(l[0]=1,++m),r=1;r<a;r++)h[p]!==h[p+1]&&(l[r]=h[p]?2:1,++m),p++;for(0!==h[p]&&(l[r]=2,++m),t=1;t<i;t++){n=t*o,h[(p=t*u)-u]!==h[p]&&(l[n]=h[p]?1:8,++m);var v=(h[p]?4:0)+(h[p-u]?8:0);for(r=1;r<a;r++)c[v=(v>>2)+(h[p+1]?4:0)+(h[p-u+1]?8:0)]&&(l[n+r]=c[v],++m),p++;if(h[p-u]!==h[p]&&(l[n+r]=h[p]?2:4,++m),m>1e3)return null}for(n=t*o,0!==h[p=u*(i-1)]&&(l[n]=8,++m),r=1;r<a;r++)h[p]!==h[p+1]&&(l[n+r]=h[p]?4:8,++m),p++;if(0!==h[p]&&(l[n+r]=4,++m),m>1e3)return null;var b=new Int32Array([0,o,-1,0,-o,0,0,0,1]),y=[];for(t=0;m&&t<=i;t++){for(var A=t*o,_=A+a;A<_&&!l[A];)A++;if(A!==_){var x,S=[A%o,t],w=l[A],P=A;do{var C=b[w];do{A+=C}while(!l[A]);5!==(x=l[A])&&10!==x?(w=x,l[A]=0):(w=x&51*w>>4,l[A]&=w>>2|w<<2),S.push(A%o),S.push(A/o|0),l[A]||--m}while(P!==A);y.push(S),--t}}return function(e){e.save(),e.scale(1/a,-1/i),e.translate(0,-i),e.beginPath();for(let r=0,n=y.length;r<n;r++){var t=y[r];e.moveTo(t[0],t[1]);for(let r=2,n=t.length;r<n;r+=2)e.lineTo(t[r],t[r+1])}e.fill(),e.beginPath(),e.restore()}}({data:e.data,width:n,height:s}):null),o&&o.compiled)o.compiled(t);else{var l=this.cachedCanvases.getCanvas("maskCanvas",n,s),c=l.context;c.save(),r(c,e),c.globalCompositeOperation="source-in",c.fillStyle=i?a.getPattern(c,this):a,c.fillRect(0,0,n,s),c.restore(),this.paintInlineImageXObject(l.canvas)}},paintImageMaskXObjectRepeat:function(e,t,n,s){var a=e.width,i=e.height,o=this.current.fillColor,l=this.current.patternFill,c=this.cachedCanvases.getCanvas("maskCanvas",a,i),u=c.context;u.save(),r(u,e),u.globalCompositeOperation="source-in",u.fillStyle=l?o.getPattern(u,this):o,u.fillRect(0,0,a,i),u.restore();for(var d=this.ctx,h=0,p=s.length;h<p;h+=2)d.save(),d.transform(t,0,0,n,s[h],s[h+1]),d.scale(1,-1),d.drawImage(c.canvas,0,0,a,i,0,-1,1,1),d.restore()},paintImageMaskXObjectGroup:function(e){for(var t=this.ctx,n=this.current.fillColor,s=this.current.patternFill,a=0,i=e.length;a<i;a++){var o=e[a],l=o.width,c=o.height,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),d=u.context;d.save(),r(d,o),d.globalCompositeOperation="source-in",d.fillStyle=s?n.getPattern(d,this):n,d.fillRect(0,0,l,c),d.restore(),t.save(),t.transform.apply(t,o.transform),t.scale(1,-1),t.drawImage(u.canvas,0,0,l,c,0,-1,1,1),t.restore()}},paintImageXObject:function(e){const t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,n.warn)("Dependent image isn't ready yet")},paintImageXObjectRepeat:function(e,t,r,s){const a=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);if(a){for(var i=a.width,o=a.height,l=[],c=0,u=s.length;c<u;c+=2)l.push({transform:[t,0,0,r,s[c],s[c+1]],x:0,y:0,w:i,h:o});this.paintInlineImageXObjectGroup(a,l)}else(0,n.warn)("Dependent image isn't ready yet")},paintInlineImageXObject:function(e){var r=e.width,n=e.height,s=this.ctx;this.save(),s.scale(1/r,-1/n);var a,i,o=s.mozCurrentTransformInverse,l=o[0],c=o[1],u=Math.max(Math.sqrt(l*l+c*c),1),d=o[2],h=o[3],p=Math.max(Math.sqrt(d*d+h*h),1);if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)a=e;else{var f=(i=this.cachedCanvases.getCanvas("inlineImage",r,n)).context;t(f,e),a=i.canvas}for(var g=r,m=n,v="prescale1";u>2&&g>1||p>2&&m>1;){var b=g,y=m;u>2&&g>1&&(u/=g/(b=Math.ceil(g/2))),p>2&&m>1&&(p/=m/(y=Math.ceil(m/2))),(f=(i=this.cachedCanvases.getCanvas(v,b,y)).context).clearRect(0,0,b,y),f.drawImage(a,0,0,g,m,0,0,b,y),a=i.canvas,g=b,m=y,v="prescale1"===v?"prescale2":"prescale1"}if(s.drawImage(a,0,0,g,m,0,-n,r,n),this.imageLayer){var A=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:e,left:A[0],top:A[1],width:r/o[0],height:n/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,r){var n=this.ctx,s=e.width,a=e.height,i=this.cachedCanvases.getCanvas("inlineImage",s,a);t(i.context,e);for(var o=0,l=r.length;o<l;o++){var c=r[o];if(n.save(),n.transform.apply(n,c.transform),n.scale(1,-1),n.drawImage(i.canvas,c.x,c.y,c.w,c.h,0,-1,1,1),this.imageLayer){var u=this.getCanvasPosition(c.x,c.y);this.imageLayer.appendImage({imgData:e,left:u[0],top:u[1],width:s,height:a})}n.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},paintXObject:function(){(0,n.warn)("Unsupported 'paintXObject' command.")},markPoint:function(e){},markPointProps:function(e,t){},beginMarkedContent:function(e){},beginMarkedContentProps:function(e,t){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var e=this.ctx;this.pendingClip&&(this.pendingClip===A?e.clip("evenodd"):e.clip(),this.pendingClip=null),e.beginPath()},getSinglePixelWidth(e){if(null===this._cachedGetSinglePixelWidth){const e=this.ctx.mozCurrentTransformInverse;this._cachedGetSinglePixelWidth=Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1],e[2]*e[2]+e[3]*e[3]))}return this._cachedGetSinglePixelWidth},getCanvasPosition:function(e,t){var r=this.ctx.mozCurrentTransform;return[r[0]*e+r[2]*t+r[4],r[1]*e+r[3]*t+r[5]]}},n.OPS)e.prototype[n.OPS[_]]=e.prototype[_];return e}();t.CanvasGraphics=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShadingPatternFromIR=function(e){var t=s[e[0]];if(!t)throw new Error(`Unknown IR type: ${e[0]}`);return t.fromIR(e)},t.TilingPattern=void 0;var n=r(2),s={};function a(e,t){if(!t||"undefined"==typeof Path2D)return;const r=t[2]-t[0],n=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],r,n),e.clip(s)}s.RadialAxial={fromIR:function(e){var t=e[1],r=e[2],n=e[3],s=e[4],i=e[5],o=e[6],l=e[7];return{type:"Pattern",getPattern:function(e){var c;a(e,r),"axial"===t?c=e.createLinearGradient(s[0],s[1],i[0],i[1]):"radial"===t&&(c=e.createRadialGradient(s[0],s[1],o,i[0],i[1],l));for(var u=0,d=n.length;u<d;++u){var h=n[u];c.addColorStop(h[0],h[1])}return c}}}};var i=function(){function e(e,t,r,n,s,a,i,o){var l,c=t.coords,u=t.colors,d=e.data,h=4*e.width;c[r+1]>c[n+1]&&(l=r,r=n,n=l,l=a,a=i,i=l),c[n+1]>c[s+1]&&(l=n,n=s,s=l,l=i,i=o,o=l),c[r+1]>c[n+1]&&(l=r,r=n,n=l,l=a,a=i,i=l);var p=(c[r]+t.offsetX)*t.scaleX,f=(c[r+1]+t.offsetY)*t.scaleY,g=(c[n]+t.offsetX)*t.scaleX,m=(c[n+1]+t.offsetY)*t.scaleY,v=(c[s]+t.offsetX)*t.scaleX,b=(c[s+1]+t.offsetY)*t.scaleY;if(!(f>=b))for(var y,A,_,x,S,w,P,C,k=u[a],R=u[a+1],E=u[a+2],T=u[i],L=u[i+1],F=u[i+2],O=u[o],D=u[o+1],I=u[o+2],M=Math.round(f),N=Math.round(b),j=M;j<=N;j++){if(j<m){let e;e=j<f?0:f===m?1:(f-j)/(f-m),y=p-(p-g)*e,A=k-(k-T)*e,_=R-(R-L)*e,x=E-(E-F)*e}else{let e;e=j>b?1:m===b?0:(m-j)/(m-b),y=g-(g-v)*e,A=T-(T-O)*e,_=L-(L-D)*e,x=F-(F-I)*e}let e;e=j<f?0:j>b?1:(f-j)/(f-b),S=p-(p-v)*e,w=k-(k-O)*e,P=R-(R-D)*e,C=E-(E-I)*e;for(var U=Math.round(Math.min(y,S)),W=Math.round(Math.max(y,S)),q=h*j+4*U,G=U;G<=W;G++)e=(y-G)/(y-S),e<0?e=0:e>1&&(e=1),d[q++]=A-(A-w)*e|0,d[q++]=_-(_-P)*e|0,d[q++]=x-(x-C)*e|0,d[q++]=255}}function t(t,r,n){var s,a,i=r.coords,o=r.colors;switch(r.type){case"lattice":var l=r.verticesPerRow,c=Math.floor(i.length/l)-1,u=l-1;for(s=0;s<c;s++)for(var d=s*l,h=0;h<u;h++,d++)e(t,n,i[d],i[d+1],i[d+l],o[d],o[d+1],o[d+l]),e(t,n,i[d+l+1],i[d+1],i[d+l],o[d+l+1],o[d+1],o[d+l]);break;case"triangles":for(s=0,a=i.length;s<a;s+=3)e(t,n,i[s],i[s+1],i[s+2],o[s],o[s+1],o[s+2]);break;default:throw new Error("illegal figure")}}return function(e,r,n,s,a,i,o,l){var c,u,d,h,p=Math.floor(e[0]),f=Math.floor(e[1]),g=Math.ceil(e[2])-p,m=Math.ceil(e[3])-f,v=Math.min(Math.ceil(Math.abs(g*r[0]*1.1)),3e3),b=Math.min(Math.ceil(Math.abs(m*r[1]*1.1)),3e3),y=g/v,A=m/b,_={coords:n,colors:s,offsetX:-p,offsetY:-f,scaleX:1/y,scaleY:1/A},x=v+4,S=b+4;if(l.isEnabled)c=l.drawFigures({width:v,height:b,backgroundColor:i,figures:a,context:_}),(u=o.getCanvas("mesh",x,S,!1)).context.drawImage(c,2,2),c=u.canvas;else{var w=(u=o.getCanvas("mesh",x,S,!1)).context,P=w.createImageData(v,b);if(i){var C=P.data;for(d=0,h=C.length;d<h;d+=4)C[d]=i[0],C[d+1]=i[1],C[d+2]=i[2],C[d+3]=255}for(d=0;d<a.length;d++)t(P,a[d],_);w.putImageData(P,2,2),c=u.canvas}return{canvas:c,offsetX:p-2*y,offsetY:f-2*A,scaleX:y,scaleY:A}}}();s.Mesh={fromIR:function(e){var t=e[2],r=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return{type:"Pattern",getPattern:function(e,d,h){var p;if(a(e,c),h)p=n.Util.singularValueDecompose2dScale(e.mozCurrentTransform);else if(p=n.Util.singularValueDecompose2dScale(d.baseTransform),l){var f=n.Util.singularValueDecompose2dScale(l);p=[p[0]*f[0],p[1]*f[1]]}var g=i(o,p,t,r,s,h?null:u,d.cachedCanvases,d.webGLContext);return h||(e.setTransform.apply(e,d.baseTransform),l&&e.transform.apply(e,l)),e.translate(g.offsetX,g.offsetY),e.scale(g.scaleX,g.scaleY),e.createPattern(g.canvas,"no-repeat")}}}},s.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};var o=function(){function e(e,t,r,n,s){this.operatorList=e[2],this.matrix=e[3]||[1,0,0,1,0,0],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.canvasGraphicsFactory=n,this.baseTransform=s,this.type="Pattern",this.ctx=r}return e.prototype={createPatternCanvas:function(e){var t=this.operatorList,r=this.bbox,s=this.xstep,a=this.ystep,i=this.paintType,o=this.tilingType,l=this.color,c=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+o);var u=r[0],d=r[1],h=r[2],p=r[3],f=n.Util.singularValueDecompose2dScale(this.matrix),g=n.Util.singularValueDecompose2dScale(this.baseTransform),m=[f[0]*g[0],f[1]*g[1]],v=this.getSizeAndScale(s,this.ctx.canvas.width,m[0]),b=this.getSizeAndScale(a,this.ctx.canvas.height,m[1]),y=e.cachedCanvases.getCanvas("pattern",v.size,b.size,!0),A=y.context,_=c.createCanvasGraphics(A);return _.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(_,i,l),_.transform(v.scale,0,0,b.scale,0,0),_.transform(1,0,0,1,-u,-d),this.clipBbox(_,r,u,d,h,p),_.executeOperatorList(t),this.ctx.transform(1,0,0,1,u,d),this.ctx.scale(1/v.scale,1/b.scale),y.canvas},getSizeAndScale:function(e,t,r){e=Math.abs(e);var n=Math.max(3e3,t),s=Math.ceil(e*r);return s>=n?s=n:r=s/e,{scale:r,size:s}},clipBbox:function(e,t,r,n,s,a){if(Array.isArray(t)&&4===t.length){var i=s-r,o=a-n;e.ctx.rect(r,n,i,o),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(e,t,r){const s=e.ctx,a=e.current;switch(t){case 1:var i=this.ctx;s.fillStyle=i.fillStyle,s.strokeStyle=i.strokeStyle,a.fillColor=i.fillStyle,a.strokeColor=i.strokeStyle;break;case 2:var o=n.Util.makeCssRgb(r[0],r[1],r[2]);s.fillStyle=o,s.strokeStyle=o,a.fillColor=o,a.strokeColor=o;break;default:throw new n.FormatError(`Unsupported paint type: ${t}`)}},getPattern:function(e,t){(e=this.ctx).setTransform.apply(e,this.baseTransform),e.transform.apply(e,this.matrix);var r=this.createPatternCanvas(t);return e.createPattern(r,"repeat")}},e}();t.TilingPattern=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var n=r(2);function s(e){if("object"!=typeof e||null===e)return e;switch(e.name){case"AbortException":return new n.AbortException(e.message);case"MissingPDFException":return new n.MissingPDFException(e.message);case"UnexpectedResponseException":return new n.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new n.UnknownErrorException(e.message,e.details);default:return new n.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,r){this.sourceName=e,this.targetName=t,this.comObj=r,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=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,r=this.callbackCapabilities[e];if(!r)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)r.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");r.reject(s(t.reason))}return}const n=this.actionHandler[t.action];if(!n)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,a=t.sourceName;new Promise((function(e){e(n(t.data))})).then((function(n){r.postMessage({sourceName:e,targetName:a,callback:1,callbackId:t.callbackId,data:n})}),(function(n){r.postMessage({sourceName:e,targetName:a,callback:2,callbackId:t.callbackId,reason:s(n)})}))}else t.streamId?this._createStreamSink(t):n(t.data)},r.addEventListener("message",this._onComObjOnMessage)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const s=this.callbackId++,a=(0,n.createPromiseCapability)();this.callbackCapabilities[s]=a;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:s,data:t},r)}catch(e){a.reject(e)}return a.promise}sendWithStream(e,t,r,a){const i=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,n.createPromiseCapability)();return this.streamControllers[i]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:o,targetName:l,action:e,streamId:i,data:t,desiredSize:r.desiredSize},a),s.promise},pull:e=>{const t=(0,n.createPromiseCapability)();return this.streamControllers[i].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:6,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,n.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,n.createPromiseCapability)();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:1,streamId:i,reason:s(e)}),t.promise}},r)}_createStreamSink(e){const t=this,r=this.actionHandler[e.action],a=e.streamId,i=this.sourceName,o=e.sourceName,l=this.comObj,c={enqueue(e,r=1,s){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,n.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:i,targetName:o,stream:4,streamId:a,chunk:e},s)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:o,stream:3,streamId:a}),delete t.streamSinks[a])},error(e){(0,n.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:i,targetName:o,stream:5,streamId:a,reason:s(e)}))},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[a]=c,new Promise((function(t){t(r(e.data,c))})).then((function(){l.postMessage({sourceName:i,targetName:o,stream:8,streamId:a,success:!0})}),(function(e){l.postMessage({sourceName:i,targetName:o,stream:8,streamId:a,reason:s(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,a=e.sourceName,i=this.comObj;switch(e.stream){case 8:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(s(e.reason));break;case 7:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(s(e.reason));break;case 6:if(!this.streamSinks[t]){i.postMessage({sourceName:r,targetName:a,stream:7,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;const{onPull:o}=this.streamSinks[e.streamId];new Promise((function(e){e(o&&o())})).then((function(){i.postMessage({sourceName:r,targetName:a,stream:7,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:a,stream:7,streamId:t,reason:s(e)})}));break;case 4:if((0,n.assert)(this.streamControllers[t],"enqueue should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].controller.enqueue(e.chunk);break;case 3:if((0,n.assert)(this.streamControllers[t],"close should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].isClosed=!0,this.streamControllers[t].controller.close(),this._deleteStreamController(t);break;case 5:(0,n.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(s(e.reason)),this._deleteStreamController(t);break;case 2:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(s(e.reason)),this._deleteStreamController(t);break;case 1:if(!this.streamSinks[t])break;const{onCancel:l}=this.streamSinks[e.streamId];new Promise((function(t){t(l&&l(s(e.reason)))})).then((function(){i.postMessage({sourceName:r,targetName:a,stream:2,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:a,stream:2,streamId:t,reason:s(e)})})),this.streamSinks[t].sinkCapability.reject(s(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(e){return e&&e.promise}))),delete this.streamControllers[e]}_postMessage(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=r(2),s=r(13);t.Metadata=class{constructor(e){(0,n.assert)("string"==typeof e,"Metadata: input is not a string"),e=this._repair(e);const t=(new s.SimpleXMLParser).parseFromString(e);this._metadataMap=new Map,t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const r=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,r,n){return String.fromCharCode(64*t+8*r+1*n)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)}));let n="";for(let e=0,t=r.length;e<t;e+=2){const t=256*r.charCodeAt(e)+r.charCodeAt(e+1);n+=t>=32&&t<127&&60!==t&&62!==t&&38!==t?String.fromCharCode(t):"&#x"+(65536+t).toString(16).substring(1)+";"}return">"+n}))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;const r=t?t.nodeName.toLowerCase():null;if(!t||"rdf:rdf"!==r||!t.hasChildNodes())return;const n=t.childNodes;for(let e=0,t=n.length;e<t;e++){const t=n[e];if("rdf:description"===t.nodeName.toLowerCase())for(let e=0,r=t.childNodes.length;e<r;e++)if("#text"!==t.childNodes[e].nodeName.toLowerCase()){const r=t.childNodes[e],n=r.nodeName.toLowerCase();this._metadataMap.set(n,r.textContent.trim())}}}get(e){return this._metadataMap.has(e)?this._metadataMap.get(e):null}getAll(){const e=Object.create(null);for(const[t,r]of this._metadataMap)e[t]=r;return e}has(e){return this._metadataMap.has(e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleXMLParser=void 0;function n(e,t){const r=e[t];return" "===r||"\n"===r||"\r"===r||"\t"===r}class s{constructor(e,t){this.nodeName=e,this.nodeValue=t,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}}t.SimpleXMLParser=class extends class{_resolveEntities(e){return e.replace(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCharCode(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCharCode(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(t)}))}_parseContent(e,t){const r=[];let s=t;function a(){for(;s<e.length&&n(e,s);)++s}for(;s<e.length&&!n(e,s)&&">"!==e[s]&&"/"!==e[s];)++s;const i=e.substring(t,s);for(a();s<e.length&&">"!==e[s]&&"/"!==e[s]&&"?"!==e[s];){a();let t="",i="";for(;s<e.length&&!n(e,s)&&"="!==e[s];)t+=e[s],++s;if(a(),"="!==e[s])return null;++s,a();const o=e[s];if('"'!==o&&"'"!==o)return null;const l=e.indexOf(o,++s);if(l<0)return null;i=e.substring(s,l),r.push({name:t,value:this._resolveEntities(i)}),s=l+1,a()}return{name:i,attributes:r,parsed:s-t}}_parseProcessingInstruction(e,t){let r=t;for(;r<e.length&&!n(e,r)&&">"!==e[r]&&"/"!==e[r];)++r;const s=e.substring(t,r);!function(){for(;r<e.length&&n(e,r);)++r}();const a=r;for(;r<e.length&&("?"!==e[r]||">"!==e[r+1]);)++r;return{name:s,value:e.substring(a,r),parsed:r-t}}parseXml(e){let t=0;for(;t<e.length;){let r=t;if("<"===e[t]){let t;switch(++r,e[r]){case"/":if(++r,t=e.indexOf(">",r),t<0)return void this.onError(-9);this.onEndElement(e.substring(r,t)),r=t+1;break;case"?":++r;const n=this._parseProcessingInstruction(e,r);if("?>"!==e.substring(r+n.parsed,r+n.parsed+2))return void this.onError(-3);this.onPi(n.name,n.value),r+=n.parsed+2;break;case"!":if("--"===e.substring(r+1,r+3)){if(t=e.indexOf("--\x3e",r+3),t<0)return void this.onError(-5);this.onComment(e.substring(r+3,t)),r=t+3}else if("[CDATA["===e.substring(r+1,r+8)){if(t=e.indexOf("]]>",r+8),t<0)return void this.onError(-2);this.onCdata(e.substring(r+8,t)),r=t+3}else{if("DOCTYPE"!==e.substring(r+1,r+8))return void this.onError(-6);{const n=e.indexOf("[",r+8);let s=!1;if(t=e.indexOf(">",r+8),t<0)return void this.onError(-4);if(n>0&&t>n){if(t=e.indexOf("]>",r+8),t<0)return void this.onError(-4);s=!0}const a=e.substring(r+8,t+(s?1:0));this.onDoctype(a),r=t+(s?2:1)}}break;default:const s=this._parseContent(e,r);if(null===s)return void this.onError(-6);let a=!1;if("/>"===e.substring(r+s.parsed,r+s.parsed+2))a=!0;else if(">"!==e.substring(r+s.parsed,r+s.parsed+1))return void this.onError(-9);this.onBeginElement(s.name,s.attributes,a),r+=s.parsed+(a?2:1)}}else{for(;r<e.length&&"<"!==e[r];)r++;const n=e.substring(t,r);this.onText(this._resolveEntities(n))}t=r}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,r){}onEndElement(e){}onError(e){}}{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=0}parseFromString(e){if(this._currentFragment=[],this._stack=[],this._errorCode=0,this.parseXml(e),0!==this._errorCode)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onResolveEntity(e){return"apos"===e?"'":super.onResolveEntity(e)}onText(e){if(function(e){for(let t=0,r=e.length;t<r;t++)if(!n(e,t))return!1;return!0}(e))return;const t=new s("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new s("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,r){const n=new s(e);n.childNodes=[],this._currentFragment.push(n),r||(this._stack.push(this._currentFragment),this._currentFragment=n.childNodes)}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment[this._currentFragment.length-1];if(t)for(let e=0,r=t.childNodes.length;e<r;e++)t.childNodes[e].parentNode=t}onError(e){this._errorCode=e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var n=r(2);t.PDFDataTransportStream=class{constructor(e,t){(0,n.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1;const r=e.initialData;if(r&&r.length>0){const e=new Uint8Array(r).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const r=this._rangeReaders.some((function(r){return r._begin===e.begin&&(r._enqueue(t),!0)}));(0,n.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t&&t.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t&&t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new s(this,e,this._progressiveDone)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new a(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeReaders.slice(0).forEach((function(t){t.cancel(e)})),this._pdfDataRangeTransport.abort()}};class s{constructor(e,t,r=!1){this._stream=e,this._done=r||!1,this._filename=null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class a{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){this._done||(0===this._requests.length?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._stream._removeRangeReader(this)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=void 0;var n=r(2);t.WebGLContext=class{constructor({enable:e=!1}){this._enabled=!0===e}get isEnabled(){let e=this._enabled;return e&&(e=s.tryInitGL()),(0,n.shadow)(this,"isEnabled",e)}composeSMask({layer:e,mask:t,properties:r}){return s.composeSMask(e,t,r)}drawFigures({width:e,height:t,backgroundColor:r,figures:n,context:a}){return s.drawFigures(e,t,r,n,a)}clear(){s.cleanup()}};var s=function(){function e(e,t,r){var n=e.createShader(r);if(e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS)){var s=e.getShaderInfoLog(n);throw new Error("Error during shader compilation: "+s)}return n}function t(t,r){return e(t,r,t.VERTEX_SHADER)}function r(t,r){return e(t,r,t.FRAGMENT_SHADER)}function n(e,t){for(var r=e.createProgram(),n=0,s=t.length;n<s;++n)e.attachShader(r,t[n]);if(e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS)){var a=e.getProgramInfoLog(r);throw new Error("Error during program linking: "+a)}return r}function s(e,t,r){e.activeTexture(r);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),n}var a,i;function o(){a||(i=document.createElement("canvas"),a=i.getContext("webgl",{premultipliedalpha:!1}))}var l=null,c=null;return{tryInitGL(){try{return o(),!!a}catch(e){}return!1},composeSMask:function(e,c,u){var d=e.width,h=e.height;l||function(){var e,s;o(),e=i,i=null,s=a,a=null;var c=n(s,[t(s,"  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;                                      }                                                             "),r(s,"  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;                                    }                                                             ")]);s.useProgram(c);var u={};u.gl=s,u.canvas=e,u.resolutionLocation=s.getUniformLocation(c,"u_resolution"),u.positionLocation=s.getAttribLocation(c,"a_position"),u.backdropLocation=s.getUniformLocation(c,"u_backdrop"),u.subtypeLocation=s.getUniformLocation(c,"u_subtype");var d=s.getAttribLocation(c,"a_texCoord"),h=s.getUniformLocation(c,"u_image"),p=s.getUniformLocation(c,"u_mask"),f=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,f),s.bufferData(s.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),s.STATIC_DRAW),s.enableVertexAttribArray(d),s.vertexAttribPointer(d,2,s.FLOAT,!1,0,0),s.uniform1i(h,0),s.uniform1i(p,1),l=u}();var p=l,f=p.canvas,g=p.gl;f.width=d,f.height=h,g.viewport(0,0,g.drawingBufferWidth,g.drawingBufferHeight),g.uniform2f(p.resolutionLocation,d,h),u.backdrop?g.uniform4f(p.resolutionLocation,u.backdrop[0],u.backdrop[1],u.backdrop[2],1):g.uniform4f(p.resolutionLocation,0,0,0,0),g.uniform1i(p.subtypeLocation,"Luminosity"===u.subtype?1:0);var m=s(g,e,g.TEXTURE0),v=s(g,c,g.TEXTURE1),b=g.createBuffer();return g.bindBuffer(g.ARRAY_BUFFER,b),g.bufferData(g.ARRAY_BUFFER,new Float32Array([0,0,d,0,0,h,0,h,d,0,d,h]),g.STATIC_DRAW),g.enableVertexAttribArray(p.positionLocation),g.vertexAttribPointer(p.positionLocation,2,g.FLOAT,!1,0,0),g.clearColor(0,0,0,0),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.clear(g.COLOR_BUFFER_BIT),g.drawArrays(g.TRIANGLES,0,6),g.flush(),g.deleteTexture(m),g.deleteTexture(v),g.deleteBuffer(b),f},drawFigures:function(e,s,l,u,d){c||function(){var e,s;o(),e=i,i=null,s=a,a=null;var l=n(s,[t(s,"  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);                         }                                                             "),r(s,"  precision mediump float;                                                                                                        varying vec4 v_color;                                                                                                           void main() {                                                     gl_FragColor = v_color;                                       }                                                             ")]);s.useProgram(l);var u={};u.gl=s,u.canvas=e,u.resolutionLocation=s.getUniformLocation(l,"u_resolution"),u.scaleLocation=s.getUniformLocation(l,"u_scale"),u.offsetLocation=s.getUniformLocation(l,"u_offset"),u.positionLocation=s.getAttribLocation(l,"a_position"),u.colorLocation=s.getAttribLocation(l,"a_color"),c=u}();var h=c,p=h.canvas,f=h.gl;p.width=e,p.height=s,f.viewport(0,0,f.drawingBufferWidth,f.drawingBufferHeight),f.uniform2f(h.resolutionLocation,e,s);var g,m,v,b=0;for(g=0,m=u.length;g<m;g++)switch(u[g].type){case"lattice":b+=((v=u[g].coords.length/u[g].verticesPerRow|0)-1)*(u[g].verticesPerRow-1)*6;break;case"triangles":b+=u[g].coords.length}var y=new Float32Array(2*b),A=new Uint8Array(3*b),_=d.coords,x=d.colors,S=0,w=0;for(g=0,m=u.length;g<m;g++){var P=u[g],C=P.coords,k=P.colors;switch(P.type){case"lattice":var R=P.verticesPerRow;v=C.length/R|0;for(var E=1;E<v;E++)for(var T=E*R+1,L=1;L<R;L++,T++)y[S]=_[C[T-R-1]],y[S+1]=_[C[T-R-1]+1],y[S+2]=_[C[T-R]],y[S+3]=_[C[T-R]+1],y[S+4]=_[C[T-1]],y[S+5]=_[C[T-1]+1],A[w]=x[k[T-R-1]],A[w+1]=x[k[T-R-1]+1],A[w+2]=x[k[T-R-1]+2],A[w+3]=x[k[T-R]],A[w+4]=x[k[T-R]+1],A[w+5]=x[k[T-R]+2],A[w+6]=x[k[T-1]],A[w+7]=x[k[T-1]+1],A[w+8]=x[k[T-1]+2],y[S+6]=y[S+2],y[S+7]=y[S+3],y[S+8]=y[S+4],y[S+9]=y[S+5],y[S+10]=_[C[T]],y[S+11]=_[C[T]+1],A[w+9]=A[w+3],A[w+10]=A[w+4],A[w+11]=A[w+5],A[w+12]=A[w+6],A[w+13]=A[w+7],A[w+14]=A[w+8],A[w+15]=x[k[T]],A[w+16]=x[k[T]+1],A[w+17]=x[k[T]+2],S+=12,w+=18;break;case"triangles":for(var F=0,O=C.length;F<O;F++)y[S]=_[C[F]],y[S+1]=_[C[F]+1],A[w]=x[k[F]],A[w+1]=x[k[F]+1],A[w+2]=x[k[F]+2],S+=2,w+=3}}l?f.clearColor(l[0]/255,l[1]/255,l[2]/255,1):f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT);var D=f.createBuffer();f.bindBuffer(f.ARRAY_BUFFER,D),f.bufferData(f.ARRAY_BUFFER,y,f.STATIC_DRAW),f.enableVertexAttribArray(h.positionLocation),f.vertexAttribPointer(h.positionLocation,2,f.FLOAT,!1,0,0);var I=f.createBuffer();return f.bindBuffer(f.ARRAY_BUFFER,I),f.bufferData(f.ARRAY_BUFFER,A,f.STATIC_DRAW),f.enableVertexAttribArray(h.colorLocation),f.vertexAttribPointer(h.colorLocation,3,f.UNSIGNED_BYTE,!1,0,0),f.uniform2f(h.scaleLocation,d.scaleX,d.scaleY),f.uniform2f(h.offsetLocation,d.offsetX,d.offsetY),f.drawArrays(f.TRIANGLES,0,b),f.flush(),f.deleteBuffer(D),f.deleteBuffer(I),p},cleanup(){l&&l.canvas&&(l.canvas.width=0,l.canvas.height=0),c&&c.canvas&&(c.canvas.width=0,c.canvas.height=0),l=null,c=null}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var n=r(1),s=r(2);class a{static create(e){switch(e.data.annotationType){case s.AnnotationType.LINK:return new o(e);case s.AnnotationType.TEXT:return new l(e);case s.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new u(e);case"Btn":return e.data.radioButton?new h(e):e.data.checkBox?new d(e):new p(e);case"Ch":return new f(e)}return new c(e);case s.AnnotationType.POPUP:return new g(e);case s.AnnotationType.FREETEXT:return new v(e);case s.AnnotationType.LINE:return new b(e);case s.AnnotationType.SQUARE:return new y(e);case s.AnnotationType.CIRCLE:return new A(e);case s.AnnotationType.POLYLINE:return new _(e);case s.AnnotationType.CARET:return new S(e);case s.AnnotationType.INK:return new w(e);case s.AnnotationType.POLYGON:return new x(e);case s.AnnotationType.HIGHLIGHT:return new P(e);case s.AnnotationType.UNDERLINE:return new C(e);case s.AnnotationType.SQUIGGLY:return new k(e);case s.AnnotationType.STRIKEOUT:return new R(e);case s.AnnotationType.STAMP:return new E(e);case s.AnnotationType.FILEATTACHMENT:return new T(e);default:return new i(e)}}}class i{constructor(e,t=!1,r=!1){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderInteractiveForms=e.renderInteractiveForms,this.svgFactory=e.svgFactory,t&&(this.container=this._createContainer(r))}_createContainer(e=!1){const t=this.data,r=this.page,n=this.viewport,a=document.createElement("section");let i=t.rect[2]-t.rect[0],o=t.rect[3]-t.rect[1];a.setAttribute("data-annotation-id",t.id);const l=s.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]);if(a.style.transform=`matrix(${n.transform.join(",")})`,a.style.transformOrigin=`-${l[0]}px -${l[1]}px`,!e&&t.borderStyle.width>0){a.style.borderWidth=`${t.borderStyle.width}px`,t.borderStyle.style!==s.AnnotationBorderStyleType.UNDERLINE&&(i-=2*t.borderStyle.width,o-=2*t.borderStyle.width);const e=t.borderStyle.horizontalCornerRadius,r=t.borderStyle.verticalCornerRadius;if(e>0||r>0){const t=`${e}px / ${r}px`;a.style.borderRadius=t}switch(t.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}t.color?a.style.borderColor=s.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):a.style.borderWidth=0}return a.style.left=`${l[0]}px`,a.style.top=`${l[1]}px`,a.style.width=`${i}px`,a.style.height=`${o}px`,a}_createPopup(e,t,r){t||((t=document.createElement("div")).style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));const n=new m({container:e,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}).render();n.style.left=e.style.width,e.appendChild(n)}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}}class o extends i{constructor(e){super(e,!!(e.data.url||e.data.dest||e.data.action))}render(){this.container.className="linkAnnotation";const{data:e,linkService:t}=this,r=document.createElement("a");return e.url?(0,n.addLinkAttributes)(r,{url:e.url,target:e.newWindow?n.LinkTarget.BLANK:t.externalLinkTarget,rel:t.externalLinkRel,enabled:t.externalLinkEnabled}):e.action?this._bindNamedAction(r,e.action):this._bindLink(r,e.dest),this.container.appendChild(r),this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.navigateTo(t),!1),t&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}}class l extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents))}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}class c extends i{render(){return this.container}}class u extends c{constructor(e){super(e,e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue)}render(){this.container.className="textWidgetAnnotation";let e=null;if(this.renderInteractiveForms){if(this.data.multiLine?(e=document.createElement("textarea"),e.textContent=this.data.fieldValue):(e=document.createElement("input"),e.type="text",e.setAttribute("value",this.data.fieldValue)),e.disabled=this.data.readOnly,e.name=this.data.fieldName,null!==this.data.maxLen&&(e.maxLength=this.data.maxLen),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;e.classList.add("comb"),e.style.letterSpacing=`calc(${t}px - 1ch)`}}else{e=document.createElement("div"),e.textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell";let t=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(t=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(e,t)}return null!==this.data.textAlignment&&(e.style.textAlign=["left","center","right"][this.data.textAlignment]),this.container.appendChild(e),this.container}_setTextStyle(e,t){const r=e.style;if(r.fontSize=`${this.data.fontSize}px`,r.direction=this.data.fontDirection<0?"rtl":"ltr",!t)return;let n="normal";t.black?n="900":t.bold&&(n="bold"),r.fontWeight=n,r.fontStyle=t.italic?"italic":"normal";const s=t.loadedName?`"${t.loadedName}", `:"",a=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=s+a}}class d extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation checkBox";const e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",e.name=this.data.fieldName,this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}class h extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}class p extends o{render(){const e=super.render();return e.className="buttonWidgetAnnotation pushButton",e}}class f extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const e=document.createElement("select");e.disabled=this.data.readOnly,e.name=this.data.fieldName,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));for(const t of this.data.options){const r=document.createElement("option");r.textContent=t.displayValue,r.value=t.exportValue,this.data.fieldValue.includes(t.displayValue)&&r.setAttribute("selected",!0),e.appendChild(r)}return this.container.appendChild(e),this.container}}class g extends i{constructor(e){super(e,!(!e.data.title&&!e.data.contents))}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelector(e);if(!t)return this.container;const r=new m({container:this.container,trigger:t,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),n=parseFloat(t.style.left),s=parseFloat(t.style.width);return this.container.style.transformOrigin=`-${n+s}px -${t.style.top}`,this.container.style.left=`${n+s}px`,this.container.appendChild(r.render()),this.container}}class m{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);const t=document.createElement("div");t.className="popup";const r=this.color;if(r){const e=.7*(255-r[0])+r[0],n=.7*(255-r[1])+r[1],a=.7*(255-r[2])+r[2];t.style.backgroundColor=s.Util.makeCssRgb(0|e,0|n,0|a)}const a=document.createElement("h1");a.textContent=this.title,t.appendChild(a);const i=n.PDFDateString.toDateObject(this.modificationDate);if(i){const e=document.createElement("span");e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:i.toLocaleDateString(),time:i.toLocaleTimeString()}),t.appendChild(e)}const o=this._formatContents(this.contents);return t.appendChild(o),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),t.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(t),e}_formatContents(e){const t=document.createElement("p"),r=e.split(/(?:\r\n?|\n)/);for(let e=0,n=r.length;e<n;++e){const s=r[e];t.appendChild(document.createTextNode(s)),e<n-1&&t.appendChild(document.createElement("br"))}return t}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(e=!1){e&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}_hide(e=!0){e&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}class v extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class b extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="lineAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),s=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),s.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),s.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),s.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),n.appendChild(s),this.container.append(n),this._createPopup(this.container,s,e),this.container}}class y extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="squareAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),s=e.borderStyle.width,a=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",t-s),a.setAttribute("height",r-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}class A extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){this.container.className="circleAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),s=e.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",t/2),a.setAttribute("cy",r/2),a.setAttribute("rx",t/2-s/2),a.setAttribute("ry",r/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}class _ extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r);let s=[];for(const t of e.vertices){const r=t.x-e.rect[0],n=e.rect[3]-t.y;s.push(r+","+n)}s=s.join(" ");const a=this.svgFactory.createElement(this.svgElementName);return a.setAttribute("points",s),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","none"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}class x extends _{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class S extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class w extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r);for(const t of e.inkLists){let r=[];for(const n of t){const t=n.x-e.rect[0],s=e.rect[3]-n.y;r.push(`${t},${s}`)}r=r.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",r),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","none"),this._createPopup(this.container,s,e),n.appendChild(s)}return this.container.append(n),this.container}}class P extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class C extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class k extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class R extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class E extends i{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents),!0)}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}class T extends i{constructor(e){super(e,!0);const{filename:t,content:r}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(t),this.content=r,this.linkService.eventBus&&this.linkService.eventBus.dispatch("fileattachmentannotation",{source:this,id:(0,s.stringToPDFString)(t),filename:t,content:r})}render(){this.container.className="fileAttachmentAnnotation";const e=document.createElement("div");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}_download(){this.downloadManager?this.downloadManager.downloadData(this.content,this.filename,""):(0,s.warn)("Download cannot be started due to unavailable download manager")}}t.AnnotationLayer=class{static render(e){const t=[],r=[];for(const n of e.annotations)n&&(n.annotationType!==s.AnnotationType.POPUP?t.push(n):r.push(n));r.length&&t.push(...r);for(const r of t){const t=a.create({data:r,layer:e.div,page:e.page,viewport:e.viewport,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderInteractiveForms:e.renderInteractiveForms||!1,svgFactory:new n.DOMSVGFactory});t.isRenderable&&e.div.appendChild(t.render())}}static update(e){for(const t of e.annotations){const r=e.div.querySelector(`[data-annotation-id="${t.id}"]`);r&&(r.style.transform=`matrix(${e.viewport.transform.join(",")})`)}e.div.removeAttribute("hidden")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderTextLayer=void 0;var n=r(2),s=function(){var e=/\S/;function t(t,r,s){var a,i=document.createElement("span"),o={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(t._textDivs.push(i),a=r.str,!e.test(a))return o.isWhitespace=!0,void t._textDivProperties.set(i,o);var l=n.Util.transform(t._viewport.transform,r.transform),c=Math.atan2(l[1],l[0]),u=s[r.fontName];u.vertical&&(c+=Math.PI/2);var d=Math.sqrt(l[2]*l[2]+l[3]*l[3]),h=d;let p,f;u.ascent?h=u.ascent*h:u.descent&&(h=(1+u.descent)*h),0===c?(p=l[4],f=l[5]-h):(p=l[4]+h*Math.sin(c),f=l[5]-h*Math.cos(c)),i.style.left=`${p}px`,i.style.top=`${f}px`,i.style.fontSize=`${d}px`,i.style.fontFamily=u.fontFamily,i.textContent=r.str,t._fontInspectorEnabled&&(i.dataset.fontName=r.fontName),0!==c&&(o.angle=c*(180/Math.PI));let g=!1;if(r.str.length>1)g=!0;else if(r.transform[0]!==r.transform[3]){const e=Math.abs(r.transform[0]),t=Math.abs(r.transform[3]);e!==t&&Math.max(e,t)/Math.min(e,t)>1.5&&(g=!0)}if(g&&(u.vertical?o.canvasWidth=r.height*t._viewport.scale:o.canvasWidth=r.width*t._viewport.scale),t._textDivProperties.set(i,o),t._textContentStream&&t._layoutText(i),t._enhanceTextSelection){var m=1,v=0;0!==c&&(m=Math.cos(c),v=Math.sin(c));var b,y,A=(u.vertical?r.height:r.width)*t._viewport.scale,_=d;0!==c?(b=[m,v,-v,m,p,f],y=n.Util.getAxialAlignedBoundingBox([0,0,A,_],b)):y=[p,f,p+A,f+_],t._bounds.push({left:y[0],top:y[1],right:y[2],bottom:y[3],div:i,size:[A,_],m:b})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,n=t.length;if(n>1e5)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var s=0;s<n;s++)e._layoutText(t[s]);e._renderingDone=!0,r.resolve()}}function s(e,t,r){let n=0;for(let s=0;s<r;s++){const r=e[t++];r>0&&(n=n?Math.min(r,n):r)}return n}function a(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));var r=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];t.forEach((function(e){for(var t=0;t<r.length&&r[t].end<=e.y1;)t++;for(var n,s,a=r.length-1;a>=0&&r[a].start>=e.y2;)a--;var i,o,l=-1/0;for(i=t;i<=a;i++){var c;(c=(s=(n=r[i]).boundary).x2>e.x1?s.index>e.index?s.x1New:e.x1:void 0===s.x2New?(s.x2+e.x1)/2:s.x2New)>l&&(l=c)}for(e.x1New=l,i=t;i<=a;i++)void 0===(s=(n=r[i]).boundary).x2New?s.x2>e.x1?s.index>e.index&&(s.x2New=s.x2):s.x2New=l:s.x2New>l&&(s.x2New=Math.max(l,s.x2));var u=[],d=null;for(i=t;i<=a;i++){var h=(s=(n=r[i]).boundary).x2>e.x2?s:e;d===h?u[u.length-1].end=n.end:(u.push({start:n.start,end:n.end,boundary:h}),d=h)}for(r[t].start<e.y1&&(u[0].start=e.y1,u.unshift({start:r[t].start,end:e.y1,boundary:r[t].boundary})),e.y2<r[a].end&&(u[u.length-1].end=e.y2,u.push({start:e.y2,end:r[a].end,boundary:r[a].boundary})),i=t;i<=a;i++)if(void 0===(s=(n=r[i]).boundary).x2New){var p=!1;for(o=t-1;!p&&o>=0&&r[o].start>=s.y1;o--)p=r[o].boundary===s;for(o=a+1;!p&&o<r.length&&r[o].end<=s.y2;o++)p=r[o].boundary===s;for(o=0;!p&&o<u.length;o++)p=u[o].boundary===s;p||(s.x2New=l)}Array.prototype.splice.apply(r,[t,a-t+1].concat(u))})),r.forEach((function(t){var r=t.boundary;void 0===r.x2New&&(r.x2New=Math.max(e,r.x2))}))}function i({textContent:e,textContentStream:t,container:r,viewport:s,textDivs:a,textContentItemsStr:i,enhanceTextSelection:o}){this._textContent=e,this._textContentStream=t,this._container=r,this._viewport=s,this._textDivs=a||[],this._textContentItemsStr=i||[],this._enhanceTextSelection=!!o,this._fontInspectorEnabled=!(!globalThis.FontInspector||!globalThis.FontInspector.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,n.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally((()=>{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)})).catch((()=>{}))}return i.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new n.AbortException("TextLayer task cancelled.")),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(e,r){for(let n=0,s=e.length;n<s;n++)this._textContentItemsStr.push(e[n].str),t(this,e[n],r)},_layoutText(e){const t=this._textDivProperties.get(e);if(t.isWhitespace)return;let r="";if(0!==t.canvasWidth){const{fontSize:n,fontFamily:s}=e.style;n===this._layoutTextLastFontSize&&s===this._layoutTextLastFontFamily||(this._layoutTextCtx.font=`${n} ${s}`,this._layoutTextLastFontSize=n,this._layoutTextLastFontFamily=s);const{width:a}=this._layoutTextCtx.measureText(e.textContent);a>0&&(t.scale=t.canvasWidth/a,r=`scaleX(${t.scale})`)}0!==t.angle&&(r=`rotate(${t.angle}deg) ${r}`),r.length>0&&(this._enhanceTextSelection&&(t.originalTransform=r),e.style.transform=r),this._textDivProperties.set(e,t),this._container.appendChild(e)},_render:function(e){const t=(0,n.createPromiseCapability)();let s=Object.create(null);const a=document.createElement("canvas");if(a.mozOpaque=!0,this._layoutTextCtx=a.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,r=this._textContent.styles;this._processItems(e,r),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then((({value:r,done:n})=>{n?t.resolve():(Object.assign(s,r.styles),this._processItems(r.items,s),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{s=null,e?this._renderTimer=setTimeout((()=>{r(this),this._renderTimer=null}),e):r(this)}),this._capability.reject)},expandTextDivs:function(e){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(function(e){for(var t=e._bounds,r=e._viewport,i=function(e,t,r){var n=r.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));a(e,n);var s=new Array(r.length);return n.forEach((function(e){var t=e.index;s[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}})),r.map((function(t,r){var a=s[r],i=n[r];i.x1=t.top,i.y1=e-a.right,i.x2=t.bottom,i.y2=e-a.left,i.index=r,i.x1New=void 0,i.x2New=void 0})),a(t,n),n.forEach((function(e){var t=e.index;s[t].top=e.x1New,s[t].bottom=e.x2New})),s}(r.width,r.height,t),o=0;o<i.length;o++){var l=t[o].div,c=e._textDivProperties.get(l);if(0!==c.angle){var u=i[o],d=t[o],h=d.m,p=h[0],f=h[1],g=[[0,0],[0,d.size[1]],[d.size[0],0],d.size],m=new Float64Array(64);g.forEach((function(e,t){var r=n.Util.applyTransform(e,h);m[t+0]=p&&(u.left-r[0])/p,m[t+4]=f&&(u.top-r[1])/f,m[t+8]=p&&(u.right-r[0])/p,m[t+12]=f&&(u.bottom-r[1])/f,m[t+16]=f&&(u.left-r[0])/-f,m[t+20]=p&&(u.top-r[1])/p,m[t+24]=f&&(u.right-r[0])/-f,m[t+28]=p&&(u.bottom-r[1])/p,m[t+32]=p&&(u.left-r[0])/-p,m[t+36]=f&&(u.top-r[1])/-f,m[t+40]=p&&(u.right-r[0])/-p,m[t+44]=f&&(u.bottom-r[1])/-f,m[t+48]=f&&(u.left-r[0])/f,m[t+52]=p&&(u.top-r[1])/-p,m[t+56]=f&&(u.right-r[0])/f,m[t+60]=p&&(u.bottom-r[1])/-p}));var v=1+Math.min(Math.abs(p),Math.abs(f));c.paddingLeft=s(m,32,16)/v,c.paddingTop=s(m,48,16)/v,c.paddingRight=s(m,0,16)/v,c.paddingBottom=s(m,16,16)/v,e._textDivProperties.set(l,c)}else c.paddingLeft=t[o].left-i[o].left,c.paddingTop=t[o].top-i[o].top,c.paddingRight=i[o].right-t[o].right,c.paddingBottom=i[o].bottom-t[o].bottom,e._textDivProperties.set(l,c)}}(this),this._bounds=null);const t=[],r=[];for(var i=0,o=this._textDivs.length;i<o;i++){const n=this._textDivs[i],s=this._textDivProperties.get(n);s.isWhitespace||(e?(t.length=0,r.length=0,s.originalTransform&&t.push(s.originalTransform),s.paddingTop>0?(r.push(`${s.paddingTop}px`),t.push(`translateY(${-s.paddingTop}px)`)):r.push(0),s.paddingRight>0?r.push(s.paddingRight/s.scale+"px"):r.push(0),s.paddingBottom>0?r.push(`${s.paddingBottom}px`):r.push(0),s.paddingLeft>0?(r.push(s.paddingLeft/s.scale+"px"),t.push(`translateX(${-s.paddingLeft/s.scale}px)`)):r.push(0),n.style.padding=r.join(" "),t.length&&(n.style.transform=t.join(" "))):(n.style.padding=null,n.style.transform=s.originalTransform))}}},function(e){var t=new i({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t}}();t.renderTextLayer=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var n=r(2),s=r(1),a=r(4);let i=function(){throw new Error("Not implemented: SVGGraphics")};t.SVGGraphics=i;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",u=["butt","round","square"],d=["miter","round","bevel"],h=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=new Int32Array(256);for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)r=1&r?3988292384^r>>1&2147483647:r>>1&2147483647;t[e]=r}function r(e,r,n,s){let a=s;const i=r.length;n[a]=i>>24&255,n[a+1]=i>>16&255,n[a+2]=i>>8&255,n[a+3]=255&i,a+=4,n[a]=255&e.charCodeAt(0),n[a+1]=255&e.charCodeAt(1),n[a+2]=255&e.charCodeAt(2),n[a+3]=255&e.charCodeAt(3),a+=4,n.set(r,a),a+=r.length;const o=function(e,r,n){let s=-1;for(let a=r;a<n;a++){const r=255&(s^e[a]);s=s>>>8^t[r]}return-1^s}(n,s+4,a);n[a]=o>>24&255,n[a+1]=o>>16&255,n[a+2]=o>>8&255,n[a+3]=255&o}function s(e){let t=e.length;const r=65535,n=Math.ceil(t/r),s=new Uint8Array(2+t+5*n+4);let a=0;s[a++]=120,s[a++]=156;let i=0;for(;t>r;)s[a++]=0,s[a++]=255,s[a++]=255,s[a++]=0,s[a++]=0,s.set(e.subarray(i,i+r),a),a+=r,i+=r,t-=r;s[a++]=1,s[a++]=255&t,s[a++]=t>>8&255,s[a++]=255&~t,s[a++]=(65535&~t)>>8&255,s.set(e.subarray(i),a),a+=e.length-i;const o=function(e,t,r){let n=1,s=0;for(let t=0;t<r;++t)n=(n+(255&e[t]))%65521,s=(s+n)%65521;return s<<16|n}(e,0,e.length);return s[a++]=o>>24&255,s[a++]=o>>16&255,s[a++]=o>>8&255,s[a++]=255&o,s}return function(t,i,o){return function(t,i,o,l){const c=t.width,u=t.height;let d,h,p;const f=t.data;switch(i){case n.ImageKind.GRAYSCALE_1BPP:h=0,d=1,p=c+7>>3;break;case n.ImageKind.RGB_24BPP:h=2,d=8,p=3*c;break;case n.ImageKind.RGBA_32BPP:h=6,d=8,p=4*c;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+p)*u);let m=0,v=0;for(let e=0;e<u;++e)g[m++]=0,g.set(f.subarray(v,v+p),m),v+=p,m+=p;if(i===n.ImageKind.GRAYSCALE_1BPP&&l){m=0;for(let e=0;e<u;e++){m++;for(let e=0;e<p;e++)g[m++]^=255}}const b=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,d,h,0,0,0]),y=function(e){if(!a.isNodeJS)return s(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const r=__webpack_require__(945804).deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return s(e)}(g),A=e.length+36+b.length+y.length,_=new Uint8Array(A);let x=0;return _.set(e,x),x+=e.length,r("IHDR",b,_,x),x+=12+b.length,r("IDATA",y,_,x),x+=12+y.length,r("IEND",new Uint8Array(0),_,x),(0,n.createObjectURL)(_,"image/png",o)}(t,void 0===t.kind?n.ImageKind.GRAYSCALE_1BPP:t.kind,i,o)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=o.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.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=o.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=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function f(e){let t=[];const r=[];for(const n of e)"save"!==n.fn?"restore"===n.fn?t=r.pop():t.push(n):(t.push({fnId:92,fn:"group",items:[]}),r.push(t),t=t[t.length-1].items);return t}function g(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let r=t.length-1;if("0"!==t[r])return t;do{r--}while("0"===t[r]);return t.substring(0,"."===t[r]?r:r+1)}function m(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${g(e[0])} ${g(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${g(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${g(e[4])} ${g(e[5])})`;return`matrix(${g(e[0])} ${g(e[1])} ${g(e[2])} ${g(e[3])} ${g(e[4])} ${g(e[5])})`}let v=0,b=0,y=0;t.SVGGraphics=i=class{constructor(e,t,r=!1){this.svgFactory=new s.DOMSVGFactory,this.current=new p,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!r,this._operatorIdMapping=[];for(const e in n.OPS)this._operatorIdMapping[n.OPS[e]]=e}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,r=e.argsArray;for(let e=0,s=t.length;e<s;e++)if(t[e]===n.OPS.dependency)for(const t of r[e]){const e=t.startsWith("g_")?this.commonObjs:this.objs,r=new Promise((r=>{e.get(t,r)}));this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(e,t,r,s,a,i){const o=[e,t,r,s,a,i];this.transformMatrix=n.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const r=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),r)))}convertOpList(e){const t=this._operatorIdMapping,r=e.argsArray,n=e.fnArray,s=[];for(let e=0,a=n.length;e<a;e++){const a=n[e];s.push({fnId:a,fn:t[a],args:r[e]})}return f(s)}executeOpTree(e){for(const t of e){const e=t.fn,r=t.fnId,s=t.args;switch(0|r){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(s);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case n.OPS.setFont:this.setFont(s);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(s[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(s[0],s[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case n.OPS.setHScale:this.setHScale(s[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.setTextRise:this.setTextRise(s[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case n.OPS.setLineWidth:this.setLineWidth(s[0]);break;case n.OPS.setLineJoin:this.setLineJoin(s[0]);break;case n.OPS.setLineCap:this.setLineCap(s[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case n.OPS.setFillColorN:this.setFillColorN(s);break;case n.OPS.shadingFill:this.shadingFill(s[0]);break;case n.OPS.setDash:this.setDash(s[0],s[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case n.OPS.setFlatness:this.setFlatness(s[0]);break;case n.OPS.setGState:this.setGState(s[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(s[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.constructPath:this.constructPath(s[0],s[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,n.warn)(`Unimplemented operator ${e}`)}}}setWordSpacing(e){this.current.wordSpacing=e}setCharSpacing(e){this.current.charSpacing=e}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(e,t,r,n,s,a){const i=this.current;i.textMatrix=i.lineMatrix=[e,t,r,n,s,a],i.textMatrixScale=Math.sqrt(e*e+t*t),i.x=i.lineX=0,i.y=i.lineY=0,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${g(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",g(-i.y)),i.txtElement=this.svgFactory.createElement("svg:text"),i.txtElement.appendChild(i.tspan)}beginText(){const e=this.current;e.x=e.lineX=0,e.y=e.lineY=0,e.textMatrix=n.IDENTITY_MATRIX,e.lineMatrix=n.IDENTITY_MATRIX,e.textMatrixScale=1,e.tspan=this.svgFactory.createElement("svg:tspan"),e.txtElement=this.svgFactory.createElement("svg:text"),e.txtgrp=this.svgFactory.createElement("svg:g"),e.xcoords=[],e.ycoords=[]}moveText(e,t){const r=this.current;r.x=r.lineX+=e,r.y=r.lineY+=t,r.xcoords=[],r.ycoords=[],r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size",`${g(r.fontSize)}px`),r.tspan.setAttributeNS(null,"y",g(-r.y))}showText(e){const t=this.current,r=t.font,s=t.fontSize;if(0===s)return;const a=t.fontSizeScale,i=t.charSpacing,c=t.wordSpacing,u=t.fontDirection,d=t.textHScale*u,h=r.vertical,p=h?1:-1,f=r.defaultVMetrics,v=s*t.fontMatrix[0];let b=0;for(const o of e){if(null===o){b+=u*c;continue}if((0,n.isNum)(o)){b+=p*o*s/1e3;continue}const e=(o.isSpace?c:0)+i,l=o.fontChar;let d,g,m,y=o.width;if(h){let e;const t=o.vmetric||f;e=o.vmetric?t[1]:.5*y,e=-e*v;const r=t[2]*v;y=t?-t[0]:y,d=e/a,g=(b+r)/a}else d=b/a,g=0;(o.isInFont||r.missingFile)&&(t.xcoords.push(t.x+d),h&&t.ycoords.push(-t.y+g),t.tspan.textContent+=l),m=h?y*v-e*u:y*v+e*u,b+=m}t.tspan.setAttributeNS(null,"x",t.xcoords.map(g).join(" ")),h?t.tspan.setAttributeNS(null,"y",t.ycoords.map(g).join(" ")):t.tspan.setAttributeNS(null,"y",g(-t.y)),h?t.y-=b:t.x+=b*d,t.tspan.setAttributeNS(null,"font-family",t.fontFamily),t.tspan.setAttributeNS(null,"font-size",`${g(t.fontSize)}px`),t.fontStyle!==o.fontStyle&&t.tspan.setAttributeNS(null,"font-style",t.fontStyle),t.fontWeight!==o.fontWeight&&t.tspan.setAttributeNS(null,"font-weight",t.fontWeight);const y=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(y===n.TextRenderingMode.FILL||y===n.TextRenderingMode.FILL_STROKE?(t.fillColor!==o.fillColor&&t.tspan.setAttributeNS(null,"fill",t.fillColor),t.fillAlpha<1&&t.tspan.setAttributeNS(null,"fill-opacity",t.fillAlpha)):t.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?t.tspan.setAttributeNS(null,"fill","transparent"):t.tspan.setAttributeNS(null,"fill","none"),y===n.TextRenderingMode.STROKE||y===n.TextRenderingMode.FILL_STROKE){const e=1/(t.textMatrixScale||1);this._setStrokeAttributes(t.tspan,e)}let A=t.textMatrix;0!==t.textRise&&(A=A.slice(),A[5]+=t.textRise),t.txtElement.setAttributeNS(null,"transform",`${m(A)} scale(${g(d)}, -1)`),t.txtElement.setAttributeNS(l,"xml:space","preserve"),t.txtElement.appendChild(t.tspan),t.txtgrp.appendChild(t.txtElement),this._ensureTransformGroup().appendChild(t.txtElement)}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}addFontStyle(e){if(!e.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const t=(0,n.createObjectURL)(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${e.loadedName}"; src: url(${t}); }\n`}setFont(e){const t=this.current,r=this.commonObjs.get(e[0]);let s=e[1];t.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),t.fontMatrix=r.fontMatrix?r.fontMatrix:n.FONT_IDENTITY_MATRIX;let a="normal";r.black?a="900":r.bold&&(a="bold");const i=r.italic?"italic":"normal";s<0?(s=-s,t.fontDirection=-1):t.fontDirection=1,t.fontSize=s,t.fontFamily=r.loadedName,t.fontWeight=a,t.fontStyle=i,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",g(-t.y)),t.xcoords=[],t.ycoords=[]}endText(){const e=this.current;e.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement&&e.txtElement.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(e){e>0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=u[e]}setLineJoin(e){this.current.lineJoin=d[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,r){this.current.strokeColor=n.Util.makeCssRgb(e,t,r)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,r){this.current.fillColor=n.Util.makeCssRgb(e,t,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,r=this.viewport.height,s=n.Util.inverseTransform(this.transformMatrix),a=n.Util.applyTransform([0,0],s),i=n.Util.applyTransform([0,r],s),o=n.Util.applyTransform([t,0],s),l=n.Util.applyTransform([t,r],s),c=Math.min(a[0],i[0],o[0],l[0]),u=Math.min(a[1],i[1],o[1],l[1]),d=Math.max(a[0],i[0],o[0],l[0]),h=Math.max(a[1],i[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",u),p.setAttributeNS(null,"width",d-c),p.setAttributeNS(null,"height",h-u),p.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(p)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],r=e[2],s=e[3]||n.IDENTITY_MATRIX,[a,i,o,l]=e[4],c=e[5],u=e[6],d=e[7],h="shading"+y++,[p,f]=n.Util.applyTransform([a,i],s),[g,m]=n.Util.applyTransform([o,l],s),[v,b]=n.Util.singularValueDecompose2dScale(s),A=c*v,_=u*b,x=this.svgFactory.createElement("svg:pattern");x.setAttributeNS(null,"id",h),x.setAttributeNS(null,"patternUnits","userSpaceOnUse"),x.setAttributeNS(null,"width",A),x.setAttributeNS(null,"height",_),x.setAttributeNS(null,"x",`${p}`),x.setAttributeNS(null,"y",`${f}`);const S=this.svg,w=this.transformMatrix,P=this.current.fillColor,C=this.current.strokeColor,k=this.svgFactory.create(g-p,m-f);if(this.svg=k,this.transformMatrix=s,2===d){const e=n.Util.makeCssRgb(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(r)),this.svg=S,this.transformMatrix=w,this.current.fillColor=P,this.current.strokeColor=C,x.appendChild(k.childNodes[0]),this.defs.appendChild(x),`url(#${h})`}_makeShadingPattern(e){switch(e[0]){case"RadialAxial":const t="shading"+y++,r=e[3];let s;switch(e[1]){case"axial":const r=e[4],n=e[5];s=this.svgFactory.createElement("svg:linearGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"x1",r[0]),s.setAttributeNS(null,"y1",r[1]),s.setAttributeNS(null,"x2",n[0]),s.setAttributeNS(null,"y2",n[1]);break;case"radial":const a=e[4],i=e[5],o=e[6],l=e[7];s=this.svgFactory.createElement("svg:radialGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"cx",i[0]),s.setAttributeNS(null,"cy",i[1]),s.setAttributeNS(null,"r",l),s.setAttributeNS(null,"fx",a[0]),s.setAttributeNS(null,"fy",a[1]),s.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of r){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),s.appendChild(t)}return this.defs.appendChild(s),`url(#${t})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const r=this.current;let s=r.x,a=r.y,i=[],o=0;for(const r of e)switch(0|r){case n.OPS.rectangle:s=t[o++],a=t[o++];const e=s+t[o++],r=a+t[o++];i.push("M",g(s),g(a),"L",g(e),g(a),"L",g(e),g(r),"L",g(s),g(r),"Z");break;case n.OPS.moveTo:s=t[o++],a=t[o++],i.push("M",g(s),g(a));break;case n.OPS.lineTo:s=t[o++],a=t[o++],i.push("L",g(s),g(a));break;case n.OPS.curveTo:s=t[o+4],a=t[o+5],i.push("C",g(t[o]),g(t[o+1]),g(t[o+2]),g(t[o+3]),g(s),g(a)),o+=6;break;case n.OPS.curveTo2:i.push("C",g(s),g(a),g(t[o]),g(t[o+1]),g(t[o+2]),g(t[o+3])),s=t[o+2],a=t[o+3],o+=4;break;case n.OPS.curveTo3:s=t[o+2],a=t[o+3],i.push("C",g(t[o]),g(t[o+1]),g(s),g(a),g(s),g(a)),o+=4;break;case n.OPS.closePath:i.push("Z")}i=i.join(" "),r.path&&e.length>0&&e[0]!==n.OPS.rectangle&&e[0]!==n.OPS.moveTo?i=r.path.getAttributeNS(null,"d")+i:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(r.path)),r.path.setAttributeNS(null,"d",i),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(s,a)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+v++,r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"transform",m(this.transformMatrix));const n=e.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.appendChild(n),this.defs.appendChild(r),e.activeClipUrl&&(e.clipGroup=null,this.extraStack.forEach((function(e){e.clipGroup=null})),r.setAttributeNS(null,"clip-path",e.activeClipUrl)),e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r);break;case"CA":this.setStrokeAlpha(r);break;case"ca":this.setFillAlpha(r);break;default:(0,n.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const r=this.current;let n=r.dashArray;1!==t&&n.length>0&&(n=n.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",r.strokeColor),e.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",g(r.miterLimit)),e.setAttributeNS(null,"stroke-linecap",r.lineCap),e.setAttributeNS(null,"stroke-linejoin",r.lineJoin),e.setAttributeNS(null,"stroke-width",g(t*r.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",n.map(g).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",g(t*r.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(e)}paintImageXObject(e){const t=this.objs.get(e);t?this.paintInlineImageXObject(t):(0,n.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const r=e.width,n=e.height,s=h(e,this.forceDataSchema,!!t),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",g(r)),a.setAttributeNS(null,"height",g(n)),this.current.element=a,this.clip("nonzero");const i=this.svgFactory.createElement("svg:image");i.setAttributeNS(c,"xlink:href",s),i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y",g(-n)),i.setAttributeNS(null,"width",g(r)+"px"),i.setAttributeNS(null,"height",g(n)+"px"),i.setAttributeNS(null,"transform",`scale(${g(1/r)} ${g(-1/n)})`),t?t.appendChild(i):this._ensureTransformGroup().appendChild(i)}paintImageMaskXObject(e){const t=this.current,r=e.width,n=e.height,s=t.fillColor;t.maskId="mask"+b++;const a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",t.maskId);const i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",g(r)),i.setAttributeNS(null,"height",g(n)),i.setAttributeNS(null,"fill",s),i.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.appendChild(a),this._ensureTransformGroup().appendChild(i),this.paintInlineImageXObject(e,a)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],r=t[3]-t[1],n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",t[0]),n.setAttributeNS(null,"y",t[1]),n.setAttributeNS(null,"width",g(e)),n.setAttributeNS(null,"height",g(r)),this.current.element=n,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),r=this.svgFactory.createElement("svg:defs");t.appendChild(r),this.defs=r;const n=this.svgFactory.createElement("svg:g");return n.setAttributeNS(null,"transform",m(e.transform)),t.appendChild(n),this.svg=n,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",m(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var n=r(2),s=r(20);const a=__webpack_require__(212993),i=__webpack_require__(558618),o=__webpack_require__(200120),l=__webpack_require__(739151),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new p(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=this.isFsUrl?new m(this,e,t):new f(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,n.createPromiseCapability)(),this._headersCapability=(0,n.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,n.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new n.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,n.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,n.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function h(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class p extends u{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new n.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const r=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:a,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=i||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(r)};this._request=null,"http:"===this._url.protocol?this._request=i.request(h(this._url,e.httpHeaders),t):this._request=o.request(h(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class f extends d{constructor(e,t,r){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const r=e.httpHeaders[t];void 0!==r&&(this._httpHeaders[t]=r)}this._httpHeaders.Range=`bytes=${t}-${r-1}`;const s=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new n.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=i.request(h(this._url,this._httpHeaders),s):this._request=o.request(h(this._url,this._httpHeaders),s),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class g extends u{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),a.lstat(t,((e,r)=>{if(e)return"ENOENT"===e.code&&(e=new n.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=r.size,this._setReadableStream(a.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends d{constructor(e,t,r){super(e);let n=decodeURIComponent(this._url.path);c.test(this._url.href)&&(n=n.replace(/^\//,"")),this._setReadableStream(a.createReadStream(n,{start:t,end:r-1}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new n.MissingPDFException('Missing PDF "'+t+'".'):new n.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,s.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if(/\.pdf$/i.test(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:s}){(0,n.assert)(r>0,"Range chunk size must be larger than zero");const a={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(e("Content-Length"),10);return Number.isInteger(i)?(a.suggestedLength=i,i<=2*r||s||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a):a},t.validateResponseStatus=function(e){return 200===e||206===e};var n=r(2),s=r(21)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let e=i(r);return e=unescape(e),e=o(e),e=l(e),a(e)}if(r=function(e){const t=[];let r;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=s.exec(e));){let[,e,n,s]=r;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[n,s]}const a=[];for(let e=0;e<t.length&&e in t;++e){let[r,n]=t[e];n=i(n),r&&(n=unescape(n),0===e&&(n=o(n))),a.push(n)}return a.join("")}(e),r)return a(l(r));if(r=n("filename","i").exec(e),r){r=r[1];let e=i(r);return e=l(e),a(e)}function n(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,r){if(e){if(!/^[\x00-\xFF]+$/.test(r))return r;try{const n=new TextDecoder(e,{fatal:!0}),s=Array.from(r,(function(e){return 255&e.charCodeAt(0)}));r=n.decode(new Uint8Array(s)),t=!1}catch(n){if(/^utf-?8$/i.test(e))try{r=decodeURIComponent(escape(r)),t=!1}catch(e){}}}return r}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),t&&(e=s("iso-8859-1",e))),e}function i(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const r=t[e].indexOf('"');-1!==r&&(t[e]=t[e].slice(0,r),t.length=e+1),t[e]=t[e].replace(/\\(.)/g,"$1")}e=t.join('"')}return e}function o(e){const t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function l(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,r,n){if("q"===r||"Q"===r)return s(t,n=(n=n.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})));try{n=atob(n)}catch(e){}return s(t,n)}))}return""}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var n=r(2),s=r(20);class a{constructor(e,t){this.url=e,t=t||{},this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,r){const n={begin:e,end:t};for(const e in r)n[e]=r[e];return this.request(n)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),r=this.currXhrId++,n=this.pendingRequests[r]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const r=this.httpHeaders[e];void 0!==r&&t.setRequestHeader(e,r)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(r){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,r),t.onprogress=this.onProgress.bind(this,r),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),r}onProgress(e,t){const r=this.pendingRequests[e];r&&r.onProgress&&r.onProgress(t)}onStateChange(e,t){const r=this.pendingRequests[e];if(!r)return;const s=r.xhr;if(s.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==s.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===s.status&&this.isHttp)return void(r.onError&&r.onError(s.status));const a=s.status||200;if((200!==a||206!==r.expectedStatus)&&a!==r.expectedStatus)return void(r.onError&&r.onError(s.status));const i=function(e){const t=e.response;return"string"!=typeof t?t:(0,n.stringToBytes)(t).buffer}(s);if(206===a){const e=s.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);r.onDone({begin:parseInt(t[1],10),chunk:i})}else i?r.onDone({begin:0,chunk:i}):r.onError&&r.onError(s.status)}hasPendingRequests(){for(const e in this.pendingRequests)return!0;return!1}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortAllRequests(){for(const e in this.pendingRequests)this.abortRequest(0|e)}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new a(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new i(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new o(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class i{constructor(e,t){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(r),this._headersReceivedCapability=(0,n.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=e=>t.getResponseHeader(e),{allowRangeRequests:n,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,this._cachedChunks.length>0||(this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[])}_onError(e){const t=this._url,r=(0,s.createResponseStatusError)(e,t);this._storedError=r,this._headersReceivedCapability.reject(r),this._requests.forEach((function(e){e.reject(r)})),this._requests=[],this._cachedChunks=[]}_onProgress(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(e,t,r){this._manager=e;const n={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,r,n),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._close()}_onProgress(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,n.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var n=r(2),s=r(20);function a(e,t,r){return{method:"GET",headers:e,signal:r&&r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function i(e){const t=new Headers;for(const r in e){const n=e[r];void 0!==n&&t.append(r,n)}return t}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new o(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new l(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class o{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=(0,n.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=i(this._stream.httpHeaders);const r=t.url;fetch(r,a(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,s.validateResponseStatus)(e.status))throw(0,s.createResponseStatusError)(e.status,r);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:a,suggestedLength:i}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=i||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}class l{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,n.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=i(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${r-1}`);const l=o.url;fetch(l,a(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,s.validateResponseStatus)(e.status))throw(0,s.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}}])},module.exports=factory()},286379:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=void 0;var n=r(6420);t.PDFLinkService=class{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:r=null,externalLinkEnabled:n=!0,ignoreDestinationZoom:s=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=r,this.externalLinkEnabled=n,this._ignoreDestinationZoom=s,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}navigateTo(e){const t=({namedDest:r,explicitDest:n})=>{const s=n[0];let a;if(s instanceof Object){if(a=this._cachedPageNumber(s),null===a)return void this.pdfDocument.getPageIndex(s).then((e=>{this.cachePageRef(e+1,s),t({namedDest:r,explicitDest:n})})).catch((()=>{console.error(`PDFLinkService.navigateTo: "${s}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(s))return void console.error(`PDFLinkService.navigateTo: "${s}" is not a valid destination reference, for dest="${e}".`);a=s+1}!a||a<1||a>this.pagesCount?console.error(`PDFLinkService.navigateTo: "${a}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:r,explicitDest:n,pageNumber:a})),this.pdfViewer.scrollPageIntoView({pageNumber:a,destArray:n,ignoreDestinationZoom:this._ignoreDestinationZoom}))};new Promise(((t,r)=>{"string"!=typeof e?t({namedDest:"",explicitDest:e}):this.pdfDocument.getDestination(e).then((r=>{t({namedDest:e,explicitDest:r})}))})).then((r=>{Array.isArray(r.explicitDest)?t(r):console.error(`PDFLinkService.navigateTo: "${r.explicitDest}" is not a valid destination array, for dest="${e}".`)}))}getDestinationHash(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(Array.isArray(e)){const t=JSON.stringify(e);return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return(this.baseUrl||"")+e}setHash(e){let t,r;if(e.includes("=")){const s=(0,n.parseQueryString)(e);if("search"in s&&this.eventBus.dispatch("findfromurlhash",{source:this,query:s.search.replace(/"/g,""),phraseSearch:"true"===s.phrase}),"page"in s&&(t=0|s.page||1),"zoom"in s){const e=s.zoom.split(","),t=e[0],n=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?r=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?r=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):r=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):r=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,n?n/100:t]}r?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:r,allowNegativeOffset:!0}):t&&(this.page=t),"pagemode"in s&&this.eventBus.dispatch("pagemode",{source:this,mode:s.pagemode}),"nameddest"in s&&this.navigateTo(s.nameddest)}else{r=unescape(e);try{r=JSON.parse(r),Array.isArray(r)||(r=r.toString())}catch(e){}if("string"==typeof r||function(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const r=e[0];if(!("object"==typeof r&&Number.isInteger(r.num)&&Number.isInteger(r.gen)||Number.isInteger(r)&&r>=0))return!1;const n=e[1];if("object"!=typeof n||"string"!=typeof n.name)return!1;let s=!0;switch(n.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;s=!1;break;default:return!1}for(let r=2;r<t;r++){const t=e[r];if(!("number"==typeof t||s&&null===t))return!1}return!0}(r))return void this.navigateTo(r);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page<this.pagesCount&&this.page++;break;case"PrevPage":this.page>1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}cachePageRef(e,t){if(!t)return;const r=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this._pagesRefCache[r]=e}_cachedPageNumber(e){const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this._pagesRefCache&&this._pagesRefCache[t]||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}},t.SimpleLinkService=class{constructor(){this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=!1}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}navigateTo(e){}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,t){}isPageVisible(e){return!0}}},6420:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(r).includes(e)&&e!==r.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(n).includes(e)&&e!==n.UNKNOWN},t.isPortraitOrientation=function(e){return e.width<=e.height},t.clamp=u,t.getPDFFileNameFromURL=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(function(e){let t=0;const r=e.length;for(;t<r&&""===e[t].trim();)t++;return"data:"===e.substring(t,t+5).toLowerCase()}(e))return console.warn('getPDFFileNameFromURL: ignoring "data:" URL for performance reasons.'),t;const r=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let s=r.exec(n[1])||r.exec(n[2])||r.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=r.exec(decodeURIComponent(s))[0]}catch(e){}return s||t},t.noContextMenuHandler=function(e){e.preventDefault()},t.parseQueryString=function(e){const t=e.split("&"),r=Object.create(null);for(let e=0,n=t.length;e<n;++e){const n=t[e].split("="),s=n[0].toLowerCase(),a=n.length>1?n[1]:null;r[decodeURIComponent(s)]=decodeURIComponent(a)}return r},t.backtrackBeforeAllVisibleElements=i,t.getVisibleElements=function(e,t,r=!1,n=!1){const s=e.scrollTop,o=s+e.clientHeight,l=e.scrollLeft,c=l+e.clientWidth,u=[],d=t.length;let h=0===d?0:a(t,n?function(e){const t=e.div;return t.offsetLeft+t.clientLeft+t.clientWidth>l}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>s});h>0&&h<d&&!n&&(h=i(h,t,s));let p=n?c:-1;for(let e=h;e<d;e++){const r=t[e],a=r.div,i=a.offsetLeft+a.clientLeft,d=a.offsetTop+a.clientTop,h=a.clientWidth,f=a.clientHeight,g=i+h,m=d+f;if(-1===p)m>=o&&(p=m);else if((n?i:d)>p)break;if(m<=s||d>=o||g<=l||i>=c)continue;const v=(f-(Math.max(0,s-d)+Math.max(0,m-o)))*(h-(Math.max(0,l-i)+Math.max(0,g-c)))*100/f/h|0;u.push({id:r.id,x:i,y:d,view:r,percent:v})}const f=u[0],g=u[u.length-1];return r&&u.sort((function(e,t){const r=e.percent-t.percent;return Math.abs(r)>.001?-r:e.id-t.id})),{first:f,last:g,views:u}},t.roundToDivide=function(e,t){const r=e%t;return 0===r?e:Math.round(e-r+t)},t.getPageSizeInches=function({view:e,userUnit:t,rotate:r}){const[n,s,a,i]=e,o=r%180!=0,l=(a-n)/72*t,c=(i-s)/72*t;return{width:o?c:l,height:o?l:c}},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const r=e>1?t:e;let n,s=0,a=1,i=1,o=1;for(;;){const e=s+i,t=a+o;if(t>8)break;r<=e/t?(i=e,o=t):(s=e,a=t)}return n=r-s/a<i/o-r?r===e?[s,a]:[a,s]:r===e?[i,o]:[o,i],n},t.getOutputScale=function(e){const t=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1);return{sx:t,sy:t,scaled:1!==t}},t.scrollIntoView=function(e,t,r=!1){let n=e.offsetParent;if(!n)return void console.error("offsetParent is not set -- cannot scroll");let s=e.offsetTop+e.clientTop,a=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth||r&&"hidden"===getComputedStyle(n).overflow;)if(n.dataset._scaleY&&(s/=n.dataset._scaleY,a/=n.dataset._scaleX),s+=n.offsetTop,a+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(void 0!==t.top&&(s+=t.top),void 0!==t.left&&(a+=t.left,n.scrollLeft=a)),n.scrollTop=s},t.watchScroll=function(e,t){const r=function(r){s||(s=window.requestAnimationFrame((function(){s=null;const r=e.scrollLeft,a=n.lastX;r!==a&&(n.right=r>a),n.lastX=r;const i=e.scrollTop,o=n.lastY;i!==o&&(n.down=i>o),n.lastY=i,t(n)})))},n={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:r};let s=null;return e.addEventListener("scroll",r,!0),n},t.binarySearchFirstItem=a,t.normalizeWheelEventDelta=function(e){let t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY);const r=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<r&&r<.75*Math.PI&&(t=-t),0===e.deltaMode?t/=900:1===e.deltaMode&&(t/=30),t},t.waitOnEventOrTimeout=function({target:e,name:t,delay:r=0}){return new Promise((function(n,s){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(r)&&r>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function a(r){e instanceof c?e._off(t,i):e.removeEventListener(t,i),u&&clearTimeout(u),n(r)}const i=a.bind(null,o.EVENT);e instanceof c?e._on(t,i):e.addEventListener(t,i);const l=a.bind(null,o.TIMEOUT),u=setTimeout(l,r)}))},t.moveToEndOfArray=function(e,t){const r=[],n=e.length;let s=0;for(let a=0;a<n;++a)t(e[a])?r.push(e[a]):(e[s]=e[a],++s);for(let t=0;s<n;++t,++s)e[s]=r[t]},t.WaitOnType=t.animationStarted=t.ProgressBar=t.EventBus=t.NullL10n=t.SpreadMode=t.ScrollMode=t.TextLayerMode=t.RendererType=t.PresentationModeState=t.VERTICAL_PADDING=t.SCROLLBAR_PADDING=t.MAX_AUTO_SCALE=t.UNKNOWN_SCALE=t.MAX_SCALE=t.MIN_SCALE=t.DEFAULT_SCALE=t.DEFAULT_SCALE_VALUE=t.CSS_UNITS=t.AutoPrintRegExp=void 0,t.CSS_UNITS=96/72,t.DEFAULT_SCALE_VALUE="auto",t.DEFAULT_SCALE=1,t.MIN_SCALE=.1,t.MAX_SCALE=10,t.UNKNOWN_SCALE=0,t.MAX_AUTO_SCALE=1.25,t.SCROLLBAR_PADDING=40,t.VERTICAL_PADDING=5,t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},t.RendererType={CANVAS:"canvas",SVG:"svg"},t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};const r={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};t.ScrollMode=r;const n={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};t.SpreadMode=n,t.AutoPrintRegExp=/\bprint\s*\(/;const s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t,r)=>function(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,((e,r)=>r in t?t[r]:"{{"+r+"}}")):e}(r,t),async translate(e){}};function a(e,t){let r=0,n=e.length-1;if(n<0||!t(e[n]))return e.length;if(t(e[r]))return r;for(;r<n;){const s=r+n>>1;t(e[s])?n=s:r=s+1}return r}function i(e,t,r){if(e<2)return e;let n=t[e].div,s=n.offsetTop+n.clientTop;s>=r&&(n=t[e-1].div,s=n.offsetTop+n.clientTop);for(let r=e-2;r>=0&&(n=t[r].div,!(n.offsetTop+n.clientTop+n.clientHeight<=s));--r)e=r;return e}t.NullL10n=s;const o={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=o;const l=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=l;class c{constructor(e){this._listeners=Object.create(null)}on(e,t){this._on(e,t,{external:!0})}off(e,t){this._off(e,t,{external:!0})}dispatch(e){const t=this._listeners[e];if(!t||0===t.length)return;const r=Array.prototype.slice.call(arguments,1);let n;t.slice(0).forEach((function({listener:e,external:t}){if(t)return n||(n=[]),void n.push(e);e.apply(null,r)})),n&&(n.forEach((function(e){e.apply(null,r)})),n=null)}_on(e,t,r=null){let n=this._listeners[e];n||(this._listeners[e]=n=[]),n.push({listener:t,external:!0===(r&&r.external)})}_off(e,t,r=null){const n=this._listeners[e];if(n)for(let e=0,r=n.length;e<r;e++)if(n[e].listener===t)return void n.splice(e,1)}}function u(e,t,r){return Math.min(Math.max(e,t),r)}t.EventBus=c,t.ProgressBar=class{constructor(e,{height:t,width:r,units:n}={}){this.visible=!0,this.div=document.querySelector(e+" .progress"),this.bar=this.div.parentNode,this.height=t||100,this.width=r||100,this.units=n||"%",this.div.style.height=this.height+this.units,this.percent=0}_updateBar(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");const e=this.width*this._percent/100;this.div.style.width=e+this.units}get percent(){return this._percent}set percent(e){this._indeterminate=isNaN(e),this._percent=u(e,0,100),this._updateBar()}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}}},682013:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=s(r(967154)),i=s(r(506479)),o=s(r(750008)),l=s(r(887757)),c=s(r(348926)),u=s(r(334575)),d=s(r(993913)),h=s(r(281506)),p=s(r(502205)),f=s(r(178585)),g=s(r(629754)),m=s(r(859713)),v=n(r(124852)),b=s(r(675263)),y=s(r(684845)),A=s(r(8094)),_=s(r(289624)),x=n(r(299299)),S=s(r(646522)),w=s(r(262217)),P=s(r(865309)),C=s(r(167101)),k=s(r(54366)),R=r(400395),E=r(348693);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){(0,m.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=x.PDFDataRangeTransport,O=function(e){(0,p.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,g.default)(t);if(r){var s=(0,g.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function s(){var e;(0,u.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,m.default)((0,h.default)(e),"state",{pdf:null}),(0,m.default)((0,h.default)(e),"viewer",{scrollPageIntoView:function(t){var r=t.pageNumber,n=e.props.onItemClick;if(n)n({pageNumber:r});else{var s=e.pages[r-1];s?s.scrollIntoView():(0,R.warnOnDev)("Warning: An internal link leading to page ".concat(r," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}}}),(0,m.default)((0,h.default)(e),"linkService",new P.default({eventBus:k.default})),(0,m.default)((0,h.default)(e),"loadDocument",(0,c.default)(l.default.mark((function t(){var r,n,s,a,i,o,c;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,e.findDocumentSource();case 4:r=t.sent,e.onSourceSuccess(),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),e.onSourceError(t.t0);case 11:if(r){t.next=13;break}return t.abrupt("return");case 13:return e.setState((function(e){return e.pdf?{pdf:null}:null})),n=e.props,s=n.options,a=n.onLoadProgress,i=n.onPassword,t.prev=15,(0,R.cancelRunningTask)(e.runningTask),e.loadingTask=x.getDocument(L(L({},r),s)),e.loadingTask.onPassword=i,a&&(e.loadingTask.onProgress=a),o=(0,A.default)(e.loadingTask.promise),e.runningTask=o,t.next=24,o.promise;case 24:c=t.sent,e.setState((function(e){return e.pdf&&e.pdf.fingerprint===c.fingerprint?null:{pdf:c}}),e.onLoadSuccess),t.next=31;break;case 28:t.prev=28,t.t1=t.catch(15),e.onLoadError(t.t1);case 31:case"end":return t.stop()}}),t,null,[[1,8],[15,28]])})))),(0,m.default)((0,h.default)(e),"setupLinkService",(function(){e.linkService.setViewer(e.viewer);var t=(0,h.default)(e);Object.defineProperty(e.linkService,"externalLinkTarget",{get:function(){switch(t.props.externalLinkTarget){case"_self":return 1;case"_blank":return 2;case"_parent":return 3;case"_top":return 4;default:return 0}}})})),(0,m.default)((0,h.default)(e),"onSourceSuccess",(function(){var t=e.props.onSourceSuccess;t&&t()})),(0,m.default)((0,h.default)(e),"onSourceError",(function(t){(0,R.errorOnDev)(t);var r=e.props.onSourceError;r&&r(t)})),(0,m.default)((0,h.default)(e),"onLoadSuccess",(function(){var t=e.props.onLoadSuccess,r=e.state.pdf;t&&t(r),e.pages=new Array(r.numPages),e.linkService.setDocument(r)})),(0,m.default)((0,h.default)(e),"onLoadError",(function(t){e.setState({pdf:!1}),(0,R.errorOnDev)(t);var r=e.props.onLoadError;r&&r(t)})),(0,m.default)((0,h.default)(e),"findDocumentSource",(0,c.default)(l.default.mark((function t(){var r,n,s,a,c;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props.file){t.next=3;break}return t.abrupt("return",null);case 3:if("string"!=typeof r){t.next=9;break}if(!(0,R.isDataURI)(r)){t.next=7;break}return n=(0,R.dataURItoUint8Array)(r),t.abrupt("return",{data:n});case 7:return(0,R.displayCORSWarning)(),t.abrupt("return",{url:r});case 9:if(!(r instanceof F)){t.next=11;break}return t.abrupt("return",{range:r});case 11:if(!(0,R.isArrayBuffer)(r)){t.next=13;break}return t.abrupt("return",{data:r});case 13:if(!R.isBrowser){t.next=19;break}if(!(0,R.isBlob)(r)&&!(0,R.isFile)(r)){t.next=19;break}return t.next=17,(0,R.loadFromFile)(r);case 17:return t.t0=t.sent,t.abrupt("return",{data:t.t0});case 19:if("object"===(0,o.default)(r)){t.next=21;break}throw new Error("Invalid parameter in file, need either Uint8Array, string or a parameter object");case 21:if(r.url||r.data||r.range){t.next=23;break}throw new Error("Invalid parameter object: need either .data, .range or .url");case 23:if("string"!=typeof r.url){t.next=29;break}if(!(0,R.isDataURI)(r.url)){t.next=28;break}return s=r.url,a=(0,i.default)(r,["url"]),c=(0,R.dataURItoUint8Array)(s),t.abrupt("return",L({data:c},a));case 28:(0,R.displayCORSWarning)();case 29:return t.abrupt("return",r);case 30:case"end":return t.stop()}}),t)})))),(0,m.default)((0,h.default)(e),"registerPage",(function(t,r){e.pages[t]=r})),(0,m.default)((0,h.default)(e),"unregisterPage",(function(t){delete e.pages[t]})),e}return(0,d.default)(s,[{key:"componentDidMount",value:function(){this.loadDocument(),this.setupLinkService()}},{key:"componentDidUpdate",value:function(e){this.props.file!==e.file&&this.loadDocument()}},{key:"componentWillUnmount",value:function(){this.loadingTask&&this.loadingTask.destroy(),(0,R.cancelRunningTask)(this.runningTask)}},{key:"renderChildren",value:function(){var e=this.props.children;return v.default.createElement(S.default.Provider,{value:this.childContext},e)}},{key:"renderContent",value:function(){var e=this.props.file,t=this.state.pdf;if(!e){var r=this.props.noData;return v.default.createElement(w.default,{type:"no-data"},"function"==typeof r?r():r)}if(null===t){var n=this.props.loading;return v.default.createElement(w.default,{type:"loading"},"function"==typeof n?n():n)}if(!1===t){var s=this.props.error;return v.default.createElement(w.default,{type:"error"},"function"==typeof s?s():s)}return this.renderChildren()}},{key:"render",value:function(){var e=this.props,t=e.className,r=e.inputRef;return v.default.createElement("div",(0,a.default)({className:(0,_.default)("react-pdf__Document",t),ref:r},this.eventProps),this.renderContent())}},{key:"childContext",get:function(){var e=this.linkService,t=this.registerPage,r=this.unregisterPage,n=this.props,s=n.renderMode,a=n.rotate;return{linkService:e,pdf:this.state.pdf,registerPage:t,renderMode:s,rotate:a,unregisterPage:r}}},{key:"eventProps",get:function(){var e=this;return(0,y.default)(this.props,(function(){return e.state.pdf}))}}]),s}(v.PureComponent);t.default=O,O.defaultProps={error:"Failed to load PDF file.",loading:"Loading PDF…",noData:"No PDF file specified.",onPassword:function(e,t){switch(t){case C.default.NEED_PASSWORD:e(prompt("Enter the password to open this PDF file."));break;case C.default.INCORRECT_PASSWORD:e(prompt("Invalid password. Please try again."))}}};var D=b.default.oneOfType([b.default.func,b.default.node]);O.propTypes=L(L({},E.eventProps),{},{children:b.default.node,className:E.isClassName,error:D,file:R.isFile,inputRef:E.isRef,loading:D,noData:D,onItemClick:b.default.func,onLoadError:b.default.func,onLoadProgress:b.default.func,onLoadSuccess:b.default.func,onPassword:b.default.func,onSourceError:b.default.func,onSourceSuccess:b.default.func,rotate:b.default.number})},646522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=(0,r(124852).createContext)(null);t.default=n},865309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(286379).PDFLinkService;t.default=n},262217:(e,t,r)=>{"use strict";var n=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var s=n(r(124852)),a=n(r(675263));function i(e){var t=e.children,r=e.type;return s.default.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(r)},t)}i.propTypes={children:a.default.node,type:a.default.oneOf(["error","loading","no-data"]).isRequired}},830076:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OutlineInternal=void 0;var a=s(r(967154)),i=s(r(887757)),o=s(r(348926)),l=s(r(334575)),c=s(r(993913)),u=s(r(281506)),d=s(r(502205)),h=s(r(178585)),p=s(r(629754)),f=s(r(859713)),g=n(r(124852)),m=s(r(675263)),v=s(r(8094)),b=s(r(684845)),y=s(r(289624)),A=s(r(646522)),_=s(r(694921)),x=s(r(160350)),S=r(400395),w=r(348693);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var C=function(e){(0,d.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,p.default)(t);if(r){var s=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,h.default)(this,e)});function s(){var e;(0,l.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,f.default)((0,u.default)(e),"state",{outline:null}),(0,f.default)((0,u.default)(e),"loadOutline",(0,o.default)(i.default.mark((function t(){var r,n,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.props.pdf,e.setState((function(e){return e.outline?{outline:null}:null})),t.prev=2,n=(0,v.default)(r.getOutline()),e.runningTask=n,t.next=7,n.promise;case 7:s=t.sent,e.setState({outline:s},e.onLoadSuccess),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(2),e.onLoadError(t.t0);case 14:case"end":return t.stop()}}),t,null,[[2,11]])})))),(0,f.default)((0,u.default)(e),"onLoadSuccess",(function(){var t=e.props.onLoadSuccess,r=e.state.outline;t&&t(r)})),(0,f.default)((0,u.default)(e),"onLoadError",(function(t){e.setState({outline:!1}),(0,S.errorOnDev)(t);var r=e.props.onLoadError;r&&r(t)})),(0,f.default)((0,u.default)(e),"onItemClick",(function(t){var r=t.pageIndex,n=t.pageNumber,s=e.props.onItemClick;s&&s({pageIndex:r,pageNumber:n})})),e}return(0,c.default)(s,[{key:"componentDidMount",value:function(){if(!this.props.pdf)throw new Error("Attempted to load an outline, but no document was specified.");this.loadOutline()}},{key:"componentDidUpdate",value:function(e){var t=this.props.pdf;e.pdf&&t!==e.pdf&&this.loadOutline()}},{key:"componentWillUnmount",value:function(){(0,S.cancelRunningTask)(this.runningTask)}},{key:"renderOutline",value:function(){var e=this.state.outline;return g.default.createElement("ul",null,e.map((function(e,t){return g.default.createElement(x.default,{key:"string"==typeof e.destination?e.destination:t,item:e})})))}},{key:"render",value:function(){var e=this.props.pdf,t=this.state.outline;if(!e||!t)return null;var r=this.props,n=r.className,s=r.inputRef;return g.default.createElement("div",(0,a.default)({className:(0,y.default)("react-pdf__Outline",n),ref:s},this.eventProps),g.default.createElement(_.default.Provider,{value:this.childContext},this.renderOutline()))}},{key:"childContext",get:function(){return{onClick:this.onItemClick}}},{key:"eventProps",get:function(){var e=this;return(0,b.default)(this.props,(function(){return e.state.outline}))}}]),s}(g.PureComponent);function k(e,t){return g.default.createElement(A.default.Consumer,null,(function(r){return g.default.createElement(C,(0,a.default)({ref:t},r,e))}))}t.OutlineInternal=C,C.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){(0,f.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({className:w.isClassName,inputRef:w.isRef,onItemClick:m.default.func,onLoadError:m.default.func,onLoadSuccess:m.default.func,pdf:w.isPdf},w.eventProps);var R=g.default.forwardRef(k);t.default=R},694921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=(0,r(124852).createContext)(null);t.default=n},160350:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OutlineItemInternal=void 0;var a=s(r(967154)),i=s(r(506479)),o=s(r(963038)),l=s(r(887757)),c=s(r(348926)),u=s(r(334575)),d=s(r(993913)),h=s(r(281506)),p=s(r(502205)),f=s(r(178585)),g=s(r(629754)),m=s(r(859713)),v=n(r(124852)),b=s(r(675263)),y=s(r(646522)),A=s(r(694921)),_=s(r(185297)),x=r(400395),S=r(348693);var w=function(e){(0,p.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,g.default)(t);if(r){var s=(0,g.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,f.default)(this,e)});function s(){var e;(0,u.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,m.default)((0,h.default)(e),"getDestination",(0,c.default)(l.default.mark((function t(){var r,n,s;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.item,s=r.pdf,(0,x.isDefined)(e.destination)){t.next=9;break}if("string"!=typeof n.dest){t.next=8;break}return t.next=5,s.getDestination(n.dest);case 5:e.destination=t.sent,t.next=9;break;case 8:e.destination=n.dest;case 9:return t.abrupt("return",e.destination);case 10:case"end":return t.stop()}}),t)})))),(0,m.default)((0,h.default)(e),"getPageIndex",(0,c.default)(l.default.mark((function t(){var r,n,s,a;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props.pdf,(0,x.isDefined)(e.pageIndex)){t.next=10;break}return t.next=4,e.getDestination();case 4:if(!(n=t.sent)){t.next=10;break}return s=(0,o.default)(n,1),a=s[0],t.next=9,r.getPageIndex(new _.default(a));case 9:e.pageIndex=t.sent;case 10:return t.abrupt("return",e.pageIndex);case 11:case"end":return t.stop()}}),t)})))),(0,m.default)((0,h.default)(e),"getPageNumber",(0,c.default)(l.default.mark((function t(){return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,x.isDefined)(e.pageNumber)){t.next=5;break}return t.next=3,e.getPageIndex();case 3:t.t0=t.sent,e.pageNumber=t.t0+1;case 5:return t.abrupt("return",e.pageNumber);case 6:case"end":return t.stop()}}),t)})))),(0,m.default)((0,h.default)(e),"onClick",function(){var t=(0,c.default)(l.default.mark((function t(r){var n,s,a;return l.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onClick,r.preventDefault(),t.next=4,e.getPageIndex();case 4:return s=t.sent,t.next=7,e.getPageNumber();case 7:a=t.sent,n&&n({pageIndex:s,pageNumber:a});case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return(0,d.default)(s,[{key:"renderSubitems",value:function(){var e=this.props,t=e.item,r=(0,i.default)(e,["item"]);if(!t.items||!t.items.length)return null;var n=t.items;return v.default.createElement("ul",null,n.map((function(e,t){return v.default.createElement(s,(0,a.default)({key:"string"==typeof e.destination?e.destination:t,item:e},r))})))}},{key:"render",value:function(){var e=this.props.item;return v.default.createElement("li",null,v.default.createElement("a",{href:"#",onClick:this.onClick},e.title),this.renderSubitems())}}]),s}(v.PureComponent);t.OutlineItemInternal=w;var P=b.default.oneOfType([b.default.string,b.default.arrayOf(b.default.any)]);w.propTypes={item:b.default.shape({dest:P,items:b.default.arrayOf(b.default.shape({dest:P,title:b.default.string})),title:b.default.string}).isRequired,onClick:b.default.func,pdf:S.isPdf.isRequired};t.default=function(e){return v.default.createElement(y.default.Consumer,null,(function(t){return v.default.createElement(A.default.Consumer,null,(function(r){return v.default.createElement(w,(0,a.default)({},t,r,e))}))}))}},484182:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PageInternal=void 0;var a=s(r(967154)),i=s(r(887757)),o=s(r(348926)),l=s(r(334575)),c=s(r(993913)),u=s(r(281506)),d=s(r(502205)),h=s(r(178585)),p=s(r(629754)),f=s(r(859713)),g=n(r(124852)),m=s(r(675263)),v=s(r(8094)),b=s(r(684845)),y=s(r(289624)),A=s(r(512324)),_=s(r(646522)),x=s(r(245808)),S=s(r(262217)),w=s(r(807645)),P=s(r(937899)),C=s(r(642147)),k=s(r(38918)),R=r(400395),E=r(348693);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){(0,f.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=function(e){(0,d.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,p.default)(t);if(r){var s=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,h.default)(this,e)});function s(){var e;(0,l.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,f.default)((0,u.default)(e),"state",{page:null}),(0,f.default)((0,u.default)(e),"onLoadSuccess",(function(){var t=e.props,r=t.onLoadSuccess,n=t.registerPage,s=e.state.page;r&&r((0,R.makePageCallback)(s,e.scale)),n&&n(e.pageIndex,e.ref)})),(0,f.default)((0,u.default)(e),"onLoadError",(function(t){(0,R.errorOnDev)(t);var r=e.props.onLoadError;r&&r(t)})),(0,f.default)((0,u.default)(e),"loadPage",(0,o.default)(i.default.mark((function t(){var r,n,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props.pdf,n=e.getPageNumber()){t.next=4;break}return t.abrupt("return");case 4:return e.setState((function(e){return e.page?{page:null}:null})),t.prev=5,s=(0,v.default)(r.getPage(n)),e.runningTask=s,t.next=10,s.promise;case 10:a=t.sent,e.setState({page:a},e.onLoadSuccess),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(5),e.setState({page:!1}),e.onLoadError(t.t0);case 18:case"end":return t.stop()}}),t,null,[[5,14]])})))),e}return(0,c.default)(s,[{key:"componentDidMount",value:function(){if(!this.props.pdf)throw new Error("Attempted to load a page, but no document was specified.");this.loadPage()}},{key:"componentDidUpdate",value:function(e){var t=this.props.pdf;if(e.pdf&&t!==e.pdf||this.getPageNumber()!==this.getPageNumber(e)){var r=this.props.unregisterPage;r&&r(this.getPageIndex(e)),this.loadPage()}}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterPage;e&&e(this.pageIndex),(0,R.cancelRunningTask)(this.runningTask)}},{key:"getPageIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return(0,R.isProvided)(e.pageNumber)?e.pageNumber-1:(0,R.isProvided)(e.pageIndex)?e.pageIndex:null}},{key:"getPageNumber",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return(0,R.isProvided)(e.pageNumber)?e.pageNumber:(0,R.isProvided)(e.pageIndex)?e.pageIndex+1:null}},{key:"renderMainLayer",value:function(){var e=this.props,t=e.canvasRef;switch(e.renderMode){case"none":return null;case"svg":return g.default.createElement(P.default,{key:"".concat(this.pageKeyNoScale,"_svg")});default:return g.default.createElement(w.default,{key:"".concat(this.pageKey,"_canvas"),canvasRef:t})}}},{key:"renderTextLayer",value:function(){return this.props.renderTextLayer?g.default.createElement(C.default,{key:"".concat(this.pageKey,"_text")}):null}},{key:"renderAnnotationLayer",value:function(){return this.props.renderAnnotationLayer?g.default.createElement(k.default,{key:"".concat(this.pageKey,"_annotations")}):null}},{key:"renderChildren",value:function(){var e=this.props.children;return g.default.createElement(x.default.Provider,{value:this.childContext},this.renderMainLayer(),this.renderTextLayer(),this.renderAnnotationLayer(),e)}},{key:"renderContent",value:function(){var e=this.pageNumber,t=this.props.pdf,r=this.state.page;if(!e){var n=this.props.noData;return g.default.createElement(S.default,{type:"no-data"},"function"==typeof n?n():n)}if(null===t||null===r){var s=this.props.loading;return g.default.createElement(S.default,{type:"loading"},"function"==typeof s?s():s)}if(!1===t||!1===r){var a=this.props.error;return g.default.createElement(S.default,{type:"error"},"function"==typeof a?a():a)}return this.renderChildren()}},{key:"render",value:function(){var e=this.pageNumber,t=this.props,r=t.className,n=t.inputRef;return g.default.createElement("div",(0,a.default)({className:(0,y.default)("react-pdf__Page",r),"data-page-number":e,ref:(0,A.default)(n,this.ref),style:{position:"relative"}},this.eventProps),this.renderContent())}},{key:"childContext",get:function(){var e=this.state.page;if(!e)return{};var t=this.props;return{customTextRenderer:t.customTextRenderer,onGetAnnotationsError:t.onGetAnnotationsError,onGetAnnotationsSuccess:t.onGetAnnotationsSuccess,onGetTextError:t.onGetTextError,onGetTextSuccess:t.onGetTextSuccess,onRenderAnnotationLayerError:t.onRenderAnnotationLayerError,onRenderAnnotationLayerSuccess:t.onRenderAnnotationLayerSuccess,onRenderError:t.onRenderError,onRenderSuccess:t.onRenderSuccess,page:e,renderInteractiveForms:t.renderInteractiveForms,rotate:this.rotate,scale:this.scale}}},{key:"pageIndex",get:function(){return this.getPageIndex()}},{key:"pageNumber",get:function(){return this.getPageNumber()}},{key:"rotate",get:function(){var e=this.props.rotate;if((0,R.isProvided)(e))return e;var t=this.state.page;return t?t.rotate:null}},{key:"scale",get:function(){var e=this.state.page;if(!e)return null;var t=this.props,r=t.scale,n=t.width,s=t.height,a=this.rotate,i=1,o=null===r?1:r;if(n||s){var l=e.getViewport({scale:1,rotation:a});i=n?n/l.width:s/l.height}return o*i}},{key:"eventProps",get:function(){var e=this;return(0,b.default)(this.props,(function(){var t=e.state.page;return t?(0,R.makePageCallback)(t,e.scale):t}))}},{key:"pageKey",get:function(){var e=this.state.page;return"".concat(e.pageIndex,"@").concat(this.scale,"/").concat(this.rotate)}},{key:"pageKeyNoScale",get:function(){var e=this.state.page;return"".concat(e.pageIndex,"/").concat(this.rotate)}}]),s}(g.PureComponent);t.PageInternal=F,F.defaultProps={error:"Failed to load the page.",loading:"Loading page…",noData:"No page specified.",renderAnnotationLayer:!0,renderInteractiveForms:!1,renderMode:"canvas",renderTextLayer:!0,scale:1};var O=m.default.oneOfType([m.default.func,m.default.node]);function D(e,t){return g.default.createElement(_.default.Consumer,null,(function(r){return g.default.createElement(F,(0,a.default)({ref:t},r,e))}))}F.propTypes=L(L({},E.eventProps),{},{children:m.default.node,className:E.isClassName,customTextRenderer:m.default.func,error:O,height:m.default.number,inputRef:E.isRef,loading:O,noData:O,onGetTextError:m.default.func,onGetTextSuccess:m.default.func,onLoadError:m.default.func,onLoadSuccess:m.default.func,onRenderError:m.default.func,onRenderSuccess:m.default.func,pageIndex:E.isPageIndex,pageNumber:E.isPageNumber,pdf:E.isPdf,registerPage:m.default.func,renderAnnotationLayer:m.default.bool,renderInteractiveForms:m.default.bool,renderMode:E.isRenderMode,renderTextLayer:m.default.bool,rotate:E.isRotate,scale:m.default.number,unregisterPage:m.default.func,width:m.default.number});var I=g.default.forwardRef(D);t.default=I},38918:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.AnnotationLayerInternal=void 0;var a=s(r(967154)),i=s(r(887757)),o=s(r(348926)),l=s(r(334575)),c=s(r(993913)),u=s(r(281506)),d=s(r(502205)),h=s(r(178585)),p=s(r(629754)),f=s(r(859713)),g=n(r(124852)),m=s(r(675263)),v=n(r(299299)),b=s(r(8094)),y=s(r(646522)),A=s(r(245808)),_=r(400395),x=r(348693);var S=function(e){(0,d.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,p.default)(t);if(r){var s=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,h.default)(this,e)});function s(){var e;(0,l.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,f.default)((0,u.default)(e),"state",{annotations:null}),(0,f.default)((0,u.default)(e),"loadAnnotations",(0,o.default)(i.default.mark((function t(){var r,n,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.props.page,t.prev=1,n=(0,b.default)(r.getAnnotations()),e.runningTask=n,t.next=6,n.promise;case 6:s=t.sent,e.setState({annotations:s},e.onLoadSuccess),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),e.onLoadError(t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})))),(0,f.default)((0,u.default)(e),"onLoadSuccess",(function(){var t=e.props.onGetAnnotationsSuccess,r=e.state.annotations;t&&t(r)})),(0,f.default)((0,u.default)(e),"onLoadError",(function(t){e.setState({annotations:!1}),(0,_.errorOnDev)(t);var r=e.props.onGetAnnotationsError;r&&r(t)})),(0,f.default)((0,u.default)(e),"onRenderSuccess",(function(){var t=e.props.onRenderAnnotationLayerSuccess;t&&t()})),(0,f.default)((0,u.default)(e),"onRenderError",(function(t){(0,_.errorOnDev)(t);var r=e.props.onRenderAnnotationLayerError;r&&r(t)})),e}return(0,c.default)(s,[{key:"componentDidMount",value:function(){if(!this.props.page)throw new Error("Attempted to load page annotations, but no page was specified.");this.loadAnnotations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.page,n=t.renderInteractiveForms;(e.page&&r!==e.page||n!==e.renderInteractiveForms)&&this.loadAnnotations()}},{key:"componentWillUnmount",value:function(){(0,_.cancelRunningTask)(this.runningTask)}},{key:"renderAnnotationLayer",value:function(){var e=this.state.annotations;if(e){var t=this.props,r=t.linkService,n=t.page,s=t.renderInteractiveForms,a=this.viewport.clone({dontFlip:!0}),i={annotations:e,div:this.annotationLayer,linkService:r,page:n,renderInteractiveForms:s,viewport:a};this.annotationLayer.innerHTML="";try{v.AnnotationLayer.render(i),this.onRenderSuccess()}catch(e){this.onRenderError(e)}}}},{key:"render",value:function(){var e=this;return g.default.createElement("div",{className:"react-pdf__Page__annotations annotationLayer",ref:function(t){e.annotationLayer=t}},this.renderAnnotationLayer())}},{key:"viewport",get:function(){var e=this.props,t=e.page,r=e.rotate,n=e.scale;return t.getViewport({scale:n,rotation:r})}}]),s}(g.PureComponent);t.AnnotationLayerInternal=S,S.propTypes={linkService:x.isLinkService.isRequired,onGetAnnotationsError:m.default.func,onGetAnnotationsSuccess:m.default.func,onRenderAnnotationLayerError:m.default.func,onRenderAnnotationLayerSuccess:m.default.func,page:x.isPage,renderInteractiveForms:m.default.bool,rotate:x.isRotate,scale:m.default.number};t.default=function(e){return g.default.createElement(y.default.Consumer,null,(function(t){return g.default.createElement(A.default.Consumer,null,(function(r){return g.default.createElement(S,(0,a.default)({},t,r,e))}))}))}},807645:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return p.default.createElement(m.default.Consumer,null,(function(t){return p.default.createElement(y,(0,a.default)({},t,e))}))},t.PageCanvasInternal=void 0;var a=s(r(967154)),i=s(r(334575)),o=s(r(993913)),l=s(r(281506)),c=s(r(502205)),u=s(r(178585)),d=s(r(629754)),h=s(r(859713)),p=n(r(124852)),f=s(r(675263)),g=s(r(512324)),m=s(r(245808)),v=r(400395),b=r(348693);var y=function(e){(0,c.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,d.default)(t);if(r){var s=(0,d.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,u.default)(this,e)});function s(){var e;(0,i.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,h.default)((0,l.default)(e),"onRenderSuccess",(function(){e.renderer=null;var t=e.props,r=t.onRenderSuccess,n=t.page,s=t.scale;r&&r((0,v.makePageCallback)(n,s))})),(0,h.default)((0,l.default)(e),"onRenderError",(function(t){if(!(0,v.isCancelException)(t)){(0,v.errorOnDev)(t);var r=e.props.onRenderError;r&&r(t)}})),(0,h.default)((0,l.default)(e),"drawPageOnCanvas",(function(){var t=(0,l.default)(e).canvasLayer;if(!t)return null;var r=(0,l.default)(e),n=r.renderViewport,s=r.viewport,a=e.props,i=a.page,o=a.renderInteractiveForms;t.width=n.width,t.height=n.height,t.style.width="".concat(Math.floor(s.width),"px"),t.style.height="".concat(Math.floor(s.height),"px");var c={get canvasContext(){return t.getContext("2d")},viewport:n,renderInteractiveForms:o};return e.cancelRenderingTask(),e.renderer=i.render(c),e.renderer.promise.then(e.onRenderSuccess).catch(e.onRenderError)})),e}return(0,o.default)(s,[{key:"componentDidMount",value:function(){this.drawPageOnCanvas()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.page;t.renderInteractiveForms!==e.renderInteractiveForms&&(r.cleanup(),this.drawPageOnCanvas())}},{key:"componentWillUnmount",value:function(){this.cancelRenderingTask(),this.canvasLayer&&(this.canvasLayer.width=0,this.canvasLayer.height=0,this.canvasLayer=null)}},{key:"cancelRenderingTask",value:function(){this.renderer&&this.renderer._internalRenderTask.running&&this.renderer._internalRenderTask.cancel()}},{key:"render",value:function(){var e=this,t=this.props.canvasRef;return p.default.createElement("canvas",{className:"react-pdf__Page__canvas",dir:"ltr",ref:(0,g.default)(t,(function(t){e.canvasLayer=t})),style:{display:"block",userSelect:"none"}})}},{key:"renderViewport",get:function(){var e=this.props,t=e.page,r=e.rotate,n=e.scale,s=(0,v.getPixelRatio)();return t.getViewport({scale:n*s,rotation:r})}},{key:"viewport",get:function(){var e=this.props,t=e.page,r=e.rotate,n=e.scale;return t.getViewport({scale:n,rotation:r})}}]),s}(p.PureComponent);t.PageCanvasInternal=y,y.propTypes={canvasRef:b.isRef,onRenderError:f.default.func,onRenderSuccess:f.default.func,page:b.isPage.isRequired,renderInteractiveForms:f.default.bool,rotate:b.isRotate,scale:f.default.number}},937899:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return p.default.createElement(m.default.Consumer,null,(function(t){return p.default.createElement(y,(0,a.default)({},t,e))}))},t.PageSVGInternal=void 0;var a=s(r(967154)),i=s(r(334575)),o=s(r(993913)),l=s(r(281506)),c=s(r(502205)),u=s(r(178585)),d=s(r(629754)),h=s(r(859713)),p=n(r(124852)),f=s(r(675263)),g=n(r(299299)),m=s(r(245808)),v=r(400395),b=r(348693);var y=function(e){(0,c.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,d.default)(t);if(r){var s=(0,d.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,u.default)(this,e)});function s(){var e;(0,i.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,h.default)((0,l.default)(e),"state",{svg:null}),(0,h.default)((0,l.default)(e),"onRenderSuccess",(function(){e.renderer=null;var t=e.props,r=t.onRenderSuccess,n=t.page,s=t.scale;r&&r((0,v.makePageCallback)(n,s))})),(0,h.default)((0,l.default)(e),"onRenderError",(function(t){if(!(0,v.isCancelException)(t)){(0,v.errorOnDev)(t);var r=e.props.onRenderError;r&&r(t)}})),(0,h.default)((0,l.default)(e),"renderSVG",(function(){var t=e.props.page;return e.renderer=t.getOperatorList(),e.renderer.then((function(r){var n=new g.SVGGraphics(t.commonObjs,t.objs);e.renderer=n.getSVG(r,e.viewport).then((function(t){e.setState({svg:t},e.onRenderSuccess)})).catch(e.onRenderError)})).catch(e.onRenderError)})),(0,h.default)((0,l.default)(e),"drawPageOnContainer",(function(t){var r=e.state.svg;if(t&&r){t.firstElementChild||t.appendChild(r);var n=e.viewport,s=n.width,a=n.height;r.setAttribute("width",s),r.setAttribute("height",a)}})),e}return(0,o.default)(s,[{key:"componentDidMount",value:function(){this.renderSVG()}},{key:"render",value:function(){var e=this,t=this.viewport,r=t.width,n=t.height;return p.default.createElement("div",{className:"react-pdf__Page__svg",ref:function(t){return e.drawPageOnContainer(t)},style:{display:"block",backgroundColor:"white",overflow:"hidden",width:r,height:n,userSelect:"none"}})}},{key:"viewport",get:function(){var e=this.props,t=e.page,r=e.rotate,n=e.scale;return t.getViewport({scale:n,rotation:r})}}]),s}(p.PureComponent);t.PageSVGInternal=y,y.propTypes={onRenderError:f.default.func,onRenderSuccess:f.default.func,page:b.isPage.isRequired,rotate:b.isRotate,scale:f.default.number}},642147:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return g.default.createElement(b.default.Consumer,null,(function(t){return g.default.createElement(x,(0,a.default)({},t,e))}))},t.TextLayerInternal=void 0;var a=s(r(967154)),i=s(r(887757)),o=s(r(348926)),l=s(r(334575)),c=s(r(993913)),u=s(r(281506)),d=s(r(502205)),h=s(r(178585)),p=s(r(629754)),f=s(r(859713)),g=n(r(124852)),m=s(r(675263)),v=s(r(8094)),b=s(r(245808)),y=s(r(259766)),A=r(400395),_=r(348693);var x=function(e){(0,d.default)(s,e);var t,r,n=(t=s,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,p.default)(t);if(r){var s=(0,p.default)(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return(0,h.default)(this,e)});function s(){var e;(0,l.default)(this,s);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),(0,f.default)((0,u.default)(e),"state",{textItems:null}),(0,f.default)((0,u.default)(e),"loadTextItems",(0,o.default)(i.default.mark((function t(){var r,n,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.props.page,t.prev=1,n=(0,v.default)(r.getTextContent()),e.runningTask=n,t.next=6,n.promise;case 6:s=t.sent,a=s.items,e.setState({textItems:a},e.onLoadSuccess),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.onLoadError(t.t0);case 14:case"end":return t.stop()}}),t,null,[[1,11]])})))),(0,f.default)((0,u.default)(e),"onLoadSuccess",(function(){var t=e.props.onGetTextSuccess,r=e.state.textItems;t&&t(r)})),(0,f.default)((0,u.default)(e),"onLoadError",(function(t){e.setState({textItems:!1}),(0,A.errorOnDev)(t);var r=e.props.onGetTextError;r&&r(t)})),e}return(0,c.default)(s,[{key:"componentDidMount",value:function(){if(!this.props.page)throw new Error("Attempted to load page text content, but no page was specified.");this.loadTextItems()}},{key:"componentDidUpdate",value:function(e){var t=this.props.page;e.page&&t!==e.page&&this.loadTextItems()}},{key:"componentWillUnmount",value:function(){(0,A.cancelRunningTask)(this.runningTask)}},{key:"renderTextItems",value:function(){var e=this.state.textItems;return e?e.map((function(e,t){return g.default.createElement(y.default,(0,a.default)({key:t,itemIndex:t},e))})):null}},{key:"render",value:function(){var e=this.unrotatedViewport,t=this.rotate;return g.default.createElement("div",{className:"react-pdf__Page__textContent",style:{position:"absolute",top:"50%",left:"50%",width:"".concat(e.width,"px"),height:"".concat(e.height,"px"),color:"transparent",transform:"translate(-50%, -50%) rotate(".concat(t,"deg)"),WebkitTransform:"translate(-50%, -50%) rotate(".concat(t,"deg)"),pointerEvents:"none"}},this.renderTextItems())}},{key:"unrotatedViewport",get:function(){var e=this.props,t=e.page,r=e.scale;return t.getViewport({scale:r})}},{key:"rotate",get:function(){var e=this.props,t=e.page;return e.rotate-t.rotate}}]),s}(g.PureComponent);t.TextLayerInternal=x,x.propTypes={onGetTextError:m.default.func,onGetTextSuccess:m.default.func,page:_.isPage.isRequired,rotate:_.isRotate,scale:m.default.number}},259766:(e,t,r)=>{"use strict";var n=r(820862),s=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return m.default.createElement(b.default.Consumer,null,(function(t){return m.default.createElement(A,(0,a.default)({},t,e))}))},t.TextLayerItemInternal=void 0;var a=s(r(967154)),i=s(r(963038)),o=s(r(887757)),l=s(r(348926)),c=s(r(334575)),u=s(r(993913)),d=s(r(281506)),h=s(r(502205)),p=s(r(178585)),f=s(r(629754)),g=s(r(859713)),m=n(r(124852)),v=s(r(675263)),b=s(r(245808)),y=r(348693);var A=function(e){(0,h.default)(v,e);var t,r,n,s,a=(n=v,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,f.default)(n);if(s){var r=(0,f.default)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,p.default)(this,e)});function v(){var e;(0,c.default)(this,v);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=a.call.apply(a,[this].concat(r)),(0,g.default)((0,d.default)(e),"getElementWidth",(function(t){var r=(0,d.default)(e).sideways;return t.getBoundingClientRect()[r?"height":"width"]})),e}return(0,u.default)(v,[{key:"componentDidMount",value:function(){this.alignTextItem()}},{key:"componentDidUpdate",value:function(){this.alignTextItem()}},{key:"getFontData",value:(r=(0,l.default)(o.default.mark((function e(t){var r,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.props.page,e.next=3,new Promise((function(e){r.commonObjs.get(t,e)}));case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"alignTextItem",value:(t=(0,l.default)(o.default.mark((function e(){var t,r,n,s,a,i,l,c,u,d,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.item){e.next=3;break}return e.abrupt("return");case 3:return t.style.transform="",r=this.props,n=r.fontName,s=r.scale,a=r.width,t.style.fontFamily="".concat(n,", sans-serif"),e.next=8,this.getFontData(n);case 8:i=e.sent,l=i?i.fallbackName:"sans-serif",t.style.fontFamily="".concat(n,", ").concat(l),c=a*s,u=this.getElementWidth(t),d="scaleX(".concat(c/u,")"),(h=i?i.ascent:0)&&(d+=" translateY(".concat(100*(1-h),"%)")),t.style.transform=d,t.style.WebkitTransform=d;case 18:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.fontSize,r=this.top,n=this.left,s=this.props,a=s.customTextRenderer,i=s.scale,o=s.str;return m.default.createElement("span",{ref:function(t){e.item=t},style:{height:"1em",fontFamily:"sans-serif",fontSize:"".concat(t*i,"px"),position:"absolute",top:"".concat(r*i,"px"),left:"".concat(n*i,"px"),transformOrigin:"left bottom",whiteSpace:"pre",pointerEvents:"all"}},a?a(this.props):o)}},{key:"unrotatedViewport",get:function(){var e=this.props,t=e.page,r=e.scale;return t.getViewport({scale:r})}},{key:"rotate",get:function(){var e=this.props,t=e.page;return e.rotate-t.rotate}},{key:"sideways",get:function(){return this.rotate%180!=0}},{key:"defaultSideways",get:function(){return this.unrotatedViewport.rotation%180!=0}},{key:"fontSize",get:function(){var e=this.props.transform,t=this.defaultSideways,r=(0,i.default)(e,2),n=r[0],s=r[1];return t?s:n}},{key:"top",get:function(){var e=this.props.transform,t=this.unrotatedViewport,r=this.defaultSideways,n=(0,i.default)(e,6),s=n[2],a=n[3],o=n[4],l=n[5],c=(0,i.default)(t.viewBox,4),u=c[1],d=c[3];return r?o+s+u:d-(l+a)}},{key:"left",get:function(){var e=this.props.transform,t=this.unrotatedViewport,r=this.defaultSideways,n=(0,i.default)(e,6),s=n[4],a=n[5],o=(0,i.default)(t.viewBox,1)[0];return r?a-o:s-o}}]),v}(m.PureComponent);t.TextLayerItemInternal=A,A.propTypes={customTextRenderer:v.default.func,fontName:v.default.string.isRequired,itemIndex:v.default.number.isRequired,page:y.isPage.isRequired,rotate:y.isRotate,scale:v.default.number,str:v.default.string.isRequired,transform:v.default.arrayOf(v.default.number).isRequired,width:v.default.number.isRequired}},245808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=(0,r(124852).createContext)(null);t.default=n},167101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={NEED_PASSWORD:1,INCORRECT_PASSWORD:2}},185297:(e,t,r)=>{"use strict";var n=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(334575)),a=n(r(993913)),i=function(){function e(t){var r=t.num,n=t.gen;(0,s.default)(this,e),this.num=r,this.gen=n}return(0,a.default)(e,[{key:"toString",value:function(){var e="".concat(this.num,"R");return 0!==this.gen&&(e+=this.gen),e}}]),e}();t.default=i},466756:(e,t,r)=>{"use strict";var n=r(595318),s=r(820862);Object.defineProperty(t,"BB",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"T3",{enumerable:!0,get:function(){return o.default}});var a=s(r(299299)),i=n(r(682013)),o=(n(r(830076)),n(r(484182))),l=n(r(149198)),c=r(400395);c.isLocalFileSystem&&(0,c.warnOnDev)("You are running React-PDF from your local file system. PDF.js Worker may fail to load due to browser's security policies. If you're on Google Chrome, you can use --allow-file-access-from-files flag for debugging purposes."),"undefined"!=typeof window&&"Worker"in window&&(a.GlobalWorkerOptions.workerPort=new l.default)},54366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=new(r(6420).EventBus);t.default=n},348693:(e,t,r)=>{"use strict";var n=r(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.isRotate=t.isRenderMode=t.isRef=t.isPdf=t.isPageNumber=t.isPageIndex=t.isPage=t.isLinkTarget=t.isLinkService=t.isFile=t.isClassName=t.eventProps=void 0;var s,a=n(r(750008)),i=n(r(319)),o=n(r(675263)),l=r(684845),c=r(400395),u=n(r(865309)),d=(s={},[].concat((0,i.default)(l.mouseEvents),(0,i.default)(l.touchEvents),(0,i.default)(l.keyboardEvents)).forEach((function(e){s[e]=o.default.func})),s);t.eventProps=d;var h=[o.default.string,o.default.instanceOf(ArrayBuffer),o.default.shape({data:o.default.object,httpHeaders:o.default.object,range:o.default.object,url:o.default.string,withCredentials:o.default.bool})];"undefined"!=typeof File&&h.push(o.default.instanceOf(File)),"undefined"!=typeof Blob&&h.push(o.default.instanceOf(Blob));var p=o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.string)]);t.isClassName=p;var f=o.default.oneOfType(h);t.isFile=f;var g=o.default.instanceOf(u.default);t.isLinkService=g;var m=o.default.oneOf(["_self","_blank","_parent","_top"]);t.isLinkTarget=m;var v=o.default.shape({_transport:o.default.shape({fontLoader:o.default.object.isRequired}).isRequired,commonObjs:o.default.shape({_objs:o.default.object.isRequired}).isRequired,getAnnotations:o.default.func.isRequired,getTextContent:o.default.func.isRequired,getViewport:o.default.func.isRequired,render:o.default.func.isRequired});t.isPage=v,t.isPageIndex=function(e,t,r){var n=e[t],s=e.pageNumber,i=e.pdf;if(!(0,c.isDefined)(i))return null;if((0,c.isDefined)(n)){if("number"!=typeof n)return new Error("`".concat(t,"` of type `").concat((0,a.default)(n),"` supplied to `").concat(r,"`, expected `number`."));if(n<0)return new Error("Expected `".concat(t,"` to be greater or equal to 0."));var o=i.numPages;if(n+1>o)return new Error("Expected `".concat(t,"` to be less or equal to ").concat(o-1,"."))}else if(!(0,c.isDefined)(s))return new Error("`".concat(t,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(r,"`."));return null},t.isPageNumber=function(e,t,r){var n=e[t],s=e.pageIndex,i=e.pdf;if(!(0,c.isDefined)(i))return null;if((0,c.isDefined)(n)){if("number"!=typeof n)return new Error("`".concat(t,"` of type `").concat((0,a.default)(n),"` supplied to `").concat(r,"`, expected `number`."));if(n<1)return new Error("Expected `".concat(t,"` to be greater or equal to 1."));var o=i.numPages;if(n>o)return new Error("Expected `".concat(t,"` to be less or equal to ").concat(o,"."))}else if(!(0,c.isDefined)(s))return new Error("`".concat(t,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(r,"`."));return null};var b=o.default.oneOfType([o.default.shape({getDestination:o.default.func.isRequired,getOutline:o.default.func.isRequired,getPage:o.default.func.isRequired,numPages:o.default.number.isRequired}),o.default.bool]);t.isPdf=b;var y=o.default.oneOfType([o.default.func,o.default.shape({current:o.default.any})]);t.isRef=y;var A=o.default.oneOf(["canvas","none","svg"]);t.isRenderMode=A;var _=o.default.oneOf([0,90,180,270]);t.isRotate=_},400395:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadFromFile=t.isCancelException=t.makePageCallback=t.cancelRunningTask=t.displayCORSWarning=t.errorOnDev=t.warnOnDev=t.getPixelRatio=t.dataURItoUint8Array=t.isDataURI=t.isFile=t.isBlob=t.isArrayBuffer=t.isString=t.isProvided=t.isDefined=t.isProduction=t.isLocalFileSystem=t.isBrowser=void 0;var r="undefined"!=typeof window;t.isBrowser=r;var n=r&&"file:"===window.location.protocol;t.isLocalFileSystem=n;t.isProduction=!0;var s=function(e){return void 0!==e};t.isDefined=s,t.isProvided=function(e){return s(e)&&null!==e};var a=function(e){return"string"==typeof e};t.isString=a,t.isArrayBuffer=function(e){return e instanceof ArrayBuffer},t.isBlob=function(e){if(!r)throw new Error("Attempted to check if a variable is a Blob on a non-browser environment.");return e instanceof Blob},t.isFile=function(e){if(!r)throw new Error("Attempted to check if a variable is a File on a non-browser environment.");return e instanceof File};var i=function(e){return a(e)&&/^data:/.test(e)};t.isDataURI=i,t.dataURItoUint8Array=function(e){if(!i(e))throw new Error("dataURItoUint8Array was provided with an argument which is not a valid data URI.");var t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);for(var r=new Uint8Array(t.length),n=0;n<t.length;n+=1)r[n]=t.charCodeAt(n);return r},t.getPixelRatio=function(){return r&&window.devicePixelRatio||1};var o=function(e){},l=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.apply(void 0,["warn"].concat(t))};t.warnOnDev=l,t.errorOnDev=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return o.apply(void 0,["error"].concat(t))},t.displayCORSWarning=function(){n&&l("Loading PDF as base64 strings/URLs might not work on protocols other than HTTP/HTTPS. On Google Chrome, you can use --allow-file-access-from-files flag for debugging purposes.")},t.cancelRunningTask=function(e){e&&e.cancel&&e.cancel()},t.makePageCallback=function(e,t){return Object.defineProperty(e,"width",{get:function(){return this.view[2]*t},configurable:!0}),Object.defineProperty(e,"height",{get:function(){return this.view[3]*t},configurable:!0}),Object.defineProperty(e,"originalWidth",{get:function(){return this.view[2]},configurable:!0}),Object.defineProperty(e,"originalHeight",{get:function(){return this.view[3]},configurable:!0}),e},t.isCancelException=function(e){return"RenderingCancelledException"===e.name},t.loadFromFile=function(e){return new Promise((function(t,r){var n=new FileReader;return n.onload=function(){return t(new Uint8Array(n.result))},n.onerror=function(e){switch(e.target.error.code){case e.target.error.NOT_FOUND_ERR:return r(new Error("Error while reading a file: File not found."));case e.target.error.NOT_READABLE_ERR:return r(new Error("Error while reading a file: File not readable."));case e.target.error.SECURITY_ERR:return r(new Error("Error while reading a file: Security error."));case e.target.error.ABORT_ERR:return r(new Error("Error while reading a file: Aborted."));default:return r(new Error("Error while reading a file."))}},n.readAsArrayBuffer(e),null}))}},535666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",i=s.asyncIterator||"@@asyncIterator",o=s.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var s=t&&t.prototype instanceof m?t:m,a=Object.create(s.prototype),i=new R(n||[]);return a._invoke=function(e,t,r){var n=d;return function(s,a){if(n===p)throw new Error("Generator is already running");if(n===f){if("throw"===s)throw a;return T()}for(r.method=s,r.arg=a;;){var i=r.delegate;if(i){var o=P(i,r);if(o){if(o===g)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var l=u(e,t,r);if("normal"===l.type){if(n=r.done?f:h,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=f,r.method="throw",r.arg=l.arg)}}}(e,r,i),a}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",h="suspendedYield",p="executing",f="completed",g={};function m(){}function v(){}function b(){}var y={};l(y,a,(function(){return this}));var A=Object.getPrototypeOf,_=A&&A(A(E([])));_&&_!==r&&n.call(_,a)&&(y=_);var x=b.prototype=m.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(s,a,i,o){var l=u(e[s],e,a);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,o)}),(function(e){r("throw",e,i,o)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,o)}))}o(l.arg)}var s;this._invoke=function(e,n){function a(){return new t((function(t,s){r(e,n,t,s)}))}return s=s?s.then(a,a):a()}}function P(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var s=u(n,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,g;var a=s.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,i=function r(){for(;++s<e.length;)if(n.call(e,s))return r.value=e[s],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:T}}function T(){return{value:t,done:!0}}return v.prototype=b,l(x,"constructor",b),l(b,"constructor",v),v.displayName=l(b,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,o,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},S(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,s,a){void 0===a&&(a=Promise);var i=new w(c(t,r,n,s),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(x),l(x,o,"Generator"),l(x,a,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function s(n,s){return o.type="throw",o.arg=e,r.next=n,s&&(r.method="next",r.arg=t),!!s}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return s("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return s(i.catchLoc,!0);if(this.prev<i.finallyLoc)return s(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return s(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return s(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var a=s;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var s=n.arg;k(r)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},149198:(e,t,r)=>{"use strict";function n(){return new Worker(r.p+"pdf.worker.entry.worker.js")}r.r(t),r.d(t,{default:()=>n})}}]);