vue-pdf3
Version:
基于Vue3 + vite + PDF.js版的PDF预览插件
2 lines • 1.06 MB
JavaScript
(function(){"use strict";var pn={exports:{}};(function(bn,wn){(function(Vt,Bt){bn.exports=Bt()})(globalThis,()=>(()=>{var xn=[,(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.WorkerTask=b.WorkerMessageHandler=void 0;var t=ae(2),x=ae(5),Z=ae(6),_=ae(8),e=ae(71),W=ae(65),H=ae(4),j=ae(102),I=ae(103);class F{constructor(B){this.name=B,this.terminated=!1,this._capability=(0,t.createPromiseCapability)()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}b.WorkerTask=F;class w{static setup(B,u){let f=!1;B.on("test",function(s){f||(f=!0,B.send("test",s instanceof Uint8Array))}),B.on("configure",function(s){(0,t.setVerbosityLevel)(s.verbosity)}),B.on("GetDocRequest",function(s){return w.createDocumentHandler(s,u)})}static createDocumentHandler(B,u){let f,S=!1,s=null;const m=[],$=(0,t.getVerbosityLevel)(),d=B.apiVersion,C="2.16.105";if(d!==C)throw new Error(`The API version "${d}" does not match the Worker version "${C}".`);const h=[];for(const E in[])h.push(E);if(h.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+h.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if(typeof ReadableStream>"u"){const E="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";throw H.isNodeJS?new Error(E+"please use a `legacy`-build instead."):new Error(E+"please update to a supported browser.")}const o=B.docId,y=B.docBaseUrl,i=B.docId+"_worker";let r=new j.MessageHandler(i,o,u);function p(){if(S)throw new Error("Worker was terminated")}function l(E){m.push(E)}function c(E){E.finish();const L=m.indexOf(E);m.splice(L,1)}async function k(E){await f.ensureDoc("checkHeader"),await f.ensureDoc("parseStartXRef"),await f.ensureDoc("parse",[E]),await f.ensureDoc("checkFirstPage",[E]),await f.ensureDoc("checkLastPage",[E]);const L=await f.ensureDoc("isPureXfa");if(L){const ne=new F("loadXfaFonts");l(ne),await Promise.all([f.loadXfaFonts(r,ne).catch(D=>{}).then(()=>c(ne)),f.loadXfaImages()])}const[P,z]=await Promise.all([f.ensureDoc("numPages"),f.ensureDoc("fingerprints")]),G=L?await f.ensureDoc("htmlForXfa"):null;return{numPages:P,fingerprints:z,htmlForXfa:G}}function T(E,L,P){const z=(0,t.createPromiseCapability)();let G;const ne=E.source;if(ne.data){try{G=new _.LocalPdfManager(o,ne.data,ne.password,r,L,P,y),z.resolve(G)}catch(O){z.reject(O)}return z.promise}let D,R=[];try{D=new I.PDFWorkerStream(r)}catch(O){return z.reject(O),z.promise}const V=D.getFullReader();V.headersReady.then(function(){if(!V.isRangeSupported)return;const O=ne.disableAutoFetch||V.isStreamingSupported;G=new _.NetworkPdfManager(o,D,{msgHandler:r,password:ne.password,length:V.contentLength,disableAutoFetch:O,rangeChunkSize:ne.rangeChunkSize},L,P,y);for(const N of R)G.sendProgressiveData(N);R=[],z.resolve(G),s=null}).catch(function(O){z.reject(O),s=null});let J=0;const X=function(){const O=(0,t.arraysToBytes)(R);ne.length&&O.length!==ne.length&&(0,t.warn)("reported HTTP length is different from actual");try{G=new _.LocalPdfManager(o,O,ne.password,r,L,P,y),z.resolve(G)}catch(N){z.reject(N)}R=[]};return new Promise(function(O,N){const U=function({value:ee,done:Y}){try{if(p(),Y){G||X(),s=null;return}J+=(0,t.arrayByteLength)(ee),V.isStreamingSupported||r.send("DocProgress",{loaded:J,total:Math.max(J,V.contentLength||0)}),G?G.sendProgressiveData(ee):R.push(ee),V.read().then(U,N)}catch(q){N(q)}};V.read().then(U,N)}).catch(function(O){z.reject(O),s=null}),s=function(O){D.cancelAllRequests(O)},z.promise}function g(E){function L(ne){p(),r.send("GetDoc",{pdfInfo:ne})}function P(ne){if(p(),ne instanceof t.PasswordException){const D=new F(`PasswordException: response ${ne.code}`);l(D),r.sendWithPromise("PasswordRequest",ne).then(function({password:R}){c(D),f.updatePassword(R),z()}).catch(function(){c(D),r.send("DocException",ne)})}else ne instanceof t.InvalidPDFException||ne instanceof t.MissingPDFException||ne instanceof t.UnexpectedResponseException||ne instanceof t.UnknownErrorException?r.send("DocException",ne):r.send("DocException",new t.UnknownErrorException(ne.message,ne.toString()))}function z(){p(),k(!1).then(L,function(ne){if(p(),!(ne instanceof Z.XRefParseException)){P(ne);return}f.requestLoadedStream(),f.onLoadedStream().then(function(){p(),k(!0).then(L,P)})})}p();const G={maxImageSize:E.maxImageSize,disableFontFace:E.disableFontFace,ignoreErrors:E.ignoreErrors,isEvalSupported:E.isEvalSupported,fontExtraProperties:E.fontExtraProperties,useSystemFonts:E.useSystemFonts,cMapUrl:E.cMapUrl,standardFontDataUrl:E.standardFontDataUrl};T(E,G,E.enableXfa).then(function(ne){if(S)throw ne.terminate(new t.AbortException("Worker was terminated.")),new Error("Worker was terminated");f=ne,f.onLoadedStream().then(function(D){r.send("DataLoaded",{length:D.bytes.byteLength})})}).then(z,P)}return r.on("GetPage",function(L){return f.getPage(L.pageIndex).then(function(P){return Promise.all([f.ensure(P,"rotate"),f.ensure(P,"ref"),f.ensure(P,"userUnit"),f.ensure(P,"view")]).then(function([z,G,ne,D]){return{rotate:z,ref:G,userUnit:ne,view:D}})})}),r.on("GetPageIndex",function(L){const P=x.Ref.get(L.num,L.gen);return f.ensureCatalog("getPageIndex",[P])}),r.on("GetDestinations",function(L){return f.ensureCatalog("destinations")}),r.on("GetDestination",function(L){return f.ensureCatalog("getDestination",[L.id])}),r.on("GetPageLabels",function(L){return f.ensureCatalog("pageLabels")}),r.on("GetPageLayout",function(L){return f.ensureCatalog("pageLayout")}),r.on("GetPageMode",function(L){return f.ensureCatalog("pageMode")}),r.on("GetViewerPreferences",function(E){return f.ensureCatalog("viewerPreferences")}),r.on("GetOpenAction",function(E){return f.ensureCatalog("openAction")}),r.on("GetAttachments",function(L){return f.ensureCatalog("attachments")}),r.on("GetJavaScript",function(L){return f.ensureCatalog("javaScript")}),r.on("GetDocJSActions",function(L){return f.ensureCatalog("jsActions")}),r.on("GetPageJSActions",function({pageIndex:E}){return f.getPage(E).then(function(L){return f.ensure(L,"jsActions")})}),r.on("GetOutline",function(L){return f.ensureCatalog("documentOutline")}),r.on("GetOptionalContentConfig",function(E){return f.ensureCatalog("optionalContentConfig")}),r.on("GetPermissions",function(E){return f.ensureCatalog("permissions")}),r.on("GetMetadata",function(L){return Promise.all([f.ensureDoc("documentInfo"),f.ensureCatalog("metadata")])}),r.on("GetMarkInfo",function(L){return f.ensureCatalog("markInfo")}),r.on("GetData",function(L){return f.requestLoadedStream(),f.onLoadedStream().then(function(P){return P.bytes})}),r.on("GetAnnotations",function({pageIndex:E,intent:L}){return f.getPage(E).then(function(P){const z=new F(`GetAnnotations: page ${E}`);return l(z),P.getAnnotationsData(r,z,L).then(G=>(c(z),G),G=>{c(z)})})}),r.on("GetFieldObjects",function(E){return f.ensureDoc("fieldObjects")}),r.on("HasJSActions",function(E){return f.ensureDoc("hasJSActions")}),r.on("GetCalculationOrderIds",function(E){return f.ensureDoc("calculationOrderIds")}),r.on("SaveDocument",function({isPureXfa:E,numPages:L,annotationStorage:P,filename:z}){f.requestLoadedStream();const G=E?null:(0,Z.getNewAnnotationsMap)(P),ne=[f.onLoadedStream(),f.ensureCatalog("acroForm"),f.ensureCatalog("acroFormRef"),f.ensureDoc("xref"),f.ensureDoc("startXRef")];if(G)for(const[D,R]of G)ne.push(f.getPage(D).then(V=>{const J=new F(`Save (editor): page ${D}`);return V.saveNewAnnotations(r,J,R).finally(function(){c(J)})}));if(E)ne.push(f.serializeXfaData(P));else for(let D=0;D<L;D++)ne.push(f.getPage(D).then(function(R){const V=new F(`Save: page ${D}`);return R.save(r,V,P).finally(function(){c(V)})}));return Promise.all(ne).then(function([D,R,V,J,X,...A]){let O=[],N=null;if(E){if(N=A[0],!N)return D.bytes}else if(O=A.flat(2),O.length===0)return D.bytes;const U=R instanceof x.Dict&&R.get("XFA")||null;let ee=null,Y=!1;if(Array.isArray(U)){for(let K=0,Q=U.length;K<Q;K+=2)U[K]==="datasets"&&(ee=U[K+1],V=null,Y=!0);ee===null&&(ee=J.getNewRef())}else U&&(V=null,(0,t.warn)("Unsupported XFA type."));let q=Object.create(null);if(J.trailer){const K=Object.create(null),Q=J.trailer.get("Info")||null;Q instanceof x.Dict&&Q.forEach((te,re)=>{typeof re=="string"&&(K[te]=(0,t.stringToPDFString)(re))}),q={rootRef:J.trailer.getRaw("Root")||null,encryptRef:J.trailer.getRaw("Encrypt")||null,newRef:J.getNewRef(),infoRef:J.trailer.getRaw("Info")||null,info:K,fileIds:J.trailer.get("ID")||null,startXRef:X,filename:z}}return J.resetNewRef(),(0,W.incrementalUpdate)({originalData:D.bytes,xrefInfo:q,newRefs:O,xref:J,hasXfa:!!U,xfaDatasetsRef:ee,hasXfaDatasetsEntry:Y,acroFormRef:V,acroForm:R,xfaData:N})})}),r.on("GetOperatorList",function(L,P){const z=L.pageIndex;f.getPage(z).then(function(G){const ne=new F(`GetOperatorList: page ${z}`);l(ne);const D=$>=t.VerbosityLevel.INFOS?Date.now():0;G.getOperatorList({handler:r,sink:P,task:ne,intent:L.intent,cacheKey:L.cacheKey,annotationStorage:L.annotationStorage}).then(function(R){c(ne),D&&(0,t.info)(`page=${z+1} - getOperatorList: time=${Date.now()-D}ms, len=${R.length}`),P.close()},function(R){c(ne),!ne.terminated&&(r.send("UnsupportedFeature",{featureId:t.UNSUPPORTED_FEATURES.errorOperatorList}),P.error(R))})})}),r.on("GetTextContent",function(L,P){const z=L.pageIndex;f.getPage(z).then(function(G){const ne=new F("GetTextContent: page "+z);l(ne);const D=$>=t.VerbosityLevel.INFOS?Date.now():0;G.extractTextContent({handler:r,task:ne,sink:P,includeMarkedContent:L.includeMarkedContent,combineTextItems:L.combineTextItems}).then(function(){c(ne),D&&(0,t.info)(`page=${z+1} - getTextContent: time=${Date.now()-D}ms`),P.close()},function(R){c(ne),!ne.terminated&&P.error(R)})})}),r.on("GetStructTree",function(L){return f.getPage(L.pageIndex).then(function(P){return f.ensure(P,"getStructTree")})}),r.on("FontFallback",function(E){return f.fontFallback(E.id,r)}),r.on("Cleanup",function(L){return f.cleanup(!0)}),r.on("Terminate",function(L){S=!0;const P=[];if(f){f.terminate(new t.AbortException("Worker was terminated."));const z=f.cleanup();P.push(z),f=null}else(0,e.clearGlobalCaches)();s&&s(new t.AbortException("Worker was terminated."));for(const z of m)P.push(z.finished),z.terminate();return Promise.all(P).then(function(){r.destroy(),r=null})}),r.on("Ready",function(L){g(B),B=null}),i}static initializeFromPort(B){const u=new j.MessageHandler("worker","main",B);w.setup(u,B),u.send("ready",null)}}b.WorkerMessageHandler=w;function n(v){return typeof v.postMessage=="function"&&"onmessage"in v}typeof window>"u"&&!H.isNodeJS&&typeof self<"u"&&n(self)&&w.initializeFromPort(self)},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.VerbosityLevel=b.Util=b.UnknownErrorException=b.UnexpectedResponseException=b.UNSUPPORTED_FEATURES=b.TextRenderingMode=b.StreamType=b.RenderingIntentFlag=b.PermissionFlag=b.PasswordResponses=b.PasswordException=b.PageActionEventType=b.OPS=b.MissingPDFException=b.LINE_FACTOR=b.LINE_DESCENT_FACTOR=b.InvalidPDFException=b.ImageKind=b.IDENTITY_MATRIX=b.FormatError=b.FontType=b.FeatureTest=b.FONT_IDENTITY_MATRIX=b.DocumentActionEventType=b.CMapCompressionType=b.BaseException=b.AnnotationType=b.AnnotationStateModelType=b.AnnotationReviewState=b.AnnotationReplyType=b.AnnotationMode=b.AnnotationMarkedState=b.AnnotationFlag=b.AnnotationFieldFlag=b.AnnotationEditorType=b.AnnotationEditorPrefix=b.AnnotationEditorParamsType=b.AnnotationBorderStyleType=b.AnnotationActionEventType=b.AbortException=void 0,b.arrayByteLength=q,b.arraysToBytes=K,b.assert=z,b.bytesToString=ee,b.createPromiseCapability=Ve,b.createValidAbsoluteUrl=ne,b.escapeString=ke,b.getModificationDate=We,b.getVerbosityLevel=g,b.info=E,b.isArrayBuffer=xe,b.isArrayEqual=_e,b.isAscii=ge,b.objectFromMap=re,b.objectSize=te,b.setVerbosityLevel=T,b.shadow=D,b.string32=Q,b.stringToBytes=Y,b.stringToPDFString=Se,b.stringToUTF16BEString=ye,b.stringToUTF8String=Fe,b.unreachable=P,b.utf8StringToString=Pe,b.warn=L,ae(3);const t=[1,0,0,1,0,0];b.IDENTITY_MATRIX=t;const x=[.001,0,0,.001,0,0];b.FONT_IDENTITY_MATRIX=x;const Z=1.35;b.LINE_FACTOR=Z;const _=.35;b.LINE_DESCENT_FACTOR=_;const e={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};b.RenderingIntentFlag=e;const W={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};b.AnnotationMode=W;const H="pdfjs_internal_editor_";b.AnnotationEditorPrefix=H;const j={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};b.AnnotationEditorType=j;const I={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};b.AnnotationEditorParamsType=I;const F={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};b.PermissionFlag=F;const w={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};b.TextRenderingMode=w;const n={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};b.ImageKind=n;const v={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};b.AnnotationType=v;const B={MARKED:"Marked",REVIEW:"Review"};b.AnnotationStateModelType=B;const u={MARKED:"Marked",UNMARKED:"Unmarked"};b.AnnotationMarkedState=u;const f={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};b.AnnotationReviewState=f;const S={GROUP:"Group",REPLY:"R"};b.AnnotationReplyType=S;const s={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};b.AnnotationFlag=s;const m={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};b.AnnotationFieldFlag=m;const $={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};b.AnnotationBorderStyleType=$;const d={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};b.AnnotationActionEventType=d;const C={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};b.DocumentActionEventType=C;const h={O:"PageOpen",C:"PageClose"};b.PageActionEventType=h;const o={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};b.StreamType=o;const y={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};b.FontType=y;const i={ERRORS:0,WARNINGS:1,INFOS:5};b.VerbosityLevel=i;const r={NONE:0,BINARY:1,STREAM:2};b.CMapCompressionType=r;const p={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};b.OPS=p;const l={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};b.UNSUPPORTED_FEATURES=l;const c={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};b.PasswordResponses=c;let k=i.WARNINGS;function T(pe){Number.isInteger(pe)&&(k=pe)}function g(){return k}function E(pe){k>=i.INFOS&&console.log(`Info: ${pe}`)}function L(pe){k>=i.WARNINGS&&console.log(`Warning: ${pe}`)}function P(pe){throw new Error(pe)}function z(pe,he){pe||P(he)}function G(pe){if(!pe)return!1;switch(pe.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function ne(pe,he=null,oe=null){if(!pe)return null;try{if(oe&&typeof pe=="string"){if(oe.addDefaultProtocol&&pe.startsWith("www.")){const je=pe.match(/\./g);je&&je.length>=2&&(pe=`http://${pe}`)}if(oe.tryConvertEncoding)try{pe=Fe(pe)}catch{}}const $e=he?new URL(pe,he):new URL(pe);if(G($e))return $e}catch{}return null}function D(pe,he,oe){return Object.defineProperty(pe,he,{value:oe,enumerable:!0,configurable:!0,writable:!1}),oe}const R=function(){function he(oe,$e){this.constructor===he&&P("Cannot initialize BaseException."),this.message=oe,this.name=$e}return he.prototype=new Error,he.constructor=he,he}();b.BaseException=R;class V extends R{constructor(he,oe){super(he,"PasswordException"),this.code=oe}}b.PasswordException=V;class J extends R{constructor(he,oe){super(he,"UnknownErrorException"),this.details=oe}}b.UnknownErrorException=J;class X extends R{constructor(he){super(he,"InvalidPDFException")}}b.InvalidPDFException=X;class A extends R{constructor(he){super(he,"MissingPDFException")}}b.MissingPDFException=A;class O extends R{constructor(he,oe){super(he,"UnexpectedResponseException"),this.status=oe}}b.UnexpectedResponseException=O;class N extends R{constructor(he){super(he,"FormatError")}}b.FormatError=N;class U extends R{constructor(he){super(he,"AbortException")}}b.AbortException=U;function ee(pe){(typeof pe!="object"||pe===null||pe.length===void 0)&&P("Invalid argument for bytesToString");const he=pe.length,oe=8192;if(he<oe)return String.fromCharCode.apply(null,pe);const $e=[];for(let je=0;je<he;je+=oe){const Be=Math.min(je+oe,he),Ke=pe.subarray(je,Be);$e.push(String.fromCharCode.apply(null,Ke))}return $e.join("")}function Y(pe){typeof pe!="string"&&P("Invalid argument for stringToBytes");const he=pe.length,oe=new Uint8Array(he);for(let $e=0;$e<he;++$e)oe[$e]=pe.charCodeAt($e)&255;return oe}function q(pe){if(pe.length!==void 0)return pe.length;if(pe.byteLength!==void 0)return pe.byteLength;P("Invalid argument for arrayByteLength")}function K(pe){const he=pe.length;if(he===1&&pe[0]instanceof Uint8Array)return pe[0];let oe=0;for(let Be=0;Be<he;Be++)oe+=q(pe[Be]);let $e=0;const je=new Uint8Array(oe);for(let Be=0;Be<he;Be++){let Ke=pe[Be];Ke instanceof Uint8Array||(typeof Ke=="string"?Ke=Y(Ke):Ke=new Uint8Array(Ke));const Ie=Ke.byteLength;je.set(Ke,$e),$e+=Ie}return je}function Q(pe){return String.fromCharCode(pe>>24&255,pe>>16&255,pe>>8&255,pe&255)}function te(pe){return Object.keys(pe).length}function re(pe){const he=Object.create(null);for(const[oe,$e]of pe)he[oe]=$e;return he}function ie(){const pe=new Uint8Array(4);return pe[0]=1,new Uint32Array(pe.buffer,0,1)[0]===1}function se(){try{return new Function(""),!0}catch{return!1}}class ce{static get isLittleEndian(){return D(this,"isLittleEndian",ie())}static get isEvalSupported(){return D(this,"isEvalSupported",se())}static get isOffscreenCanvasSupported(){return D(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}}b.FeatureTest=ce;const le=[...Array(256).keys()].map(pe=>pe.toString(16).padStart(2,"0"));class de{static makeHexColor(he,oe,$e){return`#${le[he]}${le[oe]}${le[$e]}`}static scaleMinMax(he,oe){let $e;he[0]?(he[0]<0&&($e=oe[0],oe[0]=oe[1],oe[1]=$e),oe[0]*=he[0],oe[1]*=he[0],he[3]<0&&($e=oe[2],oe[2]=oe[3],oe[3]=$e),oe[2]*=he[3],oe[3]*=he[3]):($e=oe[0],oe[0]=oe[2],oe[2]=$e,$e=oe[1],oe[1]=oe[3],oe[3]=$e,he[1]<0&&($e=oe[2],oe[2]=oe[3],oe[3]=$e),oe[2]*=he[1],oe[3]*=he[1],he[2]<0&&($e=oe[0],oe[0]=oe[1],oe[1]=$e),oe[0]*=he[2],oe[1]*=he[2]),oe[0]+=he[4],oe[1]+=he[4],oe[2]+=he[5],oe[3]+=he[5]}static transform(he,oe){return[he[0]*oe[0]+he[2]*oe[1],he[1]*oe[0]+he[3]*oe[1],he[0]*oe[2]+he[2]*oe[3],he[1]*oe[2]+he[3]*oe[3],he[0]*oe[4]+he[2]*oe[5]+he[4],he[1]*oe[4]+he[3]*oe[5]+he[5]]}static applyTransform(he,oe){const $e=he[0]*oe[0]+he[1]*oe[2]+oe[4],je=he[0]*oe[1]+he[1]*oe[3]+oe[5];return[$e,je]}static applyInverseTransform(he,oe){const $e=oe[0]*oe[3]-oe[1]*oe[2],je=(he[0]*oe[3]-he[1]*oe[2]+oe[2]*oe[5]-oe[4]*oe[3])/$e,Be=(-he[0]*oe[1]+he[1]*oe[0]+oe[4]*oe[1]-oe[5]*oe[0])/$e;return[je,Be]}static getAxialAlignedBoundingBox(he,oe){const $e=de.applyTransform(he,oe),je=de.applyTransform(he.slice(2,4),oe),Be=de.applyTransform([he[0],he[3]],oe),Ke=de.applyTransform([he[2],he[1]],oe);return[Math.min($e[0],je[0],Be[0],Ke[0]),Math.min($e[1],je[1],Be[1],Ke[1]),Math.max($e[0],je[0],Be[0],Ke[0]),Math.max($e[1],je[1],Be[1],Ke[1])]}static inverseTransform(he){const oe=he[0]*he[3]-he[1]*he[2];return[he[3]/oe,-he[1]/oe,-he[2]/oe,he[0]/oe,(he[2]*he[5]-he[4]*he[3])/oe,(he[4]*he[1]-he[5]*he[0])/oe]}static apply3dTransform(he,oe){return[he[0]*oe[0]+he[1]*oe[1]+he[2]*oe[2],he[3]*oe[0]+he[4]*oe[1]+he[5]*oe[2],he[6]*oe[0]+he[7]*oe[1]+he[8]*oe[2]]}static singularValueDecompose2dScale(he){const oe=[he[0],he[2],he[1],he[3]],$e=he[0]*oe[0]+he[1]*oe[2],je=he[0]*oe[1]+he[1]*oe[3],Be=he[2]*oe[0]+he[3]*oe[2],Ke=he[2]*oe[1]+he[3]*oe[3],Ie=($e+Ke)/2,nt=Math.sqrt(($e+Ke)**2-4*($e*Ke-Be*je))/2,rt=Ie+nt||1,Ce=Ie-nt||1;return[Math.sqrt(rt),Math.sqrt(Ce)]}static normalizeRect(he){const oe=he.slice(0);return he[0]>he[2]&&(oe[0]=he[2],oe[2]=he[0]),he[1]>he[3]&&(oe[1]=he[3],oe[3]=he[1]),oe}static intersect(he,oe){const $e=Math.max(Math.min(he[0],he[2]),Math.min(oe[0],oe[2])),je=Math.min(Math.max(he[0],he[2]),Math.max(oe[0],oe[2]));if($e>je)return null;const Be=Math.max(Math.min(he[1],he[3]),Math.min(oe[1],oe[3])),Ke=Math.min(Math.max(he[1],he[3]),Math.max(oe[1],oe[3]));return Be>Ke?null:[$e,Be,je,Ke]}static bezierBoundingBox(he,oe,$e,je,Be,Ke,Ie,nt){const rt=[],Ce=[[],[]];let qe,ze,dt,lt,st,Ye,Ft,wt;for(let Me=0;Me<2;++Me){if(Me===0?(ze=6*he-12*$e+6*Be,qe=-3*he+9*$e-9*Be+3*Ie,dt=3*$e-3*he):(ze=6*oe-12*je+6*Ke,qe=-3*oe+9*je-9*Ke+3*nt,dt=3*je-3*oe),Math.abs(qe)<1e-12){if(Math.abs(ze)<1e-12)continue;lt=-dt/ze,0<lt&<<1&&rt.push(lt);continue}Ft=ze*ze-4*dt*qe,wt=Math.sqrt(Ft),!(Ft<0)&&(st=(-ze+wt)/(2*qe),0<st&&st<1&&rt.push(st),Ye=(-ze-wt)/(2*qe),0<Ye&&Ye<1&&rt.push(Ye))}let Te=rt.length,Ae;const De=Te;for(;Te--;)lt=rt[Te],Ae=1-lt,Ce[0][Te]=Ae*Ae*Ae*he+3*Ae*Ae*lt*$e+3*Ae*lt*lt*Be+lt*lt*lt*Ie,Ce[1][Te]=Ae*Ae*Ae*oe+3*Ae*Ae*lt*je+3*Ae*lt*lt*Ke+lt*lt*lt*nt;return Ce[0][De]=he,Ce[1][De]=oe,Ce[0][De+1]=Ie,Ce[1][De+1]=nt,Ce[0].length=Ce[1].length=De+2,[Math.min(...Ce[0]),Math.min(...Ce[1]),Math.max(...Ce[0]),Math.max(...Ce[1])]}}b.Util=de;const fe=[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];function Se(pe){if(pe[0]>="\xEF"){let oe;if(pe[0]==="\xFE"&&pe[1]==="\xFF"?oe="utf-16be":pe[0]==="\xFF"&&pe[1]==="\xFE"?oe="utf-16le":pe[0]==="\xEF"&&pe[1]==="\xBB"&&pe[2]==="\xBF"&&(oe="utf-8"),oe)try{const $e=new TextDecoder(oe,{fatal:!0}),je=Y(pe);return $e.decode(je)}catch($e){L(`stringToPDFString: "${$e}".`)}}const he=[];for(let oe=0,$e=pe.length;oe<$e;oe++){const je=fe[pe.charCodeAt(oe)];he.push(je?String.fromCharCode(je):pe.charAt(oe))}return he.join("")}function ke(pe){return pe.replace(/([()\\\n\r])/g,he=>he===`
`?"\\n":he==="\r"?"\\r":`\\${he}`)}function ge(pe){return/^[\x00-\x7F]*$/.test(pe)}function ye(pe){const he=["\xFE\xFF"];for(let oe=0,$e=pe.length;oe<$e;oe++){const je=pe.charCodeAt(oe);he.push(String.fromCharCode(je>>8&255),String.fromCharCode(je&255))}return he.join("")}function Fe(pe){return decodeURIComponent(escape(pe))}function Pe(pe){return unescape(encodeURIComponent(pe))}function xe(pe){return typeof pe=="object"&&pe!==null&&pe.byteLength!==void 0}function _e(pe,he){if(pe.length!==he.length)return!1;for(let oe=0,$e=pe.length;oe<$e;oe++)if(pe[oe]!==he[oe])return!1;return!0}function We(pe=new Date){return[pe.getUTCFullYear().toString(),(pe.getUTCMonth()+1).toString().padStart(2,"0"),pe.getUTCDate().toString().padStart(2,"0"),pe.getUTCHours().toString().padStart(2,"0"),pe.getUTCMinutes().toString().padStart(2,"0"),pe.getUTCSeconds().toString().padStart(2,"0")].join("")}function Ve(){const pe=Object.create(null);let he=!1;return Object.defineProperty(pe,"settled",{get(){return he}}),pe.promise=new Promise(function(oe,$e){pe.resolve=function(je){he=!0,oe(je)},pe.reject=function(je){he=!0,$e(je)}}),pe}},(Re,b,ae)=>{ae(4)},(Re,b)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.isNodeJS=void 0;const ae=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");b.isNodeJS=ae},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.RefSetCache=b.RefSet=b.Ref=b.Name=b.EOF=b.Dict=b.Cmd=b.CIRCULAR_REF=void 0,b.clearPrimitiveCaches=u,b.isCmd=n,b.isDict=v,b.isName=w,b.isRefsEqual=B;var t=ae(2);const x=Symbol("CIRCULAR_REF");b.CIRCULAR_REF=x;const Z=Symbol("EOF");b.EOF=Z;const _=function(){let S=Object.create(null);class s{constructor($){this.name=$}static get($){return S[$]||(S[$]=new s($))}static _clearCache(){S=Object.create(null)}}return s}();b.Name=_;const e=function(){let S=Object.create(null);class s{constructor($){this.cmd=$}static get($){return S[$]||(S[$]=new s($))}static _clearCache(){S=Object.create(null)}}return s}();b.Cmd=e;const W=function(){return W};class H{constructor(S=null){this._map=Object.create(null),this.xref=S,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=W}assignXref(S){this.xref=S}get size(){return Object.keys(this._map).length}get(S,s,m){let $=this._map[S];return $===void 0&&s!==void 0&&($=this._map[s],$===void 0&&m!==void 0&&($=this._map[m])),$ instanceof j&&this.xref?this.xref.fetch($,this.suppressEncryption):$}async getAsync(S,s,m){let $=this._map[S];return $===void 0&&s!==void 0&&($=this._map[s],$===void 0&&m!==void 0&&($=this._map[m])),$ instanceof j&&this.xref?this.xref.fetchAsync($,this.suppressEncryption):$}getArray(S,s,m){let $=this._map[S];if($===void 0&&s!==void 0&&($=this._map[s],$===void 0&&m!==void 0&&($=this._map[m])),$ instanceof j&&this.xref&&($=this.xref.fetch($,this.suppressEncryption)),Array.isArray($)){$=$.slice();for(let d=0,C=$.length;d<C;d++)$[d]instanceof j&&this.xref&&($[d]=this.xref.fetch($[d],this.suppressEncryption))}return $}getRaw(S){return this._map[S]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(S,s){this._map[S]=s}has(S){return this._map[S]!==void 0}forEach(S){for(const s in this._map)S(s,this.get(s))}static get empty(){const S=new H(null);return S.set=(s,m)=>{(0,t.unreachable)("Should not call `set` on the empty dictionary.")},(0,t.shadow)(this,"empty",S)}static merge({xref:S,dictArray:s,mergeSubDicts:m=!1}){const $=new H(S),d=new Map;for(const C of s)if(C instanceof H)for(const[h,o]of Object.entries(C._map)){let y=d.get(h);if(y===void 0)y=[],d.set(h,y);else if(!m||!(o instanceof H))continue;y.push(o)}for(const[C,h]of d){if(h.length===1||!(h[0]instanceof H)){$._map[C]=h[0];continue}const o=new H(S);for(const y of h)for(const[i,r]of Object.entries(y._map))o._map[i]===void 0&&(o._map[i]=r);o.size>0&&($._map[C]=o)}return d.clear(),$.size>0?$:H.empty}}b.Dict=H;const j=function(){let S=Object.create(null);class s{constructor($,d){this.num=$,this.gen=d}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static get($,d){const C=d===0?`${$}R`:`${$}R${d}`;return S[C]||(S[C]=new s($,d))}static _clearCache(){S=Object.create(null)}}return s}();b.Ref=j;class I{constructor(S=null){this._set=new Set(S&&S._set)}has(S){return this._set.has(S.toString())}put(S){this._set.add(S.toString())}remove(S){this._set.delete(S.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}b.RefSet=I;class F{constructor(){this._map=new Map}get size(){return this._map.size}get(S){return this._map.get(S.toString())}has(S){return this._map.has(S.toString())}put(S,s){this._map.set(S.toString(),s)}putAlias(S,s){this._map.set(S.toString(),this.get(s))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}b.RefSetCache=F;function w(f,S){return f instanceof _&&(S===void 0||f.name===S)}function n(f,S){return f instanceof e&&(S===void 0||f.cmd===S)}function v(f,S){return f instanceof H&&(S===void 0||w(f.get("Type"),S))}function B(f,S){return f.num===S.num&&f.gen===S.gen}function u(){e._clearCache(),_._clearCache(),j._clearCache()}},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.XRefParseException=b.XRefEntryException=b.ParserEOFException=b.MissingDataException=b.DocStats=void 0,b.collectActions=C,b.encodeToXmlString=o,b.escapePDFName=$,b.getArrayLookupTableFactory=e,b.getInheritableProperty=w,b.getLookupTableFactory=_,b.getNewAnnotationsMap=p,b.isWhiteSpace=s,b.log2=B,b.numberToString=r,b.parseXFAPath=m,b.readInt8=u,b.readUint16=f,b.readUint32=S,b.recoverJsURL=i,b.toRomanNumerals=v,b.validateCSSFont=y;var t=ae(2),x=ae(5),Z=ae(7);function _(l){let c;return function(){return l&&(c=Object.create(null),l(c),l=null),c}}function e(l){let c;return function(){if(l){let k=l();l=null,c=Object.create(null);for(let T=0,g=k.length;T<g;T+=2)c[k[T]]=k[T+1];k=null}return c}}class W extends t.BaseException{constructor(c,k){super(`Missing data [${c}, ${k})`,"MissingDataException"),this.begin=c,this.end=k}}b.MissingDataException=W;class H extends t.BaseException{constructor(c){super(c,"ParserEOFException")}}b.ParserEOFException=H;class j extends t.BaseException{constructor(c){super(c,"XRefEntryException")}}b.XRefEntryException=j;class I extends t.BaseException{constructor(c){super(c,"XRefParseException")}}b.XRefParseException=I;class F{constructor(c){this._handler=c,this._streamTypes=new Set,this._fontTypes=new Set}_send(){const c=Object.create(null),k=Object.create(null);for(const T of this._streamTypes)c[T]=!0;for(const T of this._fontTypes)k[T]=!0;this._handler.send("DocStats",{streamTypes:c,fontTypes:k})}addStreamType(c){this._streamTypes.has(c)||(this._streamTypes.add(c),this._send())}addFontType(c){this._fontTypes.has(c)||(this._fontTypes.add(c),this._send())}}b.DocStats=F;function w({dict:l,key:c,getArray:k=!1,stopWhenFound:T=!0}){let g;const E=new x.RefSet;for(;l instanceof x.Dict&&!(l.objId&&E.has(l.objId));){l.objId&&E.put(l.objId);const L=k?l.getArray(c):l.get(c);if(L!==void 0){if(T)return L;g||(g=[]),g.push(L)}l=l.get("Parent")}return g}const n=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function v(l,c=!1){(0,t.assert)(Number.isInteger(l)&&l>0,"The number should be a positive integer.");const k=[];let T;for(;l>=1e3;)l-=1e3,k.push("M");T=l/100|0,l%=100,k.push(n[T]),T=l/10|0,l%=10,k.push(n[10+T]),k.push(n[20+l]);const g=k.join("");return c?g.toLowerCase():g}function B(l){return l<=0?0:Math.ceil(Math.log2(l))}function u(l,c){return l[c]<<24>>24}function f(l,c){return l[c]<<8|l[c+1]}function S(l,c){return(l[c]<<24|l[c+1]<<16|l[c+2]<<8|l[c+3])>>>0}function s(l){return l===32||l===9||l===13||l===10}function m(l){const c=/(.+)\[(\d+)\]$/;return l.split(".").map(k=>{const T=k.match(c);return T?{name:T[1],pos:parseInt(T[2],10)}:{name:k,pos:0}})}function $(l){const c=[];let k=0;for(let T=0,g=l.length;T<g;T++){const E=l.charCodeAt(T);(E<33||E>126||E===35||E===40||E===41||E===60||E===62||E===91||E===93||E===123||E===125||E===47||E===37)&&(k<T&&c.push(l.substring(k,T)),c.push(`#${E.toString(16)}`),k=T+1)}return c.length===0?l:(k<l.length&&c.push(l.substring(k,l.length)),c.join(""))}function d(l,c,k,T){if(!l)return;let g=null;if(l instanceof x.Ref){if(T.has(l))return;g=l,T.put(g),l=c.fetch(l)}if(Array.isArray(l))for(const E of l)d(E,c,k,T);else if(l instanceof x.Dict){if((0,x.isName)(l.get("S"),"JavaScript")){const E=l.get("JS");let L;E instanceof Z.BaseStream?L=E.getString():typeof E=="string"&&(L=E),L=L&&(0,t.stringToPDFString)(L).replace(/\u0000/g,""),L&&k.push(L)}d(l.getRaw("Next"),c,k,T)}g&&T.remove(g)}function C(l,c,k){const T=Object.create(null),g=w({dict:c,key:"AA",stopWhenFound:!1});if(g)for(let E=g.length-1;E>=0;E--){const L=g[E];if(L instanceof x.Dict)for(const P of L.getKeys()){const z=k[P];if(!z)continue;const G=L.getRaw(P),ne=new x.RefSet,D=[];d(G,l,D,ne),D.length>0&&(T[z]=D)}}if(c.has("A")){const E=c.get("A"),L=new x.RefSet,P=[];d(E,l,P,L),P.length>0&&(T.Action=P)}return(0,t.objectSize)(T)>0?T:null}const h={60:"<",62:">",38:"&",34:""",39:"'"};function o(l){const c=[];let k=0;for(let T=0,g=l.length;T<g;T++){const E=l.codePointAt(T);if(32<=E&&E<=126){const L=h[E];L&&(k<T&&c.push(l.substring(k,T)),c.push(L),k=T+1)}else k<T&&c.push(l.substring(k,T)),c.push(`&#x${E.toString(16).toUpperCase()};`),E>55295&&(E<57344||E>65533)&&T++,k=T+1}return c.length===0?l:(k<l.length&&c.push(l.substring(k,l.length)),c.join(""))}function y(l){const c="14",k="400",T=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:g,fontWeight:E,italicAngle:L}=l;if(/^".*"$/.test(g)){if(/[^\\]"/.test(g.slice(1,g.length-1)))return(0,t.warn)(`XFA - FontFamily contains some unescaped ": ${g}.`),!1}else if(/^'.*'$/.test(g)){if(/[^\\]'/.test(g.slice(1,g.length-1)))return(0,t.warn)(`XFA - FontFamily contains some unescaped ': ${g}.`),!1}else for(const G of g.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(G)||!/^[\w-\\]+$/.test(G))return(0,t.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${g}.`),!1;const P=E?E.toString():"";l.fontWeight=T.has(P)?P:k;const z=parseFloat(L);return l.italicAngle=isNaN(z)||z<-90||z>90?c:L.toString(),!0}function i(l){const c=["app.launchURL","window.open","xfa.host.gotoURL"],T=new RegExp("^\\s*("+c.join("|").split(".").join("\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(l);if(T&&T[2]){const g=T[2];let E=!1;return T[3]==="true"&&T[1]==="app.launchURL"&&(E=!0),{url:g,newWindow:E}}return null}function r(l){if(Number.isInteger(l))return l.toString();const c=Math.round(l*100);return c%100===0?(c/100).toString():c%10===0?l.toFixed(1):l.toFixed(2)}function p(l){if(!l)return null;const c=new Map;for(const[k,T]of l){if(!k.startsWith(t.AnnotationEditorPrefix))continue;let g=c.get(T.pageIndex);g||(g=[],c.set(T.pageIndex,g)),g.push(T)}return c.size>0?c:null}},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.BaseStream=void 0;var t=ae(2);class x{constructor(){this.constructor===x&&(0,t.unreachable)("Cannot initialize BaseStream.")}get length(){(0,t.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,t.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,t.shadow)(this,"isDataLoaded",!0)}getByte(){(0,t.unreachable)("Abstract method `getByte` called")}getBytes(_){(0,t.unreachable)("Abstract method `getBytes` called")}peekByte(){const _=this.getByte();return _!==-1&&this.pos--,_}peekBytes(_){const e=this.getBytes(_);return this.pos-=e.length,e}getUint16(){const _=this.getByte(),e=this.getByte();return _===-1||e===-1?-1:(_<<8)+e}getInt32(){const _=this.getByte(),e=this.getByte(),W=this.getByte(),H=this.getByte();return(_<<24)+(e<<16)+(W<<8)+H}getByteRange(_,e){(0,t.unreachable)("Abstract method `getByteRange` called")}getString(_){return(0,t.bytesToString)(this.getBytes(_))}skip(_){this.pos+=_||1}reset(){(0,t.unreachable)("Abstract method `reset` called")}moveStart(){(0,t.unreachable)("Abstract method `moveStart` called")}makeSubStream(_,e,W=null){(0,t.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}b.BaseStream=x},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.NetworkPdfManager=b.LocalPdfManager=void 0;var t=ae(2),x=ae(9),Z=ae(6),_=ae(11),e=ae(10);function W(F){if(F){const w=(0,t.createValidAbsoluteUrl)(F);if(w)return w.href;(0,t.warn)(`Invalid absolute docBaseUrl: "${F}".`)}return null}class H{constructor(){this.constructor===H&&(0,t.unreachable)("Cannot initialize BasePdfManager.")}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){const w=this.pdfDocument.catalog;return(0,t.shadow)(this,"docBaseUrl",w.baseUrl||this._docBaseUrl)}onLoadedStream(){(0,t.unreachable)("Abstract method `onLoadedStream` called")}ensureDoc(w,n){return this.ensure(this.pdfDocument,w,n)}ensureXRef(w,n){return this.ensure(this.pdfDocument.xref,w,n)}ensureCatalog(w,n){return this.ensure(this.pdfDocument.catalog,w,n)}getPage(w){return this.pdfDocument.getPage(w)}fontFallback(w,n){return this.pdfDocument.fontFallback(w,n)}loadXfaFonts(w,n){return this.pdfDocument.loadXfaFonts(w,n)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(w){return this.pdfDocument.serializeXfaData(w)}cleanup(w=!1){return this.pdfDocument.cleanup(w)}async ensure(w,n,v){(0,t.unreachable)("Abstract method `ensure` called")}requestRange(w,n){(0,t.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(){(0,t.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(w){(0,t.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(w){this._password=w}terminate(w){(0,t.unreachable)("Abstract method `terminate` called")}}class j extends H{constructor(w,n,v,B,u,f,S){super(),this._docId=w,this._password=v,this._docBaseUrl=W(S),this.msgHandler=B,this.evaluatorOptions=u,this.enableXfa=f;const s=new e.Stream(n);this.pdfDocument=new _.PDFDocument(this,s),this._loadedStreamPromise=Promise.resolve(s)}async ensure(w,n,v){const B=w[n];return typeof B=="function"?B.apply(w,v):B}requestRange(w,n){return Promise.resolve()}requestLoadedStream(){}onLoadedStream(){return this._loadedStreamPromise}terminate(w){}}b.LocalPdfManager=j;class I extends H{constructor(w,n,v,B,u,f){super(),this._docId=w,this._password=v.password,this._docBaseUrl=W(f),this.msgHandler=v.msgHandler,this.evaluatorOptions=B,this.enableXfa=u,this.streamManager=new x.ChunkedStreamManager(n,{msgHandler:v.msgHandler,length:v.length,disableAutoFetch:v.disableAutoFetch,rangeChunkSize:v.rangeChunkSize}),this.pdfDocument=new _.PDFDocument(this,this.streamManager.getStream())}async ensure(w,n,v){try{const B=w[n];return typeof B=="function"?B.apply(w,v):B}catch(B){if(!(B instanceof Z.MissingDataException))throw B;return await this.requestRange(B.begin,B.end),this.ensure(w,n,v)}}requestRange(w,n){return this.streamManager.requestRange(w,n)}requestLoadedStream(){this.streamManager.requestAllChunks()}sendProgressiveData(w){this.streamManager.onReceiveData({chunk:w})}onLoadedStream(){return this.streamManager.onLoadedStream()}terminate(w){this.streamManager.abort(w)}}b.NetworkPdfManager=I},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.ChunkedStreamManager=b.ChunkedStream=void 0;var t=ae(2),x=ae(6),Z=ae(10);class _ extends Z.Stream{constructor(H,j,I){super(new Uint8Array(H),0,H,null),this.chunkSize=j,this._loadedChunks=new Set,this.numChunks=Math.ceil(H/j),this.manager=I,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const H=[];for(let j=0,I=this.numChunks;j<I;++j)this._loadedChunks.has(j)||H.push(j);return H}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(H,j){const I=this.chunkSize;if(H%I!==0)throw new Error(`Bad begin offset: ${H}`);const F=H+j.byteLength;if(F%I!==0&&F!==this.bytes.length)throw new Error(`Bad end offset: ${F}`);this.bytes.set(new Uint8Array(j),H);const w=Math.floor(H/I),n=Math.floor((F-1)/I)+1;for(let v=w;v<n;++v)this._loadedChunks.add(v)}onReceiveProgressiveData(H){let j=this.progressiveDataLength;const I=Math.floor(j/this.chunkSize);this.bytes.set(new Uint8Array(H),j),j+=H.byteLength,this.progressiveDataLength=j;const F=j>=this.end?this.numChunks:Math.floor(j/this.chunkSize);for(let w=I;w<F;++w)this._loadedChunks.add(w)}ensureByte(H){if(H<this.progressiveDataLength)return;const j=Math.floor(H/this.chunkSize);if(!(j>this.numChunks)&&j!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(j))throw new x.MissingDataException(H,H+1);this.lastSuccessfulEnsureByteChunk=j}}ensureRange(H,j){if(H>=j||j<=this.progressiveDataLength)return;const I=Math.floor(H/this.chunkSize);if(I>this.numChunks)return;const F=Math.min(Math.floor((j-1)/this.chunkSize)+1,this.numChunks);for(let w=I;w<F;++w)if(!this._loadedChunks.has(w))throw new x.MissingDataException(H,j)}nextEmptyChunk(H){const j=this.numChunks;for(let I=0;I<j;++I){const F=(H+I)%j;if(!this._loadedChunks.has(F))return F}return null}hasChunk(H){return this._loadedChunks.has(H)}getByte(){const H=this.pos;return H>=this.end?-1:(H>=this.progressiveDataLength&&this.ensureByte(H),this.bytes[this.pos++])}getBytes(H){const j=this.bytes,I=this.pos,F=this.end;if(!H)return F>this.progressiveDataLength&&this.ensureRange(I,F),j.subarray(I,F);let w=I+H;return w>F&&(w=F),w>this.progressiveDataLength&&this.ensureRange(I,w),this.pos=w,j.subarray(I,w)}getByteRange(H,j){return H<0&&(H=0),j>this.end&&(j=this.end),j>this.progressiveDataLength&&this.ensureRange(H,j),this.bytes.subarray(H,j)}makeSubStream(H,j,I=null){j?H+j>this.progressiveDataLength&&this.ensureRange(H,H+j):H>=this.progressiveDataLength&&this.ensureByte(H);function F(){}F.prototype=Object.create(this),F.prototype.getMissingChunks=function(){const n=this.chunkSize,v=Math.floor(this.start/n),B=Math.floor((this.end-1)/n)+1,u=[];for(let f=v;f<B;++f)this._loadedChunks.has(f)||u.push(f);return u},Object.defineProperty(F.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks?!0:this.getMissingChunks().length===0},configurable:!0});const w=new F;return w.pos=w.start=H,w.end=H+j||this.end,w.dict=I,w}getBaseStreams(){return[this]}}b.ChunkedStream=_;class e{constructor(H,j){this.length=j.length,this.chunkSize=j.rangeChunkSize,this.stream=new _(this.length,this.chunkSize,this),this.pdfNetworkStream=H,this.disableAutoFetch=j.disableAutoFetch,this.msgHandler=j.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=(0,t.createPromiseCapability)()}onLoadedStream(){return this._loadedStreamCapability.promise}sendRequest(H,j){const I=this.pdfNetworkStream.getRangeReader(H,j);I.isStreamingSupported||(I.onProgress=this.onProgress.bind(this));let F=[],w=0;return new Promise((n,v)=>{const B=u=>{try{if(!u.done){const S=u.value;F.push(S),w+=(0,t.arrayByteLength)(S),I.isStreamingSupported&&this.onProgress({loaded:w}),I.read().then(B,v);return}const f=(0,t.arraysToBytes)(F);F=null,n(f)}catch(f){v(f)}};I.read().then(B,v)}).then(n=>{this.aborted||this.onReceiveData({chunk:n,begin:H})})}requestAllChunks(){const H=this.stream.getMissingChunks();return this._requestChunks(H),this._loadedStreamCapability.promise}_requestChunks(H){const j=this.currRequestId++,I=new Set;this._chunksNeededByRequest.set(j,I);for(const n of H)this.stream.hasChunk(n)||I.add(n);if(I.size===0)return Promise.resolve();const F=(0,t.createPromiseCapability)();this._promisesByRequest.set(j,F);const w=[];for(const n of I){let v=this._requestsByChunk.get(n);v||(v=[],this._requestsByChunk.set(n,v),w.push(n)),v.push(j)}if(w.length>0){const n=this.groupChunks(w);for(const v of n){const B=v.beginChunk*this.chunkSize,u=Math.min(v.endChunk*this.chunkSize,this.length);this.sendRequest(B,u).catch(F.reject)}}return F.promise.catch(n=>{if(!this.aborted)throw n})}getStream(){return this.stream}requestRange(H,j){j=Math.min(j,this.length);const I=this.getBeginChunk(H),F=this.getEndChunk(j),w=[];for(let n=I;n<F;++n)w.push(n);return this._requestChunks(w)}requestRanges(H=[]){const j=[];for(const I of H){const F=this.getBeginChunk(I.begin),w=this.getEndChunk(I.end);for(let n=F;n<w;++n)j.includes(n)||j.push(n)}return j.sort(function(I,F){return I-F}),this._requestChunks(j)}groupChunks(H){const j=[];let I=-1,F=-1;for(let w=0,n=H.length;w<n;++w){const v=H[w];I<0&&(I=v),F>=0&&F+1!==v&&(j.push({beginChunk:I,endChunk:F+1}),I=v),w+1===H.length&&j.push({beginChunk:I,endChunk:v+1}),F=v}return j}onProgress(H){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+H.loaded,total:this.length})}onReceiveData(H){const j=H.chunk,I=H.begin===void 0,F=I?this.progressiveDataLength:H.begin,w=F+j.byteLength,n=Math.floor(F/this.chunkSize),v=w<this.length?Math.floor(w/this.chunkSize):Math.ceil(w/this.chunkSize);I?(this.stream.onReceiveProgressiveData(j),this.progressiveDataLength=w):this.stream.onReceiveData(F,j),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const B=[];for(let u=n;u<v;++u){const f=this._requestsByChunk.get(u);if(!!f){this._requestsByChunk.delete(u);for(const S of f){const s=this._chunksNeededByRequest.get(S);s.has(u)&&s.delete(u),!(s.size>0)&&B.push(S)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let u;if(this.stream.numChunksLoaded===1){const f=this.stream.numChunks-1;this.stream.hasChunk(f)||(u=f)}else u=this.stream.nextEmptyChunk(v);Number.isInteger(u)&&this._requestChunks([u])}for(const u of B){const f=this._promisesByRequest.get(u);this._promisesByRequest.delete(u),f.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(H){this._loadedStreamCapability.reject(H)}getBeginChunk(H){return Math.floor(H/this.chunkSize)}getEndChunk(H){return Math.floor((H-1)/this.chunkSize)+1}abort(H){this.aborted=!0,this.pdfNetworkStream&&this.pdfNetworkStream.cancelAllRequests(H);for(const j of this._promisesByRequest.values())j.reject(H)}}b.ChunkedStreamManager=e},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.StringStream=b.Stream=b.NullStream=void 0;var t=ae(7),x=ae(2);class Z extends t.BaseStream{constructor(H,j,I,F){super(),this.bytes=H instanceof Uint8Array?H:new Uint8Array(H),this.start=j||0,this.pos=this.start,this.end=j+I||this.bytes.length,this.dict=F}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(H){const j=this.bytes,I=this.pos,F=this.end;if(!H)return j.subarray(I,F);let w=I+H;return w>F&&(w=F),this.pos=w,j.subarray(I,w)}getByteRange(H,j){return H<0&&(H=0),j>this.end&&(j=this.end),this.bytes.subarray(H,j)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(H,j,I=null){return new Z(this.bytes.buffer,H,j,I)}}b.Stream=Z;class _ extends Z{constructor(H){super((0,x.stringToBytes)(H))}}b.StringStream=_;class e extends Z{constructor(){super(new Uint8Array(0))}}b.NullStream=e},(Re,b,ae)=>{Object.defineProperty(b,"__esModule",{value:!0}),b.Page=b.PDFDocument=void 0;var t=ae(12),x=ae(2),Z=ae(6),_=ae(5),e=ae(51),W=ae(7),H=ae(67),j=ae(69),I=ae(71),F=ae(100),w=ae(17),n=ae(10),v=ae(75),B=ae(62),u=ae(15),f=ae(19),S=ae(74),s=ae(65),m=ae(76),$=ae(101);const d=1,C=[0,0,612,792];class h{constructor({pdfManager:g,xref:E,pageIndex:L,pageDict:P,ref:z,globalIdFactory:G,fontCache:ne,builtInCMapCache:D,standardFontDataCache:R,globalImageCache:V,nonBlendModesSet:J,xfaFactory:X}){this.pdfManager=g,this.pageIndex=L,this.pageDict=P,this.xref=E,this.ref=z,this.fontCache=ne,this.builtInCMapCache=D,this.standardFontDataCache=R,this.globalImageCache=V,this.nonBlendModesSet=J,this.evaluatorOptions=g.evaluatorOptions,this.resourcesPromise=null,this.xfaFactory=X;const A={obj:0};this._localIdFactory=class extends G{static createObjId(){return`p${L}_${++A.obj}`}static getPageObjId(){return`page${z.toString()}`}}}_getInheritableProperty(g,E=!1){const L=(0,Z.getInheritableProperty)({dict:this.pageDict,key:g,getArray:E,stopWhenFound:!1});return Array.isArray(L)?L.length===1||!(L[0]instanceof _.Dict)?L[0]:_.Dict.merge({xref:this.xref,dictArray:L}):L}get content(){return this.pageDict.getArray("Contents")}get resources(){const g=this._getInheritableProperty("Resources");return(0,x.shadow)(this,"resources",g instanceof _.Dict?g:_.Dict.empty)}_getBoundingBox(g){if(this.xfaData)return