Generic build of PDF.js library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
263 KiB

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t():e["pdfjs-dist/build/pdf"]=e.pdfjsDistBuildPdf=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=83)}([function(e,t,r){"use strict";function n(e){le=e}function i(){return le}function a(e){le>=ae.infos&&console.log("Info: "+e)}function o(e){le>=ae.warnings&&console.log("Warning: "+e)}function s(e){console.log("Deprecated API usage: "+e)}function l(e){throw new Error(e)}function c(e,t){e||l(t)}function u(e,t){try{var r=new URL(e);if(!r.origin||"null"===r.origin)return!1}catch(e){return!1}var n=new URL(t,r);return r.origin===n.origin}function h(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function d(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(h(r))return r}catch(e){}return null}function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}function p(e){var t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}}function m(e){return"string"!=typeof e?(o("The argument for removeNullCharacters must be a string."),e):e.replace(Ae,"")}function g(e){c(null!==e&&"object"===(void 0===e?"undefined":X(e))&&void 0!==e.length,"Invalid argument for bytesToString");var t=e.length;if(t<8192)return String.fromCharCode.apply(null,e);for(var r=[],n=0;n<t;n+=8192){var i=Math.min(n+8192,t),a=e.subarray(n,i);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function v(e){c("string"==typeof e,"Invalid argument for stringToBytes");for(var t=e.length,r=new Uint8Array(t),n=0;n<t;++n)r[n]=255&e.charCodeAt(n);return r}function b(e){return void 0!==e.length?e.length:(c(void 0!==e.byteLength),e.byteLength)}function y(e){if(1===e.length&&e[0]instanceof Uint8Array)return e[0];var t,r,n,i=0,a=e.length;for(t=0;t<a;t++)r=e[t],n=b(r),i+=n;var o=0,s=new Uint8Array(i);for(t=0;t<a;t++)r=e[t],r instanceof Uint8Array||(r="string"==typeof r?v(r):new Uint8Array(r)),n=r.byteLength,s.set(r,o),o+=n;return s}function _(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function A(e){for(var t=1,r=0;e>t;)t<<=1,r++;return r}function S(e,t){return e[t]<<24>>24}function w(e,t){return e[t]<<8|e[t+1]}function P(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function C(){var e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}function x(){try{return new Function(""),!0}catch(e){return!1}}function R(e){var t,r=e.length,n=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;t<r;t+=2)n.push(String.fromCharCode(e.charCodeAt(t)<<8|e.charCodeAt(t+1)));else for(t=0;t<r;++t){var i=Ce[e.charCodeAt(t)];n.push(i?String.fromCharCode(i):e.charAt(t))}return n.join("")}function k(e){return decodeURIComponent(escape(e))}function T(e){return unescape(encodeURIComponent(e))}function E(e){for(var t in e)return!1;return!0}function I(e){return"boolean"==typeof e}function O(e){return"number"==typeof e&&(0|e)===e}function L(e){return"number"==typeof e}function j(e){return"string"==typeof e}function D(e){return e instanceof Array}function F(e){return"object"===(void 0===e?"undefined":X(e))&&null!==e&&void 0!==e.byteLength}function N(e){return 32===e||9===e||13===e||10===e}function M(){return"object"===("undefined"==typeof process?"undefined":X(process))&&process+""=="[object process]"}function q(){var e={};return e.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),e}function U(e,t){var r=arguments.length>2&&void 0!==arguments[2]?a
;if("string"==typeof e)a={url:e};else if((0,u.isArrayBuffer)(e))a={data:e};else if(e instanceof R)a={range:e};else{if("object"!==(void 0===e?"undefined":c(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");a=e}var s={},l=null,d=null,f=h.DOMCMapReaderFactory;for(var p in a)if("url"!==p||"undefined"==typeof window)if("range"!==p)if("worker"!==p)if("data"!==p||a[p]instanceof Uint8Array)"CMapReaderFactory"!==p?s[p]=a[p]:f=a[p];else{var v=a[p];if("string"==typeof v)s[p]=(0,u.stringToBytes)(v);else if("object"!==(void 0===v?"undefined":c(v))||null===v||isNaN(v.length)){if(!(0,u.isArrayBuffer)(v))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");s[p]=new Uint8Array(v)}else s[p]=new Uint8Array(v)}else d=a[p];else l=a[p];else s[p]=new URL(a[p],window.location).href;if(s.rangeChunkSize=s.rangeChunkSize||g,s.ignoreErrors=!0!==s.stopAtErrors,void 0!==s.disableNativeImageDecoder&&(0,u.deprecated)("parameter disableNativeImageDecoder, use nativeImageDecoderSupport instead"),s.nativeImageDecoderSupport=s.nativeImageDecoderSupport||(!0===s.disableNativeImageDecoder?u.NativeImageDecoding.NONE:u.NativeImageDecoding.DECODE),s.nativeImageDecoderSupport!==u.NativeImageDecoding.DECODE&&s.nativeImageDecoderSupport!==u.NativeImageDecoding.NONE&&s.nativeImageDecoderSupport!==u.NativeImageDecoding.DISPLAY&&((0,u.warn)("Invalid parameter nativeImageDecoderSupport: need a state of enum {NativeImageDecoding}"),s.nativeImageDecoderSupport=u.NativeImageDecoding.DECODE),!d){var b=(0,h.getDefaultSetting)("workerPort");d=b?I.fromPort(b):new I,i._worker=d}var y=i.docId;return d.promise.then(function(){if(i.destroyed)throw new Error("Loading aborted");return o(d,s,l,y).then(function(e){if(i.destroyed)throw new Error("Loading aborted");var t=void 0;l?t=new m.PDFDataTransportStream(s,l):s.data||(t=new w({source:s,disableRange:(0,h.getDefaultSetting)("disableRange")}));var r=new u.MessageHandler(y,e,d.port);r.postMessageTransfers=d.postMessageTransfers;var n=new O(r,i,t,f);i._transport=n,r.send("Ready",null)})}).catch(i._capability.reject),i}function o(e,t,r,n){return e.destroyed?Promise.reject(new Error("Worker was destroyed")):(t.disableAutoFetch=(0,h.getDefaultSetting)("disableAutoFetch"),t.disableStream=(0,h.getDefaultSetting)("disableStream"),t.chunkedViewerLoading=!!r,r&&(t.length=r.length,t.initialData=r.initialData),e.messageHandler.sendWithPromise("GetDocRequest",{docId:n,source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:(0,h.getDefaultSetting)("maxImageSize"),disableFontFace:(0,h.getDefaultSetting)("disableFontFace"),disableCreateObjectURL:(0,h.getDefaultSetting)("disableCreateObjectURL"),postMessageTransfers:(0,h.getDefaultSetting)("postMessageTransfers")&&!b,docBaseUrl:t.docBaseUrl,nativeImageDecoderSupport:t.nativeImageDecoderSupport,ignoreErrors:t.ignoreErrors}).then(function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t}))}Object.defineProperty(t,"__esModule",{value:!0}),t.build=t.version=t._UnsupportedManager=t.setPDFNetworkStreamClass=t.PDFPageProxy=t.PDFDocumentProxy=t.PDFWorker=t.PDFDataRangeTransport=t.LoopbackPort=t.getDocument=void 0;var s,l=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c="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},u=r(0),h=r(7),d=r(80),f=r(79),p=r(50),m=r(82),g=65536,v=!1,b=!1,y="undefined"!=typeof document&&document.currentScript?document.currentScript.src:null,_=null,A=!1;"undefined"==typeof window?(v=!0,void 0===
a.warn)("Unimplemented button widget annotation: pushbutton");break;case"Ch":return new f(e)}return new c(e);case a.AnnotationType.POPUP:return new p(e);case a.AnnotationType.LINE:return new g(e);case a.AnnotationType.HIGHLIGHT:return new v(e);case a.AnnotationType.UNDERLINE:return new b(e);case a.AnnotationType.SQUIGGLY:return new y(e);case a.AnnotationType.STRIKEOUT:return new _(e);case a.AnnotationType.FILEATTACHMENT:return new A(e);default:return new o(e)}}};var o=function(){function e(e,t,r){this.isRenderable=t||!1,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,t&&(this.container=this._createContainer(r))}return e.prototype={_createContainer:function(e){var t=this.data,r=this.page,n=this.viewport,o=document.createElement("section"),s=t.rect[2]-t.rect[0],l=t.rect[3]-t.rect[1];o.setAttribute("data-annotation-id",t.id);var c=a.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(i.CustomStyle.setProp("transform",o,"matrix("+n.transform.join(",")+")"),i.CustomStyle.setProp("transformOrigin",o,-c[0]+"px "+-c[1]+"px"),!e&&t.borderStyle.width>0){o.style.borderWidth=t.borderStyle.width+"px",t.borderStyle.style!==a.AnnotationBorderStyleType.UNDERLINE&&(s-=2*t.borderStyle.width,l-=2*t.borderStyle.width);var u=t.borderStyle.horizontalCornerRadius,h=t.borderStyle.verticalCornerRadius;if(u>0||h>0){var d=u+"px / "+h+"px";i.CustomStyle.setProp("borderRadius",o,d)}switch(t.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid"}t.color?o.style.borderColor=a.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):o.style.borderWidth=0}return o.style.left=c[0]+"px",o.style.top=c[1]+"px",o.style.width=s+"px",o.style.height=l+"px",o},_createPopup:function(e,t,r){t||(t=document.createElement("div"),t.style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));var n=new m({container:e,trigger:t,color:r.color,title:r.title,contents:r.contents,hideWrapper:!0}),i=n.render();i.style.left=e.style.width,e.appendChild(i)},render:function(){throw new Error("Abstract method AnnotationElement.render called")}},e}(),s=function(){function e(e){o.call(this,e,!0)}return a.Util.inherit(e,o,{render:function(){this.container.className="linkAnnotation";var e=document.createElement("a");return(0,i.addLinkAttributes)(e,{url:this.data.url,target:this.data.newWindow?i.LinkTarget.BLANK:void 0}),this.data.url||(this.data.action?this._bindNamedAction(e,this.data.action):this._bindLink(e,this.data.dest)),this.container.appendChild(e),this.container},_bindLink:function(e,t){var r=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&r.linkService.navigateTo(t),!1},t&&(e.className="internalLink")},_bindNamedAction:function(e,t){var r=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return r.linkService.executeNamedAction(t),!1},e.className="internalLink"}}),e}(),l=function(){function e(e){var t=!!(e.data.hasPopup||e.data.title||e.data.contents);o.call(this,e,t)}return a.Util.inherit(e,o,{render:function(){this.container.className="textAnnotation";var 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}}),e}
;return i.setAttributeNS(null,"transform",r(e.transform)),t.appendChild(i),this.svg=i,t},_ensureClipGroup:function(){if(!this.current.clipGroup){var e=document.createElementNS(l,"svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(e),this.current.clipGroup=e}return this.current.clipGroup},_ensureTransformGroup:function(){return this.tgrp||(this.tgrp=document.createElementNS(l,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}},i}(),t.SVGGraphics=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderTextLayer=void 0;var n=r(0),i=r(7),a=function(){function e(e){return!h.test(e)}function t(t,r,a){var o=document.createElement("div"),s={style:null,angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(t._textDivs.push(o),e(r.str))return s.isWhitespace=!0,void t._textDivProperties.set(o,s);var l=n.Util.transform(t._viewport.transform,r.transform),c=Math.atan2(l[1],l[0]),u=a[r.fontName];u.vertical&&(c+=Math.PI/2);var h=Math.sqrt(l[2]*l[2]+l[3]*l[3]),f=h;u.ascent?f=u.ascent*f:u.descent&&(f=(1+u.descent)*f);var p,m;if(0===c?(p=l[4],m=l[5]-f):(p=l[4]+f*Math.sin(c),m=l[5]-f*Math.cos(c)),d[1]=p,d[3]=m,d[5]=h,d[7]=u.fontFamily,s.style=d.join(""),o.setAttribute("style",s.style),o.textContent=r.str,(0,i.getDefaultSetting)("pdfBug")&&(o.dataset.fontName=r.fontName),0!==c&&(s.angle=c*(180/Math.PI)),r.str.length>1&&(u.vertical?s.canvasWidth=r.height*t._viewport.scale:s.canvasWidth=r.width*t._viewport.scale),t._textDivProperties.set(o,s),t._textContentStream&&t._layoutText(o),t._enhanceTextSelection){var g=1,v=0;0!==c&&(g=Math.cos(c),v=Math.sin(c));var b,y,_=(u.vertical?r.height:r.width)*t._viewport.scale,A=h;0!==c?(b=[g,v,-v,g,p,m],y=n.Util.getAxialAlignedBoundingBox([0,0,_,A],b)):y=[p,m,p+_,m+A],t._bounds.push({left:y[0],top:y[1],right:y[2],bottom:y[3],div:o,size:[_,A],m:b})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,n=t.length;if(n>u)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var i=0;i<n;i++)e._layoutText(t[i]);e._renderingDone=!0,r.resolve()}}function a(e){for(var t=e._bounds,r=e._viewport,i=o(r.width,r.height,t),a=0;a<i.length;a++){var s=t[a].div,l=e._textDivProperties.get(s);if(0!==l.angle){var c=i[a],u=t[a],h=u.m,d=h[0],f=h[1],p=[[0,0],[0,u.size[1]],[u.size[0],0],u.size],m=new Float64Array(64);p.forEach(function(e,t){var r=n.Util.applyTransform(e,h);m[t+0]=d&&(c.left-r[0])/d,m[t+4]=f&&(c.top-r[1])/f,m[t+8]=d&&(c.right-r[0])/d,m[t+12]=f&&(c.bottom-r[1])/f,m[t+16]=f&&(c.left-r[0])/-f,m[t+20]=d&&(c.top-r[1])/d,m[t+24]=f&&(c.right-r[0])/-f,m[t+28]=d&&(c.bottom-r[1])/d,m[t+32]=d&&(c.left-r[0])/-d,m[t+36]=f&&(c.top-r[1])/-f,m[t+40]=d&&(c.right-r[0])/-d,m[t+44]=f&&(c.bottom-r[1])/-f,m[t+48]=f&&(c.left-r[0])/f,m[t+52]=d&&(c.top-r[1])/-d,m[t+56]=f&&(c.right-r[0])/f,m[t+60]=d&&(c.bottom-r[1])/-d});var g=function(e,t,r){for(var n=0,i=0;i<r;i++){var a=e[t++];a>0&&(n=n?Math.min(a,n):a)}return n},v=1+Math.min(Math.abs(d),Math.abs(f));l.paddingLeft=g(m,32,16)/v,l.paddingTop=g(m,48,16)/v,l.paddingRight=g(m,0,16)/v,l.paddingBottom=g(m,16,16)/v,e._textDivProperties.set(s,l)}else l.paddingLeft=t[a].left-i[a].left,l.paddingTop=t[a].top-i[a].top,l.paddingRight=i[a].right-t[a].right,l.paddingBottom=i[a].bottom-t[a].bottom,e._textDivProperties.set(s,l)}}function o(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}});s(e,n);var i=new Array(r.length);return n.forEach(function(e){var t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}),r.map(function(t,r){var a=i[r],o=n[r];o.x1=t.top,o.y1=e-a.right,o.x2=t.bottom,o.y2=e-a.left,o.index=r,o.x1New=void 0,o.x2New=void 0}),s(t,n),n.forEach(function(e){var t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New}),i}function s(e,t){t.sort(function(e,t){return e.x1-t.x1||e.index-t.index});var r={x1:-1/0,y1:-1/0,x
for(var e in this.pendingRequests)this.abortRequest(0|e)},abortRequest:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},a.prototype={_onRangeRequestReaderClosed:function(e){var t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)},getFullReader:function(){return(0,l.assert)(!this._fullRequestReader),this._fullRequestReader=new o(this._manager,this._options),this._fullRequestReader},getRangeReader:function(e,t){var r=new s(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r},cancelAllRequests:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach(function(t){t.cancel(e)})}},o.prototype={_validateRangeRequestCapabilities:function(){if(this._disableRange)return!1;var e=this._manager;if(!e.isHttp)return!1;var t=this._fullRequestId,r=e.getRequestXhr(t);if("bytes"!==r.getResponseHeader("Accept-Ranges"))return!1;if("identity"!==(r.getResponseHeader("Content-Encoding")||"identity"))return!1;var n=r.getResponseHeader("Content-Length");return n=parseInt(n,10),!!(0,l.isInt)(n)&&(this._contentLength=n,!(n<=2*this._rangeChunkSize))},_onHeadersReceived:function(){this._validateRangeRequestCapabilities()&&(this._isRangeSupported=!0);var e=this._manager,t=this._fullRequestId;e.isStreamingRequest(t)?this._isStreamingSupported=!0:this._isRangeSupported&&e.abortRequest(t),this._headersReceivedCapability.resolve()},_onProgressiveData:function(e){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._cachedChunks.push(e)},_onDone:function(e){e&&this._onProgressiveData(e.chunk),this._done=!0,this._cachedChunks.length>0||(this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[])},_onError:function(e){var t,r=this._url;t=404===e||0===e&&/^file:/.test(r)?new l.MissingPDFException('Missing PDF "'+r+'".'):new l.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+r+'".',e),this._storedError=t,this._headersReceivedCapability.reject(t),this._requests.forEach(function(e){e.reject(t)}),this._requests=[],this._cachedChunks=[]},_onProgress:function(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})},get isRangeSupported(){return this._isRangeSupported},get isStreamingSupported(){return this._isStreamingSupported},get contentLength(){return this._contentLength},get headersReady(){return this._headersReceivedCapability.promise},read:function(){if(this._storedError)return Promise.reject(this._storedError);if(this._cachedChunks.length>0){var e=this._cachedChunks.shift();return Promise.resolve({value:e,done:!1})}if(this._done)return Promise.resolve({value:void 0,done:!0});var t=(0,l.createPromiseCapability)();return this._requests.push(t),t.promise},cancel:function(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}},s.prototype={_close:function(){this.onClosed&&this.onClosed(this)},_onDone:function(e){var t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._close()},_onProgress:function(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})},get isStreamingSupported(){return!1},read:function(){if(null!==this._queuedChunk){var e=this._queuedChunk;return this._queuedChunk=null,Promise.resolve({value:e,done:!1})}if(this._done)return Promise.resolve({value:void 0,done:!0});var t=(0,l.createPromiseCapability)();return this._requests.push(t),t.promise},cancel:function(e){this._done=!0,this._requests.forEach(function(e){e.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingReques
var u=c[0],h=Math.min(s,u.byteLength),d=t.byteOffset+t.bytesFilled;Ce(t.buffer,d,u.buffer,u.byteOffset,h),u.byteLength===h?c.shift():(u.byteOffset+=h,u.byteLength-=h),e._queueTotalSize-=h,Y(e,h,t),s-=h}return!1===l&&(Me(0===e._queueTotalSize,"queue must be empty"),Me(t.bytesFilled>0),Me(t.bytesFilled<t.elementSize)),l}function Y(e,t,r){Me(0===e._pendingPullIntos.length||e._pendingPullIntos[0]===r),J(e),r.bytesFilled+=t}function V(e){Me("readable"===e._controlledReadableStream._state),0===e._queueTotalSize&&!0===e._closeRequested?g(e._controlledReadableStream):W(e)}function J(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function Q(e){for(Me(!1===e._closeRequested);e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos[0];!0===X(e,t)&&(te(e),z(e._controlledReadableStream,t))}}function K(e,t){var r=e._controlledReadableStream,n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);var i=t.constructor,a={buffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,ctor:i,readerType:"byob"};if(e._pendingPullIntos.length>0)return a.buffer=Ee(a.buffer),e._pendingPullIntos.push(a),f(r);if("closed"===r._state){var o=new t.constructor(a.buffer,a.byteOffset,0);return Promise.resolve(xe(o,!0))}if(e._queueTotalSize>0){if(!0===X(e,a)){var s=G(a);return V(e),Promise.resolve(xe(s,!1))}if(!0===e._closeRequested){var l=new TypeError("Insufficient bytes to fill elements in the given buffer");return ae(e,l),Promise.reject(l)}}a.buffer=Ee(a.buffer),e._pendingPullIntos.push(a);var c=f(r);return W(e),c}function Z(e,t){t.buffer=Ee(t.buffer),Me(0===t.bytesFilled,"bytesFilled must be 0");var r=e._controlledReadableStream;if(!0===S(r))for(;_(r)>0;){var n=te(e);z(r,n)}}function $(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(Y(e,t,r),!(r.bytesFilled<r.elementSize)){te(e);var n=r.bytesFilled%r.elementSize;if(n>0){var i=r.byteOffset+r.bytesFilled,a=r.buffer.slice(i-n,i);H(e,a,0,a.byteLength)}r.buffer=Ee(r.buffer),r.bytesFilled-=n,z(e._controlledReadableStream,r),Q(e)}}function ee(e,t){var r=e._pendingPullIntos[0],n=e._controlledReadableStream;if("closed"===n._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");Z(e,r)}else Me("readable"===n._state),$(e,t,r)}function te(e){var t=e._pendingPullIntos.shift();return J(e),t}function re(e){var t=e._controlledReadableStream;return"readable"===t._state&&(!0!==e._closeRequested&&(!1!==e._started&&(!0===w(t)&&A(t)>0||(!0===S(t)&&_(t)>0||oe(e)>0))))}function ne(e){var t=e._controlledReadableStream;if(Me(!1===e._closeRequested),Me("readable"===t._state),e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){if(e._pendingPullIntos[0].bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw ae(e,r),r}}g(t)}function ie(e,t){var r=e._controlledReadableStream;Me(!1===e._closeRequested),Me("readable"===r._state);var n=t.buffer,i=t.byteOffset,a=t.byteLength,o=Ee(n);if(!0===w(r))if(0===A(r))H(e,o,i,a);else{Me(0===e._queue.length);var s=new Uint8Array(o,i,a);y(r,s,!1)}else!0===S(r)?(H(e,o,i,a),Q(e)):(Me(!1===l(r),"stream must not be locked"),H(e,o,i,a))}function ae(e,t){var r=e._controlledReadableStream;Me("readable"===r._state),B(e),ze(e),v(r,t)}function oe(e){var t=e._controlledReadableStream,r=t._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function se(e,t){if(t=Number(t),!1===Re(t))throw new RangeError("bytesWritten must be a finite");Me(e._pendingPullIntos.length>0),ee(e,t)}function le(e,t){Me(e._pendingPullIntos.length>0);var r=e._pendingPullIntos[0];if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,ee(e,t.byteLength)}function ce(e){return
if(!(S(e)&&ve in e))throw H("It is not a typed array constructor!");return new e(t)},ke=function(e,t){return Te(L(e,e[be]),t)},Te=function(e,t){for(var r=0,n=t.length,i=Re(e,n);n>r;)i[r]=t[r++];return i},Ee=function(e,t,r){B(e,t,{get:function(){return this._d[r]}})},Ie=function(e){var t,r,n,i,a,o,s=w(e),l=arguments.length,c=l>1?arguments[1]:void 0,h=void 0!==c,d=k(s);if(void 0!=d&&!P(d)){for(o=d.call(s),n=[],t=0;!(a=o.next()).done;t++)n.push(a.value);s=n}for(h&&l>2&&(c=u(c,arguments[2],2)),t=0,r=g(s.length),i=Re(this,r);r>t;t++)i[t]=h?c(s[t],t):s[t];return i},Oe=function(){for(var e=0,t=arguments.length,r=Re(this,t);t>e;)r[e]=arguments[e++];return r},Le=!!X&&o(function(){pe.call(new X(1))}),je=function(){return pe.apply(Le?de.call(xe(this)):xe(this),arguments)},De={copyWithin:function(e,t){return q.call(xe(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return $(xe(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return M.apply(xe(this),arguments)},filter:function(e){return ke(this,K(xe(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return ee(xe(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return te(xe(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){Q(xe(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(xe(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return re(xe(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(xe(this),arguments)},lastIndexOf:function(e){return se.apply(xe(this),arguments)},map:function(e){return Se(xe(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return le.apply(xe(this),arguments)},reduceRight:function(e){return ce.apply(xe(this),arguments)},reverse:function(){for(var e,t=this,r=xe(t).length,n=Math.floor(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t},some:function(e){return Z(xe(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return he.call(xe(this),e)},subarray:function(e,t){var r=xe(this),n=r.length,i=b(e,n);return new(L(r,r[be]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,g((void 0===t?n:b(t,n))-i))}},Fe=function(e,t){return ke(this,de.call(xe(this),e,t))},Ne=function(e){xe(this);var t=Ce(arguments[1],1),r=this.length,n=w(e),i=g(n.length),a=0;if(i+t>r)throw G("Wrong length!");for(;a<i;)this[t+a]=n[a++]},Me={entries:function(){return oe.call(xe(this))},keys:function(){return ae.call(xe(this))},values:function(){return ie.call(xe(this))}},qe=function(e,t){return S(e)&&e[_e]&&"symbol"!=(void 0===t?"undefined":n(t))&&t in e&&String(+t)==String(t)},Ue=function(e,t){return qe(e,t=y(t,!0))?d(2,e[t]):z(e,t)},We=function(e,t,r){return!(qe(e,t=y(t,!0))&&S(r)&&_(r,"value"))||_(r,"get")||_(r,"set")||r.configurable||_(r,"writable")&&!r.writable||_(r,"enumerable")&&!r.enumerable?B(e,t,r):(e[t]=r.value,e)};ye||(W.f=Ue,U.f=We),s(s.S+s.F*!ye,"Object",{getOwnPropertyDescriptor:Ue,defineProperty:We}),o(function(){fe.call({})})&&(fe=pe=function(){return ue.call(this)});var Be=p({},De);p(Be,Me),f(Be,me,Me.values),p(Be,{slice:Fe,set:Ne,constructor:function(){},toString:fe,toLocaleString:je}),Ee(Be,"buffer","b"),Ee(Be,"byteOffset","o"),Ee(Be,"byteLength","l"),Ee(Be,"length","e"),B(Be,ge,{get:function(){return this[_e]}}),e.exports=function(e,t,r,n){n=!!n;var c=e+(n?"Clamped":"")+"Array",u="get"+e,d="set"+e,p=a[c],m=p||{},b=p&&x(p),y=!p||!l.ABV,_={},w=p&&p.prototype,P=function(e,r){var n=e._d;return n.v[u](r*t+n.o,we)},k=function(e,r,i){var a=e._d;n&&(i=(i=Math.round(i))<0?0:i>255?255:255&i),a.v[d](r*t+a.o,i,we)},T=function(e,t){B(e,t,{get:function(){return P(this,t)},set:function(e){return k(this,t,e)},enumerable:!0})};y?(p=r(function(e,r,n,i){h(e,p,c,"_d");var a,o,s,l,u=0,d=0;if(S(r)){if(!(r instanceof V||"ArrayBuffer"==(l=A(r))||"SharedArrayBuffer"==l))return _e in r?Te(p,r):Ie.call(p,r);a=r,d=Ce(n,t);var m=r.byteLength;if(void 0===i){if(m%t)throw G("Wrong length!");if((o=m-d)<0)throw G("Wrong length!")}else if((o=g(i)*t)+d>m)throw G("Wrong length!");s=o/t}else s=v(r),o=s*t,a=new V(o)
;var o=Math.floor(n[0]),s=Math.floor(n[1]),l=Math.max(Math.ceil(n[2])-o,1),c=Math.max(Math.ceil(n[3])-s,1),u=1,h=1;l>4096&&(u=l/4096,l=4096),c>4096&&(h=c/4096,c=4096);var f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(f,l,c,!0),m=p.context;m.scale(1/u,1/h),m.translate(-o,-s),m.transform.apply(m,r),e.smask?this.smaskStack.push({canvas:p.canvas,context:m,offsetX:o,offsetY:s,scaleX:u,scaleY:h,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,s),t.scale(u,h)),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(),f(this.ctx),this.current=new h,(0,a.isArray)(e)&&4===e.length){var n=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],n,i),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,r)},endAnnotation:function(){this.restore()},paintJpegXObject:function(e,t,r){var n=this.objs.get(e);if(!n)return void(0,a.warn)("Dependent image isn't ready yet");this.save();var i=this.ctx;if(i.scale(1/t,-1/r),i.drawImage(n,0,0,n.width,n.height,0,-r,t,r),this.imageLayer){var o=i.mozCurrentTransformInverse,s=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:e,left:s[0],top:s[1],width:t/o[0],height:r/o[3]})}this.restore()},paintImageMaskXObject:function(e){var t=this.ctx,n=e.width,a=e.height,o=this.current.fillColor,s=this.current.patternFill,l=this.processingType3;if(l&&void 0===l.compiled&&(l.compiled=n<=1e3&&a<=1e3?i({data:e.data,width:n,height:a}):null),l&&l.compiled)return void l.compiled(t);var c=this.cachedCanvases.getCanvas("maskCanvas",n,a),u=c.context;u.save(),r(u,e),u.globalCompositeOperation="source-in",u.fillStyle=s?o.getPattern(u,this):o,u.fillRect(0,0,n,a),u.restore(),this.paintInlineImageXObject(c.canvas)},paintImageMaskXObjectRepeat:function(e,t,n,i){var a=e.width,o=e.height,s=this.current.fillColor,l=this.current.patternFill,c=this.cachedCanvases.getCanvas("maskCanvas",a,o),u=c.context;u.save(),r(u,e),u.globalCompositeOperation="source-in",u.fillStyle=l?s.getPattern(u,this):s,u.fillRect(0,0,a,o),u.restore();for(var h=this.ctx,d=0,f=i.length;d<f;d+=2)h.save(),h.transform(t,0,0,n,i[d],i[d+1]),h.scale(1,-1),h.drawImage(c.canvas,0,0,a,o,0,-1,1,1),h.restore()},paintImageMaskXObjectGroup:function(e){for(var t=this.ctx,n=this.current.fillColor,i=this.current.patternFill,a=0,o=e.length;a<o;a++){var s=e[a],l=s.width,c=s.height,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),h=u.context;h.save(),r(h,s),h.globalCompositeOperation="source-in",h.fillStyle=i?n.getPattern(h,this):n,h.fillRect(0,0,l,c),h.restore(),t.save(),t.transform.apply(t,s.transform),t.scale(1,-1),t.drawImage(u.canvas,0,0,l,c,0,-1,1,1),t.restore()}},paintImageXObject:function(e){var t=this.objs.get(e);if(!t)return void(0,a.warn)("Dependent image isn't ready yet");this.paintInlineImageXObject(t)},paintImageXObjectRepeat:function(e,t,r,n){var i=this.objs.get(e);if(!i)return void(0,a.warn)("Dependent image isn't ready yet");for(var o=i.width,s=i.height,l=[],c=0,u=n.length;c<u;c+=2)l.push({transform:[t,0,0,r,n[c],n[c+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(i,l)},paintInlineImageXObject:function(e){var r=e.width,n=e.height,i=this.ctx;this.save(),i.scale(1/r,-1/n);var a,o,s=i.mozCurrentTransformInverse,l=s[0],c=s[1],u=Math.max(Math.sqrt(l*l+c*c),1),h=s[2],d=s[3],f=Math.max(Math.sqrt(h*h+d*d),1);if(e instanceof HTMLElement||!e.data)a=e;else{o=this.cachedCanvases.getCanvas
e.type="number"}catch(n){var t=e.constructor.prototype,r=Object.getOwnPropertyDescriptor(t,"type");Object.defineProperty(t,"type",{get:function(){return r.get.call(this)},set:function(e){r.set.call(this,"number"===e?"text":e)},enumerable:!0,configurable:!0})}}}(),function(){if(g&&document.attachEvent){var e=document.constructor.prototype,t=Object.getOwnPropertyDescriptor(e,"readyState");Object.defineProperty(e,"readyState",{get:function(){var e=t.get.call(this);return"interactive"===e?"loading":e},set:function(e){t.set.call(this,e)},enumerable:!0,configurable:!0})}}(),function(){g&&void 0===Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}(),function(){Number.isNaN||(Number.isNaN=function(e){return"number"==typeof e&&isNaN(e)})}(),function(){Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e})}(),function(){if(i.Promise)return"function"!=typeof i.Promise.all&&(i.Promise.all=function(e){var t,r,n=0,a=[],o=new i.Promise(function(e,n){t=e,r=n});return e.forEach(function(e,i){n++,e.then(function(e){a[i]=e,0===--n&&t(a)},r)}),0===n&&t(a),o}),"function"!=typeof i.Promise.resolve&&(i.Promise.resolve=function(e){return new i.Promise(function(t){t(e)})}),"function"!=typeof i.Promise.reject&&(i.Promise.reject=function(e){return new i.Promise(function(t,r){r(e)})}),void("function"!=typeof i.Promise.prototype.catch&&(i.Promise.prototype.catch=function(e){return i.Promise.prototype.then(void 0,e)}));var e=2,t={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(e){0!==e._status&&(this.handlers=this.handlers.concat(e._handlers),e._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var t=Date.now()+1;this.handlers.length>0;){var r=this.handlers.shift(),n=r.thisPromise._status,i=r.thisPromise._value;try{1===n?"function"==typeof r.onResolve&&(i=r.onResolve(i)):"function"==typeof r.onReject&&(i=r.onReject(i),n=1,r.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(r.thisPromise))}catch(t){n=e,i=t}if(r.nextPromise._updateStatus(n,i),Date.now()>=t)break}if(this.handlers.length>0)return void setTimeout(this.runHandlers.bind(this),0);this.running=!1},addUnhandledRejection:function(e){this.unhandledRejections.push({promise:e,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(e){e._unhandledRejection=!1;for(var t=0;t<this.unhandledRejections.length;t++)this.unhandledRejections[t].promise===e&&(this.unhandledRejections.splice(t),t--)},scheduleRejectionCheck:function(){var e=this;this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){e.pendingRejectionCheck=!1;for(var t=Date.now(),r=0;r<e.unhandledRejections.length;r++)if(t-e.unhandledRejections[r].time>500){var n=e.unhandledRejections[r].promise._value,i="Unhandled rejection: "+n;n.stack&&(i+="\n"+n.stack);try{throw new Error(i)}catch(e){console.warn(i)}e.unhandledRejections.splice(r),r--}e.unhandledRejections.length&&e.scheduleRejectionCheck()},500))}},r=function(e){this._status=0,this._handlers=[];try{e.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}};r.all=function(t){function n(t){o._status!==e&&(l=[],a(t))}var i,a,o=new r(function(e,t){i=e,a=t}),s=t.length,l=[];if(0===s)return i(l),o;for(var c=0,u=t.length;c<u;++c){var h=t[c],d=function(t){return function(r){o._status!==e&&(l[t]=r,0===--s&&i(l))}}(c);r.isPromise(h)?h.then(d,n):d(h)}return o},r.isPromise=function(e){return e&&"function"==typeof e.then},r.resolve=function(e){return new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,r){r(e)})},r.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(n,i){if(1!==this._status&&this._status!==e){if(1===n&&r.isPromise(i))return void i.then(this._updateStatus.bind(this,1),this._updateStatus.bind(this,e));this._status=n,this._value=i,n===e&&0===this._handlers.length&&(this._unhandledRejection=!0,t.addU