1try{let e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="21286a36-0a25-48bc-bb9e-338836879d1f",e._sentryDebugIdIdentifier="sentry-dbid-21286a36-0a25-48bc-bb9e-338836879d1f")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[516],{70273:(module,__unused_webpack_exports,__webpack_require__)=>{var process=__webpack_require__(29143),Buffer=__webpack_require__(51642).Buffer;!function(d,c){module.exports=d.pdfjsLib=c()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(d,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.VerbosityLevel=c.Util=c.UnknownErrorException=c.UnexpectedResponseException=c.TextRenderingMode=c.RenderingIntentFlag=c.PromiseCapability=c.PermissionFlag=c.PasswordResponses=c.PasswordException=c.PageActionEventType=c.OPS=c.MissingPDFException=c.MAX_IMAGE_SIZE_TO_CACHE=c.LINE_FACTOR=c.LINE_DESCENT_FACTOR=c.InvalidPDFException=c.ImageKind=c.IDENTITY_MATRIX=c.FormatError=c.FeatureTest=c.FONT_IDENTITY_MATRIX=c.DocumentActionEventType=c.CMapCompressionType=c.BaseException=c.BASELINE_FACTOR=c.AnnotationType=c.AnnotationReplyType=c.AnnotationPrefix=c.AnnotationMode=c.AnnotationFlag=c.AnnotationFieldFlag=c.AnnotationEditorType=c.AnnotationEditorPrefix=c.AnnotationEditorParamsType=c.AnnotationBorderStyleType=c.AnnotationActionEventType=c.AbortException=void 0,c.assert=_,c.bytesToString=I,c.createValidAbsoluteUrl=x,c.getModificationDate=K,c.getUuid=tt,c.getVerbosityLevel=b,c.info=A,c.isArrayBuffer=q,c.isArrayEqual=X,c.isNodeJS=void 0,c.normalizeUnicode=Z,c.objectFromMap=N,c.objectSize=O,c.setVerbosityLevel=f,c.shadow=E,c.string32=L,c.stringToBytes=D,c.stringToPDFString=$,c.stringToUTF8String=W,c.unreachable=y,c.utf8StringToString=V,c.warn=v,c.isNodeJS="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),c.IDENTITY_MATRIX=[1,0,0,1,0,0],c.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],c.MAX_IMAGE_SIZE_TO_CACHE=1e7;let u=1.35;c.LINE_FACTOR=1.35;let p=.35;c.LINE_DESCENT_FACTOR=.35,c.BASELINE_FACTOR=p/u,c.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},c.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},c.AnnotationEditorPrefix="pdfjs_internal_editor_",c.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},c.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},c.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},c.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},c.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},c.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},c.AnnotationReplyType={GROUP:"Group",REPLY:"R"},c.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},c.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:0x1000000,RICHTEXT:0x2000000,RADIOSINUNISON:0x2000000,COMMITONSELCHANGE:0x4000000},c.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},c.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},c.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},c.PageActionEventType={O:"PageOpen",C:"PageClose"};let g={ERRORS:0,WARNINGS:1,INFOS:5};
1c.VerbosityLevel=g,c.CMapCompressionType={NONE:0,BINARY:1},c.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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},c.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let m=g.WARNINGS;function f(d){Number.isInteger(d)&&(m=d)}function b(){return m}function A(d){m>=g.INFOS&&console.log(`Info: ${d}`)}function v(d){m>=g.WARNINGS&&console.log(`Warning: ${d}`)}function y(d){throw Error(d)}function _(d,c){d||y(c)}function S(d){switch(d?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function x(d,c=null,u=null){if(!d)return null;try{if(u&&"string"==typeof d){if(u.addDefaultProtocol&&d.startsWith("www.")){let c=d.match(/\./g);c?.length>=2&&(d=`http://${d}`)}if(u.tryConvertEncoding)try{d=W(d)}catch{}}let p=c?new URL(d,c):new URL(d);if(S(p))return p}catch{}return null}function E(d,c,u,p=!1){return Object.defineProperty(d,c,{value:u,enumerable:!p,configurable:!0,writable:!1}),u}let C=function(){function d(c,u){this.constructor===d&&y("Cannot initialize BaseException."),this.message=c,this.name=u}return d.prototype=Error(),d.constructor=d,d}();c.BaseException=C;class T extends C{constructor(d,c){super(d,"PasswordException"),this.code=c}}c.PasswordException=T;class w extends C{constructor(d,c){super(d,"UnknownErrorException"),this.details=c}}c.UnknownErrorException=w;class P extends C{constructor(d){super(d,"InvalidPDFException")}}c.InvalidPDFException=P;class M extends C{constructor(d){super(d,"MissingPDFException")}}c.MissingPDFException=M;class k extends C{constructor(d,c){super(d,"UnexpectedResponseException"),this.status=c}}c.UnexpectedResponseException=k;class F extends C{constructor(d){super(d,"FormatError")}}c.FormatError=F;class R extends C{constructor(d){super(d,"AbortException")}}function I(d){("object"!=typeof d||d?.length===void 0)&&y("Invalid argument for bytesToString");let c=d.length,u=8192;if(c<8192)return String.fromCharCode.apply(null,d);let p=[];for(let g=0;g<c;g+=u){let m=Math.min(g+u,c),f=d.subarray(g,m);p.push(String.fromCharCode.apply(null,f))}return p.join("")}function D(d){"string"!=typeof d&&y("Invalid argument for stringToBytes");let c=d.length,u=new Uint8Array(c);for(let p=0;p<c;++p)u[p]=255&d.charCodeAt(p);return u}function L(d){return String.fromCharCode(d>>24&255,d>>16&255,d>>8&255,255&d)}function O(d){return Object.keys(d).length}function N(d){let c=Object.create(null);for(let[u,p]of d)c[u]=p;return c}function B(){let d=new Uint8Array(4);return d[0]=1,1===new Uint32Array(d.buffer,0,1)[0]}function U(){try{return Function(""),!0}catch{return!1}}c.AbortException=R;class j{static get isLittleEndian(){return E(this,"isLittleEndian",B())}static get isEvalSupported(){return E(this,"isEvalSupported",U())}static get isOffscreenCanvasSupported(){return E(this,"isOffscreenCanvasSupported","u">typeof OffscreenCanvas)}static get platform(){return"u"<typeof navigator?E(this,"platform",{isWin:!1,isMac:!1}):E(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return E(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}c.FeatureTest=j;let z=[...Array(256).keys()].map(d=>d.toString(16).padStart(2,"0"));class H{static makeHexColor(d,c,u){return`#${z[d]}${z[c]}${z[u]}`}static scaleMinMax(d,c){let u;d[0]?(d[0]<0&&(u=c[0],c[0]=c[1],c[1]=u),c[0]*=d[0],c[1]*=d[0],d[3]<0&&(u=c[2],c[2]=c[3],c[3]=u),c[2]*=d[3],c[3]*=d[3]):(u=c[0],c[0]=c[2],c[2]=u,u=c[1],c[1]=c[3],c[3]=u,d[1]<0&&(u=c[2],c[2]=c[3],c[3]=u),c[2]*=d[1],c[3]*=d[1],d[2]<0&&(u=c[0],c[0]=c[1],c[1]=u),c[0]*=d[2],c[1]*=d[2]),c[0]+=d[4],c[1]+=d[4],c[2]+=d[5],c[3]+=d[5]}static transform(d,c){return[d[0]*c[0]+d[2]*c[1],d[1]*c[0]+d[3]*c[1],d[0]*c[2]+d[2]*c[3],d[1]*c[2]+d[3]*c[3],d[0]*c[4]+d[2]*c[5]+d[4],d[1]*c[4]+d[3]*c[5]+d[5]]}static applyTransform(d,c){return[d[0]*c[0]+d[1]*c[2]+c[4],d[0]*c[1]+d[1]*c[3]+c[5]]}static applyInverseTransform(d,c){let u=c[0]*c[3]-c[1]*c[2];return[(d[0]*c[3]-d[1]*c[2]+c[2]*c[5]-c[4]*c[3])/u,(-d[0]*c[1]+d[1]*c[0]+c[4]*c[1]-c[5]*c[0])/u]}static getAxialAlignedBoundingBox(d,c){let u=this.applyTransform(d,c),p=this.applyTransform(d.slice(2,4),c),g=this.applyTransform([d[0],d[3]],c),m=this.applyTransform([d[2],d[1]],c);return[Math.min(u[0],p[0],g[0],m[0]),Math.min(u[1],p[1],g[1],m[1]),Math.max(u[0],p[0],g[0],m[0]),Math.max(u[1],p[1],g[1],m[1])]}static inverseTransform(d){let c=d[0]*d[3]-d[1]*d[2];return[d[3]/c,-d[1]/c,-d[2]/c,d[0]/c,(d[2]*d[5]-d[4]*d[3])/c,(d[4]*d[1]-d[5]*d[0])/c]}static singularValueDecompose2dScale(d){let c=[d[0],d[2],d[1],d[3]],u=d[0]*c[0]+d[1]*c[2],p=d[0]
1*c[1]+d[1]*c[3],g=d[2]*c[0]+d[3]*c[2],m=d[2]*c[1]+d[3]*c[3],f=(u+m)/2,b=Math.sqrt((u+m)**2-4*(u*m-g*p))/2;return[Math.sqrt(f+b||1),Math.sqrt(f-b||1)]}static normalizeRect(d){let c=d.slice(0);return d[0]>d[2]&&(c[0]=d[2],c[2]=d[0]),d[1]>d[3]&&(c[1]=d[3],c[3]=d[1]),c}static intersect(d,c){let u=Math.max(Math.min(d[0],d[2]),Math.min(c[0],c[2])),p=Math.min(Math.max(d[0],d[2]),Math.max(c[0],c[2]));if(u>p)return null;let g=Math.max(Math.min(d[1],d[3]),Math.min(c[1],c[3])),m=Math.min(Math.max(d[1],d[3]),Math.max(c[1],c[3]));return g>m?null:[u,g,p,m]}static bezierBoundingBox(d,c,u,p,g,m,f,b){let A,v,y,_,S,x,E,C,T=[],w=[[],[]];for(let w=0;w<2;++w){if(0===w?(v=6*d-12*u+6*g,A=-3*d+9*u-9*g+3*f,y=3*u-3*d):(v=6*c-12*p+6*m,A=-3*c+9*p-9*m+3*b,y=3*p-3*c),1e-12>Math.abs(A)){if(1e-12>Math.abs(v))continue;0<(_=-y/v)&&_<1&&T.push(_);continue}C=Math.sqrt(E=v*v-4*y*A),!(E<0)&&(0<(S=(-v+C)/(2*A))&&S<1&&T.push(S),0<(x=(-v-C)/(2*A))&&x<1&&T.push(x))}let P=T.length,M,k=P;for(;P--;)M=1-(_=T[P]),w[0][P]=M*M*M*d+3*M*M*_*u+3*M*_*_*g+_*_*_*f,w[1][P]=M*M*M*c+3*M*M*_*p+3*M*_*_*m+_*_*_*b;return w[0][k]=d,w[1][k]=c,w[0][k+1]=f,w[1][k+1]=b,w[0].length=w[1].length=k+2,[Math.min(...w[0]),Math.min(...w[1]),Math.max(...w[0]),Math.max(...w[1])]}}c.Util=H;let G=[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 $(d){if(d[0]>="\xef"){let c;if("\xfe"===d[0]&&"\xff"===d[1]?c="utf-16be":"\xff"===d[0]&&"\xfe"===d[1]?c="utf-16le":"\xef"===d[0]&&"\xbb"===d[1]&&"\xbf"===d[2]&&(c="utf-8"),c)try{let u=new TextDecoder(c,{fatal:!0}),p=D(d);return u.decode(p)}catch(d){v(`stringToPDFString: "${d}".`)}}let c=[];for(let u=0,p=d.length;u<p;u++){let p=G[d.charCodeAt(u)];c.push(p?String.fromCharCode(p):d.charAt(u))}return c.join("")}function W(d){return decodeURIComponent(escape(d))}function V(d){return unescape(encodeURIComponent(d))}function q(d){return"object"==typeof d&&d?.byteLength!==void 0}function X(d,c){if(d.length!==c.length)return!1;for(let u=0,p=d.length;u<p;u++)if(d[u]!==c[u])return!1;return!0}function K(d=new Date){return[d.getUTCFullYear().toString(),(d.getUTCMonth()+1).toString().padStart(2,"0"),d.getUTCDate().toString().padStart(2,"0"),d.getUTCHours().toString().padStart(2,"0"),d.getUTCMinutes().toString().padStart(2,"0"),d.getUTCSeconds().toString().padStart(2,"0")].join("")}class Y{#t=!1;constructor(){this.promise=new Promise((d,c)=>{this.resolve=c=>{this.#t=!0,d(c)},this.reject=d=>{this.#t=!0,c(d)}})}get settled(){return this.#t}}c.PromiseCapability=Y;let J=null,Q=null;function Z(d){return J||(J=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Q=new Map([["ï¬
","ſt"]])),d.replaceAll(J,(d,c,u)=>c?c.normalize("NFKC"):Q.get(u))}function tt(){if("u">typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();let d=new Uint8Array(32);if("u">typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(d);else for(let c=0;c<32;c++)d[c]=Math.floor(255*Math.random());return I(d)}c.AnnotationPrefix="pdfjs_internal_id_"},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_c
1anvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(d){if("string"==typeof d||d instanceof URL?d={url:d}:(0,_util.isArrayBuffer)(d)&&(d={data:d}),"object"!=typeof d)throw Error("Invalid parameter in getDocument, need parameter object.");if(!d.url&&!d.data&&!d.range)throw Error("Invalid parameter object: need either .data, .range or .url");let c=new PDFDocumentLoadingTask,{docId:u}=c,p=d.url?getUrlProp(d.url):null,g=d.data?getDataProp(d.data):null,m=d.httpHeaders||null,f=!0===d.withCredentials,b=d.password??null,A=d.range instanceof PDFDataRangeTransport?d.range:null,v=Number.isInteger(d.rangeChunkSize)&&d.rangeChunkSize>0?d.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,y=d.worker instanceof PDFWorker?d.worker:null,_=d.verbosity,S="string"!=typeof d.docBaseUrl||(0,_display_utils.isDataScheme)(d.docBaseUrl)?null:d.docBaseUrl,x="str
1ing"==typeof d.cMapUrl?d.cMapUrl:null,E=!1!==d.cMapPacked,C=d.CMapReaderFactory||DefaultCMapReaderFactory,T="string"==typeof d.standardFontDataUrl?d.standardFontDataUrl:null,w=d.StandardFontDataFactory||DefaultStandardFontDataFactory,P=!0!==d.stopAtErrors,M=Number.isInteger(d.maxImageSize)&&d.maxImageSize>-1?d.maxImageSize:-1,k=!1!==d.isEvalSupported,F="boolean"==typeof d.isOffscreenCanvasSupported?d.isOffscreenCanvasSupported:!_util.isNodeJS,R=Number.isInteger(d.canvasMaxAreaInBytes)?d.canvasMaxAreaInBytes:-1,I="boolean"==typeof d.disableFontFace?d.disableFontFace:_util.isNodeJS,D=!0===d.fontExtraProperties,L=!0===d.enableXfa,O=d.ownerDocument||globalThis.document,N=!0===d.disableRange,B=!0===d.disableStream,U=!0===d.disableAutoFetch,j=!0===d.pdfBug,z=A?A.length:d.length??NaN,H="boolean"==typeof d.useSystemFonts?d.useSystemFonts:!_util.isNodeJS&&!I,G="boolean"==typeof d.useWorkerFetch?d.useWorkerFetch:C===_display_utils.DOMCMapReaderFactory&&w===_display_utils.DOMStandardFontDataFactory&&x&&T&&(0,_display_utils.isValidFetchUrl)(x,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(T,document.baseURI),$=d.canvasFactory||new DefaultCanvasFactory({ownerDocument:O}),W=d.filterFactory||new DefaultFilterFactory({docId:u,ownerDocument:O}),V=null;(0,_util.setVerbosityLevel)(_);let q={canvasFactory:$,filterFactory:W};if(G||(q.cMapReaderFactory=new C({baseUrl:x,isCompressed:E}),q.standardFontDataFactory=new w({baseUrl:T})),!y){let d={verbosity:_,port:_worker_options.GlobalWorkerOptions.workerPort};c._worker=y=d.port?PDFWorker.fromPort(d):new PDFWorker(d)}let X={docId:u,apiVersion:"3.11.174",data:g,password:b,disableAutoFetch:U,rangeChunkSize:v,length:z,docBaseUrl:S,enableXfa:L,evaluatorOptions:{maxImageSize:M,disableFontFace:I,ignoreErrors:P,isEvalSupported:k,isOffscreenCanvasSupported:F,canvasMaxAreaInBytes:R,fontExtraProperties:D,useSystemFonts:H,cMapUrl:G?x:null,standardFontDataUrl:G?T:null}},K={ignoreErrors:P,isEvalSupported:k,disableFontFace:I,fontExtraProperties:D,enableXfa:L,ownerDocument:O,disableAutoFetch:U,pdfBug:j,styleElement:V};return y.promise.then(function(){if(c.destroyed)throw Error("Loading aborted");return Promise.all([_fetchDocument(y,X),new Promise(function(d){let c,u;A?c=new _transport_stream.PDFDataTransportStream({length:z,initialData:A.initialData,progressiveDone:A.progressiveDone,contentDispositionFilename:A.contentDispositionFilename,disableRange:N,disableStream:B},A):g||(u={url:p,length:z,httpHeaders:m,withCredentials:f,rangeChunkSize:v,disableRange:N,disableStream:B},c=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(u):(0,_display_utils.isValidFetchUrl)(u.url)?new _displayFetch_stream.PDFFetchStream(u):new _displayNetwork.PDFNetworkStream(u)),d(c)})]).then(function([d,p]){if(c.destroyed)throw Error("Loading aborted");let g=new _message_handler.MessageHandler(u,d,y.port),m=new WorkerTransport(g,c,p,K,q);c._transport=m,g.send("Ready",null)})}).catch(c._capability.reject),c}async function _fetchDocument(d,c){if(d.destroyed)throw Error("Worker was destroyed");let u=await d.messageHandler.sendWithPromise("GetDocRequest",c,c.data?[c.data.buffer]:null);if(d.destroyed)throw Error("Worker was destroyed");return u}function getUrlProp(d){if(d instanceof URL)return d.href;try{return new URL(d,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof d)return d}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(d){if(_util.isNodeJS&&void 0!==Buffer&&d instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength)return d;if("string"==typeof d)return(0,_util.stringToBytes)(d);if("object"==typeof d&&!isNaN(d?.length)||(0,_util.isArrayBuffer)(d))return new Uint8Array(d);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{static #e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${PDFDocumentLoadingTask.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(d){throw this._worker?.port&&delete this._worker._pendingDestroy,d}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(d,c,u=!1,p=null){this.length=d,this.initialData=c,this.progressiveDone=u,this.contentDispositionFilename=p,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(d){this._rangeListeners.push(d)}addProgressListener(d){this._progressListeners.push(d)}addProgressiveReadListener(d){this._progressiveReadListeners.push(d)}addProgressiveDoneListener(d){this._progressiveDoneListeners.push(d)}onDataRange(d,c){for(let u of this._rangeListeners)u(d,c)}onDataProgress(d,c){this._readyCapability.promise.then(()=>{for(let u of this._progressListeners)u(d,c)})}onDataProgressiveRead(d){this._readyCapability.promise.then(()=>{for(let c of this._progressiveReadListeners)c(d)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let d of this._progressiveDoneListeners)d()})}transportReady(){this._readyCapability.resolve()}requestDataRange(d,c){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(d,c){this._pdfInfo=d,this._transport=c,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(d=>{if(!d)return d;let c=[];for(let u in d)c.push(...d[u]);return c}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(d){return this._transport.getPage(d)}getPageIndex(d){return this._transport.getPageIndex(d)}getDestinations(){return this._transport.getDestinations()}getDestination(d){return this._transport.getDestination(d)}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()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(d=!1){return this._transport.startCleanup(d||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#i=null;#s=!1;constructor(d,c,u,p=!1){this._pageIndex=d,this._pageInfo=c,this._transport=u,this._stats=p?new _display_utils.StatTimer:null,this._pdfBug=p,this.commonObjs=u.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,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:d,rotation:c=this.rotate,offsetX:u=0,offsetY:p=0,dontFlip:g=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:d,rotation:c,offsetX:u,offsetY:p,dontFlip:g})}getAnnotations({intent:d="display"}={}
1){let c=this._transport.getRenderingIntent(d);return this._transport.getAnnotations(this._pageIndex,c.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:d,viewport:c,intent:u="display",annotationMode:p=_util.AnnotationMode.ENABLE,transform:g=null,background:m=null,optionalContentConfigPromise:f=null,annotationCanvasMap:b=null,pageColors:A=null,printAnnotationStorage:v=null}){this._stats?.time("Overall");let y=this._transport.getRenderingIntent(u,p,v);this.#s=!1,this.#r(),f||(f=this._transport.getOptionalContentConfig());let _=this._intentStates.get(y.cacheKey);_||(_=Object.create(null),this._intentStates.set(y.cacheKey,_)),_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);let S=!!(y.renderingIntent&_util.RenderingIntentFlag.PRINT);_.displayReadyCapability||(_.displayReadyCapability=new _util.PromiseCapability,_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(y));let x=d=>{_.renderTasks.delete(E),(this._maybeCleanupAfterRender||S)&&(this.#s=!0),this.#a(!S),d?(E.capability.reject(d),this._abortOperatorList({intentState:_,reason:d instanceof Error?d:Error(d)})):E.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},E=new InternalRenderTask({callback:x,params:{canvasContext:d,viewport:c,transform:g,background:m},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:b,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!S,pdfBug:this._pdfBug,pageColors:A});(_.renderTasks||=new Set).add(E);let C=E.task;return Promise.all([_.displayReadyCapability.promise,f]).then(([d,c])=>{this.destroyed?x():(this._stats?.time("Rendering"),E.initializeGraphics({transparency:d,optionalContentConfig:c}),E.operatorListChanged())}).catch(x),C}getOperatorList({intent:d="display",annotationMode:c=_util.AnnotationMode.ENABLE,printAnnotationStorage:u=null}={}){let p;function g(){f.operatorList.lastChunk&&(f.opListReadCapability.resolve(f.operatorList),f.renderTasks.delete(p))}let m=this._transport.getRenderingIntent(d,c,u,!0),f=this._intentStates.get(m.cacheKey);return f||(f=Object.create(null),this._intentStates.set(m.cacheKey,f)),f.opListReadCapability||((p=Object.create(null)).operatorListChanged=g,f.opListReadCapability=new _util.PromiseCapability,(f.renderTasks||=new Set).add(p),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m)),f.opListReadCapability.promise}streamTextContent({includeMarkedContent:d=!1,disableNormalization:c=!1}={}){let u=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===d,disableNormalization:!0===c},{highWaterMark:u,size:d=>d.items.length})}getTextContent(d={}){if(this._transport._htmlForXfa)return this.getXfa().then(d=>_xfa_text.XfaText.textContent(d));let c=this.streamTextContent(d);return new Promise(function(d,u){function p(){g.read().then(function({value:c,done:u}){u?d(m):(Object.assign(m.styles,c.styles),m.items.push(...c.items),p())},u)}let g=c.getReader(),m={items:[],styles:Object.create(null)};p()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let d=[];for(let c of this._intentStates.values())if(this._abortOperatorList({intentState:c,reason:Error("Page was destroyed."),force:!0}),!c.opListReadCapability)for(let u of c.renderTasks)d.push(u.completed),u.cancel();return this.objs.clear(),this.#s=!1,this.#r(),Promise.all(d)}cleanup(d=!1){this.#s=!0;let c=this.#a(!1);return d&&c&&(this._stats&&=new _display_utils.StatTimer),c}#a(d=!1){if(this.#r(),!this.#s||this.destroyed)return!1;if(d)return this.#i=setTimeout(()=>{this.#i=null,this.#a(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(let{renderTasks:d,operatorList:c}of this._intentStates.values())if(d.size>0||!c.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#s=!1,!0}#r(){this.#i&&(clearTimeout(this.#i),this.#i=null)}_startRenderPage(d,c){let u=this._intentStates.get(c);u&&(this._stats?.timeEnd("Page Request"),u.displayReadyCapability?.resolve(d))}_renderPageChunk(d,c){for(let u=0,p=d.length;u<p;u++)c.operatorList.fnArray.push(d.fnArray[u]),c.operatorList.argsArray.push(d.argsArray[u]);for(let u of(c.operatorList.lastChunk=d.lastChunk,c.operatorList.separateAnnots=d.separateAnnots,c.renderTasks))u.operatorListChanged();d.lastChunk&&this.#a(!0)}_pumpOperatorList({renderingIntent:d,cacheKey:c,annotationStorageSerializable:u}){let{map:p,transfers:g}=u,m=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:d,cacheKey:c,annotationStorage:p},g).getReader(),f=this._intentStates.get(c);f.streamReader=m;let b=()=>{m.read().then(({value:d,done:c})=>{if(c){f.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,f),b())},d=>
1{if(f.streamReader=null,!this._transport.destroyed){if(f.operatorList){for(let d of(f.operatorList.lastChunk=!0,f.renderTasks))d.operatorListChanged();this.#a(!0)}if(f.displayReadyCapability)f.displayReadyCapability.reject(d);else if(f.opListReadCapability)f.opListReadCapability.reject(d);else throw d}})};b()}_abortOperatorList({intentState:d,reason:c,force:u=!1}){if(d.streamReader){if(d.streamReaderCancelTimeout&&(clearTimeout(d.streamReaderCancelTimeout),d.streamReaderCancelTimeout=null),!u){if(d.renderTasks.size>0)return;if(c instanceof _display_utils.RenderingCancelledException){let u=RENDERING_CANCELLED_TIMEOUT;c.extraDelay>0&&c.extraDelay<1e3&&(u+=c.extraDelay),d.streamReaderCancelTimeout=setTimeout(()=>{d.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:d,reason:c,force:!0})},u);return}}if(d.streamReader.cancel(new _util.AbortException(c.message)).catch(()=>{}),d.streamReader=null,!this._transport.destroyed){for(let[c,u]of this._intentStates)if(u===d){this._intentStates.delete(c);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#n=new Set;#o=Promise.resolve();postMessage(d,c){let u={data:structuredClone(d,c?{transfer:c}:null)};this.#o.then(()=>{for(let d of this.#n)d.call(this,u)})}addEventListener(d,c){this.#n.add(c)}removeEventListener(d,c){this.#n.delete(c)}terminate(){this.#n.clear()}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS&&1)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let pdfjsFilePath=document?.currentScript?.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(d,c){let u;try{if(!(u=new URL(d)).origin||"null"===u.origin)return!1}catch{return!1}let p=new URL(c,u);return u.origin===p.origin},PDFWorkerUtil.createCDNWrapper=function(d){let c=`importScripts("${d}");`;return URL.createObjectURL(new Blob([c]))};class PDFWorker{static #l;constructor({name:d=null,port:c=null,verbosity:u=(0,_util.getVerbosityLevel)()}={}){if(this.name=d,this.destroyed=!1,this.verbosity=u,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,c){if(PDFWorker.#l?.has(c))throw Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).set(c,this),this._initializeFromPort(c);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(d){this._port=d,this._messageHandler=new _message_handler.MessageHandler("main","worker",d),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:d}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,d)||(d=PDFWorkerUtil.createCDNWrapper(new URL(d,window.location).href));let c=new Worker(d),u=new _message_handler.MessageHandler("main","worker",c),p=()=>{c.removeEventListener("error",g),u.destroy(),c.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},g=()=>{this._webWorker||p()};c.addEventListener("error",g),u.on("test",d=>{(c.removeEventListener("error",g),this.destroyed)?p():d?(this._messageHandler=u,this._port=c,this._webWorker=c,this._readyCapability.resolve(),u.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),u.destroy(),c.terminate())}),u.on("ready",d=>{if(c.removeEventListener("error",g),this.destroyed)return void p();try{m()}catch{this._setupFakeWorker()}});let m=()=>{let d=new Uint8Array;u.send("test",d,[d.buffer])};m();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(d=>{if(this.destroyed)return void this._readyCapability.reject(Error("Worker was destroyed"));let c=new LoopbackPort;this._port=c;let u=`fake${PDFWorkerUtil.fakeWorkerId++}`,p=new _message_handler.MessageHandler(u+"_worker",u,c);d.setup(p,c);let g=new _message_handler.MessageHandler(u,u+"_worker",c);this._messageHandler=g,this._readyCapability.resolve(),g.send("configure",{verbosity:this.verbosity})}).catch(d=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${d.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(d){if(!d?.port)throw Error("PDFWorker.fromPort - invalid method signature.");let c=this.#l?.get(d.port);
1if(c){if(c._pendingDestroy)throw Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return c}return new PDFWorker(d)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&1){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await (0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#h=new Map;#d=new Map;#c=new Map;#u=null;constructor(d,c,u,p,g){this.messageHandler=d,this.loadingTask=c,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:p.ownerDocument,styleElement:p.styleElement}),this._params=p,this.canvasFactory=g.canvasFactory,this.filterFactory=g.filterFactory,this.cMapReaderFactory=g.cMapReaderFactory,this.standardFontDataFactory=g.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=u,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(d,c=null){let u=this.#h.get(d);if(u)return u;let p=this.messageHandler.sendWithPromise(d,c);return this.#h.set(d,p),p}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(d,c=_util.AnnotationMode.ENABLE,u=null,p=!1){let g=_util.RenderingIntentFlag.DISPLAY,m=_annotation_storage.SerializableEmpty;switch(d){case"any":g=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":g=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${d}`)}switch(c){case _util.AnnotationMode.DISABLE:g+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:g+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:m=((g+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE)&_util.RenderingIntentFlag.PRINT&&u instanceof _annotation_storage.PrintAnnotationStorage?u:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${c}`)}return p&&(g+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:g,cacheKey:`${g}_${m.hash}`,annotationStorageSerializable:m}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(Error("Worker was destroyed during onPassword callback"));let d=[];for(let c of this.#d.values())d.push(c._destroy());this.#d.clear(),this.#c.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let c=this.messageHandler.sendWithPromise("Terminate",null);return d.push(c),Promise.all(d).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#h.clear(),this.filterFactory.destroy(),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(){let{messageHandler:d,loadingTask:c}=this;d.on("GetReader",(d,c)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=d=>{this._lastProgress={loaded:d.loaded,total:d.total}},c.onPull=()=>{this._fullReader.read().then(function({value:d,done:u}){u?c.close():((0,_util.assert)(d instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),c.enqueue(new Uint8Array(d),1,[d]))}).catch(d=>{c.error(d)})},c.onCancel=d=>{this._fullReader.cancel(d),c.ready.catch(d=>{if(!this.destroyed)throw d})}}),d.on("ReaderHeadersReady",d=>{let u=new _util.PromiseCapability,p=this._fullReader;return p.headersReady.then(()=>{p.isStreamingSupported&&p.isRangeSupported||(this._lastProgress&&
1c.onProgress?.(this._lastProgress),p.onProgress=d=>{c.onProgress?.({loaded:d.loaded,total:d.total})}),u.resolve({isStreamingSupported:p.isStreamingSupported,isRangeSupported:p.isRangeSupported,contentLength:p.contentLength})},u.reject),u.promise}),d.on("GetRangeReader",(d,c)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let u=this._networkStream.getRangeReader(d.begin,d.end);u?(c.onPull=()=>{u.read().then(function({value:d,done:u}){u?c.close():((0,_util.assert)(d instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),c.enqueue(new Uint8Array(d),1,[d]))}).catch(d=>{c.error(d)})},c.onCancel=d=>{u.cancel(d),c.ready.catch(d=>{if(!this.destroyed)throw d})}):c.close()}),d.on("GetDoc",({pdfInfo:d})=>{this._numPages=d.numPages,this._htmlForXfa=d.htmlForXfa,delete d.htmlForXfa,c._capability.resolve(new PDFDocumentProxy(d,this))}),d.on("DocException",function(d){let u;switch(d.name){case"PasswordException":u=new _util.PasswordException(d.message,d.code);break;case"InvalidPDFException":u=new _util.InvalidPDFException(d.message);break;case"MissingPDFException":u=new _util.MissingPDFException(d.message);break;case"UnexpectedResponseException":u=new _util.UnexpectedResponseException(d.message,d.status);break;case"UnknownErrorException":u=new _util.UnknownErrorException(d.message,d.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}c._capability.reject(u)}),d.on("PasswordRequest",d=>{if(this.#u=new _util.PromiseCapability,c.onPassword){let u=d=>{d instanceof Error?this.#u.reject(d):this.#u.resolve({password:d})};try{c.onPassword(u,d.code)}catch(d){this.#u.reject(d)}}else this.#u.reject(new _util.PasswordException(d.message,d.code));return this.#u.promise}),d.on("DataLoaded",d=>{c.onProgress?.({loaded:d.length,total:d.length}),this.downloadInfoCapability.resolve(d)}),d.on("StartRenderPage",d=>{this.destroyed||this.#d.get(d.pageIndex)._startRenderPage(d.transparency,d.cacheKey)}),d.on("commonobj",([c,u,p])=>{if(!this.destroyed&&!this.commonObjs.has(c))switch(u){case"Font":let g=this._params;if("error"in p){let d=p.error;(0,_util.warn)(`Error during font loading: ${d}`),this.commonObjs.resolve(c,d);break}let m=g.pdfBug&&globalThis.FontInspector?.enabled?(d,c)=>globalThis.FontInspector.fontAdded(d,c):null,f=new _font_loader.FontFaceObject(p,{isEvalSupported:g.isEvalSupported,disableFontFace:g.disableFontFace,ignoreErrors:g.ignoreErrors,inspectFont:m});this.fontLoader.bind(f).catch(u=>d.sendWithPromise("FontFallback",{id:c})).finally(()=>{!g.fontExtraProperties&&f.data&&(f.data=null),this.commonObjs.resolve(c,f)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(c,p);break;default:throw Error(`Got unknown common object type ${u}`)}}),d.on("obj",([d,c,u,p])=>{if(this.destroyed)return;let g=this.#d.get(c);if(!g.objs.has(d))switch(u){case"Image":if(g.objs.resolve(d,p),p){let d;if(p.bitmap){let{width:c,height:u}=p;d=c*u*4}else d=p.data?.length||0;d>_util.MAX_IMAGE_SIZE_TO_CACHE&&(g._maybeCleanupAfterRender=!0)}break;case"Pattern":g.objs.resolve(d,p);break;default:throw Error(`Got unknown object type ${u}`)}}),d.on("DocProgress",d=>{this.destroyed||c.onProgress?.({loaded:d.loaded,total:d.total})}),d.on("FetchBuiltInCMap",d=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(d):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),d.on("FetchStandardFontData",d=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(d):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:d,transfers:c}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:d,filename:this._fullReader?.filename??null},c).finally(()=>{this.annotationStorage.resetModified()})}getPage(d){if(!Number.isInteger(d)||d<=0||d>this._numPages)return Promise.reject(Error("Invalid page request."));let c=d-1,u=this.#c.get(c);if(u)return u;
1let p=this.messageHandler.sendWithPromise("GetPage",{pageIndex:c}).then(d=>{if(this.destroyed)throw Error("Transport destroyed");let u=new PDFPageProxy(c,d,this,this._params.pdfBug);return this.#d.set(c,u),u});return this.#c.set(c,p),p}getPageIndex(d){return"object"!=typeof d||null===d||!Number.isInteger(d.num)||d.num<0||!Number.isInteger(d.gen)||d.gen<0?Promise.reject(Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:d.num,gen:d.gen})}getAnnotations(d,c){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:d,intent:c})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(d){return"string"!=typeof d?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:d})}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)}getDocJSActions(){return this.#p("GetDocJSActions")}getPageJSActions(d){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:d})}getStructTree(d){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:d})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(d=>new _optional_content_config.OptionalContentConfig(d))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let d="GetMetadata",c=this.#h.get(d);if(c)return c;let u=this.messageHandler.sendWithPromise(d,null).then(d=>({info:d[0],metadata:d[1]?new _metadata.Metadata(d[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#h.set(d,u),u}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(d=!1){if(!this.destroyed){for(let d of(await this.messageHandler.sendWithPromise("Cleanup",null),this.#d.values()))if(!d.cleanup())throw Error(`startCleanup: Page ${d.pageNumber} is currently rendering.`);this.commonObjs.clear(),d||this.fontLoader.clear(),this.#h.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){let{disableAutoFetch:d,enableXfa:c}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:d,enableXfa:c})}}class PDFObjects{#g=Object.create(null);#m(d){return this.#g[d]||={capability:new _util.PromiseCapability,data:null}}get(d,c=null){if(c){let u=this.#m(d);return u.capability.promise.then(()=>c(u.data)),null}let u=this.#g[d];if(!u?.capability.settled)throw Error(`Requesting object that isn't resolved yet ${d}.`);return u.data}has(d){let c=this.#g[d];return c?.capability.settled||!1}resolve(d,c=null){let u=this.#m(d);u.data=c,u.capability.resolve()}clear(){for(let d in this.#g){let{data:c}=this.#g[d];c?.bitmap?.close()}this.#g=Object.create(null)}}class RenderTask{#f=null;constructor(d){this.#f=d,this.onContinue=null}get promise(){return this.#f.capability.promise}cancel(d=0){this.#f.cancel(null,d)}get separateAnnots(){let{separateAnnots:d}=this.#f.operatorList;if(!d)return!1;let{annotationCanvasMap:c}=this.#f;return d.form||d.canvas&&c?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static #b=new WeakSet;constructor({callback:d,params:c,objs:u,commonObjs:p,annotationCanvasMap:g,operatorList:m,pageIndex:f,canvasFactory:b,filterFactory:A,useRequestAnimationFrame:v=!1,pdfBug:y=!1,pageColors:_=null}){this.callback=d,this.params=c,this.objs=u,this.commonObjs=p,this.annotationCanvasMap=g,this.operatorListIdx=null,this.operatorList=m,this._pageIndex=f,this.canvasFactory=b,this.filterFactory=A,this._pdfBug=y,this.pageColors=_,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===v&&"u">typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=c.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:d=!1,optionalContentConfig:c}
1){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#b.has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#b.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:u,viewport:p,transform:g,background:m}=this.params;this.gfx=new _canvas.CanvasGraphics(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:c},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:g,viewport:p,transparency:d,background:m}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(d=null,c=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback(d||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,c))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()}_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._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}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(),InternalRenderTask.#b.delete(this._canvas),this.callback())))}}let version="3.11.174";exports.version=version;let build="ce8716743";exports.build=build},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SerializableEmpty=c.PrintAnnotationStorage=c.AnnotationStorage=void 0;var p=u(1),g=u(4),m=u(8);let f=Object.freeze({map:null,hash:"",transfers:void 0});c.SerializableEmpty=f;class b{#A=!1;#v=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(d,c){let u=this.#v.get(d);return void 0===u?c:Object.assign(c,u)}getRawValue(d){return this.#v.get(d)}remove(d){if(this.#v.delete(d),0===this.#v.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let d of this.#v.values())if(d instanceof g.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(d,c){let u=this.#v.get(d),p=!1;if(void 0!==u)for(let[d,g]of Object.entries(c))u[d]!==g&&(p=!0,u[d]=g);else p=!0,this.#v.set(d,c);p&&this.#y(),c instanceof g.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(c.constructor._type)}has(d){return this.#v.has(d)}getAll(){return this.#v.size>0?(0,p.objectFromMap)(this.#v):null}setAll(d){for(let[c,u]of Object.entries(d))this.setValue(c,u)}get size(){return this.#v.size}#y(){this.#A||(this.#A=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#A&&(this.#A=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new A(this)}get serializable(){if(0===this.#v.size)return f;let d=new Map,c=new m.MurmurHash3_64,u=[],p=Object.create(null),b=!1;for(let[u,m]of this.#v){let f=m instanceof g.AnnotationEditor?m.serialize(!1,p):m;f&&(d.set(u,f),c.update(`${u}:${JSON.stringify(f)}`),b||=!!f.bitmap)}if(b)for(let c of d.values())c.bitmap&&u.push(c.bitmap);return d.size>0?{map:d,hash:c.hexdigest(),transfers:u}:f}}c.AnnotationStorage=b;class A extends b{#_;constructor(d){super();const{map:c,hash:u,transfers:p}=d.serializable,g=structuredClone(c,p?{transfer:p}:null);this.#_={map:g,hash:u,transfers:p}}get print(){(0,p.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#_}}c.PrintAnnotationStorage=A},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AnnotationEditor=void 0;var p=u(5),g=u(1),m=u(6);class f{#S="";#x=!1;#E=null;#C=null;#T=null;#w=!1;#P=null;#M=this.focusin.bind(this);#k=this.focusout.bind(this);#F=!1;#R=!1;#I=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#D=!1;#L=f._zIndex++;static _borderLineWidth=-1;
1static _colorManager=new p.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(d){this.constructor===f&&(0,g.unreachable)("Cannot initialize AnnotationEditor."),this.parent=d.parent,this.id=d.id,this.width=this.height=null,this.pageIndex=d.parent.pageIndex,this.name=d.name,this.div=null,this._uiManager=d.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=d.isCentered,this._structTreeParentId=null;const{rotation:c,rawDims:{pageWidth:u,pageHeight:p,pageX:m,pageY:b}}=this.parent.viewport;this.rotation=c,this.pageRotation=(360+c-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[u,p],this.pageTranslation=[m,b];const[A,v]=this.parentDimensions;this.x=d.x/A,this.y=d.y/v,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,g.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(d){let c=new b({id:d.parent.getNextId(),parent:d.parent,uiManager:d._uiManager});c.annotationElementId=d.annotationElementId,c.deleted=!0,c._uiManager.addToAnnotationStorage(c)}static initialize(d,c=null){if(f._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(c=>[c,d.get(c)])),c?.strings)for(let u of c.strings)f._l10nPromise.set(u,d.get(u));if(-1!==f._borderLineWidth)return;let u=getComputedStyle(document.documentElement);f._borderLineWidth=parseFloat(u.getPropertyValue("--outline-width"))||0}static updateDefaultParams(d,c){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(d){return!1}static paste(d,c){(0,g.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#D}set _isDraggable(d){this.#D=d,this.div?.classList.toggle("draggable",d)}center(){let[d,c]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*c/(2*d),this.y+=this.width*d/(2*c);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*c/(2*d),this.y-=this.width*d/(2*c);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(d){this._uiManager.addCommands(d)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#L}setParent(d){null!==d&&(this.pageIndex=d.pageIndex,this.pageDimensions=d.pageDimensions),this.parent=d}focusin(d){this._focusEventsAllowed&&(this.#F?this.#F=!1:this.parent.setSelected(this))}focusout(d){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let c=d.relatedTarget;!c?.closest(`#${this.id}`)&&(d.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(d,c,u,p){let[g,m]=this.parentDimensions;[u,p]=this.screenToPageTranslation(u,p),this.x=(d+u)/g,this.y=(c+p)/m,this.fixAndSetPosition()}#O([d,c],u,p){[u,p]=this.screenToPageTranslation(u,p),this.x+=u/d,this.y+=p/c,this.fixAndSetPosition()}translate(d,c){this.#O(this.parentDimensions,d,c)}translateInPage(d,c){this.#O(this.pageDimensions,d,c),this.div.scrollIntoView({block:"nearest"})}drag(d,c){let[u,p]=this.parentDimensions;if(this.x+=d/u,this.y+=c/p,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:d,y:c}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,c)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:g,y:m}=this,[f,b]=this.#N();g+=f,m+=b,this.div.style.left=`${(100*g).toFixed(2)}%`,this.div.style.top=`${(100*m).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}#N(){let[d,c]=this.parentDimensions,{_borderLineWidth:u}=f,p=u/d,g=u/c;switch(this.rotation){case 90:return[-p,g];case 180:return[p,g];case 270:return[p,-g];default:return[-p,-g]}}fixAndSetPosition(){let[d,c]=this.pageDimensions,{x:u,y:p,width:g,height:m}=this;switch(g*=d,m*=c,u*=d,p*=c,this.rotation){case 0:u=Math.max(0,Math.min(d-g,u)),p=Math.max(0,Math.min(c-m,p));break;
1case 90:u=Math.max(0,Math.min(d-m,u)),p=Math.min(c,Math.max(g,p));break;case 180:u=Math.min(d,Math.max(g,u)),p=Math.min(c,Math.max(m,p));break;case 270:u=Math.min(d,Math.max(m,u)),p=Math.max(0,Math.min(c-g,p))}this.x=u/=d,this.y=p/=c;let[f,b]=this.#N();u+=f,p+=b;let{style:A}=this.div;A.left=`${(100*u).toFixed(2)}%`,A.top=`${(100*p).toFixed(2)}%`,this.moveInDOM()}static #B(d,c,u){switch(u){case 90:return[c,-d];case 180:return[-d,-c];case 270:return[-c,d];default:return[d,c]}}screenToPageTranslation(d,c){return f.#B(d,c,this.parentRotation)}pageTranslationToScreen(d,c){return f.#B(d,c,360-this.parentRotation)}#U(d){switch(d){case 90:{let[d,c]=this.pageDimensions;return[0,-d/c,c/d,0]}case 180:return[-1,0,0,-1];case 270:{let[d,c]=this.pageDimensions;return[0,d/c,-c/d,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:d,pageDimensions:[c,u]}=this,p=c*d,m=u*d;return g.FeatureTest.isCSSRoundSupported?[Math.round(p),Math.round(m)]:[p,m]}setDims(d,c){let[u,p]=this.parentDimensions;this.div.style.width=`${(100*d/u).toFixed(2)}%`,this.#w||(this.div.style.height=`${(100*c/p).toFixed(2)}%`),this.#E?.classList.toggle("small",d<f.SMALL_EDITOR_SIZE||c<f.SMALL_EDITOR_SIZE)}fixDims(){let{style:d}=this.div,{height:c,width:u}=d,p=u.endsWith("%"),g=!this.#w&&c.endsWith("%");if(p&&g)return;let[m,f]=this.parentDimensions;p||(d.width=`${(100*parseFloat(u)/m).toFixed(2)}%`),this.#w||g||(d.height=`${(100*parseFloat(c)/f).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#j(){if(this.#P)return;this.#P=document.createElement("div"),this.#P.classList.add("resizers");let d=["topLeft","topRight","bottomRight","bottomLeft"];for(let c of(this._willKeepAspectRatio||d.push("topMiddle","middleRight","bottomMiddle","middleLeft"),d)){let d=document.createElement("div");this.#P.append(d),d.classList.add("resizer",c),d.addEventListener("pointerdown",this.#z.bind(this,c)),d.addEventListener("contextmenu",m.noContextMenu)}this.div.prepend(this.#P)}#z(d,c){c.preventDefault();let{isMac:u}=g.FeatureTest.platform;if(0!==c.button||c.ctrlKey&&u)return;let p=this.#H.bind(this,d),m=this._isDraggable;this._isDraggable=!1;let f={passive:!0,capture:!0};window.addEventListener("pointermove",p,f);let b=this.x,A=this.y,v=this.width,y=this.height,_=this.parent.div.style.cursor,S=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(c.target).cursor;let x=()=>{this._isDraggable=m,window.removeEventListener("pointerup",x),window.removeEventListener("blur",x),window.removeEventListener("pointermove",p,f),this.parent.div.style.cursor=_,this.div.style.cursor=S;let d=this.x,c=this.y,u=this.width,g=this.height;(d!==b||c!==A||u!==v||g!==y)&&this.addCommands({cmd:()=>{this.width=u,this.height=g,this.x=d,this.y=c;let[p,m]=this.parentDimensions;this.setDims(p*u,m*g),this.fixAndSetPosition()},undo:()=>{this.width=v,this.height=y,this.x=b,this.y=A;let[d,c]=this.parentDimensions;this.setDims(d*v,c*y),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",x),window.addEventListener("blur",x)}#H(d,c){let u,p,[g,m]=this.parentDimensions,b=this.x,A=this.y,v=this.width,y=this.height,_=f.MIN_SIZE/g,S=f.MIN_SIZE/m,x=d=>Math.round(1e4*d)/1e4,E=this.#U(this.rotation),C=(d,c)=>[E[0]*d+E[2]*c,E[1]*d+E[3]*c],T=this.#U(360-this.rotation),w=(d,c)=>[T[0]*d+T[2]*c,T[1]*d+T[3]*c],P=!1,M=!1;switch(d){case"topLeft":P=!0,u=(d,c)=>[0,0],p=(d,c)=>[d,c];break;case"topMiddle":u=(d,c)=>[d/2,0],p=(d,c)=>[d/2,c];break;case"topRight":P=!0,u=(d,c)=>[d,0],p=(d,c)=>[0,c];break;case"middleRight":M=!0,u=(d,c)=>[d,c/2],p=(d,c)=>[0,c/2];break;case"bottomRight":P=!0,u=(d,c)=>[d,c],p=(d,c)=>[0,0];break;case"bottomMiddle":u=(d,c)=>[d/2,c],p=(d,c)=>[d/2,0];break;case"bottomLeft":P=!0,u=(d,c)=>[0,c],p=(d,c)=>[d,0];break;case"middleLeft":M=!0,u=(d,c)=>[0,c/2],p=(d,c)=>[d,c/2]}let k=u(v,y),F=p(v,y),R=C(...F),I=x(b+R[0]),D=x(A+R[1]),L=1,O=1,[N,B]=this.screenToPageTranslation(c.movementX,c.movementY);if([N,B]=w(N/g,B/m),P){let d=Math.hypot(v,y);L=O=Math.max(Math.min(Math.hypot(F[0]-k[0]-N,F[1]-k[1]-B)/d,1/v,1/y),_/v,S/y)}else M?L=Math.max(_,Math.min(1,Math.abs(F[0]-k[0]-N)))/v:O=Math.max(S,Math.min(1,Math.abs(F[
11]-k[1]-B)))/y;let U=x(v*L),j=x(y*O),z=I-(R=C(...p(U,j)))[0],H=D-R[1];this.width=U,this.height=j,this.x=z,this.y=H,this.setDims(g*U,m*j),this.fixAndSetPosition()}async addAltTextButton(){if(this.#E)return;let d=this.#E=document.createElement("button");d.className="altText";let c=await f._l10nPromise.get("editor_alt_text_button_label");if(d.textContent=c,d.setAttribute("aria-label",c),d.tabIndex="0",d.addEventListener("contextmenu",m.noContextMenu),d.addEventListener("pointerdown",d=>d.stopPropagation()),d.addEventListener("click",d=>{d.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),d.addEventListener("keydown",c=>{c.target===d&&"Enter"===c.key&&(c.preventDefault(),this._uiManager.editAltText(this))}),this.#G(),this.div.append(d),!f.SMALL_EDITOR_SIZE){let c=40;f.SMALL_EDITOR_SIZE=Math.min(128,Math.round(d.getBoundingClientRect().width*(1+c/100)))}}async #G(){let d=this.#E;if(!d)return;if(!this.#S&&!this.#x){d.classList.remove("done"),this.#C?.remove();return}f._l10nPromise.get("editor_alt_text_edit_button_label").then(c=>{d.setAttribute("aria-label",c)});let c=this.#C;if(!c){this.#C=c=document.createElement("span"),c.className="tooltip",c.setAttribute("role","tooltip");let u=c.id=`alt-text-tooltip-${this.id}`;d.setAttribute("aria-describedby",u);let p=100;d.addEventListener("mouseenter",()=>{this.#T=setTimeout(()=>{this.#T=null,this.#C.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},p)}),d.addEventListener("mouseleave",()=>{clearTimeout(this.#T),this.#T=null,this.#C?.classList.remove("show")})}d.classList.add("done"),c.innerText=this.#x?await f._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,c.parentNode||d.append(c)}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#x}}set altTextData({altText:d,decorative:c}
1){(this.#S!==d||this.#x!==c)&&(this.#S=d,this.#x=c,this.#G())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#M),this.div.addEventListener("focusout",this.#k);let[d,c]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*c/d).toFixed(2)}%`,this.div.style.maxHeight=`${(100*d/c).toFixed(2)}%`);let[u,g]=this.getInitialTranslation();return this.translate(u,g),(0,p.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(d){let{isMac:c}=g.FeatureTest.platform;0!==d.button||d.ctrlKey&&c?d.preventDefault():(this.#F=!0,this.#$(d))}#$(d){let c,u;if(!this._isDraggable)return;let p=this._uiManager.isSelected(this);this._uiManager.setUpDragSession(),p&&(c={passive:!0,capture:!0},u=d=>{let[c,u]=this.screenToPageTranslation(d.movementX,d.movementY);this._uiManager.dragSelectedEditors(c,u)},window.addEventListener("pointermove",u,c));let m=()=>{if(window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),p&&window.removeEventListener("pointermove",u,c),this.#F=!1,!this._uiManager.endDragSession()){let{isMac:c}=g.FeatureTest.platform;d.ctrlKey&&!c||d.shiftKey||d.metaKey&&c?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",m),window.addEventListener("blur",m)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(d,c,u){d.changeParent(this),this.x=c,this.y=u,this.fixAndSetPosition()}getRect(d,c){let u=this.parentScale,[p,g]=this.pageDimensions,[m,f]=this.pageTranslation,b=d/u,A=c/u,v=this.x*p,y=this.y*g,_=this.width*p,S=this.height*g;switch(this.rotation){case 0:return[v+b+m,g-y-A-S+f,v+b+_+m,g-y-A+f];case 90:return[v+A+m,g-y+b+f,v+A+S+m,g-y+b+_+f];case 180:return[v-b-_+m,g-y+A+f,v-b+m,g-y+A+S+f];case 270:return[v-A-S+m,g-y-b-_+f,v-A+m,g-y-b+f];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(d,c){let[u,p,g,m]=d,f=g-u,b=m-p;switch(this.rotation){case 0:return[u,c-m,f,b];case 90:return[u,c-p,b,f];case 180:return[g,c-p,f,b];case 270:return[g,c-m,b,f];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#I=!0}disableEditMode(){this.#I=!1}isInEditMode(){return this.#I}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#M),this.div?.addEventListener("focusout",this.#k)}serialize(d=!1,c=null){(0,g.unreachable)("An editor must be serializable")}static deserialize(d,c,u){let p=new this.prototype.constructor({parent:c,id:c.getNextId(),uiManager:u});p.rotation=d.rotation;let[g,m]=p.pageDimensions,[f,b,A,v]=p.getRectInCurrentCoords(d.rect,m);return p.x=f/g,p.y=b/m,p.width=A/g,p.height=v/m,p}remove(){this.div.removeEventListener("focusin",this.#M),this.div.removeEventListener("focusout",this.#k),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#E?.remove(),this.#E=null,this.#C=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#j(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(d,c){}disableEditing(){this.#E&&(this.#E.hidden=!0)}enableEditing(){this.#E&&(this.#E.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#R}set isEditing(d){this.#R=d,this.parent&&(d?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(d,c){this.#w=!0;let u=d/c,{style:p}=this.div;p.aspectRatio=u,p.height="auto"}static get MIN_SIZE(){return 16}}c.AnnotationEditor=f;class b extends f{constructor(d){super(d),this.annotationElementId=d.annotationElementId,this.deleted=!0}
1serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.KeyboardManager=c.CommandManager=c.ColorManager=c.AnnotationEditorUIManager=void 0,c.bindEvents=m,c.opacityToHex=f;var p=u(1),g=u(6);function m(d,c,u){for(let p of u)c.addEventListener(p,d[p].bind(d))}function f(d){return Math.round(Math.min(255,Math.max(1,255*d))).toString(16).padStart(2,"0")}class b{#W=0;getId(){return`${p.AnnotationEditorPrefix}${this.#W++}`}}class A{#V=(0,p.getUuid)();#W=0;#q=null;static get _isSVGFittingCanvas(){let d='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',c=new OffscreenCanvas(1,3).getContext("2d"),u=new Image;u.src=d;let g=u.decode().then(()=>(c.drawImage(u,0,0,1,1,0,0,1,3),0===new Uint32Array(c.getImageData(0,0,1,1).data.buffer)[0]));return(0,p.shadow)(this,"_isSVGFittingCanvas",g)}async #X(d,c){this.#q||=new Map;let u=this.#q.get(d);if(null===u)return null;if(u?.bitmap)return u.refCounter+=1,u;try{let d;if(u||={bitmap:null,id:`image_${this.#V}_${this.#W++}`,refCounter:0,isSvg:!1},"string"==typeof c){u.url=c;let p=await fetch(c);if(!p.ok)throw Error(p.statusText);d=await p.blob()}else d=u.file=c;if("image/svg+xml"===d.type){let c=A._isSVGFittingCanvas,p=new FileReader,g=new Image,m=new Promise((d,m)=>{g.onload=()=>{u.bitmap=g,u.isSvg=!0,d()},p.onload=async()=>{let d=u.svgUrl=p.result;g.src=await c?`${d}#svgView(preserveAspectRatio(none))`:d},g.onerror=p.onerror=m});p.readAsDataURL(d),await m}else u.bitmap=await createImageBitmap(d);u.refCounter=1}catch(d){console.error(d),u=null}return this.#q.set(d,u),u&&this.#q.set(u.id,u),u}async getFromFile(d){let{lastModified:c,name:u,size:p,type:g}=d;return this.#X(`${c}_${u}_${p}_${g}`,d)}async getFromUrl(d){return this.#X(d,d)}async getFromId(d){this.#q||=new Map;let c=this.#q.get(d);return c?c.bitmap?(c.refCounter+=1,c):c.file?this.getFromFile(c.file):this.getFromUrl(c.url):null}getSvgUrl(d){let c=this.#q.get(d);return c?.isSvg?c.svgUrl:null}deleteId(d){this.#q||=new Map;let c=this.#q.get(d);c&&(c.refCounter-=1,0===c.refCounter&&(c.bitmap=null))}isValidId(d){return d.startsWith(`image_${this.#V}_`)}}class v{#K=[];#Y=!1;#J;#Q=-1;constructor(d=128){this.#J=d}add({cmd:d,undo:c,mustExec:u,type:p=NaN,overwriteIfSameType:g=!1,keepUndo:m=!1}){if(u&&d(),this.#Y)return;let f={cmd:d,undo:c,type:p};if(-1===this.#Q){this.#K.length>0&&(this.#K.length=0),this.#Q=0,this.#K.push(f);return}if(g&&this.#K[this.#Q].type===p){m&&(f.undo=this.#K[this.#Q].undo),this.#K[this.#Q]=f;return}let b=this.#Q+1;b===this.#J?this.#K.splice(0,1):(this.#Q=b,b<this.#K.length&&this.#K.splice(b)),this.#K.push(f)}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,this.#Q-=1)}redo(){this.#Q<this.#K.length-1&&(this.#Q+=1,this.#Y=!0,this.#K[this.#Q].cmd(),this.#Y=!1)}hasSomethingToUndo(){return -1!==this.#Q}hasSomethingToRedo(){return this.#Q<this.#K.length-1}destroy(){this.#K=null}}c.CommandManager=v;class y{constructor(d){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:c}=p.FeatureTest.platform;for(const[u,p,g={}]of d)for(const d of u){const u=d.startsWith("mac+");c&&u?(this.callbacks.set(d.slice(4),{callback:p,options:g}),this.allKeys.add(d.split("+").at(-1))):c||u||(this.callbacks.set(d,{callback:p,options:g}),this.allKeys.add(d.split("+").at(-1)))}}#Z(d){d.altKey&&this.buffer.push("alt"),d.ctrlKey&&this.buffer.push("ctrl"),d.metaKey&&this.buffer.push("meta"),d.shiftKey&&this.buffer.push("shift"),this.buffer.push(d.key);let c=this.buffer.join("+");return this.buffer.length=0,c}exec(d,c){if(!this.allKeys.has(c.key))return;let u=this.callbacks.get(this.#Z(c));if(!u)return;let{callback:p,options:{bubbles:g=!1,args:m=[],checker:f=null}}=u;(!f||f(d,c))&&(p.bind(d,...m)(),g||(c.stopPropagation(),c.preventDefault()))}}c.KeyboardManager=y;class _{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let d=new Map([["CanvasText",null],["Canvas",null]]);return(0,g.getColorValues)(d),(0,p.shadow)(this,"_colors",d)}convert(d){let c=(0,g.getRGB)(d);if(!window.matchMedia("(forced-colors: active)").matches)return c;for(let[d,u]of this._colors)if(u.every((d,u)=>d===c[u]))return _._colorsMapping.get(d);return c}getHexCode(d){let c=this._colors.get(d);return c?p.Util.makeHexColor(...c):d}}c.ColorManager=_;
1class S{#tt=null;#te=new Map;#ti=new Map;#ts=null;#tr=null;#ta=new v;#tn=0;#to=new Set;#tl=null;#th=null;#td=new Set;#tc=null;#tu=new b;#tp=!1;#tg=!1;#tm=null;#tf=p.AnnotationEditorType.NONE;#tb=new Set;#tA=null;#tv=this.blur.bind(this);#ty=this.focus.bind(this);#t_=this.copy.bind(this);#tS=this.cut.bind(this);#tx=this.paste.bind(this);#tE=this.keydown.bind(this);#tC=this.onEditingAction.bind(this);#tT=this.onPageChanging.bind(this);#tw=this.onScaleChanging.bind(this);#tP=this.onRotationChanging.bind(this);#tM={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#tk=[0,0];#tF=null;#tR=null;#tI=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let d=S.prototype,c=d=>{let{activeElement:c}=document;return c&&d.#tR.contains(c)&&d.hasSomethingToControl()},u=this.TRANSLATE_SMALL,g=this.TRANSLATE_BIG;return(0,p.shadow)(this,"_keyboardManager",new y([[["ctrl+a","mac+meta+a"],d.selectAll],[["ctrl+z","mac+meta+z"],d.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],d.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],d.delete],[["Escape","mac+Escape"],d.unselectAll],[["ArrowLeft","mac+ArrowLeft"],d.translateSelectedEditors,{args:[-u,0],checker:c}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],d.translateSelectedEditors,{args:[-g,0],checker:c}],[["ArrowRight","mac+ArrowRight"],d.translateSelectedEditors,{args:[u,0],checker:c}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],d.translateSelectedEditors,{args:[g,0],checker:c}],[["ArrowUp","mac+ArrowUp"],d.translateSelectedEditors,{args:[0,-u],checker:c}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],d.translateSelectedEditors,{args:[0,-g],checker:c}],[["ArrowDown","mac+ArrowDown"],d.translateSelectedEditors,{args:[0,u],checker:c}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],d.translateSelectedEditors,{args:[0,g],checker:c}]]))}constructor(d,c,u,p,m,f){this.#tR=d,this.#tI=c,this.#ts=u,this._eventBus=p,this._eventBus._on("editingaction",this.#tC),this._eventBus._on("pagechanging",this.#tT),this._eventBus._on("scalechanging",this.#tw),this._eventBus._on("rotationchanging",this.#tP),this.#tr=m.annotationStorage,this.#tc=m.filterFactory,this.#tA=f,this.viewParameters={realScale:g.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){for(let d of(this.#tD(),this.#tL(),this._eventBus._off("editingaction",this.#tC),this._eventBus._off("pagechanging",this.#tT),this._eventBus._off("scalechanging",this.#tw),this._eventBus._off("rotationchanging",this.#tP),this.#ti.values()))d.destroy();this.#ti.clear(),this.#te.clear(),this.#td.clear(),this.#tt=null,this.#tb.clear(),this.#ta.destroy(),this.#ts.destroy()}get hcmFilter(){return(0,p.shadow)(this,"hcmFilter",this.#tA?this.#tc.addHCMFilter(this.#tA.foreground,this.#tA.background):"none")}get direction(){return(0,p.shadow)(this,"direction",getComputedStyle(this.#tR).direction)}editAltText(d){this.#ts?.editAltText(this,d)}onPageChanging({pageNumber:d}){this.#tn=d-1}focusMainContainer(){this.#tR.focus()}findParent(d,c){for(let u of this.#ti.values()){let{x:p,y:g,width:m,height:f}=u.div.getBoundingClientRect();if(d>=p&&d<=p+m&&c>=g&&c<=g+f)return u}return null}disableUserSelect(d=!1){this.#tI.classList.toggle("noUserSelect",d)}addShouldRescale(d){this.#td.add(d)}removeShouldRescale(d){this.#td.delete(d)}onScaleChanging({scale:d}){for(let c of(this.commitOrRemove(),this.viewParameters.realScale=d*g.PixelsPerInch.PDF_TO_CSS_UNITS,this.#td))c.onScaleChanging()}onRotationChanging({pagesRotation:d}){this.commitOrRemove(),this.viewParameters.rotation=d}addToAnnotationStorage(d){d.isEmpty()||!this.#tr||this.#tr.has(d.id)||this.#tr.setValue(d.id,d)}#tO(){window.addEventListener("focus",this.#ty),window.addEventListener("blur",this.#tv)}#tL(){window.removeEventListener("focus",this.#ty),window.removeEventListener("blur",this.#tv)}blur(){if(!this.hasSelection)return;let{activeElement:d}=document;for(let c of this.#tb)if(c.div.contains(d)){this.#tm=[c,d],c._focusEventsAllowed=!1;break}}focus(){if(!this.#tm)return;let[d,c]=this.#tm;this.#tm=null,c.addEventListener("focusin",()=>{d._focusEventsAllowed=!0},{once:!0}),c.focus()}#tN(){window.addEventListener("keydown",this.#tE,{capture:!0})}#tD(){window.removeEventListener("keydown",this.#tE,{capture:!0})}#tB(){document.addEventListener("copy",this.#t_),document.addEventListener("cut",this.#tS),document.addEventListener("paste",this.#tx)}#tU(){document.removeEventListener("copy",this.#t_),document.removeEventListener("cut",this.#tS),document.removeEventListener("paste",this.#tx)}addEditListeners(){this.#tN(),this.#tB()}removeEditListeners(){this.#tD(),this.#tU()}copy(d){if(d.preventDefault(),this.#tt?.commitOrRemove(),!this.hasSelection)return;let c=[];for(let d of this.#tb){let u=d.serialize(!0);u&&c.push(u)}0!==c.length&&d.clipboardData.setData("application/pdfjs",JSON.stringify(c))}cut(d){this.copy(d),this.delete()}paste(d){d.preventDefault();let{clipboardData:c}=d;for(let d of c.items)for(let c of this.#th)if(c.isHandlingMimeForPasting(d.type))return void c.paste(d,this.currentLayer);let u=c.getData("application/pdfjs");if(!u)return;try{u=JSON.parse(u)}catch(d){(0,p.warn)(`paste: "${d.message}".`);return}if(!Array.isArray(u))return;this.unselectAll();let g=this.currentLayer;try{let d=[];for(let c of u){let u=g.deserialize(c);if(!u)return;d.push(u)}let c=()=>{for(let c of d)this.#tj(c);this.#tz(d)},p=()=>{for(let c of d)c.remove()};this.addCommands({cmd:c,undo:p,mustExec:!0})}catch(d){(0,p.warn)(`paste: "${d.message}".`)}}keydown(d){this.getActive()?.shouldGetKeyboardEvents()||S._keyboardManager.exec(this,d)}onEditingAction(d){["undo","redo","delete","selectAll"].includes(d.name)&&this[d.name]()}#tH(d){Object.entries(d).some(([d,c])=>this.#tM[d]!==c)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#tM,d)})}#tG(d){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:d})}setEditingState(d){d?(this.#tO(),this.#tN(),this.#tB(),this.#tH({isEditing:this.#tf!==p.AnnotationEditorType.NONE,isEmpty:this.#t$(),hasSomethingToUndo:this.#ta.hasSomethingToUndo(),hasSomethingToRedo:this.#ta.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#tL(),this.#tD(),this.#tU(),this.#tH({isEditing:!1}),this.disableUserSelect(!1))}
1registerEditorTypes(d){if(!this.#th)for(let c of(this.#th=d,this.#th))this.#tG(c.defaultPropertiesToUpdate)}getId(){return this.#tu.getId()}get currentLayer(){return this.#ti.get(this.#tn)}getLayer(d){return this.#ti.get(d)}get currentPageIndex(){return this.#tn}addLayer(d){this.#ti.set(d.pageIndex,d),this.#tp?d.enable():d.disable()}removeLayer(d){this.#ti.delete(d.pageIndex)}updateMode(d,c=null){if(this.#tf!==d){if(this.#tf=d,d===p.AnnotationEditorType.NONE){this.setEditingState(!1),this.#tW();return}for(let c of(this.setEditingState(!0),this.#tV(),this.unselectAll(),this.#ti.values()))c.updateMode(d);if(c){for(let d of this.#te.values())if(d.annotationElementId===c){this.setSelected(d),d.enterInEditMode();break}}}}updateToolbar(d){d!==this.#tf&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:d})}updateParams(d,c){if(this.#th){if(d===p.AnnotationEditorParamsType.CREATE)return void this.currentLayer.addNewEditor(d);for(let u of this.#tb)u.updateParams(d,c);for(let u of this.#th)u.updateDefaultParams(d,c)}}enableWaiting(d=!1){if(this.#tg!==d)for(let c of(this.#tg=d,this.#ti.values()))d?c.disableClick():c.enableClick(),c.div.classList.toggle("waiting",d)}#tV(){if(!this.#tp)for(let d of(this.#tp=!0,this.#ti.values()))d.enable()}#tW(){if(this.unselectAll(),this.#tp)for(let d of(this.#tp=!1,this.#ti.values()))d.disable()}getEditors(d){let c=[];for(let u of this.#te.values())u.pageIndex===d&&c.push(u);return c}getEditor(d){return this.#te.get(d)}addEditor(d){this.#te.set(d.id,d)}removeEditor(d){this.#te.delete(d.id),this.unselect(d),d.annotationElementId&&this.#to.has(d.annotationElementId)||this.#tr?.remove(d.id)}addDeletedAnnotationElement(d){this.#to.add(d.annotationElementId),d.deleted=!0}isDeletedAnnotationElement(d){return this.#to.has(d)}removeDeletedAnnotationElement(d){this.#to.delete(d.annotationElementId),d.deleted=!1}#tj(d){let c=this.#ti.get(d.pageIndex);c?c.addOrRebuild(d):this.addEditor(d)}setActiveEditor(d){this.#tt!==d&&(this.#tt=d,d&&this.#tG(d.propertiesToUpdate))}toggleSelected(d){if(this.#tb.has(d)){this.#tb.delete(d),d.unselect(),this.#tH({hasSelectedEditor:this.hasSelection});return}this.#tb.add(d),d.select(),this.#tG(d.propertiesToUpdate),this.#tH({hasSelectedEditor:!0})}setSelected(d){for(let c of this.#tb)c!==d&&c.unselect();this.#tb.clear(),this.#tb.add(d),d.select(),this.#tG(d.propertiesToUpdate),this.#tH({hasSelectedEditor:!0})}isSelected(d){return this.#tb.has(d)}unselect(d){d.unselect(),this.#tb.delete(d),this.#tH({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#tb.size}undo(){this.#ta.undo(),this.#tH({hasSomethingToUndo:this.#ta.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#t$()})}redo(){this.#ta.redo(),this.#tH({hasSomethingToUndo:!0,hasSomethingToRedo:this.#ta.hasSomethingToRedo(),isEmpty:this.#t$()})}addCommands(d){this.#ta.add(d),this.#tH({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#t$()})}#t$(){if(0===this.#te.size)return!0;if(1===this.#te.size)for(let d of this.#te.values())return d.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let d=[...this.#tb],c=()=>{for(let c of d)c.remove()},u=()=>{for(let c of d)this.#tj(c)};this.addCommands({cmd:c,undo:u,mustExec:!0})}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#tz(d){for(let c of(this.#tb.clear(),d))c.isEmpty()||(this.#tb.add(c),c.select());this.#tH({hasSelectedEditor:!0})}selectAll(){for(let d of this.#tb)d.commit();this.#tz(this.#te.values())}unselectAll(){if(this.#tt)return void this.#tt.commitOrRemove();if(this.hasSelection){for(let d of this.#tb)d.unselect();this.#tb.clear(),this.#tH({hasSelectedEditor:!1})}}translateSelectedEditors(d,c,u=!1){if(u||this.commitOrRemove(),!this.hasSelection)return;this.#tk[0]+=d,this.#tk[1]+=c;let[p,g]=this.#tk,m=[...this.#tb],f=1e3;for(let u of(this.#tF&&clearTimeout(this.#tF),this.#tF=setTimeout(()=>{this.#tF=null,this.#tk[0]=this.#tk[1]=0,this.addCommands({cmd:()=>{for(let d of m)this.#te.has(d.id)&&d.translateInPage(p,g)},undo:()=>{for(let d of m)this.#te.has(d.id)&&d.translateInPage(-p,-g)},mustExec:!1})},f),m))u.translateInPage(d,c)}setUpDragSession(){if(this.hasSelection)for(let d of(this.disableUserSelect(!0),this.#tl=new Map,this.#tb))this.#tl.set(d,{savedX:d.x,savedY:d.y,savedPageIndex:d.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#tl)return!1;this.disableUserSelect(!1);let d=this.#tl;this.#tl=null;
1let c=!1;for(let[{x:u,y:p,pageIndex:g},m]of d)m.newX=u,m.newY=p,m.newPageIndex=g,c||=u!==m.savedX||p!==m.savedY||g!==m.savedPageIndex;if(!c)return!1;let u=(d,c,u,p)=>{if(this.#te.has(d.id)){let g=this.#ti.get(p);g?d._setParentAndPosition(g,c,u):(d.pageIndex=p,d.x=c,d.y=u)}};return this.addCommands({cmd:()=>{for(let[c,{newX:p,newY:g,newPageIndex:m}]of d)u(c,p,g,m)},undo:()=>{for(let[c,{savedX:p,savedY:g,savedPageIndex:m}]of d)u(c,p,g,m)},mustExec:!0}),!0}dragSelectedEditors(d,c){if(this.#tl)for(let u of this.#tl.keys())u.drag(d,c)}rebuild(d){if(null===d.parent){let c=this.getLayer(d.pageIndex);c?(c.changeParent(d),c.addOrRebuild(d)):(this.addEditor(d),this.addToAnnotationStorage(d),d.rebuild())}else d.parent.addOrRebuild(d)}isActive(d){return this.#tt===d}getActive(){return this.#tt}getMode(){return this.#tf}get imageManager(){return(0,p.shadow)(this,"imageManager",new A)}}c.AnnotationEditorUIManager=S},(d,c,u)=>{let p;Object.defineProperty(c,"__esModule",{value:!0}),c.StatTimer=c.RenderingCancelledException=c.PixelsPerInch=c.PageViewport=c.PDFDateString=c.DOMStandardFontDataFactory=c.DOMSVGFactory=c.DOMFilterFactory=c.DOMCanvasFactory=c.DOMCMapReaderFactory=void 0,c.deprecated=D,c.getColorValues=B,c.getCurrentTransform=U,c.getCurrentTransformInverse=j,c.getFilenameFromUrl=P,c.getPdfFilenameFromUrl=M,c.getRGB=N,c.getXfaPageViewport=O,c.isDataScheme=T,c.isPdfFile=w,c.isValidFetchUrl=F,c.loadScript=I,c.noContextMenu=R,c.setLayerDimensions=z;var g=u(7),m=u(1);let f="http://www.w3.org/2000/svg";class b{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}c.PixelsPerInch=b;class A extends g.BaseFilterFactory{#tq;#tX;#e;#tK;#tY;#tJ;#tQ;#tZ;#t0;#t1;#W=0;constructor({docId:d,ownerDocument:c=globalThis.document}={}){super(),this.#e=d,this.#tK=c}get #q(){return this.#tq||=new Map}get #t2(){if(!this.#tX){let d=this.#tK.createElement("div"),{style:c}=d;c.visibility="hidden",c.contain="strict",c.width=c.height=0,c.position="absolute",c.top=c.left
1=0,c.zIndex=-1;let u=this.#tK.createElementNS(f,"svg");u.setAttribute("width",0),u.setAttribute("height",0),this.#tX=this.#tK.createElementNS(f,"defs"),d.append(u),u.append(this.#tX),this.#tK.body.append(d)}return this.#tX}addFilter(d){let c,u,p,g;if(!d)return"none";let m=this.#q.get(d);if(m)return m;if(1===d.length){let m=d[0],f=Array(256);for(let d=0;d<256;d++)f[d]=m[d]/255;g=c=u=p=f.join(",")}else{let[m,f,b]=d,A=Array(256),v=Array(256),y=Array(256);for(let d=0;d<256;d++)A[d]=m[d]/255,v[d]=f[d]/255,y[d]=b[d]/255;c=A.join(","),u=v.join(","),p=y.join(","),g=`${c}${u}${p}`}if(m=this.#q.get(g))return this.#q.set(d,m),m;let f=`g_${this.#e}_transfer_map_${this.#W++}`,b=`url(#${f})`;this.#q.set(d,b),this.#q.set(g,b);let A=this.#t3(f);return this.#t5(c,u,p,A),b}addHCMFilter(d,c){let u=`${d}-${c}`;if(this.#tJ===u||(this.#tJ=u,this.#tQ="none",this.#tY?.remove(),!d||!c))return this.#tQ;let p=this.#t8(d);d=m.Util.makeHexColor(...p);let g=this.#t8(c);if(c=m.Util.makeHexColor(...g),this.#t2.style.color="","#000000"===d&&"#ffffff"===c||d===c)return this.#tQ;let f=Array(256);for(let d=0;d<=255;d++){let c=d/255;f[d]=c<=.03928?c/12.92:((c+.055)/1.055)**2.4}let b=f.join(","),A=`g_${this.#e}_hcm_filter`,v=this.#tZ=this.#t3(A);this.#t5(b,b,b,v),this.#t4(v);let y=(d,c)=>{let u=p[d]/255,m=g[d]/255,f=Array(c+1);for(let d=0;d<=c;d++)f[d]=u+d/c*(m-u);return f.join(",")};return this.#t5(y(0,5),y(1,5),y(2,5),v),this.#tQ=`url(#${A})`,this.#tQ}addHighlightHCMFilter(d,c,u,p){let g=`${d}-${c}-${u}-${p}`;if(this.#t0===g||(this.#t0=g,this.#t1="none",this.#tZ?.remove(),!d||!c))return this.#t1;let[m,f]=[d,c].map(this.#t8.bind(this)),b=Math.round(.2126*m[0]+.7152*m[1]+.0722*m[2]),A=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[v,y]=[u,p].map(this.#t8.bind(this));A<b&&([b,A,v,y]=[A,b,y,v]),this.#t2.style.color="";let _=(d,c,u)=>{let p=Array(256),g=(A-b)/u,m=d/255,f=(c-d)/(255*u),v=0;for(let d=0;d<=u;d++){let c=Math.round(b+d*g),u=m+d*f;for(let d=v;d<=c;d++)p[d]=u;v=c+1}for(let d=v;d<256;d++)p[d]=p[v-1];return p.join(",")},S=`g_${this.#e}_hcm_highlight_filter`,x=this.#tZ=this.#t3(S);return this.#t4(x),this.#t5(_(v[0],y[0],5),_(v[1],y[1],5),_(v[2],y[2],5),x),this.#t1=`url(#${S})`,this.#t1}destroy(d=!1){d&&(this.#tQ||this.#t1)||(this.#tX&&(this.#tX.parentNode.parentNode.remove(),this.#tX=null),this.#tq&&(this.#tq.clear(),this.#tq=null),this.#W=0)}#t4(d){let c=this.#tK.createElementNS(f,"feColorMatrix");c.setAttribute("type","matrix"),c.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),d.append(c)}#t3(d){let c=this.#tK.createElementNS(f,"filter");return c.setAttribute("color-interpolation-filters","sRGB"),c.setAttribute("id",d),this.#t2.append(c),c}#t6(d,c,u){let p=this.#tK.createElementNS(f,c);p.setAttribute("type","discrete"),p.setAttribute("tableValues",u),d.append(p)}#t5(d,c,u,p){let g=this.#tK.createElementNS(f,"feComponentTransfer");p.append(g),this.#t6(g,"feFuncR",d),this.#t6(g,"feFuncG",c),this.#t6(g,"feFuncB",u)}#t8(d){return this.#t2.style.color=d,N(getComputedStyle(this.#t2).getPropertyValue("color"))}}c.DOMFilterFactory=A;class v extends g.BaseCanvasFactory{constructor({ownerDocument:d=globalThis.document}={}){super(),this._document=d}_createCanvas(d,c){let u=this._document.createElement("canvas");return u.width=d,u.height=c,u}}async function y(d,c=!1){if(F(d,document.baseURI)){let u=await fetch(d);if(!u.ok)throw Error(u.statusText);return c?new Uint8Array(await u.arrayBuffer()):(0,m.stringToBytes)(await u.text())}return new Promise((u,p)=>{let g=new XMLHttpRequest;g.open("GET",d,!0),c&&(g.responseType="arraybuffer"),g.onreadystatechange=()=>{if(g.readyState===XMLHttpRequest.DONE){if(200===g.status||0===g.status){let d;if(c&&g.response?d=new Uint8Array(g.response):!c&&g.responseText&&(d=(0,m.stringToBytes)(g.responseText)),d)return void u(d)}p(Error(g.statusText))}},g.send(null)})}c.DOMCanvasFactory=v;class _ extends g.BaseCMapReaderFactory{_fetchData(d,c){return y(d,this.isCompressed).then(d=>({cMapData:d,compressionType:c}))}}c.DOMCMapReaderFactory=_;class S extends g.BaseStandardFontDataFactory{_fetchData(d){return y(d,!0)}}c.DOMStandardFontDataFactory=S;class x extends g.BaseSVGFactory{_createSVG(d){return document.createElementNS(f,d)}}c.DOMSVGFactory=x;class E{constructor({viewBox:d,scale:c,rotation:u,offsetX:p=0,offsetY:g=0,dontFlip:m=!1}){let f,b,A,v,y,_,S,x;this.viewBox=d,this.scale=c,this.rotation=u,this.offsetX=p,this.offsetY=g;const E=(d[2]+d[0])/2,C=(d[3]+d[1])/2;switch((u%=360)<0&&(u+=360),u){case 180:f=-1,b=0,A=0,v=1;break;case 90:f=0,b=1,A=1,v=0;break;case 270:f=0,b=-1,A=-1,v=0;break;case 0:f=1,b=0,A=0,v=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}m&&(A=-A,v=-v),0===f?(y=Math.abs(C-d[1])*c+p,_=Math.abs(E-d[0])*c+g,S=(d[3]-d[1])*c,x=(d[2]-d[0])*c):(y=Math.abs(E-d[0])*c+p,_=Math.abs(C-d[1])*c+g,S=(d[2]-d[0])*c,x=(d[3]-d[1])*c),this.transform=[f*c,b*c,A*c,v*c,y-f*c*E-A*c*C,_-b*c*E-v*c*C],this.width=S,this.height=x}get rawDims(){let{viewBox:d}=this;return(0,m.shadow)(this,"rawDims",{pageWidth:d[2]-d[0],pageHeight:d[3]-d[1],pageX:d[0],pageY:d[
11]})}clone({scale:d=this.scale,rotation:c=this.rotation,offsetX:u=this.offsetX,offsetY:p=this.offsetY,dontFlip:g=!1}={}){return new E({viewBox:this.viewBox.slice(),scale:d,rotation:c,offsetX:u,offsetY:p,dontFlip:g})}convertToViewportPoint(d,c){return m.Util.applyTransform([d,c],this.transform)}convertToViewportRectangle(d){let c=m.Util.applyTransform([d[0],d[1]],this.transform),u=m.Util.applyTransform([d[2],d[3]],this.transform);return[c[0],c[1],u[0],u[1]]}convertToPdfPoint(d,c){return m.Util.applyInverseTransform([d,c],this.transform)}}c.PageViewport=E;class C extends m.BaseException{constructor(d,c=0){super(d,"RenderingCancelledException"),this.extraDelay=c}}function T(d){let c=d.length,u=0;for(;u<c&&""===d[u].trim();)u++;return"data:"===d.substring(u,u+5).toLowerCase()}function w(d){return"string"==typeof d&&/\.pdf$/i.test(d)}function P(d,c=!1){return c||([d]=d.split(/[#?]/,1)),d.substring(d.lastIndexOf("/")+1)}function M(d,c="document.pdf"){if("string"!=typeof d)return c;if(T(d))return(0,m.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),c;let u=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,p=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(d),g=u.exec(p[1])||u.exec(p[2])||u.exec(p[3]);if(g&&(g=g[0]).includes("%"))try{g=u.exec(decodeURIComponent(g))[0]}catch{}return g||c}c.RenderingCancelledException=C;class k{started=Object.create(null);times=[];time(d){d in this.started&&(0,m.warn)(`Timer is already running for ${d}`),this.started[d]=Date.now()}timeEnd(d){d in this.started||(0,m.warn)(`Timer has not been started for ${d}`),this.times.push({name:d,start:this.started[d],end:Date.now()}),delete this.started[d]}toString(){let d=[],c=0;for(let{name:d}of this.times)c=Math.max(d.length,c);for(let{name:u,start:p,end:g}of this.times)d.push(`${u.padEnd(c)} ${g-p}ms 2`);return d.join("")}}function F(d,c){try{let{protocol:u}=c?new URL(d,c):new URL(d);return"http:"===u||"https:"===u}catch{return!1}}function R(d){d.preventDefault()}function I(d,c=!1){return new Promise((u,p)=>{let g=document.createElement("script");g.src=d,g.onload=function(d){c&&g.remove(),u(d)},g.onerror=function(){p(Error(`Cannot load script at: ${g.src}`))},(document.head||document.documentElement).append(g)})}function D(d){console.log("Deprecated API usage: "+d)}c.StatTimer=k;class L{static toDateObject(d){if(!d||"string"!=typeof d)return null;let c=(p||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(d);if(!c)return null;let u=parseInt(c[1],10),g=parseInt(c[2],10);g=g>=1&&g<=12?g-1:0;let m=parseInt(c[3],10);m=m>=1&&m<=31?m:1;let f=parseInt(c[4],10);f=f>=0&&f<=23?f:0;let b=parseInt(c[5],10);b=b>=0&&b<=59?b:0;let A=parseInt(c[6],10);A=A>=0&&A<=59?A:0;let v=c[7]||"Z",y=parseInt(c[8],10);y=y>=0&&y<=23?y:0;let _=parseInt(c[9],10)||0;return _=_>=0&&_<=59?_:0,"-"===v?(f+=y,b+=_):"+"===v&&(f-=y,b-=_),new Date(Date.UTC(u,g,m,f,b,A))}}function O(d,{scale:c=1,rotation:u=0}){let{width:p,height:g}=d.attributes.style;return new E({viewBox:[0,0,parseInt(p),parseInt(g)],scale:c,rotation:u})}function N(d){if(d.startsWith("#")){let c=parseInt(d.slice(1),16);return[(0xff0000&c)>>16,(65280&c)>>8,255&c]}return d.startsWith("rgb(")?d.slice(4,-1).split(",").map(d=>parseInt(d)):d.startsWith("rgba(")?d.slice(5,-1).split(",").map(d=>parseInt(d)).slice(0,3):((0,m.warn)(`Not a valid color format: "${d}"`),[0,0,0])}function B(d){let c=document.createElement("span");for(let u of(c.style.visibility="hidden",document.body.append(c),d.keys())){c.style.color=u;let p=window.getComputedStyle(c).color;d.set(u,N(p))}c.remove()}function U(d){let{a:c,b:u,c:p,d:g,e:m,f}=d.getTransform();return[c,u,p,g,m,f]}function j(d){let{a:c,b:u,c:p,d:g,e:m,f}=d.getTransform().invertSelf();return[c,u,p,g,m,f]}function z(d,c,u=!1,p=!0){if(c instanceof E){let{pageWidth:p,pageHeight:g}=c.rawDims,{style:f}=d,b=m.FeatureTest.isCSSRoundSupported,A=`var(--scale-factor) * ${p}px`,v=`var(--scale-factor) * ${g}px`,y=b?`round(${A}, 1px)`:`calc(${A})`,_=b?`round(${v}, 1px)`:`calc(${v})`;u&&c.rotation%180!=0?(f.width=_,f.height=y):(f.width=y,f.height=_)}p&&d.setAttribute("data-main-rotation",c.rotation)}c.PDFDateString=L},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BaseStandardFontDataFactory=c.BaseSVGFactory=c.BaseFilterFactory=c.BaseCanvasFactory=c.BaseCMapReaderFactory=void 0;var p=u(1);class g{constructor(){this.constructor===g&&(0,p.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(d){return"none"}addHCMFilter(d,c){return"none"}addHighlightHCMFilter(d,c,u,p){return"none"}destroy(d=!1){}}c.BaseFilterFactory=g;class m{constructor(){this.constructor===m&&(0,p.unreachable)("Cannot initialize BaseCanvasFactory.")}create(d,c){if(d<=0||c<=0)throw Error("Invalid canvas size");let u=this._createCanvas(d,c);return{canvas:u,context:u.getContext("2d")}}reset(d,c,u){if(!d.canvas)throw Error("Canvas is not specified");if(c<=0||u<=0)throw Error("Invalid canvas size");d.canvas.width=c,d.canvas.height=u}
2destroy(d){if(!d.canvas)throw Error("Canvas is not specified");d.canvas.width=0,d.canvas.height=0,d.canvas=null,d.context=null}_createCanvas(d,c){(0,p.unreachable)("Abstract method `_createCanvas` called.")}}c.BaseCanvasFactory=m;class f{constructor({baseUrl:d=null,isCompressed:c=!0}){this.constructor===f&&(0,p.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=d,this.isCompressed=c}async fetch({name:d}){if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!d)throw Error("CMap name must be specified.");let c=this.baseUrl+d+(this.isCompressed?".bcmap":""),u=this.isCompressed?p.CMapCompressionType.BINARY:p.CMapCompressionType.NONE;return this._fetchData(c,u).catch(d=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${c}`)})}_fetchData(d,c){(0,p.unreachable)("Abstract method `_fetchData` called.")}}c.BaseCMapReaderFactory=f;class b{constructor({baseUrl:d=null}){this.constructor===b&&(0,p.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=d}async fetch({filename:d}){if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!d)throw Error("Font filename must be specified.");let c=`${this.baseUrl}${d}`;return this._fetchData(c).catch(d=>{throw Error(`Unable to load font data at: ${c}`)})}_fetchData(d){(0,p.unreachable)("Abstract method `_fetchData` called.")}}c.BaseStandardFontDataFactory=b;class A{constructor(){this.constructor===A&&(0,p.unreachable)("Cannot initialize BaseSVGFactory.")}create(d,c,u=!1){if(d<=0||c<=0)throw Error("Invalid SVG dimensions");let p=this._createSVG("svg:svg");return p.setAttribute("version","1.1"),u||(p.setAttribute("width",`${d}px`),p.setAttribute("height",`${c}px`)),p.setAttribute("preserveAspectRatio","none"),p.setAttribute("viewBox",`0 0 ${d} ${c}`),p}createElement(d){if("string"!=typeof d)throw Error("Invalid SVG element type");return this._createSVG(d)}_createSVG(d){(0,p.unreachable)("Abstract method `_createSVG` called.")}}c.BaseSVGFactory=A},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.MurmurHash3_64=void 0;var p=u(1);let g=0xc3d2e1f0,m=0xffff0000,f=65535;class b{constructor(d){this.h1=d?0|d:g,this.h2=d?0|d:g}update(d){let c,u;if("string"==typeof d){c=new Uint8Array(2*d.length),u=0;for(let p=0,g=d.length;p<g;p++){let g=d.charCodeAt(p);g<=255?c[u++]=g:(c[u++]=g>>>8,c[u++]=255&g)}}else if((0,p.isArrayBuffer)(d))u=(c=d.slice()).byteLength;else throw Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let g=u>>2,b=u-4*g,A=new Uint32Array(c.buffer,0,g),v=0,y=0,_=this.h1,S=this.h2,x=0xcc9e2d51,E=0x1b873593,C=0xcc9e2d51&f,T=0x1b873593&f;for(let d=0;d<g;d++)1&d?(_^=v=(v=(v=(v=A[d])*x&m|v*C&f)<<15|v>>>17)*E&m|v*T&f,_=5*(_=_<<13|_>>>19)+0xe6546b64):(S^=y=(y=(y=(y=A[d])*x&m|y*C&f)<<15|y>>>17)*E&m|y*T&f,S=5*(S=S<<13|S>>>19)+0xe6546b64);switch(v=0,b){case 3:v^=c[4*g+2]<<16;case 2:v^=c[4*g+1]<<8;case 1:v^=c[4*g],v=(v=(v=v*x&m|v*C&f)<<15|v>>>17)*E&m|v*T&f,1&g?_^=v:S^=v}this.h1=_,this.h2=S}hexdigest(){let d=this.h1,c=this.h2;return d^=c>>>1,d=0xed558ccd*d&m|36045*d&f,c=0xff51afd7*c&m|((c<<16|d>>>16)*0xafd7ed55&m)>>>16,d^=c>>>1,d=0x1a85ec53*d&m|60499*d&f,c=0xc4ceb9fe*c&m|((c<<16|d>>>16)*0xb9fe1a85&m)>>>16,((d^=c>>>1)>>>0).toString(16).padStart(8,"0")+(c>>>0).toString(16).padStart(8,"0")}}c.MurmurHash3_64=b},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FontLoader=c.FontFaceObject=void 0;var p=u(1);class g{#t7=new Set;constructor({ownerDocument:d=globalThis.document,styleElement:c=null}){this._document=d,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(d){this.nativeFontFaces.add(d),this._document.fonts.add(d)}removeNativeFontFace(d){this.nativeFontFaces.delete(d),this._document.fonts.delete(d)}insertRule(d){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let c=this.styleElement.sheet;c.insertRule(d,c.cssRules.length)}clear(){for(let d of this.nativeFontFaces)this._document.fonts.delete(
2d);this.nativeFontFaces.clear(),this.#t7.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(d){if(!(!d||this.#t7.has(d.loadedName))){if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:c,src:u,style:g}=d,m=new FontFace(c,u,g);this.addNativeFontFace(m);try{await m.load(),this.#t7.add(c)}catch{(0,p.warn)(`Cannot load system font: ${d.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(m)}return}(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(d){if(d.attached||d.missingFile&&!d.systemFontInfo)return;if(d.attached=!0,d.systemFontInfo)return void await this.loadSystemFont(d.systemFontInfo);if(this.isFontLoadingAPISupported){let c=d.createNativeFontFace();if(c){this.addNativeFontFace(c);try{await c.loaded}catch(u){throw(0,p.warn)(`Failed to load font '${c.family}': '${u}'.`),d.disableFontFace=!0,u}}return}let c=d.createFontFaceRule();if(c){if(this.insertRule(c),this.isSyncFontLoadingSupported)return;await new Promise(c=>{let u=this._queueLoadingCallback(c);this._prepareFontLoadEvent(d,u)})}}get isFontLoadingAPISupported(){let d=!!this._document?.fonts;return(0,p.shadow)(this,"isFontLoadingAPISupported",d)}get isSyncFontLoadingSupported(){let d=!1;return p.isNodeJS?d=!0:"u">typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)&&(d=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",d)}_queueLoadingCallback(d){let{loadingRequests:c}=this,u={done:!1,complete:function(){for((0,p.assert)(!u.done,"completeRequest() cannot be called twice."),u.done=!0;c.length>0&&c[0].done;)setTimeout(c.shift().callback,0)},callback:d};return c.push(u),u}get _loadTestFont(){let d=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",d)}_prepareFontLoadEvent(d,c){let u,g;function m(d,c){return d.charCodeAt(c)<<24|d.charCodeAt(c+1)<<16|d.charCodeAt(c+2)<<8|255&d.charCodeAt(c+3)}function f(d,c,u,p){return d.substring(0,c)+p+d.substring(c+u)}let b=this._document.createElement("canvas");b.width=1,b.height=1;let A=b.getContext("2d"),v=0;function y(d,c){if(++v>30){(0,p.warn)("Load test font never loaded."),c();return}(A.font="30px "+d,A.fillText(".",0,20),A.getImageData(0,0,1,1).data[3]>0)?c():setTimeout(y.bind(null,d,c))}let _=`lt${Date.now()}${this.loadTestFontId++}`,S=this._loadTestFont;S=f(S,976,_.length,_);let x=16,E=0x58585858,C=m(S,16);for(u=0,g=_.length-3;u<g;u+=4)C=C-E+m(_,u)|0;u<_.length&&(C=C-E+m(_+"XXX",u)|0),S=f(S,x,4,(0,p.string32)(C));let T=`url(data:font/opentype;base64,${btoa(S)});`,w=`@font-face {font-family:"${_}";src:${T}}`;this.insertRule(w);let P=this._document.createElement("div");for(let c of(P.style.visibility="hidden",P.style.width=P.style.height="10px",P.style.position="absolute",P.style.top=P.style.left="0px",[d.loadedName,_])){let d=this._document.createElement("span");d.textContent="Hi",d.style.fontFamily=c,P.append(d)}this._document.body.append(P),y(_,()=>{P.remove(),c.complete()})}}c.FontLoader=g;class m{constructor(d,{isEvalSupported:c=!0,disableFontFace:u=!1,ignoreErrors:p=!1,inspectFont:g=null}){for(const c in this.compiledGlyphs=Object.create(null),d)this[c]=d[c];this.isEvalSupported=!1!==c,this.disableFontFace=!0===u,this.ignoreErrors=!0===p,this._inspectFont=g}createNativeFontFace(){let d;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let c={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(c.style=`oblique ${this.cssFontInfo.italicAngle}deg`),d=new FontFace(this.cssFontInfo.fontFamily,this.data,c)}else d=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),d}createFontFaceRule(){let d;if(!this.data||this.disableFontFace)return null;
2let c=(0,p.bytesToString)(this.data),u=`url(data:${this.mimetype};base64,${btoa(c)});`;if(this.cssFontInfo){let c=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(c+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),d=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${c}src:${u}}`}else d=`@font-face {font-family:"${this.loadedName}";src:${u}}`;return this._inspectFont?.(this,u),d}getPathGenerator(d,c){let u;if(void 0!==this.compiledGlyphs[c])return this.compiledGlyphs[c];try{u=d.get(this.loadedName+"_path_"+c)}catch(d){if(!this.ignoreErrors)throw d;return(0,p.warn)(`getPathGenerator - ignoring character: "${d}".`),this.compiledGlyphs[c]=function(d,c){}}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){let d=[];for(let c of u){let u=void 0!==c.args?c.args.join(","):"";d.push("c.",c.cmd,"(",u,");\n")}return this.compiledGlyphs[c]=Function("c","size",d.join(""))}return this.compiledGlyphs[c]=function(d,c){for(let p of u)"scale"===p.cmd&&(p.args=[c,-c]),d[p.cmd].apply(d,p.args)}}}c.FontFaceObject=m},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.NodeStandardFontDataFactory=c.NodeFilterFactory=c.NodeCanvasFactory=c.NodeCMapReaderFactory=void 0;var p=u(7);u(1);let g=function(d){return new Promise((c,u)=>{__webpack_require__(82590).readFile(d,(d,p)=>{d||!p?u(Error(d)):c(new Uint8Array(p))})})};class m extends p.BaseFilterFactory{}c.NodeFilterFactory=m;class f extends p.BaseCanvasFactory{_createCanvas(d,c){return __webpack_require__(28383).createCanvas(d,c)}}c.NodeCanvasFactory=f;class b extends p.BaseCMapReaderFactory{_fetchData(d,c){return g(d).then(d=>({cMapData:d,compressionType:c}))}}c.NodeCMapReaderFactory=b;class A extends p.BaseStandardFontDataFactory{_fetchData(d){return g(d)}}c.NodeStandardFontDataFactory=A},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CanvasGraphics=void 0;var p=u(1),g=u(6),m=u(12),f=u(13);let b=16,A=100,v=4096,y=15,_=10,S=1e3,x=16;function E(d,c){if(d._removeMirroring)throw Error("Context is already forwarding operations.");d.__originalSave=d.save,d.__originalRestore=d.restore,d.__originalRotate=d.rotate,d.__originalScale=d.scale,d.__originalTranslate=d.translate,d.__originalTransform=d.transform,d.__originalSetTransform=d.setTransform,d.__originalResetTransform=d.resetTransform,d.__originalClip=d.clip,d.__originalMoveTo=d.moveTo,d.__originalLineTo=d.lineTo,d.__originalBezierCurveTo=d.bezierCurveTo,d.__originalRect=d.rect,d.__originalClosePath=d.closePath,d.__originalBeginPath=d.beginPath,d._removeMirroring=()=>{d.save=d.__originalSave,d.restore=d.__originalRestore,d.rotate=d.__originalRotate,d.scale=d.__originalScale,d.translate=d.__originalTranslate,d.transform=d.__originalTransform,d.setTransform=d.__originalSetTransform,d.resetTransform=d.__originalResetTransform,d.clip=d.__originalClip,d.moveTo=d.__originalMoveTo,d.lineTo=d.__originalLineTo,d.bezierCurveTo=d.__originalBezierCurveTo,d.rect=d.__originalRect,d.closePath=d.__originalClosePath,d.beginPath=d.__originalBeginPath,delete d._removeMirroring},d.save=function(){c.save(),this.__originalSave()},d.restore=function(){c.restore(),this.__originalRestore()},d.translate=function(d,u){c.translate(d,u),this.__originalTranslate(d,u)},d.scale=function(d,u){c.scale(d,u),this.__originalScale(d,u)},d.transform=function(d,u,p,g,m,f){c.transform(d,u,p,g,m,f),this.__originalTransform(d,u,p,g,m,f)},d.setTransform=function(d,u,p,g,m,f){c.setTransform(d,u,p,g,m,f),this.__originalSetTransform(d,u,p,g,m,f)},d.resetTransform=function(){c.resetTransform(),this.__originalResetTransform()},d.rotate=function(d){c.rotate(d),this.__originalRotate(d)},d.clip=function(d){c.clip(d),this.__originalClip(d)},d.moveTo=function(d,u){c.moveTo(d,u),this.__originalMoveTo(d,u)},d.lineTo=function(d,u){c.lineTo(d,u),this.__originalLineTo(d,u)},d.bezierCurveTo=function(d,u,p,g,m,f){c.bezierCurveTo(d,u,p,g,m,f),this.__originalBezierCurveTo(d,u,p,g,m,f)},d.rect=function(d,u,p,g){c.rect(d,u,p,g),this.__originalRect(d,u,p,g)},d.closePath=function(){c.closePath(),this.__originalClosePath()},d.beginPath=function(){c.beginPath(),this.__originalBeginPath()}}class C{constructor(d){this.canvasFactory=d,this.cache=Object.create(null)}getCanvas(d,c,u){let p;return void 0!==this.cache[d]?(p=this.cache[d],this.canvasFactory.reset(p,c,u)):(p=this.canvasFactory.create(c,u),this.cache[d]=p),p}delete(d){delete this.cache[d]}clear(){for(let d in this.cache){let c=this.cache[d];this.canvasFactory.destroy(c),delete this.cache[d]}}}function T(d,c,u,p,m,f,b,A,v,y){let[_,S,x,E,C,T]=(0,g.getCurrentTransform)(d);if(0===S&&0===x){let g=Math.round(b*_+C),w=Math.round(A*E+T),P=Math.abs(Math.round((b+v)*_+C)-g)||1,M=Math.abs(Math.round((A+y)*E+T)-w)||1;return d.setTransform(Math.sign(_),0,0,Math.sign(E),g,w),d.drawImage(c,u,p,m,f,0,0,P,M),d.setTransform(_,S,x,E,C,T),[P,M]}if(0===_&&0===E){let g=Math.round(A*x+C),w=Math.round(b*S+T),P=Math.abs(Math.round((A+y)*x+C)-g)||1,M=Math.abs(Math.round((b+v)*S+T)-w)||1;return d.setTransform(0,Math.sign(S),Math.sign(x),0,g,w),d.drawImage(c,u,p,m,f,0,0,M,P),d.setTransform(_,S,x,E,C,T),[M,P]}return d.drawImage(c,u,p,m,f,b,A,v,y),[Math.hypot(_,S)*v,Math.hypot(x,E)*y]}function w(d){let c,u,p,{width:g,height:m}=d;if(g>S||m>S)return null;
2let f=1e3,b=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),A=g+1,v=new Uint8Array(A*(m+1)),y=g+7&-8,_=new Uint8Array(y*m),x=0;for(let c of d.data){let d=128;for(;d>0;)_[x++]=c&d?0:255,d>>=1}let E=0;for(0!==_[x=0]&&(v[0]=1,++E),u=1;u<g;u++)_[x]!==_[x+1]&&(v[u]=_[x]?2:1,++E),x++;for(0!==_[x]&&(v[u]=2,++E),c=1;c<m;c++){x=c*y,p=c*A,_[x-y]!==_[x]&&(v[p]=_[x]?1:8,++E);let d=4*!!_[x]+8*!!_[x-y];for(u=1;u<g;u++)b[d=(d>>2)+4*!!_[x+1]+8*!!_[x-y+1]]&&(v[p+u]=b[d],++E),x++;if(_[x-y]!==_[x]&&(v[p+u]=_[x]?2:4,++E),E>f)return null}for(x=y*(m-1),p=c*A,0!==_[x]&&(v[p]=8,++E),u=1;u<g;u++)_[x]!==_[x+1]&&(v[p+u]=_[x]?4:8,++E),x++;if(0!==_[x]&&(v[p+u]=4,++E),E>f)return null;let C=new Int32Array([0,A,-1,0,-A,0,0,0,1]),T=new Path2D;for(c=0;E&&c<=m;c++){let d=c*A,u=d+g;for(;d<u&&!v[d];)d++;if(d===u)continue;T.moveTo(d%A,c);let p=d,m=v[d];do{let c=C[m];do d+=c;while(!v[d]);let u=v[d];5!==u&&10!==u?(m=u,v[d]=0):(m=u&51*m>>4,v[d]&=m>>2|m<<2),T.lineTo(d%A,d/A|0),!v[d]&&--E}while(p!==d);--c}return _=null,v=null,function(d){d.save(),d.scale(1/g,-1/m),d.translate(0,-m),d.fill(T),d.beginPath(),d.restore()}}class P{constructor(d,c){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=p.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=p.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=p.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.transferMaps="none",this.startNewPathAndClipBox([0,0,d,c])}clone(){let d=Object.create(this);return d.clipBox=this.clipBox.slice(),d}setCurrentPoint(d,c){this.x=d,this.y=c}updatePathMinMax(d,c,u){[c,u]=p.Util.applyTransform([c,u],d),this.minX=Math.min(this.minX,c),this.minY=Math.min(this.minY,u),this.maxX=Math.max(this.maxX,c),this.maxY=Math.max(this.maxY,u)}updateRectMinMax(d,c){let u=p.Util.applyTransform(c,d),g=p.Util.applyTransform(c.slice(2),d);this.minX=Math.min(this.minX,u[0],g[0]),this.minY=Math.min(this.minY,u[1],g[1]),this.maxX=Math.max(this.maxX,u[0],g[0]),this.maxY=Math.max(this.maxY,u[1],g[1])}updateScalingPathMinMax(d,c){p.Util.scaleMinMax(d,c),this.minX=Math.min(this.minX,c[0]),this.maxX=Math.max(this.maxX,c[1]),this.minY=Math.min(this.minY,c[2]),this.maxY=Math.max(this.maxY,c[3])}updateCurvePathMinMax(d,c,u,g,m,f,b,A,v,y){let _=p.Util.bezierBoundingBox(c,u,g,m,f,b,A,v);if(y){y[0]=Math.min(y[0],_[0],_[2]),y[1]=Math.max(y[1],_[0],_[2]),y[2]=Math.min(y[2],_[1],_[3]),y[3]=Math.max(y[3],_[1],_[3]);return}this.updateRectMinMax(d,_)}getPathBoundingBox(d=m.PathType.FILL,c=null){let u=[this.minX,this.minY,this.maxX,this.maxY];if(d===m.PathType.STROKE){c||(0,p.unreachable)("Stroke bounding box must include transform.");let d=p.Util.singularValueDecompose2dScale(c),g=d[0]*this.lineWidth/2,m=d[1]*this.lineWidth/2;u[0]-=g,u[1]-=m,u[2]+=g,u[3]+=m}return u}updateClipFromPath(){let d=p.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(d||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(d){this.clipBox=d,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(d=m.PathType.FILL,c=null){return p.Util.intersect(this.clipBox,this.getPathBoundingBox(d,c))}}function M(d,c){let u,g,m,f;if("u">typeof ImageData&&c instanceof ImageData)return void d.putImageData(c,0,0);let b=c.height,A=c.width,v=b%x,y=(b-v)/x,_=0===v?y:y+1,S=d.createImageData(A,x),E=0,C,T=c.data,w=S.data;if(c.kind===p.ImageKind.GRAYSCALE_1BPP){let c=T.byteLength,f=new Uint32Array(w.buffer,0,w.byteLength>>2),b=f.length,P=A+7>>3,M=0xffffffff,k=p.FeatureTest.isLittleEndian?0xff000000:255;for(u=0;u<_;u++){for(m=u<y?x:v,C=0,g=0;g<m;g++){let d=c-E,u=0,p=d>P?A:8*d-7,g=-8&p,m=0,b=0;for(;u<g;u+=8)b=T[E++],f[C++]=128&b?M:k,f[C++]=64&b?M:k,f[C++]=32&b?M:k,f[C++]=16&b?M:k,f[C++]=8&b?M:k,f[C++]=4&b?M:k,f[C++]=2&b?M:k,f[C++]=1&b?M:k;for(;u<p;u++)0===m&&(b=T[E++],m=128),f[C++]=b&m?M:k,m>>=1}for(;C<b;)f[C++]=0;d.putImageData(S,0,u*x)}}else if(c.kind===p.ImageKind.RGBA_32BPP){for(g=0,f=A*x*4,u=0;u<y;u++)w.set(T.subarray(E,E+f)),E+=f,d.putImageData(S,0,g),g+=x;u<_&&(f=A*v*4,w.set(T.subarray(E,E+f)),d.putImageData(S,0,g))}else if(c.kind===p.ImageKind.RGB_24BPP)for(f=A*(m=x),u=0;u<_;u++){for(u>=y&&(f=A*(m=v)),C=0,g=f;g--;)w[C++]=T[E++],w[C++]=T[E++],w[C++]=T[E++],w[C++]=255;d.putImageData(S,0,u*x)}else throw Error(`bad image kind: ${c.kind}`)}function k(d,c){if(c.bitmap)return void d.drawImage(c.bitmap,0,0);let u=c.height,p=c.width,g=u%x,m=(u-g)/x,b=0===g?m:m+1,A=d.createImageData(p,x),v=0,y=c.data,_=A.data;for(let c=0;c<b;c++){let u=c<m?x:g;({srcPos:v}=(0,f.convertBlackAndWhiteToRGBA)({src:y,srcPos:v,dest:_,width:p,height:u,n
2onBlackColor:0})),d.putImageData(A,0,c*x)}}function F(d,c){for(let u of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==d[u]&&(c[u]=d[u]);void 0!==d.setLineDash&&(c.setLineDash(d.getLineDash()),c.lineDashOffset=d.lineDashOffset)}function R(d){if(d.strokeStyle=d.fillStyle="#000000",d.fillRule="nonzero",d.globalAlpha=1,d.lineWidth=1,d.lineCap="butt",d.lineJoin="miter",d.miterLimit=10,d.globalCompositeOperation="source-over",d.font="10px sans-serif",void 0!==d.setLineDash&&(d.setLineDash([]),d.lineDashOffset=0),!p.isNodeJS){let{filter:c}=d;"none"!==c&&""!==c&&(d.filter="none")}}function I(d,c,u,p){let g=d.length;for(let m=3;m<g;m+=4){let g=d[m];if(0===g)d[m-3]=c,d[m-2]=u,d[m-1]=p;else if(g<255){let f=255-g;d[m-3]=d[m-3]*g+c*f>>8,d[m-2]=d[m-2]*g+u*f>>8,d[m-1]=d[m-1]*g+p*f>>8}}}function D(d,c,u){let p=d.length,g=1/255;for(let m=3;m<p;m+=4){let p=u?u[d[m]]:d[m];c[m]=c[m]*p*g|0}}function L(d,c,u){let p=d.length;for(let g=3;g<p;g+=4){let p=77*d[g-3]+152*d[g-2]+28*d[g-1];c[g]=u?c[g]*u[p>>8]>>8:c[g]*p>>16}}function O(d,c,u,p,g,m,f,b,A,v,y){let _=!!m,S=_?m[0]:0,x=_?m[1]:0,E=_?m[2]:0,C="Luminosity"===g?L:D,T=Math.min(p,Math.ceil(1048576/u));for(let g=0;g<p;g+=T){let m=Math.min(T,p-g),w=d.getImageData(b-v,g+(A-y),u,m),P=c.getImageData(b,g+A,u,m);_&&I(w.data,S,x,E),C(w.data,P.data,f),c.putImageData(P,b,g+A)}}function N(d,c,u,p){let g=p[0],m=p[1],f=p[2]-g,b=p[3]-m;0!==f&&0!==b&&(O(c.context,u,f,b,c.subtype,c.backdrop,c.transferMap,g,m,c.offsetX,c.offsetY),d.save(),d.globalAlpha=1,d.globalCompositeOperation="source-over",d.setTransform(1,0,0,1,0,0),d.drawImage(u.canvas,0,0),d.restore())}function B(d,c){let u=p.Util.singularValueDecompose2dScale(d);u[0]=Math.fround(u[0]),u[1]=Math.fround(u[1]);let m=Math.fround((globalThis.devicePixelRatio||1)*g.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==c?c:!!(u[0]<=m)||!!(u[1]<=m)}let U=["butt","round","square"],j=["miter","round","bevel"],z={},H={};class G{constructor(d,c,u,p,g,{optionalContentConfig:m,markedContentStack:f=null},b,A){this.ctx=d,this.current=new P(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=c,this.objs=u,this.canvasFactory=p,this.filterFactory=g,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=f||[],this.optionalContentConfig=m,this.cachedCanvases=new C(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=b,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=A,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(d,c=null){return"string"==typeof d?d.startsWith("g_")?this.commonObjs.get(d):this.objs.get(d):c}beginDrawing({transform:d,viewport:c,transparency:u=!1,background:p=null}){let m=this.ctx.canvas.width,f=this.ctx.canvas.height,b=this.ctx.fillStyle;if(this.ctx.fillStyle=p||"#ffffff",this.ctx.fillRect(0,0,m,f),this.ctx.fillStyle=b,u){let d=this.cachedCanvases.getCanvas("transparent",m,f);this.compositeCtx=this.ctx,this.transparentCanvas=d.canvas,this.ctx=d.context,this.ctx.save(),this.ctx.transform(...(0,g.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),R(this.ctx),d&&(this.ctx.transform(...d),this.outputScaleX=d[0],this.outputScaleY=d[0]),this.ctx.transform(...c.transform),this.viewportScale=c.scale,this.baseTransform=(0,g.getCurrentTransform)(this.ctx)}executeOperatorList(d,c,u,g){let m,f=d.argsArray,b=d.fnArray,A=c||0,v=f.length;if(v===A)return A;let S=v-A>_&&"function"==typeof u,x=S?Date.now()+y:0,E=0,C=this.commonObjs,T=this.objs;for(;;){if(void 0!==g&&A===g.nextBreakPoint)return g.breakIt(A,u),A;if((m=b[A])!==p.OPS.dependency)this[m].apply(this,f[A]);else for(let d of f[A]){let c=d.startsWith("g_")?C:T;if(!c.has(d))return c.get(d,u),A}if(++A===v)return A;if(S&&++E>_){if(Date.now()>x)return u(),A;E=0}}}#t9(){for(;this.stateStack.length||this.inSMaskMode;
2)this.restore();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)}endDrawing(){for(let d of(this.#t9(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let c of d.values())"u">typeof HTMLCanvasElement&&c instanceof HTMLCanvasElement&&(c.width=c.height=0);d.clear()}this._cachedBitmapsMap.clear(),this.#et()}#et(){if(this.pageColors){let d=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==d){let c=this.ctx.filter;this.ctx.filter=d,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=c}}}_scaleImage(d,c){let u,p,g=d.width,m=d.height,f=Math.max(Math.hypot(c[0],c[1]),1),b=Math.max(Math.hypot(c[2],c[3]),1),A=g,v=m,y="prescale1";for(;f>2&&A>1||b>2&&v>1;){let c=A,g=v;f>2&&A>1&&(c=A>=16384?Math.floor(A/2)-1||1:Math.ceil(A/2),f/=A/c),b>2&&v>1&&(g=v>=16384?Math.floor(v/2)-1||1:Math.ceil(v)/2,b/=v/g),(p=(u=this.cachedCanvases.getCanvas(y,c,g)).context).clearRect(0,0,c,g),p.drawImage(d,0,0,A,v,0,0,c,g),d=u.canvas,A=c,v=g,y="prescale1"===y?"prescale2":"prescale1"}return{img:d,paintWidth:A,paintHeight:v}}_createMaskCanvas(d){let c,u,f,b,A=this.ctx,{width:v,height:y}=d,_=this.current.fillColor,S=this.current.patternFill,x=(0,g.getCurrentTransform)(A);if((d.bitmap||d.data)&&d.count>1){let p=d.bitmap||d.data.buffer;u=JSON.stringify(S?x:[x.slice(0,4),_]),(c=this._cachedBitmapsMap.get(p))||(c=new Map,this._cachedBitmapsMap.set(p,c));let g=c.get(u);if(g&&!S)return{canvas:g,offsetX:Math.round(Math.min(x[0],x[2])+x[4]),offsetY:Math.round(Math.min(x[1],x[3])+x[5])};f=g}f||k((b=this.cachedCanvases.getCanvas("maskCanvas",v,y)).context,d);let E=p.Util.transform(x,[1/v,0,0,-1/y,0,0]);E=p.Util.transform(E,[1,0,0,1,0,-y]);let C=p.Util.applyTransform([0,0],E),w=p.Util.applyTransform([v,y],E),P=p.Util.normalizeRect([C[0],C[1],w[0],w[1]]),M=Math.round(P[2]-P[0])||1,F=Math.round(P[3]-P[1])||1,R=this.cachedCanvases.getCanvas("fillCanvas",M,F),I=R.context,D=Math.min(C[0],w[0]),L=Math.min(C[1],w[1]);I.translate(-D,-L),I.transform(...E),!f&&(f=(f=this._scaleImage(b.canvas,(0,g.getCurrentTransformInverse)(I))).img,c&&S&&c.set(u,f)),I.imageSmoothingEnabled=B((0,g.getCurrentTransform)(I),d.interpolate),T(I,f,0,0,f.width,f.height,0,0,v,y),I.globalCompositeOperation="source-in";let O=p.Util.transform((0,g.getCurrentTransformInverse)(I),[1,0,0,1,-D,-L]);return I.fillStyle=S?_.getPattern(A,this,O,m.PathType.FILL):_,I.fillRect(0,0,v,y),c&&!S&&(this.cachedCanvases.delete("fillCanvas"),c.set(u,R.canvas)),{canvas:R.canvas,offsetX:Math.round(D),offsetY:Math.round(L)}}setLineWidth(d){d!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=d,this.ctx.lineWidth=d}setLineCap(d){this.ctx.lineCap=U[d]}setLineJoin(d){this.ctx.lineJoin=j[d]}setMiterLimit(d){this.ctx.miterLimit=d}setDash(d,c){let u=this.ctx;void 0!==u.setLineDash&&(u.setLineDash(d),u.lineDashOffset=c)}setRenderingIntent(d){}setFlatness(d){}setGState(d){for(let[c,u]of d)switch(c){case"LW":this.setLineWidth(u);break;case"LC":this.setLineCap(u);break;case"LJ":this.setLineJoin(u);break;case"ML":this.setMiterLimit(u);break;case"D":this.setDash(u[0],u[1]);break;case"RI":this.setRenderingIntent(u);break;case"FL":this.setFlatness(u);break;case"Font":this.setFont(u[0],u[1]);break;case"CA":this.current.strokeAlpha=u;break;case"ca":this.current.fillAlpha=u,this.ctx.globalAlpha=u;break;case"BM":this.ctx.globalCompositeOperation=u;break;case"SMask":this.current.activeSMask=u?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(u)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let d=this.inSMaskMode;this.current.activeSMask&&!d?this.beginSMaskMode():!this.current.activeSMask&&d&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let d=this.ctx.canvas.width,c=this.ctx.canvas.height,u="smaskGroupAt"+this.groupLevel,p=this.cachedCanvases.getCanvas(u,d,c);this.suspendedCtx=this.ctx,this.ctx=p.context;let m=this.ctx;m.setTransform(...(0,g.getCurrentTransform)(this.suspendedCtx)),F(this.suspendedCtx,m),E(m,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),F(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(d){if(!this.current.activeSMask)return;d?(d[0]=Math.floor(d[0]),d[1]=Math.floor(d[1]),d[2]=Math.ceil(d[2]),d[3]=Math.ceil(d[3])):d=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let c=this.current.activeSMask;N(this.suspendedCtx,c,this.ctx,d),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore(
2)}save(){this.inSMaskMode?(F(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let d=this.current;this.stateStack.push(d),this.current=d.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),F(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(d,c,u,p,g,m){this.ctx.transform(d,c,u,p,g,m),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(d,c,u){let m,f,b=this.ctx,A=this.current,v=A.x,y=A.y,_=(0,g.getCurrentTransform)(b),S=0===_[0]&&0===_[3]||0===_[1]&&0===_[2],x=S?u.slice(0):null;for(let u=0,g=0,E=d.length;u<E;u++)switch(0|d[u]){case p.OPS.rectangle:v=c[g++],y=c[g++];let E=c[g++],C=c[g++],T=v+E,w=y+C;b.moveTo(v,y),0===E||0===C?b.lineTo(T,w):(b.lineTo(T,y),b.lineTo(T,w),b.lineTo(v,w)),S||A.updateRectMinMax(_,[v,y,T,w]),b.closePath();break;case p.OPS.moveTo:v=c[g++],y=c[g++],b.moveTo(v,y),S||A.updatePathMinMax(_,v,y);break;case p.OPS.lineTo:v=c[g++],y=c[g++],b.lineTo(v,y),S||A.updatePathMinMax(_,v,y);break;case p.OPS.curveTo:m=v,f=y,v=c[g+4],y=c[g+5],b.bezierCurveTo(c[g],c[g+1],c[g+2],c[g+3],v,y),A.updateCurvePathMinMax(_,m,f,c[g],c[g+1],c[g+2],c[g+3],v,y,x),g+=6;break;case p.OPS.curveTo2:m=v,f=y,b.bezierCurveTo(v,y,c[g],c[g+1],c[g+2],c[g+3]),A.updateCurvePathMinMax(_,m,f,v,y,c[g],c[g+1],c[g+2],c[g+3],x),v=c[g+2],y=c[g+3],g+=4;break;case p.OPS.curveTo3:m=v,f=y,v=c[g+2],y=c[g+3],b.bezierCurveTo(c[g],c[g+1],v,y,v,y),A.updateCurvePathMinMax(_,m,f,c[g],c[g+1],v,y,v,y,x),g+=4;break;case p.OPS.closePath:b.closePath()}S&&A.updateScalingPathMinMax(_,x),A.setCurrentPoint(v,y)}closePath(){this.ctx.closePath()}stroke(d=!0){let c=this.ctx,u=this.current.strokeColor;c.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof u&&u?.getPattern?(c.save(),c.strokeStyle=u.getPattern(c,this,(0,g.getCurrentTransformInverse)(c),m.PathType.STROKE),this.rescaleAndStroke(!1),c.restore()):this.rescaleAndStroke(!0)),d&&this.consumePath(this.current.getClippedPathBoundingBox()),c.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(d=!0){let c=this.ctx,u=this.current.fillColor,p=this.current.patternFill,f=!1;p&&(c.save(),c.fillStyle=u.getPattern(c,this,(0,g.getCurrentTransformInverse)(c),m.PathType.FILL),f=!0);let b=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==b&&(this.pendingEOFill?(c.fill("evenodd"),this.pendingEOFill=!1):c.fill()),f&&c.restore(),d&&this.consumePath(b)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=z}eoClip(){this.pendingClip=H}beginText(){this.current.textMatrix=p.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let d=this.pendingTextPaths,c=this.ctx;if(void 0===d)return void c.beginPath();for(let u of(c.save(),c.beginPath(),d))c.setTransform(...u.transform),c.translate(u.x,u.y),u.addToPath(c,u.fontSize);c.restore(),c.clip(),c.beginPath(),delete this.pendingTextPaths}setCharSpacing(d){this.current.charSpacing=d}setWordSpacing(d){this.current.wordSpacing=d}setHScale(d){this.current.textHScale=d/100}setLeading(d){this.current.leading=-d}setFont(d,c){let u=this.commonObjs.get(d),g=this.current;if(!u)throw Error(`Can't find font for ${d}`);if(g.fontMatrix=u.fontMatrix||p.FONT_IDENTITY_MATRIX,(0===g.fontMatrix[0]||0===g.fontMatrix[3])&&(0,p.warn)("Invalid font matrix for font "+d),c<0?(c=-c,g.fontDirection=-1):g.fontDirection=1,this.current.font=u,this.current.fontSize=c,u.isType3Font)return;let m=u.loadedName||"sans-serif",f=u.systemFontInfo?.css||`"${m}", ${u.fallbackName}`,v="normal";u.black?v="900":u.bold&&(v="bold");let y=u.italic?"italic":"normal",_=c;c<b?_=b:c>A&&(_=A),this.current.fontSizeScale=c/_,this.ctx.font=`${y} ${v} ${_}px ${f}`}setTextRenderingMode(d){this.current.textRenderingMode=d}setTextRise(d){this.current.textRise=d}moveText(d,c){this.current.x=this.current.lineX+=d,this.current.y=this.current.lineY+=c}setLeadingMoveText(d,c){this.setLeading(-c),this.moveText(d,c)}setTextMatrix(d,c,u,p,g,m){this.current.textMatrix=[d,c,u,p,g,m],this.current.textMatrixScale=Math.hypot(d,c),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(d,c,u,m){let f,b=this.ctx,A=this.current,v=A.font,y=A.textRenderingMode,_=A.fontSize/A.fontSizeScale,S=y&p.TextRenderingMode.FILL_STROKE_MASK,x=!!(y&p.TextRenderingMode.ADD_TO_PATH_FLAG),E=A.patternFill&&!v.missingFile;(v.disableFontFace||x||E)&&(f=v.getPathGenerator(this.commonObjs,d)),v.disableFontFace||E?(b.save(),b.translate(c,u),b.beginPath(),f(b,_),m&&b.setTransform(...m),(S===p.TextRenderingMode.FILL||S===p.TextRenderingMode.FILL_STROKE)&&b.fill(),(S===p.TextRenderingMode.STROKE||S===p.TextRenderingMode.FILL_STROKE)&&b.stroke(),b.restore(
2)):((S===p.TextRenderingMode.FILL||S===p.TextRenderingMode.FILL_STROKE)&&b.fillText(d,c,u),(S===p.TextRenderingMode.STROKE||S===p.TextRenderingMode.FILL_STROKE)&&b.strokeText(d,c,u)),x&&(this.pendingTextPaths||=[]).push({transform:(0,g.getCurrentTransform)(b),x:c,y:u,fontSize:_,addToPath:f})}get isFontSubpixelAAEnabled(){let{context:d}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);d.scale(1.5,1),d.fillText("I",0,10);let c=d.getImageData(0,0,10,10).data,u=!1;for(let d=3;d<c.length;d+=4)if(c[d]>0&&c[d]<255){u=!0;break}return(0,p.shadow)(this,"isFontSubpixelAAEnabled",u)}showText(d){let c,u=this.current,f=u.font;if(f.isType3Font)return this.showType3Text(d);let b=u.fontSize;if(0===b)return;let A=this.ctx,v=u.fontSizeScale,y=u.charSpacing,_=u.wordSpacing,S=u.fontDirection,x=u.textHScale*S,E=d.length,C=f.vertical,T=C?1:-1,w=f.defaultVMetrics,P=b*u.fontMatrix[0],M=u.textRenderingMode===p.TextRenderingMode.FILL&&!f.disableFontFace&&!u.patternFill;if(A.save(),A.transform(...u.textMatrix),A.translate(u.x,u.y+u.textRise),S>0?A.scale(x,-1):A.scale(x,1),u.patternFill){A.save();let d=u.fillColor.getPattern(A,this,(0,g.getCurrentTransformInverse)(A),m.PathType.FILL);c=(0,g.getCurrentTransform)(A),A.restore(),A.fillStyle=d}let k=u.lineWidth,F=u.textMatrixScale;if(0===F||0===k){let d=u.textRenderingMode&p.TextRenderingMode.FILL_STROKE_MASK;(d===p.TextRenderingMode.STROKE||d===p.TextRenderingMode.FILL_STROKE)&&(k=this.getSinglePixelWidth())}else k/=F;if(1!==v&&(A.scale(v,v),k/=v),A.lineWidth=k,f.isInvalidPDFjsFont){let c=[],p=0;for(let u of d)c.push(u.unicode),p+=u.width;A.fillText(c.join(""),0,0),u.x+=p*P*x,A.restore(),this.compose();return}let R=0,I;for(I=0;I<E;++I){let u,p,g=d[I];if("number"==typeof g){R+=T*g*b/1e3;continue}let m=!1,x=(g.isSpace?_:0)+y,E=g.fontChar,k=g.accent,F=g.width;if(C){let d=g.vmetric||w,c=-(g.vmetric?d[1]:.5*F)*P,m=d[2]*P;F=d?-d[0]:F,u=c/v,p=(R+m)/v}else u=R/v,p=0;if(f.remeasure&&F>0){let d=1e3*A.measureText(E).width/b*v;if(F<d&&this.isFontSubpixelAAEnabled){let c=F/d;m=!0,A.save(),A.scale(c,1),u/=c}else F!==d&&(u+=(F-d)/2e3*b/v)}if(this.contentVisible&&(g.isInFont||f.missingFile)){if(M&&!k)A.fillText(E,u,p);else if(this.paintChar(E,u,p,c),k){let d=u+b*k.offset.x/v,g=p-b*k.offset.y/v;this.paintChar(k.fontChar,d,g,c)}}R+=C?F*P-x*S:F*P+x*S,m&&A.restore()}C?u.y-=R:u.x+=R*x,A.restore(),this.compose()}showType3Text(d){let c,u,g,m,f=this.ctx,b=this.current,A=b.font,v=b.fontSize,y=b.fontDirection,_=A.vertical?1:-1,S=b.charSpacing,x=b.wordSpacing,E=b.textHScale*y,C=b.fontMatrix||p.FONT_IDENTITY_MATRIX,T=d.length;if(b.textRenderingMode!==p.TextRenderingMode.INVISIBLE&&0!==v){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,f.save(),f.transform(...b.textMatrix),f.translate(b.x,b.y),f.scale(E,y),c=0;c<T;++c){if("number"==typeof(u=d[c])){m=_*u*v/1e3,this.ctx.translate(m,0),b.x+=m*E;continue}let y=(u.isSpace?x:0)+S,T=A.charProcOperatorList[u.operatorListId];if(!T){(0,p.warn)(`Type3 character "${u.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=u,this.save(),f.scale(v,v),f.transform(...C),this.executeOperatorList(T),this.restore()),g=p.Util.applyTransform([u.width,0],C)[0]*v+y,f.translate(g,0),b.x+=g*E}f.restore(),this.processingType3=null}}setCharWidth(d,c){}setCharWidthAndBounds(d,c,u,p,g,m){this.ctx.rect(u,p,g-u,m-p),this.ctx.clip(),this.endPath()}getColorN_Pattern(d){let c;if("TilingPattern"===d[0]){let u=d[1],p=this.baseTransform||(0,g.getCurrentTransform)(this.ctx),f={createCanvasGraphics:d=>new G(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};c=new m.TilingPattern(d,u,this.ctx,f,p)}else c=this._getPattern(d[1],d[2]);return c}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(d,c,u){let g=p.Util.makeHexColor(d,c,u);this.ctx.strokeStyle=g,this.current.strokeColor=g}setFillRGBColor(d,c,u){let g=p.Util.makeHexColor(d,c,u);this.ctx.fillStyle=g,this.current.fillColor=g,this.current.patternFill=!1}_getPattern(d,c=null){let u;return this.cachedPatterns.has(d)?u=this.cachedPatterns.get(d):(u=(0,m.getShadingPattern)(this.getObject(d)),this.cachedPatterns.set(d,u)),c&&(u.matrix=c),u}shadingFill(d){if(!this.contentVisible)return;let c=this.ctx;this.save(),c.fillStyle=this._getPattern(d).getPattern(c,this,(0,g.getCurrentTransformInverse)(c),m.PathType.SHADING);let u=(0,g.getCurrentTransformInverse)(c);if(u){let{width:d,height:g}=c.canvas,[m,f,b,A]=p.Util.getAxialAlignedBoundingBox([0,0,d,g],u);this.ctx.fillRect(m,f,b-m,A-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore(
2)}beginInlineImage(){(0,p.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,p.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(d,c){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(d)&&6===d.length&&this.transform(...d),this.baseTransform=(0,g.getCurrentTransform)(this.ctx),c)){let d=c[2]-c[0],u=c[3]-c[1];this.ctx.rect(c[0],c[1],d,u),this.current.updateRectMinMax((0,g.getCurrentTransform)(this.ctx),c),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(d){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let c=this.ctx;d.isolated||(0,p.info)("TODO: Support non-isolated groups."),d.knockout&&(0,p.warn)("Knockout groups not supported.");let u=(0,g.getCurrentTransform)(c);if(d.matrix&&c.transform(...d.matrix),!d.bbox)throw Error("Bounding box is required.");let m=p.Util.getAxialAlignedBoundingBox(d.bbox,(0,g.getCurrentTransform)(c)),f=[0,0,c.canvas.width,c.canvas.height],b=Math.floor((m=p.Util.intersect(m,f)||[0,0,0,0])[0]),A=Math.floor(m[1]),y=Math.max(Math.ceil(m[2])-b,1),_=Math.max(Math.ceil(m[3])-A,1),S=1,x=1;y>v&&(S=y/v,y=v),_>v&&(x=_/v,_=v),this.current.startNewPathAndClipBox([0,0,y,_]);let E="groupAt"+this.groupLevel;d.smask&&(E+="_smask_"+this.smaskCounter++%2);let C=this.cachedCanvases.getCanvas(E,y,_),T=C.context;T.scale(1/S,1/x),T.translate(-b,-A),T.transform(...u),d.smask?this.smaskStack.push({canvas:C.canvas,context:T,offsetX:b,offsetY:A,scaleX:S,scaleY:x,subtype:d.smask.subtype,backdrop:d.smask.backdrop,transferMap:d.smask.transferMap||null,startTransformInverse:null}):(c.setTransform(1,0,0,1,0,0),c.translate(b,A),c.scale(S,x),c.save()),F(c,T),this.ctx=T,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(c),this.groupLevel++}endGroup(d){if(!this.contentVisible)return;this.groupLevel--;let c=this.ctx,u=this.groupStack.pop();if(this.ctx=u,this.ctx.imageSmoothingEnabled=!1,d.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let d=(0,g.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...d);let u=p.Util.getAxialAlignedBoundingBox([0,0,c.canvas.width,c.canvas.height],d);this.ctx.drawImage(c.canvas,0,0),this.ctx.restore(),this.compose(u)}}beginAnnotation(d,c,u,m,f){if(this.#t9(),R(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(c)&&4===c.length){let m=c[2]-c[0],b=c[3]-c[1];if(f&&this.annotationCanvasMap){u=u.slice(),u[4]-=c[0],u[5]-=c[1],(c=c.slice())[0]=c[1]=0,c[2]=m,c[3]=b;let[f,A]=p.Util.singularValueDecompose2dScale((0,g.getCurrentTransform)(this.ctx)),{viewportScale:v}=this,y=Math.ceil(m*this.outputScaleX*v),_=Math.ceil(b*this.outputScaleY*v);this.annotationCanvas=this.canvasFactory.create(y,_);let{canvas:S,context:x}=this.annotationCanvas;this.annotationCanvasMap.set(d,S),this.annotationCanvas.savedCtx=this.ctx,this.ctx=x,this.ctx.save(),this.ctx.setTransform(f,0,0,-A,0,b*A),R(this.ctx)}else R(this.ctx),this.ctx.rect(c[0],c[1],m,b),this.ctx.clip(),this.endPath()}this.current=new P(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...u),this.transform(...m)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#et(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(d){if(!this.contentVisible)return;let c=d.count;(d=this.getObject(d.data,d)).count=c;let u=this.ctx,p=this.processingType3;if(p&&(void 0===p.compiled&&(p.compiled=w(d)),p.compiled))return void p.compiled(u);let g=this._createMaskCanvas(d),m=g.canvas;u.save(),u.setTransform(1,0,0,1,0,0),u.drawImage(m,g.offsetX,g.offsetY),u.restore(),this.compose()}paintImageMaskXObjectRepeat(d,c,u=0,m=0,f,b){if(!this.contentVisible)return;d=this.getObject(d.data,d);let A=this.ctx;A.save();let v=(0,g.getCurrentTransform)(A);A.transform(c,u,m,f,0,0);let y=this._createMaskCanvas(d);A.setTransform(1,0,0,1,y.offsetX-v[4],y.offsetY-v[5]);for(let d=0,g=b.length;d<g;d+=2){let g=p.Util.transform(v,[c,u,m,f,b[d],b[d+1]]),[_,S]=p.Util.applyTransform([0,0],g);A.drawImage(y.canvas,_,S)}
2A.restore(),this.compose()}paintImageMaskXObjectGroup(d){if(!this.contentVisible)return;let c=this.ctx,u=this.current.fillColor,p=this.current.patternFill;for(let f of d){let{data:d,width:b,height:A,transform:v}=f,y=this.cachedCanvases.getCanvas("maskCanvas",b,A),_=y.context;_.save(),k(_,this.getObject(d,f)),_.globalCompositeOperation="source-in",_.fillStyle=p?u.getPattern(_,this,(0,g.getCurrentTransformInverse)(c),m.PathType.FILL):u,_.fillRect(0,0,b,A),_.restore(),c.save(),c.transform(...v),c.scale(1,-1),T(c,y.canvas,0,0,b,A,0,-1,1,1),c.restore()}this.compose()}paintImageXObject(d){if(!this.contentVisible)return;let c=this.getObject(d);c?this.paintInlineImageXObject(c):(0,p.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(d,c,u,g){if(!this.contentVisible)return;let m=this.getObject(d);if(!m)return void(0,p.warn)("Dependent image isn't ready yet");let f=m.width,b=m.height,A=[];for(let d=0,p=g.length;d<p;d+=2)A.push({transform:[c,0,0,u,g[d],g[d+1]],x:0,y:0,w:f,h:b});this.paintInlineImageXObjectGroup(m,A)}applyTransferMapsToCanvas(d){return"none"!==this.current.transferMaps&&(d.filter=this.current.transferMaps,d.drawImage(d.canvas,0,0),d.filter="none"),d.canvas}applyTransferMapsToBitmap(d){if("none"===this.current.transferMaps)return d.bitmap;let{bitmap:c,width:u,height:p}=d,g=this.cachedCanvases.getCanvas("inlineImage",u,p),m=g.context;return m.filter=this.current.transferMaps,m.drawImage(c,0,0),m.filter="none",g.canvas}paintInlineImageXObject(d){let c;if(!this.contentVisible)return;let u=d.width,m=d.height,f=this.ctx;if(this.save(),!p.isNodeJS){let{filter:d}=f;"none"!==d&&""!==d&&(f.filter="none")}if(f.scale(1/u,-1/m),d.bitmap)c=this.applyTransferMapsToBitmap(d);else if("function"==typeof HTMLElement&&d instanceof HTMLElement||!d.data)c=d;else{let p=this.cachedCanvases.getCanvas("inlineImage",u,m).context;M(p,d),c=this.applyTransferMapsToCanvas(p)}let b=this._scaleImage(c,(0,g.getCurrentTransformInverse)(f));f.imageSmoothingEnabled=B((0,g.getCurrentTransform)(f),d.interpolate),T(f,b.img,0,0,b.paintWidth,b.paintHeight,0,-m,u,m),this.compose(),this.restore()}paintInlineImageXObjectGroup(d,c){let u;if(!this.contentVisible)return;let p=this.ctx;if(d.bitmap)u=d.bitmap;else{let c=d.width,p=d.height,g=this.cachedCanvases.getCanvas("inlineImage",c,p).context;M(g,d),u=this.applyTransferMapsToCanvas(g)}for(let d of c)p.save(),p.transform(...d.transform),p.scale(1,-1),T(p,u,d.x,d.y,d.w,d.h,0,-1,1,1),p.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(d){}markPointProps(d,c){}beginMarkedContent(d){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(d,c){"OC"===d?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(c)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(d){let c=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(d);let u=this.ctx;this.pendingClip&&(c||(this.pendingClip===H?u.clip("evenodd"):u.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),u.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let d=(0,g.getCurrentTransform)(this.ctx);if(0===d[1]&&0===d[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(d[0]),Math.abs(d[3]));else{let c=Math.abs(d[0]*d[3]-d[2]*d[1]),u=Math.hypot(d[0],d[2]),p=Math.hypot(d[1],d[3]);this._cachedGetSinglePixelWidth=Math.max(u,p)/c}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let d,c,{lineWidth:u}=this.current,{a:p,b:g,c:m,d:f}=this.ctx.getTransform();if(0===g&&0===m){let g=Math.abs(p),m=Math.abs(f);if(g===m)if(0===u)d=c=1/g;else{let p=g*u;d=c=p<1?1/p:1}else if(0===u)d=1/g,c=1/m;else{let p=g*u,f=m*u;d=p<1?1/p:1,c=f<1?1/f:1}}else{let b=Math.abs(p*f-g*m),A=Math.hypot(p,g),v=Math.hypot(m,f);if(0===u)d=v/b,c=A/b;else{let p=u*b;d=v>p?v/p:1,c=A>p?A/p:1}}this._cachedScaleForStroking[0]=d,this._cachedScaleForStroking[1]=c}return this._cachedScaleForStroking}rescaleAndStroke(d){let{ctx:c}=this,{lineWidth:u}=this.current,[p,g]=this.getScaleForStroking();if(c.lineWidth=u||1,1===p&&1===g)return void c.stroke();let m=c.getLineDash();if(d&&c.save(),c.scale(p,g),m.length>0){let d=Math.max(p,g);c.setLineDash(m.map(c=>c/d)),c.lineDashOffset/=d}
2c.stroke(),d&&c.restore()}isContentVisible(){for(let d=this.markedContentStack.length-1;d>=0;d--)if(!this.markedContentStack[d].visible)return!1;return!0}}for(let d in c.CanvasGraphics=G,p.OPS)void 0!==G.prototype[d]&&(G.prototype[p.OPS[d]]=G.prototype[d])},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TilingPattern=c.PathType=void 0,c.getShadingPattern=x;var p=u(1),g=u(6);let m={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function f(d,c){if(!c)return;let u=c[2]-c[0],p=c[3]-c[1],g=new Path2D;g.rect(c[0],c[1],u,p),d.clip(g)}c.PathType=m;class b{constructor(){this.constructor===b&&(0,p.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,p.unreachable)("Abstract method `getPattern` called.")}}class A extends b{constructor(d){super(),this._type=d[1],this._bbox=d[2],this._colorStops=d[3],this._p0=d[4],this._p1=d[5],this._r0=d[6],this._r1=d[7],this.matrix=null}_createGradient(d){let c;for(let u of("axial"===this._type?c=d.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(c=d.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))c.addColorStop(u[0],u[1]);return c}getPattern(d,c,u,b){let A;if(b===m.STROKE||b===m.FILL){let m=c.current.getClippedPathBoundingBox(b,(0,g.getCurrentTransform)(d))||[0,0,0,0],v=Math.ceil(m[2]-m[0])||1,y=Math.ceil(m[3]-m[1])||1,_=c.cachedCanvases.getCanvas("pattern",v,y,!0),S=_.context;S.clearRect(0,0,S.canvas.width,S.canvas.height),S.beginPath(),S.rect(0,0,S.canvas.width,S.canvas.height),S.translate(-m[0],-m[1]),u=p.Util.transform(u,[1,0,0,1,m[0],m[1]]),S.transform(...c.baseTransform),this.matrix&&S.transform(...this.matrix),f(S,this._bbox),S.fillStyle=this._createGradient(S),S.fill(),A=d.createPattern(_.canvas,"no-repeat");let x=new DOMMatrix(u);A.setTransform(x)}else f(d,this._bbox),A=this._createGradient(d);return A}}function v(d,c,u,p,g,m,f,b){let A,v,y,_,S,x,E,C,T,w=c.coords,P=c.colors,M=d.data,k=4*d.width;w[u+1]>w[p+1]&&(A=u,u=p,p=A,A=m,m=f,f=A),w[p+1]>w[g+1]&&(A=p,p=g,g=A,A=f,f=b,b=A),w[u+1]>w[p+1]&&(A=u,u=p,p=A,A=m,m=f,f=A);let F=(w[u]+c.offsetX)*c.scaleX,R=(w[u+1]+c.offsetY)*c.scaleY,I=(w[p]+c.offsetX)*c.scaleX,D=(w[p+1]+c.offsetY)*c.scaleY,L=(w[g]+c.offsetX)*c.scaleX,O=(w[g+1]+c.offsetY)*c.scaleY;if(R>=O)return;let N=P[m],B=P[m+1],U=P[m+2],j=P[f],z=P[f+1],H=P[f+2],G=P[b],$=P[b+1],W=P[b+2],V=Math.round(R),q=Math.round(O);for(let d=V;d<=q;d++){let c;if(d<D){let c=d<R?0:(R-d)/(R-D);v=F-(F-I)*c,y=N-(N-j)*c,_=B-(B-z)*c,S=U-(U-H)*c}else{let c;v=I-(I-L)*(c=d>O?1:D===O?0:(D-d)/(D-O)),y=j-(j-G)*c,_=z-(z-$)*c,S=H-(H-W)*c}x=F-(F-L)*(c=d<R?0:d>O?1:(R-d)/(R-O)),E=N-(N-G)*c,C=B-(B-$)*c,T=U-(U-W)*c;let u=Math.round(Math.min(v,x)),p=Math.round(Math.max(v,x)),g=k*d+4*u;for(let d=u;d<=p;d++)(c=(v-d)/(v-x))<0?c=0:c>1&&(c=1),M[g++]=y-(y-E)*c|0,M[g++]=_-(_-C)*c|0,M[g++]=S-(S-T)*c|0,M[g++]=255}}function y(d,c,u){let p,g,m=c.coords,f=c.colors;switch(c.type){case"lattice":let b=c.verticesPerRow,A=Math.floor(m.length/b)-1,y=b-1;for(p=0;p<A;p++){let c=p*b;for(let p=0;p<y;p++,c++)v(d,u,m[c],m[c+1],m[c+b],f[c],f[c+1],f[c+b]),v(d,u,m[c+b+1],m[c+1],m[c+b],f[c+b+1],f[c+1],f[c+b])}break;case"triangles":for(p=0,g=m.length;p<g;p+=3)v(d,u,m[p],m[p+1],m[p+2],f[p],f[p+1],f[p+2]);break;default:throw Error("illegal figure")}}class _ extends b{constructor(d){super(),this._coords=d[2],this._colors=d[3],this._figures=d[4],this._bounds=d[5],this._bbox=d[7],this._background=d[8],this.matrix=null}_createMeshCanvas(d,c,u){let p=1.1,g=3e3,m=2,f=Math.floor(this._bounds[0]),b=Math.floor(this._bounds[1]),A=Math.ceil(this._bounds[2])-f,v=Math.ceil(this._bounds[3])-b,_=Math.min(Math.ceil(Math.abs(A*d[0]*p)),g),S=Math.min(Math.ceil(Math.abs(v*d[1]*p)),g),x=A/_,E=v/S,C={coords:this._coords,colors:this._colors,offsetX:-f,offsetY:-b,scaleX:1/x,scaleY:1/E},T=_+2*m,w=S+2*m,P=u.getCanvas("mesh",T,w,!1),M=P.context,k=M.createImageData(_,S);if(c){let d=k.data;for(let u=0,p=d.length;u<p;u+=4)d[u]=c[0],d[u+1]=c[1],d[u+2]=c[2],d[u+3]=255}for(let d of this._figures)y(k,d,C);return M.putImageData(k,m,m),{canvas:P.canvas,offsetX:f-m*x,offsetY:b-m*E,scaleX:x,scaleY:E}}getPattern(d,c,u,b){let A;if(f(d,this._bbox),b===m.SHADING)A=p.Util.singularValueDecompose2dScale((0,g.getCurrentTransform)(d));else if(A=p.Util.singularValueDecompose2dScale(c.baseTransform),this.matrix
2){let d=p.Util.singularValueDecompose2dScale(this.matrix);A=[A[0]*d[0],A[1]*d[1]]}let v=this._createMeshCanvas(A,b===m.SHADING?null:this._background,c.cachedCanvases);return b!==m.SHADING&&(d.setTransform(...c.baseTransform),this.matrix&&d.transform(...this.matrix)),d.translate(v.offsetX,v.offsetY),d.scale(v.scaleX,v.scaleY),d.createPattern(v.canvas,"no-repeat")}}class S extends b{getPattern(){return"hotpink"}}function x(d){switch(d[0]){case"RadialAxial":return new A(d);case"Mesh":return new _(d);case"Dummy":return new S}throw Error(`Unknown IR type: ${d[0]}`)}let E=1,C=2;class T{static MAX_PATTERN_SIZE=3e3;constructor(d,c,u,p,g){this.operatorList=d[2],this.matrix=d[3]||[1,0,0,1,0,0],this.bbox=d[4],this.xstep=d[5],this.ystep=d[6],this.paintType=d[7],this.tilingType=d[8],this.color=c,this.ctx=u,this.canvasGraphicsFactory=p,this.baseTransform=g}createPatternCanvas(d){let c=this.operatorList,u=this.bbox,m=this.xstep,f=this.ystep,b=this.paintType,A=this.tilingType,v=this.color,y=this.canvasGraphicsFactory;(0,p.info)("TilingType: "+A);let _=u[0],S=u[1],x=u[2],E=u[3],C=p.Util.singularValueDecompose2dScale(this.matrix),T=p.Util.singularValueDecompose2dScale(this.baseTransform),w=[C[0]*T[0],C[1]*T[1]],P=this.getSizeAndScale(m,this.ctx.canvas.width,w[0]),M=this.getSizeAndScale(f,this.ctx.canvas.height,w[1]),k=d.cachedCanvases.getCanvas("pattern",P.size,M.size,!0),F=k.context,R=y.createCanvasGraphics(F);R.groupLevel=d.groupLevel,this.setFillAndStrokeStyleToContext(R,b,v);let I=_,D=S,L=x,O=E;return _<0&&(I=0,L+=Math.abs(_)),S<0&&(D=0,O+=Math.abs(S)),F.translate(-(P.scale*I),-(M.scale*D)),R.transform(P.scale,0,0,M.scale,0,0),F.save(),this.clipBbox(R,I,D,L,O),R.baseTransform=(0,g.getCurrentTransform)(R.ctx),R.executeOperatorList(c),R.endDrawing(),{canvas:k.canvas,scaleX:P.scale,scaleY:M.scale,offsetX:I,offsetY:D}}getSizeAndScale(d,c,u){d=Math.abs(d);let p=Math.max(T.MAX_PATTERN_SIZE,c),g=Math.ceil(d*u);return g>=p?g=p:u=g/d,{scale:u,size:g}}clipBbox(d,c,u,p,m){let f=p-c,b=m-u;d.ctx.rect(c,u,f,b),d.current.updateRectMinMax((0,g.getCurrentTransform)(d.ctx),[c,u,p,m]),d.clip(),d.endPath()}setFillAndStrokeStyleToContext(d,c,u){let g=d.ctx,m=d.current;switch(c){case E:let f=this.ctx;g.fillStyle=f.fillStyle,g.strokeStyle=f.strokeStyle,m.fillColor=f.fillStyle,m.strokeColor=f.strokeStyle;break;case C:let b=p.Util.makeHexColor(u[0],u[1],u[2]);g.fillStyle=b,g.strokeStyle=b,m.fillColor=b,m.strokeColor=b;break;default:throw new p.FormatError(`Unsupported paint type: ${c}`)}}getPattern(d,c,u,g){let f=u;g!==m.SHADING&&(f=p.Util.transform(f,c.baseTransform),this.matrix&&(f=p.Util.transform(f,this.matrix)));let b=this.createPatternCanvas(c),A=new DOMMatrix(f);A=(A=A.translate(b.offsetX,b.offsetY)).scale(1/b.scaleX,1/b.scaleY);let v=d.createPattern(b.canvas,"repeat");return v.setTransform(A),v}}c.TilingPattern=T},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.convertBlackAndWhiteToRGBA=m,c.convertToRGBA=g,c.grayToRGBA=b;var p=u(1);function g(d){switch(d.kind){case p.ImageKind.GRAYSCALE_1BPP:return m(d);case p.ImageKind.RGB_24BPP:return f(d)}return null}function m({src:d,srcPos:c=0,dest:u,width:g,height:f,nonBlackColor:b=0xffffffff,inverseDecode:A=!1}){let v=p.FeatureTest.isLittleEndian?0xff000000:255,[y,_]=A?[b,v]:[v,b],S=g>>3,x=7&g,E=d.length;u=new Uint32Array(u.buffer);let C=0;for(let p=0;p<f;p++){for(let p=c+S;c<p;c++){let p=c<E?d[c]:255;u[C++]=128&p?_:y,u[C++]=64&p?_:y,u[C++]=32&p?_:y,u[C++]=16&p?_:y,u[C++]=8&p?_:y,u[C++]=4&p?_:y,u[C++]=2&p?_:y,u[C++]=1&p?_:y}if(0===x)continue;let p=c<E?d[c++]:255;for(let d=0;d<x;d++)u[C++]=p&1<<7-d?_:y}return{srcPos:c,destPos:C}}function f({src:d,srcPos:c=0,dest:u,destPos:g=0,width:m,height:b}){let A=0,v=d.length>>2,y=new Uint32Array(d.buffer,c,v);if(p.FeatureTest.isLittleEndian){for(;A<v-2;A+=3,g+=4){let d=y[A],c=y[A+1],p=y[A+2];u[g]=0xff000000|d,u[g+1]=d>>>24|c<<8|0xff000000,u[g+2]=c>>>16|p<<16|0xff000000,u[g+3]=p>>>8|0xff000000}for(let c=4*A,p=d.length;c<p;c+=3)u[g++]=d[c]|d[c+1]<<8|d[c+2]<<16|0xff000000}else{for(;A<v-2;A+=3,g+=4){let d=y[A],c=y[A+1],p=y[A+2];u[g]=255|d,u[g+1]=d<<24|c>>>8|255,u[g+2]=c<<16|p>>>16|255,u[g+3]=p<<8|255}for(let c=4*A,p=d.length;c<p;c+=3)u[g++]=d[c]<<24|d[c+1]<<16|d[c+2]<<8|255}return{srcPos:c,destPos:g}}function b(d,c){if(p.FeatureTest.isLittleEndian)for(let u=0,p=d.length;u<p;u++)c[u]=65793*d[u]|0xff000000;else for(let u=0,p=d.length;u<p;u++)c[u]=0x1010100*d[u]|255}},(d,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.GlobalWorkerOptions=void 0;let u=Object.create(null);c.GlobalWorkerOptions=u,u.workerPort=null,u.workerSrc=""},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.MessageHandler=void 0;var p=u(1);let g=1,m=2,f=1,b=2,A=3,v=4,y=5,_=6,S=7,x=8;function E(d){switch(!(d instanceof Error||"object"==typeof d&&null!==d)&&(0,p.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),d.name){case"AbortException":return new p.AbortException(d.message);case"MissingPDFException":return new p.MissingPDFException(d.message);case"PasswordException":return new p.PasswordException(d.message,d.code);case"UnexpectedResponseException":return new p.UnexpectedResponseException(d.message,d.status);case"UnknownErrorException":return new p.UnknownErrorException(d.message,d.details);default:return new p.UnknownErrorException(d.message,d.toString())}}class C{constructor(d,c,u){this.sourceName=d,this.targetName=c,this.comObj=u,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=d=>{let c=d.data;if(c.targetName!==this.sourceName)return;if(c.stream)return void this.#ee(c);if(c.callback){let d=c.callbackId,u=this.callbackCapabilities[d];if(!u)throw Error(`Cannot resolve callback ${d}`);if(delete this.callbackCapabilities[d],c.callback===g)u.resolve(c.data);else if(c.callback===m)u.reject(E(c.reason));else throw Error("Unexpected callback case");return}let p=this.actionHandler[c.action];if(!p)throw Error(`Unknown action from worker: ${c.action}`);if(c.callbackId){let d=this.sourceName,f=c.sourceName;new Promise(function(d){d(p(c.data))}).then(function(p){u.postMessage({sourceName:d,targetName:f,callback:g,callbackId:c.callbackId,data:p})},function(p){u.postMessage({sourceName:d,targetName:f,callback:m,callbackId:c.callbackId,reason:E(p)})});return}c.streamId?this.#ei(c):p(c.data)},u.addEventListener("message",this._onComObjOnMessage)}on(d,c){let u=this.actionHandler;if(u[d])throw Error(`There is already an actionName called "${d}"`);u[d]=c}send(d,c,u){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:d,data:c},u)}
2sendWithPromise(d,c,u){let g=this.callbackId++,m=new p.PromiseCapability;this.callbackCapabilities[g]=m;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:d,callbackId:g,data:c},u)}catch(d){m.reject(d)}return m.promise}sendWithStream(d,c,u,g){let m=this.streamId++,b=this.sourceName,A=this.targetName,v=this.comObj;return new ReadableStream({start:u=>{let f=new p.PromiseCapability;return this.streamControllers[m]={controller:u,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},v.postMessage({sourceName:b,targetName:A,action:d,streamId:m,data:c,desiredSize:u.desiredSize},g),f.promise},pull:d=>{let c=new p.PromiseCapability;return this.streamControllers[m].pullCall=c,v.postMessage({sourceName:b,targetName:A,stream:_,streamId:m,desiredSize:d.desiredSize}),c.promise},cancel:d=>{(0,p.assert)(d instanceof Error,"cancel must have a valid reason");let c=new p.PromiseCapability;return this.streamControllers[m].cancelCall=c,this.streamControllers[m].isClosed=!0,v.postMessage({sourceName:b,targetName:A,stream:f,streamId:m,reason:E(d)}),c.promise}},u)}#ei(d){let c=d.streamId,u=this.sourceName,g=d.sourceName,m=this.comObj,f=this,b=this.actionHandler[d.action],_={enqueue(d,f=1,b){if(this.isCancelled)return;let A=this.desiredSize;this.desiredSize-=f,A>0&&this.desiredSize<=0&&(this.sinkCapability=new p.PromiseCapability,this.ready=this.sinkCapability.promise),m.postMessage({sourceName:u,targetName:g,stream:v,streamId:c,chunk:d},b)},close(){this.isCancelled||(this.isCancelled=!0,m.postMessage({sourceName:u,targetName:g,stream:A,streamId:c}),delete f.streamSinks[c])},error(d){(0,p.assert)(d instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,m.postMessage({sourceName:u,targetName:g,stream:y,streamId:c,reason:E(d)}))},sinkCapability:new p.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:d.desiredSize,ready:null};_.sinkCapability.resolve(),_.ready=_.sinkCapability.promise,this.streamSinks[c]=_,new Promise(function(c){c(b(d.data,_))}).then(function(){m.postMessage({sourceName:u,targetName:g,stream:x,streamId:c,success:!0})},function(d){m.postMessage({sourceName:u,targetName:g,stream:x,streamId:c,reason:E(d)})})}#ee(d){let c=d.streamId,u=this.sourceName,g=d.sourceName,m=this.comObj,C=this.streamControllers[c],T=this.streamSinks[c];switch(d.stream){case x:d.success?C.startCall.resolve():C.startCall.reject(E(d.reason));break;case S:d.success?C.pullCall.resolve():C.pullCall.reject(E(d.reason));break;case _:if(!T){m.postMessage({sourceName:u,targetName:g,stream:S,streamId:c,success:!0});break}T.desiredSize<=0&&d.desiredSize>0&&T.sinkCapability.resolve(),T.desiredSize=d.desiredSize,new Promise(function(d){d(T.onPull?.())}).then(function(){m.postMessage({sourceName:u,targetName:g,stream:S,streamId:c,success:!0})},function(d){m.postMessage({sourceName:u,targetName:g,stream:S,streamId:c,reason:E(d)})});break;case v:if((0,p.assert)(C,"enqueue should have stream controller"),C.isClosed)break;C.controller.enqueue(d.chunk);break;case A:if((0,p.assert)(C,"close should have stream controller"),C.isClosed)break;C.isClosed=!0,C.controller.close(),this.#es(C,c);break;case y:(0,p.assert)(C,"error should have stream controller"),C.controller.error(E(d.reason)),this.#es(C,c);break;case b:d.success?C.cancelCall.resolve():C.cancelCall.reject(E(d.reason)),this.#es(C,c);break;case f:if(!T)break;new Promise(function(c){c(T.onCancel?.(E(d.reason)))}).then(function(){m.postMessage({sourceName:u,targetName:g,stream:b,streamId:c,success:!0})},function(d){m.postMessage({sourceName:u,targetName:g,stream:b,streamId:c,reason:E(d)})}),T.sinkCapability.reject(E(d.reason)),T.isCancelled=!0,delete this.streamSinks[c];break;default:throw Error("Unexpected stream case")}}async #es(d,c){await Promise.allSettled([d.startCall?.promise,d.pullCall?.promise,d.cancelCall?.promise]),delete this.streamControllers[c]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}c.MessageHandler=C},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Metadata=void 0;var p=u(1);class g{#er;#ea;constructor({parsedData:d,rawData:c}){this.#er=d,this.#ea=c}getRaw(){return this.#ea}get(d){return this.#er.get(d)??null}getAll(){return(0,p.objectFromMap)(this.#er)}has(d){return this.#er.has(d)}}c.Metadata=g},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionalContentConfig=void 0;var p=u(1),g=u(8);let m=Symbol("INTERNAL");class f{#en=!0;constructor(d,c){this.name=d,this.intent=c}get visible(){return this.#en}_setVisible(d,c){d!==m&&(0,p.unreachable)("Internal method `_setVisible` called."),this.#en=c}}class b{#eo=null;#el=new Map;#eh=null;#ed=null;constructor(d){if(this.name=null,this.creator=null,null===d)return;for(const c of(this.name=d.name,this.creator=d.creator,this.#ed=d.order,d.groups))this.#el.set(c.id,new f(c.name,c.intent));if("OFF"===d.baseState)for(const d of this.#el.values())d._setVisible(m,!1);for(const c of d.on)this.#el.get(c)._setVisible(m,!0);for(const c of d.off)this.#el.get(c)._setVisible(m,!1);this.#eh=this.getHash()}#ec(d){let c=d.length;if(c<2)return!0;let u=d[0];for(let g=1;g<c;g++){let c,m=d[g];if(Array.isArray(m))c=this.#ec(m);else{if(!this.#el.has(m))return(0,p.warn)(`Optional content group not found: ${m}`),!0;c=this.#el.get(m).visible}switch(u){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return"And"===u}isVisible(d){if(0===this.#el.size)return!0;
2if(!d)return(0,p.warn)("Optional content group not defined."),!0;if("OCG"===d.type)return this.#el.has(d.id)?this.#el.get(d.id).visible:((0,p.warn)(`Optional content group not found: ${d.id}`),!0);if("OCMD"===d.type){if(d.expression)return this.#ec(d.expression);if(d.policy&&"AnyOn"!==d.policy){if("AllOn"===d.policy){for(let c of d.ids){if(!this.#el.has(c)){(0,p.warn)(`Optional content group not found: ${c}`);break}if(!this.#el.get(c).visible)return!1}return!0}else if("AnyOff"===d.policy){for(let c of d.ids){if(!this.#el.has(c))return(0,p.warn)(`Optional content group not found: ${c}`),!0;if(!this.#el.get(c).visible)return!0}return!1}else if("AllOff"===d.policy){for(let c of d.ids){if(!this.#el.has(c)){(0,p.warn)(`Optional content group not found: ${c}`);break}if(this.#el.get(c).visible)return!1}return!0}}else{for(let c of d.ids){if(!this.#el.has(c))return(0,p.warn)(`Optional content group not found: ${c}`),!0;if(this.#el.get(c).visible)return!0}return!1}return(0,p.warn)(`Unknown optional content policy ${d.policy}.`),!0}return(0,p.warn)(`Unknown group type ${d.type}.`),!0}setVisibility(d,c=!0){this.#el.has(d)?(this.#el.get(d)._setVisible(m,!!c),this.#eo=null):(0,p.warn)(`Optional content group not found: ${d}`)}get hasInitialVisibility(){return null===this.#eh||this.getHash()===this.#eh}getOrder(){return this.#el.size?this.#ed?this.#ed.slice():[...this.#el.keys()]:null}getGroups(){return this.#el.size>0?(0,p.objectFromMap)(this.#el):null}getGroup(d){return this.#el.get(d)||null}getHash(){if(null!==this.#eo)return this.#eo;let d=new g.MurmurHash3_64;for(let[c,u]of this.#el)d.update(`${c}:${u.visible}`);return this.#eo=d.hexdigest()}}c.OptionalContentConfig=b},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PDFDataTransportStream=void 0;var p=u(1),g=u(6);class m{constructor({length:d,initialData:c,progressiveDone:u=!1,contentDispositionFilename:g=null,disableRange:m=!1,disableStream:f=!1},b){if((0,p.assert)(b,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=u,this._contentDispositionFilename=g,c?.length>0){const d=c instanceof Uint8Array&&c.byteLength===c.buffer.byteLength?c.buffer:new Uint8Array(c).buffer;this._queuedChunks.push(d)}this._pdfDataRangeTransport=b,this._isStreamingSupported=!f,this._isRangeSupported=!m,this._contentLength=d,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((d,c)=>{this._onReceiveData({begin:d,chunk:c})}),this._pdfDataRangeTransport.addProgressListener((d,c)=>{this._onProgress({loaded:d,total:c})}),this._pdfDataRangeTransport.addProgressiveReadListener(d=>{this._onReceiveData({chunk:d})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:d,chunk:c}){let u=c instanceof Uint8Array&&c.byteLength===c.buffer.byteLength?c.buffer:new Uint8Array(c).buffer;if(void 0===d)this._fullRequestReader?this._fullRequestReader._enqueue(u):this._queuedChunks.push(u);else{let c=this._rangeReaders.some(function(c){return c._begin===d&&(c._enqueue(u),!0)});(0,p.assert)(c,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(d){void 0===d.total?this._rangeReaders[0]?.onProgress?.({loaded:d.loaded}):this._fullRequestReader?.onProgress?.({loaded:d.loaded,total:d.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(d){let c=this._rangeReaders.indexOf(d);c>=0&&this._rangeReaders.splice(c,1)}getFullReader(){(0,p.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let d=this._queuedChunks;return this._queuedChunks=null,new f(this,d,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(d,c){if(c<=this._progressiveDataLength)return null;let u=new b(this,d,c);return this._pdfDataRangeTransport.requestDataRange(d,c),this._rangeReaders.push(u),u}cancelAllRequests(d){for(let c of(this._fullRequestReader?.cancel(d),this._rangeReaders.slice(0)))c.cancel(d);this._pdfDataRangeTransport.abort()}}c.PDFDataTransportStream=m;class f{constructor(d,c,u=!1,p=null){for(const m of(this._stream=d,this._done=u||!1,this._filename=(0,g.isPdfFile)(p)?p:null,this._queuedChunks=c||[],this._loaded=0,this._queuedChunks))this._loaded+=m.byteLength;
2this._requests=[],this._headersReady=Promise.resolve(),d._fullRequestReader=this,this.onProgress=null}_enqueue(d){this._done||(this._requests.length>0?this._requests.shift().resolve({value:d,done:!1}):this._queuedChunks.push(d),this._loaded+=d.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};let d=new p.PromiseCapability;return this._requests.push(d),d.promise}cancel(d){for(let d of(this._done=!0,this._requests))d.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class b{constructor(d,c,u){this._stream=d,this._begin=c,this._end=u,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(d){if(!this._done){if(0===this._requests.length)this._queuedChunk=d;else{for(let c of(this._requests.shift().resolve({value:d,done:!1}),this._requests))c.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let d=this._queuedChunk;return this._queuedChunk=null,{value:d,done:!1}}if(this._done)return{value:void 0,done:!0};let d=new p.PromiseCapability;return this._requests.push(d),d.promise}cancel(d){for(let d of(this._done=!0,this._requests))d.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PDFFetchStream=void 0;var p=u(1),g=u(20);function m(d,c,u){return{method:"GET",headers:d,signal:u.signal,mode:"cors",credentials:c?"include":"same-origin",redirect:"follow"}}function f(d){let c=new Headers;for(let u in d){let p=d[u];void 0!==p&&c.append(u,p)}return c}function b(d){return d instanceof Uint8Array?d.buffer:d instanceof ArrayBuffer?d:((0,p.warn)(`getArrayBuffer - unexpected data format: ${d}`),new Uint8Array(d).buffer)}class A{constructor(d){this.source=d,this.isHttp=/^https?:/i.test(d.url),this.httpHeaders=this.isHttp&&d.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new v(this),this._fullRequestReader}getRangeReader(d,c){if(c<=this._progressiveDataLength)return null;let u=new y(this,d,c);return this._rangeRequestReaders.push(u),u}cancelAllRequests(d){for(let c of(this._fullRequestReader?.cancel(d),this._rangeRequestReaders.slice(0)))c.cancel(d)}}c.PDFFetchStream=A;class v{constructor(d){this._stream=d,this._reader=null,this._loaded=0,this._filename=null;const c=d.source;this._withCredentials=c.withCredentials||!1,this._contentLength=c.length,this._headersCapability=new p.PromiseCapability,this._disableRange=c.disableRange||!1,this._rangeChunkSize=c.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!c.disableStream,this._isRangeSupported=!c.disableRange,this._headers=f(this._stream.httpHeaders);const u=c.url;fetch(u,m(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!(0,g.validateResponseStatus)(d.status))throw(0,g.createResponseStatusError)(d.status,u);this._reader=d.body.getReader(),this._headersCapability.resolve();let c=c=>d.headers.get(c),{allowRangeRequests:m,suggestedLength:f}=(0,g.validateRangeRequestCapabilities)({getResponseHeader:c,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=m,this._contentLength=f||this._contentLength,this._filename=(0,g.extractFilenameFromHeader)(c),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new p.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;let{value:d,done:c}=await this._reader.read();return c?{value:d,done:c}:(this._loaded+=d.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:b(d),done:!1})}cancel(d){this._reader?.cancel(d),this._abortController.abort()}}class y{constructor(d,c,u){this._stream=d,this._reader=null,this._loaded=0;const b=d.source;this._withCredentials=b.withCredentials||!1,this._readCapability=new p.PromiseCapability,this._isStreamingSupported=!b.disableStream,this._abortController=new AbortController,this._headers=f(this._stream.httpHeaders),this._headers.append("Range",`bytes=${c}-${u-1}`);const A=b.url;fetch(A,m(this._headers,this._withCredentials,this._abortController)).then(d=>{if(!(0,g.validateResponseStatus)(d.status))throw(0,g.createResponseStatusError)(d.status,A);this._readCapability.resolve(),this._reader=d.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:d,done:c}=await this._reader.read();return c?{value:d,done:c}:(this._loaded+=d.byteLength,this.onProgress?.({loaded:this._loaded}),{value:b(d),done:!1})}cancel(d){this._reader?.cancel(d),this._abortController.abort()}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createResponseStatusError=A,c.extractFilenameFromHeader=b,c.validateRangeRequestCapabilities=f,c.val
2idateResponseStatus=v;var p=u(1),g=u(21),m=u(6);function f({getResponseHeader:d,isHttp:c,rangeChunkSize:u,disableRange:p}){let g={allowRangeRequests:!1,suggestedLength:void 0},m=parseInt(d("Content-Length"),10);return Number.isInteger(m)&&(g.suggestedLength=m,m<=2*u||p||!c||"bytes"!==d("Accept-Ranges")||"identity"!==(d("Content-Encoding")||"identity")||(g.allowRangeRequests=!0)),g}function b(d){let c=d("Content-Disposition");if(c){let d=(0,g.getFilenameFromContentDispositionHeader)(c);if(d.includes("%"))try{d=decodeURIComponent(d)}catch{}if((0,m.isPdfFile)(d))return d}return null}function A(d,c){return 404===d||0===d&&c.startsWith("file:")?new p.MissingPDFException('Missing PDF "'+c+'".'):new p.UnexpectedResponseException(`Unexpected server response (${d}) while retrieving PDF "${c}".`,d)}function v(d){return 200===d||206===d}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getFilenameFromContentDispositionHeader=g;var p=u(1);function g(d){let c=!0,u=g("filename\\*","i").exec(d);if(u){let d=A(u=u[1]);return f(d=y(d=v(d=unescape(d))))}if(u=b(d))return f(y(u));if(u=g("filename","i").exec(d)){let d=A(u=u[1]);return f(d=y(d))}function g(d,c){return RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',c)}function m(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{let g=new TextDecoder(d,{fatal:!0}),m=(0,p.stringToBytes)(u);u=g.decode(m),c=!1}catch{}}return u}function f(d){return c&&/[\x80-\xff]/.test(d)&&(d=m("utf-8",d),c&&(d=m("iso-8859-1",d))),d}function b(d){let c,u=[],p=g("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(c=p.exec(d));){let[,d,p,g]=c;if((d=parseInt(d,10))in u){if(0===d)break;continue}u[d]=[p,g]}let m=[];for(let d=0;d<u.length&&d in u;++d){let[c,p]=u[d];p=A(p),c&&(p=unescape(p),0===d&&(p=v(p))),m.push(p)}return m.join("")}function A(d){if(d.startsWith('"')){let c=d.slice(1).split('\\"');for(let d=0;d<c.length;++d){let u=c[d].indexOf('"');-1!==u&&(c[d]=c[d].slice(0,u),c.length=d+1),c[d]=c[d].replaceAll(/\\(.)/g,"$1")}d=c.join('"')}return d}function v(d){let c=d.indexOf("'");return -1===c?d:m(d.slice(0,c),d.slice(c+1).replace(/^[^']*'/,""))}function y(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,c,u,p){if("q"===u||"Q"===u)return m(c,p=(p=p.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(d,c){return String.fromCharCode(parseInt(c,16))}));try{p=atob(p)}catch{}return m(c,p)})}return""}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PDFNetworkStream=void 0;var p=u(1),g=u(20);let m=200,f=206;function b(d){let c=d.response;return"string"!=typeof c?c:(0,p.stringToBytes)(c).buffer}class A{constructor(d,c={}){this.url=d,this.isHttp=/^https?:/i.test(d),this.httpHeaders=this.isHttp&&c.httpHeaders||Object.create(null),this.withCredentials=c.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(d,c,u){let p={begin:d,end:c};for(let d in u)p[d]=u[d];return this.request(p)}requestFull(d){return this.request(d)}request(d){let c=new XMLHttpRequest,u=this.currXhrId++,p=this.pendingRequests[u]={xhr:c};for(let d in c.open("GET",this.url),c.withCredentials=this.withCredentials,this.httpHeaders){let u=this.httpHeaders[d];void 0!==u&&c.setRequestHeader(d,u)}return this.isHttp&&"begin"in d&&"end"in d?(c.setRequestHeader("Range",`bytes=${d.begin}-${d.end-1}`),p.expectedStatus=f):p.expectedStatus=m,c.responseType="arraybuffer",d.onError&&(c.onerror=function(u){d.onError(c.status)}),c.onreadystatechange=this.onStateChange.bind(this,u),c.onprogress=this.onProgress.bind(this,u),p.onHeadersReceived=d.onHeadersReceived,p.onDone=d.onDone,p.onError=d.onError,p.onProgress=d.onProgress,c.send(null),u}onProgress(d,c){let u=this.pendingRequests[d];u&&u.onProgress?.(c)}onStateChange(d,c){let u=this.pendingRequests[d];if(!u)return;let p=u.xhr;if(p.readyState>=2&&u.onHeadersReceived&&(u.onHeadersReceived(),delete u.onHeadersReceived),4!==p.readyState||!(d in this.pendingRequests))return;if(delete this.pendingRequests[d],0===p.status&&this.isHttp)return void u.onError?.(p.status);let g=p.status||m;if((g!==m||u.expectedStatus!==f)&&g!==u.expectedStatus)return void u.onError?.(p.status);let A=b(p);if(g===f){let d=p.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(d);u.onDone({begin:parseInt(c[1],10),chunk:A})}else A?u.onDone({begin:0,chunk:A}):u.onError?.(p.status)}getRequestXhr(d){return this.pendingRequests[d].xhr}isPendingRequest(d){return d in this.pendingRequests}
2abortRequest(d){let c=this.pendingRequests[d].xhr;delete this.pendingRequests[d],c.abort()}}class v{constructor(d){this._source=d,this._manager=new A(d.url,{httpHeaders:d.httpHeaders,withCredentials:d.withCredentials}),this._rangeChunkSize=d.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(d){let c=this._rangeRequestReaders.indexOf(d);c>=0&&this._rangeRequestReaders.splice(c,1)}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new y(this._manager,this._source),this._fullRequestReader}getRangeReader(d,c){let u=new _(this._manager,d,c);return u.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(u),u}cancelAllRequests(d){for(let c of(this._fullRequestReader?.cancel(d),this._rangeRequestReaders.slice(0)))c.cancel(d)}}c.PDFNetworkStream=v;class y{constructor(d,c){this._manager=d;const u={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=c.url,this._fullRequestId=d.requestFull(u),this._headersReceivedCapability=new p.PromiseCapability,this._disableRange=c.disableRange||!1,this._contentLength=c.length,this._rangeChunkSize=c.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(){let d=this._fullRequestId,c=this._manager.getRequestXhr(d),u=d=>c.getResponseHeader(d),{allowRangeRequests:p,suggestedLength:m}=(0,g.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});p&&(this._isRangeSupported=!0),this._contentLength=m||this._contentLength,this._filename=(0,g.extractFilenameFromHeader)(u),this._isRangeSupported&&this._manager.abortRequest(d),this._headersReceivedCapability.resolve()}_onDone(d){if(d&&(this._requests.length>0?this._requests.shift().resolve({value:d.chunk,done:!1}):this._cachedChunks.push(d.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(d){for(let c of(this._storedError=(0,g.createResponseStatusError)(d,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))c.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(d){this.onProgress?.({loaded:d.loaded,total:d.lengthComputable?d.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};let d=new p.PromiseCapability;return this._requests.push(d),d.promise}cancel(d){for(let c of(this._done=!0,this._headersReceivedCapability.reject(d),this._requests))c.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class _{constructor(d,c,u){this._manager=d;const p={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=d.url,this._requestId=d.requestRange(c,u,p),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(d){let c=d.chunk;for(let d of(this._requests.length>0?this._requests.shift().resolve({value:c,done:!1}):this._queuedChunk=c,this._done=!0,this._requests))d.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(d){for(let c of(this._storedError=(0,g.createResponseStatusError)(d,this._url),this._requests))c.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(d){this.isStreamingSupported||this.onProgress?.({loaded:d.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let d=this._queuedChunk;return this._queuedChunk=null,{value:d,done:!1}}if(this._done)return{value:void 0,done:!0};let d=new p.PromiseCapability;return this._requests.push(d),d.promise}cancel(d){for(let d of(this._done=!0,this._requests))d.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
2(this._requestId),this._close()}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PDFNodeStream=void 0;var p=u(1),g=u(20);let m=/^file:\/\/\/[a-zA-Z]:\//;function f(d){let c=__webpack_require__(40252),u=c.parse(d);return"file:"===u.protocol||u.host?u:/^[a-z]:[/\\]/i.test(d)?c.parse(`file:///${d}`):(u.host||(u.protocol="file:"),u)}class b{constructor(d){this.source=d,this.url=f(d.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&d.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,p.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new x(this):new _(this),this._fullRequestReader}getRangeReader(d,c){if(c<=this._progressiveDataLength)return null;let u=this.isFsUrl?new E(this,d,c):new S(this,d,c);return this._rangeRequestReaders.push(u),u}cancelAllRequests(d){for(let c of(this._fullRequestReader?.cancel(d),this._rangeRequestReaders.slice(0)))c.cancel(d)}}c.PDFNodeStream=b;class A{constructor(d){this._url=d.url,this._done=!1,this._storedError=null,this.onProgress=null;const c=d.source;this._contentLength=c.length,this._loaded=0,this._filename=null,this._disableRange=c.disableRange||!1,this._rangeChunkSize=c.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!c.disableStream,this._isRangeSupported=!c.disableRange,this._readableStream=null,this._readCapability=new p.PromiseCapability,this._headersCapability=new p.PromiseCapability}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;let d=this._readableStream.read();return null===d?(this._readCapability=new p.PromiseCapability,this.read()):(this._loaded+=d.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(d).buffer,done:!1})}cancel(d){this._readableStream?this._readableStream.destroy(d):this._error(d)}_error(d){this._storedError=d,this._readCapability.resolve()}_setReadableStream(d){this._readableStream=d,d.on("readable",()=>{this._readCapability.resolve()}),d.on("end",()=>{d.destroy(),this._done=!0,this._readCapability.resolve()}),d.on("error",d=>{this._error(d)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new p.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class v{constructor(d){this._url=d.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new p.PromiseCapability;const c=d.source;this._isStreamingSupported=!c.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;let d=this._readableStream.read();return null===d?(this._readCapability=new p.PromiseCapability,this.read()):(this._loaded+=d.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(d).buffer,done:!1})}cancel(d){this._readableStream?this._readableStream.destroy(d):this._error(d)}_error(d){this._storedError=d,this._readCapability.resolve()}_setReadableStream(d){this._readableStream=d,d.on("readable",()=>{this._readCapability.resolve()}),d.on("end",()=>{d.destroy(),this._done=!0,this._readCapability.resolve()}),d.on("error",d=>{this._error(d)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function y(d,c){return{protocol:d.protocol,auth:d.auth,host:d.hostname,port:d.port,path:d.path,method:"GET",headers:c}}
2class _ extends A{constructor(d){super(d);const c=c=>{if(404===c.statusCode){let d=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(c);let u=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:m,suggestedLength:f}=(0,g.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:d.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=m,this._contentLength=f||this._contentLength,this._filename=(0,g.extractFilenameFromHeader)(u)};if(this._request=null,"http:"===this._url.protocol){const u=__webpack_require__(85515);this._request=u.request(y(this._url,d.httpHeaders),c)}else{const u=__webpack_require__(82474);this._request=u.request(y(this._url,d.httpHeaders),c)}this._request.on("error",d=>{this._storedError=d,this._headersCapability.reject(d)}),this._request.end()}}class S extends v{constructor(d,c,u){for(const c in super(d),this._httpHeaders={},d.httpHeaders){const u=d.httpHeaders[c];void 0!==u&&(this._httpHeaders[c]=u)}this._httpHeaders.Range=`bytes=${c}-${u-1}`;const g=d=>{if(404===d.statusCode){let d=new p.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=d;return}this._setReadableStream(d)};if(this._request=null,"http:"===this._url.protocol){const d=__webpack_require__(85515);this._request=d.request(y(this._url,this._httpHeaders),g)}else{const d=__webpack_require__(82474);this._request=d.request(y(this._url,this._httpHeaders),g)}this._request.on("error",d=>{this._storedError=d}),this._request.end()}}class x extends A{constructor(d){super(d);let c=decodeURIComponent(this._url.path);m.test(this._url.href)&&(c=c.replace(/^\//,""));const u=__webpack_require__(82590);u.lstat(c,(d,g)=>{if(d){"ENOENT"===d.code&&(d=new p.MissingPDFException(`Missing PDF "${c}".`)),this._storedError=d,this._headersCapability.reject(d);return}this._contentLength=g.size,this._setReadableStream(u.createReadStream(c)),this._headersCapability.resolve()})}}class E extends v{constructor(d,c,u){super(d);let p=decodeURIComponent(this._url.path);m.test(this._url.href)&&(p=p.replace(/^\//,""));const g=__webpack_require__(82590);this._setReadableStream(g.createReadStream(p,{start:c,end:u-1}))}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SVGGraphics=void 0;var p=u(6),g=u(1);let m="normal",f="normal",b="#000000",A="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/1999/xlink",y=["butt","round","square"],_=["miter","round","bevel"],S=function(d,c="",u=!1){if(URL.createObjectURL&&"u">typeof Blob&&!u)return URL.createObjectURL(new Blob([d],{type:c}));let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=`data:${c};base64,`;for(let c=0,u=d.length;c<u;c+=3){let m=255&d[c],f=255&d[c+1],b=255&d[c+2],A=m>>2,v=(3&m)<<4|f>>4,y=c+1<u?(15&f)<<2|b>>6:64,_=c+2<u?63&b:64;g+=p[A]+p[v]+p[y]+p[_]}return g},x=function(){let d=new Uint8Array([137,80,78,71,13,10,26,10]),c=12,u=new Int32Array(256);for(let d=0;d<256;d++){let c=d;for(let d=0;d<8;d++)c=1&c?0xedb88320^c>>1&0x7fffffff:c>>1&0x7fffffff;u[d]=c}function p(d,c,p){let g=-1;for(let m=c;m<p;m++){let c=u[(g^d[m])&255];g=g>>>8^c}return -1^g}function m(d,c,u,g){let m=g,f=c.length;u[m]=f>>24&255,u[m+1]=f>>16&255,u[m+2]=f>>8&255,u[m+3]=255&f,u[m+=4]=255&d.charCodeAt(0),u[m+1]=255&d.charCodeAt(1),u[m+2]=255&d.charCodeAt(2),u[m+3]=255&d.charCodeAt(3),m+=4,u.set(c,m);let b=p(u,g+4,m+=c.length);u[m]=b>>24&255,u[m+1]=b>>16&255,u[m+2]=b>>8&255,u[m+3]=255&b}function f(d,c,u){let p=1,g=0;for(let m=c;m<u;++m)g=(g+(p=(p+(255&d[m]))%65521))%65521;return g<<16|p}function b(d){if(!g.isNodeJS)return A(d);try{let c=parseInt(process.versions.node)>=8?d:Buffer.from(d),u=__webpack_require__(71040).deflateSync(c,{level:9});return u instanceof Uint8Array?u:new Uint8Array(u)}catch(d){(0,g.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+d)}return A(d)}function A(d){let c=d.length,u=65535,p=Math.ceil(c/65535),g=new Uint8Array(2+c+5*p+4),m=0;g[m++]=120,g[m++]=156;let b=0;for(;c>u;
2)g[m++]=0,g[m++]=255,g[m++]=255,g[m++]=0,g[m++]=0,g.set(d.subarray(b,b+u),m),m+=u,b+=u,c-=u;g[m++]=1,g[m++]=255&c,g[m++]=c>>8&255,g[m++]=65535&~c&255,g[m++]=(65535&~c)>>8&255,g.set(d.subarray(b),m),m+=d.length-b;let A=f(d,0,d.length);return g[m++]=A>>24&255,g[m++]=A>>16&255,g[m++]=A>>8&255,g[m++]=255&A,g}function v(u,p,f,A){let v,y,_,x=u.width,E=u.height,C=u.data;switch(p){case g.ImageKind.GRAYSCALE_1BPP:y=0,v=1,_=x+7>>3;break;case g.ImageKind.RGB_24BPP:y=2,v=8,_=3*x;break;case g.ImageKind.RGBA_32BPP:y=6,v=8,_=4*x;break;default:throw Error("invalid format")}let T=new Uint8Array((1+_)*E),w=0,P=0;for(let d=0;d<E;++d)T[w++]=0,T.set(C.subarray(P,P+_),w),P+=_,w+=_;if(p===g.ImageKind.GRAYSCALE_1BPP&&A){w=0;for(let d=0;d<E;d++){w++;for(let d=0;d<_;d++)T[w++]^=255}}let M=new Uint8Array([x>>24&255,x>>16&255,x>>8&255,255&x,E>>24&255,E>>16&255,E>>8&255,255&E,v,y,0,0,0]),k=b(T),F=new Uint8Array(d.length+3*c+M.length+k.length),R=0;return F.set(d,R),m("IHDR",M,F,R+=d.length),m("IDATA",k,F,R+=c+M.length),R+=c+k.length,m("IEND",new Uint8Array(0),F,R),S(F,"image/png",f)}return function(d,c,u){let p=void 0===d.kind?g.ImageKind.GRAYSCALE_1BPP:d.kind;return v(d,p,c,u)}}();class E{constructor(){this.fontSizeScale=1,this.fontWeight=f,this.fontSize=0,this.textMatrix=g.IDENTITY_MATRIX,this.fontMatrix=g.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=g.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=b,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(d,c){this.x=d,this.y=c}}function C(d){let c=[],u=[];for(let p of d){if("save"===p.fn){c.push({fnId:92,fn:"group",items:[]}),u.push(c),c=c.at(-1).items;continue}"restore"===p.fn?c=u.pop():c.push(p)}return c}function T(d){if(Number.isInteger(d))return d.toString();let c=d.toFixed(10),u=c.length-1;if("0"!==c[u])return c;do u--;while("0"===c[u]);return c.substring(0,"."===c[u]?u:u+1)}function w(d){if(0===d[4]&&0===d[5]){if(0===d[1]&&0===d[2])return 1===d[0]&&1===d[3]?"":`scale(${T(d[0])} ${T(d[3])})`;if(d[0]===d[3]&&d[1]===-d[2]){let c=180*Math.acos(d[0])/Math.PI;return`rotate(${T(c)})`}}else if(1===d[0]&&0===d[1]&&0===d[2]&&1===d[3])return`translate(${T(d[4])} ${T(d[5])})`;return`matrix(${T(d[0])} ${T(d[1])} ${T(d[2])} ${T(d[3])} ${T(d[4])} ${T(d[5])})`}let P=0,M=0,k=0;class F{constructor(d,c,u=!1){for(const m in(0,p.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new p.DOMSVGFactory,this.current=new E,this.transformMatrix=g.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=d,this.objs=c,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!u,this._operatorIdMapping=[],g.OPS)this._operatorIdMapping[g.OPS[m]]=m}getObject(d,c=null){return"string"==typeof d?d.startsWith("g_")?this.commonObjs.get(d):this.objs.get(d):c}save(){this.transformStack.push(this.transformMatrix);let d=this.current;this.extraStack.push(d),this.current=d.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(d){this.save(),this.executeOpTree(d),this.restore()}loadDependencies(d){let c=d.fnArray,u=d.argsArray;for(let d=0,p=c.length;d<p;d++)if(c[d]===g.OPS.dependency)for(let c of u[d]){let d=c.startsWith("g_")?this.commonObjs:this.objs,u=new Promise(u=>{d.get(c,u)});this.current.dependencies.push(u)}return Promise.all(this.current.dependencies)}transform(d,c,u,p,m,f){let b=[d,c,u,p,m,f];this.transformMatrix=g.Util.transform(this.transformMatrix,b),this.tgrp=null}getSVG(d,c){this.viewport=c;let u=this._initialize(c);return this.loadDependencies(d).then(()=>(this.transformMatrix=g.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(d)),u))}convertOpList(d){let c=this._operatorIdMapping,u=d.argsArray,p=d.fnArray,g=[];for(let d=0,m=p.length;d<m;d++){let m=p[d];g.push({fnId:m,fn:c[m],args:u[d]})}return C(g)}executeOpTree(d){for(let c of d){let d=c.fn,u=c.fnId,p=c.args;switch(0|u){case g.OPS.beginText:this.beginText();break;case g.OPS.dependency:break;case g.OPS.setLeading:this.setLeading(p);break;case g.OPS.setLeadingMoveText:this.setLeadingMoveText(p[0],p[1]);break;case g.OPS.setFont:this.setFont(p);break;case g.OPS.showText:case g.OPS.showSpacedText:this.showText(p[0]);break;case g.OPS.endText:this.endText();break;case g.OPS.moveText:this.moveText(p[0],p[1]);break;case g.OPS.setCharSpacing:this.setCharSpacing(p[0]);break;case g.OPS.setWordSpacing:this.setWordSpacing(p[0]);break;case g.OPS.setHScale:this.setHScale(p[0]);break;case g.OPS.setTextMatrix:this.setTextMatrix(p[0],p[1],p[2],p[3],p[4],p[5]);break;case g.OPS.setTextRise:this.setTextRise(p[0]);break;case g.OPS.setTextRenderingMode:this.setTextRenderingMode(p[0]);break;case g.OPS.setLineWidth:this.setLineWidth(p[0]);break;case g.OPS.setLineJoin:this.setLineJoin(p[0]);break;case g.OPS.setLineCap:this.setLineCap(p[0]);break;case g.OPS.setMiterLimit:this.setMiterLimit(p[0]);break;case g.OPS.setFillRGBColor:this.setFillRGBColor(p[0],p[1],p[2]);break;case g.OPS.setStrokeRGBColor:this.setStrokeRGBColor(p[0],p[1],p[2]);break;case g.OPS.setStrokeColorN:this.setStrokeColorN(p);break;case g.OPS.setFillColorN:this.setFillColorN(p);break;case g.OPS.shadingFill:this.shadingFill(p[0]);break;case g.OPS.setDash:this.setDash(p[0],p[1]);break;
2case g.OPS.setRenderingIntent:this.setRenderingIntent(p[0]);break;case g.OPS.setFlatness:this.setFlatness(p[0]);break;case g.OPS.setGState:this.setGState(p[0]);break;case g.OPS.fill:this.fill();break;case g.OPS.eoFill:this.eoFill();break;case g.OPS.stroke:this.stroke();break;case g.OPS.fillStroke:this.fillStroke();break;case g.OPS.eoFillStroke:this.eoFillStroke();break;case g.OPS.clip:this.clip("nonzero");break;case g.OPS.eoClip:this.clip("evenodd");break;case g.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case g.OPS.paintImageXObject:this.paintImageXObject(p[0]);break;case g.OPS.paintInlineImageXObject:this.paintInlineImageXObject(p[0]);break;case g.OPS.paintImageMaskXObject:this.paintImageMaskXObject(p[0]);break;case g.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(p[0],p[1]);break;case g.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case g.OPS.closePath:this.closePath();break;case g.OPS.closeStroke:this.closeStroke();break;case g.OPS.closeFillStroke:this.closeFillStroke();break;case g.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case g.OPS.nextLine:this.nextLine();break;case g.OPS.transform:this.transform(p[0],p[1],p[2],p[3],p[4],p[5]);break;case g.OPS.constructPath:this.constructPath(p[0],p[1]);break;case g.OPS.endPath:this.endPath();break;case 92:this.group(c.items);break;default:(0,g.warn)(`Unimplemented operator ${d}`)}}}setWordSpacing(d){this.current.wordSpacing=d}setCharSpacing(d){this.current.charSpacing=d}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(d,c,u,p,g,m){let f=this.current;f.textMatrix=f.lineMatrix=[d,c,u,p,g,m],f.textMatrixScale=Math.hypot(d,c),f.x=f.lineX=0,f.y=f.lineY=0,f.xcoords=[],f.ycoords=[],f.tspan=this.svgFactory.createElement("svg:tspan"),f.tspan.setAttributeNS(null,"font-family",f.fontFamily),f.tspan.setAttributeNS(null,"font-size",`${T(f.fontSize)}px`),f.tspan.setAttributeNS(null,"y",T(-f.y)),f.txtElement=this.svgFactory.createElement("svg:text"),f.txtElement.append(f.tspan)}beginText(){let d=this.current;d.x=d.lineX=0,d.y=d.lineY=0,d.textMatrix=g.IDENTITY_MATRIX,d.lineMatrix=g.IDENTITY_MATRIX,d.textMatrixScale=1,d.tspan=this.svgFactory.createElement("svg:tspan"),d.txtElement=this.svgFactory.createElement("svg:text"),d.txtgrp=this.svgFactory.createElement("svg:g"),d.xcoords=[],d.ycoords=[]}moveText(d,c){let u=this.current;u.x=u.lineX+=d,u.y=u.lineY+=c,u.xcoords=[],u.ycoords=[],u.tspan=this.svgFactory.createElement("svg:tspan"),u.tspan.setAttributeNS(null,"font-family",u.fontFamily),u.tspan.setAttributeNS(null,"font-size",`${T(u.fontSize)}px`),u.tspan.setAttributeNS(null,"y",T(-u.y))}showText(d){let c=this.current,u=c.font,p=c.fontSize;if(0===p)return;let v=c.fontSizeScale,y=c.charSpacing,_=c.wordSpacing,S=c.fontDirection,x=c.textHScale*S,E=u.vertical,C=E?1:-1,P=u.defaultVMetrics,M=p*c.fontMatrix[0],k=0;for(let g of d){let d,m;if(null===g){k+=S*_;continue}if("number"==typeof g){k+=C*g*p/1e3;continue}let f=(g.isSpace?_:0)+y,b=g.fontChar,A=g.width;if(E){let c,u=g.vmetric||P;c=-(c=g.vmetric?u[1]:.5*A)*M;let p=u[2]*M;A=u?-u[0]:A,d=c/v,m=(k+p)/v}else d=k/v,m=0;(g.isInFont||u.missingFile)&&(c.xcoords.push(c.x+d),E&&c.ycoords.push(-c.y+m),c.tspan.textContent+=b),k+=E?A*M-f*S:A*M+f*S}c.tspan.setAttributeNS(null,"x",c.xcoords.map(T).join(" ")),E?c.tspan.setAttributeNS(null,"y",c.ycoords.map(T).join(" ")):c.tspan.setAttributeNS(null,"y",T(-c.y)),E?c.y-=k:c.x+=k*x,c.tspan.setAttributeNS(null,"font-family",c.fontFamily),c.tspan.setAttributeNS(null,"font-size",`${T(c.fontSize)}px`),c.fontStyle!==m&&c.tspan.setAttributeNS(null,"font-style",c.fontStyle),c.fontWeight!==f&&c.tspan.setAttributeNS(null,"font-weight",c.fontWeight);let F=c.textRenderingMode&g.TextRenderingMode.FILL_STROKE_MASK;if(F===g.TextRenderingMode.FILL||F===g.TextRenderingMode.FILL_STROKE?(c.fillColor!==b&&c.tspan.setAttributeNS(null,"fill",c.fillColor),c.fillAlpha<1&&c.tspan.setAttributeNS(null,"fill-opacity",c.fillAlpha)):c.textRenderingMode===g.TextRenderingMode.ADD_TO_PATH?c.tspan.setAttributeNS(null,"fill","transparent"):c.tspan.setAttributeNS(null,"fill","none"),F===g.TextRenderingMode.STROKE||F===g.TextRenderingMode.FILL_STROKE){let d=1/(c.textMatrixScale||1);this._setStrokeAttributes(c.tspan,d)}let R=c.textMatrix;0!==c.textRise&&(R=R.slice(),R[5]+=c.textRise),c.txtElement.setAttributeNS(null,"transform",`${w(R)} scale(${T(x)}, -1)`),c.txtElement.setAttributeNS(A,"xml:space","preserve"),c.txtElement.append(c.tspan),c.txtgrp.append(c.txtElement),this._ensureTransformGroup().append(c.txtElement)}setLeadingMoveText(d,c){this.setLeading(-c),this.moveText(d,c)}addFontStyle(d){if(!d.data)throw 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.append(this.cssStyle));let c=S(d.data,d.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${d.loadedName}"; src: url(${c}); } 3`}setFont(d){let c=this.current,u=this.commonObjs.get(d[0]),p=d[1];c.font=u,!this.embedFonts||u.missingFile||this.embeddedFonts[u.loadedName]||(this.addFontStyle(u),this.embeddedFonts[u.loadedName]=u),c.fontMatrix=u.fontMatrix||g.FONT_IDENTITY_MATRIX;let m="normal";u.black?m="900":u.bold&&(m="bold");let f=u.italic?"italic":"normal";p<0?(p=-p,c.fontDirection=-1):c.fontDirection=1,c.fontSize=p,c.fontFamily=u.loadedName,c.fontWeight=m,c.fontStyle=f,c.tspan=this.svgFactory.createElement("svg:tspan"),c.tspan.setAttributeNS(null,"y",T(-c.y)),c.xcoords=[],c.ycoords=[]}endText(){let d=this.current;d.textRenderingMode&g.TextRenderingMode.ADD_TO_PATH_FLAG&&d.txtElement?.hasChildNodes()&&(d.element=d.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(d){d>0&&(this.current.lineWidth=d)}setLineCap(d){this.current.lineCap=y[d]}setLineJoin(d){this.current.lineJoin=_[d]}setMiterLimit(d){this.current.miterLimit=d}setStrokeAlpha(d){this.current.strokeAlpha=d}setStrokeRGBColor(d,c,u){this.current.strokeColor=g.Util.makeHexColor(d,c,u)}setFillAlpha(d){this.current.fillAlpha=d}setFillRGBColor(d,c,u){this.current.fillColor=g.Util.makeHexColor(d,c,u),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(d){this.current.strokeColor=this._makeColorN_Pattern(d)}setFillColorN(d){this.current.fillColor=this._makeColorN_Pattern(d)}shadingFill(d){let{width:c,height:u}=this.viewport,p=g.Util.inverseTransform(this.transformMatrix),[m,f,b,A]=g.Util.getAxialAlignedBoundingBox([0,0,c,u],p),v=this.svgFactory.createElement("svg:rect");v.setAttributeNS(null,"x",m),v.setAttributeNS(null,"y",f),v.setAttributeNS(null,"width",b-m),v.setAttributeNS(null,"height",A-f),v.setAttributeNS(null,"fill",this._makeShadingPattern(d)),this.current.fillAlpha<1&&v.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(v)}_makeColorN_Pattern(d){return"TilingPattern"===d[0]?this._makeTilingPattern(d):this._makeShadingPattern(d)}_makeTilingPattern(d){let c=d[1],u=d[2],p=d[3]||g.IDENTITY_MATRIX,[m,f,b,A]=d[4],v=d[5],y=d[6],_=d[7],S=`shading${k++}`,[x,E,C,T]=g.Util.normalizeRect([...g.Util.applyTransform([m,f],p),...g.Util.applyTransform([b,A],p)]),[w,P]=g.Util.singularValueDecompose2dScale(p),M=v*w,F=y*P,R=this.svgFactory.createElement("svg:pattern");R.setAttributeNS(null,"id",S),R.setAttributeNS(null,"patternUnits","userSpaceOnUse"),R.setAttributeNS(null,"width",M),R.setAttributeNS(null,"height",F),R.setAttributeNS(null,"x",`${x}`),R.setAttributeNS(null,"y",`${E}`);let I=this.svg,D=this.transformMatrix,L=this.current.fillColor,O=this.current.strokeColor,N=this.svgFactory.create(C-x,T-E);if(this.svg=N,this.transformMatrix=p,2===_){let d=g.Util.makeHexColor(...c);this.current.fillColor=d,this.current.strokeColor=d}return this.executeOpTree(this.convertOpList(u)),this.svg=I,this.transformMatrix=D,this.current.fillColor=L,this.current.strokeColor=O,R.append(N.childNodes[0]),this.defs.append(R),`url(#${S})`}_makeShadingPattern(d){switch("string"==typeof d&&(d=this.objs.get(d)),d[0]){case"RadialAxial":let c,u=`shading${k++}`,p=d[3];switch(d[1]){case"axial":let m=d[4],f=d[5];(c=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",u),c.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),c.setAttributeNS(null,"x1",m[0]),c.setAttributeNS(null,"y1",m[1]),c.setAttributeNS(null,"x2",f[0]),c.setAttributeNS(null,"y2",f[1]);break;case"radial":let b=d[4],A=d[5],v=d[6],y=d[7];(c=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",u),c.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),c.setAttributeNS(null,"cx",A[0]),c.setAttributeNS(null,"cy",A[1]),c.setAttributeNS(null,"r",y),c.setAttributeNS(null,"fx",b[0]),c.setAttributeNS(null,"fy",b[1]),c.setAttributeNS(null,"fr",v);break;default:throw Error(`Unknown RadialAxial type: ${d[1]}`)}for(let d of p){let u=this.svgFactory.createElement("svg:stop");
3u.setAttributeNS(null,"offset",d[0]),u.setAttributeNS(null,"stop-color",d[1]),c.append(u)}return this.defs.append(c),`url(#${u})`;case"Mesh":return(0,g.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw Error(`Unknown IR type: ${d[0]}`)}}setDash(d,c){this.current.dashArray=d,this.current.dashPhase=c}constructPath(d,c){let u=this.current,p=u.x,m=u.y,f=[],b=0;for(let u of d)switch(0|u){case g.OPS.rectangle:p=c[b++],m=c[b++];let d=c[b++],A=c[b++],v=p+d,y=m+A;f.push("M",T(p),T(m),"L",T(v),T(m),"L",T(v),T(y),"L",T(p),T(y),"Z");break;case g.OPS.moveTo:p=c[b++],m=c[b++],f.push("M",T(p),T(m));break;case g.OPS.lineTo:p=c[b++],m=c[b++],f.push("L",T(p),T(m));break;case g.OPS.curveTo:p=c[b+4],m=c[b+5],f.push("C",T(c[b]),T(c[b+1]),T(c[b+2]),T(c[b+3]),T(p),T(m)),b+=6;break;case g.OPS.curveTo2:f.push("C",T(p),T(m),T(c[b]),T(c[b+1]),T(c[b+2]),T(c[b+3])),p=c[b+2],m=c[b+3],b+=4;break;case g.OPS.curveTo3:p=c[b+2],m=c[b+3],f.push("C",T(c[b]),T(c[b+1]),T(p),T(m),T(p),T(m)),b+=4;break;case g.OPS.closePath:f.push("Z")}f=f.join(" "),u.path&&d.length>0&&d[0]!==g.OPS.rectangle&&d[0]!==g.OPS.moveTo?f=u.path.getAttributeNS(null,"d")+f:(u.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(u.path)),u.path.setAttributeNS(null,"d",f),u.path.setAttributeNS(null,"fill","none"),u.element=u.path,u.setCurrentPoint(p,m)}endPath(){let d=this.current;if(d.path=null,!this.pendingClip)return;if(!d.element){this.pendingClip=null;return}let c=`clippath${P++}`,u=this.svgFactory.createElement("svg:clipPath");u.setAttributeNS(null,"id",c),u.setAttributeNS(null,"transform",w(this.transformMatrix));let p=d.element.cloneNode(!0);if("evenodd"===this.pendingClip?p.setAttributeNS(null,"clip-rule","evenodd"):p.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,u.append(p),this.defs.append(u),d.activeClipUrl){for(let c of(d.clipGroup=null,this.extraStack))c.clipGroup=null;u.setAttributeNS(null,"clip-path",d.activeClipUrl)}d.activeClipUrl=`url(#${c})`,this.tgrp=null}clip(d){this.pendingClip=d}closePath(){let d=this.current;if(d.path){let c=`${d.path.getAttributeNS(null,"d")}Z`;d.path.setAttributeNS(null,"d",c)}}setLeading(d){this.current.leading=-d}setTextRise(d){this.current.textRise=d}setTextRenderingMode(d){this.current.textRenderingMode=d}setHScale(d){this.current.textHScale=d/100}setRenderingIntent(d){}setFlatness(d){}setGState(d){for(let[c,u]of d)switch(c){case"LW":this.setLineWidth(u);break;case"LC":this.setLineCap(u);break;case"LJ":this.setLineJoin(u);break;case"ML":this.setMiterLimit(u);break;case"D":this.setDash(u[0],u[1]);break;case"RI":this.setRenderingIntent(u);break;case"FL":this.setFlatness(u);break;case"Font":this.setFont(u);break;case"CA":this.setStrokeAlpha(u);break;case"ca":this.setFillAlpha(u);break;default:(0,g.warn)(`Unimplemented graphic state operator ${c}`)}}fill(){let d=this.current;d.element&&(d.element.setAttributeNS(null,"fill",d.fillColor),d.element.setAttributeNS(null,"fill-opacity",d.fillAlpha),this.endPath())}stroke(){let d=this.current;d.element&&(this._setStrokeAttributes(d.element),d.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(d,c=1){let u=this.current,p=u.dashArray;1!==c&&p.length>0&&(p=p.map(function(d){return c*d})),d.setAttributeNS(null,"stroke",u.strokeColor),d.setAttributeNS(null,"stroke-opacity",u.strokeAlpha),d.setAttributeNS(null,"stroke-miterlimit",T(u.miterLimit)),d.setAttributeNS(null,"stroke-linecap",u.lineCap),d.setAttributeNS(null,"stroke-linejoin",u.lineJoin),d.setAttributeNS(null,"stroke-width",T(c*u.lineWidth)+"px"),d.setAttributeNS(null,"stroke-dasharray",p.map(T).join(" ")),d.setAttributeNS(null,"stroke-dashoffset",T(c*u.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){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(){let d=this.svgFactory.createElement("svg:rect");d.setAttributeNS(null,"x","0"),d.setAttributeNS(null,"y","0"),d.setAttributeNS(null,"width","1px"),d.setAttributeNS(null,"height","1px"),d.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(d)}paintImageXObject(d){let c=this.getObject(d);c?this.paintInlineImageXObject(c):(0,g.warn)(`Dependent image with object ID ${d} is not ready yet`)}paintInlineImageXObject(d,c){let u=d.width,p=d.height,g=x(d,this.forceDataSchema,!!c),m=this.svgFactory.createElement("svg:rect");m.setAttributeNS(null,"x","0"),m.setAttributeNS(null,"y","0"),m.setAttributeNS(null,"width",T(u)),m.setAttributeNS(null,"height",T
3(p)),this.current.element=m,this.clip("nonzero");let f=this.svgFactory.createElement("svg:image");f.setAttributeNS(v,"xlink:href",g),f.setAttributeNS(null,"x","0"),f.setAttributeNS(null,"y",T(-p)),f.setAttributeNS(null,"width",T(u)+"px"),f.setAttributeNS(null,"height",T(p)+"px"),f.setAttributeNS(null,"transform",`scale(${T(1/u)} ${T(-1/p)})`),c?c.append(f):this._ensureTransformGroup().append(f)}paintImageMaskXObject(d){let c=this.getObject(d.data,d);if(c.bitmap)return void(0,g.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");let u=this.current,p=c.width,m=c.height,f=u.fillColor;u.maskId=`mask${M++}`;let b=this.svgFactory.createElement("svg:mask");b.setAttributeNS(null,"id",u.maskId);let A=this.svgFactory.createElement("svg:rect");A.setAttributeNS(null,"x","0"),A.setAttributeNS(null,"y","0"),A.setAttributeNS(null,"width",T(p)),A.setAttributeNS(null,"height",T(m)),A.setAttributeNS(null,"fill",f),A.setAttributeNS(null,"mask",`url(#${u.maskId})`),this.defs.append(b),this._ensureTransformGroup().append(A),this.paintInlineImageXObject(c,b)}paintFormXObjectBegin(d,c){if(Array.isArray(d)&&6===d.length&&this.transform(d[0],d[1],d[2],d[3],d[4],d[5]),c){let d=c[2]-c[0],u=c[3]-c[1],p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c[0]),p.setAttributeNS(null,"y",c[1]),p.setAttributeNS(null,"width",T(d)),p.setAttributeNS(null,"height",T(u)),this.current.element=p,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(d){let c=this.svgFactory.create(d.width,d.height),u=this.svgFactory.createElement("svg:defs");c.append(u),this.defs=u;let p=this.svgFactory.createElement("svg:g");return p.setAttributeNS(null,"transform",w(d.transform)),c.append(p),this.svg=p,c}_ensureClipGroup(){if(!this.current.clipGroup){let d=this.svgFactory.createElement("svg:g");d.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(d),this.current.clipGroup=d}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",w(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}c.SVGGraphics=F},(d,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.XfaText=void 0;class u{static textContent(d){let c=[],p={items:c,styles:Object.create(null)};function g(d){if(!d)return;let p=null,m=d.name;if("#text"===m)p=d.value;else{if(!u.shouldBuildText(m))return;d?.attributes?.textContent?p=d.attributes.textContent:d.value&&(p=d.value)}if(null!==p&&c.push({str:p}),d.children)for(let c of d.children)g(c)}return g(d),p}static shouldBuildText(d){return"textarea"!==d&&"input"!==d&&"option"!==d&&"select"!==d}}c.XfaText=u},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TextLayerRenderTask=void 0,c.renderTextLayer=C,c.updateTextLayer=T;var p=u(1),g=u(6);let m=1e5,f=30,b=.8,A=new Map;function v(d,c){let u;if(c&&p.FeatureTest.isOffscreenCanvasSupported)u=new OffscreenCanvas(d,d).getContext("2d",{alpha:!1});else{let c=document.createElement("canvas");c.width=c.height=d,u=c.getContext("2d",{alpha:!1})}return u}function y(d,c){let u=A.get(d);if(u)return u;let p=v(f,c);p.font=`${f}px ${d}`;let g=p.measureText(""),m=g.fontBoundingBoxAscent,y=Math.abs(g.fontBoundingBoxDescent);if(m){let c=m/(m+y);return A.set(d,c),p.canvas.width=p.canvas.height=0,c}p.strokeStyle="red",p.clearRect(0,0,f,f),p.strokeText("g",0,0);let _=p.getImageData(0,0,f,f).data;y=0;for(let d=_.length-1-3;d>=0;d-=4)if(_[d]>0){y=Math.ceil(d/4/f);break}p.clearRect(0,0,f,f),p.strokeText("A",0,f),_=p.getImageData(0,0,f,f).data,m=0;for(let d=0,c=_.length;d<c;d+=4)if(_[d]>0){m=f-Math.floor(d/4/f);break}if(p.canvas.width=p.canvas.height=0,m){let c=m/(m+y);return A.set(d,c),c}return A.set(d,b),b}function _(d,c,u){let g,m,f=document.createElement("span"),b={angle:0,canvasWidth:0,hasText:""!==c.str,hasEOL:c.hasEOL,fontSize:0};d._textDivs.push(f);let A=p.Util.transform(d._transform,c.transform),v=Math.atan2(A[1],A[0]),_=u[c.fontName];_.vertical&&(v+=Math.PI/2);let S=Math.hypot(A[2],A[3]),x=S*y(_.fontFamily,d._isOffscreenCanvasSupported);0===v?(g=A[4],m=A[5]-x):(g=A[4]+x*Math.sin(v),m=A[5]-x*Math.cos(v));let E="calc(var(--scale-factor)*",C=f.style;d._container===d._rootContainer?(C.left=`${(100*g/d._pageWidth).toFixed(2)}%`,C.top=`${(100*m/d._pageHeight).toFixed(2)}%`):(C.left=`${E}${g.toFixed(2)}px)`,C.top=`${E}${m.toFixed(2)}px)`),C.fontSize=`${E}${S.toFixed(2)}px)`,C.fontFamily=_.fontFamily,b.fontSize=S,f.setAttribute("role","presentation"),f.textContent=c.str,f.dir=c.dir,d._fontInspectorEnabled&&(f.dataset.fontName=c.fontName),0!==v&&(b.angle=180/Math.PI*v);let T=!1;if(c.str.length>1)T=!0;else if(" "!==c.str&&c.transform[0]!==c.transform[3]){let d=Math.abs(c.transform[0]),u=Math.abs(c.transform[3]);d!==u&&Math.max(d,u)/Math.min(d,u)>1.5&&(T=!0)}T&&(b.canvasWidth=_.vertical?c.height:c.width),d._textDivProperties.set(f,b),d._isReadableStream&&d._layoutText(f)}function S(d){let{div:c,scale:u,properties:p,ctx:g,prevFontSize:m,prevFontFamily:f}=d,{style:b}=c,A="";if(0!==p.canvasWidth&&p.hasText){let{fontFamily:v}=b,{canvasWidth:y,fontSize:_}=p;(m!==_||f!==v)&&(g.font=`${_*u}px ${v}`,d.prevFontSize=_,d.prevFontFamily=v);let{width:S}=g.measureText(c.textContent);S>0&&(A=`scaleX(${y*u/S})`)}0!==p.angle&&(A=`rotate(${p.angle}deg) ${A}`),A.length>0&&(b.transform=A)}
3function x(d){if(d._canceled)return;let c=d._textDivs,u=d._capability;if(c.length>m)return void u.resolve();if(!d._isReadableStream)for(let u of c)d._layoutText(u);u.resolve()}class E{constructor({textContentSource:d,container:c,viewport:u,textDivs:m,textDivProperties:f,textContentItemsStr:b,isOffscreenCanvasSupported:A}){this._textContentSource=d,this._isReadableStream=d instanceof ReadableStream,this._container=this._rootContainer=c,this._textDivs=m||[],this._textContentItemsStr=b||[],this._isOffscreenCanvasSupported=A,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=f||new WeakMap,this._canceled=!1,this._capability=new p.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:u.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:v(0,A)};const{pageWidth:y,pageHeight:_,pageX:S,pageY:x}=u.rawDims;this._transform=[1,0,0,-1,-S,x+_],this._pageWidth=y,this._pageHeight=_,(0,g.setLayerDimensions)(c,u),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new p.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new p.AbortException("TextLayer task cancelled."))}_processItems(d,c){for(let u of d){if(void 0===u.str){if("beginMarkedContentProps"===u.type||"beginMarkedContent"===u.type){let d=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==u.id&&this._container.setAttribute("id",`${u.id}`),d.append(this._container)}else"endMarkedContent"===u.type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(u.str),_(this,u,c)}}_layoutText(d){let c=this._layoutTextParams.properties=this._textDivProperties.get(d);if(this._layoutTextParams.div=d,S(this._layoutTextParams),c.hasText&&this._container.append(d),c.hasEOL){let d=document.createElement("br");d.setAttribute("role","presentation"),this._container.append(d)}}_render(){let d=new p.PromiseCapability,c=Object.create(null);if(this._isReadableStream){let u=()=>{this._reader.read().then(({value:p,done:g})=>{g?d.resolve():(Object.assign(c,p.styles),this._processItems(p.items,c),u())},d.reject)};this._reader=this._textContentSource.getReader(),u()}else if(this._textContentSource){let{items:c,styles:u}=this._textContentSource;this._processItems(c,u),d.resolve()}else throw Error('No "textContentSource" parameter specified.');d.promise.then(()=>{c=null,x(this)},this._capability.reject)}}function C(d){!d.textContentSource&&(d.textContent||d.textContentStream)&&((0,g.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),d.textContentSource=d.textContent||d.textContentStream);let{container:c,viewport:u}=d,p=getComputedStyle(c),m=p.getPropertyValue("visibility"),f=parseFloat(p.getPropertyValue("--scale-factor"));"visible"===m&&(!f||Math.abs(f-u.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");let b=new E(d);return b._render(),b}function T({container:d,viewport:c,textDivs:u,textDivProperties:p,isOffscreenCanvasSupported:m,mustRotate:f=!0,mustRescale:b=!0}){if(f&&(0,g.setLayerDimensions)(d,{rotation:c.rotation}),b){let d=v(0,m),g={prevFontSize:null,prevFontFamily:null,div:null,scale:c.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:d};for(let d of u)g.properties=p.get(d),g.div=d,S(g)}}c.TextLayerRenderTask=E},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AnnotationEditorLayer=void 0;var p=u(1),g=u(4),m=u(28),f=u(33),b=u(6),A=u(34);class v{#eu;#ep=!1;#eg=null;#em=this.pointerup.bind(this);#ef=this.pointerdown.bind(this);#eb=new Map;#eA=!1;#ev=!1;#ey=!1;#e_;static _initialized=!1;constructor({uiManager:d,pageIndex:c,div:u,accessibilityManager:p,annotationLayer:g,viewport:b,l10n:y}){const _=[m.FreeTextEditor,f.InkEditor,A.StampEditor];if(!v._initialized)for(const d of(v._initialized=!0,_))d.initialize(y);
3d.registerEditorTypes(_),this.#e_=d,this.pageIndex=c,this.div=u,this.#eu=p,this.#eg=g,this.viewport=b,this.#e_.addLayer(this)}get isEmpty(){return 0===this.#eb.size}updateToolbar(d){this.#e_.updateToolbar(d)}updateMode(d=this.#e_.getMode()){this.#eS(),d===p.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),d!==p.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",d===p.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",d===p.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",d===p.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(d){if(d||this.#e_.getMode()===p.AnnotationEditorType.INK){if(!d){for(let d of this.#eb.values())if(d.isEmpty())return void d.setInBackground()}this.#ex({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(d){this.#e_.setEditingState(d)}addCommands(d){this.#e_.addCommands(d)}enable(){this.div.style.pointerEvents="auto";let d=new Set;for(let c of this.#eb.values())c.enableEditing(),c.annotationElementId&&d.add(c.annotationElementId);if(this.#eg)for(let c of this.#eg.getEditableAnnotations()){if(c.hide(),this.#e_.isDeletedAnnotationElement(c.data.id)||d.has(c.data.id))continue;let u=this.deserialize(c);u&&(this.addOrRebuild(u),u.enableEditing())}}disable(){this.#ey=!0,this.div.style.pointerEvents="none";let d=new Set;for(let c of this.#eb.values()){if(c.disableEditing(),!c.annotationElementId||null!==c.serialize()){d.add(c.annotationElementId);continue}this.getEditableAnnotation(c.annotationElementId)?.show(),c.remove()}if(this.#eg)for(let c of this.#eg.getEditableAnnotations()){let{id:u}=c.data;d.has(u)||this.#e_.isDeletedAnnotationElement(u)||c.show()}this.#eS(),this.isEmpty&&(this.div.hidden=!0),this.#ey=!1}getEditableAnnotation(d){return this.#eg?.getEditableAnnotation(d)||null}setActiveEditor(d){this.#e_.getActive()!==d&&this.#e_.setActiveEditor(d)}enableClick(){this.div.addEventListener("pointerdown",this.#ef),this.div.addEventListener("pointerup",this.#em)}disableClick(){this.div.removeEventListener("pointerdown",this.#ef),this.div.removeEventListener("pointerup",this.#em)}attach(d){this.#eb.set(d.id,d);let{annotationElementId:c}=d;c&&this.#e_.isDeletedAnnotationElement(c)&&this.#e_.removeDeletedAnnotationElement(d)}detach(d){this.#eb.delete(d.id),this.#eu?.removePointerInTextLayer(d.contentDiv),!this.#ey&&d.annotationElementId&&this.#e_.addDeletedAnnotationElement(d)}remove(d){this.detach(d),this.#e_.removeEditor(d),d.div.contains(document.activeElement)&&setTimeout(()=>{this.#e_.focusMainContainer()},0),d.div.remove(),d.isAttachedToDOM=!1,this.#ev||this.addInkEditorIfNeeded(!1)}changeParent(d){d.parent!==this&&(d.annotationElementId&&(this.#e_.addDeletedAnnotationElement(d.annotationElementId),g.AnnotationEditor.deleteAnnotationElement(d),d.annotationElementId=null),this.attach(d),d.parent?.detach(d),d.setParent(this),d.div&&d.isAttachedToDOM&&(d.div.remove(),this.div.append(d.div)))}add(d){if(this.changeParent(d),this.#e_.addEditor(d),this.attach(d),!d.isAttachedToDOM){let c=d.render();this.div.append(c),d.isAttachedToDOM=!0}d.fixAndSetPosition(),d.onceAdded(),this.#e_.addToAnnotationStorage(d)}moveEditorInDOM(d){if(!d.isAttachedToDOM)return;let{activeElement:c}=document;d.div.contains(c)&&(d._focusEventsAllowed=!1,setTimeout(()=>{d.div.contains(document.activeElement)?d._focusEventsAllowed=!0:(d.div.addEventListener("focusin",()=>{d._focusEventsAllowed=!0},{once:!0}),c.focus())},0)),d._structTreeParentId=this.#eu?.moveElementInDOM(this.div,d.div,d.contentDiv,!0)}addOrRebuild(d){d.needsToBeRebuilt()?d.rebuild():this.add(d)}addUndoableEditor(d){let c=()=>d._uiManager.rebuild(d),u=()=>{d.remove()};this.addCommands({cmd:c,undo:u,mustExec:!1})}getNextId(){return this.#e_.getId()}#eE(d){switch(this.#e_.getMode()){case p.AnnotationEditorType.FREETEXT:return new m.FreeTextEditor(d);case p.AnnotationEditorType.INK:return new f.InkEditor(d);case p.AnnotationEditorType.STAMP:return new A.StampEditor(d)}return null}pasteEditor(d,c){this.#e_.updateToolbar(d),this.#e_.updateMode(d);let{offsetX:u,offsetY:p}=this.#eC(),g=this.getNextId(),m=this.#eE({parent:this,id:g,x:u,y:p,uiManager:this.#e_,isCentered:!0,...c});m&&this.add(m)}deserialize(d){switch(d.annotationType??d.annotationEditorType){case p.AnnotationEditorType.FREETEXT:return m.FreeTextEditor.deserialize(d,this,this.#e_);case p.AnnotationEditorType.INK:return f.InkEditor.deserialize(d,this,this.#e_);case p.AnnotationEditorType.STAMP:return A.StampEditor.deserialize(d,this,this.#e_)}return null}#ex(d,c){let u=this.getNextId(),p=this.#eE({parent:this,id:u,x:d.offsetX,y:d.offsetY,uiManager:this.#e_,isCentered:c});return p&&this.add(p),p}#eC(){let{x:d,y:c,width:u,height:p}=this.div.getBoundingClientRect(),g=Math.max(0,d),m=Math.max(0,c),f=Math.min(window.innerWidth,d+u),b=Math.min(window.innerHeight,c+p),A=(g+f)/2-d,v=(m+b)/2-c,[y,_]=this.viewport.rotation%180==0?[A,v]:[v,A];return{offsetX:y,offsetY:_}}addNewEditor(){this.#ex(this.#eC(),!0)}setSelected(d){this.#e_.setSelected(d)}toggleSelected(d){this.#e_.toggleSelected(d)}isSelected(d){return this.#e_.isSelected(d)}unselect(d){this.#e_.unselect(d)}pointerup(d){let{isMac:c}=p.FeatureTest.platform;if(0===d.button&&(!d.ctrlKey||!c)&&d.target===this.div&&this.#eA){if(this.#eA=!1,!this.#ep){this.#ep=!0;return}if(this.#e_.getMode()===p.AnnotationEditorType.STAMP)return void this.#e_.unselectAll();this.#ex(d,!1)}}
3pointerdown(d){if(this.#eA){this.#eA=!1;return}let{isMac:c}=p.FeatureTest.platform;if(0!==d.button||d.ctrlKey&&c||d.target!==this.div)return;this.#eA=!0;let u=this.#e_.getActive();this.#ep=!u||u.isEmpty()}findNewParent(d,c,u){let p=this.#e_.findParent(c,u);return null!==p&&p!==this&&(p.changeParent(d),!0)}destroy(){for(let d of(this.#e_.getActive()?.parent===this&&(this.#e_.commitOrRemove(),this.#e_.setActiveEditor(null)),this.#eb.values()))this.#eu?.removePointerInTextLayer(d.contentDiv),d.setParent(null),d.isAttachedToDOM=!1,d.div.remove();this.div=null,this.#eb.clear(),this.#e_.removeLayer(this)}#eS(){for(let d of(this.#ev=!0,this.#eb.values()))d.isEmpty()&&d.remove();this.#ev=!1}render({viewport:d}){for(let c of(this.viewport=d,(0,b.setLayerDimensions)(this.div,d),this.#e_.getEditors(this.pageIndex)))this.add(c);this.updateMode()}update({viewport:d}){this.#e_.commitOrRemove(),this.viewport=d,(0,b.setLayerDimensions)(this.div,{rotation:d.rotation}),this.updateMode()}get pageDimensions(){let{pageWidth:d,pageHeight:c}=this.viewport.rawDims;return[d,c]}}c.AnnotationEditorLayer=v},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FreeTextEditor=void 0;var p=u(1),g=u(5),m=u(4),f=u(29);class b extends m.AnnotationEditor{#eT=this.editorDivBlur.bind(this);#ew=this.editorDivFocus.bind(this);#eP=this.editorDivInput.bind(this);#eM=this.editorDivKeydown.bind(this);#ek;#eF="";#eR=`${this.id}-editor`;#eI;#eD=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let d=b.prototype,c=d=>d.isEmpty(),u=g.AnnotationEditorUIManager.TRANSLATE_SMALL,m=g.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,p.shadow)(this,"_keyboardManager",new g.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],d.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],d.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],d._translateEmpty,{args:[-u,0],checker:c}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],d._translateEmpty,{args:[-m,0],checker:c}],[["ArrowRight","mac+ArrowRight"],d._translateEmpty,{args:[u,0],checker:c}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],d._translateEmpty,{args:[m,0],checker:c}],[["ArrowUp","mac+ArrowUp"],d._translateEmpty,{args:[0,-u],checker:c}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],d._translateEmpty,{args:[0,-m],checker:c}],[["ArrowDown","mac+ArrowDown"],d._translateEmpty,{args:[0,u],checker:c}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],d._translateEmpty,{args:[0,m],checker:c}]]))}static _type="freetext";constructor(d){super({...d,name:"freeTextEditor"}),this.#ek=d.color||b._defaultColor||m.AnnotationEditor._defaultLineColor,this.#eI=d.fontSize||b._defaultFontSize}static initialize(d){m.AnnotationEditor.initialize(d,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});let c=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(c.getPropertyValue("--freetext-padding"))}static updateDefaultParams(d,c){switch(d){case p.AnnotationEditorParamsType.FREETEXT_SIZE:b._defaultFontSize=c;break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:b._defaultColor=c}}updateParams(d,c){switch(d){case p.AnnotationEditorParamsType.FREETEXT_SIZE:this.#eL(c);break;case p.AnnotationEditorParamsType.FREETEXT_COLOR:this.#eO(c)}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,b._defaultFontSize],[p.AnnotationEditorParamsType.FREETEXT_COLOR,b._defaultColor||m.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.FREETEXT_SIZE,this.#eI],[p.AnnotationEditorParamsType.FREETEXT_COLOR,this.#ek]]}#eL(d){let c=d=>{this.editorDiv.style.fontSize=`calc(${d}px * var(--scale-factor))`,this.translate(0,-(d-this.#eI)*this.parentScale),this.#eI=d,this.#eN()},u=this.#eI;this.addCommands({cmd:()=>{c(d)},undo:()=>{c(u)},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#eO(d){let c=this.#ek;this.addCommands({cmd:()=>{this.#ek=this.editorDiv.style.color=d},undo:()=>{this.#ek=this.editorDiv.style.color=c},mustExec:!0,type:p.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(d,c){this._uiManager.translateSelectedEditors(d,c,!0)}getInitialTranslation(){let d=this.parentScale;return[-b._internalPadding*d,-(b._internalPadding+this.#eI)*d]}rebuild(){!this.parent||(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(p.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#eM),this.editorDiv.addEventListener("focus",this.#ew),this.editorDiv.addEventListener("blur",this.#eT),this.editorDiv.addEventListener("input",this.#eP))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#eR),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#eM),this.editorDiv.removeEventListener("focus",this.#ew),this.editorDiv.removeEventListener("blur",this.#eT),this.editorDiv.removeEventListener("input",this.#eP),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(d){this._focusEventsAllowed&&(super.focusin(d),d.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width?this.#eB():(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#eU(){let d=this.editorDiv.getElementsByTagName("div");if(0===d.length)return this.editorDiv.innerText;let c=[];for(let u of d)c.push(u.innerText.replace(/\r\n?|\n/,""));return c.join("\n")}#eN(){let d,[c,u]=this.parentDimensions;
3if(this.isAttachedToDOM)d=this.div.getBoundingClientRect();else{let{currentLayer:c,div:u}=this,p=u.style.display;u.style.display="hidden",c.div.append(this.div),d=u.getBoundingClientRect(),u.remove(),u.style.display=p}this.rotation%180==this.parentRotation%180?(this.width=d.width/c,this.height=d.height/u):(this.width=d.height/c,this.height=d.width/u),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let d=this.#eF,c=this.#eF=this.#eU().trimEnd();if(d===c)return;let u=d=>{(this.#eF=d,d)?(this.#ej(),this._uiManager.rebuild(this),this.#eN()):this.remove()};this.addCommands({cmd:()=>{u(c)},undo:()=>{u(d)},mustExec:!1}),this.#eN()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(d){this.enterInEditMode()}keydown(d){d.target===this.div&&"Enter"===d.key&&(this.enterInEditMode(),d.preventDefault())}editorDivKeydown(d){b._keyboardManager.exec(this,d)}editorDivFocus(d){this.isEditing=!0}editorDivBlur(d){this.isEditing=!1}editorDivInput(d){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){let d,c;if(this.div)return this.div;this.width&&(d=this.x,c=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#eR),this.enableEditing(),m.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(d=>this.editorDiv?.setAttribute("aria-label",d)),m.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(d=>this.editorDiv?.setAttribute("default-content",d)),this.editorDiv.contentEditable=!0;let{style:u}=this.editorDiv;if(u.fontSize=`calc(${this.#eI}px * var(--scale-factor))`,u.color=this.#ek,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,g.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[u,p]=this.parentDimensions;if(this.annotationElementId){let g,m,{position:f}=this.#eD,[b,A]=this.getInitialTranslation();[b,A]=this.pageTranslationToScreen(b,A);let[v,y]=this.pageDimensions,[_,S]=this.pageTranslation;switch(this.rotation){case 0:g=d+(f[0]-_)/v,m=c+this.height-(f[1]-S)/y;break;case 90:g=d+(f[0]-_)/v,m=c-(f[1]-S)/y,[b,A]=[A,-b];break;case 180:g=d-this.width+(f[0]-_)/v,m=c-(f[1]-S)/y,[b,A]=[-b,-A];break;case 270:g=d+(f[0]-_-this.height*y)/v,m=c+(f[1]-S-this.width*v)/y,[b,A]=[-A,b]}this.setAt(g*u,m*p,b,A)}else this.setAt(d*u,c*p,this.width*u,this.height*p);this.#ej(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}#ej(){if(this.editorDiv.replaceChildren(),this.#eF)for(let d of this.#eF.split("\n")){let c=document.createElement("div");c.append(d?document.createTextNode(d):document.createElement("br")),this.editorDiv.append(c)}}get contentDiv(){return this.editorDiv}static deserialize(d,c,u){let g=null;if(d instanceof f.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:c,fontColor:u},rect:m,rotation:f,id:b},textContent:A,textPosition:v,parent:{page:{pageNumber:y}}}=d;if(!A||0===A.length)return null;g=d={annotationType:p.AnnotationEditorType.FREETEXT,color:Array.from(u),fontSize:c,value:A.join("\n"),position:v,pageIndex:y-1,rect:m,rotation:f,id:b,deleted:!1}}let m=super.deserialize(d,c,u);return m.#eI=d.fontSize,m.#ek=p.Util.makeHexColor(...d.color),m.#eF=d.value,m.annotationElementId=d.id||null,m.#eD=g,m}serialize(d=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};let c=b._internalPadding*this.parentScale,u=this.getRect(c,c),g=m.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#ek),f={annotationType:p.AnnotationEditorType.FREETEXT,color:g,fontSize:this.#eI,value:this.#eF,pageIndex:this.pageIndex,rect:u,rotation:this.rotation,structTreeParentId:this._structTreeParentId};
3return d?f:this.annotationElementId&&!this.#ez(f)?null:(f.id=this.annotationElementId,f)}#ez(d){let{value:c,fontSize:u,color:p,rect:g,pageIndex:m}=this.#eD;return d.value!==c||d.fontSize!==u||d.rect.some((d,c)=>Math.abs(d-g[c])>=1)||d.color.some((d,c)=>d!==p[c])||d.pageIndex!==m}#eB(d=!1){if(!this.annotationElementId)return;if(this.#eN(),!d&&(0===this.width||0===this.height))return void setTimeout(()=>this.#eB(!0),0);let c=b._internalPadding*this.parentScale;this.#eD.rect=this.getRect(c,c)}}c.FreeTextEditor=b},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.StampAnnotationElement=c.InkAnnotationElement=c.FreeTextAnnotationElement=c.AnnotationLayer=void 0;var p=u(1),g=u(6),m=u(3),f=u(30),b=u(31),A=u(32);let v=1e3,y=9,_=new WeakSet;function S(d){return{width:d[2]-d[0],height:d[3]-d[1]}}class x{static create(d){switch(d.data.annotationType){case p.AnnotationType.LINK:return new C(d);case p.AnnotationType.TEXT:return new T(d);case p.AnnotationType.WIDGET:switch(d.data.fieldType){case"Tx":return new P(d);case"Btn":if(d.data.radioButton)return new F(d);if(d.data.checkBox)return new k(d);return new R(d);case"Ch":return new I(d);case"Sig":return new M(d)}return new w(d);case p.AnnotationType.POPUP:return new D(d);case p.AnnotationType.FREETEXT:return new O(d);case p.AnnotationType.LINE:return new N(d);case p.AnnotationType.SQUARE:return new B(d);case p.AnnotationType.CIRCLE:return new U(d);case p.AnnotationType.POLYLINE:return new j(d);case p.AnnotationType.CARET:return new H(d);case p.AnnotationType.INK:return new G(d);case p.AnnotationType.POLYGON:return new z(d);case p.AnnotationType.HIGHLIGHT:return new $(d);case p.AnnotationType.UNDERLINE:return new W(d);case p.AnnotationType.SQUIGGLY:return new V(d);case p.AnnotationType.STRIKEOUT:return new q(d);case p.AnnotationType.STAMP:return new X(d);case p.AnnotationType.FILEATTACHMENT:return new K(d);default:return new E(d)}}}class E{#eH=!1;constructor(d,{isRenderable:c=!1,ignoreBorder:u=!1,createQuadrilaterals:p=!1}={}){this.isRenderable=c,this.data=d.data,this.layer=d.layer,this.linkService=d.linkService,this.downloadManager=d.downloadManager,this.imageResourcesPath=d.imageResourcesPath,this.renderForms=d.renderForms,this.svgFactory=d.svgFactory,this.annotationStorage=d.annotationStorage,this.enableScripting=d.enableScripting,this.hasJSActions=d.hasJSActions,this._fieldObjects=d.fieldObjects,this.parent=d.parent,c&&(this.container=this._createContainer(u)),p&&this._createQuadrilaterals()}static _hasPopupData({titleObj:d,contentsObj:c,richText:u}){return!!(d?.str||c?.str||u?.str)}get hasPopupData(){return E._hasPopupData(this.data)}_createContainer(d){let{data:c,parent:{page:u,viewport:g}}=this,m=document.createElement("section");m.setAttribute("data-annotation-id",c.id),this instanceof w||(m.tabIndex=v),m.style.zIndex=this.parent.zIndex++,this.data.popupRef&&m.setAttribute("aria-haspopup","dialog"),c.noRotate&&m.classList.add("norotate");let{pageWidth:f,pageHeight:b,pageX:A,pageY:y}=g.rawDims;if(!c.rect||this instanceof D){let{rotation:d}=c;return c.hasOwnCanvas||0===d||this.setRotation(d,m),m}let{width:_,height:x}=S(c.rect),E=p.Util.normalizeRect([c.rect[0],u.view[3]-c.rect[1]+u.view[1],c.rect[2],u.view[3]-c.rect[3]+u.view[1]]);if(!d&&c.borderStyle.width>0){m.style.borderWidth=`${c.borderStyle.width}px`;let d=c.borderStyle.horizontalCornerRadius,u=c.borderStyle.verticalCornerRadius;if(d>0||u>0){let c=`calc(${d}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;m.style.borderRadius=c}else if(this instanceof F){let d=`calc(${_}px * var(--scale-factor)) / calc(${x}px * var(--scale-factor))`;m.style.borderRadius=d}switch(c.borderStyle.style){case p.AnnotationBorderStyleType.SOLID:m.style.borderStyle="solid";break;case p.AnnotationBorderStyleType.DASHED:m.style.borderStyle="dashed";break;case p.AnnotationBorderStyleType.BEVELED:(0,p.warn)("Unimplemented border style: beveled");break;case p.AnnotationBorderStyleType.INSET:(0,p.warn)("Unimplemented border style: inset");break;case p.AnnotationBorderStyleType.UNDERLINE:m.style.borderBottomStyle="solid"}let g=c.borderColor||null;g?(this.#eH=!0,m.style.borderColor=p.Util.makeHexColor(0|g[0],0|g[1],0|g[2])):m.style.borderWidth=0}m.style.left=`${100*(E[0]-A)/f}%`,m.style.top=`${100*(E[1]-y)/b}%`;let{rotation:C}=c;return c.hasOwnCanvas||0===C?(m.style.width=`${100*_/f}%`,m.style.height=`${100*x/b}%`):this.setRotation(C,m),m}setRotation(d,c=this.container){let u,p;if(!this.data.rect)return;let{pageWidth:g,pageHeight:m}=this.parent.viewport.rawDims,{width:f,height:b}=S(this.data.rect);d%180==0?(u=100*f/g,p=100*b/m):(u=100*b/g,p=100*f/m),c.style.width=`${u}%`,c.style.height=`${p}%`,c.setAttribute("data-main-rotation",(360-d)%360)}get _commonActions(){let d=(d,c,u)=>{let p=u.detail[d],g=p[0],m=p.slice(1);u.target.style[c]=f.ColorConverters[`${g}_HTML`](m),this.annotationStorage.setValue(this.data.id,{[c]:f.ColorConverters[`${g}_rgb`](m)})};return(0,p.shadow)(this,"_commonActions",{display:d=>{let{display:c}=d.detail,u=c%2==1;this.container.style.visibility=u?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:u,noPrint:1===c||2===c})},print:d=>{this.annotationStorage.setValue(this.data.id,{noPrint:!d.detail.print})},hidden:d=>{let{hidden:c}=d.detail;this.container.style.visibility=c?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:c,noView:c})},focus:d=>{setTimeout(()=>
3d.target.focus({preventScroll:!1}),0)},userName:d=>{d.target.title=d.detail.userName},readonly:d=>{d.target.disabled=d.detail.readonly},required:d=>{this._setRequired(d.target,d.detail.required)},bgColor:c=>{d("bgColor","backgroundColor",c)},fillColor:c=>{d("fillColor","backgroundColor",c)},fgColor:c=>{d("fgColor","color",c)},textColor:c=>{d("textColor","color",c)},borderColor:c=>{d("borderColor","borderColor",c)},strokeColor:c=>{d("strokeColor","borderColor",c)},rotation:d=>{let c=d.detail.rotation;this.setRotation(c),this.annotationStorage.setValue(this.data.id,{rotation:c})}})}_dispatchEventFromSandbox(d,c){let u=this._commonActions;for(let p of Object.keys(c.detail)){let g=d[p]||u[p];g?.(c)}}_setDefaultPropertiesFromJS(d){if(!this.enableScripting)return;let c=this.annotationStorage.getRawValue(this.data.id);if(!c)return;let u=this._commonActions;for(let[p,g]of Object.entries(c)){let m=u[p];m&&(m({detail:{[p]:g},target:d}),delete c[p])}}_createQuadrilaterals(){let d;if(!this.container)return;let{quadPoints:c}=this.data;if(!c)return;let[u,p,g,m]=this.data.rect;if(1===c.length){let[,{x:d,y:f},{x:b,y:A}]=c[0];if(g===d&&m===f&&u===b&&p===A)return}let{style:f}=this.container;if(this.#eH){let{borderColor:c,borderWidth:u}=f;f.borderWidth=0,d=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${c}" stroke-width="${u}">`],this.container.classList.add("hasBorder")}let b=g-u,A=m-p,{svgFactory:v}=this,y=v.createElement("svg");y.classList.add("quadrilateralsContainer"),y.setAttribute("width",0),y.setAttribute("height",0);let _=v.createElement("defs");y.append(_);let S=v.createElement("clipPath"),x=`clippath_${this.data.id}`;for(let[,{x:p,y:g},{x:f,y:y}]of(S.setAttribute("id",x),S.setAttribute("clipPathUnits","objectBoundingBox"),_.append(S),c)){let c=v.createElement("rect"),_=(f-u)/b,x=(m-g)/A,E=(p-f)/b,C=(g-y)/A;c.setAttribute("x",_),c.setAttribute("y",x),c.setAttribute("width",E),c.setAttribute("height",C),S.append(c),d?.push(`<rect vector-effect="non-scaling-stroke" x="${_}" y="${x}" width="${E}" height="${C}"/>`)}this.#eH&&(d.push("</g></svg>')"),f.backgroundImage=d.join("")),this.container.append(y),this.container.style.clipPath=`url(#${x})`}_createPopup(){let{container:d,data:c}=this;d.setAttribute("aria-haspopup","dialog");let u=new D({data:{color:c.color,titleObj:c.titleObj,modificationDate:c.modificationDate,contentsObj:c.contentsObj,richText:c.richText,parentRect:c.rect,borderStyle:0,id:`popup_${c.id}`,rotation:c.rotation},parent:this.parent,elements:[this]});this.parent.div.append(u.render())}render(){(0,p.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(d,c=null){let u=[];if(this._fieldObjects){let g=this._fieldObjects[d];if(g)for(let{page:d,id:m,exportValues:f}of g){if(-1===d||m===c)continue;let g="string"==typeof f?f:null,b=document.querySelector(`[data-element-id="${m}"]`);if(b&&!_.has(b)){(0,p.warn)(`_getElementsByName - element not allowed: ${m}`);continue}u.push({id:m,exportValue:g,domElement:b})}return u}for(let p of document.getElementsByName(d)){let{exportValue:d}=p,g=p.getAttribute("data-element-id");g!==c&&_.has(p)&&u.push({id:g,exportValue:d,domElement:p})}return u}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let d=this.getElementsToTriggerPopup();if(Array.isArray(d))for(let c of d)c.classList.add("highlightArea");else d.classList.add("highlightArea")}_editOnDoubleClick(){let{annotationEditorType:d,data:{id:c}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:d,editId:c})})}}class C extends E{constructor(d,c=null){super(d,{isRenderable:!0,ignoreBorder:!!c?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=d.data.isTooltipOnly}render(){let{data:d,linkService:c}=this,u=document.createElement("a");u.setAttribute("data-element-id",d.id);let p=!1;return d.url?(c.addLinkAttributes(u,d.url,d.newWindow),p=!0):d.action?(this._bindNamedAction(u,d.action),p=!0):d.attachment?(this._bindAttachment(u,d.attachment),p=!0):d.setOCGState?(this.#eG(u,d.setOCGState),p=!0):d.dest?(this._bindLink(u,d.dest),p=!0):(d.actions&&(d.actions.Action||d.actions["Mouse Up"]||d.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(u,d),p=!0),d.resetForm?(this._bindResetFormAction(u,d.resetForm),p=!0):this.isTooltipOnly&&!p&&(this._bindLink(u,""),p=!0)),this.container.classList.add("linkA
3nnotation"),p&&this.container.append(u),this.container}#e$(){this.container.setAttribute("data-internal-link","")}_bindLink(d,c){d.href=this.linkService.getDestinationHash(c),d.onclick=()=>(c&&this.linkService.goToDestination(c),!1),(c||""===c)&&this.#e$()}_bindNamedAction(d,c){d.href=this.linkService.getAnchorUrl(""),d.onclick=()=>(this.linkService.executeNamedAction(c),!1),this.#e$()}_bindAttachment(d,c){d.href=this.linkService.getAnchorUrl(""),d.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,c.content,c.filename),!1),this.#e$()}#eG(d,c){d.href=this.linkService.getAnchorUrl(""),d.onclick=()=>(this.linkService.executeSetOCGState(c),!1),this.#e$()}_bindJSAction(d,c){d.href=this.linkService.getAnchorUrl("");let u=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let p of Object.keys(c.actions)){let g=u.get(p);g&&(d[g]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c.id,name:p}}),!1))}d.onclick||(d.onclick=()=>!1),this.#e$()}_bindResetFormAction(d,c){let u=d.onclick;if(u||(d.href=this.linkService.getAnchorUrl("")),this.#e$(),!this._fieldObjects){(0,p.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),u||(d.onclick=()=>!1);return}d.onclick=()=>{u?.();let{fields:d,refs:g,include:m}=c,f=[];if(0!==d.length||0!==g.length){let c=new Set(g);for(let u of d)for(let{id:d}of this._fieldObjects[u]||[])c.add(d);for(let d of Object.values(this._fieldObjects))for(let u of d)c.has(u.id)===m&&f.push(u)}else for(let d of Object.values(this._fieldObjects))f.push(...d);let b=this.annotationStorage,A=[];for(let d of f){let{id:c}=d;switch(A.push(c),d.type){case"text":{let u=d.defaultValue||"";b.setValue(c,{value:u});break}case"checkbox":case"radiobutton":{let u=d.defaultValue===d.exportValues;b.setValue(c,{value:u});break}case"combobox":case"listbox":{let u=d.defaultValue||"";b.setValue(c,{value:u});break}default:continue}let u=document.querySelector(`[data-element-id="${c}"]`);if(u){if(!_.has(u)){(0,p.warn)(`_bindResetFormAction - element not allowed: ${c}`);continue}u.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:A,name:"ResetForm"}}),!1}}}class T extends E{constructor(d){super(d,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let d=document.createElement("img");return d.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",d.alt="[{{type}} Annotation]",d.dataset.l10nId="text_annotation_type",d.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(d),this.container}}class w extends E{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(d){this.data.hasOwnCanvas&&(d.previousSibling?.nodeName==="CANVAS"&&(d.previousSibling.hidden=!0),d.hidden=!1)}_getKeyModifier(d){let{isWin:c,isMac:u}=p.FeatureTest.platform;return c&&d.ctrlKey||u&&d.metaKey}_setEventListener(d,c,u,p,g){u.includes("mouse")?d.addEventListener(u,d=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:p,value:g(d),shift:d.shiftKey,modifier:this._getKeyModifier(d)}})}):d.addEventListener(u,d=>{if("blur"===u){if(!c.focused||!d.relatedTarget)return;c.focused=!1}else if("focus"===u){if(c.focused)return;c.focused=!0}g&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:p,value:g(d)}})})}_setEventListeners(d,c,u,p){for(let[g,m]of u)("Action"===m||this.data.actions?.[m])&&(("Focus"===m||"Blur"===m)&&(c||={focused:!1}),this._setEventListener(d,c,g,m,p),"Focus"!==m||this.data.actions?.Blur?"Blur"!==m||this.data.actions?.Focus||this._setEventListener(d,c,"focus","Focus",null):this._setEventListener(d,c,"blur","Blur",null))}_setBackgroundColor(d){let c=this.data.backgroundColor||null;d.style.backgroundColor=null===c?"transparent":p.Util.makeHexColor(c[0],c[1],c[2])}_setTextStyle(d){let c,u=["left","center","right"],{fontColor:g}=this.data.defaultAppearanceData,m=this.data.defaultAppearanceData.fontSize||y,f=d.style,b=2,A=d=>Math.round(10*d)/10;if(this.data.multiLine){let d=Math.abs(this.data.rect[3]-this.data.rect[1]-b),u=Math.round(d/(p.LINE_FACTOR*m))||1;c=Math.min(m,A(d/u/p.LINE_FACTOR))}else c=Math.min(m,A(Math.abs(this.data.rect[3]-this.data.rect[1]-b)/p.LINE_FACTOR));f.fontSize=`calc(${c}px * var(--scale-factor))`,f.color=p.Util.makeHexColor(g[0],g[1],g[2]),null!==this.data.textAlignment&&(f.textAlign=u[this.data.textAlignment])}_setRequired(d,c){c?d.setAttribute("required",!0):d.removeAttribute("required"),d.setAttribute("aria-required",c)}}class P extends w{constructor(d){const c=d.renderForms||!d.data.hasAppearance&&!!d.data.fieldValue;super(d,{isRenderable:c})}setPropertyOnSiblings(d,c,u,p){let g=this.annotationStorage;
3for(let m of this._getElementsByName(d.name,d.id))m.domElement&&(m.domElement[c]=u),g.setValue(m.id,{[p]:u})}render(){let d=this.annotationStorage,c=this.data.id;this.container.classList.add("textWidgetAnnotation");let u=null;if(this.renderForms){let p=d.getValue(c,{value:this.data.fieldValue}),g=p.value||"",m=d.getValue(c,{charLimit:this.data.maxLen}).charLimit;m&&g.length>m&&(g=g.slice(0,m));let f=p.formattedValue||this.data.textContent?.join("\n")||null;f&&this.data.comb&&(f=f.replaceAll(/\s+/g,""));let b={userValue:g,formattedValue:f,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((u=document.createElement("textarea")).textContent=f??g,this.data.doNotScroll&&(u.style.overflowY="hidden")):((u=document.createElement("input")).type="text",u.setAttribute("value",f??g),this.data.doNotScroll&&(u.style.overflowX="hidden")),this.data.hasOwnCanvas&&(u.hidden=!0),_.add(u),u.setAttribute("data-element-id",c),u.disabled=this.data.readOnly,u.name=this.data.fieldName,u.tabIndex=v,this._setRequired(u,this.data.required),m&&(u.maxLength=m),u.addEventListener("input",p=>{d.setValue(c,{value:p.target.value}),this.setPropertyOnSiblings(u,"value",p.target.value,"value"),b.formattedValue=null}),u.addEventListener("resetform",d=>{let c=this.data.defaultFieldValue??"";u.value=b.userValue=c,b.formattedValue=null});let A=d=>{let{formattedValue:c}=b;null!=c&&(d.target.value=c),d.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){u.addEventListener("focus",d=>{if(b.focused)return;let{target:c}=d;b.userValue&&(c.value=b.userValue),b.lastCommittedValue=c.value,b.commitKey=1,b.focused=!0}),u.addEventListener("updatefromsandbox",u=>{this.showElementAndHideCanvas(u.target);let p={value(u){b.userValue=u.detail.value??"",d.setValue(c,{value:b.userValue.toString()}),u.target.value=b.userValue},formattedValue(u){let{formattedValue:p}=u.detail;b.formattedValue=p,null!=p&&u.target!==document.activeElement&&(u.target.value=p),d.setValue(c,{formattedValue:p})},selRange(d){d.target.setSelectionRange(...d.detail.selRange)},charLimit:u=>{let{charLimit:p}=u.detail,{target:g}=u;if(0===p)return void g.removeAttribute("maxLength");g.setAttribute("maxLength",p);let m=b.userValue;m&&!(m.length<=p)&&(g.value=b.userValue=m=m.slice(0,p),d.setValue(c,{value:m}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c,name:"Keystroke",value:m,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(p,u)}),u.addEventListener("keydown",d=>{b.commitKey=1;let u=-1;if("Escape"===d.key?u=0:"Enter"!==d.key||this.data.multiLine?"Tab"===d.key&&(b.commitKey=3):u=2,-1===u)return;let{value:p}=d.target;b.lastCommittedValue!==p&&(b.lastCommittedValue=p,b.userValue=p,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c,name:"Keystroke",value:p,willCommit:!0,commitKey:u,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}))});let p=A;A=null,u.addEventListener("blur",d=>{if(!b.focused||!d.relatedTarget)return;b.focused=!1;let{value:u}=d.target;b.userValue=u,b.lastCommittedValue!==u&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c,name:"Keystroke",value:u,willCommit:!0,commitKey:b.commitKey,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}),p(d)}),this.data.actions?.Keystroke&&u.addEventListener("beforeinput",d=>{b.lastCommittedValue=null;let{data:u,target:p}=d,{value:g,selectionStart:m,selectionEnd:f}=p,A=m,v=f;switch(d.inputType){case"deleteWordBackward":{let d=g.substring(0,m).match(/\w*[^\w]*$/);d&&(A-=d[0].length);break}
3case"deleteWordForward":{let d=g.substring(m).match(/^[^\w]*\w*/);d&&(v+=d[0].length);break}case"deleteContentBackward":m===f&&(A-=1);break;case"deleteContentForward":m===f&&(v+=1)}d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c,name:"Keystroke",value:g,change:u||"",willCommit:!1,selStart:A,selEnd:v}})}),this._setEventListeners(u,b,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.value)}if(A&&u.addEventListener("blur",A),this.data.comb){let d=(this.data.rect[2]-this.data.rect[0])/m;u.classList.add("comb"),u.style.letterSpacing=`calc(${d}px * var(--scale-factor) - 1ch)`}}else(u=document.createElement("div")).textContent=this.data.fieldValue,u.style.verticalAlign="middle",u.style.display="table-cell";return this._setTextStyle(u),this._setBackgroundColor(u),this._setDefaultPropertiesFromJS(u),this.container.append(u),this.container}}class M extends w{constructor(d){super(d,{isRenderable:!!d.data.hasOwnCanvas})}}class k extends w{constructor(d){super(d,{isRenderable:d.renderForms})}render(){let d=this.annotationStorage,c=this.data,u=c.id,p=d.getValue(u,{value:c.exportValue===c.fieldValue}).value;"string"==typeof p&&(p="Off"!==p,d.setValue(u,{value:p})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let g=document.createElement("input");return _.add(g),g.setAttribute("data-element-id",u),g.disabled=c.readOnly,this._setRequired(g,this.data.required),g.type="checkbox",g.name=c.fieldName,p&&g.setAttribute("checked",!0),g.setAttribute("exportValue",c.exportValue),g.tabIndex=v,g.addEventListener("change",p=>{let{name:g,checked:m}=p.target;for(let p of this._getElementsByName(g,u)){let u=m&&p.exportValue===c.exportValue;p.domElement&&(p.domElement.checked=u),d.setValue(p.id,{value:u})}d.setValue(u,{value:m})}),g.addEventListener("resetform",d=>{let u=c.defaultFieldValue||"Off";d.target.checked=u===c.exportValue}),this.enableScripting&&this.hasJSActions&&(g.addEventListener("updatefromsandbox",c=>{let p={value(c){c.target.checked="Off"!==c.detail.value,d.setValue(u,{value:c.target.checked})}};this._dispatchEventFromSandbox(p,c)}),this._setEventListeners(g,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.checked)),this._setBackgroundColor(g),this._setDefaultPropertiesFromJS(g),this.container.append(g),this.container}}class F extends w{constructor(d){super(d,{isRenderable:d.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let d=this.annotationStorage,c=this.data,u=c.id,p=d.getValue(u,{value:c.fieldValue===c.buttonValue}).value;"string"==typeof p&&(p=p!==c.buttonValue,d.setValue(u,{value:p}));let g=document.createElement("input");if(_.add(g),g.setAttribute("data-element-id",u),g.disabled=c.readOnly,this._setRequired(g,this.data.required),g.type="radio",g.name=c.fieldName,p&&g.setAttribute("checked",!0),g.tabIndex=v,g.addEventListener("change",c=>{let{name:p,checked:g}=c.target;for(let c of this._getElementsByName(p,u))d.setValue(c.id,{value:!1});d.setValue(u,{value:g})}),g.addEventListener("resetform",d=>{let u=c.defaultFieldValue;d.target.checked=null!=u&&u===c.buttonValue}),this.enableScripting&&this.hasJSActions){let p=c.buttonValue;g.addEventListener("updatefromsandbox",c=>{let g={value:c=>{let g=p===c.detail.value;for(let p of this._getElementsByName(c.target.name)){let c=g&&p.id===u;p.domElement&&(p.domElement.checked=c),d.setValue(p.id,{value:c})}}};this._dispatchEventFromSandbox(g,c)}),this._setEventListeners(g,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.checked)}return this._setBackgroundColor(g),this._setDefaultPropertiesFromJS(g),this.container.append(g),this.container}}class R extends C{constructor(d){super(d,{ignoreBorder:d.data.hasAppearance})}render(){let d=super.render();
3d.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(d.title=this.data.alternativeText);let c=d.lastChild;return this.enableScripting&&this.hasJSActions&&c&&(this._setDefaultPropertiesFromJS(c),c.addEventListener("updatefromsandbox",d=>{this._dispatchEventFromSandbox({},d)})),d}}class I extends w{constructor(d){super(d,{isRenderable:d.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let d=this.annotationStorage,c=this.data.id,u=d.getValue(c,{value:this.data.fieldValue}),p=document.createElement("select");_.add(p),p.setAttribute("data-element-id",c),p.disabled=this.data.readOnly,this._setRequired(p,this.data.required),p.name=this.data.fieldName,p.tabIndex=v;let g=this.data.combo&&this.data.options.length>0;for(let d of(!this.data.combo&&(p.size=this.data.options.length,this.data.multiSelect&&(p.multiple=!0)),p.addEventListener("resetform",d=>{let c=this.data.defaultFieldValue;for(let d of p.options)d.selected=d.value===c}),this.data.options)){let c=document.createElement("option");c.textContent=d.displayValue,c.value=d.exportValue,u.value.includes(d.exportValue)&&(c.setAttribute("selected",!0),g=!1),p.append(c)}let m=null;if(g){let d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),p.prepend(d),m=()=>{d.remove(),p.removeEventListener("input",m),m=null},p.addEventListener("input",m)}let f=d=>{let c=d?"value":"textContent",{options:u,multiple:g}=p;return g?Array.prototype.filter.call(u,d=>d.selected).map(d=>d[c]):-1===u.selectedIndex?null:u[u.selectedIndex][c]},b=f(!1),A=d=>{let c=d.target.options;return Array.prototype.map.call(c,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(p.addEventListener("updatefromsandbox",u=>{let g={value(u){m?.();let g=u.detail.value,A=new Set(Array.isArray(g)?g:[g]);for(let d of p.options)d.selected=A.has(d.value);d.setValue(c,{value:f(!0)}),b=f(!1)},multipleSelection(d){p.multiple=!0},remove(u){let g=p.options,m=u.detail.remove;g[m].selected=!1,p.remove(m),g.length>0&&-1===Array.prototype.findIndex.call(g,d=>d.selected)&&(g[0].selected=!0),d.setValue(c,{value:f(!0),items:A(u)}),b=f(!1)},clear(u){for(;0!==p.length;)p.remove(0);d.setValue(c,{value:null,items:[]}),b=f(!1)},insert(u){let{index:g,displayValue:m,exportValue:v}=u.detail.insert,y=p.children[g],_=document.createElement("option");_.textContent=m,_.value=v,y?y.before(_):p.append(_),d.setValue(c,{value:f(!0),items:A(u)}),b=f(!1)},items(u){let{items:g}=u.detail;for(;0!==p.length;)p.remove(0);for(let d of g){let{displayValue:c,exportValue:u}=d,g=document.createElement("option");g.textContent=c,g.value=u,p.append(g)}p.options.length>0&&(p.options[0].selected=!0),d.setValue(c,{value:f(!0),items:A(u)}),b=f(!1)},indices(u){let p=new Set(u.detail.indices);for(let d of u.target.options)d.selected=p.has(d.index);d.setValue(c,{value:f(!0)}),b=f(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(g,u)}),p.addEventListener("input",u=>{let p=f(!0);d.setValue(c,{value:p}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:c,name:"Keystroke",value:b,changeEx:p,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(p,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):p.addEventListener("input",function(u){d.setValue(c,{value:f(!0)})}),this.data.combo&&this._setTextStyle(p),this._setBackgroundColor(p),this._setDefaultPropertiesFromJS(p),this.container.append(p),this.container}}class D extends E{constructor(d){const{data:c,elements:u}=d;super(d,{isRenderable:E._hasPopupData(c)}),this.elements=u}render(){this.container.classList.add("popupAnnotation");let d=new L({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),c=[];for(let u of this.elements)u.popup=d,c.push(u.data.id),u.addHighlightArea();return this.container.setAttribute("aria-controls",c.map(d=>`${p.AnnotationPrefix}${d}
3`).join(",")),this.container}}class L{#eW=null;#eV=this.#eq.bind(this);#eX=this.#eK.bind(this);#eY=this.#eJ.bind(this);#eQ=this.#eZ.bind(this);#ek=null;#tR=null;#e0=null;#e1=null;#e2=null;#e3=null;#e5=!1;#e8=null;#e4=null;#e6=null;#e7=null;#e9=!1;constructor({container:d,color:c,elements:u,titleObj:p,modificationDate:m,contentsObj:f,richText:b,parent:A,rect:v,parentRect:y,open:_}){this.#tR=d,this.#e7=p,this.#e0=f,this.#e6=b,this.#e2=A,this.#ek=c,this.#e4=v,this.#e3=y,this.#e1=u;const S=g.PDFDateString.toDateObject(m);for(const d of(S&&(this.#eW=A.l10n.get("annotation_date_string",{date:S.toLocaleDateString(),time:S.toLocaleTimeString()})),this.trigger=u.flatMap(d=>d.getElementsToTriggerPopup()),this.trigger))d.addEventListener("click",this.#eQ),d.addEventListener("mouseenter",this.#eY),d.addEventListener("mouseleave",this.#eX),d.classList.add("popupTriggerArea");for(const d of u)d.container?.addEventListener("keydown",this.#eV);this.#tR.hidden=!0,_&&this.#eZ()}render(){if(this.#e8)return;let{page:{view:d},viewport:{rawDims:{pageWidth:c,pageHeight:u,pageX:g,pageY:m}}}=this.#e2,f=this.#e8=document.createElement("div");if(f.className="popup",this.#ek){let d=f.style.outlineColor=p.Util.makeHexColor(...this.#ek);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))f.style.backgroundColor=`color-mix(in srgb, ${d} 30%, white)`;else{let d=.7;f.style.backgroundColor=p.Util.makeHexColor(...this.#ek.map(c=>Math.floor(d*(255-c)+c)))}}let b=document.createElement("span");b.className="header";let v=document.createElement("h1");if(b.append(v),{dir:v.dir,str:v.textContent}=this.#e7,f.append(b),this.#eW){let d=document.createElement("span");d.classList.add("popupDate"),this.#eW.then(c=>{d.textContent=c}),b.append(d)}let y=this.#e0,_=this.#e6;if(_?.str&&(!y?.str||y.str===_.str))A.XfaLayer.render({xfaHtml:_.html,intent:"richText",div:f}),f.lastChild.classList.add("richText","popupContent");else{let d=this._formatContents(y);f.append(d)}let S=!!this.#e3,x=S?this.#e3:this.#e4;for(let d of this.#e1)if(!x||null!==p.Util.intersect(d.data.rect,x)){x=d.data.rect,S=!0;break}let E=p.Util.normalizeRect([x[0],d[3]-x[1]+d[1],x[2],d[3]-x[3]+d[1]]),C=5,T=S?x[2]-x[0]+C:0,w=E[0]+T,P=E[1],{style:M}=this.#tR;M.left=`${100*(w-g)/c}%`,M.top=`${100*(P-m)/u}%`,this.#tR.append(f)}_formatContents({str:d,dir:c}){let u=document.createElement("p");u.classList.add("popupContent"),u.dir=c;let p=d.split(/(?:\r\n?|\n)/);for(let d=0,c=p.length;d<c;++d){let g=p[d];u.append(document.createTextNode(g)),d<c-1&&u.append(document.createElement("br"))}return u}#eq(d){d.altKey||d.shiftKey||d.ctrlKey||d.metaKey||("Enter"===d.key||"Escape"===d.key&&this.#e5)&&this.#eZ()}#eZ(){this.#e5=!this.#e5,this.#e5?(this.#eJ(),this.#tR.addEventListener("click",this.#eQ),this.#tR.addEventListener("keydown",this.#eV)):(this.#eK(),this.#tR.removeEventListener("click",this.#eQ),this.#tR.removeEventListener("keydown",this.#eV))}#eJ(){this.#e8||this.render(),this.isVisible?this.#e5&&this.#tR.classList.add("focused"):(this.#tR.hidden=!1,this.#tR.style.zIndex=parseInt(this.#tR.style.zIndex)+1e3)}#eK(){this.#tR.classList.remove("focused"),!this.#e5&&this.isVisible&&(this.#tR.hidden=!0,this.#tR.style.zIndex=parseInt(this.#tR.style.zIndex)-1e3)}forceHide(){this.#e9=this.isVisible,this.#e9&&(this.#tR.hidden=!0)}maybeShow(){this.#e9&&(this.#e9=!1,this.#tR.hidden=!1)}get isVisible(){return!1===this.#tR.hidden}}class O extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0}),this.textContent=d.data.textContent,this.textPosition=d.data.textPosition,this.annotationEditorType=p.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let d=document.createElement("div");for(let c of(d.classList.add("annotationTextContent"),d.setAttribute("role","comment"),this.textContent)){let u=document.createElement("span");u.textContent=c,d.append(u)}this.container.append(d)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}c.FreeTextAnnotationElement=O;class N extends E{#it=null;constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let d=this.data,{width:c,height:u}=S(d.rect),p=this.svgFactory.create(c,u,!0),g=this.#it=this.svgFactory.createElement("svg:line");return g.setAttribute("x1",d.rect[2]-d.lineCoordinates[0]),g.setAttribute("y1",d.rect[3]-d.lineCoordinates[1]),g.setAttribute("x2",d.rect[2]-d.lineCoordinates[2]),g.setAttribute("y2",d.rect[3]-d.lineCoordinates[3]),g.setAttribute("stroke-width",d.borderStyle.width||1),g.setAttribute("stroke","transparent"),g.setAttribute("fill","transparent"),p.append(g),this.container.append(p),!d.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#it}addHighlightArea(){this.container.classList.add("highlightArea")}}
3class B extends E{#ie=null;constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let d=this.data,{width:c,height:u}=S(d.rect),p=this.svgFactory.create(c,u,!0),g=d.borderStyle.width,m=this.#ie=this.svgFactory.createElement("svg:rect");return m.setAttribute("x",g/2),m.setAttribute("y",g/2),m.setAttribute("width",c-g),m.setAttribute("height",u-g),m.setAttribute("stroke-width",g||1),m.setAttribute("stroke","transparent"),m.setAttribute("fill","transparent"),p.append(m),this.container.append(p),!d.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ie}addHighlightArea(){this.container.classList.add("highlightArea")}}class U extends E{#ii=null;constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let d=this.data,{width:c,height:u}=S(d.rect),p=this.svgFactory.create(c,u,!0),g=d.borderStyle.width,m=this.#ii=this.svgFactory.createElement("svg:ellipse");return m.setAttribute("cx",c/2),m.setAttribute("cy",u/2),m.setAttribute("rx",c/2-g/2),m.setAttribute("ry",u/2-g/2),m.setAttribute("stroke-width",g||1),m.setAttribute("stroke","transparent"),m.setAttribute("fill","transparent"),p.append(m),this.container.append(p),!d.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ii}addHighlightArea(){this.container.classList.add("highlightArea")}}class j extends E{#is=null;constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let d=this.data,{width:c,height:u}=S(d.rect),p=this.svgFactory.create(c,u,!0),g=[];for(let c of d.vertices){let u=c.x-d.rect[0],p=d.rect[3]-c.y;g.push(u+","+p)}g=g.join(" ");let m=this.#is=this.svgFactory.createElement(this.svgElementName);return m.setAttribute("points",g),m.setAttribute("stroke-width",d.borderStyle.width||1),m.setAttribute("stroke","transparent"),m.setAttribute("fill","transparent"),p.append(m),this.container.append(p),!d.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#is}addHighlightArea(){this.container.classList.add("highlightArea")}}class z extends j{constructor(d){super(d),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}
3class H extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class G extends E{#ir=[];constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=p.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let d=this.data,{width:c,height:u}=S(d.rect),p=this.svgFactory.create(c,u,!0);for(let c of d.inkLists){let u=[];for(let p of c){let c=p.x-d.rect[0],g=d.rect[3]-p.y;u.push(`${c},${g}`)}u=u.join(" ");let g=this.svgFactory.createElement(this.svgElementName);this.#ir.push(g),g.setAttribute("points",u),g.setAttribute("stroke-width",d.borderStyle.width||1),g.setAttribute("stroke","transparent"),g.setAttribute("fill","transparent"),!d.popupRef&&this.hasPopupData&&this._createPopup(),p.append(g)}return this.container.append(p),this.container}getElementsToTriggerPopup(){return this.#ir}addHighlightArea(){this.container.classList.add("highlightArea")}}c.InkAnnotationElement=G;class $ extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class W extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class V extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class q extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class X extends E{constructor(d){super(d,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}c.StampAnnotationElement=X;class K extends E{#ia=null;constructor(d){super(d,{isRenderable:!0});const{filename:c,content:u}=this.data.file;this.filename=(0,g.getFilenameFromUrl)(c,!0),this.content=u,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:c,content:u})}render(){let d;this.container.classList.add("fileAttachmentAnnotation");let{container:c,data:u}=this;u.hasAppearance||0===u.fillAlpha?d=document.createElement("div"):((d=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(u.name)?"paperclip":"pushpin"}.svg`,u.fillAlpha&&u.fillAlpha<1&&(d.style=`filter: opacity(${Math.round(100*u.fillAlpha)}%);`)),d.addEventListener("dblclick",this.#io.bind(this)),this.#ia=d;let{isMac:g}=p.FeatureTest.platform;return c.addEventListener("keydown",d=>{"Enter"===d.key&&(g?d.metaKey:d.ctrlKey)&&this.#io()}),!u.popupRef&&this.hasPopupData?this._createPopup():d.classList.add("popupTriggerArea"),c.append(d),c}getElementsToTriggerPopup(){return this.#ia}addHighlightArea(){this.container.classList.add("highlightArea")}#io(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class Y{#eu=null;#il=null;#ih=new Map;constructor({div:d,accessibilityManager:c,annotationCanvasMap:u,l10n:p,page:g,viewport:m}){this.div=d,this.#eu=c,this.#il=u,this.l10n=p,this.page=g,this.viewport=m,this.zIndex=0,this.l10n||=b.NullL10n}#id(d,c){let u=d.firstChild||d;u.id=`${p.AnnotationPrefix}${c}`,this.div.append(d),this.#eu?.moveElementInDOM(this.div,d,u,!1)}async render(d){let{annotations:c}=d,u=this.div;(0,g.setLayerDimensions)(u,this.viewport);let f=new Map,b={data:null,layer:u,linkService:d.linkService,downloadManager:d.downloadManager,imageResourcesPath:d.imageResourcesPath||"",renderForms:!1!==d.renderForms,svgFactory:new g.DOMSVGFactory,annotationStorage:d.annotationStorage||new m.AnnotationStorage,enableScripting:!0===d.enableScripting,hasJSActions:d.hasJSActions,fieldObjects:d.fieldObjects,parent:this,elements:null};for(let d of c){if(d.noHTML)continue;let c=d.annotationType===p.AnnotationType.POPUP;if(c){let c=f.get(d.id);if(!c)continue;b.elements=c}else{let{width:c,height:u}=S(d.rect);if(c<=0||u<=0)continue}b.data=d;
3let u=x.create(b);if(!u.isRenderable)continue;if(!c&&d.popupRef){let c=f.get(d.popupRef);c?c.push(u):f.set(d.popupRef,[u])}u.annotationEditorType>0&&this.#ih.set(u.data.id,u);let g=u.render();d.hidden&&(g.style.visibility="hidden"),this.#id(g,d.id)}this.#ic(),await this.l10n.translate(u)}update({viewport:d}){let c=this.div;this.viewport=d,(0,g.setLayerDimensions)(c,{rotation:d.rotation}),this.#ic(),c.hidden=!1}#ic(){if(!this.#il)return;let d=this.div;for(let[c,u]of this.#il){let p=d.querySelector(`[data-annotation-id="${c}"]`);if(!p)continue;let{firstChild:g}=p;g?"CANVAS"===g.nodeName?g.replaceWith(u):g.before(u):p.append(u)}this.#il.clear()}getEditableAnnotations(){return Array.from(this.#ih.values())}getEditableAnnotation(d){return this.#ih.get(d)}}c.AnnotationLayer=Y},(d,c)=>{function u(d){return Math.floor(255*Math.max(0,Math.min(1,d))).toString(16).padStart(2,"0")}function p(d){return Math.max(0,Math.min(255,255*d))}Object.defineProperty(c,"__esModule",{value:!0}),c.ColorConverters=void 0;class g{static CMYK_G([d,c,u,p]){return["G",1-Math.min(1,.3*d+.59*u+.11*c+p)]}static G_CMYK([d]){return["CMYK",0,0,0,1-d]}static G_RGB([d]){return["RGB",d,d,d]}static G_rgb([d]){return[d=p(d),d,d]}static G_HTML([d]){let c=u(d);return`#${c}${c}${c}`}static RGB_G([d,c,u]){return["G",.3*d+.59*c+.11*u]}static RGB_rgb(d){return d.map(p)}static RGB_HTML(d){return`#${d.map(u).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([d,c,u,p]){return["RGB",1-Math.min(1,d+p),1-Math.min(1,u+p),1-Math.min(1,c+p)]}static CMYK_rgb([d,c,u,g]){return[p(1-Math.min(1,d+g)),p(1-Math.min(1,u+g)),p(1-Math.min(1,c+g))]}static CMYK_HTML(d){let c=this.CMYK_RGB(d).slice(1);return this.RGB_HTML(c)}static RGB_CMYK([d,c,u]){let p=1-d,g=1-c,m=1-u,f=Math.min(p,g,m);return["CMYK",p,g,m,f]}}c.ColorConverters=g},(d,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.NullL10n=void 0,c.getL10nFallback=p;let u={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typingâ¦",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function p(d,c){switch(d){case"find_match_count":d=`find_match_count[${1===c.total?"one":"other"}]`;break;case"find_match_count_limit":d=`find_match_count_limit[${1===c.limit?"one"
3:"other"}]`}return u[d]||""}function g(d,c){return c?d.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(d,u)=>u in c?c[u]:"{{"+u+"}}"):d}u.print_progress_percent="{{progress}}%",c.NullL10n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(d,c=null,u=p(d,c))=>g(u,c),async translate(d){}}},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.XfaLayer=void 0;var p=u(25);class g{static setupStorage(d,c,u,p,g){let m=p.getValue(c,{value:null});switch(u.name){case"textarea":if(null!==m.value&&(d.textContent=m.value),"print"===g)break;d.addEventListener("input",d=>{p.setValue(c,{value:d.target.value})});break;case"input":if("radio"===u.attributes.type||"checkbox"===u.attributes.type){if(m.value===u.attributes.xfaOn?d.setAttribute("checked",!0):m.value===u.attributes.xfaOff&&d.removeAttribute("checked"),"print"===g)break;d.addEventListener("change",d=>{p.setValue(c,{value:d.target.checked?d.target.getAttribute("xfaOn"):d.target.getAttribute("xfaOff")})})}else{if(null!==m.value&&d.setAttribute("value",m.value),"print"===g)break;d.addEventListener("input",d=>{p.setValue(c,{value:d.target.value})})}break;case"select":if(null!==m.value)for(let c of(d.setAttribute("value",m.value),u.children))c.attributes.value===m.value?c.attributes.selected=!0:c.attributes.hasOwnProperty("selected")&&delete c.attributes.selected;d.addEventListener("input",d=>{let u=d.target.options,g=-1===u.selectedIndex?"":u[u.selectedIndex].value;p.setValue(c,{value:g})})}}static setAttributes({html:d,element:c,storage:u=null,intent:p,linkService:g}){let{attributes:m}=c,f=d instanceof HTMLAnchorElement;for(let[c,u]of("radio"===m.type&&(m.name=`${m.name}-${p}`),Object.entries(m)))if(null!=u)switch(c){case"class":u.length&&d.setAttribute(c,u.join(" "));break;case"dataId":break;case"id":d.setAttribute("data-element-id",u);break;case"style":Object.assign(d.style,u);break;case"textContent":d.textContent=u;break;default:f&&("href"===c||"newWindow"===c)||d.setAttribute(c,u)}f&&g.addLinkAttributes(d,m.href,m.newWindow),u&&m.dataId&&this.setupStorage(d,m.dataId,c,u)}static render(d){let c=d.annotationStorage,u=d.linkService,g=d.xfaHtml,m=d.intent||"display",f=document.createElement(g.name);g.attributes&&this.setAttributes({html:f,element:g,intent:m,linkService:u});let b=[[g,-1,f]],A=d.div;if(A.append(f),d.viewport){let c=`matrix(${d.viewport.transform.join(",")})`;A.style.transform=c}"richText"!==m&&A.setAttribute("class","xfaLayer xfaFont");let v=[];for(;b.length>0;){let[d,g,f]=b.at(-1);if(g+1===d.children.length){b.pop();continue}let A=d.children[++b.at(-1)[1]];if(null===A)continue;let{name:y}=A;if("#text"===y){let d=document.createTextNode(A.value);v.push(d),f.append(d);continue}let _=A?.attributes?.xmlns?document.createElementNS(A.attributes.xmlns,y):document.createElement(y);if(f.append(_),A.attributes&&this.setAttributes({html:_,element:A,storage:c,intent:m,linkService:u}),A.children&&A.children.length>0)b.push([A,-1,_]);else if(A.value){let d=document.createTextNode(A.value);p.XfaText.shouldBuildText(y)&&v.push(d),_.append(d)}}for(let d of A.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:v}}static update(d){let c=`matrix(${d.viewport.transform.join(",")})`;d.div.style.transform=c,d.div.hidden=!1}}c.XfaLayer=g},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InkEditor=void 0;var p=u(1),g=u(4),m=u(29),f=u(6),b=u(5);class A extends g.AnnotationEditor{#iu=0;#ip=0;#ig=this.canvasPointermove.bind(this);#im=this.canvasPointerleave.bind(this);#ib=this.canvasPointerup.bind(this);#iA=this.canvasPointerdown.bind(this);#iv=new Path2D;#iy=!1;#i_=!1;#iS=!1;#ix=null;#iE=0;#iC=0;#iT=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(d){super({...d,name:"inkEditor"}),this.color=d.color||null,this.thickness=d.thickness||null,this.opacity=d.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(d){g.AnnotationEditor.initialize(d,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(d,c){switch(d){case p.AnnotationEditorParamsType.INK_THICKNESS:A._defaultThickness=c;break;case p.AnnotationEditorParamsType.INK_COLOR:A._defaultColor=c;break;case p.AnnotationEditorParamsType.INK_OPACITY:A._defaultOpacity=c/100}}updateParams(d,c){switch(d){case p.AnnotationEditorParamsType.INK_THICKNESS:this.#iw(c);break;case p.AnnotationEditorParamsType.INK_COLOR:this.#eO(c);break;case p.AnnotationEditorParamsType.INK_OPACITY:this.#iP(c)}}static get defaultPropertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,A._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,A._defaultColor||g.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*A._defaultOpacity)]]}get propertiesToUpdate(){return[[p.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||A._defaultThickness],[p.AnnotationEditorParamsType.INK_COLOR,this.color||A._defaultColor||g.AnnotationEditor._defaultLineColor],[p.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??A._defaultOpacity))]]}#iw(d){let c=this.thickness;this.addCommands({cmd:()=>{this.thickness=d,this.#iM()},undo:()=>{this.thickness=c,this.#iM()},mustExec:!0,type:p.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#eO(d){let c=this.color;this.addCommands({cmd:()=>{this.color=d,this.#ik()},undo:()=>{this.color=c,this.#ik()},mustExec:!0,type:p.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#iP(d){d/=100;let c=this.opacity;this.addCommands({cmd:()=>{this.opacity=d,this.#ik()},undo:()=>{this.opacity=c,this.#ik()},mustExec:!0,type:p.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#iF(),this.#iR()),this.isAttachedToDOM||(this.parent.add(this),this.#iI()),this.#iM()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#ix.disconnect(),this.#ix=null,
3super.remove())}setParent(d){!this.parent&&d?this._uiManager.removeShouldRescale(this):this.parent&&null===d&&this._uiManager.addShouldRescale(this),super.setParent(d)}onScaleChanging(){let[d,c]=this.parentDimensions,u=this.width*d,p=this.height*c;this.setDimensions(u,p)}enableEditMode(){this.#iy||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#iA))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#iA))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#iD(){let{parentRotation:d,parentDimensions:[c,u]}=this;switch(d){case 90:return[0,u,u,c];case 180:return[c,u,c,u];case 270:return[c,0,u,c];default:return[0,0,c,u]}}#iL(){let{ctx:d,color:c,opacity:u,thickness:p,parentScale:g,scaleFactor:m}=this;d.lineWidth=p*g/m,d.lineCap="round",d.lineJoin="round",d.miterLimit=10,d.strokeStyle=`${c}${(0,b.opacityToHex)(u)}`}#iO(d,c){this.canvas.addEventListener("contextmenu",f.noContextMenu),this.canvas.addEventListener("pointerleave",this.#im),this.canvas.addEventListener("pointermove",this.#ig),this.canvas.addEventListener("pointerup",this.#ib),this.canvas.removeEventListener("pointerdown",this.#iA),this.isEditing=!0,this.#iS||(this.#iS=!0,this.#iI(),this.thickness||=A._defaultThickness,this.color||=A._defaultColor||g.AnnotationEditor._defaultLineColor,this.opacity??=A._defaultOpacity),this.currentPath.push([d,c]),this.#i_=!1,this.#iL(),this.#iT=()=>{this.#iN(),this.#iT&&window.requestAnimationFrame(this.#iT)},window.requestAnimationFrame(this.#iT)}#iB(d,c){let[u,p]=this.currentPath.at(-1);if(this.currentPath.length>1&&d===u&&c===p)return;let g=this.currentPath,m=this.#iv;if(g.push([d,c]),this.#i_=!0,g.length<=2){m.moveTo(...g[0]),m.lineTo(d,c);return}3===g.length&&(this.#iv=m=new Path2D,m.moveTo(...g[0])),this.#iU(m,...g.at(-3),...g.at(-2),d,c)}#ij(){if(0===this.currentPath.length)return;let d=this.currentPath.at(-1);this.#iv.lineTo(...d)}#iz(d,c){let u;if(this.#iT=null,d=Math.min(Math.max(d,0),this.canvas.width),c=Math.min(Math.max(c,0),this.canvas.height),this.#iB(d,c),this.#ij(),1!==this.currentPath.length)u=this.#iH();else{let p=[d,c];u=[[p,p.slice(),p.slice(),p]]}let p=this.#iv,g=this.currentPath;this.currentPath=[],this.#iv=new Path2D;let m=()=>{this.allRawPaths.push(g),this.paths.push(u),this.bezierPath2D.push(p),this.rebuild()},f=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#iF(),this.#iR()),this.#iM())};this.addCommands({cmd:m,undo:f,mustExec:!0})}#iN(){if(!this.#i_)return;this.#i_=!1,this.thickness*this.parentScale;let d=this.currentPath.slice(-3),{ctx:c}=(d.map(d=>d[0]),d.map(d=>d[1]),this);for(let d of(c.save(),c.clearRect(0,0,this.canvas.width,this.canvas.height),this.bezierPath2D))c.stroke(d);c.stroke(this.#iv),c.restore()}#iU(d,c,u,p,g,m,f){let b=(c+p)/2,A=(u+g)/2,v=(p+m)/2,y=(g+f)/2;d.bezierCurveTo(b+2*(p-b)/3,A+2*(g-A)/3,v+2*(p-v)/3,y+2*(g-y)/3,v,y)}#iH(){let d,c=this.currentPath;if(c.length<=2)return[[c[0],c[0],c.at(-1),c.at(-1)]];let u=[],[p,g]=c[0];for(d=1;d<c.length-2;d++){let[m,f]=c[d],[b,A]=c[d+1],v=(m+b)/2,y=(f+A)/2,_=[p+2*(m-p)/3,g+2*(f-g)/3],S=[v+2*(m-v)/3,y+2*(f-y)/3];u.push([[p,g],_,S,[v,y]]),[p,g]=[v,y]}let[m,f]=c[d],[b,A]=c[d+1],v=[p+2*(m-p)/3,g+2*(f-g)/3],y=[b+2*(m-b)/3,A+2*(f-A)/3];return u.push([[p,g],v,y,[b,A]]),u}#ik(){if(this.isEmpty())return void this.#iG();this.#iL();let{canvas:d,ctx:c}=this;for(let u of(c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,d.width,d.height),this.#iG(),this.bezierPath2D))c.stroke(u)}commit(){this.#iy||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#iy=!0,this.div.classList.add("disabled"),this.#iM(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(d){this._focusEventsAllowed&&(super.focusin(d),this.enableEditMode())}canvasPointerdown(d){0===d.button&&this.isInEditMode()&&!this.#iy&&(this.setInForeground(),d.preventDefault(),"mouse"!==d.type&&this.div.focus(),this.#iO(d.offsetX,d.offsetY))}canvasPointermove(d){d.preventDefault(),this.#iB(d.offsetX,d.offsetY)}canvasPointerup(d){d.preventDefault(),this.#i$(d)}canvasPointerleave(d){this.#i$(d)}#i$(d){this.canvas.removeEventListener("pointerleave",this.#im),this.canvas.removeEventListener("pointermove",this.#ig),this.canvas.removeEventListener("pointerup",this.#ib),this.canvas.addEventListener("pointerdown",this.#iA),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",f.noContextMenu)},10),this.#iz(d.offsetX,d.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
3d()}#iF(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",g.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(d=>this.canvas?.setAttribute("aria-label",d)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#iR(){this.#ix=new ResizeObserver(d=>{let c=d[0].contentRect;c.width&&c.height&&this.setDimensions(c.width,c.height)}),this.#ix.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#iy}render(){let d,c;if(this.div)return this.div;this.width&&(d=this.x,c=this.y),super.render(),g.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(d=>this.div?.setAttribute("aria-label",d));let[u,p,m,f]=this.#iD();if(this.setAt(u,p,0,0),this.setDims(m,f),this.#iF(),this.width){let[u,p]=this.parentDimensions;this.setAspectRatio(this.width*u,this.height*p),this.setAt(d*u,c*p,this.width*u,this.height*p),this.#iS=!0,this.#iI(),this.setDims(this.width*u,this.height*p),this.#ik(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#iR(),this.div}#iI(){if(!this.#iS)return;let[d,c]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*d),this.canvas.height=Math.ceil(this.height*c),this.#iG()}setDimensions(d,c){let u=Math.round(d),p=Math.round(c);if(this.#iE===u&&this.#iC===p)return;this.#iE=u,this.#iC=p,this.canvas.style.visibility="hidden";let[g,m]=this.parentDimensions;this.width=d/g,this.height=c/m,this.fixAndSetPosition(),this.#iy&&this.#iW(d,c),this.#iI(),this.#ik(),this.canvas.style.visibility="visible",this.fixDims()}#iW(d,c){let u=this.#iV(),p=(d-u)/this.#ip,g=(c-u)/this.#iu;this.scaleFactor=Math.min(p,g)}#iG(){let d=this.#iV()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+d,this.translationY*this.scaleFactor+d)}static #iq(d){let c=new Path2D;for(let u=0,p=d.length;u<p;u++){let[p,g,m,f]=d[u];0===u&&c.moveTo(...p),c.bezierCurveTo(g[0],g[1],m[0],m[1],f[0],f[1])}return c}static #iX(d,c,u){let[p,g,m,f]=c;switch(u){case 0:for(let c=0,u=d.length;c<u;c+=2)d[c]+=p,d[c+1]=f-d[c+1];break;case 90:for(let c=0,u=d.length;c<u;c+=2){let u=d[c];d[c]=d[c+1]+p,d[c+1]=u+g}break;case 180:for(let c=0,u=d.length;c<u;c+=2)d[c]=m-d[c],d[c+1]+=g;break;case 270:for(let c=0,u=d.length;c<u;c+=2){let u=d[c];d[c]=m-d[c+1],d[c+1]=f-u}break;default:throw Error("Invalid rotation")}return d}static #iK(d,c,u){let[p,g,m,f]=c;switch(u){case 0:for(let c=0,u=d.length;c<u;c+=2)d[c]-=p,d[c+1]=f-d[c+1];break;case 90:for(let c=0,u=d.length;c<u;c+=2){let u=d[c];d[c]=d[c+1]-g,d[c+1]=u-p}break;case 180:for(let c=0,u=d.length;c<u;c+=2)d[c]=m-d[c],d[c+1]-=g;break;case 270:for(let c=0,u=d.length;c<u;c+=2){let u=d[c];d[c]=f-d[c+1],d[c+1]=m-u}break;default:throw Error("Invalid rotation")}return d}#iY(d,c,u,p){let g=[],m=this.thickness/2,f=d*c+m,b=d*u+m;for(let c of this.paths){let u=[],m=[];for(let p=0,g=c.length;p<g;p++){let[A,v,y,_]=c[p],S=d*A[0]+f,x=d*A[1]+b,E=d*v[0]+f,C=d*v[1]+b,T=d*y[0]+f,w=d*y[1]+b,P=d*_[0]+f,M=d*_[1]+b;0===p&&(u.push(S,x),m.push(S,x)),u.push(E,C,T,w,P,M),m.push(E,C),p===g-1&&m.push(P,M)}g.push({bezier:A.#iX(u,p,this.rotation),points:A.#iX(m,p,this.rotation)})}return g}#iJ(){let d=1/0,c=-1/0,u=1/0,g=-1/0;for(let m of this.paths)for(let[f,b,A,v]of m){let m=p.Util.bezierBoundingBox(...f,...b,...A,...v);d=Math.min(d,m[0]),u=Math.min(u,m[1]),c=Math.max(c,m[2]),g=Math.max(g,m[3])}return[d,u,c,g]}#iV(){return this.#iy?Math.ceil(this.thickness*this.parentScale):0}#iM(d=!1){if(this.isEmpty())return;if(!this.#iy)return void this.#ik();let c=this.#iJ(),u=this.#iV();this.#ip=Math.max(g.AnnotationEditor.MIN_SIZE,c[2]-c[0]),this.#iu=Math.max(g.AnnotationEditor.MIN_SIZE,c[3]-c[1]);let p=Math.ceil(u+this.#ip*this.scaleFactor),m=Math.ceil(u+this.#iu*this.scaleFactor),[f,b]=this.parentDimensions;this.width=p/f,this.height=m/b,this.setAspectRatio(p,m);let A=this.translationX,v=this.translationY;this.translationX=-c[0],this.translationY=-c[1],this.#iI(),this.#ik(),this.#iE=p,this.#iC=m,this.setDims(p,m);let y=d?u/this.scaleFactor/2:0;this.translate(A-this.translationX-y,v-this.translationY-y)}static deserialize(d,c,u){if(d instanceof m.InkAnnotationElement)return null;let f=super.deserialize(d,c,u);f.thickness=d.thickness,f.color=p.Util.makeHexColor(...d.color),f.opacity=d.opacity;let[b,v]=f.pageDimensions,y=f.width*b,_=f.height*v,S=f.parentScale,x=d.thickness/2;f.#iy=!0,f.#iE=Math.round(y),f.#iC=Math.round(_);let{paths:E,rect:C,rotation:T}=d;for(let{bezier:d}of E){d=A.#iK(d,C,T);let c=[];f.paths.push(c);let u=S*(d[0]-x),p=S*(d[1]-x);for(let g=2,m=d.length;g<m;g+=6){let m=S*(d[g]-x),f=S*(d[g+1]-x),b=S*(d[g+2]-x),A=S*(d[g+3]-x),v=S*(d[g+4]-x),y=S*(d[g+5]-x);c.push([[u,p],[m,f],[b,A],[v,y]]),u=v,p=y}let g=this.#iq(c);f.bezierPath2D.push(g)}let w=f.#iJ();return f.#ip=Math.max(g.AnnotationEditor.MIN_SIZE,w[2]-w[0]),f.#iu=Math.max(g.AnnotationEditor.MIN_SIZE,w[3]-w[1]),f.#iW(y,_),f}serialize(){if(this.isEmpty())return null;let d=this.getRect(0,0),c=g.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:p.AnnotationEditorType.INK,color:c,thickness:this.thickness,opacity:this.opacity,paths:this.#iY(this.scaleFactor/this.parentScale,this.translationX,this.translationY,d),pageIndex:this.pageIndex,rect:d,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}c.InkEditor=A},(d,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.StampEditor=void 0;var p=u(1),g=u(4),m=u(6),f=u(29);class b extends g.AnnotationEditor{#iQ=null;#iZ=null;#i0=null;#i1=null;#i2=null;#i3=null;#ix=null;#i5=null;#i8=!1;#i4=!1;static _type="stamp";constructor(d){super({...d,name:"stampEditor"}),this.#i1=d.bitmapUrl,this.#i2=d.bitmapFile}static initialize(d){g.AnnotationEditor.initialize(d)}static get supportedTypes(){let d=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,p.shadow)(this,"supportedTypes",d.map(d=>`image/${d}`))}static get supportedTypesStr(){return(0,p.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(d){return this.supportedTypes.includes(d)}static paste(d,c){c.pasteEditor(p.AnnotationEditorType.STAMP,{bitmapFile:d.getAsFile()})}#i6(d,c=!1){d?(this.#iQ=d.bitmap,c||(this.#iZ=d.id,this.#i8=d.isSvg),this.#iF()):this.remove()}#i7(){this.#i0=null,this._uiManager.enableWaiting(!1),this.#i3&&this.div.focus()}#i9(){if(this.#iZ){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#iZ).then(d=>this.#i6(d,!0)).finally(()=>this.#i7());return}if(this.#i1){let d=this.#i1;this.#i1=null,this._uiManager.enableWaiting(!0),this.#i0=this._uiManager.imageManager.getFromUrl(d).then(d=>this.#i6(d)).finally(()=>this.#i7());return}if(this.#i2){let d=this.#i2;this.#i2=null,this._uiManager.enableWaiting(!0),this.#i0=this._uiManager.imageManager.getFromFile(d).then(d=>this.#i6(d)).finally(()=>this.#i7());return}let d=document.createElement("input");
3d.type="file",d.accept=b.supportedTypesStr,this.#i0=new Promise(c=>{d.addEventListener("change",async()=>{if(d.files&&0!==d.files.length){this._uiManager.enableWaiting(!0);let c=await this._uiManager.imageManager.getFromFile(d.files[0]);this.#i6(c)}else this.remove();c()}),d.addEventListener("cancel",()=>{this.remove(),c()})}).finally(()=>this.#i7()),d.click()}remove(){this.#iZ&&(this.#iQ=null,this._uiManager.imageManager.deleteId(this.#iZ),this.#i3?.remove(),this.#i3=null,this.#ix?.disconnect(),this.#ix=null),super.remove()}rebuild(){if(!this.parent){this.#iZ&&this.#i9();return}super.rebuild(),null!==this.div&&(this.#iZ&&this.#i9(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#i0||this.#iQ||this.#i1||this.#i2)}get isResizable(){return!0}render(){let d,c;if(this.div)return this.div;if(this.width&&(d=this.x,c=this.y),super.render(),this.div.hidden=!0,this.#iQ?this.#iF():this.#i9(),this.width){let[u,p]=this.parentDimensions;this.setAt(d*u,c*p,this.width*u,this.height*p)}return this.div}#iF(){let{div:d}=this,{width:c,height:u}=this.#iQ,[p,g]=this.pageDimensions,m=.75;if(this.width)c=this.width*p,u=this.height*g;else if(c>m*p||u>m*g){let d=Math.min(m*p/c,m*g/u);c*=d,u*=d}let[f,b]=this.parentDimensions;this.setDims(c*f/p,u*b/g),this._uiManager.enableWaiting(!1);let A=this.#i3=document.createElement("canvas");d.append(A),d.hidden=!1,this.#st(c,u),this.#iR(),this.#i4||(this.parent.addUndoableEditor(this),this.#i4=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#se(d,c){let[u,p]=this.parentDimensions;this.width=d/u,this.height=c/p,this.setDims(d,c),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#i5&&clearTimeout(this.#i5);let g=200;this.#i5=setTimeout(()=>{this.#i5=null,this.#st(d,c)},g)}#si(d,c){let{width:u,height:p}=this.#iQ,g=u,m=p,f=this.#iQ;for(;g>2*d||m>2*c;){let u=g,p=m;g>2*d&&(g=g>=16384?Math.floor(g/2)-1:Math.ceil(g/2)),m>2*c&&(m=m>=16384?Math.floor(m/2)-1:Math.ceil(m/2));let b=new OffscreenCanvas(g,m);b.getContext("2d").drawImage(f,0,0,u,p,0,0,g,m),f=b.transferToImageBitmap()}return f}#st(d,c){d=Math.ceil(d),c=Math.ceil(c);let u=this.#i3;if(!u||u.width===d&&u.height===c)return;u.width=d,u.height=c;let p=this.#i8?this.#iQ:this.#si(d,c),g=u.getContext("2d");g.filter=this._uiManager.hcmFilter,g.drawImage(p,0,0,p.width,p.height,0,0,d,c)}#ss(d){if(d){if(this.#i8){let d=this._uiManager.imageManager.getSvgUrl(this.#iZ);if(d)return d}let d=document.createElement("canvas");return{width:d.width,height:d.height}=this.#iQ,d.getContext("2d").drawImage(this.#iQ,0,0),d.toDataURL()}if(this.#i8){let[d,c]=this.pageDimensions,u=Math.round(this.width*d*m.PixelsPerInch.PDF_TO_CSS_UNITS),p=Math.round(this.height*c*m.PixelsPerInch.PDF_TO_CSS_UNITS),g=new OffscreenCanvas(u,p);return g.getContext("2d").drawImage(this.#iQ,0,0,this.#iQ.width,this.#iQ.height,0,0,u,p),g.transferToImageBitmap()}return structuredClone(this.#iQ)}#iR(){this.#ix=new ResizeObserver(d=>{let c=d[0].contentRect;c.width&&c.height&&this.#se(c.width,c.height)}),this.#ix.observe(this.div)}static deserialize(d,c,u){if(d instanceof f.StampAnnotationElement)return null;let p=super.deserialize(d,c,u),{rect:g,bitmapUrl:m,bitmapId:b,isSvg:A,accessibilityData:v}=d;b&&u.imageManager.isValidId(b)?p.#iZ=b:p.#i1=m,p.#i8=A;let[y,_]=p.pageDimensions;return p.width=(g[2]-g[0])/y,p.height=(g[3]-g[1])/_,v&&(p.altTextData=v),p}serialize(d=!1,c=null){if(this.isEmpty())return null;let u={annotationType:p.AnnotationEditorType.STAMP,bitmapId:this.#iZ,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#i8,structTreeParentId:this._structTreeParentId};if(d)return u.bitmapUrl=this.#ss(!0),u.accessibilityData=this.altTextData,u;let{decorative:g,altText:m}=this.altTextData;if(!g&&m&&(u.accessibilityData={type:"Figure",alt:m}),null===c)return u;c.stamps||=new Map;let f=this.#i8?(u.rect[2]-u.rect[0])*(u.rect[3]-u.rect[1]):null;if(c.stamps.has(this.#iZ)){if(this.#i8){let d=c.stamps.get(this.#iZ);f>d.area&&(d.area=f,d.serialized.bitmap.close(),d.serialized.bitmap=this.#ss(!1))}}else c.stamps.set(this.#iZ,{area:f,serialized:u}),u.bitmap=this.#ss(!1);return u}}c.StampEditor=b}],__webpack_module_cache__={};function __w_pdfjs_require__(d){var c=__webpack_module_cache__[d];if(void 0!==c)return c.exports;var u=__webpack_module_cache__[d]={exports:{}};
3return __webpack_modules__[d](u,u.exports,__w_pdfjs_require__),u.exports}var __nested_webpack_exports__={};return(()=>{var d=__nested_webpack_exports__;Object.defineProperty(d,"__esModule",{value:!0}),Object.defineProperty(d,"AbortException",{enumerable:!0,get:function(){return c.AbortException}}),Object.defineProperty(d,"AnnotationEditorLayer",{enumerable:!0,get:function(){return m.AnnotationEditorLayer}}),Object.defineProperty(d,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return c.AnnotationEditorParamsType}}),Object.defineProperty(d,"AnnotationEditorType",{enumerable:!0,get:function(){return c.AnnotationEditorType}}),Object.defineProperty(d,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return f.AnnotationEditorUIManager}}),Object.defineProperty(d,"AnnotationLayer",{enumerable:!0,get:function(){return b.AnnotationLayer}}),Object.defineProperty(d,"AnnotationMode",{enumerable:!0,get:function(){return c.AnnotationMode}}),Object.defineProperty(d,"CMapCompressionType",{enumerable:!0,get:function(){return c.CMapCompressionType}}),Object.defineProperty(d,"DOMSVGFactory",{enumerable:!0,get:function(){return p.DOMSVGFactory}}),Object.defineProperty(d,"FeatureTest",{enumerable:!0,get:function(){return c.FeatureTest}}),Object.defineProperty(d,"GlobalWorkerOptions",{enumerable:!0,get:function(){return A.GlobalWorkerOptions}}),Object.defineProperty(d,"ImageKind",{enumerable:!0,get:function(){return c.ImageKind}}),Object.defineProperty(d,"InvalidPDFException",{enumerable:!0,get:function(){return c.InvalidPDFException}}),Object.defineProperty(d,"MissingPDFException",{enumerable:!0,get:function(){return c.MissingPDFException}}),Object.defineProperty(d,"OPS",{enumerable:!0,get:function(){return c.OPS}}),Object.defineProperty(d,"PDFDataRangeTransport",{enumerable:!0,get:function(){return u.PDFDataRangeTransport}}),Object.defineProperty(d,"PDFDateString",{enumerable:!0,get:function(){return p.PDFDateString}}),Object.defineProperty(d,"PDFWorker",{enumerable:!0,get:function(){return u.PDFWorker}}),Object.defineProperty(d,"PasswordResponses",{enumerable:!0,get:function(){return c.PasswordResponses}}),Object.defineProperty(d,"PermissionFlag",{enumerable:!0,get:function(){return c.PermissionFlag}}),Object.defineProperty(d,"PixelsPerInch",{enumerable:!0,get:function(){return p.PixelsPerInch}}),Object.defineProperty(d,"PromiseCapability",{enumerable:!0,get:function(){return c.PromiseCapability}}),Object.defineProperty(d,"RenderingCancelledException",{enumerable:!0,get:function(){return p.RenderingCancelledException}}),Object.defineProperty(d,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}}),Object.defineProperty(d,"UnexpectedResponseException",{enumerable:!0,get:function(){return c.UnexpectedResponseException}}),Object.defineProperty(d,"Util",{enumerable:!0,get:function(){return c.Util}}),Object.defineProperty(d,"VerbosityLevel",{enumerable:!0,get:function(){return c.VerbosityLevel}}),Object.defineProperty(d,"XfaLayer",{enumerable:!0,get:function(){return v.XfaLayer}}),Object.defineProperty(d,"build",{enumerable:!0,get:function(){return u.build}}),Object.defineProperty(d,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return c.createValidAbsoluteUrl}}),Object.defineProperty(d,"getDocument",{enumerable:!0,get:function(){return u.getDocument}}),Object.defineProperty(d,"getFilenameFromUrl",{enumerable:!0,get:function(){return p.getFilenameFromUrl}}),Object.defineProperty(d,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return p.getPdfFilenameFromUrl}}),Object.defineProperty(d,"getXfaPageViewport",{enumerable:!0,get:function(){return p.getXfaPageViewport}}),Object.defineProperty(d,"isDataScheme",{enumerable:!0,get:function(){return p.isDataScheme}}),Object.defineProperty(d,"isPdfFile",{enumerable:!0,get:function(){return p.isPdfFile}}),Object.defineProperty(d,"loadScript",{enumerable:!0,get:function(){return p.loadScript}}),Object.defineProperty(d,"noContextMenu",{enumerable:!0,get:function(){return p.noContextMenu}}),Object.defineProperty(d,"normalizeUnicode",{enumerable:!0,get:function(){return c.normalizeUnicode}}),Object.defineProperty(d,"renderTextLayer",{enumerable:!0,get:function(){return g.renderTextLayer}}),Object.defineProperty(d,"setLayerDimensions",{enumerable:!0,get:function(){return p.setLayerDimensions}}),Object.defineProperty(d,"shadow",{enumerable:!0,get:function(){return c.shadow}}),Object.defineProperty(d,"updateTextLayer",{enumerable:!0,get:function(){return g.updateTextLayer}}),Object.defineProperty(d,"version",{enumerable:!0,get:function(){return u.version}});var c=__w_pdfjs_require__(1),u=__w_pdfjs_require__(2),p=__w_pdfjs_require__(6),g=__w_pdfjs_require__(26),m=__w_pdfjs_require__(27),f=__w_pdfjs_require__(5),b=__w_pdfjs_require__(29),A=__w_pdfjs_require__(14),v=__w_pdfjs_require__(32)})(),__nested_webpack_exports__})())}}]); 4//# sourceMappingURL=7f4d0f7c.1392c1f3f2d72d85.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.