1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4577],{99299:function(module,__unused_webpack_exports,__webpack_require__){var root,factory,process=__webpack_require__(83454),Buffer=__webpack_require__(21876).Buffer;root=globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.StreamType=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FontType=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.arrayByteLength=Z,e.arraysToBytes=tt,e.assert=U,e.bytesToString=J,e.createPromiseCapability=ty,e.createValidAbsoluteUrl=z,e.escapeString=tc,e.getModificationDate=tA,e.getVerbosityLevel=D,e.info=L,e.isArrayBuffer=tf,e.isArrayEqual=tb,e.isAscii=tu,e.objectFromMap=ts,e.objectSize=ti,e.setVerbosityLevel=I,e.shadow=q,e.string32=te,e.stringToBytes=Q,e.stringToPDFString=td,e.stringToUTF16BEString=tp,e.stringToUTF8String=tg,e.unreachable=j,e.utf8StringToString=tm,e.warn=N,i(2);let s=[1,0,0,1,0,0];e.IDENTITY_MATRIX=s;let r=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=r;let a=1.35;e.LINE_FACTOR=a;let n=.35;e.LINE_DESCENT_FACTOR=n;let o={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.RenderingIntentFlag=o;let l={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationMode=l;let h="pdfjs_internal_editor_";e.AnnotationEditorPrefix=h;let d={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorType=d;let c={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.AnnotationEditorParamsType=c;let u={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.PermissionFlag=u;let p={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};e.TextRenderingMode=p;let g={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=g;let m={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};e.AnnotationType=m;let f={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=f;let b={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=b;let A={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=A;let y={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=y;let v={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=v;let _={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationFieldFlag=_;let S={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=S;let x={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"};e.AnnotationActionEventType=x;let C={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.DocumentActionEventType=C;let E={O:"PageOpen",C:"PageClose"};e.PageActionEventType=E;let T={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=T;let P={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=P;let M={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=M;let k={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=k;
1let w={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=w;let R={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.UNSUPPORTED_FEATURES=R;let F={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=F;let O=M.WARNINGS;function I(t){Number.isInteger(t)&&(O=t)}function D(){return O}function L(t){O>=M.INFOS&&console.log(`Info: ${t}`)}function N(t){O>=M.WARNINGS&&console.log(`Warning: ${t}`)}function j(t){throw Error(t)}function U(t,e){t||j(e)}function B(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function z(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){let s=t.match(/\./g);s&&s.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=tg(t)}catch(r){}}let a=e?new URL(t,e):new URL(t);if(B(a))return a}catch(n){}return null}function q(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!1}),i}let W=function(){function t(e,i){this.constructor===t&&j("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=Error(),t.constructor=t,t}();e.BaseException=W;class H extends W{constructor(t,e){super(t,"PasswordException"),this.code=e}}e.PasswordException=H;class G extends W{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}e.UnknownErrorException=G;class V extends W{constructor(t){super(t,"InvalidPDFException")}}e.InvalidPDFException=V;class $ extends W{constructor(t){super(t,"MissingPDFException")}}e.MissingPDFException=$;class X extends W{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}e.UnexpectedResponseException=X;class Y extends W{constructor(t){super(t,"FormatError")}}e.FormatError=Y;class K extends W{constructor(t){super(t,"AbortException")}}function J(t){("object"!=typeof t||null===t||void 0===t.length)&&j("Invalid argument for bytesToString");let e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);let s=[];for(let r=0;r<e;r+=i){let a=Math.min(r+i,e),n=t.subarray(r,a);s.push(String.fromCharCode.apply(null,n))}return s.join("")}function Q(t){"string"!=typeof t&&j("Invalid argument for stringToBytes");let e=t.length,i=new Uint8Array(e);for(let s=0;s<e;++s)i[s]=255&t.charCodeAt(s);return i}function Z(t){return void 0!==t.length?t.length:void 0!==t.byteLength?t.byteLength:void j("Invalid argument for arrayByteLength")}function tt(t){let e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];let i=0;for(let s=0;s<e;s++)i+=Z(t[s]);let r=0,a=new Uint8Array(i);for(let n=0;n<e;n++){let o=t[n];o instanceof Uint8Array||(o="string"==typeof o?Q(o):new Uint8Array(o));let l=o.byteLength;a.set(o,r),r+=l}return a}function te(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function ti(t){return Object.keys(t).length}function ts(t){let e=Object.create(null);for(let[i,s]of t)e[i]=s;return e}function tr(){let t=new Uint8Array(4);t[0]=1;let e=new Uint32Array(t.buffer,0,1);return 1===e[0]}function ta(){try{return Function(""),!0}catch(t){return!1}}e.AbortException=K;class tn{static get isLittleEndian(){return q(this,"isLittleEndian",tr())}static get isEvalSupported(){return q(this,"isEvalSupported",ta())}static get isOffscreenCanvasSupported(){return q(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}}e.FeatureTest=tn;let to=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0"));class tl{static makeHexColor(t,e,i){return`#${to[t]}${to[e]}${to[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[1],e[1]=i),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(i=e[2],e[2]=e[3],e[3]=i),e[2]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[2],e[2]=i,i=e[1],e[1]=e[3],e[3]=i,t[1]<0&&(i=e[2],e[2]=e[3],e[3]=i),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[1],e[1]=i),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){let i=t[0]*e[0]+t[1]*e[2]+e[4],s=t[0]*e[1]+t[1]*e[3]+e[5];return[i,s]}static applyInverseTransform(t,e){let i=e[0]*e[3]-e[1]*e[2],s=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,r=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i;return[s,r]}static getAxialAlignedBoundingBox(t,e){let i=tl.applyTransform(t,e),s=tl.applyTransform(t.slice(2,4),e),r=tl.a
1pplyTransform([t[0],t[3]],e),a=tl.applyTransform([t[2],t[1]],e);return[Math.min(i[0],s[0],r[0],a[0]),Math.min(i[1],s[1],r[1],a[1]),Math.max(i[0],s[0],r[0],a[0]),Math.max(i[1],s[1],r[1],a[1])]}static inverseTransform(t){let e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static apply3dTransform(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}static singularValueDecompose2dScale(t){let e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],s=t[0]*e[1]+t[1]*e[3],r=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],n=(i+a)/2,o=Math.sqrt((i+a)**2-4*(i*a-r*s))/2,l=n+o||1,h=n-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(t){let e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){let i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>s)return null;let r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>a?null:[i,r,s,a]}static bezierBoundingBox(t,e,i,s,r,a,n,o){let l,h,d,c,u,p,g,m;let f=[],b=[[],[]];for(let A=0;A<2;++A){if(0===A?(h=6*t-12*i+6*r,l=-3*t+9*i-9*r+3*n,d=3*i-3*t):(h=6*e-12*s+6*a,l=-3*e+9*s-9*a+3*o,d=3*s-3*e),1e-12>Math.abs(l)){if(1e-12>Math.abs(h))continue;0<(c=-d/h)&&c<1&&f.push(c);continue}m=Math.sqrt(g=h*h-4*d*l),!(g<0)&&(0<(u=(-h+m)/(2*l))&&u<1&&f.push(u),0<(p=(-h-m)/(2*l))&&p<1&&f.push(p))}let y=f.length,v,_=y;for(;y--;)v=1-(c=f[y]),b[0][y]=v*v*v*t+3*v*v*c*i+3*v*c*c*r+c*c*c*n,b[1][y]=v*v*v*e+3*v*v*c*s+3*v*c*c*a+c*c*c*o;return b[0][_]=t,b[1][_]=e,b[0][_+1]=n,b[1][_+1]=o,b[0].length=b[1].length=_+2,[Math.min(...b[0]),Math.min(...b[1]),Math.max(...b[0]),Math.max(...b[1])]}}e.Util=tl;let th=[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 td(t){if(t[0]>="\xef"){let e;if("\xfe"===t[0]&&"\xff"===t[1]?e="utf-16be":"\xff"===t[0]&&"\xfe"===t[1]?e="utf-16le":"\xef"===t[0]&&"\xbb"===t[1]&&"\xbf"===t[2]&&(e="utf-8"),e)try{let i=new TextDecoder(e,{fatal:!0}),s=Q(t);return i.decode(s)}catch(r){N(`stringToPDFString: "${r}".`)}}let a=[];for(let n=0,o=t.length;n<o;n++){let l=th[t.charCodeAt(n)];a.push(l?String.fromCharCode(l):t.charAt(n))}return a.join("")}function tc(t){return t.replace(/([()\\\n\r])/g,t=>"\n"===t?"\\n":"\r"===t?"\\r":`\\${t}`)}function tu(t){return/^[\x00-\x7F]*$/.test(t)}function tp(t){let e=["\xfe\xff"];for(let i=0,s=t.length;i<s;i++){let r=t.charCodeAt(i);e.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return e.join("")}function tg(t){return decodeURIComponent(escape(t))}function tm(t){return unescape(encodeURIComponent(t))}function tf(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength}function tb(t,e){if(t.length!==e.length)return!1;for(let i=0,s=t.length;i<s;i++)if(t[i]!==e[i])return!1;return!0}function tA(t=new Date){let e=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return e.join("")}function ty(){let t=Object.create(null),e=!1;return Object.defineProperty(t,"settled",{get:()=>e}),t.promise=new Promise(function(i,s){t.resolve=function(t){e=!0,i(t)},t.reject=function(t){e=!0,s(t)}}),t}},(t,e,i)=>{i(3)},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;let i="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=i},(t,e,i)=>{let s;Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFD
1ateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.binarySearchFirstItem=P,e.deprecated=S,e.getColorValues=T,e.getFilenameFromUrl=b,e.getPdfFilenameFromUrl=A,e.getRGB=E,e.getXfaPageViewport=C,e.isDataScheme=m,e.isPdfFile=f,e.isValidFetchUrl=v,e.loadScript=_;var r=i(5),a=i(1);let n="http://www.w3.org/2000/svg";class o{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=o;class l extends r.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){super(),this._document=t}_createCanvas(t,e){let i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}async function h(t,e=!1){if(v(t,document.baseURI)){let i=await fetch(t);if(!i.ok)throw Error(i.statusText);return e?new Uint8Array(await i.arrayBuffer()):(0,a.stringToBytes)(await i.text())}return new Promise((i,s)=>{let r=new XMLHttpRequest;r.open("GET",t,!0),e&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(e&&r.response?t=new Uint8Array(r.response):!e&&r.responseText&&(t=(0,a.stringToBytes)(r.responseText)),t){i(t);return}}s(Error(r.statusText))}},r.send(null)})}e.DOMCanvasFactory=l;class d extends r.BaseCMapReaderFactory{_fetchData(t,e){return h(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=d;class c extends r.BaseStandardFontDataFactory{_fetchData(t){return h(t,!0)}}e.DOMStandardFontDataFactory=c;class u extends r.BaseSVGFactory{_createSVG(t){return document.createElementNS(n,t)}}e.DOMSVGFactory=u;class p{constructor({viewBox:t,scale:e,rotation:i,offsetX:s=0,offsetY:r=0,dontFlip:a=!1}){let n,o,l,h,d,c,u,p;this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=s,this.offsetY=r;let g=(t[2]+t[0])/2,m=(t[3]+t[1])/2;switch((i%=360)<0&&(i+=360),i){case 180:n=-1,o=0,l=0,h=1;break;case 90:n=0,o=1,l=1,h=0;break;case 270:n=0,o=-1,l=-1,h=0;break;case 0:n=1,o=0,l=0,h=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(l=-l,h=-h),0===n?(d=Math.abs(m-t[1])*e+s,c=Math.abs(g-t[0])*e+r,u=Math.abs(t[3]-t[1])*e,p=Math.abs(t[2]-t[0])*e):(d=Math.abs(g-t[0])*e+s,c=Math.abs(m-t[1])*e+r,u=Math.abs(t[2]-t[0])*e,p=Math.abs(t[3]-t[1])*e),this.transform=[n*e,o*e,l*e,h*e,d-n*e*g-l*e*m,c-o*e*g-h*e*m],this.width=u,this.height=p}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:s=this.offsetY,dontFlip:r=!1}={}){return new p({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}convertToViewportPoint(t,e){return a.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){let e=a.Util.applyTransform([t[0],t[1]],this.transform),i=a.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return a.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=p;class g extends a.BaseException{constructor(t,e){super(t,"RenderingCancelledException"),this.type=e}}function m(t){let e=t.length,i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function f(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function b(t){let e=t.indexOf("#"),i=t.indexOf("?"),s=Math.min(e>0?e:t.length,i>0?i:t.length);return t.substring(t.lastIndexOf("/",s)+1,s)}function A(t,e="document.pdf"){if("string"!=typeof t)return e;if(m(t))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=i.exec(t),n=s.exec(r[1])||s.exec(r[2])||s.exec(r[3]);if(n&&(n=n[0]).includes("%"))try{n=s.exec(decodeURIComponent(n))[0]}catch(o){}return n||e}e.RenderingCancelledException=g;class y{constructor(){this.started=Object.create(null),this.times=[]}time(t){t in this.started&&(0,a.warn)(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,a.warn)(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],e=0;for(let i of this.times){let s=i.name;s.length>e&&(e=s.length)}for(let r of this.times){let a=r.end-r.start;t.push(`${r.name.padEnd(e)} ${a}ms 2`)}return t.join("")}}function v(t,e){try{let{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(s){return!1}}function _(t,e=!1){return new Promise((i,s)=>{let r=document.createElement("script");r.src=t,r.onload=function(t){e&&r.remove(),i(t)},r.onerror=function(){s(Error(`Cannot load script at: ${r.src}`))},(document.head||document.documentElement).append(r)})}function S(t){console.log("Deprecated API usage: "+t)}e.StatTimer=y;class x{static toDateObject(t){if(!t||"string"!=typeof t)return null;s||(s=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let e=s.exec(t);if(!e)return null;let i=parseInt(e[1],10),r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let a=parseInt(e[3],10);a=a>=1&&a<=31?a:1;let n=parseInt(e[4],10);n=n>=0&&n<=23?n:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;let h=e[7]||"Z",d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===h?(n+=d,o+=c):"+"===h&&(n-=d,o-=c),new Date(Date.UTC(i,r,a,n,o,l))}}function C(t,{scale:e=1,rotation:i=0}){let{width:s,height:r}=t.attributes.style,a=[0,0,parseInt(s),parseInt(r)];return new p({viewBox:a,scale:e,rotation:i})}function E(t){if(t.startsWith("#")){let e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):((0,a.warn)(`Not a valid color format: "${t}"`),[0,0,0])}function T(t){let e=document.createElement("span");for(let i of(e.style.visibility="hidden",document.body.append(e),t.keys())){e.style.color=i;let s=window.getComputedStyle(e).color;t.set(i,E(s))}e.remove()}function P(t,e,i=0){let s=i,r=t.length-1;if(r<0||!e(t[r]))return t.length;if(e(t[s]))return s;for(;s<r;){let a=s+r>>1,n=t[a];e(n)?r=a:s=a+1}return s}e.PDFDateString=x},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var s=i(1);class r{constructor(){this.constructor===r&&(0,s.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw Error("Invalid canvas size");let i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d")}}reset(t,e,i){if(!t.canvas)throw Error("Canvas is not specified");if(e<=0||i<=0)throw Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,s.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=r;class a{constructor({baseUrl:t=null,isCompressed:e=!1}){this.constructor===a&&(0,s.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?s.CMapCompressionType.BINARY:s.CMapCompressionType.NONE;return this._fetchData(e,i).catch(t=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}_fetchData(t,e){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=a;class n{constructor({baseUrl:t=null}){this.constructor===n&&(0,s.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw Error("Font filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetchData(e).catch(t=>{throw Error(`Unable to load font data at: ${e}`)})}_fetchData(t){(0,s.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=n;class o{constructor(){this.constructor===o&&(0,s.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e,i=!1){if(t<=0||e<=0)throw Error("Invalid SVG dimensions");let s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),i||(s.setAttribute("width",`${t}px`),s.setAttribute("height",`${e}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${e}`),s}createElement(t){if("string"!=typeof t)throw Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,s.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=o},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{let createPDFNetworkStream;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(7),_display_utils=__w_pdfjs_require__(4),_font_loader=__w_pdfjs_require__(11),_canvas=__w_pdfjs_require__(12),_worker_options=__w_pdfjs_require__(15),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(16),_metadata=__w_pdfjs_require__(17),_optional_content_config=__w_pdfjs_require__(18),_transport_stream=__w_pdfjs_require__(19),_xfa_text=__w_pdfjs_require__(20);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){let{NodeCanvasFactory,NodeCMapReaderFactory,NodeStandardFontDataFactory}=__w_pdfjs_require__(21);exports.DefaultCanvasFactory=DefaultCanvasFactory=NodeCanvasFactory,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=NodeCMapReaderFactory,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=NodeStandardFontDataFactory}function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){let e;let i=new PDFDocumentLoadingTask;if("string"==typeof t||t instanceof URL)e={url:t};else if((0,_util.isArrayBuffer)(t))e={data:t};else if(t instanceof PDFDataRangeTransport)e={range:t};else{if("object"!=typeof t)throw Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!t.url&&!t.data&&!t.range)throw Error("Invalid parameter object: need either .data, .range or .url");e=t}let s=Object.create(null),r=null,a=null;for(let n in e){let o=e[n];switch(n){case"url":if("undefined"!=typeof window)try{s[n]=new URL(o,window.location).href;continue}catch(l){(0,_util.warn)(`Cannot create valid URL: "${l}".`)}else if("string"==typeof o||o instanceof URL){s[n]=o.toString();continue}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":r=o;continue;case"worker":a=o;continue;case"data":if(_is_node.isNodeJS&&void 0!==Buffer&&o instanceof Buffer)s[n]=new Uint8Array(o);else if(o instanceof Uint8Array)break;else if("string"==typeof o)s[n]=(0,_util.stringToBytes)(o);else if("object"!=typeof o||null===o||isNaN(o.length)){if((0,_util.isArrayBuffer)(o))s[n]=new Uint8Array(o);else throw Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.")}else s[n]=new Uint8Array(o);continue}s[n]=o}if(s.CMapReaderFactory=s.CMapReaderFactory||DefaultCMapReaderFactory,s.StandardFontDataFactory=s.StandardFontDataFactory||DefaultStandardFontDataFactory,s.ignoreErrors=!0!==s.stopAtErrors,s.fontExtraProperties=!0===s.fontExtraProperties,s.pdfBug=!0===s.pdfBug,s.enableXfa=!0===s.enableXfa,(!Number.isInteger(s.rangeChunkSize)||s.rangeChunkSize<1)&&(s.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),("string"!=typeof s.docBaseUrl||(0,_display_utils.isDataScheme)(s.docBaseUrl))&&(s.docBaseUrl=null),(!Number.isInteger(s.maxImageSize)||s.maxImageSize<-1)&&(s.maxImageSize=-1),"string"!=typeof s.cMapUrl&&(s.cMapUrl=null),"string"!=typeof s.standardFontDataUrl&&(s.standardFontDataUrl=null),"boolean"!=typeof s.useWorkerFetch&&(s.useWorkerFetch=s.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&s.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof s.isEvalSupported&&(s.isEvalSupported=!0),"boolean"!=typeof s.disableFontFace&&(s.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof s.useSystemFonts&&(s.useSystemFonts=!_is_node.isNodeJS&&!s.disableFontFace),("object"!=typeof s.ownerDocument||null===s.ownerDocument)&&(s.ownerDocument=globalThis.document),"boolean"!=typeof s.disableRange&&(s.disableRange=!1),"boolean"!=typeof s.disableStream&&(s.disableStream=!1),"boolean"!=typeof s.disableAutoFetch&&(s.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(s.verbosity),!a){let h={verbosity:s.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};a=h.port?PDFWorker.fromPort(h):new PDFWorker(h),i._worker=a}let d=i.docId;return a.promise.then(function(){if(i.destroyed)throw Error("Loading aborted");let t=_fetchDocument(a,s,r,d),e=new Promise(function(t){let e;r?e=new _transport_stream.PDFDataTransportStream({length:s.length,initialData:s.initialData,progressiveDone:s.progressiveDone,contentDispositionFilename:s.contentDispositionFilename,disableRange:s.disableRange,disableStream:s.disableStream},r):s.data||(e=createPDFNetworkStream({url:s.url,length:s.length,httpHeaders:s.httpHeaders,withCredentials:s.withCredentials,rangeChunkSize:s.rangeChunkSize,disableRange:s.disableRange,disableStream:s.disableStream})),t(e)});return Promise.all([t,e]).then(function([t,e]){if(i.destroyed)throw Error("Loading aborted");let r=new _message_handler.MessageHandler(d,t,a.port),n=new WorkerTransport(r,i,e,s);i._transport=n,r.send("Ready",null)})}).catch(i._capability.reject),i}async function _fetchDocument(t,e,i,s){if(t.destroyed)throw Error("Worker was destroyed");i&&(e.length=i.length,e.initialData=i.initialData,e.progressiveDone=i.progressiveDone,e.contentDispositionFilename=i.contentDispositionFilename);
2let r=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:s,apiVersion:"2.15.349",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,enableXfa:e.enableXfa,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?e.cMapUrl:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null});if(e.data&&(e.data=null),t.destroyed)throw Error("Worker was destroyed");return r}class PDFDocumentLoadingTask{static #t=0;constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId=`d${PDFDocumentLoadingTask.#t++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await this._transport?.destroy(),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e,i=!1,s=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(let i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(let i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(let e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:async()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),this.stats||{streamTypes:{},fontTypes:{}})})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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()}getJavaScript(){return this._transport.getJavaScript()}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()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,i,s,r=!1){this._pageIndex=t,this._pageInfo=e,this._ownerDocument=s,this._transport=i,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,this._bitmaps=new Set,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=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:t,rotation:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:r=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}getAnnotations({intent:t="display"}={}
2){let e=this._transport.getRenderingIntent(t),i=this._annotationPromises.get(e.cacheKey);return i||(i=this._transport.getAnnotations(this._pageIndex,e.renderingIntent),this._annotationPromises.set(e.cacheKey,i),i=i.then(t=>{for(let e of t)void 0!==e.titleObj&&Object.defineProperty(e,"title",{get:()=>((0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),e.titleObj.str)}),void 0!==e.contentsObj&&Object.defineProperty(e,"contents",{get:()=>((0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),e.contentsObj.str)});return t})),i}getJSActions(){return this._jsActionsPromise||=this._transport.getPageJSActions(this._pageIndex)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:r=null,imageLayer:a=null,canvasFactory:n=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:h=null,pageColors:d=null,printAnnotationStorage:c=null}){arguments[0]?.renderInteractiveForms!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&s===_util.AnnotationMode.ENABLE&&(s=_util.AnnotationMode.ENABLE_FORMS)),arguments[0]?.includeAnnotationStorage!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&s===_util.AnnotationMode.ENABLE&&(s=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");let u=this._transport.getRenderingIntent(i,s,c);this.pendingCleanup=!1,l||(l=this._transport.getOptionalContentConfig());let p=this._intentStates.get(u.cacheKey);p||(p=Object.create(null),this._intentStates.set(u.cacheKey,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);let g=n||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),m=!!(u.renderingIntent&_util.RenderingIntentFlag.PRINT);p.displayReadyCapability||(p.displayReadyCapability=(0,_util.createPromiseCapability)(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(u));let f=t=>{p.renderTasks.delete(b),(this.cleanupAfterRender||m)&&(this.pendingCleanup=!0),this._tryCleanup(),t?(b.capability.reject(t),this._abortOperatorList({intentState:p,reason:t instanceof Error?t:Error(t)})):b.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},b=new InternalRenderTask({callback:f,params:{canvasContext:t,viewport:e,transform:r,imageLayer:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:g,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:d});(p.renderTasks||=new Set).add(b);let A=b.task;return Promise.all([p.displayReadyCapability.promise,l]).then(([t,e])=>{if(this.pendingCleanup){f();return}this._stats&&this._stats.time("Rendering"),b.initializeGraphics({transparency:t,optionalContentConfig:e}),b.operatorListChanged()}).catch(f),A}getOperatorList({intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}={}){let s;function r(){n.operatorList.lastChunk&&(n.opListReadCapability.resolve(n.operatorList),n.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(t,e,i,!0),n=this._intentStates.get(a.cacheKey);return n||(n=Object.create(null),this._intentStates.set(a.cacheKey,n)),n.opListReadCapability||((s=Object.create(null)).operatorListChanged=r,n.opListReadCapability=(0,_util.createPromiseCapability)(),(n.renderTasks||=new Set).add(s),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(a)),n.opListReadCapability.promise}streamTextContent({disableCombineTextItems:t=!1,includeMarkedContent:e=!1}={}){let i=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{highWaterMark:i,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>_xfa_text.XfaText.textContent(t));let e=this.streamTextContent(t);return new Promise(function(t,i){function s(){r.read().then(function({value:e,done:i}){if(i){t(a);return}Object.assign(a.styles,e.styles),a.items.push(...e.items),s()},i)}let r=e.getReader(),a={items:[],styles:Object.create(null)};s()})}getStructTree(){return this._structTreePromise||=this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let t=[];for(let e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(let i of e.renderTasks)t.push(i.completed),i.cancel();for(let s of(this.objs.clear(),this._bitmaps))s.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsProm
2ise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(t)}cleanup(t=!1){return this.pendingCleanup=!0,this._tryCleanup(t)}_tryCleanup(t=!1){if(!this.pendingCleanup)return!1;for(let{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;for(let s of(this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,t&&this._stats&&(this._stats=new _display_utils.StatTimer),this._bitmaps))s.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(t,e){let i=this._intentStates.get(e);i&&(this._stats&&this._stats.timeEnd("Page Request"),i.displayReadyCapability&&i.displayReadyCapability.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i<s;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);for(let r of(e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots,e.renderTasks))r.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageMap:i}){let s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:i}),r=s.getReader(),a=this._intentStates.get(e);a.streamReader=r;let n=()=>{r.read().then(({value:t,done:e})=>{if(e){a.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(t,a),n())},t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){for(let e of(a.operatorList.lastChunk=!0,a.renderTasks))e.operatorListChanged();this._tryCleanup()}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else if(a.opListReadCapability)a.opListReadCapability.reject(t);else throw t}})};n()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(!i){if(t.renderTasks.size>0)return;if(e instanceof _display_utils.RenderingCancelledException){t.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:t,reason:e,force:!0}),t.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(t.streamReader.cancel(new _util.AbortException(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(let[s,r]of this._intentStates)if(r===t){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(t,e){let i={data:structuredClone(t,e)};this._deferred.then(()=>{for(let t of this._listeners)t.call(this,i)})}addEventListener(t,e){this._listeners.push(e)}removeEventListener(t,e){let i=this._listeners.indexOf(e);this._listeners.splice(i,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)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(t,e){let i;try{if(!(i=new URL(t)).origin||"null"===i.origin)return!1}catch(s){return!1}let r=new URL(e,i);return i.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(t){let e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static #e=new WeakMap;constructor({name:t=null,port:e=null,verbosity:i=(0,_util.getVerbosityLevel)()}={}){if(e&&PDFWorker.#e.has(e))throw Error("Cannot use more than one PDFWorker per port.");if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,e){PDFWorker.#e.set(e,this),this._initializeFromPort(e);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if("undefined"!=typeof Worker&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let t=PDFWorker.workerSrc;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t),i=new _message_handler.MessageHandler("main","worker",e),s=()=>{e.removeEventListener("error",r),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||s()};e.addEventListener("error",r),i.on("test",t=>{if(e.removeEventListener("error",r),this.destroyed){s();return}t?(this._messageHandler=i,this._port=e,this._webWorker=e,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),e.terminate())}),i.on("ready",t=>{if(e.removeEventListener("error",r),this.destroyed){s();return}try{a()}catch(i){this._setupFakeWorker()}});let a=()=>{let t=new Uint8Array;i.send("test",t,[t.buffer])};a();return}catch(n){(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(t=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let e=new LoopbackPort;this._port=e;let i=`fake${PDFWorkerUtil.fakeWorkerId++}`,s=new _message_handler.MessageHandler(i+"_worker",i,e);t.setup(s,e);let r=new _message_handler.MessageHandler(i,i+"_worker",e);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})}).catch(t=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw Error("PDFWorker.fromPort - invalid method signature.");return this.#e.has(t.port)?this.#e.get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.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(t){return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){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,PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{#i=null;#s=new Map;#r=new Map;#a=null;constructor(t,e,i,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:e.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this._params=s,s.useWorkerFetch||(this.CMapReaderFactory=new s.CMapReaderFactory({baseUrl:s.cMapUrl,isCompressed:s.cMapPacked}),this.StandardFontDataFactory=new s.StandardFontDataFactory({baseUrl:s.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return this.#i}
2getRenderingIntent(t,e=_util.AnnotationMode.ENABLE,i=null,s=!1){let r=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;let n=r&_util.RenderingIntentFlag.PRINT&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage;a=n.serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return s&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:`${r}_${_annotation_storage.AnnotationStorage.getHash(a)}`,annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(Error("Worker was destroyed during onPassword callback"));let t=[];for(let e of this.#s.values())t.push(e._destroy());this.#s.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#a=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function({value:t,done:i}){if(i){e.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(t),"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",t=>{let i=(0,_util.createPromiseCapability)(),s=this._fullReader;return s.headersReady.then(()=>{s.isStreamingSupported&&s.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),s.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:s.isStreamingSupported,isRangeSupported:s.isRangeSupported,contentLength:s.contentLength})},i.reject),i.promise}),t.on("GetRangeReader",(t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let i=this._networkStream.getRangeReader(t.begin,t.end);if(!i){e.close();return}e.onPull=()=>{i.read().then(function({value:t,done:i}){if(i){e.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(t),"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(t,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":i=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(i)}
2),t.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),e.onPassword){let i=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(i,t.code)}catch(s){this._passwordCapability.reject(s)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{if(this.destroyed)return;let e=this.#s.get(t.pageIndex);e._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,i,s])=>{if(!(this.destroyed||this.commonObjs.has(e)))switch(i){case"Font":let r=this._params;if("error"in s){let a=s.error;(0,_util.warn)(`Error during font loading: ${a}`),this.commonObjs.resolve(e,a);break}let n=null;r.pdfBug&&globalThis.FontInspector?.enabled&&(n={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});let o=new _font_loader.FontFaceObject(s,{isEvalSupported:r.isEvalSupported,disableFontFace:r.disableFontFace,ignoreErrors:r.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:n});this.fontLoader.bind(o).catch(i=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>
2{!r.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(e,o)});break;case"FontPath":case"Image":this.commonObjs.resolve(e,s);break;default:throw Error(`Got unknown common object type ${i}`)}}),t.on("obj",([t,e,i,s])=>{if(this.destroyed)return;let r=this.#s.get(e);if(!r.objs.has(t))switch(i){case"Image":r.objs.resolve(t,s);let a=8e6;if(s){let n;if(s.bitmap){let{bitmap:o,width:l,height:h}=s;n=l*h*4,r._bitmaps.add(o)}else n=s.data?.length||0;n>a&&(r.cleanupAfterRender=!0)}break;case"Pattern":r.objs.resolve(t,s);break;default:throw Error(`Got unknown object type ${i}`)}}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("DocStats",t=>{this.destroyed||(this.#i=Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))}),t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),t.on("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(t):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(t):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:t}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(t)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(Error("Invalid page request."));let e=t-1,i=this.#r.get(e);if(i)return i;let s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw Error("Transport destroyed");let i=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);return this.#s.set(e,i),i});return this.#r.set(e,s),s}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally(()=>{this.annotationStorage.resetModified()})}getFieldObjects(){return this._getFieldObjectsPromise||=this.messageHandler.sendWithPromise("GetFieldObjects",null)}hasJSActions(){return this._hasJSActionsPromise||=this.messageHandler.sendWithPromise("HasJSActions",null)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithProm
2ise("GetOptionalContentConfig",null).then(t=>new _optional_content_config.OptionalContentConfig(t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.#a||=this.messageHandler.sendWithPromise("GetMetadata",null).then(t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(let e of this.#s.values()){let i=e.cleanup();if(!i)throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear(),t||this.fontLoader.clear(),this.#a=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){let t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}class PDFObjects{#n=Object.create(null);#o(t){let e=this.#n[t];return e||(this.#n[t]={capability:(0,_util.createPromiseCapability)(),data:null})}get(t,e=null){if(e){let i=this.#o(t);return i.capability.promise.then(()=>e(i.data)),null}let s=this.#n[t];if(!s?.capability.settled)throw Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){let e=this.#n[t];return e?.capability.settled||!1}resolve(t,e=null){let i=this.#o(t);i.data=e,i.capability.resolve()}clear(){this.#n=Object.create(null)}}class RenderTask{#l=null;constructor(t){this.#l=t,this.onContinue=null}get promise(){return this.#l.capability.promise}cancel(){this.#l.cancel()}get separateAnnots(){let{separateAnnots:t}=this.#l.operatorList;if(!t)return!1;let{annotationCanvasMap:e}=this.#l;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static #h=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:r,operatorList:a,pageIndex:n,canvasFactory:o,useRequestAnimationFrame:l=!1,pdfBug:h=!1,pageColors:d=null}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=n,this.canvasFactory=o,this._pdfBug=h,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#h.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.#h.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:i,viewport:s,transform:r,imageLayer:a,background:n}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,a,e,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:s,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(t=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.#h.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&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)}
2):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(),this._canvas&&InternalRenderTask.#h.delete(this._canvas),this.callback())))}}let version="2.15.349";exports.version=version;let build="b8aa9c622";exports.build=build},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var s=i(1),r=i(8),a=i(10);class n{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null}getValue(t,e){let i=this._storage.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this._storage.get(t)}removeKey(t){this._storage.delete(t),0===this._storage.size&&this.resetModified()}setValue(t,e){let i=this._storage.get(t),s=!1;if(void 0!==i)for(let[r,a]of Object.entries(e))i[r]!==a&&(s=!0,i[r]=a);else s=!0,this._storage.set(t,e);s&&this.#d()}has(t){return this._storage.has(t)}getAll(){return this._storage.size>0?(0,s.objectFromMap)(this._storage):null}get size(){return this._storage.size}#d(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new o(this)}get serializable(){if(0===this._storage.size)return null;let t=new Map;for(let[e,i]of this._storage){let s=i instanceof r.AnnotationEditor?i.serialize():i;s&&t.set(e,s)}return t}static getHash(t){if(!t)return"";let e=new a.MurmurHash3_64;for(let[i,s]of t)e.update(`${i}:${JSON.stringify(s)}`);return e.hexdigest()}}e.AnnotationStorage=n;class o extends n{#c=null;constructor(t){super(),this.#c=structuredClone(t.serializable)}get print(){(0,s.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#c}}e.PrintAnnotationStorage=o},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var s=i(9),r=i(1);class a{#u=this.focusin.bind(this);#p=this.focusout.bind(this);#g=!1;#m=!1;#f=!1;#b=a._zIndex++;static _colorManager=new s.ColorManager;static _zIndex=1;constructor(t){this.constructor===a&&(0,r.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null;let[e,i]=this.parent.viewportBaseDimensions;this.x=t.x/e,this.y=t.y/i,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,r.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#b}focusin(t){this.#g?this.#g=!1:this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;let e=t.relatedTarget;!e?.closest(`#${this.id}`)&&(t.preventDefault(),this.parent.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(t){let e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x,this.startY=t.clientY-e.y,t.dataTransfer.setData("text/plain",this.id),t.dataTransfer.effectAllowed="move"}setAt(t,e,i,s){let[r,a]=this.parent.viewportBaseDimensions;[i,s]=this.screenToPageTranslation(i,s),this.x=(t+i)/r,this.y=(e+s)/a,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(t,e){let[i,s]=this.parent.viewportBaseDimensions;[t,e]=this.screenToPageTranslation(t,e),this.x+=t/i,this.y+=e/s,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(t,e){let{rotation:i}=this.parent.viewport;switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}setDims(t,e){let[i,s]=this.parent.viewportBaseDimensions;this.div.style.width=`${100*t/i}%`,this.div.style.height=`${100*e/s}%`}getInitialTranslation(){return[0,0]}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.#u),this.div.addEventListener("focusout",this.#p);let[t,e]=this.getInitialTranslation();return this.translate(t,e),(0,s.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(t){let e=s.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e){t.preventDefault();return}t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#g=!0}getRect(t,e){let[i,s]=this.parent.viewportBaseDimensions,[r,a]=this.parent.pageDimensions,n=r*t/i,o=a*e/s,l=this.x*r,h=this.y*a,d=this.width*r,c=this.height*a;switch(this.rotation){case 0:return[l+n,a-h-o-c,l+n+d,a-h-o];case 90:return[l+o,a-h+n,l+o+c,a-h+n+d];case 180:return[l-n-d,a-h+o,l-n,a-h+o+c];case 270:return[l-o-c,a-h-n-d,l-o,a-h-n];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[i,s,r,a]=t,n=r-i,o=a-s;switch(this.rotation){case 0:return[i,e-a,n,o];case 90:return[i,e-s,o,n];case 180:return[r,e-s,n,o];case 270:return[r,e-a,o,n];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#f=!0}disableEditMode(){this.#f=!1}isInEditMode(){return this.#f}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#u)}
2serialize(){(0,r.unreachable)("An editor must be serializable")}static deserialize(t,e){let i=new this.prototype.constructor({parent:e,id:e.getNextId()});i.rotation=t.rotation;let[s,r]=e.pageDimensions,[a,n,o,l]=i.getRectInCurrentCoords(t.rect,r);return i.x=a/s,i.y=n/r,i.width=o/s,i.height=l/r,i}remove(){this.div.removeEventListener("focusin",this.#u),this.div.removeEventListener("focusout",this.#p),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}getIdForTextLayer(){return this.id}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(t){this.#m=t,t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}e.AnnotationEditor=a},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=a,e.opacityToHex=n;var s=i(1),r=i(4);function a(t,e,i){for(let s of i)e.addEventListener(s,t[s].bind(t))}function n(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class o{#A=0;getId(){return`${s.AnnotationEditorPrefix}${this.#A++}`}}class l{#y=[];#v=!1;#_;#S=-1;constructor(t=128){this.#_=t}add({cmd:t,undo:e,mustExec:i,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}){if(i&&t(),this.#v)return;let n={cmd:t,undo:e,type:s};if(-1===this.#S){this.#y.length>0&&(this.#y.length=0),this.#S=0,this.#y.push(n);return}if(r&&this.#y[this.#S].type===s){a&&(n.undo=this.#y[this.#S].undo),this.#y[this.#S]=n;return}let o=this.#S+1;o===this.#_?this.#y.splice(0,1):(this.#S=o,o<this.#y.length&&this.#y.splice(o)),this.#y.push(n)}undo(){-1!==this.#S&&(this.#v=!0,this.#y[this.#S].undo(),this.#v=!1,this.#S-=1)}redo(){this.#S<this.#y.length-1&&(this.#S+=1,this.#v=!0,this.#y[this.#S].cmd(),this.#v=!1)}hasSomethingToUndo(){return -1!==this.#S}hasSomethingToRedo(){return this.#S<this.#y.length-1}destroy(){this.#y=null}}e.CommandManager=l;class h{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let e=h.platform.isMac;for(let[i,s]of t)for(let r of i){let a=r.startsWith("mac+");e&&a?(this.callbacks.set(r.slice(4),s),this.allKeys.add(r.split("+").at(-1))):e||a||(this.callbacks.set(r,s),this.allKeys.add(r.split("+").at(-1)))}}static get platform(){let t="undefined"!=typeof navigator?navigator.platform:"";return(0,s.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}#x(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(t,e){if(!this.allKeys.has(e.key))return;let i=this.callbacks.get(this.#x(e));i&&(i.bind(t)(),e.stopPropagation(),e.preventDefault())}}e.KeyboardManager=h;class u{#C=null;copy(t){t&&(Array.isArray(t)?this.#C=t.map(t=>t.serialize()):this.#C=[t.serialize()],this.#C=this.#C.filter(t=>!!t),0===this.#C.length&&(this.#C=null))}paste(){return this.#C}isEmpty(){return null===this.#C}destroy(){this.#C=null}}class p{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return(0,r.getColorValues)(t),(0,s.shadow)(this,"_colors",t)}convert(t){let e=(0,r.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[i,s]of this._colors)if(s.every((t,i)=>t===e[i]))return p._colorsMapping.get(i);return e}getHexCode(t){let e=this._colors.get(t);return e?s.Util.makeHexColor(...e):t}}e.ColorManager=p;class g{#E=null;#T=new Map;#P=new Map;#M=new u;#k=new l;#w=0;#R=null;#F=null;#O=new o;#I=!1;#D=s.AnnotationEditorType.NONE;#L=new Set;#N=this.keydown.bind(this);#j=this.onEditingAction.bind(this);#U=this.onPageChanging.bind(this);#B=this.onTextLayerRendered.bind(this);#z={isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#q=null;static _keyboardManager=new h([[["ctrl+a","mac+meta+a"],g.prototype.selectAll],[["ctrl+c","mac+meta+c"],g.prototype.copy],[["ctrl+v","mac+meta+v"],g.prototype.paste],[["ctrl+x","mac+meta+x"],g.prototype.cut],[["ctrl+z","mac+meta+z"],g.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],g.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],g.prototype.delete],[["Escape","mac+Escape"],g.prototype.unselectAll]]);constructor(t,e){this.#q=t,this.#F=e,this.#F._on("editingaction",this.#j),this.#F._on("pagechanging",this.#U),this.#F._on("textlayerrendered",this.#B)}destroy(){for(let t of(this.#W(),this.#F._off("editingaction",this.#j),this.#F._off("pagechanging",this.#U),this.#F._off("textlayerrendered",this.#B),this.#P.values())
2)t.destroy();this.#P.clear(),this.#T.clear(),this.#E=null,this.#L.clear(),this.#M.destroy(),this.#k.destroy()}onPageChanging({pageNumber:t}){this.#w=t-1}onTextLayerRendered({pageNumber:t}){let e=t-1,i=this.#P.get(e);i?.onTextLayerRendered()}focusMainContainer(){this.#q.focus()}#H(){this.#q.addEventListener("keydown",this.#N)}#W(){this.#q.removeEventListener("keydown",this.#N)}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||g._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","cut","copy","paste","delete","selectAll"].includes(t.name)&&this[t.name]()}#G(m){let f=Object.entries(m).some(([t,e])=>this.#z[t]!==e);f&&this.#F.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#z,m)})}#V(b){this.#F.dispatch("annotationeditorparamschanged",{source:this,details:b})}setEditingState(t){t?(this.#H(),this.#G({isEditing:this.#D!==s.AnnotationEditorType.NONE,isEmpty:this.#$(),hasSomethingToUndo:this.#k.hasSomethingToUndo(),hasSomethingToRedo:this.#k.hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:this.#M.isEmpty()})):(this.#W(),this.#G({isEditing:!1}))}registerEditorTypes(t){for(let e of(this.#R=t,this.#R))this.#V(e.defaultPropertiesToUpdate)}getId(){return this.#O.getId()}addLayer(t){this.#P.set(t.pageIndex,t),this.#I?t.enable():t.disable()}removeLayer(t){this.#P.delete(t.pageIndex)}updateMode(t){if(this.#D=t,t===s.AnnotationEditorType.NONE)this.setEditingState(!1),this.#X();else for(let e of(this.setEditingState(!0),this.#Y(),this.#P.values()))e.updateMode(t)}updateToolbar(t){t!==this.#D&&this.#F.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){for(let i of this.#L)i.updateParams(t,e);for(let s of this.#R)s.updateDefaultParams(t,e)}#Y(){if(!this.#I)for(let A of(this.#I=!0,this.#P.values()))A.enable()}#X(){if(this.unselectAll(),this.#I)for(let y of(this.#I=!1,this.#P.values()))y.disable()}getEditors(t){let e=[];for(let i of this.#T.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#T.get(t)}addEditor(t){this.#T.set(t.id,t)}removeEditor(t){this.#T.delete(t.id),this.unselect(t)}#K(v){let _=this.#P.get(v.pageIndex);_?_.addOrRebuild(v):this.addEditor(v)}setActiveEditor(t){this.#E!==t&&(this.#E=t,t&&this.#V(t.propertiesToUpdate))}toggleSelected(t){if(this.#L.has(t)){this.#L.delete(t),t.unselect(),this.#G({hasSelectedEditor:this.hasSelection});return}this.#L.add(t),t.select(),this.#V(t.propertiesToUpdate),this.#G({hasSelectedEditor:!0})}setSelected(t){for(let e of this.#L)e!==t&&e.unselect();this.#L.clear(),this.#L.add(t),t.select(),this.#V(t.propertiesToUpdate),this.#G({hasSelectedEditor:!0})}isSelected(t){return this.#L.has(t)}unselect(t){t.unselect(),this.#L.delete(t),this.#G({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#L.size}undo(){this.#k.undo(),this.#G({hasSomethingToUndo:this.#k.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#$()})}redo(){this.#k.redo(),this.#G({hasSomethingToUndo:!0,hasSomethingToRedo:this.#k.hasSomethingToRedo(),isEmpty:this.#$()})}addCommands(t){this.#k.add(t),this.#G({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#$()})}#$(){if(0===this.#T.size)return!0;if(1===this.#T.size)for(let S of this.#T.values())return S.isEmpty();return!1}delete(){if(this.#E&&this.#E.commitOrRemove(),!this.hasSelection)return;let t=[...this.#L],e=()=>{for(let e of t)e.remove()},i=()=>{for(let e of t)this.#K(e)};this.addCommands({cmd:e,undo:i,mustExec:!0})}copy(){if(this.#E&&this.#E.commitOrRemove(),this.hasSelection){let t=[];for(let e of this.#L)e.isEmpty()||t.push(e);0!==t.length&&(this.#M.copy(t),this.#G({hasEmptyClipboard:!1}))}}cut(){this.copy(),this.delete()}paste(){if(this.#M.isEmpty())return;this.unselectAll();let t=this.#P.get(this.#w),e=this.#M.paste().map(e=>t.deserialize(e)),i=()=>{for(let t of e)this.#K(t);this.#J(e)},s=()=>{for(let t of e)t.remove()};this.addCommands({cmd:i,undo:s,mustExec:!0})}#J(x){for(let C of(this.#L.clear(),x))C.isEmpty()||(this.#L.add(C),C.select());this.#G({hasSelectedEditor:!0})}selectAll(){for(let t of this.#L)t.commit();this.#J(this.#T.values())}
2unselectAll(){if(this.#E){this.#E.commitOrRemove();return}if(0!==this.#J.size){for(let t of this.#L)t.unselect();this.#L.clear(),this.#G({hasSelectedEditor:!1})}}isActive(t){return this.#E===t}getActive(){return this.#E}getMode(){return this.#D}}e.AnnotationEditorUIManager=g},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var s=i(1);let r=3285377520,a=4294901760,n=65535;class o{constructor(t){this.h1=t?4294967295&t:r,this.h2=t?4294967295&t:r}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let r=0,o=t.length;r<o;r++){let l=t.charCodeAt(r);l<=255?e[i++]=l:(e[i++]=l>>>8,e[i++]=255&l)}}else if((0,s.isArrayBuffer)(t))i=(e=t.slice()).byteLength;else throw Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let h=i>>2,d=i-4*h,c=new Uint32Array(e.buffer,0,h),u=0,p=0,g=this.h1,m=this.h2,f=3432918353,b=461845907,A=f&n,y=b&n;for(let v=0;v<h;v++)1&v?(g^=u=(u=(u=(u=c[v])*f&a|u*A&n)<<15|u>>>17)*b&a|u*y&n,g=5*(g=g<<13|g>>>19)+3864292196):(m^=p=(p=(p=(p=c[v])*f&a|p*A&n)<<15|p>>>17)*b&a|p*y&n,m=5*(m=m<<13|m>>>19)+3864292196);switch(u=0,d){case 3:u^=e[4*h+2]<<16;case 2:u^=e[4*h+1]<<8;case 1:u^=e[4*h],u=(u=(u=u*f&a|u*A&n)<<15|u>>>17)*b&a|u*y&n,1&h?g^=u:m^=u}this.h1=g,this.h2=m}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1,t=3981806797*t&a|36045*t&n,e=4283543511*e&a|((e<<16|t>>>16)*2950163797&a)>>>16,t^=e>>>1,t=444984403*t&a|60499*t&n,e=3301882366*e&a|((e<<16|t>>>16)*3120437893&a)>>>16,t^=e>>>1;let i=(t>>>0).toString(16),s=(e>>>0).toString(16);return i.padStart(8,"0")+s.padStart(8,"0")}}e.MurmurHash3_64=o},(t,e,i)=>{let s;Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var r=i(1);class a{constructor({docId:t,onUnsupportedFeature:e,ownerDocument:i=globalThis.document,styleElement:s=null}){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseFontLoader."),this.docId=t,this._onUnsupportedFeature=e,this._document=i,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(t){this.nativeFontFaces.push(t),this._document.fonts.add(t)}insertRule(t){let e=this.styleElement;e||((e=this.styleElement=this._document.createElement("style")).id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].append(e));let i=e.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(t){if(t.attached||t.missingFile)return;if(t.attached=!0,this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}let s=t.createFontFaceRule();if(s){if(this.insertRule(s),this.isSyncFontLoadingSupported)return;await new Promise(e=>{let i=this._queueLoadingCallback(e);this._prepareFontLoadEvent([s],[t],i)})}}_queueLoadingCallback(t){(0,r.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){let t=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){(0,r.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,r.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(t,e,i){(0,r.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}e.FontLoader=s,e.FontLoader=s=class extends a{constructor(t){super(t),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let t=!1;if("undefined"==typeof navigator)t=!0;else{let e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);e?.[1]>=14&&(t=!0)}return(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function e(){for((0,r.assert)(!s.done,"completeRequest() cannot be called twice."),s.done=!0;i.requests.length>0&&i.requests[0].done;){let t=i.requests.shift();setTimeout(t.callback,0)}}let i=this.loadingContext,s={id:`pdfjs-font-loading-${i.nextRequestId++}`,done:!1,complete:e,callback:t};return i.requests.push(s),s}get _loadTestFont(){let t=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,r.shadow)(this,"_loadTestFont",t())}_prepareFontLoadEvent(t,e,i){let s,a;function n(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function o(t,e,i,s){let r=t.substring(0,e),a=t.substring(e+i);return r+s+a}let l=this._document.createElement("canvas");l.width=1,l.height=1;let h=l.getContext("2d"),d=0;function c(t,e){if(++d>30){(0,r.warn)("Load test font never loaded."),e();return}h.font="30px "+t,h.fillText(".",0,20);let i=h.getImageData(0,0,1,1);if(i.data[3]>0){e();return}setTimeout(c.bind(null,t,e))}let u=`lt${Date.now()}${this.loadTestFontId++}`,p=this._loadTestFont,g=976;p=o(p,g,u.length,u);let m=16,f=1482184792,b=n(p,m);for(s=0,a=u.length-3;s<a;s+=4)b=b-f+n(u,s)|0;s<u.length&&(b=b-f+n(u+"XXX",s)|0),p=o(p,m,4,(0,r.string32)(b));let A=`url(data:font/opentype;base64,${btoa(p)});`,y=`@font-face {font-family:"${u}";src:${A}}`;this.insertRule(y);let v=[];for(let _ of e)v.push(_.loadedName);v.push(u);let S=this._document.createElement("div");for(let x of(S.style.visibility="hidden",S.style.width=S.style.height="10px",S.style.position="absolute",
2S.style.top=S.style.left="0px",v)){let C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=x,S.append(C)}this._document.body.append(S),c(u,()=>{S.remove(),i.complete()})}};class n{constructor(t,{isEvalSupported:e=!0,disableFontFace:i=!1,ignoreErrors:s=!1,onUnsupportedFeature:r,fontRegistry:a=null}){for(let n in this.compiledGlyphs=Object.create(null),t)this[n]=t[n];this.isEvalSupported=!1!==e,this.disableFontFace=!0===i,this.ignoreErrors=!0===s,this._onUnsupportedFeature=r,this.fontRegistry=a}createNativeFontFace(){let t;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),t}createFontFaceRule(){let t;if(!this.data||this.disableFontFace)return null;let e=(0,r.bytesToString)(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;if(this.cssFontInfo){let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${i}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${i}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,i),t}getPathGenerator(t,e){let i;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];try{i=t.get(this.loadedName+"_path_"+e)}catch(s){if(!this.ignoreErrors)throw s;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${s}".`),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){let a=[];for(let n of i){let o=void 0!==n.args?n.args.join(","):"";a.push("c.",n.cmd,"(",o,");\n")}return this.compiledGlyphs[e]=Function("c","size",a.join(""))}return this.compiledGlyphs[e]=function(t,e){for(let s of i)"scale"===s.cmd&&(s.args=[e,-e]),t[s.cmd].apply(t,s.args)}}}e.FontFaceObject=n},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var s=i(1),r=i(4),a=i(13),n=i(14),o=i(3);let l=16,h=100,d=4096,c=15,u=10,p=!0,g=1e3,m=16,f=1.000001;function b(t,e){if(t._removeMirroring)throw Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,s,r,a,n){e.transform(t,i,s,r,a,n),this.__originalTransform(t,i,s,r,a,n)},t.setTransform=function(t,i,s,r,a,n){e.setTransform(t,i,s,r,a,n),this.__originalSetTransform(t,i,s,r,a,n)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,s,r,a,n){e.bezierCurveTo(t,i,s,r,a,n),this.__originalBezierCurveTo(t,i,s,r,a,n)},t.rect=function(t,i,s,r){e.rect(t,i,s,r),this.__originalRect(t,i,s,r)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}function A(t){if(t._transformStack&&(t._transformStack=[]),!t.mozCurrentTransform){t._originalSave=t.save,t._originalRestore=t.restore,t._originalRotate=t.rotate,t._originalScale=t.scale,t._originalTranslate=t.translate,t._originalTransform=t.transform,t._originalSetTransform=t.setTransform,t._originalResetTransform=t.resetTransform,t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0],t._transformStack=[];try{let e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"lineWidth");t._setLineWidth=e.set,t._getLineWidth=e.get,Object.defineProperty(t,"lineWidth",{set:function(t){this._setLineWidth(t*f)},get:function(){return this._getLineWidth()}})}catch(i){}Object.defineProperty(t,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(t,"mozCurrentTransformInverse",{get:function(){let[t,e,i,s,r,a]=this._transformMatrix,n=t*s-e*i,o=e*i-t*s;return[s/n,e/o,i/o,t/n,(s*r-i*a)/o,(e*r-t*a)/n]}}),t.save=function(){let t=this._transformMatrix;this._transformStack.push(t),this._transformMatrix=t.slice(0,6),this._originalSave()},t.restore=function(){0===this._transformStack.length&&(0,s.warn)("Tried to restore a ctx when the stack was already empty.");let t=this._transformStack.pop();t&&(this._transformMatrix=t,this._originalRestore())},t.translate=function(t,e){let i=this._transformMatrix;i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this._originalTranslate(t,e)},t.scale=function(t,e){let i=this._transformMatrix;i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this._originalScale(t,e)},t.transform=function(e,i,s,r,a,n){let o=this._transformMatrix;this._transformMatrix=[o[0]*e+o[2]*i,o[1]*e+o[3]*i,o[0]*s+o[2]*r,o[1]*s+o[3]*r,o[0]*a+o[2]*n+o[4],o[1]*a+o[3]*n+o[5]],t._originalTransform(e,i,s,r,a,n)},t.setTransform=function(e,i,s,r,a,n){this._transformMatrix=[e,i,s,r,a,n],t._originalSetTransform(e,i,s,r,a,n)},t.resetTransform=function(){this._transformMatrix=[1,0,0,1,0,0],t._originalResetTransform()},t.rotate=function(t){let e=Math.cos(t),i=Math.sin(t),s=this._transformMatrix;
2this._transformMatrix=[s[0]*e+s[2]*i,s[1]*e+s[3]*i,-(s[0]*i)+s[2]*e,-(s[1]*i)+s[3]*e,s[4],s[5]],this._originalRotate(t)}}}class y{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i,s){let r;return void 0!==this.cache[t]?(r=this.cache[t],this.canvasFactory.reset(r,e,i),r.context.setTransform(1,0,0,1,0,0)):(r=this.canvasFactory.create(e,i),this.cache[t]=r),s&&A(r.context),r}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function v(t,e,i,s,r,a,n,o,l,h){let[d,c,u,p,g,m]=t.mozCurrentTransform;if(0===c&&0===u){let f=n*d+g,b=Math.round(f),A=o*p+m,y=Math.round(A),v=(n+l)*d+g,_=Math.abs(Math.round(v)-b)||1,S=(o+h)*p+m,x=Math.abs(Math.round(S)-y)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(p),b,y),t.drawImage(e,i,s,r,a,0,0,_,x),t.setTransform(d,c,u,p,g,m),[_,x]}if(0===d&&0===p){let C=o*u+g,E=Math.round(C),T=n*c+m,P=Math.round(T),M=(o+h)*u+g,k=Math.abs(Math.round(M)-E)||1,w=(n+l)*c+m,R=Math.abs(Math.round(w)-P)||1;return t.setTransform(0,Math.sign(c),Math.sign(u),0,E,P),t.drawImage(e,i,s,r,a,0,0,R,k),t.setTransform(d,c,u,p,g,m),[R,k]}t.drawImage(e,i,s,r,a,n,o,l,h);let F=Math.hypot(d,c),O=Math.hypot(u,p);return[F*l,O*h]}function _(t){let e,i,s,r,a,n;let{width:l,height:h}=t;if(!p||l>g||h>g)return null;let d=1e3,c=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=l+1,m=new Uint8Array(u*(h+1)),f=l+7&-8,b=new Uint8Array(f*h),A=0;for(let y of t.data){let v=128;for(;v>0;)b[A++]=y&v?0:255,v>>=1}let _=0;for(0!==b[A=0]&&(m[0]=1,++_),i=1;i<l;i++)b[A]!==b[A+1]&&(m[i]=b[A]?2:1,++_),A++;for(0!==b[A]&&(m[i]=2,++_),e=1;e<h;e++){A=e*f,s=e*u,b[A-f]!==b[A]&&(m[s]=b[A]?1:8,++_);let S=(b[A]?4:0)+(b[A-f]?8:0);for(i=1;i<l;i++)c[S=(S>>2)+(b[A+1]?4:0)+(b[A-f+1]?8:0)]&&(m[s+i]=c[S],++_),A++;if(b[A-f]!==b[A]&&(m[s+i]=b[A]?2:4,++_),_>d)return null}for(A=f*(h-1),s=e*u,0!==b[A]&&(m[s]=8,++_),i=1;i<l;i++)b[A]!==b[A+1]&&(m[s+i]=b[A]?4:8,++_),A++;if(0!==b[A]&&(m[s+i]=4,++_),_>d)return null;let x=new Int32Array([0,u,-1,0,-u,0,0,0,1]);for(o.isNodeJS?a=[]:r=new Path2D,e=0;_&&e<=h;e++){let C=e*u,E=C+l;for(;C<E&&!m[C];)C++;if(C===E)continue;r?r.moveTo(C%u,e):n=[C%u,e];let T=C,P=m[C];do{let M=x[P];do C+=M;while(!m[C]);let k=m[C];5!==k&&10!==k?(P=k,m[C]=0):(P=k&51*P>>4,m[C]&=P>>2|P<<2),r?r.lineTo(C%u,C/u|0):n.push(C%u,C/u|0),!m[C]&&--_}while(T!==C);r||a.push(n),--e}b=null,m=null;let w=function(t){if(t.save(),t.scale(1/l,-1/h),t.translate(0,-h),r)t.fill(r);else{for(let e of(t.beginPath(),a)){t.moveTo(e[0],e[1]);for(let i=2,s=e.length;i<s;i+=2)t.lineTo(e[i],e[i+1])}t.fill()}t.beginPath(),t.restore()};return w}class S{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=s.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=s.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=s.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=null,this.startNewPathAndClipBox([0,0,t,e])}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=s.Util.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){let i=s.Util.applyTransform(e,t),r=s.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,i[0],r[0]),this.minY=Math.min(this.minY,i[1],r[1]),this.maxX=Math.max(this.maxX,i[0],r[0]),this.maxY=Math.max(this.maxY,i[1],r[1])}updateScalingPathMinMax(t,e){s.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,r,a,n,o,l,h,d){let c=s.Util.bezierBoundingBox(e,i,r,a,n,o,l,h);if(d){d[0]=Math.min(d[0],c[0],c[2]),d[1]=Math.max(d[1],c[0],c[2]),d[2]=Math.min(d[2],c[1],c[3]),d[3]=Math.max(d[3],c[1],c[3]);return}this.updateRectMinMax(t,c)}getPathBoundingBox(t=a.PathType.FILL,e=null){let i=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,s.unreachable)("Stroke bounding box must include transform.");let r=s.Util.singularValueDecompose2dScale(e),n=r[0]*this.lineWidth/2,o=r[1]*this.lineWidth/2;i[0]-=n,i[1]-=o,i[2]+=n,i[3]+=o}return i}updateClipFromPath(){let t=s.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=a.PathType.FILL,e=null){return s.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function x(t,e,i=null){let r,a,n,o,l,h,d,c;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}let u=e.height,p=e.width,g=u%m,f=(u-g)/m,b=0===g?f:f+1,A=t.createImageData(p,m),y=0,v,_=e.data,S=A.data;if(i)switch(i.length){case 1:l=i[0],h=i[0],d=i[0],c=i[0];break;case 4:l=i[0],h=i[1],d=i[2],c=i[3]}if(e.kind===s.ImageKind.GRAYSCALE_1BPP){let x=_.byteLength,C=new Uint32Array(S.buffer,0,S.byteLength>>2),E=C.length,T=p+7>>3,P=4294967295,M=s.FeatureTest.isLittleEndian?4278190080:255;for(c&&255===c[0]&&0===c[255]&&([P,M]=[M,P]),r=0;r<b;r++){for(a=0,n=r<f?m:g,v=0;a<n;a++){let k=x-y,w=0,R=k>
2T?p:8*k-7,F=-8&R,O=0,I=0;for(;w<F;w+=8)I=_[y++],C[v++]=128&I?P:M,C[v++]=64&I?P:M,C[v++]=32&I?P:M,C[v++]=16&I?P:M,C[v++]=8&I?P:M,C[v++]=4&I?P:M,C[v++]=2&I?P:M,C[v++]=1&I?P:M;for(;w<R;w++)0===O&&(I=_[y++],O=128),C[v++]=I&O?P:M,O>>=1}for(;v<E;)C[v++]=0;t.putImageData(A,0,r*m)}}else if(e.kind===s.ImageKind.RGBA_32BPP){let D=!!(l||h||d);for(r=0,a=0,o=p*m*4;r<f;r++){if(S.set(_.subarray(y,y+o)),y+=o,D)for(let L=0;L<o;L+=4)l&&(S[L+0]=l[S[L+0]]),h&&(S[L+1]=h[S[L+1]]),d&&(S[L+2]=d[S[L+2]]);t.putImageData(A,0,a),a+=m}if(r<b){if(o=p*g*4,S.set(_.subarray(y,y+o)),D)for(let N=0;N<o;N+=4)l&&(S[N+0]=l[S[N+0]]),h&&(S[N+1]=h[S[N+1]]),d&&(S[N+2]=d[S[N+2]]);t.putImageData(A,0,a)}}else if(e.kind===s.ImageKind.RGB_24BPP){let j=!!(l||h||d);for(r=0,o=p*(n=m);r<b;r++){for(r>=f&&(o=p*(n=g)),v=0,a=o;a--;)S[v++]=_[y++],S[v++]=_[y++],S[v++]=_[y++],S[v++]=255;if(j)for(let U=0;U<v;U+=4)l&&(S[U+0]=l[S[U+0]]),h&&(S[U+1]=h[S[U+1]]),d&&(S[U+2]=d[S[U+2]]);t.putImageData(A,0,r*m)}}else throw Error(`bad image kind: ${e.kind}`)}function C(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}let i=e.height,s=e.width,r=i%m,a=(i-r)/m,o=0===r?a:a+1,l=t.createImageData(s,m),h=0,d=e.data,c=l.data;for(let u=0;u<o;u++){let p=u<a?m:r;({srcPos:h}=(0,n.applyMaskImageData)({src:d,srcPos:h,dest:c,width:s,height:p})),t.putImageData(l,0,u*m)}}function E(t,e){let i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let s=0,r=i.length;s<r;s++){let a=i[s];void 0!==t[a]&&(e[a]=t[a])}void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function T(t,e){t.strokeStyle=t.fillStyle=e||"#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0)}function P(t,e,i,s){let r=t.length;for(let a=3;a<r;a+=4){let n=t[a];if(0===n)t[a-3]=e,t[a-2]=i,t[a-1]=s;else if(n<255){let o=255-n;t[a-3]=t[a-3]*n+e*o>>8,t[a-2]=t[a-2]*n+i*o>>8,t[a-1]=t[a-1]*n+s*o>>8}}}function M(t,e,i){let s=t.length,r=1/255;for(let a=3;a<s;a+=4){let n=i?i[t[a]]:t[a];e[a]=e[a]*n*r|0}}function k(t,e,i){let s=t.length;for(let r=3;r<s;r+=4){let a=77*t[r-3]+152*t[r-2]+28*t[r-1];e[r]=i?e[r]*i[a>>8]>>8:e[r]*a>>16}}function w(t,e,i,s,r,a,n,o,l,h,d){let c;let u=!!a,p=u?a[0]:0,g=u?a[1]:0,m=u?a[2]:0;c="Luminosity"===r?k:M;let f=1048576,b=Math.min(s,Math.ceil(f/i));for(let A=0;A<s;A+=b){let y=Math.min(b,s-A),v=t.getImageData(o-h,A+(l-d),i,y),_=e.getImageData(o,A+l,i,y);u&&P(v.data,p,g,m),c(v.data,_.data,n),e.putImageData(_,o,A+l)}}function R(t,e,i,s){let r=s[0],a=s[1],n=s[2]-r,o=s[3]-a;0!==n&&0!==o&&(w(e.context,i,n,o,e.subtype,e.backdrop,e.transferMap,r,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}function F(t,e){let i=s.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);let a=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:i[0]<=a||i[1]<=a}let O=["butt","round","square"],I=["miter","round","bevel"],D={},L={};class N{constructor(t,e,i,s,r,a,n,o){this.ctx=t,this.current=new S(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=s,this.imageLayer=r,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=[],this.optionalContentConfig=a,this.cachedCanvases=new y(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=n,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=o?.background||null,this.foregroundColor=o?.foreground||null,t&&A(t),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:s=null}){let a=this.ctx.canvas.width,n=this.ctx.canvas.height,o=s||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;let l=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;let h=this.backgroundColor=this.ctx.fillStyle,d=!0,c=o;if(this.ctx.fillStyle=o,d="string"==typeof(c=this.ctx.fillStyle)&&/^#[0-9A-Fa-f]{6}$/.test(c),("#000000"!==l||"#ffffff"!==h)&&l!==h&&d){let[u,p,g]=(0,r.getRGB)(c),m=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,f=Math.round(.2126*m(u)+.71
252*m(p)+.0722*m(g));this.selectColor=(t,e,i)=>{let s=.2126*m(t)+.7152*m(e)+.0722*m(i);return Math.round(s)===f?h:l}}else this.foregroundColor=this.backgroundColor=null}if(this.ctx.fillStyle=this.backgroundColor||o,this.ctx.fillRect(0,0,a,n),this.ctx.restore(),i){let b=this.cachedCanvases.getCanvas("transparent",a,n,!0);this.compositeCtx=this.ctx,this.transparentCanvas=b.canvas,this.ctx=b.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),T(this.ctx,this.foregroundColor),t&&(this.ctx.transform.apply(this.ctx,t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform.apply(this.ctx,e.transform),this.viewportScale=e.scale,this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()}executeOperatorList(t,e,i,r){let a;let n=t.argsArray,o=t.fnArray,l=e||0,h=n.length;if(h===l)return l;let d=h-l>u&&"function"==typeof i,p=d?Date.now()+c:0,g=0,m=this.commonObjs,f=this.objs;for(;;){if(void 0!==r&&l===r.nextBreakPoint)return r.breakIt(l,i),l;if((a=o[l])!==s.OPS.dependency)this[a].apply(this,n[l]);else for(let b of n[l]){let A=b.startsWith("g_")?m:f;if(!A.has(b))return A.get(b,i),l}if(++l===h)return l;if(d&&++g>u){if(Date.now()>p)return i(),l;g=0}}}#Q(){for(;this.stateStack.length||this.inSMaskMode;)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 t of(this.#Q(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(t,e){let i,s;let r=t.width,a=t.height,n=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=r,h=a,d="prescale1";for(;n>2&&l>1||o>2&&h>1;){let c=l,u=h;n>2&&l>1&&(c=Math.ceil(l/2),n/=l/c),o>2&&h>1&&(u=Math.ceil(h/2),o/=h/u),(s=(i=this.cachedCanvases.getCanvas(d,c,u,!1)).context).clearRect(0,0,c,u),s.drawImage(t,0,0,l,h,0,0,c,u),t=i.canvas,l=c,h=u,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){let e,i,r,n;let o=this.ctx,{width:l,height:h}=t,d=this.current.fillColor,c=this.current.patternFill,u=o.mozCurrentTransform;if((t.bitmap||t.data)&&t.count>1){let p=t.bitmap||t.data.buffer,g=u.slice(0,4);i=JSON.stringify(c?g:[g,d]),(e=this._cachedBitmapsMap.get(p))||(e=new Map,this._cachedBitmapsMap.set(p,e));let m=e.get(i);if(m&&!c){let f=Math.round(Math.min(u[0],u[2])+u[4]),b=Math.round(Math.min(u[1],u[3])+u[5]);return{canvas:m,offsetX:f,offsetY:b}}r=m}r||C((n=this.cachedCanvases.getCanvas("maskCanvas",l,h,!1)).context,t);let A=s.Util.transform(u,[1/l,0,0,-1/h,0,0]);A=s.Util.transform(A,[1,0,0,1,0,-h]);let y=s.Util.applyTransform([0,0],A),_=s.Util.applyTransform([l,h],A),S=s.Util.normalizeRect([y[0],y[1],_[0],_[1]]),x=Math.round(S[2]-S[0])||1,E=Math.round(S[3]-S[1])||1,T=this.cachedCanvases.getCanvas("fillCanvas",x,E,!0),P=T.context,M=Math.min(y[0],_[0]),k=Math.min(y[1],_[1]);P.translate(-M,-k),P.transform.apply(P,A),!r&&(r=(r=this._scaleImage(n.canvas,P.mozCurrentTransformInverse)).img,e&&c&&e.set(i,r)),P.imageSmoothingEnabled=F(P.mozCurrentTransform,t.interpolate),v(P,r,0,0,r.width,r.height,0,0,l,h),P.globalCompositeOperation="source-in";let w=s.Util.transform(P.mozCurrentTransformInverse,[1,0,0,1,-M,-k]);return P.fillStyle=c?d.getPattern(o,this,w,a.PathType.FILL):d,P.fillRect(0,0,l,h),e&&!c&&(this.cachedCanvases.delete("fillCanvas"),e.set(i,T.canvas)),{canvas:T.canvas,offsetX:Math.round(M),offsetY:Math.round(k)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=O[t]}setLineJoin(t){this.ctx.lineJoin=I[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){let i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}
2setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let e=0,i=t.length;e<i;e++){let s=t[e],r=s[0],a=s[1];switch(r){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=s[1];break;case"ca":this.current.fillAlpha=s[1],this.ctx.globalAlpha=s[1];break;case"BM":this.ctx.globalCompositeOperation=a;break;case"SMask":this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=a}}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,t,e,!0);this.suspendedCtx=this.ctx,this.ctx=s.context;let r=this.ctx;r.setTransform.apply(r,this.suspendedCtx.mozCurrentTransform),E(this.suspendedCtx,r),b(r,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(),E(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let e=this.current.activeSMask,i=this.suspendedCtx;R(i,e,this.ctx,t),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()}save(){this.inSMaskMode?(E(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),E(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,s,r,a){this.ctx.transform(t,e,i,s,r,a),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){let r,a;let n=this.ctx,o=this.current,l=o.x,h=o.y,d=n.mozCurrentTransform,c=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],u=c?i.slice(0):null;for(let p=0,g=0,m=t.length;p<m;p++)switch(0|t[p]){case s.OPS.rectangle:l=e[g++],h=e[g++];let f=e[g++],b=e[g++],A=l+f,y=h+b;n.moveTo(l,h),0===f||0===b?n.lineTo(A,y):(n.lineTo(A,h),n.lineTo(A,y),n.lineTo(l,y)),c||o.updateRectMinMax(d,[l,h,A,y]),n.closePath();break;case s.OPS.moveTo:l=e[g++],h=e[g++],n.moveTo(l,h),c||o.updatePathMinMax(d,l,h);break;case s.OPS.lineTo:l=e[g++],h=e[g++],n.lineTo(l,h),c||o.updatePathMinMax(d,l,h);break;case s.OPS.curveTo:r=l,a=h,l=e[g+4],h=e[g+5],n.bezierCurveTo(e[g],e[g+1],e[g+2],e[g+3],l,h),o.updateCurvePathMinMax(d,r,a,e[g],e[g+1],e[g+2],e[g+3],l,h,u),g+=6;break;case s.OPS.curveTo2:r=l,a=h,n.bezierCurveTo(l,h,e[g],e[g+1],e[g+2],e[g+3]),o.updateCurvePathMinMax(d,r,a,l,h,e[g],e[g+1],e[g+2],e[g+3],u),l=e[g+2],h=e[g+3],g+=4;break;case s.OPS.curveTo3:r=l,a=h,l=e[g+2],h=e[g+3],n.bezierCurveTo(e[g],e[g+1],l,h,l,h),o.updateCurvePathMinMax(d,r,a,e[g],e[g+1],l,h,l,h,u),g+=4;break;case s.OPS.closePath:n.closePath()}c&&o.updateScalingPathMinMax(d,u),o.setCurrentPoint(l,h)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;let e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,a.PathType.STROKE),this.rescaleAndStroke(!1),e.restore(
2)):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t){t=void 0===t||t;let e=this.ctx,i=this.current.fillColor,s=this.current.patternFill,r=!1;s&&(e.save(),e.fillStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,a.PathType.FILL),r=!0);let n=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==n&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),r&&e.restore(),t&&this.consumePath(n)}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=D}eoClip(){this.pendingClip=L}beginText(){this.current.textMatrix=s.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let t=this.pendingTextPaths,e=this.ctx;if(void 0===t){e.beginPath();return}for(let i of(e.save(),e.beginPath(),t))e.setTransform.apply(e,i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){let i=this.commonObjs.get(t),r=this.current;if(!i)throw Error(`Can't find font for ${t}`);if(r.fontMatrix=i.fontMatrix||s.FONT_IDENTITY_MATRIX,(0===r.fontMatrix[0]||0===r.fontMatrix[3])&&(0,s.warn)("Invalid font matrix for font "+t),e<0?(e=-e,r.fontDirection=-1):r.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;let a=i.loadedName||"sans-serif",n="normal";i.black?n="900":i.bold&&(n="bold");let o=i.italic?"italic":"normal",d=`"${a}", ${i.fallbackName}`,c=e;e<l?c=l:e>h&&(c=h),this.current.fontSizeScale=e/c,this.ctx.font=`${o} ${n} ${c}px ${d}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,s,r,a){this.current.textMatrix=[t,e,i,s,r,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,r){let a;let n=this.ctx,o=this.current,l=o.font,h=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,c=h&s.TextRenderingMode.FILL_STROKE_MASK,u=!!(h&s.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;if((l.disableFontFace||u||p)&&(a=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||p?(n.save(),n.translate(e,i),n.beginPath(),a(n,d),r&&n.setTransform.apply(n,r),(c===s.TextRenderingMode.FILL||c===s.TextRenderingMode.FILL_STROKE)&&n.fill(),(c===s.TextRenderingMode.STROKE||c===s.TextRenderingMode.FILL_STROKE)&&n.stroke(),n.restore()):((c===s.TextRenderingMode.FILL||c===s.TextRenderingMode.FILL_STROKE)&&n.fillText(t,e,i),(c===s.TextRenderingMode.STROKE||c===s.TextRenderingMode.FILL_STROKE)&&n.strokeText(t,e,i)),u){let g=this.pendingTextPaths||(this.pendingTextPaths=[]);g.push({transform:n.mozCurrentTransform,x:e,y:i,fontSize:d,addToPath:a})}}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10,!1);t.scale(1.5,1),t.fillText("I",0,10);let e=t.getImageData(0,0,10,10).data,i=!1;for(let r=3;r<e.length;r+=4)if(e[r]>0&&e[r]<255){i=!0;break}return(0,s.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){let e;let i=this.current,r=i.font;if(r.isType3Font)return this.showType3Text(t);let n=i.fontSize;if(0===n)return;let o=this.ctx,l=i.fontSizeScale,h=i.charSpacing,d=i.wordSpacing,c=i.fontDirection,u=i.textHScale*c,p=t.length,g=r.vertical,m=g?1:-1,f=r.defaultVMetrics,b=n*i.fontMatrix[0],A=i.textRenderingMode===s.TextRenderingMode.FILL&&!r.disableFontFace&&!i.patternFill;if(o.save(),o.transform.apply(o,i.textMatrix),o.translate(i.x,i.y+i.textRise),c>0?o.scale(u,-1):o.scale(u,1),i.patternFill){o.save();let y=i.fillColor.getPattern(o,this,o.mozCurrentTransformInverse,a.PathType.FILL);
2e=o.mozCurrentTransform,o.restore(),o.fillStyle=y}let v=i.lineWidth,_=i.textMatrixScale;if(0===_||0===v){let S=i.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;(S===s.TextRenderingMode.STROKE||S===s.TextRenderingMode.FILL_STROKE)&&(v=this.getSinglePixelWidth())}else v/=_;1!==l&&(o.scale(l,l),v/=l),o.lineWidth=v;let x=0,C;for(C=0;C<p;++C){let E,T,P;let M=t[C];if("number"==typeof M){x+=m*M*n/1e3;continue}let k=!1,w=(M.isSpace?d:0)+h,R=M.fontChar,F=M.accent,O=M.width;if(g){let I=M.vmetric||f,D=-(M.vmetric?I[1]:.5*O)*b,L=I[2]*b;O=I?-I[0]:O,E=D/l,T=(x+L)/l}else E=x/l,T=0;if(r.remeasure&&O>0){let N=1e3*o.measureText(R).width/n*l;if(O<N&&this.isFontSubpixelAAEnabled){let j=O/N;k=!0,o.save(),o.scale(j,1),E/=j}else O!==N&&(E+=(O-N)/2e3*n/l)}if(this.contentVisible&&(M.isInFont||r.missingFile)){if(A&&!F)o.fillText(R,E,T);else if(this.paintChar(R,E,T,e),F){let U=E+n*F.offset.x/l,B=T-n*F.offset.y/l;this.paintChar(F.fontChar,U,B,e)}}x+=P=g?O*b-w*c:O*b+w*c,k&&o.restore()}g?i.y-=x:i.x+=x*u,o.restore(),this.compose()}showType3Text(t){let e,i,r,a;let n=this.ctx,o=this.current,l=o.font,h=o.fontSize,d=o.fontDirection,c=l.vertical?1:-1,u=o.charSpacing,p=o.wordSpacing,g=o.textHScale*d,m=o.fontMatrix||s.FONT_IDENTITY_MATRIX,f=t.length,b=o.textRenderingMode===s.TextRenderingMode.INVISIBLE;if(!b&&0!==h){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,n.save(),n.transform.apply(n,o.textMatrix),n.translate(o.x,o.y),n.scale(g,d),e=0;e<f;++e){if("number"==typeof(i=t[e])){a=c*i*h/1e3,this.ctx.translate(a,0),o.x+=a*g;continue}let A=(i.isSpace?p:0)+u,y=l.charProcOperatorList[i.operatorListId];if(!y){(0,s.warn)(`Type3 character "${i.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=i,this.save(),n.scale(h,h),n.transform.apply(n,m),this.executeOperatorList(y),this.restore());let v=s.Util.applyTransform([i.width,0],m);r=v[0]*h+A,n.translate(r,0),o.x+=r*g}n.restore(),this.processingType3=null}}setCharWidth(t,e){}
2setCharWidthAndBounds(t,e,i,s,r,a){this.ctx.rect(i,s,r-i,a-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){let i=t[1],s=this.baseTransform||this.ctx.mozCurrentTransform.slice(),r={createCanvasGraphics:t=>new N(t,this.commonObjs,this.objs,this.canvasFactory)};e=new a.TilingPattern(t,i,this.ctx,r,s)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){let r=this.selectColor?.(t,e,i)||s.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(t,e,i){let r=this.selectColor?.(t,e,i)||s.Util.makeHexColor(t,e,i);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=(0,a.getShadingPattern)(this.objs.get(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;let e=this.ctx;this.save();let i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,a.PathType.SHADING);let r=e.mozCurrentTransformInverse;if(r){let n=e.canvas,o=n.width,l=n.height,h=s.Util.applyTransform([0,0],r),d=s.Util.applyTransform([0,l],r),c=s.Util.applyTransform([o,0],r),u=s.Util.applyTransform([o,l],r),p=Math.min(h[0],d[0],c[0],u[0]),g=Math.min(h[1],d[1],c[1],u[1]),m=Math.max(h[0],d[0],c[0],u[0]),f=Math.max(h[1],d[1],c[1],u[1]);this.ctx.fillRect(p,g,m-p,f-g)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,s.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,s.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform.apply(this,t),this.baseTransform=this.ctx.mozCurrentTransform,e)){let i=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],i,s),this.current.updateRectMinMax(this.ctx.mozCurrentTransform,e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let e=this.ctx;t.isolated||(0,s.info)("TODO: Support non-isolated groups."),t.knockout&&(0,s.warn)("Knockout groups not supported.");let i=e.mozCurrentTransform;if(t.matrix&&e.transform.apply(e,t.matrix),!t.bbox)throw Error("Bounding box is required.");let r=s.Util.getAxialAlignedBoundingBox(t.bbox,e.mozCurrentTransform),a=[0,0,e.canvas.width,e.canvas.height];r=s.Util.intersect(r,a)||[0,0,0,0];let n=Math.floor(r[0]),o=Math.floor(r[1]),l=Math.max(Math.ceil(r[2])-n,1),h=Math.max(Math.ceil(r[3])-o,1),c=1,u=1;l>d&&(c=l/d,l=d),h>d&&(u=h/d,h=d),this.current.startNewPathAndClipBox([0,0,l,h]);let p="groupAt"+this.groupLevel;t.smask&&(p+="_smask_"+this.smaskCounter++%2);let g=this.cachedCanvases.getCanvas(p,l,h,!0),m=g.context;m.scale(1/c,1/u),m.translate(-n,-o),m.transform.apply(m,i),t.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:n,offsetY:o,scaleX:c,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(n,o),e.scale(c,u),e.save()),E(e,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;let e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let r=this.ctx.mozCurrentTransform;this.restore(),this.ctx.save(),this.ctx.setTransform.apply(this.ctx,r);let a=s.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],r);
2this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(a)}}beginAnnotation(t,e,i,r,a){if(this.#Q(),T(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform),Array.isArray(e)&&4===e.length){let n=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=o;let[l,h]=s.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),{viewportScale:d}=this,c=Math.ceil(n*this.outputScaleX*d),u=Math.ceil(o*this.outputScaleY*d);this.annotationCanvas=this.canvasFactory.create(c,u);let{canvas:p,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(t,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,A(this.ctx),this.ctx.setTransform(l,0,0,-h,0,o*h),T(this.ctx,this.foregroundColor)}else T(this.ctx,this.foregroundColor),this.ctx.rect(e[0],e[1],n,o),this.ctx.clip(),this.endPath()}this.current=new S(this.ctx.canvas.width,this.ctx.canvas.height),this.transform.apply(this,i),this.transform.apply(this,r)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;let e=t.count;(t=this.getObject(t.data,t)).count=e;let i=this.ctx,s=this.processingType3;if(s&&(void 0===s.compiled&&(s.compiled=_(t)),s.compiled)){s.compiled(i);return}let r=this._createMaskCanvas(t),a=r.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,r.offsetX,r.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,r=0,a,n){if(!this.contentVisible)return;t=this.getObject(t.data,t);let o=this.ctx;o.save();let l=o.mozCurrentTransform;o.transform(e,i,r,a,0,0);let h=this._createMaskCanvas(t);o.setTransform(1,0,0,1,0,0);for(let d=0,c=n.length;d<c;d+=2){let u=s.Util.transform(l,[e,i,r,a,n[d],n[d+1]]),[p,g]=s.Util.applyTransform([0,0],u);o.drawImage(h.canvas,p,g)}o.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;let e=this.ctx,i=this.current.fillColor,s=this.current.patternFill;for(let r of t){let{data:n,width:o,height:l,transform:h}=r,d=this.cachedCanvases.getCanvas("maskCanvas",o,l,!1),c=d.context;c.save();let u=this.getObject(n,r);C(c,u),c.globalCompositeOperation="source-in",c.fillStyle=s?i.getPattern(c,this,e.mozCurrentTransformInverse,a.PathType.FILL):i,c.fillRect(0,0,o,l),c.restore(),e.save(),e.transform.apply(e,h),e.scale(1,-1),v(e,d.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;let e=this.getObject(t);if(!e){(0,s.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,i,r){if(!this.contentVisible)return;let a=this.getObject(t);if(!a){(0,s.warn)("Dependent image isn't ready yet");return}let n=a.width,o=a.height,l=[];for(let h=0,d=r.length;h<d;h+=2)l.push({transform:[e,0,0,i,r[h],r[h+1]],x:0,y:0,w:n,h:o});this.paintInlineImageXObjectGroup(a,l)}paintInlineImageXObject(t){let e;if(!this.contentVisible)return;let i=t.width,s=t.height,r=this.ctx;if(this.save(),r.scale(1/i,-1/s),"function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)e=t;else{let a=this.cachedCanvases.getCanvas("inlineImage",i,s,!1),n=a.context;x(n,t,this.current.transferMaps),e=a.canvas}let o=this._scaleImage(e,r.mozCurrentTransformInverse);r.imageSmoothingEnabled=F(r.mozCurrentTransform,t.interpolate);let[l,h]=v(r,o.img,0,0,o.paintWidth,o.paintHeight,0,-s,i,s);if(this.imageLayer){let d=this.getCanvasPosition(0,-s);this.imageLayer.appendImage({imgData:t,left:d[0],top:d[1],width:l,height:h})}this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;let i=this.ctx,s=t.width,r=t.height,a=this.cachedCanvases.getCanvas("inlineImage",s,r,!1),n=a.context;x(n,t,this.current.transferMaps);for(let o=0,l=e.length;o<l;o++){let h=e[o];if(i.save(),i.transform.apply(i,h.transform),i.scale(1,-1),v(i,a.canvas,h.x,h.y,h.w,h.h,0,-1,1,1),this.imageLayer){let d=this.getCanvasPosition(h.x,h.y);this.imageLayer.appendImage({imgData:t,left:d[0],top:d[1],width:s,height:r})}
2i.restore()}this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){let e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);let i=this.ctx;this.pendingClip&&(e||(this.pendingClip===L?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=this.ctx.mozCurrentTransform;if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,s)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){let t,e;let{lineWidth:i}=this.current,s=this.ctx.mozCurrentTransform;if(0===s[1]&&0===s[2]){let r=Math.abs(s[0]),a=Math.abs(s[3]);if(0===i)t=1/r,e=1/a;else{let n=r*i,o=a*i;t=n<1?1/n:1,e=o<1?1/o:1}}else{let l=Math.abs(s[0]*s[3]-s[2]*s[1]),h=Math.hypot(s[0],s[1]),d=Math.hypot(s[2],s[3]);if(0===i)t=d/l,e=h/l;else{let c=i*l;t=d>c?d/c:1,e=h>c?h/c:1}}this._cachedScaleForStroking=[t,e]}return this._cachedScaleForStroking}rescaleAndStroke(t){let e,i,s;let{ctx:r}=this,{lineWidth:a}=this.current,[n,o]=this.getScaleForStroking();if(r.lineWidth=a||1,1===n&&1===o){r.stroke();return}t&&(e=r.mozCurrentTransform.slice(),i=r.getLineDash().slice(),s=r.lineDashOffset),r.scale(n,o);let l=Math.max(n,o);r.setLineDash(r.getLineDash().map(t=>t/l)),r.lineDashOffset/=l,r.stroke(),t&&(r.setTransform(...e),r.setLineDash(i),r.lineDashOffset=s)}getCanvasPosition(t,e){let i=this.ctx.mozCurrentTransform;return[i[0]*t+i[2]*e+i[4],i[1]*t+i[3]*e+i[5]]}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(let j in e.CanvasGraphics=N,s.OPS)void 0!==N.prototype[j]&&(N.prototype[s.OPS[j]]=N.prototype[j])},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=p;var s=i(1),r=i(3);let a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function n(t,e){if(!e||r.isNodeJS)return;let i=e[2]-e[0],s=e[3]-e[1],a=new Path2D;a.rect(e[0],e[1],i,s),t.clip(a)}e.PathType=a;class o{constructor(){this.constructor===o&&(0,s.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,s.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;for(let i of("axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,r){let o;if(r===a.STROKE||r===a.FILL){let l=e.current.getClippedPathBoundingBox(r,t.mozCurrentTransform)||[0,0,0,0],h=Math.ceil(l[2]-l[0])||1,d=Math.ceil(l[3]-l[1])||1,c=e.cachedCanvases.getCanvas("pattern",h,d,!0),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-l[0],-l[1]),i=s.Util.transform(i,[1,0,0,1,l[0],l[1]]),u.transform.apply(u,e.baseTransform),this.matrix&&u.transform.apply(u,this.matrix),n(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),o=t.createPattern(c.canvas,"no-repeat");let p=new DOMMatrix(i);try{o.setTransform(p)}catch(g){(0,s.warn)(`RadialAxialShadingPattern.getPattern: "${g?.message}".`)}}else n(t,this._bbox),o=this._createGradient(t);return o}}
2function h(t,e,i,s,r,a,n,o){let l,h,d,c,u,p,g,m,f;let b=e.coords,A=e.colors,y=t.data,v=4*t.width;b[i+1]>b[s+1]&&(l=i,i=s,s=l,l=a,a=n,n=l),b[s+1]>b[r+1]&&(l=s,s=r,r=l,l=n,n=o,o=l),b[i+1]>b[s+1]&&(l=i,i=s,s=l,l=a,a=n,n=l);let _=(b[i]+e.offsetX)*e.scaleX,S=(b[i+1]+e.offsetY)*e.scaleY,x=(b[s]+e.offsetX)*e.scaleX,C=(b[s+1]+e.offsetY)*e.scaleY,E=(b[r]+e.offsetX)*e.scaleX,T=(b[r+1]+e.offsetY)*e.scaleY;if(S>=T)return;let P=A[a],M=A[a+1],k=A[a+2],w=A[n],R=A[n+1],F=A[n+2],O=A[o],I=A[o+1],D=A[o+2],L=Math.round(S),N=Math.round(T);for(let j=L;j<=N;j++){let U;if(j<C){let B;h=_-(_-x)*(B=j<S?0:(S-j)/(S-C)),d=P-(P-w)*B,c=M-(M-R)*B,u=k-(k-F)*B}else{let z;h=x-(x-E)*(z=j>T?1:C===T?0:(C-j)/(C-T)),d=w-(w-O)*z,c=R-(R-I)*z,u=F-(F-D)*z}p=_-(_-E)*(U=j<S?0:j>T?1:(S-j)/(S-T)),g=P-(P-O)*U,m=M-(M-I)*U,f=k-(k-D)*U;let q=Math.round(Math.min(h,p)),W=Math.round(Math.max(h,p)),H=v*j+4*q;for(let G=q;G<=W;G++)(U=(h-G)/(h-p))<0?U=0:U>1&&(U=1),y[H++]=d-(d-g)*U|0,y[H++]=c-(c-m)*U|0,y[H++]=u-(u-f)*U|0,y[H++]=255}}function d(t,e,i){let s,r;let a=e.coords,n=e.colors;switch(e.type){case"lattice":let o=e.verticesPerRow,l=Math.floor(a.length/o)-1,d=o-1;for(s=0;s<l;s++){let c=s*o;for(let u=0;u<d;u++,c++)h(t,i,a[c],a[c+1],a[c+o],n[c],n[c+1],n[c+o]),h(t,i,a[c+o+1],a[c+1],a[c+o],n[c+o+1],n[c+1],n[c+o])}break;case"triangles":for(s=0,r=a.length;s<r;s+=3)h(t,i,a[s],a[s+1],a[s+2],n[s],n[s+1],n[s+2]);break;default:throw Error("illegal figure")}}class c extends o{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){let s=1.1,r=3e3,a=2,n=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-n,h=Math.ceil(this._bounds[3])-o,c=Math.min(Math.ceil(Math.abs(l*t[0]*s)),r),u=Math.min(Math.ceil(Math.abs(h*t[1]*s)),r),p=l/c,g=h/u,m={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-o,scaleX:1/p,scaleY:1/g},f=c+2*a,b=u+2*a,A=i.getCanvas("mesh",f,b,!1),y=A.context,v=y.createImageData(c,u);if(e){let _=v.data;for(let S=0,x=_.length;S<x;S+=4)_[S]=e[0],_[S+1]=e[1],_[S+2]=e[2],_[S+3]=255}for(let C of this._figures)d(v,C,m);y.putImageData(v,a,a);let E=A.canvas;return{canvas:E,offsetX:n-a*p,offsetY:o-a*g,scaleX:p,scaleY:g}}getPattern(t,e,i,r){let o;if(n(t,this._bbox),r===a.SHADING)o=s.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else if(o=s.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){let l=s.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*l[0],o[1]*l[1]]}let h=this._createMeshCanvas(o,r===a.SHADING?null:this._background,e.cachedCanvases);return r!==a.SHADING&&(t.setTransform.apply(t,e.baseTransform),this.matrix&&t.transform.apply(t,this.matrix)),t.translate(h.offsetX,h.offsetY),t.scale(h.scaleX,h.scaleY),t.createPattern(h.canvas,"no-repeat")}}class u extends o{getPattern(){return"hotpink"}}function p(t){switch(t[0]){case"RadialAxial":return new l(t);case"Mesh":return new c(t);case"Dummy":return new u}throw Error(`Unknown IR type: ${t[0]}`)}let g={COLORED:1,UNCOLORED:2};class m{static get MAX_PATTERN_SIZE(){return(0,s.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,i,s,r){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=s,this.baseTransform=r}createPatternCanvas(t){let e=this.operatorList,i=this.bbox,r=this.xstep,a=this.ystep,n=this.paintType,o=this.tilingType,l=this.color,h=this.canvasGraphicsFactory;(0,s.info)("TilingType: "+o);let d=i[0],c=i[1],u=i[2],p=i[3],g=s.Util.singularValueDecompose2dScale(this.matrix),m=s.Util.singularValueDecompose2dScale(this.baseTransform),f=[g[0]*m[0],g[1]*m[1]],b=this.getSizeAndScale(r,this.ctx.canvas.width,f[0]),A=this.getSizeAndScale(a,this.ctx.canvas.height,f[1]),y=t.cachedCanvases.getCanvas("pattern",b.size,A.size,!0),v=y.context,_=h.createCanvasGraphics(v);_.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(_,n,l);let S=d,x=c,C=u,E=p;return d<0&&(S=0,C+=Math.abs(d)),c<0&&(x=0,E+=Math.abs(c)),v.translate(-(b.scale*S),-(A.scale*x)),_.transform(b.scale,0,0,A.scale,0,0),v.save(),this.clipBbox(_,S,x,C,E),_.baseTransform=_.ctx.mozCurrentTransform.slice(),_.executeOperatorList(e),_.endDrawing(),{canvas:y.canvas,scaleX:b.scale,scaleY:A.scale,offsetX:S,offsetY:x}}getSizeAndScale(t,e,i){t=Math.abs(t);let s=Math.max(m.MAX_PATTERN_SIZE,e),r=Math.ceil(t*i);return r>=s?r=s:i=r/t,{scale:i,size:r}}clipBbox(t,e,i,s,r){let a=s-e,n=r-i;t.ctx.rect(e,i,a,n),t.current.updateRectMinMax(t.ctx.mozCurrentTransform,[e,i,s,r]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){let r=t.ctx,a=t.current;switch(e){case g.COLORED:let n=this.ctx;r.fillStyle=n.fillStyle,r.strokeStyle=n.strokeStyle,a.fillColor=n.fillStyle,a.strokeColor=n.strokeStyle;break;case g.UNCOLORED:let o=s.Util.makeHexColor(i[0],i[1],i[2]);r.fillStyle=o,r.strokeStyle=o,a.fillColor=o,a.strokeColor=o;break;default:throw new s.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,r){let n=i;r!==a.SHADING&&(n=s.Util.transform(n,e.baseTransform),this.matrix&&(n=s.Util.transform(n,this.matrix
2)));let o=this.createPatternCanvas(e),l=new DOMMatrix(n);l=(l=l.translate(o.offsetX,o.offsetY)).scale(1/o.scaleX,1/o.scaleY);let h=t.createPattern(o.canvas,"repeat");try{h.setTransform(l)}catch(d){(0,s.warn)(`TilingPattern.getPattern: "${d?.message}".`)}return h}}e.TilingPattern=m},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.applyMaskImageData=r;var s=i(1);function r({src:t,srcPos:e=0,dest:i,destPos:r=0,width:a,height:n,inverseDecode:o=!1}){let l=s.FeatureTest.isLittleEndian?4278190080:255,[h,d]=o?[0,l]:[l,0],c=a>>3,u=7&a,p=t.length;i=new Uint32Array(i.buffer);for(let g=0;g<n;g++){for(let m=e+c;e<m;e++){let f=e<p?t[e]:255;i[r++]=128&f?d:h,i[r++]=64&f?d:h,i[r++]=32&f?d:h,i[r++]=16&f?d:h,i[r++]=8&f?d:h,i[r++]=4&f?d:h,i[r++]=2&f?d:h,i[r++]=1&f?d:h}if(0===u)continue;let b=e<p?t[e++]:255;for(let A=0;A<u;A++)i[r++]=b&1<<7-A?d:h}return{srcPos:e,destPos:r}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;let i=Object.create(null);e.GlobalWorkerOptions=i,i.workerPort=void 0===i.workerPort?null:i.workerPort,i.workerSrc=void 0===i.workerSrc?"":i.workerSrc},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var s=i(1);let r={UNKNOWN:0,DATA:1,ERROR:2},a={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function n(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,s.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new s.AbortException(t.message);case"MissingPDFException":return new s.MissingPDFException(t.message);case"PasswordException":return new s.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new s.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new s.UnknownErrorException(t.message,t.details);default:return new s.UnknownErrorException(t.message,t.toString())}}class o{constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,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=t=>{let e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){let s=e.callbackId,a=this.callbackCapabilities[s];if(!a)throw Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],e.callback===r.DATA)a.resolve(e.data);else if(e.callback===r.ERROR)a.reject(n(e.reason));else throw Error("Unexpected callback case");return}let o=this.actionHandler[e.action];if(!o)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let l=this.sourceName,h=e.sourceName;new Promise(function(t){t(o(e.data))}).then(function(t){i.postMessage({sourceName:l,targetName:h,callback:r.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:l,targetName:h,callback:r.ERROR,callbackId:e.callbackId,reason:n(t)})});return}if(e.streamId){this._createStreamSink(e);return}o(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){let i=this.actionHandler;if(i[t])throw Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){let r=this.callbackId++,a=(0,s.createPromiseCapability)();this.callbackCapabilities[r]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(n){a.reject(n)}return a.promise}sendWithStream(t,e,i,r){let o=this.streamId++,l=this.sourceName,h=this.targetName,d=this.comObj;return new ReadableStream({start:i=>{let a=(0,s.createPromiseCapability)();return this.streamControllers[o]={controller:i,startCall:a,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:l,targetName:h,action:t,streamId:o,data:e,desiredSize:i.desiredSize},r),a.promise},pull:t=>{let e=(0,s.createPromiseCapability)();return this.streamControllers[o].pullCall=e,d.postMessage({sourceName:l,targetName:h,stream:a.PULL,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,s.assert)(t instanceof Error,"cancel must have a valid reason");let e=(0,s.createPromiseCapability)();return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,d.postMessage({sourceName:l,targetName:h,stream:a.CANCEL,streamId:o,reason:n(t)}),e.promise}},i)}_createStreamSink(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,l=this,h=this.actionHandler[t.action],d={enqueue(t,n=1,l){if(this.isCancelled)return;let h=this.desiredSize;this.desiredSize-=n,h>0&&this.desiredSize<=0&&(this.sinkCapability=(0,s.createPromiseCapability)(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream
2:a.ENQUEUE,streamId:e,chunk:t},l)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:a.CLOSE,streamId:e}),delete l.streamSinks[e])},error(t){(0,s.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:a.ERROR,streamId:e,reason:n(t)}))},sinkCapability:(0,s.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[e]=d,new Promise(function(e){e(h(t.data,d))}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:a.START_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:r,stream:a.START_COMPLETE,streamId:e,reason:n(t)})})}_processStreamMessage(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,l=this.streamControllers[e],h=this.streamSinks[e];switch(t.stream){case a.START_COMPLETE:t.success?l.startCall.resolve():l.startCall.reject(n(t.reason));break;case a.PULL_COMPLETE:t.success?l.pullCall.resolve():l.pullCall.reject(n(t.reason));break;case a.PULL:if(!h){o.postMessage({sourceName:i,targetName:r,stream:a.PULL_COMPLETE,streamId:e,success:!0});break}h.desiredSize<=0&&t.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=t.desiredSize,new Promise(function(t){t(h.onPull&&h.onPull())}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:a.PULL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:r,stream:a.PULL_COMPLETE,streamId:e,reason:n(t)})});break;case a.ENQUEUE:if((0,s.assert)(l,"enqueue should have stream controller"),l.isClosed)break;l.controller.enqueue(t.chunk);break;case a.CLOSE:if((0,s.assert)(l,"close should have stream controller"),l.isClosed)break;l.isClosed=!0,l.controller.close(),this._deleteStreamController(l,e);break;case a.ERROR:(0,s.assert)(l,"error should have stream controller"),l.controller.error(n(t.reason)),this._deleteStreamController(l,e);break;case a.CANCEL_COMPLETE:t.success?l.cancelCall.resolve():l.cancelCall.reject(n(t.reason)),this._deleteStreamController(l,e);break;case a.CANCEL:if(!h)break;new Promise(function(e){e(h.onCancel&&h.onCancel(n(t.reason)))}).then(function(){o.postMessage({sourceName:i,targetName:r,stream:a.CANCEL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:r,stream:a.CANCEL_COMPLETE,streamId:e,reason:n(t)})}),h.sinkCapability.reject(n(t.reason)),h.isCancelled=!0,delete this.streamSinks[e];break;default:throw Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}e.MessageHandler=o},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var s=i(1);class r{#Z;#tt;constructor({parsedData:t,rawData:e}){this.#Z=t,this.#tt=e}getRaw(){return this.#tt}get(t){return this.#Z.get(t)??null}getAll(){return(0,s.objectFromMap)(this.#Z)}has(t){return this.#Z.has(t)}}e.Metadata=r},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var s=i(1);let r=Symbol("INTERNAL");class a{#te=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#te}_setVisible(t,e){t!==r&&(0,s.unreachable)("Internal method `_setVisible` called."),this.#te=e}}class n{#ti=!0;#ts=new Map;#tr=null;#ta=null;constructor(t){if(this.name=null,this.creator=null,null===t)return;for(let e of(this.name=t.name,this.creator=t.creator,this.#ta=t.order,t.groups))this.#ts.set(e.id,new a(e.name,e.intent));if("OFF"===t.baseState)for(let i of this.#ts.values())i._setVisible(r,!1);for(let s of t.on)this.#ts.get(s)._setVisible(r,!0);for(let n of t.off)this.#ts.get(n)._setVisible(r,!1);for(let[o,l]of(this.#tr=new Map,this.#ts))this.#tr.set(o,l.visible)}#tn(o){let l=o.length;if(l<2)return!0;let h=o[0];for(let d=1;d<l;d++){let c;let u=o[d];if(Array.isArray(u))c=this.#tn(u);else{if(!this.#ts.has(u))return(0,s.warn)(`Optional content group not found: ${u}`),!0;c=this.#ts.get(u).visible}switch(h){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return"And"===h}isVisible(t){if(0===this.#ts.size)return!0;
2if(!t)return(0,s.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return this.#ts.has(t.id)?this.#ts.get(t.id).visible:((0,s.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#tn(t.expression);if(t.policy&&"AnyOn"!==t.policy){if("AllOn"===t.policy){for(let e of t.ids){if(!this.#ts.has(e)){(0,s.warn)(`Optional content group not found: ${e}`);break}if(!this.#ts.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(let i of t.ids){if(!this.#ts.has(i))return(0,s.warn)(`Optional content group not found: ${i}`),!0;if(!this.#ts.get(i).visible)return!0}return!1}if("AllOff"===t.policy){for(let r of t.ids){if(!this.#ts.has(r)){(0,s.warn)(`Optional content group not found: ${r}`);break}if(this.#ts.get(r).visible)return!1}return!0}}else{for(let a of t.ids){if(!this.#ts.has(a))return(0,s.warn)(`Optional content group not found: ${a}`),!0;if(this.#ts.get(a).visible)return!0}return!1}return(0,s.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,s.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){if(!this.#ts.has(t)){(0,s.warn)(`Optional content group not found: ${t}`);return}this.#ts.get(t)._setVisible(r,!!e),this.#ti=null}get hasInitialVisibility(){if(null!==this.#ti)return this.#ti;for(let[t,e]of this.#ts){let i=this.#tr.get(t);if(e.visible!==i)return this.#ti=!1}return this.#ti=!0}getOrder(){return this.#ts.size?this.#ta?this.#ta.slice():[...this.#ts.keys()]:null}getGroups(){return this.#ts.size>0?(0,s.objectFromMap)(this.#ts):null}getGroup(t){return this.#ts.get(t)||null}}e.OptionalContentConfig=n},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var s=i(1),r=i(4);class a{constructor(t,e){(0,s.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=t.progressiveDone||!1,this._contentDispositionFilename=t.contentDispositionFilename||null;let i=t.initialData;if(i?.length>0){let r=new Uint8Array(i).buffer;this._queuedChunks.push(r)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._contentLength=t.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),this._pdfDataRangeTransport.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),this._pdfDataRangeTransport.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{let i=this._rangeReaders.some(function(i){return i._begin===t.begin&&(i._enqueue(e),!0)});(0,s.assert)(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){if(void 0===t.total){let e=this._rangeReaders[0];e?.onProgress&&e.onProgress({loaded:t.loaded})}else{let i=this._fullRequestReader;i?.onProgress&&i.onProgress({loaded:t.loaded,total:t.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,s.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new n(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=new o(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeReaders.slice(0)))e.cancel(t);this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=a;
2class n{constructor(t,e,i=!1,s=null){for(let a of(this._stream=t,this._done=i||!1,this._filename=(0,r.isPdfFile)(s)?s:null,this._queuedChunks=e||[],this._loaded=0,this._queuedChunks))this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){let e=this._requests.shift();e.resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.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){let t=this._queuedChunks.shift();return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=(0,s.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(t){for(let e of(this._done=!0,this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class o{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{let e=this._requests.shift();for(let i of(e.resolve({value:t,done:!1}),this._requests))i.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 t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=(0,s.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(t){for(let e of(this._done=!0,this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class i{static textContent(t){let e=[],s={items:e,styles:Object.create(null)};function r(t){if(!t)return;let s=null,a=t.name;if("#text"===a)s=t.value;else{if(!i.shouldBuildText(a))return;t?.attributes?.textContent?s=t.attributes.textContent:t.value&&(s=t.value)}if(null!==s&&e.push({str:s}),t.children)for(let n of t.children)r(n)}return r(t),s}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=i},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var s=i(5);let r=function(t){return new Promise((e,i)=>{let s=__webpack_require__(70172);s.readFile(t,(t,s)=>{if(t||!s){i(Error(t));return}e(new Uint8Array(s))})})};class a extends s.BaseCanvasFactory{_createCanvas(t,e){let i=__webpack_require__(93414);return i.createCanvas(t,e)}}e.NodeCanvasFactory=a;class n extends s.BaseCMapReaderFactory{_fetchData(t,e){return r(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=n;class o extends s.BaseStandardFontDataFactory{_fetchData(t){return r(t)}}e.NodeStandardFontDataFactory=o},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var s=i(1),r=i(9),a=i(4),n=i(23),o=i(24);class l{#to=!1;#tl=this.pointerup.bind(this);#th=this.pointerdown.bind(this);#td=new Map;#tc=!1;#tu=new WeakMap;#tp=new Map;#tg;#tm=new Set;static _initialized=!1;constructor(t){l._initialized||(l._initialized=!0,n.FreeTextEditor.initialize(t.l10n),o.InkEditor.initialize(t.l10n),t.uiManager.registerEditorTypes([n.FreeTextEditor,o.InkEditor])),this.#tg=t.uiManager,this.annotationStorage=t.annotationStorage,this.pageIndex=t.pageIndex,this.div=t.div,this.#tg.addLayer(this)}get textLayerElements(){let t=this.div.parentNode.getElementsByClassName("textLayer").item(0);if(!t)return(0,s.shadow)(this,"textLayerElements",null);let e=this.#tu.get(t);return e||(0===(e=t.querySelectorAll('span[role="presentation"]')).length?(0,s.shadow)(this,"textLayerElements",null):((e=Array.from(e)).sort(l.#tf),this.#tu.set(t,e),e))}get #tb(){return!!this.div.parentNode.querySelector(".textLayer .endOfContent")}updateToolbar(t){this.#tg.updateToolbar(t)}updateMode(t=this.#tg.getMode()){this.#tA(),t===s.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#tg.unselectAll()}addInkEditorIfNeeded(t){if(!t&&this.#tg.getMode()!==s.AnnotationEditorType.INK)return;if(!t){for(let e of this.#td.values())if(e.isEmpty()){e.setInBackgroun
2d();return}}let i=this.#ty({offsetX:0,offsetY:0});i.setInBackground()}setEditingState(t){this.#tg.setEditingState(t)}addCommands(t){this.#tg.addCommands(t)}enable(){for(let t of(this.div.style.pointerEvents="auto",this.#td.values()))t.enableEditing()}disable(){for(let t of(this.div.style.pointerEvents="none",this.#td.values()))t.disableEditing()}setActiveEditor(t){let e=this.#tg.getActive();e!==t&&this.#tg.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#th),this.div.addEventListener("pointerup",this.#tl)}disableClick(){this.div.removeEventListener("pointerdown",this.#th),this.div.removeEventListener("pointerup",this.#tl)}attach(t){this.#td.set(t.id,t)}detach(t){this.#td.delete(t.id),this.removePointerInTextLayer(t)}remove(t){this.#tg.removeEditor(t),this.detach(t),this.annotationStorage.removeKey(t.id),t.div.style.display="none",setTimeout(()=>{t.div.style.display="",t.div.remove(),t.isAttachedToDOM=!1,document.activeElement===document.body&&this.#tg.focusMainContainer()},0),this.#tc||this.addInkEditorIfNeeded(!1)}#tv(h){h.parent!==this&&(this.attach(h),h.pageIndex=this.pageIndex,h.parent?.detach(h),h.parent=this,h.div&&h.isAttachedToDOM&&(h.div.remove(),this.div.append(h.div)))}static #tf(d,c){let u=d.getBoundingClientRect(),p=c.getBoundingClientRect();if(u.y+u.height<=p.y)return -1;if(p.y+p.height<=u.y)return 1;let g=u.x+u.width/2,m=p.x+p.width/2;return g-m}onTextLayerRendered(){for(let t of(this.#tp.clear(),this.#tm))t.isAttachedToDOM&&this.addPointerInTextLayer(t);this.#tm.clear()}removePointerInTextLayer(t){if(!this.#tb){this.#tm.delete(t);return}let{id:e}=t,i=this.#tp.get(e);if(!i)return;this.#tp.delete(e);let s=i.getAttribute("aria-owns");s?.includes(e)&&((s=s.split(" ").filter(t=>t!==e).join(" "))?i.setAttribute("aria-owns",s):(i.removeAttribute("aria-owns"),i.setAttribute("role","presentation")))}addPointerInTextLayer(t){if(!this.#tb){this.#tm.add(t);return}this.removePointerInTextLayer(t);let e=this.textLayerElements;if(!e)return;let{contentDiv:i}=t,s=t.getIdForTextLayer(),r=(0,a.binarySearchFirstItem)(e,t=>0>l.#tf(i,t)),n=e[Math.max(0,r-1)],o=n.getAttribute("aria-owns");o?.includes(s)||n.setAttribute("aria-owns",o?`${o} ${s}`:s),n.removeAttribute("role"),this.#tp.set(s,n)}moveDivInDOM(t){this.addPointerInTextLayer(t);let{div:e,contentDiv:i}=t;if(!this.div.hasChildNodes()){this.div.append(e);return}let s=Array.from(this.div.childNodes).filter(t=>t!==e);if(0===s.length)return;let r=(0,a.binarySearchFirstItem)(s,t=>0>l.#tf(i,t));0===r?s[0].before(e):s[r-1].after(e)}add(t){if(this.#tv(t),this.addToAnnotationStorage(t),this.#tg.addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}this.moveDivInDOM(t),t.onceAdded()}addToAnnotationStorage(t){t.isEmpty()||this.annotationStorage.has(t.id)||this.annotationStorage.setValue(t.id,t)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){let e=()=>{this.addOrRebuild(t)},i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!0})}addUndoableEditor(t){let e=()=>{this.addOrRebuild(t)},i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getNextId(){return this.#tg.getId()}#t_(f){switch(this.#tg.getMode()){case s.AnnotationEditorType.FREETEXT:return new n.FreeTextEditor(f);case s.AnnotationEditorType.INK:return new o.InkEditor(f)}return null}deserialize(t){switch(t.annotationType){case s.AnnotationEditorType.FREETEXT:return n.FreeTextEditor.deserialize(t,this);case s.AnnotationEditorType.INK:return o.InkEditor.deserialize(t,this)}return null}#ty(b){let A=this.getNextId(),y=this.#t_({parent:this,id:A,x:b.offsetX,y:b.offsetY});return y&&this.add(y),y}setSelected(t){this.#tg.setSelected(t)}toggleSelected(t){this.#tg.toggleSelected(t)}isSelected(t){return this.#tg.isSelected(t)}unselect(t){this.#tg.unselect(t)}pointerup(t){let e=r.KeyboardManager.platform.isMac;if(0===t.button&&(!t.ctrlKey||!e)&&t.target===this.div){if(!this.#to){this.#to=!0;return}this.#ty(t)}}pointerdown(t){let e=r.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;let i=this.#tg.getActive();this.#to=!i||i.isEmpty()}drop(t){let e=t.dataTransfer.getData("text/plain"),i=this.#tg.getEditor(e);
2if(!i)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.#tv(i);let s=this.div.getBoundingClientRect(),r=t.clientX-s.x,a=t.clientY-s.y;i.translate(r-i.startX,a-i.startY),this.moveDivInDOM(i),i.div.focus()}dragover(t){t.preventDefault()}destroy(){for(let t of(this.#tg.getActive()?.parent===this&&this.#tg.setActiveEditor(null),this.#td.values()))this.removePointerInTextLayer(t),t.isAttachedToDOM=!1,t.div.remove(),t.parent=null;this.#tp.clear(),this.div=null,this.#td.clear(),this.#tm.clear(),this.#tg.removeLayer(this)}#tA(){for(let v of(this.#tc=!0,this.#td.values()))v.isEmpty()&&v.remove();this.#tc=!1}render(t){for(let e of(this.viewport=t.viewport,(0,r.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions(),this.#tg.getEditors(this.pageIndex)))this.add(e);this.updateMode()}update(t){this.viewport=t.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){let[t,e,i,s]=this.viewport.viewBox,r=i-t,a=s-e;return[r,a]}get viewportBaseDimensions(){let{width:t,height:e,rotation:i}=this.viewport;return i%180==0?[t,e]:[e,t]}setDimensions(){let{width:t,height:e,rotation:i}=this.viewport,s=i%180!=0,r=Math.floor(t)+"px",a=Math.floor(e)+"px";this.div.style.width=s?a:r,this.div.style.height=s?r:a,this.div.setAttribute("data-main-rotation",i)}}e.AnnotationEditorLayer=l},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var s=i(1),r=i(9),a=i(8);class n extends a.AnnotationEditor{#tS=this.editorDivBlur.bind(this);#tx=this.editorDivFocus.bind(this);#tC=this.editorDivKeydown.bind(this);#tE;#tT="";#tP="";#tM=!1;#tk;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new r.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],n.prototype.commitOrRemove]]);constructor(t){super({...t,name:"freeTextEditor"}),this.#tE=t.color||n._defaultColor||a.AnnotationEditor._defaultLineColor,this.#tk=t.fontSize||n._defaultFontSize}static initialize(t){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_aria_label"].map(e=>[e,t.get(e)]));let e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case s.AnnotationEditorParamsType.FREETEXT_SIZE:n._defaultFontSize=e;break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:n._defaultColor=e}}updateParams(t,e){switch(t){case s.AnnotationEditorParamsType.FREETEXT_SIZE:this.#tw(e);break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:this.#tR(e)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,n._defaultFontSize],[s.AnnotationEditorParamsType.FREETEXT_COLOR,n._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,this.#tk],[s.AnnotationEditorParamsType.FREETEXT_COLOR,this.#tE]]}#tw(o){let l=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#tk)*this.parent.scaleFactor),this.#tk=t,this.#tF()},h=this.#tk;this.parent.addCommands({cmd(){l(o)},undo(){l(h)},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#tR(d){let c=this.#tE;this.parent.addCommands({cmd:()=>{this.#tE=d,this.editorDiv.style.color=d},undo:()=>{this.#tE=c,this.editorDiv.style.color=c},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){return[-n._internalPadding*this.parent.scaleFactor,-(n._internalPadding+this.#tk)*this.parent.scaleFactor]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(s.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.editorDiv.addEventListener("keydown",this.#tC),this.editorDiv.addEventListener("focus",this.#tx),this.editorDiv.addEventListener("blur",this.#tS))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#tC),this.editorDiv.removeEventListener("focus",this.#tx),this.editorDiv.removeEventListener("blur",this.#tS),this.div.focus(),this.isEditing=!1)}focusin(t){super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),super.remove()}#tO(){let u=this.editorDiv.getElementsByTagName("div");if(0===u.length)return this.editorDiv.innerText;let p=[];for(let g=0,m=u.length;g<m;g++){let f=u[g],b=f.firstChild;b?.nodeName==="#text"?p.push(b.data):p.push("")}return p.join("\n")}#tF(){let[A,y]=this.parent.viewportBaseDimensions,v=this.div.getBoundingClientRect();this.width=v.width/A,this.height=v.height/y}commit(){super.commit(),this.#tM||(this.#tM=!0,this.parent.addUndoableEditor(this)),this.disableEditMode(),this.#tP=this.editorDiv.innerHTML,this.#tT=this.#tO().trimEnd(),this.#tF()}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(t){n._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}getIdForTextLayer(){return this.editorDiv.id}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",`${this.id}-editor`),this.enableEditing(),n._l10nPromise.get("editor_free_text_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),n._l10nPromise.get("free_text_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#tk}px * var(--scale-factor))`,i.color=this.#tE,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,r.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[s,a]=this.parent.viewportBaseDimensions;this.setAt(t*s,e*a,this.width*s,this.height*a),this.editorDiv.innerHTML=this.#tP,this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e){let i=super.deserialize(t,e);return i.#tk=t.fontSize,i.#tE=s.Util.makeHexColor(...t.color),i.#tT=t.value,i.#tP=t.value.split("\n").map(t=>`<div>${t}</div>`).join(""),i}serialize(){if(this.isEmpty())return null;let t=n._internalPadding*this.parent.scaleFactor,e=this.getRect(t,t),i=a.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:s.AnnotationEditorType.FREETEXT,color:i,fontSize:this.#tk,value:this.#tT,pageIndex:this.parent.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=n},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});var s=i(1),r=i(8),a=i(25),n=i(9);let o=16;class l extends r.AnnotationEditor{#tI=0;#tD=0;#tL=0;#tN=this.canvasPointermove.bind(this);#tj=this.canvasPointerleave.bind(this);#tU=this.canvasPointerup.bind(this);#tB=this.canvasPointerdown.bind(this);#tz=!1;#tq=!1;#tW=null;#tH=null;#tG=0;#tV=0;#t$=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink_aria_label"].map(e=>[e,t.get(e)]))}static updateDefaultParams(t,e){switch(t){case s.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=e;break;case s.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=e;break;case s.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=e/100}}updateParams(t,e){switch(t){case s.AnnotationEditorParamsType.INK_THICKNESS:this.#tX(e);break;case s.AnnotationEditorParamsType.INK_COLOR:this.#tR(e);break;case s.AnnotationEditorParamsType.INK_OPACITY:this.#tY(e)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||r.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||r.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#tX(h){let d=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=h,this.#tK()},undo:()=>{this.thickness=d,this.#tK()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#tR(c){let u=this.color;this.parent.addCommands({cmd:()=>{this.color=c,this.#tJ()},undo:()=>{this.color=u,this.#tJ()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#tY(p){p/=100;let g=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=p,this.#tJ()},undo:()=>{this.opacity=g,this.#tJ()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#tQ(),this.#tZ()),this.isAttachedToDOM||(this.parent.add(this),this.#t0()),this.#tK())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#tH.disconnect(),this.#tH=null,super.remove())}enableEditMode(){this.#tz||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#tB),this.canvas.addEventListener("pointerup",this.#tU))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#tB),this.canvas.removeEventListener("pointerup",this.#tU))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#t1(){let{width:m,height:f,rotation:b}=this.parent.viewport;switch(b){case 90:return[0,m,m,f];case 180:return[m,f,m,f];case 270:return[f,0,m,f];default:return[0,0,m,f]}}#t2(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.miterLimit=10,this.ctx.strokeStyle=`${this.color}${(0,n.opacityToHex)(this.opacity)}`}#t3(A,y){this.isEditing=!0,this.#tq||(this.#tq=!0,this.#t0(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||r.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([A,y]),this.#tW=null,this.#t2(),this.ctx.beginPath(),this.ctx.moveTo(A,y),this.#t$=()=>{this.#t$&&(this.#tW&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):this.#tJ(),this.ctx.lineTo(...this.#tW),this.#tW=null,this.ctx.stroke()),window.requestAnimationFrame(this.#t$))},window.requestAnimationFrame(this.#t$)}#t5(v,_){let[S,x]=this.currentPath.at(-1);(v!==S||_!==x)&&(this.currentPath.push([v,_]),this.#tW=[v,_])}#t4(C,E){let T;this.ctx.closePath(),this.#t$=null,C=Math.min(Math.max(C,0),this.canvas.width),E=Math.min(Math.max(E,0),this.canvas.height);let[P,M]=this.currentPath.at(-1);if((C!==P||E!==M)&&this.currentPath.push([C,E]),1!==this.currentPath.length)T=(0,a.fitCurve)(this.currentPath,30,null);else{let k=[C,E];T=[[k,k.slice(),k.slice(),k]]}let w=l.#t8(T);this.currentPath.length=0;let R=()=>{this.paths.push(T),this.bezierPath2D.push(w),this.rebuild()},F=()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#tQ(),this.#tZ()),this.#tK())};this.parent.addCommands({cmd:R,undo:F,mustExec:!0})}#tJ(){if(this.isEmpty()){this.#t6();return}this.#t2();let{canvas:O,ctx:I}=this;for(let D of(I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,O.width,O.height),this.#t6(),this.bezierPath2D))I.stroke(D)}commit(){this.#tz||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#tz=!0,this.div.classList.add("disabled"),this.#tK(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveDivInDOM(this),this.div.focus())}focusin(t){super.focusin(t),this.enableEditMode()}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#tz&&(this.setInForeground(),"mouse"!==t.type&&this.div.focus(),t.stopPropagation(),this.canvas.addEventListener("pointerleave",this.#tj),this.canvas.addEventListener("pointermove",this.#tN),this.#t3(t.offsetX,t.offsetY))}canvasPointermove(t){t.stopPropagation(),this.#t5(t.offsetX,t.offsetY)}canvasPointerup(t){0===t.button&&this.isInEditMode()&&0!==this.currentPath.length&&(t.stopPropagation(),this.#t7(t),this.setInBackgroun
2d())}canvasPointerleave(t){this.#t7(t),this.setInBackground()}#t7(L){this.#t4(L.offsetX,L.offsetY),this.canvas.removeEventListener("pointerleave",this.#tj),this.canvas.removeEventListener("pointermove",this.#tN),this.parent.addToAnnotationStorage(this)}#tQ(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#tZ(){this.#tH=new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#tH.observe(this.div)}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),l._l10nPromise.get("editor_ink_aria_label").then(t=>this.div?.setAttribute("aria-label",t));let[i,s,r,a]=this.#t1();if(this.setAt(i,s,0,0),this.setDims(r,a),this.#tQ(),this.width){let[n,o]=this.parent.viewportBaseDimensions;this.setAt(t*n,e*o,this.width*n,this.height*o),this.#tq=!0,this.#t0(),this.setDims(this.width*n,this.height*o),this.#tJ(),this.#t9(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#tZ(),this.div}#t0(){if(!this.#tq)return;let[N,j]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*N),this.canvas.height=Math.ceil(this.height*j),this.#t6()}setDimensions(t,e){let i=Math.round(t),s=Math.round(e);if(this.#tG===i&&this.#tV===s)return;this.#tG=i,this.#tV=s,this.canvas.style.visibility="hidden",this.#tI&&Math.abs(this.#tI-t/e)>.01&&(e=Math.ceil(t/this.#tI),this.setDims(t,e));let[r,a]=this.parent.viewportBaseDimensions;this.width=t/r,this.height=e/a,this.#tz&&this.#et(t,e),this.#t0(),this.#tJ(),this.canvas.style.visibility="visible"}#et(U,B){let z=this.#ee(),q=(U-z)/this.#tL,W=(B-z)/this.#tD;this.scaleFactor=Math.min(q,W)}#t6(){let H=this.#ee()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+H,this.translationY*this.scaleFactor+H)}static #t8(G){let V=new Path2D;for(let $=0,X=G.length;$<X;$++){let[Y,K,J,Q]=G[$];0===$&&V.moveTo(...Y),V.bezierCurveTo(K[0],K[1],J[0],J[1],Q[0],Q[1])}return V}#ei(Z,tt,te,ti){let ts,tr;let ta=4,tn=[],to=this.thickness/2;for(let tl of this.paths){ts=[],tr=[];for(let th=0,td=tl.length;th<td;th++){let[tc,tu,tp,tg]=tl[th],tm=Z*(tc[0]+tt)+to,tf=ti-Z*(tc[1]+te)-to,tb=Z*(tu[0]+tt)+to,tA=ti-Z*(tu[1]+te)-to,ty=Z*(tp[0]+tt)+to,tv=ti-Z*(tp[1]+te)-to,t_=Z*(tg[0]+tt)+to,tS=ti-Z*(tg[1]+te)-to;0===th&&(ts.push(tm,tf),tr.push(tm,tf)),ts.push(tb,tA,ty,tv,t_,tS),this.#es(tm,tf,tb,tA,ty,tv,t_,tS,ta,tr)}tn.push({bezier:ts,points:tr})}return tn}#es(tx,tC,tE,tT,tP,tM,tk,tw,tR,tF){if(this.#er(tx,tC,tE,tT,tP,tM,tk,tw)){tF.push(tk,tw);return}for(let tO=1;tO<tR-1;tO++){let tI=tO/tR,tD=1-tI,tL=tI*tx+tD*tE,tN=tI*tC+tD*tT,tj=tI*tE+tD*tP,tU=tI*tT+tD*tM,tB=tI*tP+tD*tk,tz=tI*tM+tD*tw;tL=tI*tL+tD*tj,tN=tI*tN+tD*tU,tj=tI*tj+tD*tB,tU=tI*tU+tD*tz,tL=tI*tL+tD*tj,tN=tI*tN+tD*tU,tF.push(tL,tN)}tF.push(tk,tw)}#er(tq,tW,tH,tG,tV,t$,tX,tY){let tK=10,tJ=(3*tH-2*tq-tX)**2,tQ=(3*tG-2*tW-tY)**2,tZ=(3*tV-tq-2*tX)**2,t0=(3*t$-tW-2*tY)**2;return Math.max(tJ,tZ)+Math.max(tQ,t0)<=tK}#ea(){let t1=1/0,t2=-1/0,t3=1/0,t5=-1/0;for(let t4 of this.paths)for(let[t8,t6,t7,t9]of t4){let et=s.Util.bezierBoundingBox(...t8,...t6,...t7,...t9);
2t1=Math.min(t1,et[0]),t3=Math.min(t3,et[1]),t2=Math.max(t2,et[2]),t5=Math.max(t5,et[3])}return[t1,t3,t2,t5]}#ee(){return this.#tz?Math.ceil(this.thickness*this.parent.scaleFactor):0}#tK(ee=!1){if(this.isEmpty())return;if(!this.#tz){this.#tJ();return}let ei=this.#ea(),es=this.#ee();this.#tL=Math.max(o,ei[2]-ei[0]),this.#tD=Math.max(o,ei[3]-ei[1]);let er=Math.ceil(es+this.#tL*this.scaleFactor),ea=Math.ceil(es+this.#tD*this.scaleFactor),[en,eo]=this.parent.viewportBaseDimensions;this.width=er/en,this.height=ea/eo,this.#tI=er/ea,this.#t9();let el=this.translationX,eh=this.translationY;this.translationX=-ei[0],this.translationY=-ei[1],this.#t0(),this.#tJ(),this.#tG=er,this.#tV=ea,this.setDims(er,ea);let ed=ee?es/this.scaleFactor/2:0;this.translate(el-this.translationX-ed,eh-this.translationY-ed)}#t9(){let{style:ec}=this.div;this.#tI>=1?(ec.minHeight=`${o}px`,ec.minWidth=`${Math.round(this.#tI*o)}px`):(ec.minWidth=`${o}px`,ec.minHeight=`${Math.round(o/this.#tI)}px`)}static deserialize(t,e){let i=super.deserialize(t,e);i.thickness=t.thickness,i.color=s.Util.makeHexColor(...t.color),i.opacity=t.opacity;let[r,a]=e.pageDimensions,n=i.width*r,o=i.height*a,l=e.scaleFactor,h=t.thickness/2;for(let{bezier:d}of(i.#tI=n/o,i.#tz=!0,i.#tG=Math.round(n),i.#tV=Math.round(o),t.paths)){let c=[];i.paths.push(c);let u=l*(d[0]-h),p=l*(o-d[1]-h);for(let g=2,m=d.length;g<m;g+=6){let f=l*(d[g]-h),b=l*(o-d[g+1]-h),A=l*(d[g+2]-h),y=l*(o-d[g+3]-h),v=l*(d[g+4]-h),_=l*(o-d[g+5]-h);c.push([[u,p],[f,b],[A,y],[v,_]]),u=v,p=_}let S=this.#t8(c);i.bezierPath2D.push(S)}let x=i.#ea();return i.#tL=x[2]-x[0],i.#tD=x[3]-x[1],i.#et(n,o),i}serialize(){if(this.isEmpty())return null;let t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],i=r.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:s.AnnotationEditorType.INK,color:i,thickness:this.thickness,opacity:this.opacity,paths:this.#ei(this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,e),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=l},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fitCurve=void 0;let s=i(26);e.fitCurve=s},t=>{function e(t,e,s){if(!Array.isArray(t))throw TypeError("First argument should be an array");if(t.forEach(e=>{if(!Array.isArray(e)||e.some(t=>"number"!=typeof t)||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),(t=t.filter((e,i)=>0===i||!e.every((e,s)=>e===t[i-1][s]))).length<2)return[];let r=t.length,a=c(t[1],t[0]),n=c(t[r-2],t[r-1]);return i(t,a,n,e,s)}function i(t,e,r,n,l){var h,d,c,p,g,m,f,b,A,y,v,_,S;let x=20;if(2===t.length)return _=u.vectorLen(u.subtract(t[0],t[1]))/3,[h=[t[0],u.addArrays(t[0],u.mulItems(e,_)),u.addArrays(t[1],u.mulItems(r,_)),t[1]]];if(d=o(t),[h,p,m]=s(t,d,d,e,r,l),0===p||p<n)return[h];if(p<n*n)for(S=0,c=d,g=p,f=m;S<x;S++){if(c=a(h,t,c),[h,p,m]=s(t,d,c,e,r,l),p<n)return[h];if(m===f){let C=p/g;if(C>.9999&&C<1.0001)break}g=p,f=m}return v=[],(b=u.subtract(t[m-1],t[m+1])).every(t=>0===t)&&(b=u.subtract(t[m-1],t[m]),[b[0],b[1]]=[-b[1],b[0]]),A=u.normalize(b),y=u.mulItems(A,-1),v=(v=v.concat(i(t.slice(0,m+1),e,A,n,l))).concat(i(t.slice(m),y,r,n,l))}function s(t,e,i,s,a,n){var o,h,d;return o=r(t,i,s,a,n),[h,d]=l(t,o,e),n&&n({bez:o,points:t,params:e,maxErr:h,maxPoint:d}),[o,h,d]}function r(t,e,i,s){var r,a,n,o,l,h,d,c,g,m,f,b,A,y,v,_,S,x=t[0],C=t[t.length-1];for(A=0,r=[x,null,null,C],a=u.zeros_Xx2x2(e.length),y=e.length;A<y;A++)S=1-(_=e[A]),(n=a[A])[0]=u.mulItems(i,3*_*(S*S)),n[1]=u.mulItems(s,3*S*(_*_));for(A=0,o=[[0,0],[0,0]],l=[0,0],y=t.length;A<y;A++)_=e[A],n=a[A],o[0][0]+=u.dot(n[0],n[0]),o[0][1]+=u.dot(n[0],n[1]),o[1][0]+=u.dot(n[0],n[1]),o[1][1]+=u.dot(n[1],n[1]),v=u.subtract(t[A],p.q([x,x,C,C],_)),l[0]+=u.dot(n[0],v),l[1]+=u.dot(n[1],v);return h=o[0][0]*o[1][1]-o[1][0]*o[0][1],d=o[0][0]*l[1]-o[1][0]*l[0],c=l[0]*o[1][1]-l[1]*o[0][1],g=0===h?0:c/h,m=0===h?0:d/h,g<(f=1e-6*(b=u.vectorLen(u.subtract(x,C))))||m<f?(r[1]=u.addArrays(x,u.mulItems(i,b/3)),r[2]=u.addArrays(C,u.mulItems(s,b/3))):(r[1]=u.addArrays(x,u.mulItems(i,g)),r[2]=u.addArrays(C,u.mulItems(s,m))),r}function a(t,e,i){return i.map((i,s)=>n(t,e[s],i))}function n(t,e,i){var s=u.subtract(p.q(t,i),e),r=p.qprime(t,i),a=u.mulMatrix(s,r),n=u.sum(u.squareItems(r))+2*u.mulMatrix(s,p.qprimeprime(t,i));return 0===n?i:i-a/n}function o(t){var e,i,s,r=[];return t.forEach((t,a)=>{e=a?i+u.vectorLen(u.subtract(t,s)):0,r.push(e),i=e,s=t}),r=r.map(t=>t/i)}function l(t,e,i){var s,r,a,n,o,l,c,g;r=0,a=Math.floor(t.length/2);let m=h(e,10);for(o=0,l=t.length;o<l;o++)c=t[o],g=d(e,i[o],m,10),(s=(n=u.subtract(p.q(e,g),c))[0]*n[0]+n[1]*n[1])>r&&(r=s,a=o);return[r,a]}var h=function(t,e){for(var i,s=[0],r=t[0],a=0,n=1;n<=e;n++)i=p.q(t,n/e),s.push(a+=u.vectorLen(u.subtract(i,r))),r=i;return s.map(t=>t/a)};function d(t,e,i,s){if(e<0)return 0;if(e>1)return 1;for(var r,a,n,o,l=1;l<=s;l++)if(e<=i[l]){n=(l-1)/s,a=l/s,o=(e-(r=i[l-1]))/(i[l]-r)*(a-n)+n;break}return o}function c(t,e){return u.normalize(u.subtract(t,e))}class u{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map(t=>t*e)}static mulMatrix(t,e){return t.reduce((t,i,s)=>t+i*e[s],0)}static subtract(t,e){return t.map((t,i)=>t-e[i])}static addArrays(t,e){return t.map((t,i)=>t+e[i])}static addItems(t,e){return t.map(t=>t+e)}static sum(t){return t.reduce((t,e)=>t+e)}static dot(t,e){return u.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map(t=>t/e)}static squareItems(t){return t.map(t=>t*t)}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class p{static q(t,e){var i=1-e,s=u.mulItems(t[0],i*i*i),r=u.mulItems(t[1],3*i*i*e),a=u.mulItems(t[2],3*i*e*e),n=u.mulItems(t[3],e*e*e);return u.addArrays(u.addArrays(s,r),u.addArrays(a,n))}static qprime(t,e){var i=1-e,s=u.mulItems(u.subtract(t[1],t[0]),3*i*i),r=u.mulItems(u.subtract(t[2],t[1]),6*i*e),a=u.mulItems(u.subtract(t[3],t[2]),3*e*e);return u.addArrays(u.addArrays(s,r),a)}static qprimeprime(t,e){return u.addArrays(u.mulItems(u.addArrays(u.subtract(t[2],u.mulItems(t[1],2)),t[0]),6*(1-e)),u.mulItems(u.addArrays(u.subtract(t[3],u.mulItems(t[2],2)),t[1]),6*e))}}t.exports=e,t.exports.fitCubic=i,t.exports.createTangent=c},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var s=i(1),r=i(4),a=i(7),n=i(28),o=i(29);let l=1e3,h=9,d=new WeakSet;function c(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class u{static create(t){let e=t.data.annotationType;switch(e){case s.AnnotationType.LINK:return new g(t);case s.AnnotationType.TEXT:return new m(t);case s.AnnotationType.WIDGET:let i=t.data.fieldType;switch(i){case"Tx":return new b(t);case"Btn":if(t.data.radioButton)return new y(t);if(t.data.checkBox)return new A(t);return new v(t);case"Ch":return new _(t)}return new f(t);case s.AnnotationType.POPUP:return new S(t);case s.AnnotationType.FREETEXT:return new C(t);case s.AnnotationType.LINE:return new E(t);case s.AnnotationType.SQUARE:return new T(t);case s.AnnotationType.CIRCLE:return new P(t);case s.AnnotationType.POLYLINE:return new M(t);case s.AnnotationType.CARET:return new w(t);case s.AnnotationType.INK:return new R(t);case s.AnnotationType.POLYGON:return new k(t);case s.AnnotationType.HIGHLIGHT:return new F(t);case s.AnnotationType.UNDERLINE:return new O(t);case s.AnnotationType.SQUIGGLY:return new I(t);case s.AnnotationType.STRIKEOUT:return new D(t);case s.AnnotationType.STAMP:return new L(t);case s.AnnotationType.FILEATTACHMENT:return new N(t);default:return new p(t)}}}class p{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this._mouseState=t.mouseState,e&&(this.container=this._createContainer(i)),s&&(this.quadrilaterals=this._createQuadrilaterals(i))}_createContainer(t=!1){let e=this.data,i=this.page,r=this.viewport,a=document.createElement("section"),{width:n,height:o}=c(e.rect),[l,h,d,u]=r.viewBox,p=d-l,g=u-h;a.setAttribute("data-annotation-id",e.id);let m=s.Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth=`${e.borderStyle.width}px`;let f=e.borderStyle.horizontalCornerRadius,b=e.borderStyle.verticalCornerRadius;if(f>0||b>0){let A=`calc(${f}px * var(--scale-factor)) / calc(${b}px * var(--scale-factor))`;a.style.borderRadius=A}switch(e.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}let y=e.borderColor||null;y?a.style.borderColor=s.Util.makeHexColor(0|y[0],0|y[1],0|y[2]):a.style.borderWidth=0}a.style.left=`${100*(m[0]-l)/p}%`,a.style.top=`${100*(m[1]-h)/g}%`;let{rotation:v}=e;return e.hasOwnCanvas||0===v?(a.style.width=`${100*n/p}%`,a.style.height=`${100*o/g}%`):this.setRotation(v,a),a}setRotation(t,e=this.container){let i,s;let[r,a,n,o]=this.viewport.viewBox,l=n-r,h=o-a,{width:d,height:u}=c(this.data.rect);t%180==0?(i=100*d/l,s=100*u/h):(i=100*u/l,s=100*d/h),e.style.width=`${i}%`,e.style.height=`${s}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(t,e,i)=>{let s=i.detail[t];i.target.style[e]=n.ColorConverters[`${s[0]}_HTML`](s.slice(1))};return(0,s.shadow)(this,"_commonActions",{display:t=>{let e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus(t){setTimeout(()=>
2t.target.focus({preventScroll:!1}),0)},userName(t){t.target.title=t.detail.userName},readonly(t){t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor(e){t("bgColor","backgroundColor",e)},fillColor(e){t("fillColor","backgroundColor",e)},fgColor(e){t("fgColor","color",e)},textColor(e){t("textColor","color",e)},borderColor(e){t("borderColor","borderColor",e)},strokeColor(e){t("strokeColor","borderColor",e)},rotation:t=>{let e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){let i=this._commonActions;for(let s of Object.keys(e.detail)){let r=t[s]||i[s];r&&r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let i=this._commonActions;for(let[s,r]of Object.entries(e)){let a=i[s];a&&(a({detail:r,target:t}),delete e[s])}}_createQuadrilaterals(t=!1){if(!this.data.quadPoints)return null;let e=[],i=this.data.rect;for(let s of this.data.quadPoints)this.data.rect=[s[2].x,s[2].y,s[1].x,s[1].y],e.push(this._createContainer(t));return this.data.rect=i,e}_createPopup(t,e){let i=this.container;this.quadrilaterals&&(t=t||this.quadrilaterals,i=this.quadrilaterals[0]),t||((t=document.createElement("div")).className="popupTriggerArea",i.append(t));let s=new x({container:i,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}),r=s.render();r.style.left="100%",i.append(r)}_renderQuadrilaterals(t){for(let e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){let i=[];if(this._fieldObjects){let r=this._fieldObjects[t];if(r)for(let{page:a,id:n,exportValues:o}of r){if(-1===a||n===e)continue;let l="string"==typeof o?o:null,h=document.querySelector(`[data-element-id="${n}"]`);if(h&&!d.has(h)){(0,s.warn)(`_getElementsByName - element not allowed: ${n}`);continue}i.push({id:n,exportValue:l,domElement:h})}return i}for(let c of document.getElementsByName(t)){let{id:u,exportValue:p}=c;u!==e&&d.has(c)&&i.push({id:u,exportValue:p,domElement:c})}return i}static get platform(){let t="undefined"!=typeof navigator?navigator.platform:"";return(0,s.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}class g extends p{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let s=!1;return(t.url?(e.addLinkAttributes(i,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(i,t.action),s=!0):t.dest?(this._bindLink(i,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),s=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.quadrilaterals)?this._renderQuadrilaterals("linkAnnotation").map((t,e)=>{let s=0===e?i:i.cloneNode();return t.append(s),t}):(this.container.className="linkAnnotation",s&&this.container.append(i),this.container)}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&(t.className="internalLink")}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),t.className="internalLink"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let s of Object.keys(e.actions)){let r=i.get(s);r&&(t[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),t.className="internalLink"}_bindResetFormAction(t,e){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),t.className="internalLink",!this._fieldObjects){(0,s.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i&&i();let{fields:t,refs:r,include:a}=e,n=[];if(0!==t.length||0!==r.length){let o=new Set(r);for(let l of t){let h=this._fieldObjects[l]||[];for(let{id:c}of h)o.add(c)}for(let u of Object.values(this._fieldObjects))for(let p of u)o.has(p.id)===a&&n.push(p)}else for(let g of Object.values(this._fieldObjects))n.push(...g);
2let m=this.annotationStorage,f=[];for(let b of n){let{id:A}=b;switch(f.push(A),b.type){case"text":{let y=b.defaultValue||"";m.setValue(A,{value:y});break}case"checkbox":case"radiobutton":{let v=b.defaultValue===b.exportValues;m.setValue(A,{value:v});break}case"combobox":case"listbox":{let _=b.defaultValue||"";m.setValue(A,{value:_});break}default:continue}let S=document.querySelector(`[data-element-id="${A}"]`);if(S){if(!d.has(S)){(0,s.warn)(`_bindResetFormAction - element not allowed: ${A}`);continue}S.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}}),!1}}}class m extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e})}render(){this.container.className="textAnnotation";let t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(t,this.data),this.container.append(t),this.container}}class f extends p{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(t){let{isWin:e,isMac:i}=p.platform;return e&&t.ctrlKey||i&&t.metaKey}_setEventListener(t,e,i,s){e.includes("mouse")?t.addEventListener(e,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(e,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t)}})})}_setEventListeners(t,e,i){for(let[s,r]of e)("Action"===r||this.data.actions?.[r])&&this._setEventListener(t,s,r,i)}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":s.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e;let i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||h,n=t.style;if(this.data.multiLine){let o=Math.abs(this.data.rect[3]-this.data.rect[1]),l=Math.round(o/(s.LINE_FACTOR*a))||1,d=o/l;e=Math.min(a,Math.round(d/s.LINE_FACTOR))}else{let c=Math.abs(this.data.rect[3]-this.data.rect[1]);e=Math.min(a,Math.round(c/s.LINE_FACTOR))}n.fontSize=`calc(${e}px * var(--scale-factor))`,n.color=s.Util.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(n.textAlign=i[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class b extends f{constructor(t){let e=t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,i,s){let r=this.annotationStorage;
2for(let a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),r.setValue(a.id,{[s]:i})}render(){let t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let i=null;if(this.renderForms){let s=t.getValue(e,{value:this.data.fieldValue}),r=s.formattedValue||s.value||"",a={userValue:r,formattedValue:null,valueOnFocus:""};this.data.multiLine?((i=document.createElement("textarea")).textContent=r,this.data.doNotScroll&&(i.style.overflowY="hidden")):((i=document.createElement("input")).type="text",i.setAttribute("value",r),this.data.doNotScroll&&(i.style.overflowX="hidden")),d.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=l,this._setRequired(i,this.data.required),i.addEventListener("input",s=>{t.setValue(e,{value:s.target.value}),this.setPropertyOnSiblings(i,"value",s.target.value,"value")}),i.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue??"";i.value=a.userValue=e,a.formattedValue=null});let n=t=>{let{formattedValue:e}=a;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{a.userValue&&(t.target.value=a.userValue),a.valueOnFocus=t.target.value}),i.addEventListener("updatefromsandbox",i=>{let s={value(i){a.userValue=i.detail.value??"",t.setValue(e,{value:a.userValue.toString()}),i.target.value=a.userValue},formattedValue(i){let{formattedValue:s}=i.detail;a.formattedValue=s,null!=s&&i.target!==document.activeElement&&(i.target.value=s),t.setValue(e,{formattedValue:s})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)}};this._dispatchEventFromSandbox(s,i)}),i.addEventListener("keydown",t=>{let i=-1;if("Escape"===t.key?i=0:"Enter"===t.key?i=2:"Tab"===t.key&&(i=3),-1===i)return;let{value:s}=t.target;a.valueOnFocus!==s&&(a.userValue=s,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let o=n;n=null,i.addEventListener("blur",t=>{let{value:i}=t.target;a.userValue=i,this._mouseState.isDown&&a.valueOnFocus!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),o(t)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",t=>{let{data:i,target:s}=t,{value:r,selectionStart:a,selectionEnd:n}=s,o=a,l=n;switch(t.inputType){case"deleteWordBackward":{let h=r.substring(0,a).match(/\w*[^\w]*$/);h&&(o-=h[0].length);break}
2case"deleteWordForward":{let d=r.substring(a).match(/^[^\w]*\w*/);d&&(l+=d[0].length);break}case"deleteContentBackward":a===n&&(o-=1);break;case"deleteContentForward":a===n&&(l+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:i||"",willCommit:!1,selStart:o,selEnd:l}})}),this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(n&&i.addEventListener("blur",n),null!==this.data.maxLen&&(i.maxLength=this.data.maxLen),this.data.comb){let h=this.data.rect[2]-this.data.rect[0],c=h/this.data.maxLen;i.classList.add("comb"),i.style.letterSpacing=`calc(${c}px * var(--scale-factor) - 1ch)`}}else(i=document.createElement("div")).textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell";return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class A extends f{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,i=e.id,s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof s&&(s="Off"!==s,t.setValue(i,{value:s})),this.container.className="buttonWidgetAnnotation checkBox";let r=document.createElement("input");return d.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=l,r.addEventListener("change",s=>{let{name:r,checked:a}=s.target;for(let n of this._getElementsByName(r,i)){let o=a&&n.exportValue===e.exportValue;n.domElement&&(n.domElement.checked=o),t.setValue(n.id,{value:o})}t.setValue(i,{value:a})}),r.addEventListener("resetform",t=>{let i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",e=>{let s={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class y extends f{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";let t=this.annotationStorage,e=this.data,i=e.id,s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;"string"==typeof s&&(s=s!==e.buttonValue,t.setValue(i,{value:s}));let r=document.createElement("input");if(d.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.tabIndex=l,r.addEventListener("change",e=>{let{name:s,checked:r}=e.target;for(let a of this._getElementsByName(s,i))t.setValue(a.id,{value:!1});t.setValue(i,{value:r})}),r.addEventListener("resetform",t=>{let i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){let a=e.buttonValue;r.addEventListener("updatefromsandbox",e=>{let s={value:e=>{let s=a===e.detail.value;for(let r of this._getElementsByName(e.target.name)){let n=s&&r.id===i;r.domElement&&(r.domElement.checked=n),t.setValue(r.id,{value:n})}}};this._dispatchEventFromSandbox(s,e)}),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class v extends g{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(t.title=this.data.alternativeText);let e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class _ extends f{constructor(t){super(t,{isRenderable:t.renderForms})}
2render(){this.container.className="choiceWidgetAnnotation";let t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),s=document.createElement("select");d.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=l;let r=this.data.combo&&this.data.options.length>0;for(let a of(!this.data.combo&&(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue;for(let i of s.options)i.selected=i.value===e}),this.data.options)){let n=document.createElement("option");n.textContent=a.displayValue,n.value=a.exportValue,i.value.includes(a.exportValue)&&(n.setAttribute("selected",!0),r=!1),s.append(n)}let o=null;if(r){let h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),s.prepend(h),o=()=>{h.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}let c=(t,e)=>{let i=e?"value":"textContent",s=t.target.options;return t.target.multiple?Array.prototype.filter.call(s,t=>t.selected).map(t=>t[i]):-1===s.selectedIndex?null:s[s.selectedIndex][i]},u=t=>{let e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",i=>{let r={value(i){o?.();let r=i.detail.value,a=new Set(Array.isArray(r)?r:[r]);for(let n of s.options)n.selected=a.has(n.value);t.setValue(e,{value:c(i,!0)})},multipleSelection(t){s.multiple=!0},remove(i){let r=s.options,a=i.detail.remove;if(r[a].selected=!1,s.remove(a),r.length>0){let n=Array.prototype.findIndex.call(r,t=>t.selected);-1===n&&(r[0].selected=!0)}t.setValue(e,{value:c(i,!0),items:u(i)})},clear(i){for(;0!==s.length;)s.remove(0);t.setValue(e,{value:null,items:[]})},insert(i){let{index:r,displayValue:a,exportValue:n}=i.detail.insert,o=s.children[r],l=document.createElement("option");l.textContent=a,l.value=n,o?o.before(l):s.append(l),t.setValue(e,{value:c(i,!0),items:u(i)})},items(i){let{items:r}=i.detail;for(;0!==s.length;)s.remove(0);for(let a of r){let{displayValue:n,exportValue:o}=a,l=document.createElement("option");l.textContent=n,l.value=o,s.append(l)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:c(i,!0),items:u(i)})},indices(i){let s=new Set(i.detail.indices);for(let r of i.target.options)r.selected=s.has(r.index);t.setValue(e,{value:c(i,!0)})},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(r,i)}),s.addEventListener("input",i=>{let s=c(i,!0),r=c(i,!1);t.setValue(e,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,changeEx:s,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],t=>t.target.checked)):s.addEventListener("input",function(i){t.setValue(e,{value:c(i,!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class S extends p{constructor(t){let e=!!(t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e})}render(){let t=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",t.includes(this.data.parentType))return this.container;let e=`[data-annotation-id="${this.data.parentId}"]`,i=this.layer.querySelectorAll(e);if(0===i.length)return this.container;let r=new x({container:this.container,trigger:Array.from(i),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),a=this.page,n=s.Util.normalizeRect([this.data.parentRect[0],a.view[3]-this.data.parentRect[1]+a.view[1],this.data.parentRect[2],a.view[3]-this.data.parentRect[3]+a.view[1]]),o=n[0]+this.data.parentRect[2]-this.data.parentRect[0],l=n[1],[h,d,c,u]=this.viewport.viewBox,p=c-h,g=u-d;return this.container.style.left=`${100*(o-h)/p}%`,this.container.style.top=`${100*(l-d)/g}%`,this.container.append(r.render()),this.container}}
2class x{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){let t=.7,e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.hidden=!0;let i=document.createElement("div");i.className="popup";let a=this.color;if(a){let n=t*(255-a[0])+a[0],l=t*(255-a[1])+a[1],h=t*(255-a[2])+a[2];i.style.backgroundColor=s.Util.makeHexColor(0|n,0|l,0|h)}let d=document.createElement("h1");d.dir=this.titleObj.dir,d.textContent=this.titleObj.str,i.append(d);let c=r.PDFDateString.toDateObject(this.modificationDate);if(c){let u=document.createElement("span");u.className="popupDate",u.textContent="{{date}}, {{time}}",u.dataset.l10nId="annotation_date_string",u.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()}),i.append(u)}if(this.richText?.str&&(!this.contentsObj?.str||this.contentsObj.str===this.richText.str))o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:i}),i.lastChild.className="richText popupContent";else{let p=this._formatContents(this.contentsObj);i.append(p)}for(let g of(Array.isArray(this.trigger)||(this.trigger=[this.trigger]),this.trigger))g.addEventListener("click",this._toggle.bind(this)),g.addEventListener("mouseover",this._show.bind(this,!1)),g.addEventListener("mouseout",this._hide.bind(this,!1));return i.addEventListener("click",this._hide.bind(this,!0)),e.append(i),e}_formatContents({str:t,dir:e}){let i=document.createElement("p");i.className="popupContent",i.dir=e;let s=t.split(/(?:\r\n?|\n)/);for(let r=0,a=s.length;r<a;++r){let n=s[r];i.append(document.createTextNode(n)),r<a-1&&i.append(document.createElement("br"))}return i}
2_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(t=!1){t&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex+=1)}_hide(t=!0){t&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex-=1)}}class C extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class E extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){this.container.className="lineAnnotation";let t=this.data,{width:e,height:i}=c(t.rect),s=this.svgFactory.create(e,i,!0),r=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),this._createPopup(r,t),this.container}}class T extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){this.container.className="squareAnnotation";let t=this.data,{width:e,height:i}=c(t.rect),s=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",r/2),a.setAttribute("y",r/2),a.setAttribute("width",e-r),a.setAttribute("height",i-r),a.setAttribute("stroke-width",r||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),this._createPopup(a,t),this.container}}class P extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){this.container.className="circleAnnotation";let t=this.data,{width:e,height:i}=c(t.rect),s=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",e/2),a.setAttribute("cy",i/2),a.setAttribute("rx",e/2-r/2),a.setAttribute("ry",i/2-r/2),a.setAttribute("stroke-width",r||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),s.append(a),this.container.append(s),this._createPopup(a,t),this.container}}class M extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;let t=this.data,{width:e,height:i}=c(t.rect),s=this.svgFactory.create(e,i,!0),r=[];for(let a of t.vertices){let n=a.x-t.rect[0],o=t.rect[3]-a.y;r.push(n+","+o)}r=r.join(" ");let l=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",r),l.setAttribute("stroke-width",t.borderStyle.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),s.append(l),this.container.append(s),this._createPopup(l,t),this.container}}class k extends M{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class w extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class R extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;let t=this.data,{width:e,height:i}=c(t.rect),s=this.svgFactory.create(e,i,!0);for(let r of t.inkLists){let a=[];for(let n of r){let o=n.x-t.rect[0],l=t.rect[3]-n.y;a.push(`${o},${l}`)}a=a.join(" ");let h=this.svgFactory.createElement(this.svgElementName);h.setAttribute("points",a),h.setAttribute("stroke-width",t.borderStyle.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),this._createPopup(h,t),s.append(h)}return this.container.append(s),this.container}}
2class F extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class O extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class I extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class D extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals)?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class L extends p{constructor(t){let e=!!(t.data.hasPopup||t.data.titleObj?.str||t.data.contentsObj?.str||t.data.richText?.str);super(t,{isRenderable:e,ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class N extends p{constructor(t){super(t,{isRenderable:!0});let{filename:e,content:i}=this.data.file;this.filename=(0,r.getFilenameFromUrl)(e),this.content=i,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:i})}render(){this.container.className="fileAttachmentAnnotation";let t=document.createElement("div");return t.className="popupTriggerArea",t.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(t,this.data),this.container.append(t),this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class j{static render(t){let{annotations:e,div:i,viewport:n}=t;this.#en(i,n);let o=[],l=[];for(let h of e){if(!h)continue;if(h.annotationType===s.AnnotationType.POPUP){l.push(h);continue}let{width:d,height:p}=c(h.rect);d<=0||p<=0||o.push(h)}for(let g of(l.length&&o.push(...l),o)){let m=u.create({data:g,layer:i,page:t.page,viewport:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new r.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(m.isRenderable){let f=m.render();if(g.hidden&&(f.style.visibility="hidden"),Array.isArray(f))for(let b of f)i.append(b);else m instanceof S?i.prepend(f):i.append(f)}}this.#eo(i,t.annotationCanvasMap)}static update(t){let{annotationCanvasMap:e,div:i,viewport:s}=t;this.#en(i,s),this.#eo(i,e),i.hidden=!1}static #en(U,{width:B,height:z,rotation:q}){let{style:W}=U,H=q%180!=0,G=Math.floor(B)+"px",V=Math.floor(z)+"px";W.width=H?V:G,W.height=H?G:V,U.setAttribute("data-main-rotation",q)}static #eo($,X){if(X){for(let[Y,K]of X){let J=$.querySelector(`[data-annotation-id="${Y}"]`);if(!J)continue;let{firstChild:Q}=J;Q?"CANVAS"===Q.nodeName?Q.replaceWith(K):Q.before(K):J.append(K)}X.clear()}}}e.AnnotationLayer=j},(t,e)=>{function i(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}
2Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0;class s{static CMYK_G([t,e,i,s]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_HTML([t]){let e=i(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_HTML([t,e,s]){let r=i(t),a=i(e),n=i(s);return`#${r}${a}${n}`}static T_HTML(){return"#00000000"}static CMYK_RGB([t,e,i,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,i+s),1-Math.min(1,e+s)]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){let s=1-t,r=1-e,a=1-i,n=Math.min(s,r,a);return["CMYK",s,r,a,n]}}e.ColorConverters=s},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var s=i(20);class r{static setupStorage(t,e,i,s,r){let a=s.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===r)break;t.addEventListener("input",t=>{s.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===r)break;t.addEventListener("change",t=>{s.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===r)break;t.addEventListener("input",t=>{s.setValue(e,{value:t.target.value})})}break;case"select":if(null!==a.value)for(let n of i.children)n.attributes.value===a.value&&(n.attributes.selected=!0);t.addEventListener("input",t=>{let i=t.target.options,r=-1===i.selectedIndex?"":i[i.selectedIndex].value;s.setValue(e,{value:r})})}}static setAttributes({html:t,element:e,storage:i=null,intent:s,linkService:r}){let{attributes:a}=e,n=t instanceof HTMLAnchorElement;for(let[o,l]of("radio"===a.type&&(a.name=`${a.name}-${s}`),Object.entries(a)))if(null!=l)switch(o){case"class":l.length&&t.setAttribute(o,l.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",l);break;case"style":Object.assign(t.style,l);break;case"textContent":t.textContent=l;break;default:n&&("href"===o||"newWindow"===o)||t.setAttribute(o,l)}n&&r.addLinkAttributes(t,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(t,a.dataId,e,i)}static render(t){let e=t.annotationStorage,i=t.linkService,r=t.xfaHtml,a=t.intent||"display",n=document.createElement(r.name);r.attributes&&this.setAttributes({html:n,element:r,intent:a,linkService:i});let o=[[r,-1,n]],l=t.div;if(l.append(n),t.viewport){let h=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=h}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");let d=[];for(;o.length>0;){let c;let[u,p,g]=o.at(-1);if(p+1===u.children.length){o.pop();continue}let m=u.children[++o.at(-1)[1]];if(null===m)continue;let{name:f}=m;if("#text"===f){let b=document.createTextNode(m.value);d.push(b),g.append(b);continue}if(c=m?.attributes?.xmlns?document.createElementNS(m.attributes.xmlns,f):document.createElement(f),g.append(c),m.attributes&&this.setAttributes({html:c,element:m,storage:e,intent:a,linkService:i}),m.children&&m.children.length>0)o.push([m,-1,c]);else if(m.value){let A=document.createTextNode(m.value);s.XfaText.shouldBuildText(f)&&d.push(A),c.append(A)}}for(let y of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))y.setAttribute("readOnly",!0);return{textDivs:d}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}e.XfaLayer=r},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=A;var s=i(1),r=i(4);let a=1e5,n=30,o=.8,l=new Map,h=/^\s+$/g;function d(t,e){let i=l.get(t);if(i)return i;e.save(),e.font=`${n}px ${t}`;let s=e.measureText(""),r=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(r){e.restore();let h=r/(r+a);return l.set(t,h),h}e.strokeStyle="red",e.clearRect(0,0,n,n),e.strokeText("g",0,0);let d=e.getImageData(0,0,n,n).data;a=0;for(let c=d.length-1-3;c>=0;c-=4)if(d[c]>0){a=Math.ceil(c/4/n);break}e.clearRect(0,0,n,n),e.strokeText("A",0,n),d=e.getImageData(0,0,n,n).data,r=0;for(let u=0,p=d.length;u<p;u+=4)if(d[u]>0){r=n-Math.floor(u/4/n);break}
2if(e.restore(),r){let g=r/(r+a);return l.set(t,g),g}return l.set(t,o),o}function c(t,e,i,r){let a,n;let o=document.createElement("span"),l=t._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(o);let c=s.Util.transform(t._viewport.transform,e.transform),u=Math.atan2(c[1],c[0]),p=i[e.fontName];p.vertical&&(u+=Math.PI/2);let g=Math.hypot(c[2],c[3]),m=g*d(p.fontFamily,r);0===u?(a=c[4],n=c[5]-m):(a=c[4]+m*Math.sin(u),n=c[5]-m*Math.cos(u)),o.style.left=`${a}px`,o.style.top=`${n}px`,o.style.fontSize=`${g}px`,o.style.fontFamily=p.fontFamily,l.fontSize=g,o.setAttribute("role","presentation"),o.textContent=e.str,o.dir=e.dir,t._fontInspectorEnabled&&(o.dataset.fontName=e.fontName),0!==u&&(l.angle=u*(180/Math.PI));let f=!1;if(e.str.length>1||t._enhanceTextSelection&&h.test(e.str))f=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){let b=Math.abs(e.transform[0]),A=Math.abs(e.transform[3]);b!==A&&Math.max(b,A)/Math.min(b,A)>1.5&&(f=!0)}if(f&&(p.vertical?l.canvasWidth=e.height*t._viewport.scale:l.canvasWidth=e.width*t._viewport.scale),t._textDivProperties.set(o,l),t._textContentStream&&t._layoutText(o),t._enhanceTextSelection&&l.hasText){let y,v,_=1,S=0;0!==u&&(_=Math.cos(u),S=Math.sin(u));let x=(p.vertical?e.height:e.width)*t._viewport.scale,C=g;0!==u?(y=[_,S,-S,_,a,n],v=s.Util.getAxialAlignedBoundingBox([0,0,x,C],y)):v=[a,n,a+x,n+C],t._bounds.push({left:v[0],top:v[1],right:v[2],bottom:v[3],div:o,size:[x,C],m:y})}}function u(t){if(t._canceled)return;let e=t._textDivs,i=t._capability,s=e.length;if(s>a){t._renderingDone=!0,i.resolve();return}if(!t._textContentStream)for(let r=0;r<s;r++)t._layoutText(e[r]);t._renderingDone=!0,i.resolve()}function p(t,e,i){let s=0;for(let r=0;r<i;r++){let a=t[e++];a>0&&(s=s?Math.min(a,s):a)}return s}function g(t){let e=t._bounds,i=t._viewport,r=m(i.width,i.height,e);for(let a=0;a<r.length;a++){let n=e[a].div,o=t._textDivProperties.get(n);if(0===o.angle){o.paddingLeft=e[a].left-r[a].left,o.paddingTop=e[a].top-r[a].top,o.paddingRight=r[a].right-e[a].right,o.paddingBottom=r[a].bottom-e[a].bottom,t._textDivProperties.set(n,o);continue}let l=r[a],h=e[a],d=h.m,c=d[0],u=d[1],g=[[0,0],[0,h.size[1]],[h.size[0],0],h.size],f=new Float64Array(64);for(let b=0,A=g.length;b<A;b++){let y=s.Util.applyTransform(g[b],d);f[b+0]=c&&(l.left-y[0])/c,f[b+4]=u&&(l.top-y[1])/u,f[b+8]=c&&(l.right-y[0])/c,f[b+12]=u&&(l.bottom-y[1])/u,f[b+16]=u&&-((l.left-y[0])/u),f[b+20]=c&&(l.top-y[1])/c,f[b+24]=u&&-((l.right-y[0])/u),f[b+28]=c&&(l.bottom-y[1])/c,f[b+32]=c&&-((l.left-y[0])/c),f[b+36]=u&&-((l.top-y[1])/u),f[b+40]=c&&-((l.right-y[0])/c),f[b+44]=u&&-((l.bottom-y[1])/u),f[b+48]=u&&(l.left-y[0])/u,f[b+52]=c&&-((l.top-y[1])/c),f[b+56]=u&&(l.right-y[0])/u,f[b+60]=c&&-((l.bottom-y[1])/c)}let v=1+Math.min(Math.abs(c),Math.abs(u));o.paddingLeft=p(f,32,16)/v,o.paddingTop=p(f,48,16)/v,o.paddingRight=p(f,0,16)/v,o.paddingBottom=p(f,16,16)/v,t._textDivProperties.set(n,o)}}function m(t,e,i){let s=i.map(function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}});f(t,s);let r=Array(i.length);for(let a of s){let n=a.index;r[n]={left:a.x1New,top:0,right:a.x2New,bottom:0}}for(let o of(i.map(function(e,i){let a=r[i],n=s[i];n.x1=e.top,n.y1=t-a.right,n.x2=e.bottom,n.y2=t-a.left,n.index=i,n.x1New=void 0,n.x2New=void 0}),f(e,s),s)){let l=o.index;r[l].top=o.x1New,r[l].bottom=o.x2New}return r}function f(t,e){e.sort(function(t,e){return t.x1-e.x1||t.index-e.index});let i={x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0},s=[{start:-1/0,end:1/0,boundary:i}];for(let r of e){let a,n,o=0;for(;o<s.length&&s[o].end<=r.y1;)o++;let l=s.length-1;for(;l>=0&&s[l].start>=r.y2;)l--;let h,d,c=-1/0;for(h=o;h<=l;h++){let u;(u=(n=(a=s[h]).boundary).x2>r.x1?n.index>r.index?n.x1New:r.x1:void 0===n.x2New?(n.x2+r.x1)/2:n.x2New)>c&&(c=u)}for(r.x1New=c,h=o;h<=l;h++)void 0===(n=(a=s[h]).boundary).x2New?n.x2>r.x1?n.index>r.index&&(n.x2New=n.x2):n.x2New=c:n.x2New>c&&(n.x2New=Math.max(c,n.x2));let p=[],g=null;for(h=o;h<=l;h++){n=(a=s[h]).boundary;let m=n.x2>r.x2?n:r;g===m?p.at(-1).end=a.end:(p.push({start:a.start,end:a.end,boundary:m}),g=m)}for(s[o].start<r.y1&&(p[0].start=r.y1,p.unshift({start:s[o].start,end:r.y1,boundary:s[o].boundary})),r.y2<s[l].end&&(p.at(-1).end=r.y2,p.push({start:r.y2,end:s[l].end,boundary:s[l].boundary})),h=o;h<=l;h++){if(void 0!==(n=(a=s[h]).boundary).x2New)continue;let f=!1;for(d=o-1;!f&&d>=0&&s[d].start>=n.y1;d--)f=s[d].boundary===n;for(d=l+1;!f&&d<s.length&&s[d].end<=n.y2;d++)f=s[d].boundary===n;for(d=0;!f&&d<p.length;d++)f=p[d].boundary===n;f||(n.x2New=c)}
2Array.prototype.splice.apply(s,[o,l-o+1,...p])}for(let b of s){let A=b.boundary;void 0===A.x2New&&(A.x2New=Math.max(t,A.x2))}}class b{constructor({textContent:t,textContentStream:e,container:i,viewport:a,textDivs:n,textContentItemsStr:o,enhanceTextSelection:l}){l&&(0,r.deprecated)("The `enhanceTextSelection` functionality will be removed in the future."),this._textContent=t,this._textContentStream=e,this._container=i,this._document=i.ownerDocument,this._viewport=a,this._textDivs=n||[],this._textContentItemsStr=o||[],this._enhanceTextSelection=!!l,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,s.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._devicePixelRatio=globalThis.devicePixelRatio||1,this._capability.promise.finally(()=>{this._enhanceTextSelection||(this._textDivProperties=null),this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new s.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(Error("TextLayer task cancelled."))}_processItems(t,e){for(let i=0,s=t.length;i<s;i++){if(void 0===t[i].str){if("beginMarkedContentProps"===t[i].type||"beginMarkedContent"===t[i].type){let r=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==t[i].id&&this._container.setAttribute("id",`${t[i].id}`),r.append(this._container)}else"endMarkedContent"===t[i].type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(t[i].str),c(this,t[i],e,this._layoutTextCtx)}}_layoutText(t){let e=this._textDivProperties.get(t),i="";if(0!==e.canvasWidth&&e.hasText){let{fontFamily:s}=t.style,{fontSize:r}=e;(r!==this._layoutTextLastFontSize||s!==this._layoutTextLastFontFamily)&&(this._layoutTextCtx.font=`${r*this._devicePixelRatio}px ${s}`,this._layoutTextLastFontSize=r,this._layoutTextLastFontFamily=s);let{width:a}=this._layoutTextCtx.measureText(t.textContent);if(a>0){let n=this._devicePixelRatio*e.canvasWidth/a;this._enhanceTextSelection&&(e.scale=n),i=`scaleX(${n})`}}if(0!==e.angle&&(i=`rotate(${e.angle}deg) ${i}`),i.length>0&&(this._enhanceTextSelection&&(e.originalTransform=i),t.style.transform=i),e.hasText&&this._container.append(t),e.hasEOL){let o=document.createElement("br");o.setAttribute("role","presentation"),this._container.append(o)}}_render(t=0){let e=(0,s.createPromiseCapability)(),i=Object.create(null),r=this._document.createElement("canvas");if(r.height=r.width=n,this._layoutTextCtx=r.getContext("2d",{alpha:!1}),this._textContent){let a=this._textContent.items,o=this._textContent.styles;this._processItems(a,o),e.resolve()}else if(this._textContentStream){let l=()=>{this._reader.read().then(({value:t,done:s})=>{if(s){e.resolve();return}Object.assign(i,t.styles),this._processItems(t.items,i),l()},e.reject)};this._reader=this._textContentStream.getReader(),l()}else throw Error('Neither "textContent" nor "textContentStream" parameters specified.');e.promise.then(()=>{i=null,t?this._renderTimer=setTimeout(()=>{u(this),this._renderTimer=null},t):u(this)},this._capability.reject)}expandTextDivs(t=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(g(this),this._bounds=null);let e=[],i=[];for(let s=0,r=this._textDivs.length;s<r;s++){let a=this._textDivs[s],n=this._textDivProperties.get(a);n.hasText&&(t?(e.length=0,i.length=0,n.originalTransform&&e.push(n.originalTransform),n.paddingTop>0?(i.push(`${n.paddingTop}px`),e.push(`translateY(${-n.paddingTop}px)`)):i.push(0),n.paddingRight>0?i.push(`${n.paddingRight/n.scale}px`):i.push(0),n.paddingBottom>0?i.push(`${n.paddingBottom}px`):i.push(0),n.paddingLeft>0?(i.push(`${n.paddingLeft/n.scale}px`),e.push(`translateX(${-n.paddingLeft/n.scale}px)`)):i.push(0),a.style.padding=i.join(" "),e.length&&(a.style.transform=e.join(" "))):(a.style.padding=null,a.style.transform=n.originalTransform))}}}function A(t){let e=new b({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});return e._render(t.timeout),e}e.TextLayerRenderTask=b},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var s=i(4),r=i(1),a=i(3);let n=class{constructor(){(0,r.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=n;{let o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/1999/xlink",d=["butt","round","square"],c=["miter","round","bevel"],u=function(t,e="",i=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([t],{type:e}));let s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=`data:${e};base64,`;for(let a=0,n=t.length;a<n;a+=3){let o=255&t[a],l=255&t[a+1],h=255&t[a+2],d=o>>2,c=(3&o)<<4|l>>4,u=a+1<n?(15&l)<<2|h>>6:64,p=a+2<n?63&h:64;r+=s[d]+s[c]+s[u]+s[p]}return r},p=function(){let t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,i=new Int32Array(256);for(let s=0;s<256;s++){let n=s;for(let o=0;o<8;o++)n=1&n?3988292384^n>>1&2147483647:n>>1&2147483647;i[s]=n}function l(t,e,s){let r=-1;for(let a=e;a<s;a++){let n=(r^t[a])&255,o=i[n];r=r>>>8^o}return -1^r}function h(t,e,i,s){let r=s,a=e.length;i[r]=a>>24&255,i[r+1]=a>>16&255,i[r+2]=a>>8&255,i[r+3]=255&a,i[r+=4]=255&t.charCodeAt(0),i[r+1]=255&t.charCodeAt(1),i[r+2]=255&t.charCodeAt(2),i[r+3]=255&t.charCodeAt(3),r+=4,i.set(e,r),r+=e.length;let n=l(i,s+4,r);i[r]=n>>24&255,i[r+1]=n>>16&255,i[r+2]=n>>8&255,i[r+3]=255&n}function d(t,e,i){let s=1,r=0;for(let a=e;a<i;++a)r=(r+(s=(s+(255&t[a]))%65521))%65521;return r<<16|s}function c(t){if(!a.isNodeJS)return p(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);let i=__webpack_require__(82258).deflateSync(e,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(s){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+s)}return p(t)}function p(t){let e=t.length,i=65535,s=Math.ceil(e/i),r=new Uint8Array(2+e+5*s+4),a=0;r[a++]=120,r[a++]=156;let n=0;for(;e>i;)r[a++]=0,r[a++]=255,r[a++]=255,r[a++]=0,r[a++]=0,r.set(t.subarray(n,n+i),a),a+=i,n+=i,e-=i;r[a++]=1,r[a++]=255&e,r[a++]=e>>8&255,r[a++]=255&~e,r[a++]=(65535&~e)>>8&255,r.set(t.subarray(n),a),a+=t.length-n;let o=d(t,0,t.length);return r[a++]=o>>24&255,r[a++]=o>>16&255,r[a++]=o>>8&255,r[a++]=255&o,r}function g(i,s,a,n){let o,l,d;let p=i.width,g=i.height,m=i.data;switch(s){case r.ImageKind.GRAYSCALE_1BPP:l=0,o=1,d=p+7>>3;break;case r.ImageKind.RGB_24BPP:l=2,o=8,d=3*p;break;case r.ImageKind.RGBA_32BPP:l=6,o=8,d=4*p;break;default:throw Error("invalid format")}let f=new Uint8Array((1+d)*g),b=0,A=0;for(let y=0;y<g;++y)f[b++]=0,f.set(m.subarray(A,A+d),b),A+=d,b+=d;if(s===r.ImageKind.GRAYSCALE_1BPP&&n){b=0;for(let v=0;v<g;v++){b++;for(let _=0;_<d;_++)f[b++]^=255}}let S=new Uint8Array([p>>24&255,p>>16&255,p>>8&255,255&p,g>>24&255,g>>16&255,g>>8&255,255&g,o,l,0,0,0]),x=c(f),C=t.length+3*e+S.length+x.length,E=new Uint8Array(C),T=0;return E.set(t,T),h("IHDR",S,E,T+=t.length),h("IDATA",x,E,T+=e+S.length),T+=e+x.length,h("IEND",new Uint8Array(0),E,T),u(E,"image/png",a)}return function(t,e,i){let s=void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind;return g(t,s,e,i)}}();class g{constructor(){this.fontSizeScale=1,this.fontWeight=o.fontWeight,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=r.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=o.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t,this.y=e}}function m(t){let e=[],i=[];for(let s of t){if("save"===s.fn){e.push({fnId:92,fn:"group",items:[]}),i.push(e),e=e.at(-1).items;continue}"restore"===s.fn?e=i.pop():e.push(s)}return e}function f(t){if(Number.isInteger(t))return t.toString();let e=t.toFixed(10),i=e.length-1;if("0"!==e[i])return e;do i--;while("0"===e[i]);return e.substring(0,"."===e[i]?i:i+1)}function b(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?""
2:`scale(${f(t[0])} ${f(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){let e=180*Math.acos(t[0])/Math.PI;return`rotate(${f(e)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${f(t[4])} ${f(t[5])})`;return`matrix(${f(t[0])} ${f(t[1])} ${f(t[2])} ${f(t[3])} ${f(t[4])} ${f(t[5])})`}let A=0,y=0,v=0;e.SVGGraphics=n=class{constructor(t,e,i=!1){for(let a in(0,s.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new s.DOMSVGFactory,this.current=new g,this.transformMatrix=r.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!i,this._operatorIdMapping=[],r.OPS)this._operatorIdMapping[r.OPS[a]]=a}save(){this.transformStack.push(this.transformMatrix);let t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){let e=t.fnArray,i=t.argsArray;for(let s=0,a=e.length;s<a;s++)if(e[s]===r.OPS.dependency)for(let n of i[s]){let o=n.startsWith("g_")?this.commonObjs:this.objs,l=new Promise(t=>{o.get(n,t)});this.current.dependencies.push(l)}return Promise.all(this.current.dependencies)}transform(t,e,i,s,a,n){let o=[t,e,i,s,a,n];this.transformMatrix=r.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;let i=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=r.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),i))}convertOpList(t){let e=this._operatorIdMapping,i=t.argsArray,s=t.fnArray,r=[];for(let a=0,n=s.length;a<n;a++){let o=s[a];r.push({fnId:o,fn:e[o],args:i[a]})}return m(r)}executeOpTree(t){for(let e of t){let i=e.fn,s=e.fnId,a=e.args;switch(0|s){case r.OPS.beginText:this.beginText();break;case r.OPS.dependency:break;case r.OPS.setLeading:this.setLeading(a);break;case r.OPS.setLeadingMoveText:this.setLeadingMoveText(a[0],a[1]);break;case r.OPS.setFont:this.setFont(a);break;case r.OPS.showText:case r.OPS.showSpacedText:this.showText(a[0]);break;case r.OPS.endText:this.endText();break;case r.OPS.moveText:this.moveText(a[0],a[1]);break;case r.OPS.setCharSpacing:this.setCharSpacing(a[0]);break;case r.OPS.setWordSpacing:this.setWordSpacing(a[0]);break;case r.OPS.setHScale:this.setHScale(a[0]);break;case r.OPS.setTextMatrix:this.setTextMatrix(a[0],a[1],a[2],a[3],a[4],a[5]);break;case r.OPS.setTextRise:this.setTextRise(a[0]);break;case r.OPS.setTextRenderingMode:this.setTextRenderingMode(a[0]);break;case r.OPS.setLineWidth:this.setLineWidth(a[0]);break;case r.OPS.setLineJoin:this.setLineJoin(a[0]);break;case r.OPS.setLineCap:this.setLineCap(a[0]);break;case r.OPS.setMiterLimit:this.setMiterLimit(a[0]);break;case r.OPS.setFillRGBColor:this.setFillRGBColor(a[0],a[1],a[2]);break;case r.OPS.setStrokeRGBColor:this.setStrokeRGBColor(a[0],a[1],a[2]);break;case r.OPS.setStrokeColorN:this.setStrokeColorN(a);break;case r.OPS.setFillColorN:this.setFillColorN(a);break;case r.OPS.shadingFill:this.shadingFill(a[0]);break;case r.OPS.setDash:this.setDash(a[0],a[1]);break;case r.OPS.setRenderingIntent:this.setRenderingIntent(a[0]);break;case r.OPS.setFlatness:this.setFlatness(a[0]);break;case r.OPS.setGState:this.setGState(a[0]);break;case r.OPS.fill:this.fill();break;case r.OPS.eoFill:this.eoFill();break;case r.OPS.stroke:this.stroke();break;case r.OPS.fillStroke:this.fillStroke();break;case r.OPS.eoFillStroke:this.eoFillStroke();break;case r.OPS.clip:this.clip("nonzero");break;case r.OPS.eoClip:this.clip("evenodd");break;case r.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case r.OPS.paintImageXObject:this.paintImageXObject(a[0]);break;case r.OPS.paintInlineImageXObject:this.paintInlineImageXObject(a[0]);break;case r.OPS.paintImageMaskXObject:this.paintImageMaskXObject(a[0]);break;case r.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(a[0],a[1]);break;case r.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case r.OPS.closePath:this.closePath();break;case r.OPS.closeStroke:this.closeStroke();break;case r.OPS.closeFillStroke:this.closeFillStroke();break;case r.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case r.OPS.nextLine:this.nextLine();break;case r.OPS.transform:this.transform(a[0],a[1],a[2],a[3],a[4],a[5]);break;case r.OPS.constructPath:this.constructPath(a[0],a[1]);break;case r.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;
2default:(0,r.warn)(`Unimplemented operator ${i}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,i,s,r,a){let n=this.current;n.textMatrix=n.lineMatrix=[t,e,i,s,r,a],n.textMatrixScale=Math.hypot(t,e),n.x=n.lineX=0,n.y=n.lineY=0,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",`${f(n.fontSize)}px`),n.tspan.setAttributeNS(null,"y",f(-n.y)),n.txtElement=this.svgFactory.createElement("svg:text"),n.txtElement.append(n.tspan)}beginText(){let t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=r.IDENTITY_MATRIX,t.lineMatrix=r.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){let i=this.current;i.x=i.lineX+=t,i.y=i.lineY+=e,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${f(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",f(-i.y))}showText(t){let e=this.current,i=e.font,s=e.fontSize;if(0===s)return;let a=e.fontSizeScale,n=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,c=e.textHScale*d,u=i.vertical,p=u?1:-1,g=i.defaultVMetrics,m=s*e.fontMatrix[0],A=0;for(let y of t){let v,_,S;if(null===y){A+=d*h;continue}if("number"==typeof y){A+=p*y*s/1e3;continue}let x=(y.isSpace?h:0)+n,C=y.fontChar,E=y.width;if(u){let T;let P=y.vmetric||g;T=-(T=y.vmetric?P[1]:.5*E)*m;let M=P[2]*m;E=P?-P[0]:E,v=T/a,_=(A+M)/a}else v=A/a,_=0;(y.isInFont||i.missingFile)&&(e.xcoords.push(e.x+v),u&&e.ycoords.push(-e.y+_),e.tspan.textContent+=C),A+=S=u?E*m-x*d:E*m+x*d}e.tspan.setAttributeNS(null,"x",e.xcoords.map(f).join(" ")),u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(f).join(" ")):e.tspan.setAttributeNS(null,"y",f(-e.y)),u?e.y-=A:e.x+=A*c,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",`${f(e.fontSize)}px`),e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);let k=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(k===r.TextRenderingMode.FILL||k===r.TextRenderingMode.FILL_STROKE?(e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),k===r.TextRenderingMode.STROKE||k===r.TextRenderingMode.FILL_STROKE){let w=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,w)}let R=e.textMatrix;0!==e.textRise&&(R=R.slice(),R[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform",`${b(R)} scale(${f(c)}, -1)`),e.txtElement.setAttributeNS(l,"xml:space","preserve"),e.txtElement.append(e.tspan),e.txtgrp.append(e.txtElement),this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.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 e=u(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); } 3`}setFont(t){let e=this.current,i=this.commonObjs.get(t[0]),s=t[1];e.font=i,!this.embedFonts||i.missingFile||this.embeddedFonts[i.loadedName]||(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),e.fontMatrix=i.fontMatrix||r.FONT_IDENTITY_MATRIX;let a="normal";i.black?a="900":i.bold&&(a="bold");let n=i.italic?"italic":"normal";s<0?(s=-s,e.fontDirection=-1):e.fontDirection=1,e.fontSize=s,e.fontFamily=i.loadedName,e.fontWeight=a,e.fontStyle=n,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",f(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){let t=this.current;t.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=d[t]}setLineJoin(t){this.current.lineJoin=c[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,i){this.current.strokeColor=r.Util.makeHexColor(t,e,i)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,i){this.current.fillColor=r.Util.makeHexColor(t,e,i),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){let e=this.viewport.width,i=this.viewport.height,s=r.Util.inverseTransform(this.transformMatrix),a=r.Util.applyTransform([0,0],s),n=r.Util.applyTransform([0,i],s),o=r.Util.applyTransform([e,0],s),l=r.Util.applyTransform([e,i],s),h=Math.min(a[0],n[0],o[0],l[0]),d=Math.min(a[1],n[1],o[1],l[1]),c=Math.max(a[0],n[0],o[0],l[0]),u=Math.max(a[1],n[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",h),p.setAttributeNS(null,"y",d),p.setAttributeNS(null,"width",c-h),p.setAttributeNS(null,"height",u-d),p.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){let e=t[1],i=t[2],s=t[3]||r.IDENTITY_MATRIX,[a,n,o,l]=t[4],h=t[5],d=t[6],c=t[7],u=`shading${v++}`,[p,g,m,f]=r.Util.normalizeRect([...r.Util.applyTransform([a,n],s),...r.Util.applyTransform([o,l],s)]),[b,A]=r.Util.singularValueDecompose2dScale(s),y=h*b,_=d*A,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",y),S.setAttributeNS(null,"height",_),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${g}`);let x=this.svg,C=this.transformMatrix,E=this.current.fillColor,T=this.current.strokeColor,P=this.svgFactory.create(m-p,f-g);if(this.svg=P,this.transformMatrix=s,2===c){let M=r.Util.makeHexColor(...e);this.current.fillColor=M,this.current.strokeColor=M}return this.executeOpTree(this.convertOpList(i)),this.svg=x,this.transformMatrix=C,this.current.fillColor=E,this.current.strokeColor=T,S.append(P.childNodes[0]),this.defs.append(S),`url(#${u})`}_makeShadingPattern(t){switch("string"==typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":let e;let i=`shading${v++}`,s=t[3];switch(t[1]){case"axial":let a=t[4],n=t[5];(e=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",a[0]),e.setAttributeNS(null,"y1",a[1]),e.setAttributeNS(null,"x2",n[0]),e.setAttributeNS(null,"y2",n[1]);break;case"radial":let o=t[4],l=t[5],h=t[6],d=t[7];(e=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",l[0]),e.setAttributeNS(null,"cy",l[1]),e.setAttributeNS(null,"r",d),e.setAttributeNS(null,"fx",o[0]),e.setAttributeNS(null,"fy",o[1]),e.setAttributeNS(null,"fr",h);break;default:throw Error(`Unknown RadialAxial type: ${t[1]}`)}for(let c of s){let u=this.svgFactory.createElement("svg:stop");
3u.setAttributeNS(null,"offset",c[0]),u.setAttributeNS(null,"stop-color",c[1]),e.append(u)}return this.defs.append(e),`url(#${i})`;case"Mesh":return(0,r.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){let i=this.current,s=i.x,a=i.y,n=[],o=0;for(let l of t)switch(0|l){case r.OPS.rectangle:s=e[o++],a=e[o++];let h=e[o++],d=e[o++],c=s+h,u=a+d;n.push("M",f(s),f(a),"L",f(c),f(a),"L",f(c),f(u),"L",f(s),f(u),"Z");break;case r.OPS.moveTo:s=e[o++],a=e[o++],n.push("M",f(s),f(a));break;case r.OPS.lineTo:s=e[o++],a=e[o++],n.push("L",f(s),f(a));break;case r.OPS.curveTo:s=e[o+4],a=e[o+5],n.push("C",f(e[o]),f(e[o+1]),f(e[o+2]),f(e[o+3]),f(s),f(a)),o+=6;break;case r.OPS.curveTo2:n.push("C",f(s),f(a),f(e[o]),f(e[o+1]),f(e[o+2]),f(e[o+3])),s=e[o+2],a=e[o+3],o+=4;break;case r.OPS.curveTo3:s=e[o+2],a=e[o+3],n.push("C",f(e[o]),f(e[o+1]),f(s),f(a),f(s),f(a)),o+=4;break;case r.OPS.closePath:n.push("Z")}n=n.join(" "),i.path&&t.length>0&&t[0]!==r.OPS.rectangle&&t[0]!==r.OPS.moveTo?n=i.path.getAttributeNS(null,"d")+n:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(i.path)),i.path.setAttributeNS(null,"d",n),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(s,a)}endPath(){let t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}let e=`clippath${A++}`,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"transform",b(this.transformMatrix));let s=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?s.setAttributeNS(null,"clip-rule","evenodd"):s.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,i.append(s),this.defs.append(i),t.activeClipUrl){for(let r of(t.clipGroup=null,this.extraStack))r.clipGroup=null;i.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}clip(t){this.pendingClip=t}closePath(){let t=this.current;if(t.path){let e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);break;default:(0,r.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){let t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){let t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t,e=1){let i=this.current,s=i.dashArray;1!==e&&s.length>0&&(s=s.map(function(t){return e*t})),t.setAttributeNS(null,"stroke",i.strokeColor),t.setAttributeNS(null,"stroke-opacity",i.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",f(i.miterLimit)),t.setAttributeNS(null,"stroke-linecap",i.lineCap),t.setAttributeNS(null,"stroke-linejoin",i.lineJoin),t.setAttributeNS(null,"stroke-width",f(e*i.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",s.map(f).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",f(e*i.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){let t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(t)}paintImageXObject(t){let e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(!e){(0,r.warn)(`Dependent image with object ID ${t} is not ready yet`);return}this.paintInlineImageXObject(e)}paintInlineImageXObject(t,e){let i=t.width,s=t.height,r=p(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",f(i)),a.setAttributeNS(null,"height",f(s)),this.current.element=a,this.clip("nonzero");let n=this.svgFactory.createElement("svg:image");n.setAttributeNS(h,"xlink:href",r),n.setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y",f(-s)),n.setAttributeNS(null,"width",f(i)+"px"),n.setAttributeNS(null,"height",f(s)+"px"),n.setAttributeNS(null,"transform",`scale(${f(1/i)} ${f(-1/s)})`),e?e.append(n):this._ensureTransformGroup().append(n)}paintImageMaskXObject(t){let e=this.current,i=t.width,s=t.height,r=e.fillColor;e.maskId=`mask${y++}`;let a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",e.maskId);let n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width",f(i)),n.setAttributeNS(null,"height",f(s)),n.setAttributeNS(null,"fill",r),n.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(a),this._ensureTransformGroup().append(n),this.paintInlineImageXObject(t,a)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){let i=e[2]-e[0],s=e[3]-e[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",e[0]),r.setAttributeNS(null,"y",e[1]),r.setAttributeNS(null,"width",f(i)),r.setAttributeNS(null,"height",f(s)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){let e=this.svgFactory.create(t.width,t.height),i=this.svgFactory.createElement("svg:defs");e.append(i),this.defs=i;let s=this.svgFactory.createElement("svg:g");return s.setAttributeNS(null,"transform",b(t.transform)),e.append(s),this.svg=s,e}_ensureClipGroup(){if(!this.current.clipGroup){let t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",b(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(t,e,i)=>
3{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var s=i(1),r=i(33);let a=__webpack_require__(70172),n=__webpack_require__(2001),o=__webpack_require__(33779),l=__webpack_require__(11987),h=/^file:\/\/\/[a-zA-Z]:\//;function d(t){let e=l.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?l.parse(`file:///${t}`):(e.host||(e.protocol="file:"),e)}class c{constructor(t){this.source=t,this.url=d(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new b(this):new m(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=this.isFsUrl?new A(this,t,e):new f(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFNodeStream=c;class u{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=(0,s.createPromiseCapability)(),this._headersCapability=(0,s.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();if(null===t)return this._readCapability=(0,s.createPromiseCapability)(),this.read();this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});let e=new Uint8Array(t).buffer;return{value:e,done:!1}}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class p{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,s.createPromiseCapability)();let e=t.source;this._isStreamingSupported=!e.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 t=this._readableStream.read();if(null===t)return this._readCapability=(0,s.createPromiseCapability)(),this.read();this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded});let e=new Uint8Array(t).buffer;return{value:e,done:!1}}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function g(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class m extends u{constructor(t){super(t);let e=e=>{if(404===e.statusCode){let i=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=i,this._headersCapability.reject(i);return}this._headersCapability.resolve(),this._setReadableStream(e);let a=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:o}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=o||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(a)};this._request=null,"http:"===this._url.protocol?this._request=n.request(g(this._url,t.httpHeaders),e):this._request=o.request(g(this._url,t.httpHeaders),e),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class f extends p{constructor(t,e,i){for(let r in super(t),this._httpHeaders={},t.httpHeaders){let a=t.httpHeaders[r];void 0!==a&&(this._httpHeaders[r]=a)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;let l=t=>{if(404===t.statusCode){let e=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e;return}this._setReadableStream(t)};this._request=null,"http:"===this._url.protocol?this._request=n.request(g(this._url,this._httpHeaders),l):this._request=o.request(g(this._url,this._httpHeaders),l),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class b extends u{constructor(t){super(t);let e=decodeURIComponent(this._url.path);h.test(this._url.href)&&(e=e.replace(/^\//,"")),a.lstat(e,(t,i)=>{if(t){"ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t);return}this._contentLength=i.size,this._setReadableStream(a.createReadStream(e)),this._headersCapability.resolve()})}}class A extends p{constructor(t,e,i){super(t);let s=decodeURIComponent(this._url.path);h.test(this._url.href)&&(s=s.replace(/^\//,"")),this._setReadableStream(a.createReadStream(s,{start:e,end:i-1}))}}},(t,e,i)=>
3{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=l,e.extractFilenameFromHeader=o,e.validateRangeRequestCapabilities=n,e.validateResponseStatus=h;var s=i(1),r=i(34),a=i(4);function n({getResponseHeader:t,isHttp:e,rangeChunkSize:i,disableRange:s}){let r={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);if(!Number.isInteger(a)||(r.suggestedLength=a,a<=2*i||s||!e||"bytes"!==t("Accept-Ranges")))return r;let n=t("Content-Encoding")||"identity";return"identity"!==n||(r.allowRangeRequests=!0),r}function o(t){let e=t("Content-Disposition");if(e){let i=(0,r.getFilenameFromContentDispositionHeader)(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch(s){}if((0,a.isPdfFile)(i))return i}return null}function l(t,e){return 404===t||0===t&&e.startsWith("file:")?new s.MissingPDFException('Missing PDF "'+e+'".'):new s.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function h(t){return 200===t||206===t}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=r;var s=i(1);function r(t){let e=!0,i=o("filename\\*","i").exec(t);if(i){let r=c(i=i[1]);return h(r=p(r=u(r=unescape(r))))}if(i=d(t)){let a=p(i);return h(a)}if(i=o("filename","i").exec(t)){let n=c(i=i[1]);return h(n=p(n))}function o(t,e){return RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function l(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{let r=new TextDecoder(t,{fatal:!0}),a=(0,s.stringToBytes)(i);i=r.decode(a),e=!1}catch(n){}}return i}function h(t){return e&&/[\x80-\xff]/.test(t)&&(t=l("utf-8",t),e&&(t=l("iso-8859-1",t))),t}function d(t){let e;let i=[],s=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=s.exec(t));){let[,r,a,n]=e;if((r=parseInt(r,10))in i){if(0===r)break;continue}i[r]=[a,n]}let l=[];for(let h=0;h<i.length&&(h in i);++h){let[d,p]=i[h];p=c(p),d&&(p=unescape(p),0===h&&(p=u(p))),l.push(p)}return l.join("")}function c(t){if(t.startsWith('"')){let e=t.slice(1).split('\\"');for(let i=0;i<e.length;++i){let s=e[i].indexOf('"');-1!==s&&(e[i]=e[i].slice(0,s),e.length=i+1),e[i]=e[i].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function u(t){let e=t.indexOf("'");if(-1===e)return t;let i=t.slice(0,e),s=t.slice(e+1),r=s.replace(/^[^']*'/,"");return l(i,r)}function p(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,s){if("q"===i||"Q"===i)return l(e,s=(s=s.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{s=atob(s)}catch(r){}return l(e,s)})}return""}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var s=i(1),r=i(33);let a=200,n=206;function o(t){let e=t.response;if("string"!=typeof e)return e;let i=(0,s.stringToBytes)(e);return i.buffer}class l{constructor(t,e={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.getXhr=e.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){let s={begin:t,end:e};for(let r in i)s[r]=i[r];return this.request(s)}requestFull(t){return this.request(t)}request(t){let e=this.getXhr(),i=this.currXhrId++,s=this.pendingRequests[i]={xhr:e};for(let r in e.open("GET",this.url),e.withCredentials=this.withCredentials,this.httpHeaders){let o=this.httpHeaders[r];void 0!==o&&e.setRequestHeader(r,o)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=n):s.expectedStatus=a,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){let i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){let i=this.pendingRequests[t];if(!i)return;let s=i.xhr;if(s.readyState>
3=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==s.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===s.status&&this.isHttp){i.onError?.(s.status);return}let r=s.status||a,l=r===a&&i.expectedStatus===n;if(!l&&r!==i.expectedStatus){i.onError?.(s.status);return}let h=o(s);if(r===n){let d=s.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(d);i.onDone({begin:parseInt(c[1],10),chunk:h})}else h?i.onDone({begin:0,chunk:h}):i.onError?.(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){let e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class h{constructor(t){this._source=t,this._manager=new l(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new d(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let i=new c(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFNetworkStream=h;class d{constructor(t,e){this._manager=t;let i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=(0,s.createPromiseCapability)(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.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 t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:s,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t){if(this._requests.length>0){let e=this._requests.shift();e.resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk)}if(this._done=!0,!(this._cachedChunks.length>0)){for(let i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){for(let e of(this._storedError=(0,r.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.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){let t=this._cachedChunks.shift();return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=(0,s.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(t){for(let e of(this._done=!0,this._headersReceivedCapability.reject(t),this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest
3(this._fullRequestId),this._fullRequestReader=null}}class c{constructor(t,e,i){this._manager=t;let s={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){let e=t.chunk;if(this._requests.length>0){let i=this._requests.shift();i.resolve({value:e,done:!1})}else this._queuedChunk=e;for(let s of(this._done=!0,this._requests))s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){for(let e of(this._storedError=(0,r.createResponseStatusError)(t,this._url),this._requests))e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=(0,s.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(t){for(let e of(this._done=!0,this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var s=i(1),r=i(33);function a(t,e,i){return{method:"GET",headers:t,signal:i?.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function n(t){let e=new Headers;for(let i in t){let s=t[i];void 0!==s&&e.append(i,s)}return e}class o{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=new h(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFFetchStream=o;class l{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=(0,s.createPromiseCapability)(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=n(this._stream.httpHeaders);let i=e.url;fetch(i,a(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,r.validateResponseStatus)(t.status))throw(0,r.createResponseStatusError)(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();let e=e=>t.headers.get(e),{allowRangeRequests:a,suggestedLength:n}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=n||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.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:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});let i=new Uint8Array(t).buffer;return{value:i,done:!1}}cancel(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}}class h{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;let o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,s.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=n(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);let l=o.url;fetch(l,a(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,r.validateResponseStatus)(t.status))throw(0,r.createResponseStatusError)(t.status,l);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded});let i=new Uint8Array(t).buffer;return{value:i,done:!1}}cancel(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](i,i.exports,__w_pdfjs_require__),i.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__;
3Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return r.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return n.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return s.LoopbackPort}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return s.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return s.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return d.SVGGraphics}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}}),Object.defineProperty(t,"binarySearchFirstItem",{enumerable:!0,get:function(){return i.binarySearchFirstItem}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return s.build}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return e.createPromiseCapability}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return s.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return h.renderTextLayer}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.version}});var e=__w_pdfjs_require__(1),i=__w_pdfjs_require__(4),s=__w_pdfjs_require__(6),r=__w_pdfjs_require__(22),a=__w_pdfjs_require__(9),n=__w_pdfjs_require__(27),o=__w_pdfjs_require__(15),l=__w_pdfjs_require__(3),h=__w_pdfjs_require__(30),d=__w_pdfjs_require__(31),c=__w_pdfjs_require__(29);
3if(l.isNodeJS){let{PDFNodeStream:u}=__w_pdfjs_require__(32);(0,s.setPDFNetworkStreamFactory)(t=>new u(t))}else{let{PDFNetworkStream:p}=__w_pdfjs_require__(35),{PDFFetchStream:g}=__w_pdfjs_require__(36);(0,s.setPDFNetworkStreamFactory)(t=>(0,i.isValidFetchUrl)(t.url)?new g(t):new p(t))}})(),__webpack_exports__})(),module.exports=factory()}}]);
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.