UNPKG

ngx-extended-pdf-viewer

Version:

Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.

25 lines 374 kB
window.ngxZone.runOutsideAngular(() => {
/**
 * @licstart The following is the entire license notice for the
 * JavaScript code in this page
 *
 * Copyright 2023 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @licend The above is the entire license notice for the
 * JavaScript code in this page
 */
!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?globalThis["pdfjs-dist/build/pdf"]=module.exports=e():"function"==typeof define&&define.amd?(globalThis["pdfjs-dist/build/pdf"]=globalThis.pdfjsLib=e()||define("pdfjs-dist/build/pdf",[],e)):"object"==typeof exports?globalThis["pdfjs-dist/build/pdf"]=exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=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.assert=function assert(t,e){t||unreachable(e)};e.bytesToString=function bytesToString(t){"object"==typeof t&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const a=[];for(let r=0;r<e;r+=i){const s=Math.min(r+i,e),n=t.subarray(r,s);a.push(String.fromCharCode.apply(null,n))}return a.join("")};e.createPromiseCapability=function createPromiseCapability(){const t=Object.create(null);let e=!1;Object.defineProperty(t,"settled",{get:()=>e});t.promise=new Promise((function(i,a){t.resolve=function(t){e=!0;i(t)};t.reject=function(t){e=!0;a(t)}}));return t};e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const a=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":case"capacitor":return!0;default:return!1}}(a))return a}catch(t){}return null};e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[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")].join("")};e.getVerbosityLevel=function getVerbosityLevel(){return r};e.info=function info(t){r>=a.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Info: ${t}`):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log(`Info: ${t}`):console.log(`Info: ${t}`))};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let i=0,a=t.length;i<a;i++)if(t[i]!==e[i])return!1;return!0};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[i,a]of t)e[i]=a;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(r=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const i=new TextDecoder(e,{fatal:!0}),a=stringToBytes(t);return i.decode(a)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let i=0,a=t.length;i<a;i++){const a=o[t.charCodeAt(i)];e.push(a?String.fromCharCode(a):t.charAt(i))}return e.join("")};e.stringToUTF8String=stringToUTF8String;e.unreachable=unreachable;e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};e.warn=warn;if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;i(2)}e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.MAX_IMAGE_SIZE_TO_CACHE=1e7;e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.BASELINE_FACTOR=.25925925925925924;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationEditorPrefix="pdfjs_internal_editor_";e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReplyType={GROUP:"Group",REPLY:"R"};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.PageActionEventType={O:"PageOpen",C:"PageClose"};const a={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=a;e.CMapCompressionType={NONE:0,BINARY:1};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=a.WARNINGS;function warn(t){r>=a.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log(`Warning: ${t}`):Window&&globalThis.ngxConsole?globalThis.ngxConsole.log(`Warning: ${t}`):console.log(`Warning: ${t}`))}function unreachable(t){throw new Error(t)}function shadow(t,e,i){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:i,enumerable:!a,configurable:!0,writable:!1});return i}const s=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=s;e.PasswordException=class PasswordException extends s{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends s{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends s{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends s{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends s{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends s{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends s{constructor(t){super(t,"AbortException")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let a=0;a<e;++a)i[a]=255&t.charCodeAt(a);return i}e.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?shadow(this,"platform",{isWin:!1,isMac:!1}):shadow(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const n=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,i){return`#${n[t]}${n[e]}${n[i]}`}static scaleMinMax(t,e){let i;if(t[0]){if(t[0]<0){i=e[0];e[0]=e[1];e[1]=i}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){i=e[2];e[2]=e[3];e[3]=i}e[2]*=t[3];e[3]*=t[3]}else{i=e[0];e[0]=e[2];e[2]=i;i=e[1];e[1]=e[3];e[3]=i;if(t[1]<0){i=e[2];e[2]=e[3];e[3]=i}e[2]*=t[1];e[3]*=t[1];if(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){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=Util.applyTransform(t,e),a=Util.applyTransform(t.slice(2,4),e),r=Util.applyTransform([t[0],t[3]],e),s=Util.applyTransform([t[2],t[1]],e);return[Math.min(i[0],a[0],r[0],s[0]),Math.min(i[1],a[1],r[1],s[1]),Math.max(i[0],a[0],r[0],s[0]),Math.max(i[1],a[1],r[1],s[1])]}static inverseTransform(t){const 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 singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],a=t[0]*e[1]+t[1]*e[3],r=t[2]*e[0]+t[3]*e[2],s=t[2]*e[1]+t[3]*e[3],n=(i+s)/2,o=Math.sqrt((i+s)**2-4*(i*s-r*a))/2,l=n+o||1,c=n-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),a=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>a)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>s?null:[i,r,a,s]}static bezierBoundingBox(t,e,i,a,r,s,n,o){const l=[],c=[[],[]];let d,h,u,p,f,g,v,m;for(let c=0;c<2;++c){if(0===c){h=6*t-12*i+6*r;d=-3*t+9*i-9*r+3*n;u=3*i-3*t}else{h=6*e-12*a+6*s;d=-3*e+9*a-9*s+3*o;u=3*a-3*e}if(Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h;0<p&&p<1&&l.push(p)}else{v=h*h-4*u*d;m=Math.sqrt(v);if(!(v<0)){f=(-h+m)/(2*d);0<f&&f<1&&l.push(f);g=(-h-m)/(2*d);0<g&&g<1&&l.push(g)}}}let _,b=l.length;const y=b;for(;b--;){p=l[b];_=1-p;c[0][b]=_*_*_*t+3*_*_*p*i+3*_*p*p*r+p*p*p*n;c[1][b]=_*_*_*e+3*_*_*p*a+3*_*p*p*s+p*p*p*o}c[0][y]=t;c[1][y]=e;c[0][y+1]=n;c[1][y+1]=o;c[0].length=c[1].length=y+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=Util;const o=[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 stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,e,i)=>{"use strict";!function checkDOMMatrix(){globalThis.DOMMatrix}();!function checkPath2D(){globalThis.Path2D}();!function checkReadableStream(){globalThis.ReadableStream}();!function checkArrayAt(){Array.prototype.at||i(3)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(77)}();!function checkStructuredClone(){globalThis.structuredClone||i(89)}()},(t,e,i)=>{i(4);var a=i(76);t.exports=a("Array","at")},(t,e,i)=>{"use strict";var a=i(5),r=i(42),s=i(66),n=i(64),o=i(71);a({target:"Array",proto:!0},{at:function at(t){var e=r(this),i=s(e),a=n(t),o=a>=0?a:i+a;return o<0||o>=i?void 0:e[o]}});o("at")},(t,e,i)=>{var a=i(6),r=i(7).f,s=i(46),n=i(50),o=i(40),l=i(58),c=i(70);t.exports=function(t,e){var i,d,h,u,p,f=t.target,g=t.global,v=t.stat;if(i=g?a:v?a[f]||o(f,{}):(a[f]||{}).prototype)for(d in e){u=e[d];h=t.dontCallGetSet?(p=r(i,d))&&p.value:i[d];if(!c(g?d:f+(v?".":"#")+d,t.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(t.sham||h&&h.sham)&&s(u,"sham",!0);n(i,d,u,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,e,i)=>{var a=i(8),r=i(10),s=i(12),n=i(13),o=i(14),l=i(20),c=i(41),d=i(44),h=Object.getOwnPropertyDescriptor;e.f=a?h:function getOwnPropertyDescriptor(t,e){t=o(t);e=l(e);if(d)try{return h(t,e)}catch(t){}if(c(t,e))return n(!r(s.f,t,e),t[e])}},(t,e,i)=>{var a=i(9);t.exports=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,i)=>{var a=i(11),r=Function.prototype.call;t.exports=a?r.bind(r):function(){return r.apply(r,arguments)}},(t,e,i)=>{var a=i(9);t.exports=!a((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,e)=>{"use strict";var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,r=a&&!i.call({1:2},1);e.f=r?function propertyIsEnumerable(t){var e=a(this,t);return!!e&&e.enumerable}:i},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,i)=>{var a=i(15),r=i(18);t.exports=function(t){return a(r(t))}},(t,e,i)=>{var a=i(16),r=i(9),s=i(17),n=Object,o=a("".split);t.exports=r((function(){return!n("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?o(t,""):n(t)}:n},(t,e,i)=>{var a=i(11),r=Function.prototype,s=r.call,n=a&&r.bind.bind(s,s);t.exports=a?n:function(t){return function(){return s.apply(t,arguments)}}},(t,e,i)=>{var a=i(16),r=a({}.toString),s=a("".slice);t.exports=function(t){return s(r(t),8,-1)}},(t,e,i)=>{var a=i(19),r=TypeError;t.exports=function(t){if(a(t))throw r("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,i)=>{var a=i(21),r=i(25);t.exports=function(t){var e=a(t,"string");return r(e)?e:e+""}},(t,e,i)=>{var a=i(10),r=i(22),s=i(25),n=i(32),o=i(35),l=i(36),c=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!r(t)||s(t))return t;var i,l=n(t,d);if(l){void 0===e&&(e="default");i=a(l,t,e);if(!r(i)||s(i))return i;throw c("Can't convert object to primitive value")}void 0===e&&(e="number");return o(t,e)}},(t,e,i)=>{var a=i(23),r=i(24),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:a(t)||t===s}:function(t){return"object"==typeof t?null!==t:a(t)}},(t,e,i)=>{var a=i(24),r=a.all;t.exports=a.IS_HTMLDDA?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,i=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:i}},(t,e,i)=>{var a=i(26),r=i(23),s=i(27),n=i(28),o=Object;t.exports=n?function(t){return"symbol"==typeof t}:function(t){var e=a("Symbol");return r(e)&&s(e.prototype,o(t))}},(t,e,i)=>{var a=i(6),r=i(23);t.exports=function(t,e){return arguments.length<2?(i=a[t],r(i)?i:void 0):a[t]&&a[t][e];var i}},(t,e,i)=>{var a=i(16);t.exports=a({}.isPrototypeOf)},(t,e,i)=>{var a=i(29);t.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,i)=>{var a=i(30),r=i(9);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},(t,e,i)=>{var a,r,s=i(6),n=i(31),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(r=(a=d.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1]));!r&&n&&(!(a=n.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=n.match(/Chrome\/(\d+)/))&&(r=+a[1]);t.exports=r},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,i)=>{var a=i(33),r=i(19);t.exports=function(t,e){var i=t[e];return r(i)?void 0:a(i)}},(t,e,i)=>{var a=i(23),r=i(34),s=TypeError;t.exports=function(t){if(a(t))return t;throw s(r(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,i)=>{var a=i(10),r=i(23),s=i(22),n=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&r(i=t.toString)&&!s(o=a(i,t)))return o;if(r(i=t.valueOf)&&!s(o=a(i,t)))return o;if("string"!==e&&r(i=t.toString)&&!s(o=a(i,t)))return o;throw n("Can't convert object to primitive value")}},(t,e,i)=>{var a=i(6),r=i(37),s=i(41),n=i(43),o=i(29),l=i(28),c=a.Symbol,d=r("wks"),h=l?c.for||c:c&&c.withoutSetter||n;t.exports=function(t){s(d,t)||(d[t]=o&&s(c,t)?c[t]:h("Symbol."+t));return d[t]}},(t,e,i)=>{var a=i(38),r=i(39);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.30.0",mode:a?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.0/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,i)=>{var a=i(6),r=i(40),s="__core-js_shared__",n=a[s]||r(s,{});t.exports=n},(t,e,i)=>{var a=i(6),r=Object.defineProperty;t.exports=function(t,e){try{r(a,t,{value:e,configurable:!0,writable:!0})}catch(i){a[t]=e}return e}},(t,e,i)=>{var a=i(16),r=i(42),s=a({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return s(r(t),e)}},(t,e,i)=>{var a=i(18),r=Object;t.exports=function(t){return r(a(t))}},(t,e,i)=>{var a=i(16),r=0,s=Math.random(),n=a(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++r+s,36)}},(t,e,i)=>{var a=i(8),r=i(9),s=i(45);t.exports=!a&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},(t,e,i)=>{var a=i(6),r=i(22),s=a.document,n=r(s)&&r(s.createElement);t.exports=function(t){return n?s.createElement(t):{}}},(t,e,i)=>{var a=i(8),r=i(47),s=i(13);t.exports=a?function(t,e,i){return r.f(t,e,s(1,i))}:function(t,e,i){t[e]=i;return t}},(t,e,i)=>{var a=i(8),r=i(44),s=i(48),n=i(49),o=i(20),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",p="writable";e.f=a?s?function defineProperty(t,e,i){n(t);e=o(e);n(i);if("function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i[p]){var a=d(t,e);if(a&&a[p]){t[e]=i.value;i={configurable:u in i?i[u]:a[u],enumerable:h in i?i[h]:a[h],writable:!1}}}return c(t,e,i)}:c:function defineProperty(t,e,i){n(t);e=o(e);n(i);if(r)try{return c(t,e,i)}catch(t){}if("get"in i||"set"in i)throw l("Accessors not supported");"value"in i&&(t[e]=i.value);return t}},(t,e,i)=>{var a=i(8),r=i(9);t.exports=a&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,i)=>{var a=i(22),r=String,s=TypeError;t.exports=function(t){if(a(t))return t;throw s(r(t)+" is not an object")}},(t,e,i)=>{var a=i(23),r=i(47),s=i(51),n=i(40);t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;a(i)&&s(i,c,o);if(o.global)l?t[e]=i:n(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:r.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,i)=>{var a=i(16),r=i(9),s=i(23),n=i(41),o=i(8),l=i(52).CONFIGURABLE,c=i(53),d=i(54),h=d.enforce,u=d.get,p=String,f=Object.defineProperty,g=a("".slice),v=a("".replace),m=a([].join),_=o&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),y=t.exports=function(t,e,i){"Symbol("===g(p(e),0,7)&&(e="["+v(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(e="get "+e);i&&i.setter&&(e="set "+e);(!n(t,"name")||l&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e);_&&i&&n(i,"arity")&&t.length!==i.arity&&f(t,"length",{value:i.arity});try{i&&n(i,"constructor")&&i.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var a=h(t);n(a,"source")||(a.source=m(b,"string"==typeof e?e:""));return t};Function.prototype.toString=y((function toString(){return s(this)&&u(this).source||c(this)}),"toString")},(t,e,i)=>{var a=i(8),r=i(41),s=Function.prototype,n=a&&Object.getOwnPropertyDescriptor,o=r(s,"name"),l=o&&"something"===function something(){}.name,c=o&&(!a||a&&n(s,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,i)=>{var a=i(16),r=i(23),s=i(39),n=a(Function.toString);r(s.inspectSource)||(s.inspectSource=function(t){return n(t)});t.exports=s.inspectSource},(t,e,i)=>{var a,r,s,n=i(55),o=i(6),l=i(22),c=i(46),d=i(41),h=i(39),u=i(56),p=i(57),f="Object already initialized",g=o.TypeError,v=o.WeakMap;if(n||h.state){var m=h.state||(h.state=new v);m.get=m.get;m.has=m.has;m.set=m.set;a=function(t,e){if(m.has(t))throw g(f);e.facade=t;m.set(t,e);return e};r=function(t){return m.get(t)||{}};s=function(t){return m.has(t)}}else{var _=u("state");p[_]=!0;a=function(t,e){if(d(t,_))throw g(f);e.facade=t;c(t,_,e);return e};r=function(t){return d(t,_)?t[_]:{}};s=function(t){return d(t,_)}}t.exports={set:a,get:r,has:s,enforce:function(t){return s(t)?r(t):a(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=r(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return i}}}},(t,e,i)=>{var a=i(6),r=i(23),s=a.WeakMap;t.exports=r(s)&&/native code/.test(String(s))},(t,e,i)=>{var a=i(37),r=i(43),s=a("keys");t.exports=function(t){return s[t]||(s[t]=r(t))}},t=>{t.exports={}},(t,e,i)=>{var a=i(41),r=i(59),s=i(7),n=i(47);t.exports=function(t,e,i){for(var o=r(e),l=n.f,c=s.f,d=0;d<o.length;d++){var h=o[d];a(t,h)||i&&a(i,h)||l(t,h,c(e,h))}}},(t,e,i)=>{var a=i(26),r=i(16),s=i(60),n=i(69),o=i(49),l=r([].concat);t.exports=a("Reflect","ownKeys")||function ownKeys(t){var e=s.f(o(t)),i=n.f;return i?l(e,i(t)):e}},(t,e,i)=>{var a=i(61),r=i(68).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return a(t,r)}},(t,e,i)=>{var a=i(16),r=i(41),s=i(14),n=i(62).indexOf,o=i(57),l=a([].push);t.exports=function(t,e){var i,a=s(t),c=0,d=[];for(i in a)!r(o,i)&&r(a,i)&&l(d,i);for(;e.length>c;)r(a,i=e[c++])&&(~n(d,i)||l(d,i));return d}},(t,e,i)=>{var a=i(14),r=i(63),s=i(66),createMethod=function(t){return function(e,i,n){var o,l=a(e),c=s(l),d=r(n,c);if(t&&i!=i){for(;c>d;)if((o=l[d++])!=o)return!0}else for(;c>d;d++)if((t||d in l)&&l[d]===i)return t||d||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,i)=>{var a=i(64),r=Math.max,s=Math.min;t.exports=function(t,e){var i=a(t);return i<0?r(i+e,0):s(i,e)}},(t,e,i)=>{var a=i(65);t.exports=function(t){var e=+t;return e!=e||0===e?0:a(e)}},t=>{var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function trunc(t){var a=+t;return(a>0?i:e)(a)}},(t,e,i)=>{var a=i(67);t.exports=function(t){return a(t.length)}},(t,e,i)=>{var a=i(64),r=Math.min;t.exports=function(t){return t>0?r(a(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,i)=>{var a=i(9),r=i(23),s=/#|\.prototype\./,isForced=function(t,e){var i=o[n(t)];return i==c||i!=l&&(r(e)?a(e):!!e)},n=isForced.normalize=function(t){return String(t).replace(s,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,i)=>{var a=i(36),r=i(72),s=i(47).f,n=a("unscopables"),o=Array.prototype;null==o[n]&&s(o,n,{configurable:!0,value:r(null)});t.exports=function(t){o[n][t]=!0}},(t,e,i)=>{var a,r=i(49),s=i(73),n=i(68),o=i(57),l=i(75),c=i(45),d=i(56),h="prototype",u="script",p=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+"</"+u+">"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{a=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&a?NullProtoObjectViaActiveX(a):function(){var t,e=c("iframe"),i="java"+u+":";e.style.display="none";l.appendChild(e);e.src=String(i);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(a);for(var t=n.length;t--;)delete NullProtoObject[h][n[t]];return NullProtoObject()};o[p]=!0;t.exports=Object.create||function create(t,e){var i;if(null!==t){EmptyConstructor[h]=r(t);i=new EmptyConstructor;EmptyConstructor[h]=null;i[p]=t}else i=NullProtoObject();return void 0===e?i:s.f(i,e)}},(t,e,i)=>{var a=i(8),r=i(48),s=i(47),n=i(49),o=i(14),l=i(74);e.f=a&&!r?Object.defineProperties:function defineProperties(t,e){n(t);for(var i,a=o(e),r=l(e),c=r.length,d=0;c>d;)s.f(t,i=r[d++],a[i]);return t}},(t,e,i)=>{var a=i(61),r=i(68);t.exports=Object.keys||function keys(t){return a(t,r)}},(t,e,i)=>{var a=i(26);t.exports=a("document","documentElement")},(t,e,i)=>{var a=i(6),r=i(16);t.exports=function(t,e){return r(a[t].prototype[e])}},(t,e,i)=>{i(78)},(t,e,i)=>{"use strict";var a=i(79),r=i(66),s=i(64),n=a.aTypedArray;(0,a.exportTypedArrayMethod)("at",(function at(t){var e=n(this),i=r(e),a=s(t),o=a>=0?a:i+a;return o<0||o>=i?void 0:e[o]}))},(t,e,i)=>{"use strict";var a,r,s,n=i(80),o=i(8),l=i(6),c=i(23),d=i(22),h=i(41),u=i(81),p=i(34),f=i(46),g=i(50),v=i(83),m=i(27),_=i(84),b=i(86),y=i(36),A=i(43),P=i(54),S=P.enforce,w=P.get,x=l.Int8Array,E=x&&x.prototype,C=l.Uint8ClampedArray,k=C&&C.prototype,M=x&&_(x),T=E&&_(E),R=Object.prototype,I=l.TypeError,D=y("toStringTag"),O=A("TYPED_ARRAY_TAG"),G="TypedArrayConstructor",L=n&&!!b&&"Opera"!==u(l.opera),N=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=_(t);if(d(e)){var i=w(e);return i&&h(i,G)?i[G]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!d(t))return!1;var e=u(t);return h(j,e)||h(B,e)};for(a in j)(s=(r=l[a])&&r.prototype)?S(s)[G]=r:L=!1;for(a in B)(s=(r=l[a])&&r.prototype)&&(S(s)[G]=r);if(!L||!c(M)||M===Function.prototype){M=function TypedArray(){throw I("Incorrect invocation")};if(L)for(a in j)l[a]&&b(l[a],M)}if(!L||!T||T===R){T=M.prototype;if(L)for(a in j)l[a]&&b(l[a].prototype,T)}L&&_(k)!==T&&b(k,T);if(o&&!h(T,D)){N=!0;v(T,D,{configurable:!0,get:function(){return d(this)?this[O]:void 0}});for(a in j)l[a]&&f(l[a],O,a)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:N&&O,aTypedArray:function(t){if(isTypedArray(t))return t;throw I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||m(M,t)))return t;throw I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,a){if(o){if(i)for(var r in j){var s=l[r];if(s&&h(s.prototype,t))try{delete s.prototype[t]}catch(i){try{s.prototype[t]=e}catch(t){}}}T[t]&&!i||g(T,t,i?e:L&&E[t]||e,a)}},exportTypedArrayStaticMethod:function(t,e,i){var a,r;if(o){if(b){if(i)for(a in j)if((r=l[a])&&h(r,t))try{delete r[t]}catch(t){}if(M[t]&&!i)return;try{return g(M,t,i?e:L&&M[t]||e)}catch(t){}}for(a in j)!(r=l[a])||r[t]&&!i||g(r,t,e)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||h(j,e)||h(B,e)},isTypedArray:isTypedArray,TypedArray:M,TypedArrayPrototype:T}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,i)=>{var a=i(82),r=i(23),s=i(17),n=i(36)("toStringTag"),o=Object,l="Arguments"==s(function(){return arguments}());t.exports=a?s:function(t){var e,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=o(t),n))?i:l?s(e):"Object"==(a=s(e))&&r(e.callee)?"Arguments":a}},(t,e,i)=>{var a={};a[i(36)("toStringTag")]="z";t.exports="[object z]"===String(a)},(t,e,i)=>{var a=i(51),r=i(47);t.exports=function(t,e,i){i.get&&a(i.get,e,{getter:!0});i.set&&a(i.set,e,{setter:!0});return r.f(t,e,i)}},(t,e,i)=>{var a=i(41),r=i(23),s=i(42),n=i(56),o=i(85),l=n("IE_PROTO"),c=Object,d=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=s(t);if(a(e,l))return e[l];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof c?d:null}},(t,e,i)=>{var a=i(9);t.exports=!a((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,i)=>{var a=i(87),r=i(49),s=i(88);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=a(Object.prototype,"__proto__","set"))(i,[]);e=i instanceof Array}catch(t){}return function setPrototypeOf(i,a){r(i);s(a);e?t(i,a):i.__proto__=a;return i}}():void 0)},(t,e,i)=>{var a=i(16),r=i(33);t.exports=function(t,e,i){try{return a(r(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}},(t,e,i)=>{var a=i(23),r=String,s=TypeError;t.exports=function(t){if("object"==typeof t||a(t))return t;throw s("Can't set "+r(t)+" as a prototype")}},(t,e,i)=>{i(90);i(97);i(99);i(122);i(124);var a=i(136);t.exports=a.structuredClone},(t,e,i)=>{"use strict";var a=i(14),r=i(71),s=i(91),n=i(54),o=i(47).f,l=i(92),c=i(96),d=i(38),h=i(8),u="Array Iterator",p=n.set,f=n.getterFor(u);t.exports=l(Array,"Array",(function(t,e){p(this,{type:u,target:a(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,i=t.kind,a=t.index++;if(!e||a>=e.length){t.target=void 0;return c(void 0,!0)}return c("keys"==i?a:"values"==i?e[a]:[a,e[a]],!1)}),"values");var g=s.Arguments=s.Array;r("keys");r("values");r("entries");if(!d&&h&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(t){}},t=>{t.exports={}},(t,e,i)=>{"use strict";var a=i(5),r=i(10),s=i(38),n=i(52),o=i(23),l=i(93),c=i(84),d=i(86),h=i(95),u=i(46),p=i(50),f=i(36),g=i(91),v=i(94),m=n.PROPER,_=n.CONFIGURABLE,b=v.IteratorPrototype,y=v.BUGGY_SAFARI_ITERATORS,A=f("iterator"),P="keys",S="values",w="entries",returnThis=function(){return this};t.exports=function(t,e,i,n,f,v,x){l(i,e,n);var E,C,k,getIterationMethod=function(t){if(t===f&&D)return D;if(!y&&t in R)return R[t];switch(t){case P:return function keys(){return new i(this,t)};case S:return function values(){return new i(this,t)};case w:return function entries(){return new i(this,t)}}return function(){return new i(this)}},M=e+" Iterator",T=!1,R=t.prototype,I=R[A]||R["@@iterator"]||f&&R[f],D=!y&&I||getIterationMethod(f),O="Array"==e&&R.entries||I;if(O&&(E=c(O.call(new t)))!==Object.prototype&&E.next){s||c(E)===b||(d?d(E,b):o(E[A])||p(E,A,returnThis));h(E,M,!0,!0);s&&(g[M]=returnThis)}if(m&&f==S&&I&&I.name!==S)if(!s&&_)u(R,"name",S);else{T=!0;D=function values(){return r(I,this)}}if(f){C={values:getIterationMethod(S),keys:v?D:getIterationMethod(P),entries:getIterationMethod(w)};if(x)for(k in C)(y||T||!(k in R))&&p(R,k,C[k]);else a({target:e,proto:!0,forced:y||T},C)}s&&!x||R[A]===D||p(R,A,D,{name:f});g[e]=D;return C}},(t,e,i)=>{"use strict";var a=i(94).IteratorPrototype,r=i(72),s=i(13),n=i(95),o=i(91),returnThis=function(){return this};t.exports=function(t,e,i,l){var c=e+" Iterator";t.prototype=r(a,{next:s(+!l,i)});n(t,c,!1,!0);o[c]=returnThis;return t}},(t,e,i)=>{"use strict";var a,r,s,n=i(9),o=i(23),l=i(22),c=i(72),d=i(84),h=i(50),u=i(36),p=i(38),f=u("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(r=d(d(s)))!==Object.prototype&&(a=r):g=!0);!l(a)||n((function(){var t={};return a[f].call(t)!==t}))?a={}:p&&(a=c(a));o(a[f])||h(a,f,(function(){return this}));t.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:g}},(t,e,i)=>{var a=i(47).f,r=i(41),s=i(36)("toStringTag");t.exports=function(t,e,i){t&&!i&&(t=t.prototype);t&&!r(t,s)&&a(t,s,{configurable:!0,value:e})}},t=>{t.exports=function(t,e){return{value:t,done:e}}},(t,e,i)=>{var a=i(82),r=i(50),s=i(98);a||r(Object.prototype,"toString",s,{unsafe:!0})},(t,e,i)=>{"use strict";var a=i(82),r=i(81);t.exports=a?{}.toString:function toString(){return"[object "+r(this)+"]"}},(t,e,i)=>{i(100)},(t,e,i)=>{"use strict";i(101)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),i(119))},(t,e,i)=>{"use strict";var a=i(5),r=i(6),s=i(16),n=i(70),o=i(50),l=i(102),c=i(109),d=i(116),h=i(23),u=i(19),p=i(22),f=i(9),g=i(117),v=i(95),m=i(118);t.exports=function(t,e,i){var _=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),y=_?"set":"add",A=r[t],P=A&&A.prototype,S=A,w={},fixMethod=function(t){var e=s(P[t]);o(P,t,"add"==t?function add(t){e(this,0===t?0:t);return this}:"delete"==t?function(t){return!(b&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function get(t){return b&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function has(t){return!(b&&!p(t))&&e(this,0===t?0:t)}:function set(t,i){e(this,0===t?0:t,i);return this})};if(n(t,!h(A)||!(b||P.forEach&&!f((function(){(new A).entries().next()}))))){S=i.getConstructor(e,t,_,y);l.enable()}else if(n(t,!0)){var x=new S,E=x[y](b?{}:-0,1)!=x,C=f((function(){x.has(1)})),k=g((function(t){new A(t)})),M=!b&&f((function(){for(var t=new A,e=5;e--;)t[y](e,e);return!t.has(-0)}));if(!k){(S=e((function(t,e){d(t,P);var i=m(new A,t,S);u(e)||c(e,i[y],{that:i,AS_ENTRIES:_});return i}))).prototype=P;P.constructor=S}if(C||M){fixMethod("delete");fixMethod("has");_&&fixMethod("get")}(M||E)&&fixMethod(y);b&&P.clear&&delete P.clear}w[t]=S;a({global:!0,constructor:!0,forced:S!=A},w);v(S,t);b||i.setStrong(S,t,_);return S}},(t,e,i)=>{var a=i(5),r=i(16),s=i(57),n=i(22),o=i(41),l=i(47).f,c=i(60),d=i(103),h=i(106),u=i(43),p=i(108),f=!1,g=u("meta"),v=0,setMetadata=function(t){l(t,g,{value:{objectID:"O"+v++,weakData:{}}})},m=t.exports={enable:function(){m.enable=function(){};f=!0;var t=c.f,e=r([].splice),i={};i[g]=1;if(t(i).length){c.f=function(i){for(var a=t(i),r=0,s=a.length;r<s;r++)if(a[r]===g){e(a,r,1);break}return a};a({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f})}},fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,g)){if(!h(t))return"F";if(!e)return"E";setMetadata(t)}return t[g].objectID},getWeakData:function(t,e){if(!o(t,g)){if(!h(t))return!0;if(!e)return!1;setMetadata(t)}return t[g].weakData},onFreeze:function(t){p&&f&&h(t)&&!o(t,g)&&setMetadata(t);return t}};s[g]=!0},(t,e,i)=>{var a=i(17),r=i(14),s=i(60).f,n=i(104),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return o&&"Window"==a(t)?function(t){try{return s(t)}catch(t){return n(o)}}(t):s(r(t))}},(t,e,i)=>{var a=i(63),r=i(66),s=i(105),n=Array,o=Math.max;t.exports=function(t,e,i){for(var l=r(t),c=a(e,l),d=a(void 0===i?l:i,l),h=n(o(d-c,0)),u=0;c<d;c++,u++)s(h,u,t[c]);h.length=u;return h}},(t,e,i)=>{"use strict";var a=i(20),r=i(47),s=i(13);t.exports=function(t,e,i){var n=a(e);n in t?r.f(t,n,s(0,i)):t[n]=i}},(t,e,i)=>{var a=i(9),r=i(22),s=i(17),n=i(107),o=Object.isExtensible,l=a((function(){o(1)}));t.exports=l||n?function isExtensible(t){return!!r(t)&&((!n||"ArrayBuffer"!=s(t))&&(!o||o(t)))}:o},(t,e,i)=>{var a=i(9);t.exports=a((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,e,i)=>{var a=i(9);t.exports=!a((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,e,i)=>{var a=i(110),r=i(10),s=i(49),n=i(34),o=i(112),l=i(66),c=i(27),d=i(113),h=i(114),u=i(115),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},f=Result.prototype;t.exports=function(t,e,i){var g,v,m,_,b,y,A,P=i&&i.that,S=!(!i||!i.AS_ENTRIES),w=!(!i||!i.IS_RECORD),x=!(!i||!i.IS_ITERATOR),E=!(!i||!i.INTERRUPTED),C=a(e,P),stop=function(t){g&&u(g,"normal",t);return new Result(!0,t)},callFn=function(t){if(S){s(t);return E?C(t[0],t[1],stop):C(t[0],t[1])}return E?C(t,stop):C(t)};if(w)g=t.iterator;else if(x)g=t;else{if(!(v=h(t)))throw p(n(t)+" is not iterable");if(o(v)){for(m=0,_=l(t);_>m;m++)if((b=callFn(t[m]))&&c(f,b))return b;return new Result(!1)}g=d(t,v)}y=w?t.next:g.next;for(;!(A=r(y,g)).done;){try{b=callFn(A.value)}catch(t){u(g,"throw",t)}if("object"==typeof b&&b&&c(f,b))return b}return new Result(!1)}},(t,e,i)=>{var a=i(111),r=i(33),s=i(11),n=a(a.bind);t.exports=function(t,e){r(t);return void 0===e?t:s?n(t,e):function(){return t.apply(e,arguments)}}},(t,e,i)=>{var a=i(17),r=i(16);t.exports=function(t){if("Function"===a(t))return r(t)}},(t,e,i)=>{var a=i(36),r=i(91),s=a("iterator"),n=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||n[s]===t)}},(t,e,i)=>{var a=i(10),r=i(33),s=i(49),n=i(34),o=i(114),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(r(i))return s(a(i,t));throw l(n(t)+" is not iterable")}},(t,e,i)=>{var a=i(81),r=i(32),s=i(19),n=i(91),o=i(36)("iterator");t.exports=function(t){if(!s(t))return r(t,o)||r(t,"@@iterator")||n[a(t)]}},(t,e,i)=>{var a=i(10),r=i(49),s=i(32);t.exports=function(t,e,i){var n,o;r(t);try{if(!(n=s(t,"return"))){if("throw"===e)throw i;return i}n=a(n,t)}catch(t){o=!0;n=t}if("throw"===e)throw i;if(o)throw n;r(n);return i}},(t,e,i)=>{var a=i(27),r=TypeError;t.exports=function(t,e){if(a(e,t))return t;throw r("Incorrect invocation")}},(t,e,i)=>{var a=i(36)("iterator"),r=!1;try{var s=0,n={next:function(){return{done:!!s++}},return:function(){r=!0}};n[a]=function(){return this};Array.from(n,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var s={};s[a]=function(){return{next:function(){return{done:i=!0}}}};t(s)}catch(t){}return i}},(t,e,i)=>{var a=i(23),r=i(22),s=i(86);t.exports=function(t,e,i){var n,o;s&&a(n=e.constructor)&&n!==i&&r(o=n.prototype)&&o!==i.prototype&&s(t,o);return t}},(t,e,i)=>{"use strict";var a=i(72),r=i(83),s=i(120),n=i(110),o=i(116),l=i(19),c=i(109),d=i(92),h=i(96),u=i(121),p=i(8),f=i(102).fastKey,g=i(54),v=g.set,m=g.getterFor;t.exports={getConstructor:function(t,e,i,d){var h=t((function(t,r){o(t,u);v(t,{type:e,index:a(null),first:void 0,last:void 0,size:0});p||(t.size=0);l(r)||c(r,t[d],{that:t,AS_ENTRIES:i})})),u=h.prototype,g=m(e),define=function(t,e,i){var a,r,s=g(t),n=getEntry(t,e);if(n)n.value=i;else{s.last=n={index:r=f(e,!0),key:e,value:i,previous:a=s.last,next:void 0,removed:!1};s.first||(s.first=n);a&&(a.next=n);p?s.size++:t.size++;"F"!==r&&(s.index[r]=n)}return t},getEntry=function(t,e){var i,a=g(t),r=f(e);if("F"!==r)return a.index[r];for(i=a.first;i;i=i.next)if(i.key==e)return i};s(u,{clear:function clear(){for(var t=g(this),e=t.index,i=t.first;i;){i.removed=!0;i.previous&&(i.previous=i.previous.next=void 0);delete e[i.index];i=i.next}t.first=t.last=void 0;p?t.size=0:this.size=0},delete:function(t){var e=this,i=g(e),a=getEntry(e,t);if(a){var r=a.next,s=a.previous;delete i.index[a.index];a.removed=!0;s&&(s.next=r);r&&(r.previous=s);i.first==a&&(i.first=r);i.last==a&&(i.last=s);p?i.size--:e.size--}return!!a},forEach:function forEach(t){for(var e,i=g(this),a=n(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;){a(e.value,e.key,this);for(;e&&e.removed;)e=e.previous}},has:function has(t){return!!getEntry(this,t)}});s(u,i?{get:function get(t){var e=getEntry(this,t);return e&&e.value},set:function set(t,e){return define(this,0===t?0:t,e)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});p&&r(u,"size",{configurable:!0,get:function(){return g(this).size}});return h},setStrong:function(t,e,i){var a=e+" Iterator",r=m(e),s=m(a);d(t,e,(function(t,e){v(this,{type:a,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;if(!t.target||!(t.last=i=i?i.next:t.state.first)){t.target=void 0;return h(void 0,!0)}return h("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1)}),i?"entries":"values",!i,!0);u(e)}}},(t,e,i)=>{var a=i(50);t.exports=function(t,e,i){for(var r in e)a(t,r,e[r],i);return t}},(t,e,i)=>{"use strict";var a=i(26),r=i(83),s=i(36),n=i(8),o=s("species");t.exports=function(t){var e=a(t);n&&e&&!e[o]&&r(e,o,{configurable:!0,get:function(){return this}})}},(t,e,i)=>{i(123)},(t,e,i)=>{"use strict";i(101)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),i(119))},(t,e,i)=>{var a,r=i(38),s=i(5),n=i(6),o=i(26),l=i(16),c=i(9),d=i(43),h=i(23),u=i(125),p=i(19),f=i(22),g=i(25),v=i(109),m=i(49),_=i(81),b=i(41),y=i(105),A=i(46),P=i(66),S=i(126),w=i(127),x=i(129),E=i(130),C=i(131),k=i(132),M=n.Object,T=n.Array,R=n.Date,I=n.Error,D=n.EvalError,O=n.RangeError,G=n.ReferenceError,L=n.SyntaxError,N=n.TypeError,j=n.URIError,B=n.PerformanceMark,W=n.WebAssembly,U=W&&W.CompileError||I,q=W&&W.LinkError||I,V=W&&W.RuntimeError||I,H=o("DOMException"),z=x.Map,X=x.has,$=x.get,Y=x.set,K=E.Set,J=E.add,Q=o("Object","keys"),Z=l([].push),tt=l((!0).valueOf),et=l(1..valueOf),it=l("".valueOf),rt=l(R.prototype.getTime),st=d("structuredClone"),nt="DataCloneError",ot="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new n.Set([7]),i=t(e),a=t(M(7));return i==e||!i.has(7)||"object"!=typeof a||7!=a}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var i=new e,a=t({a:i,b:i});return!(a&&a.a===a.b&&a.a instanceof e&&a.a.stack===i.stack)}))},lt=n.structuredClone,ct=r||!checkErrorsCloning(lt,I)||!checkErrorsCloning(lt,H)||!(a=lt,!c((function(){var t=a(new n.AggregateError([1],st,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=st||3!=t.cause}))),dt=!lt&&checkBasicSemantic((function(t){return new B(st,{detail:t}).detail})),ht=checkBasicSemantic(lt)||dt,throwUncloneable=function(t){throw new H("Uncloneable type: "+t,nt)},throwUnpolyfillable=function(t,e){throw new H((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",nt)},structuredCloneInternal=function(t,e){g(t)&&throwUncloneable("Symbol");if(!f(t))return t;if(e){if(X(e,t))return $(e,t)}else e=new z;var i,a,r,s,l,c,d,u,p,v,m,S=_(t),x=!1;switch(S){case"Array":r=T(P(t));x=!0;break;case"Object":r={};x=!0;break;case"Map":r=new z;x=!0;break;case"Set":r=new K;x=!0;break;case"RegExp":r=new RegExp(t.source,w(t));break;case"Error":switch(a=t.name){case"AggregateError":r=o("AggregateError")([]);break;case"EvalError":r=D();break;case"RangeError":r=O();break;case"ReferenceError":r=G();break;case"SyntaxError":r=L();break;case"TypeError":r=N();break;case"URIError":r=j();break;case"CompileError":r=U();break;case"LinkError":r=q();break;case"RuntimeError":r=V();break;default:r=I()}x=!0;break;case"DOMException":r=new H(t.message,t.name);x=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=n[S];f(i)||throwUnpolyfillable(S);r=new i(structuredCloneInternal(t.buffer,e),t.byteOffset,"DataView"===S?t.byteLength:t.length);break;case"DOMQuad":try{r=new DOMQuad(structuredCloneInternal(t.p1,e),structuredCloneInternal(t.p2,e),structuredCloneInternal(t.p3,e),structuredCloneInternal(t.p4,e))}catch(e){ht?r=ht(t):throwUnpolyfillable(S)}break;case"FileList":if(s=function(){var t;try{t=new n.DataTransfer}catch(e){try{t=new n.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(l=0,c=P(t);l<c;l++)s.items.add(structuredCloneInternal(t[l],e));r=s.files}else ht?r=ht(t):throwUnpolyfillable(S);break;case"ImageData":try{r=new ImageData(structuredCloneInternal(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){ht?r=ht(t):throwUnpolyfillable(S)}break;default:if(ht)r=ht(t);else switch(S){case"BigInt":r=M(t.valueOf());break;case"Boolean":r=M(tt(t));break;case"Number":r=M(et(t));break;case"String":r=M(it(t));break;case"Date":r=new R(rt(t));break;case"ArrayBuffer":(i=n.DataView)||"function"==typeof t.slice||throwUnpolyfillable(S);try{if("function"!=typeof t.slice||t.resizable){c=t.byteLength;m="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0;r=new ArrayBuffer(c,m);p=new i(t);v=new i(r);for(l=0;l<c;l++)v.setUint8(l,p.getUint8(l))}else r=t.slice(0)}catch(t){throw new H("ArrayBuffer is detached",nt)}break;case"SharedArrayBuffer":r=t;break;case"Blob":try{r=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(S)}break;case"DOMPoint":case"DOMPointReadOnly":i=n[S];try{r=i.fromPoint?i.fromPoint(t):new i(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(S)}break;case"DOMRect":case"DOMRectReadOnly":i=n[S];try{r=i.fromRect?i.fromRect(t):new i(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(S)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=n[S];try{r=i.fromMatrix?i.fromMatrix(t):new i(t)}catch(t){throwUnpolyfillable(S)}break;case"AudioData":case"VideoFrame":h(t.clone)||throwUnpolyfillable(S);try{r=t.clone()}catch(t){throwUncloneable(S)}break;case"File":try{r=new File([t],t.name,t)}catch(t){throwUnpolyfillable(S)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(S);default:throwUncloneable(S)}}Y(e,t,r);if(x)switch(S){case"Array":case"Object":d=Q(t);for(l=0,c=P(d);l<c;l++){u=d[l];y(r,u,structuredCloneInternal(t[u],e))}break;case"Map":t.forEach((function(t,i){Y(r,structuredCloneInternal(i,e),structuredCloneInternal(t,e))}));break;case"Set":t.forEach((function(t){J(r,structuredCloneInternal(t,e))}));break;case"Error":A(r,"message",structuredCloneInternal(t.message,e));b(t,"cause")&&A(r,"cause",structuredCloneInternal(t.cause,e));"AggregateError"==a&&(r.errors=structuredCloneInternal(t.errors,e));case"DOMException":C&&A(r,"stack",structuredCloneInternal(t.stack,e))}return r};s({global:!0,enumerable:!0,sham:!k,forced:ct},{structuredClone:function structuredClone(t){var e,i=S(arguments.length,1)>1&&!p(arguments[1])?m(arguments[1]):void 0,a=i?i.transfer:void 0;void 0!==a&&function(t,e){if(!f(t))throw N("Transfer option cannot be converted to a sequence");var i=[];v(t,(function(t){Z(i,m(t))}));var a,r,s,o,l,c,d=0,p=P(i);if(k){o=lt(i,{transfer:i});for(;d<p;)Y(e,i[d],o[d++])}else for(;d<p;){a=i[d++];if(X(e,a))throw new H("Duplicate transferable",nt);switch(r=_(a)){case"ImageBitmap":s=n.OffscreenCanvas;u(s)||throwUnpolyfillable(r,ot);try{(c=new s(a.width,a.height)).getContext("bitmaprenderer").transferFromImageBitmap(a);l=c.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":h(a.clone)&&h(a.close)||throwUnpolyfillable(r,ot);try{l=a.clone();a.close()}catch(t){}break;case"ArrayBuffer":h(a.transfer)||throwUnpolyfillable(r,ot);l=a.transfer();break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(r,ot)}if(void 0===l)throw new H("This object cannot be transferred: "+r,nt);Y(e,a,l)}}(a,e=new z);return structuredCloneInternal(t,e)}})},(t,e,i)=>{var a=i(16),r=i(9),s=i(23),n=i(81),o=i(26),l=i(53),noop=function(){},c=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=a(h.exec),p=!h.exec(noop),f=function isConstructor(t){if(!s(t))return!1;try{d(noop,c,t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!s(t))return!1;switch(n(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(h,l(t))}catch(t){return!0}};g.sham=!0;t.exports=!d||r((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},t=>{var e=TypeError;t.exports=function(t,i){if(t<i)throw e("Not enough arguments");return t}},(t,e,i)=>{var a=i(10),r=i(41),s=i(27),n=i(128),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||r(t,"flags")||!s(o,t)?e:a(n,t)}},(t,e,i)=>{"use strict";var a=i(49);t.exports=function(){var t=a(this),e="";t.hasIndices&&(e+="d");t.global&&(e+="g");t.ignoreCase&&(e+="i");t.multiline&&(e+="m");t.dotAll&&(e+="s");t.unicode&&(e+="u");t.unicodeSets&&(e+="v");t.sticky&&(e+="y");return e}},(t,e,i)=>{var a=i(16),r=Map.prototype;t.exports={Map:Map,set:a(r.set),get:a(r.get),has:a(r.has),remove:a(r.delete),proto:r}},(t,e,i)=>{var a=i(16),r=Set.prototype;t.exports={Set:Set,add:a(r.add),has:a(r.has),remove:a(r.delete),proto:r}},(t,e,i)=>{var a=i(9),r=i(13);t.exports=!a((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",r(1,7));return 7!==t.stack}))},(t,e,i)=>{var a=i(6),r=i(9),s=i(30),n=i(133),o=i(134),l=i(135),c=a.structuredClone;t.exports=!!c&&!r((function(){if(o&&s>92||l&&s>94||n&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength}))},(t,e,i)=>{var a=i(134),r=i(135);t.exports=!a&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,i)=>{var a=i(17);t.exports="undefined"!=typeof process&&"process"==a(process)},(t,e,i)=>{var a=i(6);t.exports=a},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";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.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(138),_display_utils=__w_pdfjs_require__(141),_font_loader=__w_pdfjs_require__(144),_canvas=__w_pdfjs_require__(146),_worker_options=__w_pdfjs_require__(149),_is_node=__w_pdfjs_require__(145),_message_handler=__w_pdfjs_require__(150),_metadata=__w_pdfjs_require__(151),_optional_content_config=__w_pdfjs_require__(152),_transport_stream=__w_pdfjs_require__(153),_xfa_text=__w_pdfjs_require__(154);function _classStaticPrivateFieldSpecGet(t,e,i){_classCheckPrivateStaticAccess(t,e);_classCheckPrivateStaticFieldDescriptor(i,"get");return _classApplyDescriptorGet(t,i)}function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(t,e){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,e,"get"))}function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldSet(t,e,i){_classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,ServiceWorkerOptions={showUnverifiedSignatures:!1};window.ServiceWorkerOptions=ServiceWorkerOptions;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeFilterFactory:i,NodeStandardFontDataFactory:a}=__w_pdfjs_require__(155);exports.DefaultCanvasFactory=DefaultCanvasFactory=t;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e;exports.DefaultFilterFactory=DefaultFilterFactory=i;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=a}if(_is_node.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(156);createPDFNetworkStream=e=>new t(e)}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(159),{PDFFetchStream:e}=__w_pdfjs_require__(160);createPDFNetworkStream=i=>(0,_display_utils.isValidFetchUrl)(i.url)?new e(i):new t(i)}function getDocument(t){"string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t});if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const e=new PDFDocumentLoadingTask,{docId:i}=e,a=t.url?getUrlProp(t.url,t.baseHref):null,r=t.data?getDataProp(t.data):null,s=t.httpHeaders||null,n=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let d=t.worker instanceof PDFWorker?t.worker:null;const h=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="function"==typeof t.cMapUrl?t.cMapUrl():"string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,v="function"==typeof t.standardFontDataUrl?t.standardFontDataUrl():"string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,m=t.StandardFontDataFactory||DefaultStandardFontDataFactory,_=!0!==t.stopAtErrors,b=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,y=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_is_node.isNodeJS,P=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,S="boolean"==typeof t.disableFontFace?t.disableFontFace:_is_node.isNodeJS,w=!0===t.fontExtraProperties,x=!0===t.enableXfa,E=t.ownerDocument||globalThis.document,C=!0===t.disableRange,k=!0===t.disableStream,M=!0===t.disableAutoFetch,T=!0===t.pdfBug,R=l?l.length:t.length??NaN,I="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_is_node.isNodeJS&&!S,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&m===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(v,document.baseURI),O=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:E}),G=t.filterFactory||new DefaultFilterFactory({docId:i,ownerDocument:E});(0,_util.setVerbosityLevel)(h);const L={canvasFactory:O,filterFactory:G};if(!D){L.cMapReaderFactory=new g({baseUrl:p,isCompressed:f});L.standardFontDataFactory=new m({baseUrl:v})}if(!d){const t={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};d=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=d}const N={docId:i,apiVersion:"3.5.539",data:r,password:o,disableAutoFetch:M,rangeChunkSize:c,length:R,docBaseUrl:u,enableXfa:x,evaluatorOptions:{maxImageSize:b,disableFontFace:S,ignoreErrors:_,isEvalSupported:y,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:P,fontExtraProperties:w,useSystemFonts:I,cMapUrl:D?p:null,standardFontDataUrl:D?v:null}},j={ignoreErrors:_,isEvalSupported:y,disableFontFace:S,fontExtraProperties:w,enableXfa:x,ownerDocument:E,disableAutoFetch:M,pdfBug:T,styleElement:null};d.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(d,N),o=new Promise((function(t){let e;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:C,disableStream:k},l):r||(e=createPDFNetworkStream({url:a,length:R,httpHeaders:s,withCredentials:n,rangeChunkSize:c,disableRange:C,disableStream:k}));t(e)}));return Promise.all([t,o]).then((function(t){let[a,r]=t;if(e.destroyed)throw new Error("Loading aborted");const s=new _message_handler.MessageHandler(i,a,d.port),n=new WorkerTransport(s,e,r,j,L);e._transport=n;s.send("showUnverifiedSignatures",window.ServiceWorkerOptions.showUnverifiedSignatures);s.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const i=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return i}function getUrlProp(t,e){if(t instanceof URL)return t.href;try{return e?new URL(t,window.location.origin+e).href:new URL(t,window.location).href}catch(e){if(_is_node.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer){(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`.");return new Uint8Array(t)}if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(null==t?void 0:t.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}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}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0;await(null===(t=this._transport)||void 0===t?void 0:t.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t;this.initialData=e;this.progressiveDone=i;this.contentDispositionFilename=a;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(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const 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}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(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()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;var _delayedCleanupTimeout=new WeakMap,_pendingCleanup=new WeakMap,_tryCleanup=new WeakSet,_abortDelayedCleanup=new WeakSet;class PDFPageProxy{constructor(t,e,i){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];_classPrivateMethodInitSpec(this,_abortDelayedCleanup);_classPrivateMethodInitSpec(this,_tryCleanup);_classPrivateFieldInitSpec(this,_delayedCleanupTimeout,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_pendingCleanup,{writable:!0,value:!1});this._pageIndex=t;this._pageInfo=e;this._transport=i;this._stats=a?new _display_utils.StatTimer:null;this._pdfBug=a;this.commonObjs=i.commonObjs;this.objs=new PDFObjects;this._maybeCleanupAfterRender=!1;this._intentStates=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:a=0,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:a,dontFlip:r})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i;let{canvasContext:a,viewport:r,intent:s="display",annotationMode:n=_util.AnnotationMode.ENABLE,transform:o=null,background:l=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:h=null,printAnnotationStorage:u=null}=t;if(null!==(e=arguments[0])&&void 0!==e&&e.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");null===(i=this._stats)||void 0===i||i.time("Overall");const p=this._transport.getRenderingIntent(s,n,u);_classPrivateFieldSet(this,_pendingCleanup,!1);_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this);c||(c=this._transport.getOptionalContentConfig());let f=this._intentStates.get(p.cacheKey);if(!f){f=Object.create(null);this._intentStates.set(p.cacheKey,f)}if(f.streamReaderCancelTimeout){clearTimeout(f.streamReaderCancelTimeout);f.streamReaderCancelTimeout=null}const g=!!(p.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!f.displayReadyCapability){var v;f.displayReadyCapability=(0,_util.createPromiseCapability)();f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(v=this._stats)||void 0===v||v.time("Page Request");this._pumpOperatorList(p)}const complete=t=>{var e,i;f.renderTasks.delete(m);(this._maybeCleanupAfterRender||g)&&_classPrivateFieldSet(this,_pendingCleanup,!0);_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!g);if(t){m.capability.reject(t);this._abortOperatorList({intentState:f,reason:t instanceof Error?t:new Error(t)})}else m.capability.resolve();null===(e=this._stats)||void 0===e||e.timeEnd("Rendering");null===(i=this._stats)||void 0===i||i.timeEnd("Overall")},m=new InternalRenderTask({callback:complete,params:{canvasContext:a,viewport:r,transform:o,background:l},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:h});(f.renderTasks||=new Set).add(m);const _=m.task;Promise.all([f.displayReadyCapability.promise,c]).then((t=>{var e;let[i,a]=t;if(_classPrivateFieldGet(this,_pendingCleanup))complete();else{null===(e=this._stats)||void 0===e||e.time("Rendering");m.initializeGraphics({transparency:i,optionalContentConfig:a});m.operatorListChanged()}})).catch(complete);return _}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=this._transport.getRenderingIntent(t,e,i,!0);let r,s=this._intentStates.get(a.cacheKey);if(!s){s=Object.create(null);this._intentStates.set(a.cacheKey,s)}if(!s.opListReadCapability){var n;r=Object.create(null);r.operatorListChanged=function operatorListChanged(){if(s.operatorList.lastChunk){s.opListReadCapability.resolve(s.operatorList);s.renderTasks.delete(r)}};s.opListReadCapability=(0,_util.createPromiseCapability)();(s.renderTasks||=new Set).add(r);s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(n=this._stats)||void 0===n||n.time("Page Request");this._pumpOperatorList(a)}return s.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const a=e.getReader(),r={items:[],styles:Object.create(null)};!function pump(){a.read().then((function(e){let{value:i,done:a}=e;if(a)t(r);else{Object.assign(r.styles,i.styles);r.items.push(...i.items);pump()}}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const i of e.renderTasks){t.push(i.completed);i.cancel()}}this.objs.clear();_classPrivateFieldSet(this,_pendingCleanup,!1);_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this);return Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateFieldSet(this,_pendingCleanup,!0);const e=_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!1);t&&e&&(this._stats&&=new _display_utils.StatTimer);return e}_startRenderPage(t,e){var i,a;const r=this._intentStates.get(e);if(r){null===(i=this._stats)||void 0===i||i.timeEnd("Page Request");null===(a=r.displayReadyCapability)||void 0===a||a.resolve(t)}}_renderPageChunk(t,e){for(let i=0,a=t.length;i<a;i++){e.operatorList.fnArray.push(t.fnArray[i]);e.operatorList.argsArray.push(t.argsArray[i])}e.operatorList.lastChunk=t.lastChunk;e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageMap:a}=t;const r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:a}).getReader(),s=this._intentStates.get(i);s.streamReader=r;const pump=()=>{r.read().then((t=>{let{value:e,done:i}=t;if(i)s.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(e,s);pump()}}),(t=>{s.streamReader=null;if(!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(const t of s.renderTasks)t.operatorListChanged();_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!0)}if(s.displayReadyCapability)s.displayReadyCapability.reject(t);else{if(!s.opListReadCapability)throw t;s.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:i,force:a=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout){clearTimeout(e.streamReaderCancelTimeout);e.streamReaderCancelTimeout=null}if(!a){if(e.renderTasks.size>0)return;if(i instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay);e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:e,reason:i,force:!0})}),t);return}}e.streamReader.cancel(new _util.AbortException(i.message)).catch((()=>{}));e.streamReader=null;if(!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;function _tryCleanup2(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classPrivateMethodGet(this,_abortDelayedCleanup,_abortDelayedCleanup2).call(this);if(!_classPrivateFieldGet(this,_pendingCleanup))return!1;if(t){_classPrivateFieldSet(this,_delayedCleanupTimeout,setTimeout((()=>{_classPrivateFieldSet(this,_delayedCleanupTimeout,null);_classPrivateMethodGet(this,_tryCleanup,_tryCleanup2).call(this,!1)}),DELAYED_CLEANUP_TIMEOUT));return!1}for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();_classPrivateFieldSet(this,_pendingCleanup,!1);return!0}function _abortDelayedCleanup2(){if(_classPrivateFieldGet(this,_delayedCleanupTimeout)){clearTimeout(_classPrivateFieldGet(this,_delayedCleanupTimeout));_classPrivateFieldSet(this,_delayedCleanupTimeout,null)}}class LoopbackPort{#e=new Set;#i=Promise.resolve();postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};this.#i.then((()=>{for(const t of this.#e)t.call(this,i)}))}addEventListener(t,e){this.#e.add(e)}removeEventListener(t,e){this.#e.delete(e)}terminate(){this.#e.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){var _document,_document$currentScri;const t=null===(_document=document)||void 0===_document||null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let i;try{i=new URL(t);if(!i.origin||"null"===i.origin)return!1}catch(t){return!1}const a=new URL(e,i);return i.origin===a.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};var _generateTrustedURL=new WeakSet;class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:i=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classPrivateMethodInitSpec(this,_generateTrustedURL);if(e&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t;this.destroyed=!1;this.verbosity=i;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(e){_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).set(e,this);this._initializeFromPort(e)}else 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();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(_classPrivateMethodGet(this,_generateTrustedURL,_generateTrustedURL2).call(this,t)),i=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);i.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);i.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=i;this._port=e;this._webWorker=e;this._readyCapability.resolve();i.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();i.destroy();e.terminate()}}));i.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};sendTest();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const i="fake"+PDFWorkerUtil.fakeWorkerId++,a=new _message_handler.MessageHandler(i+"_worker",i,e);t.setup(a,e);const 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(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(t.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return"Function"===_worker_options.GlobalWorkerOptions.workerSrc.constructor.name?_worker_options.GlobalWorkerOptions.workerSrc():_worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;function _generateTrustedURL2(t){if(window.trustedTypes){return window.trustedTypes.createPolicy("foo",{createScriptURL:t=>t}).createScriptURL(t)}return t}var _workerPorts={writable:!0,value:new WeakMap},_methodPromises=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_cacheSimpleMethod=new WeakSet;class WorkerTransport{constructor(t,e,i,a,r){_classPrivateMethodInitSpec(this,_cacheSimpleMethod);_classPrivateFieldInitSpec(this,_methodPromises,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map});this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({ownerDocument:a.ownerDocument,styleElement:a.styleElement});this._params=a;this.canvasFactory=r.canvasFactory;this.filterFactory=r.filterFactory;this.cMapReaderFactory=r.cMapReaderFactory;this.standardFontDataFactory=r.standardFontDataFactory;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)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=_util.RenderingIntentFlag.DISPLAY,s=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;s=(r&_util.RenderingIntentFlag.PRINT&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}a&&(r+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:r,cacheKey:`${r}_${_annotation_storage.AnnotationStorage.getHash(s)}`,annotationStorageMap:s}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of _classPrivateFieldGet(this,_pageCache).values())t.push(e._destroy());_classPrivateFieldGet(this,_pageCache).clear();_classPrivateFieldGet(this,_pagePromises).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();_classPrivateFieldGet(this,_methodPromises).clear();this.filterFactory.destroy();this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{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(t){let{value:i,done:a}=t;if(a)e.close();else{(0,_util.assert)(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(i),1,[i])}})).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=>{const i=(0,_util.createPromiseCapability)(),a=this._fullReader;a.headersReady.then((()=>{if(!a.isStreamingSupported||!a.isRangeSupported){if(this._lastProgress){var t;null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)}a.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})}),i.reject);return i.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);if(i){e.onPull=()=>{i.read().then((function(t){let{value:i,done:a}=t;if(a)e.close();else{(0,_util.assert)(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(i),1,[i])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{i.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(t=>{let{pdfInfo:i}=t;this._numPages=i.numPages;this._htmlForXfa=i.htmlForXfa;delete i.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(i,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)}));t.on("PasswordRequest",(t=>{this._passwordCapability=(0,_util.createPromiseCapability)();if(e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}));t.on("DataLoaded",(t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)}));t.on("StartRenderPage",(t=>{if(this.destroyed)return;_classPrivateFieldGet(this,_pageCache).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(e=>{var i;let[a,r,s]=e;if(!this.destroyed&&!this.commonObjs.has(a))switch(r){case"Font":const e=this._params;if("error"in s){const t=s.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(a,t);break}const n=e.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new _font_loader.FontFaceObject(s,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:n});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:a}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null);this.commonObjs.resolve(a,o)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(a,s);break;default:throw new Error(`Got unknown common object type ${r}`)}}));t.on("obj",(t=>{let[e,i,a,r]=t;if(this.destroyed)return;const s=_classPrivateFieldGet(this,_pageCache).get(i);if(!s.objs.has(e))switch(a){case"Image":s.objs.resolve(e,r);if(r){let t;if(r.bitmap){const{width:e,height:i}=r;t=e*i*4}else{var n;t=(null===(n=r.data)||void 0===n?void 0:n.length)||0}t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0)}break;case"Pattern":s.objs.resolve(e,r);break;default:throw new Error(`Got unknown object type ${a}`)}}));t.on("DocProgress",(t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}));t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))));t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(null===(t=this._fullReader)||void 0===t?void 0:t.filename)??null}).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=_classPrivateFieldGet(this,_pagePromises).get(e);if(i)return i;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(e,t,this,this._params.pdfBug);_classPrivateFieldGet(this,_pageCache).set(e,i);return i}));_classPrivateFieldGet(this,_pagePromises).set(e,a);return a}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new 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})}getFieldObjects(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"GetFieldObjects")}hasJSActions(){return _classPrivateMethodGet(this,_cacheSimpleMethod,_cacheSimpleMethod2).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new 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.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=_classPrivateFieldGet(this,_methodPromises).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,i;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:(null===(e=this._fullReader)||void 0===e?void 0:e.filename)??null,contentLength:(null===(i=this._fullReader)||void 0===i?void 0:i.contentLength)??null}}));_classPrivateFieldGet(this,_methodPromises).set(t,i);return i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of _classPrivateFieldGet(this,_pageCache).values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();_classPrivateFieldGet(this,_methodPromises).clear();this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}function _cacheSimpleMethod2(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_classPrivateFieldGet(this,_methodPromises).get(t);if(i)return i;const a=this.messageHandler.sendWithPromise(t,e);_classPrivateFieldGet(this,_methodPromises).set(t,a);return a}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj);_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);i.capability.promise.then((()=>e(i.data)));return null}const i=_classPrivateFieldGet(this,_objs)[t];if(null==i||!i.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=_classPrivateFieldGet(this,_objs)[t];return(null==e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);i.data=e;i.capability.resolve()}clear(){for(const e in _classPrivateFieldGet(this,_objs)){var t;const{data:i}=_classPrivateFieldGet(this,_objs)[e];null==i||null===(t=i.bitmap)||void 0===t||t.close()}_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){const e=_classPrivateFieldGet(this,_objs)[t];return e||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}class RenderTask{#a=null;constructor(t){this.#a=t;this.onContinue=null}get promise(){return this.#a.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#a.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#a.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#a;return t.form||t.canvas&&(null==e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#r=new WeakSet;constructor(t){let{callback:e,params:i,objs:a,commonObjs:r,annotationCanvasMap:s,operatorList:n,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:h=!1,pageColors:u=null}=t;this.callback=e;this.params=i;this.objs=a;this.commonObjs=r;this.annotationCanvasMap=s;this.operatorListIdx=null;this.operatorList=n;this._pageIndex=o;this.canvasFactory=l;this.filterFactory=c;this._pdfBug=h;this.pageColors=u;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===d&&"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=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,i;let{transparency:a=!1,optionalContentConfig:r}=t;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#r.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#r.add(this._canvas)}if(this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:s,viewport:n,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap);this.gfx.beginDrawing({transform:o,viewport:n,transparency:a,background:l});this.operatorListIdx=0;this.graphicsReady=!0;null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1;this.cancelled=!0;null===(t=this.gfx)||void 0===t||t.endDrawing(this.pageColors);this._canvas&&InternalRenderTask.#r.delete(this._canvas);this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",i))}operatorListChanged(){var t;if(this.graphicsReady){null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){window.ngxZone.runOutsideAngular((()=>{this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}))}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing(this.pageColors);this._canvas&&InternalRenderTask.#r.delete(this._canvas);this.callback()}}}}}const version="3.5.539";exports.version=version;const build="3901db129";exports.build=build},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var a=i(1),r=i(139),s=i(143);function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var n=new WeakMap,o=new WeakMap,l=new WeakSet;class AnnotationStorage{constructor(){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,l);_classPrivateFieldInitSpec(this,n,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const i=_classPrivateFieldGet(this,o).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return _classPrivateFieldGet(this,o).get(t)}remove(t){_classPrivateFieldGet(this,o).delete(t);0===_classPrivateFieldGet(this,o).size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of _classPrivateFieldGet(this,o).values())if(t instanceof r.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=_classPrivateFieldGet(this,o).get(t);let a=!1;if(void 0!==i){for(const[t,r]of Object.entries(e))if(i[t]!==r){a=!0;i[t]=r}}else{a=!0;_classPrivateFieldGet(this,o).set(t,e)}a&&function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}(this,l,_setModified2).call(this);e instanceof r.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return _classPrivateFieldGet(this,o).has(t)}getAll(){return _classPrivateFieldGet(this,o).size>0?(0,a.objectFromMap)(_classPrivateFieldGet(this,o)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return _classPrivateFieldGet(this,o).size}resetModified(){if(_classPrivateFieldGet(this,n)){_classPrivateFieldSet(this,n,!1);"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===_classPrivateFieldGet(this,o).size)return null;const t=new Map;for(const[e,i]of _classPrivateFieldGet(this,o)){const a=i instanceof r.AnnotationEditor?i.serialize():i;a&&t.set(e,a)}return t}static getHash(t){if(!t)return"";const e=new s.MurmurHash3_64;for(const[i,a]of t)e.update(`${i}:${JSON.stringify(a)}`);return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;function _setModified2(){if(!_classPrivateFieldGet(this,n)){_classPrivateFieldSet(this,n,!0);"function"==typeof this.onSetModified&&this.onSetModified()}}class PrintAnnotationStorage extends AnnotationStorage{#s=null;constructor(t){super();this.#s=structuredClone(t.serializable)}get print(){(0,a.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#s}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;var a=i(140),r=i(1);class AnnotationEditor{#n=this.focusin.bind(this);#o=this.focusout.bind(this);#l=!1;#c=!1;#d=!1;_uiManager=null;#h=AnnotationEditor._zIndex++;static _colorManager=new a.ColorManager;static _zIndex=1;constructor(t){this.constructor===AnnotationEditor&&(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;this._uiManager=t.uiManager;const{rotation:e,rawDims:{pageWidth:i,pageHeight:a,pageX:s,pageY:n}}=this.parent.viewport;this.rotation=e;this.pageDimensions=[i,a];this.pageTranslation=[s,n];const[o,l]=this.parentDimensions;this.x=t.x/o;this.y=t.y/l;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,r.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#h}setParent(t){if(null!==t){this.pageIndex=t.pageIndex;this.pageDimensions=t.pageDimensions}this.parent=t}focusin(t){this.#l?this.#l=!1:this.parent.setSelected(this)}focusout(t){var e;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;if(null==i||!i.closest(`#${this.id}`)){t.preventDefault();null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(t){const 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,a){const[r,s]=this.parentDimensions;[i,a]=this.screenToPageTranslation(i,a);this.x=(t+i)/r;this.y=(e+a)/s;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(t,e){const[i,a]=this.parentDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/i;this.y+=e/a;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){switch(this.parentRotation){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:t}=this._uiManager.viewParameters,[e,i]=this.pageDimensions;return[e*t,i*t]}setDims(t,e){const[i,a]=this.parentDimensions;this.div.style.width=100*t/i+"%";this.div.style.height=100*e/a+"%"}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,a=i.endsWith("%"),r=e.endsWith("%");if(a&&r)return;const[s,n]=this.parentDimensions;a||(t.width=100*parseFloat(i)/s+"%");r||(t.height=100*parseFloat(e)/n+"%")}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.#n);this.div.addEventListener("focusout",this.#o);const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,a.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const{isMac:e}=r.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this);this.#l=!0}}getRect(t,e){const i=this.parentScale,[a,r]=this.pageDimensions,[s,n]=this.pageTranslation,o=t/i,l=e/i,c=this.x*a,d=this.y*r,h=this.width*a,u=this.height*r;switch(this.rotation){case 0:return[c+o+s,r-d-l-u+n,c+o+h+s,r-d-l+n];case 90:return[c+l+s,r-d+o+n,c+l+u+s,r-d+o+h+n];case 180:return[c-o-h+s,r-d+l+n,c-o+s,r-d+l+u+n];case 270:return[c-l-u+s,r-d-o-h+n,c-l+s,r-d-o+n];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,a,r,s]=t,n=r-i,o=s-a;switch(this.rotation){case 0:return[i,e-s,n,o];case 90:return[i,e-a,o,n];case 180:return[r,e-a,n,o];case 270:return[r,e-s,o,n];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#d=!0}disableEditMode(){this.#d=!1}isInEditMode(){return this.#d}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",this.#n)}serialize(){(0,r.unreachable)("An editor must be serializable")}static deserialize(t,e,i){const a=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});a.rotation=t.rotation;const[r,s]=a.pageDimensions,[n,o,l,c]=a.getRectInCurrentCoords(t.rect,s);a.x=n/r;a.y=o/s;a.width=l/r;a.height=c/s;return a}remove(){this.div.removeEventListener("focusin",this.#n);this.div.removeEventListener("focusout",this.#o);this.isEmpty()||this.commit();this.parent.remove(this)}select(){var t;null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t;null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#c}set isEditing(t){this.#c=t;if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,i){for(const a of i)e.addEventListener(a,t[a].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var a=i(1),r=i(141);function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}class IdManager{#u=0;getId(){return`${a.AnnotationEditorPrefix}${this.#u++}`}}class CommandManager{#p=[];#f=!1;#g;#v=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#g=t}add(t){let{cmd:e,undo:i,mustExec:a,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:n=!1}=t;a&&e();if(this.#f)return;const o={cmd:e,undo:i,type:r};if(-1===this.#v){this.#p.length>0&&(this.#p.length=0);this.#v=0;this.#p.push(o);return}if(s&&this.#p[this.#v].type===r){n&&(o.undo=this.#p[this.#v].undo);this.#p[this.#v]=o;return}const l=this.#v+1;if(l===this.#g)this.#p.splice(0,1);else{this.#v=l;l<this.#p.length&&this.#p.splice(l)}this.#p.push(o)}undo(){if(-1!==this.#v){this.#f=!0;this.#p[this.#v].undo();this.#f=!1;this.#v-=1}}redo(){if(this.#v<this.#p.length-1){this.#v+=1;this.#f=!0;this.#p[this.#v].cmd();this.#f=!1}}hasSomethingToUndo(){return-1!==this.#v}hasSomethingToRedo(){return this.#v<this.#p.length-1}destroy(){this.#p=null}}e.CommandManager=CommandManager;var s=new WeakSet;class KeyboardManager{constructor(t){_classPrivateMethodInitSpec(this,s);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const{isMac:e}=a.FeatureTest.platform;for(const[i,a]of t)for(const t of i){const i=t.startsWith("mac+");if(e&&i){this.callbacks.set(t.slice(4),a);this.allKeys.add(t.split("+").at(-1))}else if(!e&&!i){this.callbacks.set(t,a);this.allKeys.add(t.split("+").at(-1))}}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(_classPrivateMethodGet(this,s,_serialize2).call(this,e));if(i){i.bind(t)();e.stopPropagation();e.preventDefault()}}}e.KeyboardManager=KeyboardManager;function _serialize2(t){t.altKey&&this.buffer.push("alt");t.ctrlKey&&this.buffer.push("ctrl");t.metaKey&&this.buffer.push("meta");t.shiftKey&&this.buffer.push("shift");this.buffer.push(t.key);const e=this.buffer.join("+");this.buffer.length=0;return e}class ColorManager{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);(0,r.getColorValues)(t);return(0,a.shadow)(this,"_colors",t)}convert(t){const e=(0,r.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every(((t,i)=>t===e[i])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?a.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakMap,S=new WeakMap,w=new WeakMap,x=new WeakMap,E=new WeakMap,C=new WeakMap,k=new WeakMap,M=new WeakSet,T=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,G=new WeakSet,L=new WeakSet,N=new WeakSet,j=new WeakSet,B=new WeakSet;class AnnotationEditorUIManager{constructor(t,e,i){_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,M);_classPrivateFieldInitSpec(this,n,{writable:!0,value:null});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,l,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});_classPrivateFieldInitSpec(this,d,{writable:!0,value:new CommandManager});_classPrivateFieldInitSpec(this,h,{writable:!0,value:0});_classPrivateFieldInitSpec(this,u,{writable:!0,value:null});_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,f,{writable:!0,value:null});_classPrivateFieldInitSpec(this,g,{writable:!0,value:new IdManager});_classPrivateFieldInitSpec(this,v,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,m,{writable:!0,value:a.AnnotationEditorType.NONE});_classPrivateFieldInitSpec(this,_,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,b,{writable:!0,value:this.copy.bind(this)});_classPrivateFieldInitSpec(this,y,{writable:!0,value:this.cut.bind(this)});_classPrivateFieldInitSpec(this,A,{writable:!0,value:this.paste.bind(this)});_classPrivateFieldInitSpec(this,P,{writable:!0,value:this.keydown.bind(this)});_classPrivateFieldInitSpec(this,S,{writable:!0,value:this.onEditingAction.bind(this)});_classPrivateFieldInitSpec(this,w,{writable:!0,value:this.onPageChanging.bind(this)});_classPrivateFieldInitSpec(this,x,{writable:!0,value:this.onScaleChanging.bind(this)});_classPrivateFieldInitSpec(this,E,{writable:!0,value:this.onRotationChanging.bind(this)});_classPrivateFieldInitSpec(this,C,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});_classPrivateFieldInitSpec(this,k,{writable:!0,value:null});_classPrivateFieldSet(this,k,t);_classPrivateFieldSet(this,f,e);_classPrivateFieldGet(this,f)._on("editingaction",_classPrivateFieldGet(this,S));_classPrivateFieldGet(this,f)._on("pagechanging",_classPrivateFieldGet(this,w));_classPrivateFieldGet(this,f)._on("scalechanging",_classPrivateFieldGet(this,x));_classPrivateFieldGet(this,f)._on("rotationchanging",_classPrivateFieldGet(this,E));_classPrivateFieldSet(this,c,i);this.viewParameters={realScale:r.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){_classPrivateMethodGet(this,T,_removeKeyboardManager2).call(this);_classPrivateFieldGet(this,f)._off("editingaction",_classPrivateFieldGet(this,S));_classPrivateFieldGet(this,f)._off("pagechanging",_classPrivateFieldGet(this,w));_classPrivateFieldGet(this,f)._off("scalechanging",_classPrivateFieldGet(this,x));_classPrivateFieldGet(this,f)._off("rotationchanging",_classPrivateFieldGet(this,E));for(const t of _classPrivateFieldGet(this,l).values())t.destroy();_classPrivateFieldGet(this,l).clear();_classPrivateFieldGet(this,o).clear();_classPrivateFieldGet(this,p).clear();_classPrivateFieldSet(this,n,null);_classPrivateFieldGet(this,_).clear();_classPrivateFieldGet(this,d).destroy()}onPageChanging(t){let{pageNumber:e}=t;_classPrivateFieldSet(this,h,e-1)}focusMainContainer(){_classPrivateFieldGet(this,k).focus()}addShouldRescale(t){_classPrivateFieldGet(this,p).add(t)}removeShouldRescale(t){_classPrivateFieldGet(this,p).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove();this.viewParameters.realScale=e*r.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of _classPrivateFieldGet(this,p))t.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove();this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!_classPrivateFieldGet(this,c)||_classPrivateFieldGet(this,c).has(t.id)||_classPrivateFieldGet(this,c).setValue(t.id,t)}copy(t){t.preventDefault();_classPrivateFieldGet(this,n)&&_classPrivateFieldGet(this,n).commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of _classPrivateFieldGet(this,_))t.isEmpty()||e.push(t.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){(0,a.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(e))return;this.unselectAll();const i=_classPrivateFieldGet(this,l).get(_classPrivateFieldGet(this,h));try{const t=[];for(const a of e){const e=i.deserialize(a);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)_classPrivateMethodGet(this,N,_addEditorToLayer2).call(this,e);_classPrivateMethodGet(this,B,_selectEditors2).call(this,t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,a.warn)(`paste: "${t.message}".`)}}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){if(t){_classPrivateMethodGet(this,M,_addKeyboardManager2).call(this);_classPrivateMethodGet(this,R,_addCopyPasteListeners2).call(this);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{isEditing:_classPrivateFieldGet(this,m)!==a.AnnotationEditorType.NONE,isEmpty:_classPrivateMethodGet(this,j,_isEmpty2).call(this),hasSomethingToUndo:_classPrivateFieldGet(this,d).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(this,d).hasSomethingToRedo(),hasSelectedEditor:!1})}else{_classPrivateMethodGet(this,T,_removeKeyboardManager2).call(this);_classPrivateMethodGet(this,I,_removeCopyPasteListeners2).call(this);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{isEditing:!1})}}registerEditorTypes(t){if(!_classPrivateFieldGet(this,u)){_classPrivateFieldSet(this,u,t);for(const t of _classPrivateFieldGet(this,u))_classPrivateMethodGet(this,O,_dispatchUpdateUI2).call(this,t.defaultPropertiesToUpdate)}}getId(){return _classPrivateFieldGet(this,g).getId()}get currentLayer(){return _classPrivateFieldGet(this,l).get(_classPrivateFieldGet(this,h))}get currentPageIndex(){return _classPrivateFieldGet(this,h)}addLayer(t){_classPrivateFieldGet(this,l).set(t.pageIndex,t);_classPrivateFieldGet(this,v)?t.enable():t.disable()}removeLayer(t){_classPrivateFieldGet(this,l).delete(t.pageIndex)}updateMode(t){_classPrivateFieldSet(this,m,t);if(t===a.AnnotationEditorType.NONE){this.setEditingState(!1);_classPrivateMethodGet(this,L,_disableAll2).call(this)}else{this.setEditingState(!0);_classPrivateMethodGet(this,G,_enableAll2).call(this);for(const e of _classPrivateFieldGet(this,l).values())e.updateMode(t)}}updateToolbar(t){t!==_classPrivateFieldGet(this,m)&&_classPrivateFieldGet(this,f).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(_classPrivateFieldGet(this,u)){for(const i of _classPrivateFieldGet(this,_))i.updateParams(t,e);for(const i of _classPrivateFieldGet(this,u))i.updateDefaultParams(t,e)}}getEditors(t){const e=[];for(const i of _classPrivateFieldGet(this,o).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return _classPrivateFieldGet(this,o).get(t)}addEditor(t){_classPrivateFieldGet(this,o).set(t.id,t)}removeEditor(t){var e;_classPrivateFieldGet(this,o).delete(t.id);this.unselect(t);null===(e=_classPrivateFieldGet(this,c))||void 0===e||e.remove(t.id)}setActiveEditor(t){if(_classPrivateFieldGet(this,n)!==t){_classPrivateFieldSet(this,n,t);t&&_classPrivateMethodGet(this,O,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}}toggleSelected(t){if(_classPrivateFieldGet(this,_).has(t)){_classPrivateFieldGet(this,_).delete(t);t.unselect();_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{_classPrivateFieldGet(this,_).add(t);t.select();_classPrivateMethodGet(this,O,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}setSelected(t){for(const e of _classPrivateFieldGet(this,_))e!==t&&e.unselect();_classPrivateFieldGet(this,_).clear();_classPrivateFieldGet(this,_).add(t);t.select();_classPrivateMethodGet(this,O,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}isSelected(t){return _classPrivateFieldGet(this,_).has(t)}unselect(t){t.unselect();_classPrivateFieldGet(this,_).delete(t);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(this,_).size}undo(){_classPrivateFieldGet(this,d).undo();_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:_classPrivateFieldGet(this,d).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_classPrivateMethodGet(this,j,_isEmpty2).call(this)})}redo(){_classPrivateFieldGet(this,d).redo();_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(this,d).hasSomethingToRedo(),isEmpty:_classPrivateMethodGet(this,j,_isEmpty2).call(this)})}addCommands(t){_classPrivateFieldGet(this,d).add(t);_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_classPrivateMethodGet(this,j,_isEmpty2).call(this)})}delete(){this.commitOrRemove();if(!this.hasSelection)return;const t=[..._classPrivateFieldGet(this,_)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)_classPrivateMethodGet(this,N,_addEditorToLayer2).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=_classPrivateFieldGet(this,n))||void 0===t||t.commitOrRemove()}selectAll(){for(const t of _classPrivateFieldGet(this,_))t.commit();_classPrivateMethodGet(this,B,_selectEditors2).call(this,_classPrivateFieldGet(this,o).values())}unselectAll(){if(_classPrivateFieldGet(this,n))_classPrivateFieldGet(this,n).commitOrRemove();else if(0!==_classPrivateFieldGet(this,_).size){for(const t of _classPrivateFieldGet(this,_))t.unselect();_classPrivateFieldGet(this,_).clear();_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}isActive(t){return _classPrivateFieldGet(this,n)===t}getActive(){return _classPrivateFieldGet(this,n)}getMode(){return _classPrivateFieldGet(this,m)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager;function _addKeyboardManager2(){_classPrivateFieldGet(this,k).addEventListener("keydown",_classPrivateFieldGet(this,P))}function _removeKeyboardManager2(){_classPrivateFieldGet(this,k).removeEventListener("keydown",_classPrivateFieldGet(this,P))}function _addCopyPasteListeners2(){document.addEventListener("copy",_classPrivateFieldGet(this,b));document.addEventListener("cut",_classPrivateFieldGet(this,y));document.addEventListener("paste",_classPrivateFieldGet(this,A))}function _removeCopyPasteListeners2(){document.removeEventListener("copy",_classPrivateFieldGet(this,b));document.removeEventListener("cut",_classPrivateFieldGet(this,y));document.removeEventListener("paste",_classPrivateFieldGet(this,A))}function _dispatchUpdateStates2(t){Object.entries(t).some((t=>{let[e,i]=t;return _classPrivateFieldGet(this,C)[e]!==i}))&&_classPrivateFieldGet(this,f).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(this,C),t)})}function _dispatchUpdateUI2(t){_classPrivateFieldGet(this,f).dispatch("annotationeditorparamschanged",{source:this,details:t})}function _enableAll2(){if(!_classPrivateFieldGet(this,v)){_classPrivateFieldSet(this,v,!0);for(const t of _classPrivateFieldGet(this,l).values())t.enable()}}function _disableAll2(){this.unselectAll();if(_classPrivateFieldGet(this,v)){_classPrivateFieldSet(this,v,!1);for(const t of _classPrivateFieldGet(this,l).values())t.disable()}}function _addEditorToLayer2(t){const e=_classPrivateFieldGet(this,l).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function _isEmpty2(){if(0===_classPrivateFieldGet(this,o).size)return!0;if(1===_classPrivateFieldGet(this,o).size)for(const t of _classPrivateFieldGet(this,o).values())return t.isEmpty();return!1}function _selectEditors2(t){_classPrivateFieldGet(this,_).clear();for(const e of t)if(!e.isEmpty()){_classPrivateFieldGet(this,_).add(e);e.select()}_classPrivateMethodGet(this,D,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}!function _defineProperty(t,e,i){(e=function _toPropertyKey(t){var e=function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}(AnnotationEditorUIManager,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]))},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0;e.deprecated=function deprecated(t){globalThis.ngxConsole.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const i of t.keys()){e.style.color=i;const a=window.getComputedStyle(e).color;t.set(i,getRGB(a))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:i,c:a,d:r,e:s,f:n}=t.getTransform();return[e,i,a,r,s,n]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:i,c:a,d:r,e:s,f:n}=t.getTransform().invertSelf();return[e,i,a,r,s,n]};e.getFilenameFromUrl=function getFilenameFromUrl(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if(window.PDFViewerApplication.appConfig.filenameForDownload)return window.PDFViewerApplication.appConfig.filenameForDownload;if("string"!=typeof t)return e;if(isDataScheme(t)){(0,r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(a[1])||i.exec(a[2])||i.exec(a[3]);if(s){s=s[0];if(s.includes("%"))try{s=i.exec(decodeURIComponent(s))[0]}catch(t){}}return s||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,e){let{scale:i=1,rotation:a=0}=e;const{width:r,height:s}=t.attributes.style,n=[0,0,parseInt(r),parseInt(s)];return new PageViewport({viewBox:n,scale:i,rotation:a})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((i,a)=>{const r=document.createElement("script");let s=t;"Function"===t.constructor.name&&(s=t());const n=function generateTrustedURL(t){if(window.trustedTypes){return window.trustedTypes.createPolicy("foo",{createScriptURL:t=>t}).createScriptURL(t)}return t}(s);r.src=n;r.onload=function(t){e&&r.remove();i(t)};r.onerror=function(t){globalThis.ngxConsole.log(t);a(new Error(`Cannot load script at: ${r.src}`))};(document.head||document.documentElement).append(r)}))};e.setLayerDimensions=function setLayerDimensions(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof PageViewport){const{pageWidth:a,pageHeight:r}=e.rawDims,{style:s}=t,n=`calc(var(--scale-factor) * ${a}px)`,o=`calc(var(--scale-factor) * ${r}px)`;if(i&&e.rotation%180!=0){s.width=o;s.height=n}else{s.width=n;s.height=o}}a&&t.setAttribute("data-main-rotation",e.rotation)};var a=i(142),r=i(1);function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const s="http://www.w3.org/2000/svg";e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakSet;class DOMFilterFactory extends a.BaseFilterFactory{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,v);_classPrivateFieldInitSpec(this,g,{get:_get_defs,set:void 0});_classPrivateFieldInitSpec(this,f,{get:_get_cache,set:void 0});_classPrivateFieldInitSpec(this,n,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,o,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,d,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,u,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,p,{writable:!0,value:0});_classPrivateFieldSet(this,l,t);_classPrivateFieldSet(this,c,e)}addFilter(t){var e,i;if(!t)return"none";let a,r,n,o,d=_classPrivateFieldGet(this,f).get(t);if(d)return d;if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;o=a=r=n=i.join(",")}else{const[e,i,s]=t,l=new Array(256),c=new Array(256),d=new Array(256);for(let t=0;t<256;t++){l[t]=e[t]/255;c[t]=i[t]/255;d[t]=s[t]/255}a=l.join(",");r=c.join(",");n=d.join(",");o=`${a}${r}${n}`}d=_classPrivateFieldGet(this,f).get(o);if(d){_classPrivateFieldGet(this,f).set(t,d);return d}const h=`g_${_classPrivateFieldGet(this,l)}_transfer_map_${_classPrivateFieldSet(this,p,(e=_classPrivateFieldGet(this,p),i=e++,e)),i}`,u=`url(#${h})`;_classPrivateFieldGet(this,f).set(t,u);_classPrivateFieldGet(this,f).set(o,u);const m=_classPrivateFieldGet(this,c).createElementNS(s,"filter",s);m.setAttribute("id",h);m.setAttribute("color-interpolation-filters","sRGB");const _=_classPrivateFieldGet(this,c).createElementNS(s,"feComponentTransfer");m.append(_);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,_,"feFuncR",a);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,_,"feFuncG",r);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,_,"feFuncB",n);_classPrivateFieldGet(this,g).append(m);return u}addHCMFilter(t,e){var i;const a=`${t}-${e}`;if(_classPrivateFieldGet(this,h)===a)return _classPrivateFieldGet(this,u);_classPrivateFieldSet(this,h,a);_classPrivateFieldSet(this,u,"none");null===(i=_classPrivateFieldGet(this,d))||void 0===i||i.remove();if(!t||!e)return _classPrivateFieldGet(this,u);_classPrivateFieldGet(this,g).style.color=t;const n=getRGB(t=getComputedStyle(_classPrivateFieldGet(this,g)).getPropertyValue("color"));t=r.Util.makeHexColor(...n);_classPrivateFieldGet(this,g).style.color=e;const o=getRGB(e=getComputedStyle(_classPrivateFieldGet(this,g)).getPropertyValue("color"));e=r.Util.makeHexColor(...o);_classPrivateFieldGet(this,g).style.color="";if("#000000"===t&&"#ffffff"===e||t===e)return _classPrivateFieldGet(this,u);const p=new Array(256);for(let t=0;t<=255;t++){const e=t/255;p[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const f=p.join(","),m=`g_${_classPrivateFieldGet(this,l)}_hcm_filter`,_=_classPrivateFieldSet(this,d,_classPrivateFieldGet(this,c).createElementNS(s,"filter",s));_.setAttribute("id",m);_.setAttribute("color-interpolation-filters","sRGB");let b=_classPrivateFieldGet(this,c).createElementNS(s,"feComponentTransfer");_.append(b);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncR",f);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncG",f);_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncB",f);const y=_classPrivateFieldGet(this,c).createElementNS(s,"feColorMatrix");y.setAttribute("type","matrix");y.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0");_.append(y);b=_classPrivateFieldGet(this,c).createElementNS(s,"feComponentTransfer");_.append(b);const getSteps=(t,e)=>{const i=n[t]/255,a=o[t]/255,r=new Array(e+1);for(let t=0;t<=e;t++)r[t]=i+t/e*(a-i);return r.join(",")};_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncR",getSteps(0,5));_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncG",getSteps(1,5));_classPrivateMethodGet(this,v,_appendFeFunc2).call(this,b,"feFuncB",getSteps(2,5));_classPrivateFieldGet(this,g).append(_);_classPrivateFieldSet(this,u,`url(#${m})`);return _classPrivateFieldGet(this,u)}destroy(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||!_classPrivateFieldGet(this,u)){if(_classPrivateFieldGet(this,o)){_classPrivateFieldGet(this,o).parentNode.parentNode.remove();_classPrivateFieldSet(this,o,null)}if(_classPrivateFieldGet(this,n)){_classPrivateFieldGet(this,n).clear();_classPrivateFieldSet(this,n,null)}_classPrivateFieldSet(this,p,0)}}}e.DOMFilterFactory=DOMFilterFactory;function _get_cache(){return _classPrivateFieldGet(this,n)||_classPrivateFieldSet(this,n,new Map)}function _get_defs(){if(!_classPrivateFieldGet(this,o)){const t=_classPrivateFieldGet(this,c).createElement("div"),{style:e}=t;e.visibility="hidden";e.contain="strict";e.width=e.height=0;e.position="absolute";e.top=e.left=0;e.zIndex=-1;const i=_classPrivateFieldGet(this,c).createElementNS(s,"svg");i.setAttribute("width",0);i.setAttribute("height",0);_classPrivateFieldSet(this,o,_classPrivateFieldGet(this,c).createElementNS(s,"defs"));t.append(i);i.append(_classPrivateFieldGet(this,o));_classPrivateFieldGet(this,c).body.append(t)}return _classPrivateFieldGet(this,o)}function _appendFeFunc2(t,e,i){const a=_classPrivateFieldGet(this,c).createElementNS(s,e);a.setAttribute("type","discrete");a.setAttribute("tableValues",i);t.append(a)}class DOMCanvasFactory extends a.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");i.width=t;i.height=e;return i}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);return e?new Uint8Array(await i.arrayBuffer()):(0,r.stringToBytes)(await i.text())}return new Promise(((i,a)=>{const s=new XMLHttpRequest;s.open("GET",t,!0);e&&(s.responseType="arraybuffer");s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){let t;e&&s.response?t=new Uint8Array(s.response):!e&&s.responseText&&(t=(0,r.stringToBytes)(s.responseText));if(t){i(t);return}}a(new Error(s.statusText))}};s.send(null)}))}class DOMCMapReaderFactory extends a.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends a.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends a.BaseSVGFactory{_createSVG(t){return document.createElementNS(s,t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:i,rotation:a,offsetX:r=0,offsetY:s=0,dontFlip:n=!1}=t;this.viewBox=e;this.scale=i;this.rotation=a;this.offsetX=r;this.offsetY=s;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,h,u,p,f,g,v;a%=360;a<0&&(a+=360);switch(a){case 180:c=-1;d=0;h=0;u=1;break;case 90:c=0;d=1;h=1;u=0;break;case 270:c=0;d=-1;h=-1;u=0;break;case 0:c=1;d=0;h=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(n){h=-h;u=-u}if(0===c){p=Math.abs(l-e[1])*i+r;f=Math.abs(o-e[0])*i+s;g=(e[3]-e[1])*i;v=(e[2]-e[0])*i}else{p=Math.abs(o-e[0])*i+r;f=Math.abs(l-e[1])*i+s;g=(e[2]-e[0])*i;v=(e[3]-e[1])*i}this.transform=[c*i,d*i,h*i,u*i,p-c*i*o-h*i*l,f-d*i*o-u*i*l];this.width=g;this.height=v}get rawDims(){const{viewBox:t}=this;return(0,r.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:a=this.offsetY,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:a,dontFlip:r})}convertToViewportPoint(t,e){return r.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=r.Util.applyTransform([t[0],t[1]],this.transform),i=r.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return r.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends r.BaseException{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(t,"RenderingCancelledException");this.type=e;this.extraDelay=i}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}e.StatTimer=class StatTimer{started=Object.create(null);times=[];time(t){t in this.started&&(0,r.warn)(`Timer is already running for ${t}`);this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,r.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(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(const{name:i,start:a,end:r}of this.times)t.push(`${i.padEnd(e)} ${r-a}ms\n`);return t.join("")}};function isValidFetchUrl(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i||"capacitor:"===i}catch(t){return!1}}let m;e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;m||(m=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=m.exec(t);if(!e)return null;const i=parseInt(e[1],10);let a=parseInt(e[2],10);a=a>=1&&a<=12?a-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let n=parseInt(e[5],10);n=n>=0&&n<=59?n:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===l){s+=c;n+=d}else if("+"===l){s-=c;n-=d}return new Date(Date.UTC(i,a,r,s,n,o))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,r.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var a=i(1);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,a.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}destroy(){}}e.BaseFilterFactory=BaseFilterFactory;class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,a.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e),a=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,r=i.getContext("2d",a);return{canvas:i,context:r}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}_createCanvas(t,e){(0,a.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===BaseCMapReaderFactory&&(0,a.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=e;this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?a.CMapCompressionType.BINARY:a.CMapCompressionType.NONE;return this._fetchData(i,r).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}_fetchData(t,e){(0,a.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,a.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetchData(i).catch((t=>{throw new Error(`Unable to load font data at: ${i}`)}))}_fetchData(t){(0,a.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,a.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");a.setAttribute("version","1.1");if(!i){a.setAttribute("width",`${t}px`);a.setAttribute("height",`${e}px`)}a.setAttribute("preserveAspectRatio","none");a.setAttribute("viewBox",`0 0 ${t} ${e}`);return a}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,a.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;var a=i(1);const r=3285377520,s=4294901760,n=65535;e.MurmurHash3_64=class MurmurHash3_64{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 a=0,r=t.length;a<r;a++){const r=t.charCodeAt(a);if(r<=255)e[i++]=r;else{e[i++]=r>>>8;e[i++]=255&r}}}else{if(!(0,a.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();i=e.byteLength}const r=i>>2,o=i-4*r,l=new Uint32Array(e.buffer,0,r);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,v=13715;for(let t=0;t<r;t++)if(1&t){c=l[t];c=c*p&s|c*g&n;c=c<<15|c>>>17;c=c*f&s|c*v&n;h^=c;h=h<<13|h>>>19;h=5*h+3864292196}else{d=l[t];d=d*p&s|d*g&n;d=d<<15|d>>>17;d=d*f&s|d*v&n;u^=d;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*r+2]<<16;case 2:c^=e[4*r+1]<<8;case 1:c^=e[4*r];c=c*p&s|c*g&n;c=c<<15|c>>>17;c=c*f&s|c*v&n;1&r?h^=c:u^=c}this.h1=h;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&s|36045*t&n;e=4283543511*e&s|(2950163797*(e<<16|t>>>16)&s)>>>16;t^=e>>>1;t=444984403*t&s|60499*t&n;e=3301882366*e&s|(3120437893*(e<<16|t>>>16)&s)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;var a=i(1),r=i(145);e.FontLoader=class FontLoader{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;this._document=e;this.nativeFontFaces=[];this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}insertRule(t){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async bind(t){if(t.attached||t.missingFile)return;t.attached=!0;if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){(0,a.warn)(`Failed to load font '${e.family}': '${i}'.`);t.disableFontFace=!0;throw i}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,a.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let t=!1;(r.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0);return(0,a.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function completeRequest(){(0,a.assert)(!i.done,"completeRequest() cannot be called twice.");i.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(i);return i}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,a.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,i,a){return t.substring(0,e)+a+t.substring(e+i)}let i,r;const s=this._document.createElement("canvas");s.width=1;s.height=1;const n=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0,o=s.getContext("2d",n);let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=spliceString(d,976,c.length,c);const h=1482184792;let u=int32(d,16);for(i=0,r=c.length-3;i<r;i+=4)u=u-h+int32(c,i)|0;i<c.length&&(u=u-h+int32(c+"XXX",i)|0);d=spliceString(d,16,4,(0,a.string32)(u));const p=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(p);const f=this._document.createElement("div");f.style.visibility="hidden";f.style.width=f.style.height="10px";f.style.position="absolute";f.style.top=f.style.left="0px";for(const e of[t.loadedName,c]){const t=this._document.createElement("span");t.textContent="Hi";t.style.fontFamily=e;f.append(t)}this._document.body.append(f);!function isFontReady(t,e){if(++l>30){(0,a.warn)("Load test font never loaded.");e();return}o.font="30px "+t;o.fillText(".",0,20);o.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(c,(()=>{f.remove();e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:i=!0,disableFontFace:a=!1,ignoreErrors:r=!1,inspectFont:s=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==i;this.disableFontFace=!0===a;this.ignoreErrors=!0===r;this._inspectFont=s}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`);e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});null===(t=this._inspectFont)||void 0===t||t.call(this,this);return e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=(0,a.bytesToString)(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${i}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${i}}`;null===(t=this._inspectFont)||void 0===t||t.call(this,this,i);return r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;(0,a.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&a.FeatureTest.isEvalSupported){const t=[];for(const e of i){const i=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const a of i){"scale"===a.cmd&&(a.args=[e,-e]);t[a.cmd].apply(t,a.args)}}}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const i=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=i},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;var a=i(1),r=i(141),s=i(147),n=i(148),o=i(145);function _classPrivateMethodInitSpec(t,e){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.add(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const l=4096,c=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,i){let a;if(void 0!==this.cache[t]){a=this.cache[t];this.canvasFactory.reset(a,e,i)}else{a=this.canvasFactory.create(e,i);this.cache[t]=a}return a}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e);delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,i,a,s,n,o,l,c,d){const[h,u,p,f,g,v]=(0,r.getCurrentTransform)(t);if(0===u&&0===p){const r=o*h+g,m=Math.round(r),_=l*f+v,b=Math.round(_),y=(o+c)*h+g,A=Math.abs(Math.round(y)-m)||1,P=(l+d)*f+v,S=Math.abs(Math.round(P)-b)||1;t.setTransform(Math.sign(h),0,0,Math.sign(f),m,b);t.drawImage(e,i,a,s,n,0,0,A,S);t.setTransform(h,u,p,f,g,v);return[A,S]}if(0===h&&0===f){const r=l*p+g,m=Math.round(r),_=o*u+v,b=Math.round(_),y=(l+d)*p+g,A=Math.abs(Math.round(y)-m)||1,P=(o+c)*u+v,S=Math.abs(Math.round(P)-b)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,m,b);t.drawImage(e,i,a,s,n,0,0,S,A);t.setTransform(h,u,p,f,g,v);return[S,A]}t.drawImage(e,i,a,s,n,o,l,c,d);return[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=a.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=a.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=a.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps="none";this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,i){[e,i]=a.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){const i=a.Util.applyTransform(e,t),r=a.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){a.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,s,n,o,l,c,d){const h=a.Util.bezierBoundingBox(e,i,r,s,n,o,l,c);if(d){d[0]=Math.min(d[0],h[0],h[2]);d[1]=Math.max(d[1],h[0],h[2]);d[2]=Math.min(d[2],h[1],h[3]);d[3]=Math.max(d[3],h[1],h[3])}else this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===s.PathType.STROKE){e||(0,a.unreachable)("Stroke bounding box must include transform.");const t=a.Util.singularValueDecompose2dScale(e),r=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=r;i[1]-=s;i[2]+=r;i[3]+=s}return i}updateClipFromPath(){const t=a.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return a.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,s=i%c,n=(i-s)/c,o=0===s?n:n+1,l=t.createImageData(r,c);let d,h=0;const u=e.data,p=l.data;let f,g,v,m;if(e.kind===a.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,i=new Uint32Array(p.buffer,0,p.byteLength>>2),m=i.length,_=r+7>>3,b=4294967295,y=a.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){v=f<n?c:s;d=0;for(g=0;g<v;g++){const t=e-h;let a=0;const s=t>_?r:8*t-7,n=-8&s;let o=0,l=0;for(;a<n;a+=8){l=u[h++];i[d++]=128&l?b:y;i[d++]=64&l?b:y;i[d++]=32&l?b:y;i[d++]=16&l?b:y;i[d++]=8&l?b:y;i[d++]=4&l?b:y;i[d++]=2&l?b:y;i[d++]=1&l?b:y}for(;a<s;a++){if(0===o){l=u[h++];o=128}i[d++]=l&o?b:y;o>>=1}}for(;d<m;)i[d++]=0;t.putImageData(l,0,f*c)}}else if(e.kind===a.ImageKind.RGBA_32BPP){g=0;m=r*c*4;for(f=0;f<n;f++){p.set(u.subarray(h,h+m));h+=m;t.putImageData(l,0,g);g+=c}if(f<o){m=r*s*4;p.set(u.subarray(h,h+m));t.putImageData(l,0,g)}}else{if(e.kind!==a.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);v=c;m=r*v;for(f=0;f<o;f++){if(f>=n){v=s;m=r*v}d=0;for(g=m;g--;){p[d++]=u[h++];p[d++]=u[h++];p[d++]=u[h++];p[d++]=255}t.putImageData(l,0,f*c)}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,a=e.width,r=i%c,s=(i-r)/c,o=0===r?s:s+1,l=t.createImageData(a,c);let d=0;const h=e.data,u=l.data;for(let e=0;e<o;e++){const i=e<s?c:r;({srcPos:d}=(0,n.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:a,height:i,nonBlackColor:0}));t.putImageData(l,0,e*c)}}function copyCtxState(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const a of i)void 0!==t[a]&&(e[a]=t[a]);if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t){t.strokeStyle=t.fillStyle="#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";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}o.isNodeJS||(t.filter="none")}function composeSMaskBackdrop(t,e,i,a){const r=t.length;for(let s=3;s<r;s+=4){const r=t[s];if(0===r){t[s-3]=e;t[s-2]=i;t[s-1]=a}else if(r<255){const n=255-r;t[s-3]=t[s-3]*r+e*n>>8;t[s-2]=t[s-2]*r+i*n>>8;t[s-1]=t[s-1]*r+a*n>>8}}}function composeSMaskAlpha(t,e,i){const a=t.length;for(let r=3;r<a;r+=4){const a=i?i[t[r]]:t[r];e[r]=e[r]*a*.00392156862745098|0}}function composeSMaskLuminosity(t,e,i){const a=t.length;for(let r=3;r<a;r+=4){const 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 composeSMask(t,e,i,a){const r=a[0],s=a[1],n=a[2]-r,o=a[3]-s;if(0!==n&&0!==o){!function genericComposeSMask(t,e,i,a,r,s,n,o,l,c,d){const h=!!s,u=h?s[0]:0,p=h?s[1]:0,f=h?s[2]:0;let g;g="Luminosity"===r?composeSMaskLuminosity:composeSMaskAlpha;const v=Math.min(a,Math.ceil(1048576/i));for(let r=0;r<a;r+=v){const s=Math.min(v,a-r),m=t.getImageData(o-c,r+(l-d),i,s),_=e.getImageData(o,r+l,i,s);h&&composeSMaskBackdrop(m.data,u,p,f);g(m.data,_.data,n);e.putImageData(_,o,r+l)}}(e.context,i,n,o,e.subtype,e.backdrop,e.transferMap,r,s,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 getImageSmoothingEnabled(t,e){const i=a.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]);i[1]=Math.fround(i[1]);const s=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:i[0]<=s||i[1]<=s}const d=["butt","round","square"],h=["miter","round","bevel"],u={},p={};var f=new WeakSet;class CanvasGraphics{constructor(t,e,i,a,r,s,n){let{optionalContentConfig:o,markedContentStack:l=null}=s;_classPrivateMethodInitSpec(this,f);this.ctx=t;this.current=new CanvasExtraState(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=a;this.filterFactory=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=l||[];this.optionalContentConfig=o;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=n;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:a=!1,background:s=null}=t;const n=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;this.ctx.fillStyle=s||"#ffffff";this.ctx.fillRect(0,0,n,o);this.ctx.fillStyle=l;if(a){const t=this.cachedCanvases.getCanvas("transparent",n,o);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx);if(e){this.ctx.transform(...e);this.outputScaleX=e[0];this.outputScaleY=e[0]}this.ctx.transform(...i.transform);this.viewportScale=i.scale;this.baseTransform=(0,r.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,i,r){const s=t.argsArray,n=t.fnArray;let o=e||0;const l=s.length;if(l===o)return o;const c=l-o>10&&"function"==typeof i,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==r&&o===r.nextBreakPoint){r.breakIt(o,i);return o}f=n[o];if(f!==a.OPS.dependency)this[f].apply(this,s[o]);else for(const t of s[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,i);return o}}o++;if(o===l)return o;if(c&&++h>10){if(Date.now()>d){i();return o}h=0}}}endDrawing(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classPrivateMethodGet(this,f,_restoreInitialState2).call(this);this.cachedCanvases.clear();this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();if(t){const e=this.filterFactory.addHCMFilter(t.foreground,t.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=t}}}_scaleImage(t,e){const i=t.width,a=t.height;let r,s,n=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=a,d="prescale1";for(;n>2&&l>1||o>2&&c>1;){let e=l,i=c;if(n>2&&l>1){e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2);n/=l/e}if(o>2&&c>1){i=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2;o/=c/i}r=this.cachedCanvases.getCanvas(d,e,i);s=r.context;s.clearRect(0,0,e,i);s.drawImage(t,0,0,l,c,0,0,e,i);t=r.canvas;l=e;c=i;d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(e);let d,h,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;h=JSON.stringify(l?c:[c.slice(0,4),o]);d=this._cachedBitmapsMap.get(e);if(!d){d=new Map;this._cachedBitmapsMap.set(e,d)}const i=d.get(h);if(i&&!l){return{canvas:i,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=i}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",i,n);putBinaryImageMask(p.context,t)}let f=a.Util.transform(c,[1/i,0,0,-1/n,0,0]);f=a.Util.transform(f,[1,0,0,1,0,-n]);const g=a.Util.applyTransform([0,0],f),v=a.Util.applyTransform([i,n],f),m=a.Util.normalizeRect([g[0],g[1],v[0],v[1]]),_=Math.round(m[2]-m[0])||1,b=Math.round(m[3]-m[1])||1,y=this.cachedCanvases.getCanvas("fillCanvas",_,b),A=y.context,P=Math.min(g[0],v[0]),S=Math.min(g[1],v[1]);A.translate(-P,-S);A.transform(...f);if(!u){u=this._scaleImage(p.canvas,(0,r.getCurrentTransformInverse)(A));u=u.img;d&&l&&d.set(h,u)}A.imageSmoothingEnabled=getImageSmoothingEnabled((0,r.getCurrentTransform)(A),t.interpolate);drawImageAtIntegerCoords(A,u,0,0,u.width,u.height,0,0,i,n);A.globalCompositeOperation="source-in";const w=a.Util.transform((0,r.getCurrentTransformInverse)(A),[1,0,0,1,-P,-S]);A.fillStyle=l?o.getPattern(e,this,w,s.PathType.FILL):o;A.fillRect(0,0,i,n);if(d&&!l){this.cachedCanvases.delete("fillCanvas");d.set(h,y.canvas)}return{canvas:y.canvas,offsetX:Math.round(P),offsetY:Math.round(S)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=d[t]}setLineJoin(t){this.ctx.lineJoin=h[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;if(void 0!==i.setLineDash){i.setLineDash(t);i.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[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[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i;this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx;this.ctx=a.context;const s=this.ctx;s.setTransform(...(0,r.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,s);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new 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 ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,i){e.translate(t,i);this.__originalTranslate(t,i)};t.scale=function ctxScale(t,i){e.scale(t,i);this.__originalScale(t,i)};t.transform=function ctxTransform(t,i,a,r,s,n){e.transform(t,i,a,r,s,n);this.__originalTransform(t,i,a,r,s,n)};t.setTransform=function ctxSetTransform(t,i,a,r,s,n){e.setTransform(t,i,a,r,s,n);this.__originalSetTransform(t,i,a,r,s,n)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(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,a,r,s,n){e.bezierCurveTo(t,i,a,r,s,n);this.__originalBezierCurveTo(t,i,a,r,s,n)};t.rect=function(t,i,a,r){e.rect(t,i,a,r);this.__originalRect(t,i,a,r)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(s,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(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])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,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(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}transform(t,e,i,a,r,s){this.ctx.transform(t,e,i,a,r,s);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const s=this.ctx,n=this.current;let o,l,c=n.x,d=n.y;const h=(0,r.getCurrentTransform)(s),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?i.slice(0):null;for(let i=0,r=0,f=t.length;i<f;i++)switch(0|t[i]){case a.OPS.rectangle:c=e[r++];d=e[r++];const t=e[r++],i=e[r++],f=c+t,g=d+i;s.moveTo(c,d);if(0===t||0===i)s.lineTo(f,g);else{s.lineTo(f,d);s.lineTo(f,g);s.lineTo(c,g)}u||n.updateRectMinMax(h,[c,d,f,g]);s.closePath();break;case a.OPS.moveTo:c=e[r++];d=e[r++];s.moveTo(c,d);u||n.updatePathMinMax(h,c,d);break;case a.OPS.lineTo:c=e[r++];d=e[r++];s.lineTo(c,d);u||n.updatePathMinMax(h,c,d);break;case a.OPS.curveTo:o=c;l=d;c=e[r+4];d=e[r+5];s.bezierCurveTo(e[r],e[r+1],e[r+2],e[r+3],c,d);n.updateCurvePathMinMax(h,o,l,e[r],e[r+1],e[r+2],e[r+3],c,d,p);r+=6;break;case a.OPS.curveTo2:o=c;l=d;s.bezierCurveTo(c,d,e[r],e[r+1],e[r+2],e[r+3]);n.updateCurvePathMinMax(h,o,l,c,d,e[r],e[r+1],e[r+2],e[r+3],p);c=e[r+2];d=e[r+3];r+=4;break;case a.OPS.curveTo3:o=c;l=d;c=e[r+2];d=e[r+3];s.bezierCurveTo(e[r],e[r+1],c,d,c,d);n.updateCurvePathMinMax(h,o,l,e[r],e[r+1],c,d,c,d,p);r+=4;break;case a.OPS.closePath:s.closePath()}u&&n.updateScalingPathMinMax(h,p);n.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof i&&null!=i&&i.getPattern){e.save();e.strokeStyle=i.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let a=!1;if(this.current.patternFill){e.save();e.fillStyle=i.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.FILL);a=!0}const n=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==n)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();a&&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=u}eoClip(){this.pendingClip=p}beginText(){this.current.textMatrix=a.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const i of t){e.setTransform(...i.transform);e.translate(i.x,i.y);i.addToPath(e,i.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}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){const i=this.commonObjs.get(t),r=this.current;if(!i)throw new Error(`Can't find font for ${t}`);r.fontMatrix=i.fontMatrix||a.FONT_IDENTITY_MATRIX;0!==r.fontMatrix[0]&&0!==r.fontMatrix[3]||(0,a.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;r.fontDirection=-1}else r.fontDirection=1;this.current.font=i;this.current.fontSize=e;if(i.isType3Font)return;const s=i.loadedName||"sans-serif";let n="normal";i.black?n="900":i.bold&&(n="bold");const o=i.italic?"italic":"normal",l=`"${s}", ${i.fallbackName}`;let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${o} ${n} ${c}px ${l}`}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,a,r,s){this.current.textMatrix=[t,e,i,a,r,s];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,s){const n=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&a.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&a.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){n.save();n.translate(e,i);n.beginPath();f(n,d);s&&n.setTransform(...s);h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||n.fill();h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||n.stroke();n.restore()}else{h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||n.fillText(t,e,i);h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||n.strokeText(t,e,i)}if(u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,r.getCurrentTransform)(n),x:e,y:i,fontSize:d,addToPath:f})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,p=t.length,f=i.vertical,g=f?1:-1,v=i.defaultVMetrics,m=n*e.fontMatrix[0],_=e.textRenderingMode===a.TextRenderingMode.FILL&&!i.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);h>0?o.scale(u,-1):o.scale(u,1);let b;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,r.getCurrentTransformInverse)(o),s.PathType.FILL);b=(0,r.getCurrentTransform)(o);o.restore();o.fillStyle=t}let y=e.lineWidth;const A=e.textMatrixScale;if(0===A||0===y){const t=e.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;t!==a.TextRenderingMode.STROKE&&t!==a.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=A;if(1!==l){o.scale(l,l);y/=l}o.lineWidth=y;if(i.isInvalidPDFjsFont){const i=[];let a=0;for(const e of t){i.push(e.unicode);a+=e.width}o.fillText(i.join(""),0,0);e.x+=a*m*u;o.restore();this.compose();return}let P,S=0;for(P=0;P<p;++P){const e=t[P];if("number"==typeof e){S+=g*e*n/1e3;continue}let a=!1;const r=(e.isSpace?d:0)+c,s=e.fontChar,u=e.accent;let p,y,A,w=e.width;if(f){const t=e.vmetric||v,i=-(e.vmetric?t[1]:.5*w)*m,a=t[2]*m;w=t?-t[0]:w;p=i/l;y=(S+a)/l}else{p=S/l;y=0}if(i.remeasure&&w>0){const t=1e3*o.measureText(s).width/n*l;if(w<t&&this.isFontSubpixelAAEnabled){const e=w/t;a=!0;o.save();o.scale(e,1);p/=e}else w!==t&&(p+=(w-t)/2e3*n/l)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(_&&!u)o.fillText(s,p,y);else{this.paintChar(s,p,y,b);if(u){const t=p+n*u.offset.x/l,e=y-n*u.offset.y/l;this.paintChar(u.fontChar,t,e,b)}}A=f?w*m-r*h:w*m+r*h;S+=A;a&&o.restore()}f?e.y-=S:e.x+=S*u;o.restore();this.compose()}showType3Text(t){const e=this.ctx,i=this.current,r=i.font,s=i.fontSize,n=i.fontDirection,o=r.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,d=i.textHScale*n,h=i.fontMatrix||a.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,v;if(!(i.textRenderingMode===a.TextRenderingMode.INVISIBLE)&&0!==s){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;e.save();e.transform(...i.textMatrix);e.translate(i.x,i.y);e.scale(d,n);for(p=0;p<u;++p){f=t[p];if("number"==typeof f){v=o*f*s/1e3;this.ctx.translate(v,0);i.x+=v*d;continue}const n=(f.isSpace?c:0)+l,u=r.charProcOperatorList[f.operatorListId];if(!u){(0,a.warn)(`Type3 character "${f.operatorListId}" is not available.`);continue}if(this.contentVisible){this.processingType3=f;this.save();e.scale(s,s);e.transform(...h);this.executeOperatorList(u);this.restore()}g=a.Util.applyTransform([f.width,0],h)[0]*s+n;e.translate(g,0);i.x+=g*d}e.restore();this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,a,r,s){this.ctx.rect(i,a,r-i,s-a);this.ctx.clip();this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],a=this.baseTransform||(0,r.getCurrentTransform)(this.ctx),n={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new s.TilingPattern(t,i,this.ctx,n,a)}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){const r=a.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=r;this.current.strokeColor=r}setFillRGBColor(t,e,i){const r=a.Util.makeHexColor(t,e,i);this.ctx.fillStyle=r;this.current.fillColor=r;this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))e=this.cachedPatterns.get(t);else{e=(0,s.getShadingPattern)(this.getObject(t));this.cachedPatterns.set(t,e)}i&&(e.matrix=i);return e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.SHADING);const n=(0,r.getCurrentTransformInverse)(e);if(n){const t=e.canvas,i=t.width,r=t.height,s=a.Util.applyTransform([0,0],n),o=a.Util.applyTransform([0,r],n),l=a.Util.applyTransform([i,0],n),c=a.Util.applyTransform([i,r],n),d=Math.min(s[0],o[0],l[0],c[0]),h=Math.min(s[1],o[1],l[1],c[1]),u=Math.max(s[0],o[0],l[0],c[0]),p=Math.max(s[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,a.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,a.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(...t);this.baseTransform=(0,r.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i);this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,a.info)("TODO: Support non-isolated groups.");t.knockout&&(0,a.warn)("Knockout groups not supported.");const i=(0,r.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let s=a.Util.getAxialAlignedBoundingBox(t.bbox,(0,r.getCurrentTransform)(e));const n=[0,0,e.canvas.width,e.canvas.height];s=a.Util.intersect(s,n)||[0,0,0,0];const o=Math.floor(s[0]),c=Math.floor(s[1]);let d=Math.max(Math.ceil(s[2])-o,1),h=Math.max(Math.ceil(s[3])-c,1),u=1,p=1;if(d>l){u=d/l;d=l}if(h>l){p=h/l;h=l}this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(f,d,h),v=g.context;v.scale(1/u,1/p);v.translate(-o,-c);v.transform(...i);if(t.smask)this.smaskStack.push({canvas:g.canvas,context:v,offsetX:o,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(o,c);e.scale(u,p);e.save()}copyCtxState(e,v);this.ctx=v;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();this.ctx=i;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,r.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const i=a.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(i)}}beginAnnotation(t,e,i,s,n){_classPrivateMethodGet(this,f,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const s=e[2]-e[0],o=e[3]-e[1];if(n&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0];i[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=s;e[3]=o;const[n,l]=a.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(s*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.setTransform(n,0,0,-l,0,o*l);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(e[0],e[1],s,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...i);this.transform(...s)}endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,a=this.processingType3;if(a){void 0===a.compiled&&(a.compiled=function compileType3Glyph(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=e+1;let s,n,o,l=new Uint8Array(r*(i+1));const c=e+7&-8;let d=new Uint8Array(c*i),h=0;for(const e of t.data){let t=128;for(;t>0;){d[h++]=e&t?0:255;t>>=1}}let u=0;h=0;if(0!==d[h]){l[0]=1;++u}for(n=1;n<e;n++){if(d[h]!==d[h+1]){l[n]=d[h]?2:1;++u}h++}if(0!==d[h]){l[n]=2;++u}for(s=1;s<i;s++){h=s*c;o=s*r;if(d[h-c]!==d[h]){l[o]=d[h]?1:8;++u}let t=(d[h]?4:0)+(d[h-c]?8:0);for(n=1;n<e;n++){t=(t>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0);if(a[t]){l[o+n]=a[t];++u}h++}if(d[h-c]!==d[h]){l[o+n]=d[h]?2:4;++u}if(u>1e3)return null}h=c*(i-1);o=s*r;if(0!==d[h]){l[o]=8;++u}for(n=1;n<e;n++){if(d[h]!==d[h+1]){l[o+n]=d[h]?4:8;++u}h++}if(0!==d[h]){l[o+n]=4;++u}if(u>1e3)return null;const p=new Int32Array([0,r,-1,0,-r,0,0,0,1]),f=new Path2D;for(s=0;u&&s<=i;s++){let t=s*r;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%r,s);const a=t;let n=l[t];do{const e=p[n];do{t+=e}while(!l[t]);const i=l[t];if(5!==i&&10!==i){n=i;l[t]=0}else{n=i&51*n>>4;l[t]&=n>>2|n<<2}f.lineTo(t%r,t/r|0);l[t]||--u}while(a!==t);--s}d=null;l=null;return function(t){t.save();t.scale(1/e,-1/i);t.translate(0,-i);t.fill(f);t.beginPath();t.restore()}}(t));if(a.compiled){a.compiled(i);return}}const r=this._createMaskCanvas(t),s=r.canvas;i.save();i.setTransform(1,0,0,1,0,0);i.drawImage(s,r.offsetX,r.offsetY);i.restore();this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(e,i,s,n,0,0);const d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let t=0,r=o.length;t<r;t+=2){const r=a.Util.transform(c,[e,i,s,n,o[t],o[t+1]]),[h,u]=a.Util.applyTransform([0,0],r);l.drawImage(d.canvas,h,u)}l.restore();this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,a=this.current.patternFill;for(const n of t){const{data:t,width:o,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=d.context;h.save();putBinaryImageMask(h,this.getObject(t,n));h.globalCompositeOperation="source-in";h.fillStyle=a?i.getPattern(h,this,(0,r.getCurrentTransformInverse)(e),s.PathType.FILL):i;h.fillRect(0,0,o,l);h.restore();e.save();e.transform(...c);e.scale(1,-1);drawImageAtIntegerCoords(e,d.canvas,0,0,o,l,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,a.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,r){if(!this.contentVisible)return;const s=this.getObject(t);if(!s){(0,a.warn)("Dependent image isn't ready yet");return}const n=s.width,o=s.height,l=[];for(let t=0,a=r.length;t<a;t+=2)l.push({transform:[e,0,0,i,r[t],r[t+1]],x:0,y:0,w:n,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(t){if("none"!==this.current.transferMaps){t.filter=this.current.transferMaps;t.drawImage(t.canvas,0,0);t.filter="none"}return t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:a}=t,r=this.cachedCanvases.getCanvas("inlineImage",i,a),s=r.context;s.filter=this.current.transferMaps;s.drawImage(e,0,0);s.filter="none";return r.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,a=this.ctx;this.save();o.isNodeJS||(a.filter="none");a.scale(1/e,-1/i);let s;if(t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const a=this.cachedCanvases.getCanvas("inlineImage",e,i).context;putBinaryImageData(a,t);s=this.applyTransferMapsToCanvas(a)}const n=this._scaleImage(s,(0,r.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=getImageSmoothingEnabled((0,r.getCurrentTransform)(a),t.interpolate);drawImageAtIntegerCoords(a,n.img,0,0,n.paintWidth,n.paintHeight,0,-i,e,i);this.compose();this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let a;if(t.bitmap)a=t.bitmap;else{const e=t.width,i=t.height,r=this.cachedCanvases.getCanvas("inlineImage",e,i).context;putBinaryImageData(r,t);a=this.applyTransferMapsToCanvas(r)}for(const t of e){i.save();i.transform(...t.transform);i.scale(1,-1);drawImageAtIntegerCoords(i,a,t.x,t.y,t.w,t.h,0,-1,1,1);i.restore()}this.compose()}paintSolidColorImageMask(){if(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){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);const i=this.ctx;if(this.pendingClip){e||(this.pendingClip===p?i.clip("evenodd"):i.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,r.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),a=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,a)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=(0,r.getCurrentTransform)(this.ctx);let i,a;if(0===e[1]&&0===e[2]){const r=Math.abs(e[0]),s=Math.abs(e[3]);if(0===t){i=1/r;a=1/s}else{const e=r*t,n=s*t;i=e<1?1/e:1;a=n<1?1/n:1}}else{const r=Math.abs(e[0]*e[3]-e[2]*e[1]),s=Math.hypot(e[0],e[1]),n=Math.hypot(e[2],e[3]);if(0===t){i=n/r;a=s/r}else{const e=t*r;i=n>e?n/e:1;a=s>e?s/e:1}}this._cachedScaleForStroking=[i,a]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[a,s]=this.getScaleForStroking();e.lineWidth=i||1;if(1===a&&1===s){e.stroke();return}let n,o,l;if(t){n=(0,r.getCurrentTransform)(e);o=e.getLineDash().slice();l=e.lineDashOffset}e.scale(a,s);const c=Math.max(a,s);e.setLineDash(e.getLineDash().map((t=>t/c)));e.lineDashOffset/=c;e.stroke();if(t){e.setTransform(...n);e.setLineDash(o);e.lineDashOffset=l}}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;function _restoreInitialState2(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(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}}for(const t in a.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[a.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var a=i(1),r=i(141);const s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=s;function applyBoundingBox(t,e){if(!e)return;const i=e[2]-e[0],a=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],i,a);t.clip(r)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,a.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,a.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{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;"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));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,n){let o;if(n===s.STROKE||n===s.FILL){const s=e.current.getClippedPathBoundingBox(n,(0,r.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(s[2]-s[0])||1,c=Math.ceil(s[3]-s[1])||1,d=e.cachedCanvases.getCanvas("pattern",l,c,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height);h.beginPath();h.rect(0,0,h.canvas.width,h.canvas.height);h.translate(-s[0],-s[1]);i=a.Util.transform(i,[1,0,0,1,s[0],s[1]]);h.transform(...e.baseTransform);this.matrix&&h.transform(...this.matrix);applyBoundingBox(h,this._bbox);h.fillStyle=this._createGradient(h);h.fill();o=t.createPattern(d.canvas,"no-repeat");const u=new DOMMatrix(i);o.setTransform(u)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,i,a,r,s,n,o){const l=e.coords,c=e.colors,d=t.data,h=4*t.width;let u;if(l[i+1]>l[a+1]){u=i;i=a;a=u;u=s;s=n;n=u}if(l[a+1]>l[r+1]){u=a;a=r;r=u;u=n;n=o;o=u}if(l[i+1]>l[a+1]){u=i;i=a;a=u;u=s;s=n;n=u}const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[a]+e.offsetX)*e.scaleX,v=(l[a+1]+e.offsetY)*e.scaleY,m=(l[r]+e.offsetX)*e.scaleX,_=(l[r+1]+e.offsetY)*e.scaleY;if(f>=_)return;const b=c[s],y=c[s+1],A=c[s+2],P=c[n],S=c[n+1],w=c[n+2],x=c[o],E=c[o+1],C=c[o+2],k=Math.round(f),M=Math.round(_);let T,R,I,D,O,G,L,N;for(let t=k;t<=M;t++){if(t<v){let e;e=t<f?0:(f-t)/(f-v);T=p-(p-g)*e;R=b-(b-P)*e;I=y-(y-S)*e;D=A-(A-w)*e}else{let e;e=t>_?1:v===_?0:(v-t)/(v-_);T=g-(g-m)*e;R=P-(P-x)*e;I=S-(S-E)*e;D=w-(w-C)*e}let e;e=t<f?0:t>_?1:(f-t)/(f-_);O=p-(p-m)*e;G=b-(b-x)*e;L=y-(y-E)*e;N=A-(A-C)*e;const i=Math.round(Math.min(T,O)),a=Math.round(Math.max(T,O));let r=h*t+4*i;for(let t=i;t<=a;t++){e=(T-t)/(T-O);e<0?e=0:e>1&&(e=1);d[r++]=R-(R-G)*e|0;d[r++]=I-(I-L)*e|0;d[r++]=D-(D-N)*e|0;d[r++]=255}}}function drawFigure(t,e,i){const a=e.coords,r=e.colors;let s,n;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(a.length/o)-1,c=o-1;for(s=0;s<l;s++){let e=s*o;for(let s=0;s<c;s++,e++){drawTriangle(t,i,a[e],a[e+1],a[e+o],r[e],r[e+1],r[e+o]);drawTriangle(t,i,a[e+o+1],a[e+1],a[e+o],r[e+o+1],r[e+1],r[e+o])}}break;case"triangles":for(s=0,n=a.length;s<n;s+=3)drawTriangle(t,i,a[s],a[s+1],a[s+2],r[s],r[s+1],r[s+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{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){const a=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-a,n=Math.ceil(this._bounds[3])-r,o=Math.min(Math.ceil(Math.abs(s*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(n*t[1]*1.1)),3e3),c=s/o,d=n/l,h={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-r,scaleX:1/c,scaleY:1/d},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,v=g.createImageData(o,l);if(e){const t=v.data;for(let i=0,a=t.length;i<a;i+=4){t[i]=e[0];t[i+1]=e[1];t[i+2]=e[2];t[i+3]=255}}for(const t of this._figures)drawFigure(v,t,h);g.putImageData(v,2,2);return{canvas:f.canvas,offsetX:a-2*c,offsetY:r-2*d,scaleX:c,scaleY:d}}getPattern(t,e,i,n){applyBoundingBox(t,this._bbox);let o;if(n===s.SHADING)o=a.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(t));else{o=a.Util.singularValueDecompose2dScale(e.baseTransform);if(this.matrix){const t=a.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*t[0],o[1]*t[1]]}}const l=this._createMeshCanvas(o,n===s.SHADING?null:this._background,e.cachedCanvases);if(n!==s.SHADING){t.setTransform(...e.baseTransform);this.matrix&&t.transform(...this.matrix)}t.translate(l.offsetX,l.offsetY);t.scale(l.scaleX,l.scaleY);return t.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const n=1,o=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,a.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,i,a,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=a;this.baseTransform=r}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,s=this.xstep,n=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,a.info)("TilingType: "+l);const h=i[0],u=i[1],p=i[2],f=i[3],g=a.Util.singularValueDecompose2dScale(this.matrix),v=a.Util.singularValueDecompose2dScale(this.baseTransform),m=[g[0]*v[0],g[1]*v[1]],_=this.getSizeAndScale(s,this.ctx.canvas.width,m[0]),b=this.getSizeAndScale(n,this.ctx.canvas.height,m[1]),y=t.cachedCanvases.getCanvas("pattern",_.size,b.size,!0),A=y.context,P=d.createCanvasGraphics(A);P.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(P,o,c);let S=h,w=u,x=p,E=f;if(h<0){S=0;x+=Math.abs(h)}if(u<0){w=0;E+=Math.abs(u)}A.translate(-_.scale*S,-b.scale*w);P.transform(_.scale,0,0,b.scale,0,0);A.save();this.clipBbox(P,S,w,x,E);P.baseTransform=(0,r.getCurrentTransform)(P.ctx);P.executeOperatorList(e);P.endDrawing();return{canvas:y.canvas,scaleX:_.scale,scaleY:b.scale,offsetX:S,offsetY:w}}getSizeAndScale(t,e,i){t=Math.abs(t);const a=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);r>=a?r=a:i=r/t;return{scale:i,size:r}}clipBbox(t,e,i,a,s){const n=a-e,o=s-i;t.ctx.rect(e,i,n,o);t.current.updateRectMinMax((0,r.getCurrentTransform)(t.ctx),[e,i,a,s]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const r=t.ctx,s=t.current;switch(e){case n:const t=this.ctx;r.fillStyle=t.fillStyle;r.strokeStyle=t.strokeStyle;s.fillColor=t.fillStyle;s.strokeColor=t.strokeStyle;break;case o:const l=a.Util.makeHexColor(i[0],i[1],i[2]);r.fillStyle=l;r.strokeStyle=l;s.fillColor=l;s.strokeColor=l;break;default:throw new a.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,r){let n=i;if(r!==s.SHADING){n=a.Util.transform(n,e.baseTransform);this.matrix&&(n=a.Util.transform(n,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(n);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}e.TilingPattern=TilingPattern},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.convertBlackAndWhiteToRGBA=convertBlackAndWhiteToRGBA;e.convertToRGBA=function convertToRGBA(t){switch(t.kind){case a.ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(t);case a.ImageKind.RGB_24BPP:return function convertRGBToRGBA(t){let{src:e,srcPos:i=0,dest:r,destPos:s=0,width:n,height:o}=t,l=0;const c=e.length>>2,d=new Uint32Array(e.buffer,i,c);if(a.FeatureTest.isLittleEndian){for(;l<c-2;l+=3,s+=4){const t=d[l],e=d[l+1],i=d[l+2];r[s]=4278190080|t;r[s+1]=t>>>24|e<<8|4278190080;r[s+2]=e>>>16|i<<16|4278190080;r[s+3]=i>>>8|4278190080}for(let t=4*l,i=e.length;t<i;t+=3)r[s++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;l<c-2;l+=3,s+=4){const t=d[l],e=d[l+1],i=d[l+2];r[s]=255|t;r[s+1]=t<<24|e>>>8|255;r[s+2]=e<<16|i>>>16|255;r[s+3]=i<<8|255}for(let t=4*l,i=e.length;t<i;t+=3)r[s++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:i,destPos:s}}(t)}return null};e.grayToRGBA=function grayToRGBA(t,e){if(a.FeatureTest.isLittleEndian)for(let i=0,a=t.length;i<a;i++)e[i]=65793*t[i]|4278190080;else for(let i=0,a=t.length;i<a;i++)e[i]=16843008*t[i]|255};var a=i(1);function convertBlackAndWhiteToRGBA(t){let{src:e,srcPos:i=0,dest:r,width:s,height:n,nonBlackColor:o=4294967295,inverseDecode:l=!1}=t;const c=a.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[o,c]:[c,o],u=s>>3,p=7&s,f=e.length;r=new Uint32Array(r.buffer);let g=0;for(let t=0;t<n;t++){for(const t=i+u;i<t;i++){const t=i<f?e[i]:255;r[g++]=128&t?h:d;r[g++]=64&t?h:d;r[g++]=32&t?h:d;r[g++]=16&t?h:d;r[g++]=8&t?h:d;r[g++]=4&t?h:d;r[g++]=2&t?h:d;r[g++]=1&t?h:d}if(0===p)continue;const t=i<f?e[i++]:255;for(let e=0;e<p;e++)r[g++]=t&1<<7-e?h:d}return{srcPos:i,destPos:g}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const i=Object.create(null);e.GlobalWorkerOptions=i;i.workerPort=null;i.workerSrc=""},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;var a=i(1);const r=1,s=2,n=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,a.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new a.AbortException(t.message);case"MissingPDFException":return new a.MissingPDFException(t.message);case"PasswordException":return new a.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new a.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new a.UnknownErrorException(t.message,t.details);default:return new a.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{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=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===r)i.resolve(e.data);else{if(e.callback!==s)throw new Error("Unexpected callback case");i.reject(wrapReason(e.reason))}return}const a=this.actionHandler[e.action];if(!a)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,n=e.sourceName;new Promise((function(t){t(a(e.data))})).then((function(a){i.postMessage({sourceName:t,targetName:n,callback:r,callbackId:e.callbackId,data:a})}),(function(a){i.postMessage({sourceName:t,targetName:n,callback:s,callbackId:e.callbackId,reason:wrapReason(a)})}))}else e.streamId?this._createStreamSink(e):a(e.data)};i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new 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){const r=this.callbackId++,s=(0,a.createPromiseCapability)();this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,r){const s=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:i=>{const n=(0,a.createPromiseCapability)();this.streamControllers[s]={controller:i,startCall:n,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:s,data:e,desiredSize:i.desiredSize},r);return n.promise},pull:t=>{const e=(0,a.createPromiseCapability)();this.streamControllers[s].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:h,streamId:s,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,a.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,a.createPromiseCapability)();this.streamControllers[s].cancelCall=e;this.streamControllers[s].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:n,streamId:s,reason:wrapReason(t)});return e.promise}},i)}_createStreamSink(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,n=this,o=this.actionHandler[t.action],h={enqueue(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=n;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,a.createPromiseCapability)();this.ready=this.sinkCapability.promise}s.postMessage({sourceName:i,targetName:r,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;s.postMessage({sourceName:i,targetName:r,stream:l,streamId:e});delete n.streamSinks[e]}},error(t){(0,a.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;s.postMessage({sourceName:i,targetName:r,stream:d,streamId:e,reason:wrapReason(t)})}},sinkCapability:(0,a.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve();h.ready=h.sinkCapability.promise;this.streamSinks[e]=h;new Promise((function(e){e(o(t.data,h))})).then((function(){s.postMessage({sourceName:i,targetName:r,stream:p,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:r,stream:p,streamId:e,reason:wrapReason(t)})}))}_processStreamMessage(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,f=this.streamControllers[e],g=this.streamSinks[e];switch(t.stream){case p:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case u:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case h:if(!g){s.postMessage({sourceName:i,targetName:r,stream:u,streamId:e,success:!0});break}g.desiredSize<=0&&t.desiredSize>0&&g.sinkCapability.resolve();g.desiredSize=t.desiredSize;new Promise((function(t){t(g.onPull&&g.onPull())})).then((function(){s.postMessage({sourceName:i,targetName:r,stream:u,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:r,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,a.assert)(f,"enqueue should have stream controller");if(f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:(0,a.assert)(f,"close should have stream controller");if(f.isClosed)break;f.isClosed=!0;f.controller.close();this._deleteStreamController(f,e);break;case d:(0,a.assert)(f,"error should have stream controller");f.controller.error(wrapReason(t.reason));this._deleteStreamController(f,e);break;case o:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(f,e);break;case n:if(!g)break;new Promise((function(e){e(g.onCancel&&g.onCancel(wrapReason(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:r,stream:o,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:r,stream:o,streamId:e,reason:wrapReason(t)})}));g.sinkCapability.reject(wrapReason(t.reason));g.isCancelled=!0;delete this.streamSinks[e];break;default:throw new 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)}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var a=i(1);e.Metadata=class Metadata{#m;#_;constructor(t){let{parsedData:e,rawData:i}=t;this.#m=e;this.#_=i}getRaw(){return this.#_}get(t){return this.#m.get(t)??null}getAll(){return(0,a.objectFromMap)(this.#m)}has(t){return this.#m.has(t)}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var a=i(1),r=i(143);function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const s=Symbol("INTERNAL");class OptionalContentGroup{#b=!0;constructor(t,e){this.name=t;this.intent=e}get visible(){return this.#b}_setVisible(t,e){t!==s&&(0,a.unreachable)("Internal method `_setVisible` called.");this.#b=e}}var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakSet;e.OptionalContentConfig=class OptionalContentConfig{constructor(t){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,d);_classPrivateFieldInitSpec(this,n,{writable:!0,value:null});_classPrivateFieldInitSpec(this,o,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,l,{writable:!0,value:null});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;_classPrivateFieldSet(this,c,t.order);for(const e of t.groups)_classPrivateFieldGet(this,o).set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of _classPrivateFieldGet(this,o).values())t._setVisible(s,!1);for(const e of t.on)_classPrivateFieldGet(this,o).get(e)._setVisible(s,!0);for(const e of t.off)_classPrivateFieldGet(this,o).get(e)._setVisible(s,!1);_classPrivateFieldSet(this,l,this.getHash())}}isVisible(t){if(0===_classPrivateFieldGet(this,o).size)return!0;if(!t){(0,a.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!_classPrivateFieldGet(this,o).has(t.id)){(0,a.warn)(`Optional content group not found: ${t.id}`);return!0}return _classPrivateFieldGet(this,o).get(t.id).visible}if("OCMD"===t.type){if(t.expression)return _classPrivateMethodGet(this,d,_evaluateVisibilityExpression2).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,o).has(e)){(0,a.warn)(`Optional content group not found: ${e}`);return!0}if(_classPrivateFieldGet(this,o).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,o).has(e)){(0,a.warn)(`Optional content group not found: ${e}`);return!0}if(!_classPrivateFieldGet(this,o).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,o).has(e)){(0,a.warn)(`Optional content group not found: ${e}`);return!0}if(!_classPrivateFieldGet(this,o).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,o).has(e)){(0,a.warn)(`Optional content group not found: ${e}`);return!0}if(_classPrivateFieldGet(this,o).get(e).visible)return!1}return!0}(0,a.warn)(`Unknown optional content policy ${t.policy}.`);return!0}(0,a.warn)(`Unknown group type ${t.type}.`);return!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(_classPrivateFieldGet(this,o).has(t)){_classPrivateFieldGet(this,o).get(t)._setVisible(s,!!e);_classPrivateFieldSet(this,n,null)}else(0,a.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===_classPrivateFieldGet(this,l)}getOrder(){return _classPrivateFieldGet(this,o).size?_classPrivateFieldGet(this,c)?_classPrivateFieldGet(this,c).slice():[..._classPrivateFieldGet(this,o).keys()]:null}getGroups(){return _classPrivateFieldGet(this,o).size>0?(0,a.objectFromMap)(_classPrivateFieldGet(this,o)):null}getGroup(t){return _classPrivateFieldGet(this,o).get(t)||null}getHash(){if(null!==_classPrivateFieldGet(this,n))return _classPrivateFieldGet(this,n);const t=new r.MurmurHash3_64;for(const[e,i]of _classPrivateFieldGet(this,o))t.update(`${e}:${i.visible}`);return _classPrivateFieldSet(this,n,t.hexdigest())}};function _evaluateVisibilityExpression2(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let r=1;r<e;r++){const e=t[r];let s;if(Array.isArray(e))s=_classPrivateMethodGet(this,d,_evaluateVisibilityExpression2).call(this,e);else{if(!_classPrivateFieldGet(this,o).has(e)){(0,a.warn)(`Optional content group not found: ${e}`);return!0}s=_classPrivateFieldGet(this,o).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;var a=i(1),r=i(141);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){let{length:i,initialData:r,progressiveDone:s=!1,contentDispositionFilename:n=null,disableRange:o=!1,disableStream:l=!1}=t;(0,a.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=s;this._contentDispositionFilename=n;if((null==r?void 0:r.length)>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e;this._isStreamingSupported=!l;this._isRangeSupported=!o;this._contentLength=i;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{begin:e,chunk:i}=t;const r=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const t=this._rangeReaders.some((function(t){if(t._begin!==e)return!1;t._enqueue(r);return!0}));(0,a.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}_onProgress(t){if(void 0===t.total){var e,i;null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded})}else{var a,r;null===(a=this._fullRequestReader)||void 0===a||null===(r=a.onProgress)||void 0===r||r.call(a,{loaded:t.loaded,total:t.total})}}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t;this._done=i||!1;this._filename=(0,r.isPdfFile)(a)?a:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().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){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,a.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{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{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.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){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,a.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;class XfaText{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};!function walk(t){var i;if(!t)return;let a=null;const r=t.name;if("#text"===r)a=t.value;else{if(!XfaText.shouldBuildText(r))return;null!=t&&null!==(i=t.attributes)&&void 0!==i&&i.textContent?a=t.attributes.textContent:t.value&&(a=t.value)}null!==a&&e.push({str:a});if(t.children)for(const e of t.children)walk(e)}(t);return i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var a=i(142);const fetchData=function(t){return new Promise(((e,i)=>{require("fs").readFile(t,((t,a)=>{!t&&a?e(new Uint8Array(a)):i(new Error(t))}))}))};class NodeFilterFactory extends a.BaseFilterFactory{}e.NodeFilterFactory=NodeFilterFactory;class NodeCanvasFactory extends a.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends a.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends a.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;var a=i(1),r=i(157);const s=require("fs"),n=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=l.parse(t);if("file:"===e.protocol||e.host)return e;if(/^[a-z]:[/\\]/i.test(t))return l.parse(`file:///${t}`);e.host||(e.protocol="file:");return e}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol||"capacitor:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;const 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,a.createPromiseCapability)();this._headersCapability=(0,a.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(){var t;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e){this._readCapability=(0,a.createPromiseCapability)();return this.read()}this._loaded+=e.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(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 a.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,a.createPromiseCapability)();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e){this._readCapability=(0,a.createPromiseCapability)();return this.read()}this._loaded+=e.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(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 createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new a.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:i,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i;this._contentLength=s||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=n.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,i){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new a.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=n.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,""));s.lstat(e,((t,i)=>{if(t){"ENOENT"===t.code&&(t=new a.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=i.size;this._setReadableStream(s.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,i){super(t);let a=decodeURIComponent(this._url.path);c.test(this._url.href)&&(a=a.replace(/^\//,""));this._setReadableStream(s.createReadStream(a,{start:e,end:i-1}))}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new a.MissingPDFException('Missing PDF "'+e+'".');return new a.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,r.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,s.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:a,disableRange:r}=t;const s={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(e("Content-Length"),10);if(!Number.isInteger(n))return s;s.suggestedLength=n;if(n<=2*a)return s;if(r||!i)return s;if("bytes"!==e("Accept-Ranges"))return s;if("identity"!==(e("Content-Encoding")||"identity"))return s;s.allowRangeRequests=!0;return s};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var a=i(1),r=i(158),s=i(141)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,i=toParamRegExp("filename\\*","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}i=function rfc2231getparam(t){const e=[];let i;const a=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=a.exec(t));){let[,t,a,r]=i;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[a,r]}const r=[];for(let t=0;t<e.length&&t in e;++t){let[i,a]=e[t];a=rfc2616unquote(a);if(i){a=unescape(a);0===t&&(a=rfc5987decode(a))}r.push(a)}return r.join("")}(t);if(i){return fixupEncoding(rfc2047decode(i))}i=toParamRegExp("filename","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=rfc2047decode(t);return fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const r=new TextDecoder(t,{fatal:!0}),s=(0,a.stringToBytes)(i);i=r.decode(s);e=!1}catch(t){}}return i}function fixupEncoding(t){if(e&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);e&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');if(-1!==i){e[t]=e[t].slice(0,i);e.length=t+1}e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function rfc5987decode(t){const e=t.indexOf("'");if(-1===e)return t;return textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,a){if("q"===i||"Q"===i)return textdecode(e,a=(a=a.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{a=atob(a)}catch(t){}return textdecode(e,a)}))}return""};var a=i(1)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;var a=i(1),r=i(157);class NetworkManager{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,i){const a={begin:t,end:e};for(const t in i)a[t]=i[t];return this.request(a)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),i=this.currXhrId++,a=this.pendingRequests[i]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);a.expectedStatus=206}else a.expectedStatus=200;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);a.onHeadersReceived=t.onHeadersReceived;a.onDone=t.onDone;a.onError=t.onError;a.onProgress=t.onProgress;e.send(null);return i}onProgress(t,e){var i;const a=this.pendingRequests[t];a&&(null===(i=a.onProgress)||void 0===i||i.call(a,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const r=i.xhr;if(r.readyState>=2&&i.onHeadersReceived){i.onHeadersReceived();delete i.onHeadersReceived}if(4!==r.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===r.status&&this.isHttp){var s;null===(s=i.onError)||void 0===s||s.call(i,r.status);return}const n=r.status||200;if(!(200===n&&206===i.expectedStatus)&&n!==i.expectedStatus){var o;null===(o=i.onError)||void 0===o||o.call(i,r.status);return}const l=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,a.stringToBytes)(e).buffer}(r);if(206===n){const t=r.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)i.onDone({begin:0,chunk:l});else{var c;null===(c=i.onError)||void 0===c||c.call(i,r.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t];e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const i=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);i.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const 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,a.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(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0);this._contentLength=a||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,r.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{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){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,a.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,i){this._manager=t;const a={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,a);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,r.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){if(!this.isStreamingSupported){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,a.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;var a=i(1),r=i(157);function createFetchOptions(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const i in t){const a=t[i];void 0!==a&&e.append(i,a)}return e}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;(0,a.warn)(`getArrayBuffer - unexpected data format: ${t}`);return new Uint8Array(t).buffer}e.PDFFetchStream=class PDFFetchStream{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(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t;this._reader=null;this._loaded=0;this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1;this._contentLength=e.length;this._headersCapability=(0,a.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const i=e.url;fetch(i,createFetchOptions(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();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=s||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new a.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(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();if(i)return{value:e,done:i};this._loaded+=e.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(e),done:!1}}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,i){this._stream=t;this._reader=null;this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1;this._readCapability=(0,a.createPromiseCapability)();this._isStreamingSupported=!s.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${i-1}`);const n=s.url;fetch(n,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,r.validateResponseStatus)(t.status))throw(0,r.createResponseStatusError)(t.status,n);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();if(i)return{value:e,done:i};this._loaded+=e.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:getArrayBuffer(e),done:!1}}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t);this._abortController.abort()}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){if(!t.textContentSource&&(t.textContent||t.textContentStream)){(0,r.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");t.textContentSource=t.textContent||t.textContentStream}const{container:e,viewport:i}=t,a=getComputedStyle(e),s=a.getPropertyValue("visibility"),n=parseFloat(a.getPropertyValue("--scale-factor"));"visible"===s&&(!n||Math.abs(n-i.scale)>1e-15)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new TextLayerRenderTask(t);o._render();return o};e.updateTextLayer=function updateTextLayer(t){let{container:e,viewport:i,textDivs:a,textDivProperties:s,isOffscreenCanvasSupported:n,mustRotate:o=!0,mustRescale:l=!0}=t;o&&(0,r.setLayerDimensions)(e,{rotation:i.rotation});if(l){const t=getCtx(0,n),e={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of a){e.properties=s.get(t);e.div=t;layout(e)}}};var a=i(1),r=i(141);const s=30,n=.8,o=new Map;function getCtx(t,e){let i;const r=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0,alpha:!1}:{alpha:!1};if(e&&a.FeatureTest.isOffscreenCanvasSupported)i=new OffscreenCanvas(t,t).getContext("2d",r);else{const e=document.createElement("canvas");e.width=e.height=t;i=e.getContext("2d",r)}return i}function appendText(t,e,i){const r=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(r);const c=a.Util.transform(t._transform,e.transform);let d=Math.atan2(c[1],c[0]);const h=i[e.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const i=o.get(t);if(i)return i;const a=getCtx(s,e);a.font=`${s}px ${t}`;const r=a.measureText("");let l=null==r?void 0:r.fontBoundingBoxAscent,c=Math.abs(null==r?void 0:r.fontBoundingBoxDescent);if(l){const e=l/(l+c);o.set(t,e);a.canvas.width=a.canvas.height=0;return e}a.strokeStyle="red";a.clearRect(0,0,s,s);a.strokeText("g",0,0);let d=a.getImageData(0,0,s,s).data;c=0;for(let t=d.length-1-3;t>=0;t-=4)if(d[t]>0){c=Math.ceil(t/4/s);break}a.clearRect(0,0,s,s);a.strokeText("A",0,s);d=a.getImageData(0,0,s,s).data;l=0;for(let t=0,e=d.length;t<e;t+=4)if(d[t]>0){l=s-Math.floor(t/4/s);break}a.canvas.width=a.canvas.height=0;if(l){const e=l/(l+c);o.set(t,e);return e}o.set(t,n);return n}(h.fontFamily,t._isOffscreenCanvasSupported);let f,g;if(0===d){f=c[4];g=c[5]-p}else{f=c[4]+p*Math.sin(d);g=c[5]-p*Math.cos(d)}const v="calc(var(--scale-factor)*",m=r.style;if(t._container===t._rootContainer){m.left=`${(100*f/t._pageWidth).toFixed(2)}%`;m.top=`${(100*g/t._pageHeight).toFixed(2)}%`}else{m.left=`${v}${f.toFixed(2)}px)`;m.top=`${v}${g.toFixed(2)}px)`}m.fontSize=`${v}${u.toFixed(2)}px)`;m.fontFamily=h.fontFamily;l.fontSize=u;r.setAttribute("role","presentation");r.textContent=e.str;r.dir=e.dir;t._fontInspectorEnabled&&(r.dataset.fontName=e.fontName);0!==d&&(l.angle=d*(180/Math.PI));let _=!1;if(e.str.length>1)_=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(_=!0)}_&&(l.canvasWidth=h.vertical?e.height:e.width);t._textDivProperties.set(r,l);t._isReadableStream&&t._layoutText(r)}function layout(t){const{div:e,scale:i,properties:a,ctx:r,prevFontSize:s,prevFontFamily:n}=t,{style:o}=e;let l="";if(0!==a.canvasWidth&&a.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=a;if(s!==h||n!==c){r.font=`${h*i}px ${c}`;t.prevFontSize=h;t.prevFontFamily=c}try{const{width:t}=r.measureText(e.textContent);t>0&&(l=`scaleX(${d*i/t})`)}catch(t){}}0!==a.angle&&(l=`rotate(${a.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor(t){var e;let{textContentSource:i,container:s,viewport:n,textDivs:o,textDivProperties:l,textContentItemsStr:c,isOffscreenCanvasSupported:d}=t;this._textContentSource=i;this._isReadableStream=i instanceof ReadableStream;this._container=this._rootContainer=s;this._textDivs=o||[];this._textContentItemsStr=c||[];this._isOffscreenCanvasSupported=d;this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled);this._reader=null;this._textDivProperties=l||new WeakMap;this._canceled=!1;this._capability=(0,a.createPromiseCapability)();this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,d)};const{pageWidth:h,pageHeight:u,pageX:p,pageY:f}=n.rawDims;this._transform=[1,0,0,-1,-p,f+u];this._pageWidth=h;this._pageHeight=u;(0,r.setLayerDimensions)(s,n);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new a.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new a.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const i of t)if(void 0!==i.str){this._textContentItemsStr.push(i.str);appendText(this,i,e)}else if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){const t=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==i.id&&this._container.setAttribute("id",`${i.id}`);t.append(this._container)}else"endMarkedContent"===i.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){const t=(0,a.createPromiseCapability)();let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((i=>{let{value:a,done:r}=i;if(r)t.resolve();else{Object.assign(e,a.styles);this._processItems(a.items,e);pump()}}),t.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:i}=this._textContentSource;this._processItems(e,i);t.resolve()}}t.promise.then((()=>{e=null;!function render(t){if(t._canceled)return;const e=t._textDivs,i=t._capability;if(e.length>1e5)i.resolve();else{if(!t._isReadableStream)for(const i of e)t._layoutText(i);i.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;var a=i(1),r=i(140),s=i(163),n=i(164),o=i(141);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakSet,m=new WeakSet,_=new WeakSet,b=new WeakSet;class AnnotationEditorLayer{constructor(t){_classPrivateMethodInitSpec(this,b);_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,v);_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,d,{writable:!0,value:this.pointerup.bind(this)});_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.pointerdown.bind(this)});_classPrivateFieldInitSpec(this,u,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,f,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,g,{writable:!0,value:void 0});if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;s.FreeTextEditor.initialize(t.l10n);n.InkEditor.initialize(t.l10n)}t.uiManager.registerEditorTypes([s.FreeTextEditor,n.InkEditor]);_classPrivateFieldSet(this,g,t.uiManager);this.pageIndex=t.pageIndex;this.div=t.div;_classPrivateFieldSet(this,l,t.accessibilityManager);_classPrivateFieldGet(this,g).addLayer(this)}get isEmpty(){return 0===_classPrivateFieldGet(this,u).size}updateToolbar(t){_classPrivateFieldGet(this,g).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(this,g).getMode();_classPrivateMethodGet(this,b,_cleanup2).call(this);if(t===a.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();_classPrivateFieldGet(this,g).unselectAll();if(t!==a.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",t===a.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===a.AnnotationEditorType.INK);this.div.hidden=!1}}addInkEditorIfNeeded(t){if(!t&&_classPrivateFieldGet(this,g).getMode()!==a.AnnotationEditorType.INK)return;if(!t)for(const t of _classPrivateFieldGet(this,u).values())if(t.isEmpty()){t.setInBackground();return}_classPrivateMethodGet(this,_,_createAndAddNewEditor2).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){_classPrivateFieldGet(this,g).setEditingState(t)}addCommands(t){_classPrivateFieldGet(this,g).addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of _classPrivateFieldGet(this,u).values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of _classPrivateFieldGet(this,u).values())t.disableEditing();_classPrivateMethodGet(this,b,_cleanup2).call(this);this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(t){_classPrivateFieldGet(this,g).getActive()!==t&&_classPrivateFieldGet(this,g).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(this,h));this.div.addEventListener("pointerup",_classPrivateFieldGet(this,d))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(this,h));this.div.removeEventListener("pointerup",_classPrivateFieldGet(this,d))}attach(t){_classPrivateFieldGet(this,u).set(t.id,t)}detach(t){var e;_classPrivateFieldGet(this,u).delete(t.id);null===(e=_classPrivateFieldGet(this,l))||void 0===e||e.removePointerInTextLayer(t.contentDiv)}remove(t){_classPrivateFieldGet(this,g).removeEditor(t);this.detach(t);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&_classPrivateFieldGet(this,g).focusMainContainer()}),0);_classPrivateFieldGet(this,f)||this.addInkEditorIfNeeded(!1)}add(t){_classPrivateMethodGet(this,v,_changeParent2).call(this,t);_classPrivateFieldGet(this,g).addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveEditorInDOM(t);t.onceAdded();_classPrivateFieldGet(this,g).addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null===(e=_classPrivateFieldGet(this,l))||void 0===e||e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(this,g).getId()}deserialize(t){switch(t.annotationType){case a.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this,_classPrivateFieldGet(this,g));case a.AnnotationEditorType.INK:return n.InkEditor.deserialize(t,this,_classPrivateFieldGet(this,g))}return null}setSelected(t){_classPrivateFieldGet(this,g).setSelected(t)}toggleSelected(t){_classPrivateFieldGet(this,g).toggleSelected(t)}isSelected(t){return _classPrivateFieldGet(this,g).isSelected(t)}unselect(t){_classPrivateFieldGet(this,g).unselect(t)}pointerup(t){const{isMac:e}=a.FeatureTest.platform;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!1);_classPrivateFieldGet(this,c)?_classPrivateMethodGet(this,_,_createAndAddNewEditor2).call(this,t):_classPrivateFieldSet(this,c,!0)}}pointerdown(t){const{isMac:e}=a.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;_classPrivateFieldSet(this,p,!0);const i=_classPrivateFieldGet(this,g).getActive();_classPrivateFieldSet(this,c,!i||i.isEmpty())}drop(t){const e=t.dataTransfer.getData("text/plain"),i=_classPrivateFieldGet(this,g).getEditor(e);if(!i)return;t.preventDefault();t.dataTransfer.dropEffect="move";_classPrivateMethodGet(this,v,_changeParent2).call(this,i);const a=this.div.getBoundingClientRect(),r=t.clientX-a.x,s=t.clientY-a.y;i.translate(r-i.startX,s-i.startY);this.moveEditorInDOM(i);i.div.focus()}dragover(t){t.preventDefault()}destroy(){var t;(null===(t=_classPrivateFieldGet(this,g).getActive())||void 0===t?void 0:t.parent)===this&&_classPrivateFieldGet(this,g).setActiveEditor(null);for(const t of _classPrivateFieldGet(this,u).values()){var e;null===(e=_classPrivateFieldGet(this,l))||void 0===e||e.removePointerInTextLayer(t.contentDiv);t.setParent(null);t.isAttachedToDOM=!1;t.div.remove()}this.div=null;_classPrivateFieldGet(this,u).clear();_classPrivateFieldGet(this,g).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e;(0,o.setLayerDimensions)(this.div,e);(0,r.bindEvents)(this,this.div,["dragover","drop"]);for(const t of _classPrivateFieldGet(this,g).getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){let{viewport:e}=t;_classPrivateFieldGet(this,g).commitOrRemove();this.viewport=e;(0,o.setLayerDimensions)(this.div,{rotation:e.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer;function _changeParent2(t){var e;if(t.parent!==this){this.attach(t);null===(e=t.parent)||void 0===e||e.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}function _createNewEditor2(t){switch(_classPrivateFieldGet(this,g).getMode()){case a.AnnotationEditorType.FREETEXT:return new s.FreeTextEditor(t);case a.AnnotationEditorType.INK:return new n.InkEditor(t)}return null}function _createAndAddNewEditor2(t){const e=this.getNextId(),i=_classPrivateMethodGet(this,m,_createNewEditor2).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY,uiManager:_classPrivateFieldGet(this,g)});i&&this.add(i);return i}function _cleanup2(){_classPrivateFieldSet(this,f,!0);for(const t of _classPrivateFieldGet(this,u).values())t.isEmpty()&&t.remove();_classPrivateFieldSet(this,f,!1)}!function _defineProperty(t,e,i){(e=function _toPropertyKey(t){var e=function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}(AnnotationEditorLayer,"_initialized",!1)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;var a=i(1),r=i(140),s=i(139);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,i){(e=function _toPropertyKey(t){var e=function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakSet,v=new WeakSet,m=new WeakSet,_=new WeakSet;class FreeTextEditor extends s.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"});_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,g);_classPrivateFieldInitSpec(this,n,{writable:!0,value:this.editorDivBlur.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:this.editorDivFocus.bind(this)});_classPrivateFieldInitSpec(this,l,{writable:!0,value:this.editorDivInput.bind(this)});_classPrivateFieldInitSpec(this,c,{writable:!0,value:this.editorDivKeydown.bind(this)});_classPrivateFieldInitSpec(this,d,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:""});_classPrivateFieldInitSpec(this,u,{writable:!0,value:`${this.id}-editor`});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,f,{writable:!0,value:void 0});_classPrivateFieldSet(this,d,t.color||FreeTextEditor._defaultColor||s.AnnotationEditor._defaultLineColor);_classPrivateFieldSet(this,f,t.fontSize||FreeTextEditor._defaultFontSize)}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case a.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case a.AnnotationEditorParamsType.FREETEXT_SIZE:_classPrivateMethodGet(this,g,_updateFontSize2).call(this,e);break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:_classPrivateMethodGet(this,v,_updateColor2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[a.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(this,f)],[a.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(this,d)]]}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+_classPrivateFieldGet(this,f))*t]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(a.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.div.removeAttribute("aria-activedescendant");this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(this,c));this.editorDiv.addEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.addEventListener("blur",_classPrivateFieldGet(this,n));this.editorDiv.addEventListener("input",_classPrivateFieldGet(this,l))}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.setAttribute("aria-activedescendant",_classPrivateFieldGet(this,u));this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(this,c));this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(this,n));this.editorDiv.removeEventListener("input",_classPrivateFieldGet(this,l));this.div.focus({preventScroll:!0});this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(t){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(!this.width){this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing");super.remove()}commit(){if(this.isInEditMode()){super.commit();if(!_classPrivateFieldGet(this,p)){_classPrivateFieldSet(this,p,!0);this.parent.addUndoableEditor(this)}this.disableEditMode();_classPrivateFieldSet(this,h,_classPrivateMethodGet(this,m,_extractText2).call(this).trimEnd());_classPrivateMethodGet(this,_,_setEditorDimensions2).call(this)}}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enableEditMode();this.editorDiv.focus()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",_classPrivateFieldGet(this,u));this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)}));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}));this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;i.fontSize=`calc(${_classPrivateFieldGet(this,f)}px * var(--scale-factor))`;i.color=_classPrivateFieldGet(this,d);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"]);if(this.width){const[i,a]=this.parentDimensions;this.setAt(t*i,e*a,this.width*i,this.height*a);for(const t of _classPrivateFieldGet(this,h).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}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,i){const r=super.deserialize(t,e,i);_classPrivateFieldSet(r,f,t.fontSize);_classPrivateFieldSet(r,d,a.Util.makeHexColor(...t.color));_classPrivateFieldSet(r,h,t.value);return r}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parentScale,e=this.getRect(t,t),i=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:_classPrivateFieldGet(this,d));return{annotationType:a.AnnotationEditorType.FREETEXT,color:i,fontSize:_classPrivateFieldGet(this,f),value:_classPrivateFieldGet(this,h),pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor;function _updateFontSize2(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-_classPrivateFieldGet(this,f))*this.parentScale);_classPrivateFieldSet(this,f,t);_classPrivateMethodGet(this,_,_setEditorDimensions2).call(this)},e=_classPrivateFieldGet(this,f);this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=_classPrivateFieldGet(this,d);this.addCommands({cmd:()=>{_classPrivateFieldSet(this,d,this.editorDiv.style.color=t)},undo:()=>{_classPrivateFieldSet(this,d,this.editorDiv.style.color=e)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _extractText2(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const i of t)e.push(i.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}function _setEditorDimensions2(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,a=e.style.display;e.style.display="hidden";t.div.append(this.div);i=e.getBoundingClientRect();e.remove();e.style.display=a}this.width=i.width/t;this.height=i.height/e}_defineProperty(FreeTextEditor,"_freeTextDefaultContent","");_defineProperty(FreeTextEditor,"_l10nPromise",void 0);_defineProperty(FreeTextEditor,"_internalPadding",0);_defineProperty(FreeTextEditor,"_defaultColor",null);_defineProperty(FreeTextEditor,"_defaultFontSize",10);_defineProperty(FreeTextEditor,"_keyboardManager",new r.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]));_defineProperty(FreeTextEditor,"_type","freetext")},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return s.fitCurve}});var a=i(1),r=i(139),s=i(165),n=i(140);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,i){(e=function _toPropertyKey(t){var e=function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classStaticPrivateMethodGet(t,e,i){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return i}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const o=16;var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakSet,S=new WeakSet,w=new WeakSet,x=new WeakSet,E=new WeakSet,C=new WeakSet,k=new WeakSet,M=new WeakSet,T=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,G=new WeakSet,L=new WeakSet,N=new WeakSet,j=new WeakSet,B=new WeakSet,W=new WeakSet,U=new WeakSet,q=new WeakSet,V=new WeakSet;class InkEditor extends r.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"});_classPrivateMethodInitSpec(this,V);_classPrivateMethodInitSpec(this,q);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,W);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,w);_classPrivateMethodInitSpec(this,S);_classPrivateMethodInitSpec(this,P);_classPrivateFieldInitSpec(this,l,{writable:!0,value:0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:0});_classPrivateFieldInitSpec(this,d,{writable:!0,value:0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.canvasPointermove.bind(this)});_classPrivateFieldInitSpec(this,u,{writable:!0,value:this.canvasPointerleave.bind(this)});_classPrivateFieldInitSpec(this,p,{writable:!0,value:this.canvasPointerup.bind(this)});_classPrivateFieldInitSpec(this,f,{writable:!0,value:this.canvasPointerdown.bind(this)});_classPrivateFieldInitSpec(this,g,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,v,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,m,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:0});_classPrivateFieldInitSpec(this,y,{writable:!0,value:0});_classPrivateFieldInitSpec(this,A,{writable:!0,value:null});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_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case a.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case a.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case a.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case a.AnnotationEditorParamsType.INK_THICKNESS:_classPrivateMethodGet(this,P,_updateThickness2).call(this,e);break;case a.AnnotationEditorParamsType.INK_COLOR:_classPrivateMethodGet(this,S,_updateColor2).call(this,e);break;case a.AnnotationEditorParamsType.INK_OPACITY:_classPrivateMethodGet(this,w,_updateOpacity2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[a.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[a.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor],[a.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){_classPrivateMethodGet(this,I,_createCanvas2).call(this);_classPrivateMethodGet(this,D,_createObserver2).call(this)}if(!this.isAttachedToDOM){this.parent.add(this);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this)}_classPrivateMethodGet(this,q,_fitToContent2).call(this)}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;_classPrivateFieldGet(this,_).disconnect();_classPrivateFieldSet(this,_,null);super.remove()}}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this);super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,a=this.height*e;this.setDimensions(i,a)}enableEditMode(){if(!_classPrivateFieldGet(this,g)&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.addEventListener("pointerup",_classPrivateFieldGet(this,p))}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.removeEventListener("pointerup",_classPrivateFieldGet(this,p))}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){if(!_classPrivateFieldGet(this,g)){super.commit();this.isEditing=!1;this.disableEditMode();this.setInForeground();_classPrivateFieldSet(this,g,!0);this.div.classList.add("disabled");_classPrivateMethodGet(this,q,_fitToContent2).call(this,!0);this.parent.addInkEditorIfNeeded(!0);this.parent.moveEditorInDOM(this);this.div.focus({preventScroll:!0})}}focusin(t){super.focusin(t);this.enableEditMode()}canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!_classPrivateFieldGet(this,g)){this.setInForeground();"mouse"!==t.type&&this.div.focus();t.stopPropagation();this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(this,u));this.canvas.addEventListener("pointermove",_classPrivateFieldGet(this,h));_classPrivateMethodGet(this,C,_startDrawing2).call(this,t.offsetX,t.offsetY)}}canvasPointermove(t){t.stopPropagation();_classPrivateMethodGet(this,k,_draw2).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){if(0===t.button&&this.isInEditMode()&&0!==this.currentPath.length){t.stopPropagation();_classPrivateMethodGet(this,R,_endDrawing2).call(this,t);this.setInBackground()}}canvasPointerleave(t){_classPrivateMethodGet(this,R,_endDrawing2).call(this,t);this.setInBackground()}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[i,a,r,s]=_classPrivateMethodGet(this,x,_getInitialBBox2).call(this);this.setAt(i,a,0,0);this.setDims(r,s);_classPrivateMethodGet(this,I,_createCanvas2).call(this);if(this.width){const[i,a]=this.parentDimensions;this.setAt(t*i,e*a,this.width*i,this.height*a);_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.setDims(this.width*i,this.height*a);_classPrivateMethodGet(this,T,_redraw2).call(this);_classPrivateMethodGet(this,V,_setMinDims2).call(this);this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}_classPrivateMethodGet(this,D,_createObserver2).call(this);return this.div}setDimensions(t,e){const i=Math.round(t),a=Math.round(e);if(_classPrivateFieldGet(this,b)===i&&_classPrivateFieldGet(this,y)===a)return;_classPrivateFieldSet(this,b,i);_classPrivateFieldSet(this,y,a);this.canvas.style.visibility="hidden";if(_classPrivateFieldGet(this,l)&&Math.abs(_classPrivateFieldGet(this,l)-t/e)>.01){e=Math.ceil(t/_classPrivateFieldGet(this,l));this.setDims(t,e)}const[r,s]=this.parentDimensions;this.width=t/r;this.height=e/s;_classPrivateFieldGet(this,g)&&_classPrivateMethodGet(this,G,_setScaleFactor2).call(this,t,e);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,T,_redraw2).call(this);this.canvas.style.visibility="visible";this.fixDims()}static deserialize(t,e,i){const r=super.deserialize(t,e,i);r.thickness=t.thickness;r.color=a.Util.makeHexColor(...t.color);r.opacity=t.opacity;const[s,n]=r.pageDimensions,h=r.width*s,u=r.height*n,p=r.parentScale,f=t.thickness/2;_classPrivateFieldSet(r,l,h/u);_classPrivateFieldSet(r,g,!0);_classPrivateFieldSet(r,b,Math.round(h));_classPrivateFieldSet(r,y,Math.round(u));for(const{bezier:e}of t.paths){const t=[];r.paths.push(t);let i=p*(e[0]-f),a=p*(u-e[1]-f);for(let r=2,s=e.length;r<s;r+=6){const s=p*(e[r]-f),n=p*(u-e[r+1]-f),o=p*(e[r+2]-f),l=p*(u-e[r+3]-f),c=p*(e[r+4]-f),d=p*(u-e[r+5]-f);t.push([[i,a],[s,n],[o,l],[c,d]]);i=c;a=d}const s=_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,t);r.bezierPath2D.push(s)}const v=_classPrivateMethodGet(r,W,_getBbox2).call(r);_classPrivateFieldSet(r,d,Math.max(o,v[2]-v[0]));_classPrivateFieldSet(r,c,Math.max(o,v[3]-v[1]));_classPrivateMethodGet(r,G,_setScaleFactor2).call(r,h,u);return r}serialize(){if(this.isEmpty())return null;const 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:a.AnnotationEditorType.INK,color:i,thickness:this.thickness,opacity:this.opacity,paths:_classPrivateMethodGet(this,N,_serializePaths2).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor;function _updateThickness2(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},undo:()=>{this.thickness=e;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t;_classPrivateMethodGet(this,T,_redraw2).call(this)},undo:()=>{this.color=e;_classPrivateMethodGet(this,T,_redraw2).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t;_classPrivateMethodGet(this,T,_redraw2).call(this)},undo:()=>{this.opacity=e;_classPrivateMethodGet(this,T,_redraw2).call(this)},mustExec:!0,type:a.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}function _setStroke2(){const{ctx:t,color:e,opacity:i,thickness:a,parentScale:r,scaleFactor:s}=this;t.lineWidth=a*r/s;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle=`${e}${(0,n.opacityToHex)(i)}`}function _startDrawing2(t,e){this.isEditing=!0;if(!_classPrivateFieldGet(this,v)){_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.thickness||=InkEditor._defaultThickness;this.color||=InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor;this.opacity??=InkEditor._defaultOpacity}this.currentPath.push([t,e]);_classPrivateFieldSet(this,m,null);_classPrivateMethodGet(this,E,_setStroke2).call(this);this.ctx.beginPath();this.ctx.moveTo(t,e);_classPrivateFieldSet(this,A,(()=>{if(_classPrivateFieldGet(this,A)){if(_classPrivateFieldGet(this,m)){if(this.isEmpty()){this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}else _classPrivateMethodGet(this,T,_redraw2).call(this);this.ctx.lineTo(..._classPrivateFieldGet(this,m));_classPrivateFieldSet(this,m,null);this.ctx.stroke()}window.requestAnimationFrame(_classPrivateFieldGet(this,A))}}));window.requestAnimationFrame(_classPrivateFieldGet(this,A))}function _draw2(t,e){const[i,a]=this.currentPath.at(-1);if(t!==i||e!==a){this.currentPath.push([t,e]);_classPrivateFieldSet(this,m,[t,e])}}function _stopDrawing2(t,e){this.ctx.closePath();_classPrivateFieldSet(this,A,null);t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);const[i,a]=this.currentPath.at(-1);t===i&&e===a||this.currentPath.push([t,e]);let r;if(1!==this.currentPath.length)r=(0,s.fitCurve)(this.currentPath,30,null);else{const i=[t,e];r=[[i,i.slice(),i.slice(),i]]}const n=_classStaticPrivateMethodGet(InkEditor,InkEditor,_buildPath2D).call(InkEditor,r);this.currentPath.length=0;this.addCommands({cmd:()=>{this.paths.push(r);this.bezierPath2D.push(n);this.rebuild()},undo:()=>{this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){_classPrivateMethodGet(this,I,_createCanvas2).call(this);_classPrivateMethodGet(this,D,_createObserver2).call(this)}_classPrivateMethodGet(this,q,_fitToContent2).call(this)}},mustExec:!0})}function _redraw2(){if(this.isEmpty()){_classPrivateMethodGet(this,L,_updateTransform2).call(this);return}_classPrivateMethodGet(this,E,_setStroke2).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0);e.clearRect(0,0,t.width,t.height);_classPrivateMethodGet(this,L,_updateTransform2).call(this);for(const t of this.bezierPath2D)e.stroke(t)}function _endDrawing2(t){_classPrivateMethodGet(this,M,_stopDrawing2).call(this,t.offsetX,t.offsetY);this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(this,u));this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(this,h));this.addToAnnotationStorage()}function _createCanvas2(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)}));this.div.append(this.canvas);const t=window.pdfDefaultOptions.activateWillReadFrequentlyFlag?{willReadFrequently:!0}:void 0;this.ctx=this.canvas.getContext("2d",t)}function _createObserver2(){_classPrivateFieldSet(this,_,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})));_classPrivateFieldGet(this,_).observe(this.div)}function _setCanvasDims2(){if(!_classPrivateFieldGet(this,v))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);_classPrivateMethodGet(this,L,_updateTransform2).call(this)}function _setScaleFactor2(t,e){const i=_classPrivateMethodGet(this,U,_getPadding2).call(this),a=(t-i)/_classPrivateFieldGet(this,d),r=(e-i)/_classPrivateFieldGet(this,c);this.scaleFactor=Math.min(a,r)}function _updateTransform2(){const t=_classPrivateMethodGet(this,U,_getPadding2).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function _buildPath2D(t){const e=new Path2D;for(let i=0,a=t.length;i<a;i++){const[a,r,s,n]=t[i];0===i&&e.moveTo(...a);e.bezierCurveTo(r[0],r[1],s[0],s[1],n[0],n[1])}return e}function _serializePaths2(t,e,i,a){const r=[],s=this.thickness/2;let n,o;for(const l of this.paths){n=[];o=[];for(let r=0,c=l.length;r<c;r++){const[c,d,h,u]=l[r],p=t*(c[0]+e)+s,f=a-t*(c[1]+i)-s,g=t*(d[0]+e)+s,v=a-t*(d[1]+i)-s,m=t*(h[0]+e)+s,_=a-t*(h[1]+i)-s,b=t*(u[0]+e)+s,y=a-t*(u[1]+i)-s;if(0===r){n.push(p,f);o.push(p,f)}n.push(g,v,m,_,b,y);_classPrivateMethodGet(this,j,_extractPointsOnBezier2).call(this,p,f,g,v,m,_,b,y,4,o)}r.push({bezier:n,points:o})}return r}function _extractPointsOnBezier2(t,e,i,a,r,s,n,o,l,c){if(_classPrivateMethodGet(this,B,_isAlmostFlat2).call(this,t,e,i,a,r,s,n,o))c.push(n,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*t+u*i,f=h*e+u*a,g=h*i+u*r,v=h*a+u*s;p=h*p+u*g;f=h*f+u*v;g=h*g+u*(h*r+u*n);v=h*v+u*(h*s+u*o);p=h*p+u*g;f=h*f+u*v;c.push(p,f)}c.push(n,o)}}function _isAlmostFlat2(t,e,i,a,r,s,n,o){const l=(3*i-2*t-n)**2,c=(3*a-2*e-o)**2,d=(3*r-t-2*n)**2,h=(3*s-e-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}function _getBbox2(){let t=1/0,e=-1/0,i=1/0,r=-1/0;for(const s of this.paths)for(const[n,o,l,c]of s){const s=a.Util.bezierBoundingBox(...n,...o,...l,...c);t=Math.min(t,s[0]);i=Math.min(i,s[1]);e=Math.max(e,s[2]);r=Math.max(r,s[3])}return[t,i,e,r]}function _getPadding2(){return _classPrivateFieldGet(this,g)?Math.ceil(this.thickness*this.parentScale):0}function _fitToContent2(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(this,g)){_classPrivateMethodGet(this,T,_redraw2).call(this);return}const e=_classPrivateMethodGet(this,W,_getBbox2).call(this),i=_classPrivateMethodGet(this,U,_getPadding2).call(this);_classPrivateFieldSet(this,d,Math.max(o,e[2]-e[0]));_classPrivateFieldSet(this,c,Math.max(o,e[3]-e[1]));const a=Math.ceil(i+_classPrivateFieldGet(this,d)*this.scaleFactor),r=Math.ceil(i+_classPrivateFieldGet(this,c)*this.scaleFactor),[s,n]=this.parentDimensions;this.width=a/s;this.height=r/n;_classPrivateFieldSet(this,l,a/r);_classPrivateMethodGet(this,V,_setMinDims2).call(this);const h=this.translationX,u=this.translationY;this.translationX=-e[0];this.translationY=-e[1];_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,T,_redraw2).call(this);_classPrivateFieldSet(this,b,a);_classPrivateFieldSet(this,y,r);this.setDims(a,r);const p=t?i/this.scaleFactor/2:0;this.translate(h-this.translationX-p,u-this.translationY-p)}function _setMinDims2(){const{style:t}=this.div;if(_classPrivateFieldGet(this,l)>=1){t.minHeight=`${o}px`;t.minWidth=`${Math.round(_classPrivateFieldGet(this,l)*o)}px`}else{t.minWidth=`${o}px`;t.minHeight=`${Math.round(o/_classPrivateFieldGet(this,l))}px`}}_defineProperty(InkEditor,"_defaultColor",null);_defineProperty(InkEditor,"_defaultOpacity",1);_defineProperty(InkEditor,"_defaultThickness",1);_defineProperty(InkEditor,"_l10nPromise",void 0);_defineProperty(InkEditor,"_type","ink")},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.fitCurve=void 0;const a=i(166);e.fitCurve=a},t=>{"use strict";function fitCubic(t,e,i,a,r){var s,n,o,l,c,d,h,u,p,f,g,v,m;if(2===t.length){v=maths.vectorLen(maths.subtract(t[0],t[1]))/3;return[s=[t[0],maths.addArrays(t[0],maths.mulItems(e,v)),maths.addArrays(t[1],maths.mulItems(i,v)),t[1]]]}n=function chordLengthParameterize(t){var e,i,a,r=[];t.forEach(((t,s)=>{e=s?i+maths.vectorLen(maths.subtract(t,a)):0;r.push(e);i=e;a=t}));r=r.map((t=>t/i));return r}(t);[s,l,d]=generateAndReport(t,n,n,e,i,r);if(0===l||l<a)return[s];if(l<a*a){o=n;c=l;h=d;for(m=0;m<20;m++){o=reparameterize(s,t,o);[s,l,d]=generateAndReport(t,n,o,e,i,r);if(l<a)return[s];if(d===h){let t=l/c;if(t>.9999&&t<1.0001)break}c=l;h=d}}g=[];if((u=maths.subtract(t[d-1],t[d+1])).every((t=>0===t))){u=maths.subtract(t[d-1],t[d]);[u[0],u[1]]=[-u[1],u[0]]}p=maths.normalize(u);f=maths.mulItems(p,-1);return g=(g=g.concat(fitCubic(t.slice(0,d+1),e,p,a,r))).concat(fitCubic(t.slice(d),f,i,a,r))}function generateAndReport(t,e,i,a,r,s){var n,o,l;n=function generateBezier(t,e,i,a){var r,s,n,o,l,c,d,h,u,p,f,g,v,m,_,b,y,A=t[0],P=t[t.length-1];r=[A,null,null,P];s=maths.zeros_Xx2x2(e.length);for(v=0,m=e.length;v<m;v++){y=1-(b=e[v]);(n=s[v])[0]=maths.mulItems(i,3*b*(y*y));n[1]=maths.mulItems(a,3*y*(b*b))}o=[[0,0],[0,0]];l=[0,0];for(v=0,m=t.length;v<m;v++){b=e[v];n=s[v];o[0][0]+=maths.dot(n[0],n[0]);o[0][1]+=maths.dot(n[0],n[1]);o[1][0]+=maths.dot(n[0],n[1]);o[1][1]+=maths.dot(n[1],n[1]);_=maths.subtract(t[v],bezier.q([A,A,P,P],b));l[0]+=maths.dot(n[0],_);l[1]+=maths.dot(n[1],_)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];d=o[0][0]*l[1]-o[1][0]*l[0];h=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:h/c;p=0===c?0:d/c;g=maths.vectorLen(maths.subtract(A,P));if(u<(f=1e-6*g)||p<f){r[1]=maths.addArrays(A,maths.mulItems(i,g/3));r[2]=maths.addArrays(P,maths.mulItems(a,g/3))}else{r[1]=maths.addArrays(A,maths.mulItems(i,u));r[2]=maths.addArrays(P,maths.mulItems(a,p))}return r}(t,i,a,r);[o,l]=function computeMaxError(t,e,i){var a,r,s,n,o,l,c,d;r=0;s=Math.floor(t.length/2);const h=mapTtoRelativeDistances(e,10);for(o=0,l=t.length;o<l;o++){c=t[o];d=find_t(e,i[o],h,10);if((a=(n=maths.subtract(bezier.q(e,d),c))[0]*n[0]+n[1]*n[1])>r){r=a;s=o}}return[r,s]}(t,n,e);s&&s({bez:n,points:t,params:e,maxErr:o,maxPoint:l});return[n,o,l]}function reparameterize(t,e,i){return i.map(((i,a)=>newtonRaphsonRootFind(t,e[a],i)))}function newtonRaphsonRootFind(t,e,i){var a=maths.subtract(bezier.q(t,i),e),r=bezier.qprime(t,i),s=maths.mulMatrix(a,r),n=maths.sum(maths.squareItems(r))+2*maths.mulMatrix(a,bezier.qprimeprime(t,i));return 0===n?i:i-s/n}var mapTtoRelativeDistances=function(t,e){for(var i,a=[0],r=t[0],s=0,n=1;n<=e;n++){i=bezier.q(t,n/e);s+=maths.vectorLen(maths.subtract(i,r));a.push(s);r=i}return a=a.map((t=>t/s))};function find_t(t,e,i,a){if(e<0)return 0;if(e>1)return 1;for(var r,s,n,o,l=1;l<=a;l++)if(e<=i[l]){n=(l-1)/a;s=l/a;o=(e-(r=i[l-1]))/(i[l]-r)*(s-n)+n;break}return o}function createTangent(t,e){return maths.normalize(maths.subtract(t,e))}class maths{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,a)=>t+i*e[a]),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 maths.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 bezier{static q(t,e){var i=1-e,a=maths.mulItems(t[0],i*i*i),r=maths.mulItems(t[1],3*i*i*e),s=maths.mulItems(t[2],3*i*e*e),n=maths.mulItems(t[3],e*e*e);return maths.addArrays(maths.addArrays(a,r),maths.addArrays(s,n))}static qprime(t,e){var i=1-e,a=maths.mulItems(maths.subtract(t[1],t[0]),3*i*i),r=maths.mulItems(maths.subtract(t[2],t[1]),6*i*e),s=maths.mulItems(maths.subtract(t[3],t[2]),3*e*e);return maths.addArrays(maths.addArrays(a,r),s)}static qprimeprime(t,e){return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(t[2],maths.mulItems(t[1],2)),t[0]),6*(1-e)),maths.mulItems(maths.addArrays(maths.subtract(t[3],maths.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function fitCurve(t,e,i){if(!Array.isArray(t))throw new TypeError("First argument should be an array");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.")}));if((t=t.filter(((e,i)=>0===i||!e.every(((e,a)=>e===t[i-1][a]))))).length<2)return[];const a=t.length,r=createTangent(t[1],t[0]),s=createTangent(t[a-2],t[a-1]);return fitCubic(t,r,s,e,i)};t.exports.fitCubic=fitCubic;t.exports.createTangent=createTangent},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationLayer=void 0;var a=i(1),r=i(141),s=i(138),n=i(168),o=i(169);function _classStaticPrivateMethodGet(t,e,i){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return i}function _classPrivateMethodInitSpec(t,e){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.add(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case a.AnnotationType.LINK:return new LinkAnnotationElement(t);case a.AnnotationType.TEXT:return new TextAnnotationElement(t);case a.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case a.AnnotationType.POPUP:return new PopupAnnotationElement(t);case a.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case a.AnnotationType.LINE:return new LineAnnotationElement(t);case a.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case a.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case a.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case a.AnnotationType.CARET:return new CaretAnnotationElement(t);case a.AnnotationType.INK:return new InkAnnotationElement(t);case a.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case a.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case a.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case a.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case a.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case a.AnnotationType.STAMP:return new StampAnnotationElement(t);case a.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[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;e&&(this.container=this._createContainer(i));a&&(this.quadrilaterals=this._createQuadrilaterals(i))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{data:e,page:i,viewport:r}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id);e.noRotate&&s.classList.add("norotate");const{pageWidth:n,pageHeight:o,pageX:l,pageY:c}=r.rawDims,{width:d,height:h}=getRectDims(e.rect),u=a.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){s.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;s.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${d}px * var(--scale-factor)) / calc(${h}px * var(--scale-factor))`;s.style.borderRadius=t}switch(e.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}const r=e.borderColor||null;r?s.style.borderColor=a.Util.makeHexColor(0|r[0],0|r[1],0|r[2]):s.style.borderWidth=0}s.style.left=100*(u[0]-l)/n+"%";s.style.top=100*(u[1]-c)/o+"%";const{rotation:p}=e;if(e.hasOwnCanvas||0===p){s.style.width=100*d/n+"%";s.style.height=100*h/o+"%"}else this.setRotation(p,s);return s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const{pageWidth:i,pageHeight:a}=this.viewport.rawDims,{width:r,height:s}=getRectDims(this.data.rect);let n,o;if(t%180==0){n=100*r/i;o=100*s/a}else{n=100*s/i;o=100*r/a}e.style.width=`${n}%`;e.style.height=`${o}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,i)=>{const a=i.detail[t];i.target.style[e]=n.ColorConverters[`${a[0]}_HTML`](a.slice(1))};return(0,a.shadow)(this,"_commonActions",{display:t=>{const 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((()=>t.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:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const a of Object.keys(e.detail)){const r=t[a]||i[a];null==r||r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[a,r]of Object.entries(e)){const s=i[a];if(s){s({detail:{[a]:r},target:t});delete e[a]}}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],i=this.data.rect;for(const i of this.data.quadPoints){this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y];e.push(this._createContainer(t))}this.data.rect=i;return e}_createPopup(t,e){let i=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;i=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).classList.add("popupTriggerArea");i.append(t)}const a=new PopupElement({container:i,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();a.style.left="100%";i.append(a)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.classList.add(t);return this.quadrilaterals}render(){(0,a.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const r=this._fieldObjects[t];if(r)for(const{page:t,id:s,exportValues:n}of r){if(-1===t)continue;if(s===e)continue;const r="string"==typeof n?n:null,o=document.querySelector(`[data-element-id="${s}"]`);!o||c.has(o)?i.push({id:s,exportValue:r,domElement:o}):(0,a.warn)(`_getElementsByName - element not allowed: ${s}`)}return i}for(const a of document.getElementsByName(t)){const{exportValue:t}=a,r=a.getAttribute("data-element-id");r!==e&&(c.has(a)&&i.push({id:r,exportValue:t,domElement:a}))}return i}}var d=new WeakSet,h=new WeakSet;class LinkAnnotationElement extends AnnotationElement{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0});_classPrivateMethodInitSpec(this,h);_classPrivateMethodInitSpec(this,d);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let a=!1;if(t.url){e.addLinkAttributes(i,t.url,t.newWindow);a=!0}else if(t.action){this._bindNamedAction(i,t.action);a=!0}else if(t.attachment){this._bindAttachment(i,t.attachment);a=!0}else if(t.setOCGState){_classPrivateMethodGet(this,h,_bindSetOCGState2).call(this,i,t.setOCGState);a=!0}else if(t.dest){this._bindLink(i,t.dest);a=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(i,t);a=!0}if(t.resetForm){this._bindResetFormAction(i,t.resetForm);a=!0}else if(this.isTooltipOnly&&!a){this._bindLink(i,"");a=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const a=0===e?i:i.cloneNode();t.append(a);return t}));this.container.classList.add("linkAnnotation");a&&this.container.append(i);return this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,e.content,e.filename);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(e.actions)){const r=i.get(a);r&&(t[r]=()=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:a}});return!1})}t.onclick||(t.onclick=()=>!1);_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}_bindResetFormAction(t,e){const i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));_classPrivateMethodGet(this,d,_setInternalLink2).call(this);if(this._fieldObjects)t.onclick=()=>{null==i||i();const{fields:t,refs:r,include:s}=e,n=[];if(0!==t.length||0!==r.length){const e=new Set(r);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&n.push(i)}else for(const t of Object.values(this._fieldObjects))n.push(...t);const o=this.annotationStorage,l=[];for(const t of n){const{id:e}=t;l.push(e);switch(t.type){case"text":{const i=t.defaultValue||"";o.setValue(e,{value:i});window.updateAngularFormValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});window.updateAngularFormValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";o.setValue(e,{value:i});window.updateAngularFormValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(c.has(i)?i.dispatchEvent(new Event("resetform")):(0,a.warn)(`_bindResetFormAction - element not allowed: ${e}`))}if(this.enableScripting){var d;null===(d=this.linkService.eventBus)||void 0===d||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})}return!1};else{(0,a.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=()=>!1)}}}function _setInternalLink2(){this.container.setAttribute("data-internal-link","")}function _bindSetOCGState2(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};_classPrivateMethodGet(this,d,_setInternalLink2).call(this)}class TextAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str)})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");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);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}_getKeyModifier(t){const{isWin:e,isMac:i}=a.FeatureTest.platform;return e&&t.ctrlKey||i&&t.metaKey}_setEventListener(t,e,i,a){e.includes("mouse")?t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(t)}})}))}_setEventListeners(t,e,i){for(const[r,s]of e){var a;("Action"===s||null!==(a=this.data.actions)&&void 0!==a&&a[s])&&this._setEventListener(t,r,s,i)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":a.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,s=t.style;let n;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(a.LINE_FACTOR*r))||1);n=Math.min(r,roundToOneDecimal(e/a.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);n=Math.min(r,roundToOneDecimal(t/a.LINE_FACTOR))}s.fontSize=`calc(${n}px * var(--scale-factor))`;s.color=a.Util.makeHexColor(i[0],i[1],i[2]);null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,a){const r=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id)){s.domElement&&(s.domElement[e]=i);r.setValue(s.id,{[a]:i})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const r=window.getFormValueFromAngular(this.data.fieldName),s=r.value?r:t.getValue(e,{value:this.data.fieldValue});let n=s.formattedValue||s.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&n.length>o&&(n=n.slice(0,o));const d={userValue:n,formattedValue:null,lastCommittedValue:null,commitKey:1};if(this.data.multiLine){i=document.createElement("textarea");i.textContent=n;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{i=document.createElement("input");i.type="text";i.setAttribute("value",n);this.data.doNotScroll&&(i.style.overflowX="hidden")}c.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);o&&(i.maxLength=o);i.addEventListener("input",(a=>{t.setValue(e,{value:a.target.value});window.updateAngularFormValue(e,{value:a.target.value});this.setPropertyOnSiblings(i,"value",a.target.value,"value")}));i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";i.value=d.userValue=e;d.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=d;null!=e&&(t.target.value=e);t.target.scrollLeft=0};window.registerAcroformField(e,i,s.value);i.addEventListener("updateFromAngular",(i=>t.setValue(e,{value:i.detail})));if(this.enableScripting&&this.hasJSActions){var a;i.addEventListener("focus",(t=>{const{target:e}=t;d.userValue&&(e.value=d.userValue);d.lastCommittedValue=e.value;d.commitKey=1}));i.addEventListener("updatefromsandbox",(i=>{const a={value(i){d.userValue=i.detail.value??"";t.setValue(e,{value:d.userValue.toString()});window.updateAngularFormValue(e,{value:d.userValue.toString()});i.target.value=d.userValue},formattedValue(i){const{formattedValue:a}=i.detail;d.formattedValue=a;null!=a&&i.target!==document.activeElement&&(i.target.value=a);t.setValue(e,{formattedValue:a});window.updateAngularFormValue(e,{formattedValue:a})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var a;const{charLimit:r}=i.detail,{target:s}=i;if(0===r){s.removeAttribute("maxLength");return}s.setAttribute("maxLength",r);let n=d.userValue;if(n&&!(n.length<=r)){n=n.slice(0,r);s.value=d.userValue=n;t.setValue(e,{value:n});window.updateAngularFormValue(e,{value:n});null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}})}}};this._dispatchEventFromSandbox(a,i)}));i.addEventListener("keydown",(t=>{var i;d.commitKey=1;let a=-1;"Escape"===t.key?a=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(d.commitKey=3):a=2;if(-1===a)return;const{value:r}=t.target;if(d.lastCommittedValue!==r){d.lastCommittedValue=r;d.userValue=r;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:a,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const r=blurListener;blurListener=null;i.addEventListener("blur",(t=>{if(!t.relatedTarget)return;const{value:i}=t.target;d.userValue=i;if(d.lastCommittedValue!==i){var a;null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:d.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}r(t)}));null!==(a=this.data.actions)&&void 0!==a&&a.Keystroke&&i.addEventListener("beforeinput",(t=>{var i;d.lastCommittedValue=null;const{data:a,target:r}=t,{value:s,selectionStart:n,selectionEnd:o}=r;let l=n,c=o;switch(t.inputType){case"deleteWordBackward":{const t=s.substring(0,n).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=s.substring(n).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":n===o&&(l-=1);break;case"deleteContentForward":n===o&&(c+=1)}t.preventDefault();null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:a||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&i.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb");i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else{i=document.createElement("div");i.textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell"}this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id,a=window.getFormValueFromAngular(this.data.fieldName);let r;a.value&&(r=!0===a.value||a.value===e.exportValue);let s=void 0!==r?r:t.getValue(i,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof s){s="Off"!==s;t.setValue(i,{value:s});window.updateAngularFormValue(i,{value:s})}this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");c.add(n);n.setAttribute("data-element-id",i);n.disabled=e.readOnly;this._setRequired(n,this.data.required);n.type="checkbox";n.name=e.fieldName;s&&n.setAttribute("checked",!0);n.setAttribute("exportValue",e.exportValue);n.tabIndex=l;n.addEventListener("change",(a=>{const{name:r,checked:s}=a.target;for(const a of this._getElementsByName(r,i)){const r=s&&a.exportValue===e.exportValue;a.domElement&&(a.domElement.checked=r);t.setValue(a.id,{value:r});window.updateAngularFormValue(i,{value:r})}t.setValue(i,{value:s});window.updateAngularFormValue(i,{value:s})}));n.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}));window.registerAcroformField(i,n,!!s&&e.exportValue);n.addEventListener("updateFromAngular",(e=>t.setValue(i,{value:e.detail})));if(this.enableScripting&&this.hasJSActions){n.addEventListener("updatefromsandbox",(e=>{const a={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(i,{value:e.target.checked});window.updateAngularFormValue(i,{value:e.target.value})}};this._dispatchEventFromSandbox(a,e)}));this._setEventListeners(n,[["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(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let a=window.getFormValueFromAngular(this.data.fieldName).value??t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof a){a=a===e.buttonValue;t.setValue(i,{value:a})}else a&&window.updateAngularFormValue(i,{value:e.buttonValue});const r=document.createElement("input");c.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;a&&r.setAttribute("checked",!0);r.tabIndex=l;r.addEventListener("change",(e=>{const{name:a,checked:r}=e.target;for(const e of this._getElementsByName(a,i)){t.setValue(e.id,{value:!1});window.updateAngularFormValue(e.id,{value:!1})}t.setValue(i,{value:r});window.updateAngularFormValue(i,{value:r})}));r.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}));window.registerAcroformField(i,r,a?e.buttonValue:void 0,e.buttonValue);r.addEventListener("updateFromAngular",(e=>t.setValue(i,{value:e.detail})));if(this.enableScripting&&this.hasJSActions){const a=e.buttonValue;r.addEventListener("updatefromsandbox",(e=>{const r={value:e=>{const r=a===e.detail.value;for(const a of this._getElementsByName(e.target.name)){const e=r&&a.id===i;a.domElement&&(a.domElement.checked=e);t.setValue(a.id,{value:e});window.updateAngularFormValue(i,{value:e})}}};this._dispatchEventFromSandbox(r,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);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=window.getFormValueFromAngular(this.data.fieldName),a=i.value?i:t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r);r.setAttribute("data-element-id",e);r.disabled=this.data.readOnly;this._setRequired(r,this.data.required);r.name=this.data.fieldName;r.tabIndex=l;let s=this.data.combo&&this.data.options.length>0;if(!this.data.combo){r.size=this.data.options.length;this.data.multiSelect&&(r.multiple=!0)}r.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of r.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(a.value.includes(t.exportValue)){e.setAttribute("selected",!0);s=!1}r.append(e)}let n=null;if(s){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);r.prepend(t);n=()=>{t.remove();r.removeEventListener("input",n);n=null};r.addEventListener("input",n)}const getValue=t=>{const e=t?"value":"textContent",{options:i,multiple:a}=r;return a?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};window.registerAcroformField(e,r,o);r.addEventListener("updateFromAngular",(i=>t.setValue(e,{value:i.detail})));if(this.enableScripting&&this.hasJSActions){r.addEventListener("updatefromsandbox",(i=>{const a={value(i){var a;null===(a=n)||void 0===a||a();const s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(const t of r.options)t.selected=l.has(t.value);t.setValue(e,{value:getValue(!0)});o=getValue(!1);window.updateAngularFormValue(e,{value:o})},multipleSelection(t){r.multiple=!0},remove(i){const a=r.options,s=i.detail.remove;a[s].selected=!1;r.remove(s);if(a.length>0){-1===Array.prototype.findIndex.call(a,(t=>t.selected))&&(a[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(i)});o=getValue(!1)},clear(i){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]});o=getValue(!1);window.updateAngularFormValue(e,{value:o})},insert(i){const{index:a,displayValue:s,exportValue:n}=i.detail.insert,l=r.children[a],c=document.createElement("option");c.textContent=s;c.value=n;l?l.before(c):r.append(c);t.setValue(e,{value:getValue(!0),items:getItems(i)});o=getValue(!1);window.updateAngularFormValue(e,{value:o})},items(i){const{items:a}=i.detail;for(;0!==r.length;)r.remove(0);for(const t of a){const{displayValue:e,exportValue:i}=t,a=document.createElement("option");a.textContent=e;a.value=i;r.append(a)}r.options.length>0&&(r.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(i)});o=getValue(!1);window.updateAngularFormValue(e,{value:o})},indices(i){const a=new Set(i.detail.indices);for(const t of i.target.options)t.selected=a.has(t.index);t.setValue(e,{value:getValue(!0)});o=getValue(!1);window.updateAngularFormValue(e,{value:o})},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(a,i)}));r.addEventListener("input",(i=>{var a;const r=getValue(!0);t.setValue(e,{value:r});window.updateAngularFormValue(e,{value:r});i.preventDefault();null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))}else r.addEventListener("input",(function(i){t.setValue(e,{value:getValue(!0)});window.updateAngularFormValue(e,{value:getValue(!0)})}));this.data.combo&&this._setTextStyle(r);this._setBackgroundColor(r);this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class PopupAnnotationElement extends AnnotationElement{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(t){var e,i,a;const{data:r}=t;super(t,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(r.parentType)&&!!(null!==(e=r.titleObj)&&void 0!==e&&e.str||null!==(i=r.contentsObj)&&void 0!==i&&i.str||null!==(a=r.richText)&&void 0!==a&&a.str)})}render(){this.container.classList.add("popupAnnotation");const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new PopupElement({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,r=a.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),s=r[0]+this.data.parentRect[2]-this.data.parentRect[0],n=r[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:d}=this.viewport.rawDims;this.container.style.left=100*(s-c)/o+"%";this.container.style.top=100*(n-d)/l+"%";this.container.append(e.render());return this.container}}class PopupElement{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(){var t,e;const i=document.createElement("div");i.classList.add("popupWrapper");this.hideElement=this.hideWrapper?i:this.container;this.hideElement.hidden=!0;const s=document.createElement("div");s.classList.add("popup");const n=this.color;if(n){const t=.7*(255-n[0])+n[0],e=.7*(255-n[1])+n[1],i=.7*(255-n[2])+n[2];s.style.backgroundColor=a.Util.makeHexColor(0|t,0|e,0|i)}const l=document.createElement("h1");l.dir=this.titleObj.dir;l.textContent=this.titleObj.str;s.append(l);const c=r.PDFDateString.toDateObject(this.modificationDate);if(c){const t=document.createElement("span");t.classList.add("popupDate");t.textContent="{{date}}, {{time}}";t.dataset.l10nId="annotation_date_string";t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()});s.append(t)}if(null===(t=this.richText)||void 0===t||!t.str||null!==(e=this.contentsObj)&&void 0!==e&&e.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);s.append(t)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:s});s.lastChild.classList.add("richText","popupContent")}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger){t.addEventListener("click",this._toggle.bind(this));t.addEventListener("mouseover",this._show.bind(this,!1));t.addEventListener("mouseout",this._hide.bind(this,!1))}s.addEventListener("click",this._hide.bind(this,!0));i.append(s);return i}_formatContents(t){let{str:e,dir:i}=t;const a=document.createElement("p");a.classList.add("popupContent");a.dir=i;const r=e.split(/(?:\r\n?|\n)/);for(let t=0,e=r.length;t<e;++t){const i=r[t];a.append(document.createTextNode(i));t<e-1&&a.append(document.createElement("br"))}return a}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3}}_hide(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0});this.textContent=t.data.textContent}render(){this.container.classList.add("freeTextAnnotation");if(this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent");t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e;t.append(i)}this.container.append(t)}this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=getRectDims(t.rect),a=this.svgFactory.create(e,i,!0),r=this.svgFactory.createElement("svg:line");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");a.append(r);this.container.append(a);this._createPopup(r,t);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=getRectDims(t.rect),a=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.svgFactory.createElement("svg:rect");s.setAttribute("x",r/2);s.setAttribute("y",r/2);s.setAttribute("width",e-r);s.setAttribute("height",i-r);s.setAttribute("stroke-width",r||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");a.append(s);this.container.append(a);this._createPopup(s,t);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=getRectDims(t.rect),a=this.svgFactory.create(e,i,!0),r=t.borderStyle.width,s=this.svgFactory.createElement("svg:ellipse");s.setAttribute("cx",e/2);s.setAttribute("cy",i/2);s.setAttribute("rx",e/2-r/2);s.setAttribute("ry",i/2-r/2);s.setAttribute("stroke-width",r||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");a.append(s);this.container.append(a);this._createPopup(s,t);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:i}=getRectDims(t.rect),a=this.svgFactory.create(e,i,!0);let r=[];for(const e of t.vertices){const i=e.x-t.rect[0],a=t.rect[3]-e.y;r.push(i+","+a)}r=r.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",r);s.setAttribute("stroke-width",t.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");a.append(s);this.container.append(a);this._createPopup(s,t);return this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t);this.containerClassName="polygonAnnotation";this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0})}render(){this.container.classList.add("caretAnnotation");this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:i}=getRectDims(t.rect),a=this.svgFactory.create(e,i,!0);for(const e of t.inkLists){let i=[];for(const a of e){const e=a.x-t.rect[0],r=t.rect[3]-a.y;i.push(`${e},${r}`)}i=i.join(" ");const r=this.svgFactory.createElement(this.svgElementName);r.setAttribute("points",i);r.setAttribute("stroke-width",t.borderStyle.width||1);r.setAttribute("stroke","transparent");r.setAttribute("fill","transparent");this._createPopup(r,t);a.append(r)}this.container.append(a);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.classList.add("highlightAnnotation");return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.classList.add("underlineAnnotation");return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.classList.add("squigglyAnnotation");return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.classList.add("strikeoutAnnotation");return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){var e,i,a;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(a=t.data.richText)&&void 0!==a&&a.str),ignoreBorder:!0})}render(){this.container.classList.add("stampAnnotation");this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(t){var e;super(t,{isRenderable:!0});const{filename:i,content:a}=this.data.file;this.filename=(0,r.getFilenameFromUrl)(i,!0);this.content=a;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:i,content:a})}render(){var t,e;this.container.classList.add("fileAttachmentAnnotation");let i;if(this.data.hasAppearance)i=document.createElement("div");else{i=document.createElement("img");i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`}i.classList.add("popupTriggerArea");i.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(e=this.data.contentsObj)&&void 0!==e&&e.str||this.data.richText)&&this._createPopup(i,this.data);this.container.append(i);return this.container}_download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static render(t){const{annotations:e,div:i,viewport:n,accessibilityManager:o}=t;(0,r.setLayerDimensions)(i,n);const l={data:null,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 s.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects};let c=0;for(const t of e){if(t.noHTML)continue;if(t.annotationType!==a.AnnotationType.POPUP){const{width:e,height:i}=getRectDims(t.rect);if(e<=0||i<=0)continue}l.data=t;const e=AnnotationElementFactory.create(l);if(!e.isRenderable)continue;const r=e.render();t.hidden&&(r.style.visibility="hidden");if(Array.isArray(r))for(const e of r){e.style.zIndex=c++;_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,e,t.id,i,o)}else{r.style.zIndex=c++;e instanceof PopupAnnotationElement?i.prepend(r):_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,r,t.id,i,o)}}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:i,viewport:a}=t;(0,r.setLayerDimensions)(i,{rotation:a.rotation});_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,e);i.hidden=!1}}e.AnnotationLayer=AnnotationLayer;function _appendElement(t,e,i,a){const s=t.firstChild||t;s.id=`${r.AnnotationPrefix}${e}`;i.append(t);null==a||a.moveElementInDOM(i,t,s,!1)}function _setAnnotationCanvasMap(t,e){if(e){for(const[i,a]of e){const e=t.querySelector(`[data-annotation-id="${i}"]`);if(!e)continue;const{firstChild:r}=e;r?"CANVAS"===r.nodeName?r.replaceWith(a):r.before(a):e.append(a)}e.clear()}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}e.ColorConverters=class ColorConverters{static CMYK_G(t){let[e,i,a,r]=t;return["G",1-Math.min(1,.3*e+.59*a+.11*i+r)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_HTML(t){let[e]=t;const i=makeColorComp(e);return`#${i}${i}${i}`}static RGB_G(t){let[e,i,a]=t;return["G",.3*e+.59*i+.11*a]}static RGB_HTML(t){let[e,i,a]=t;return`#${makeColorComp(e)}${makeColorComp(i)}${makeColorComp(a)}`}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,i,a,r]=t;return["RGB",1-Math.min(1,e+r),1-Math.min(1,a+r),1-Math.min(1,i+r)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,a]=t;const r=1-e,s=1-i,n=1-a;return["CMYK",r,s,n,Math.min(r,s,n)]}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;var a=i(154);e.XfaLayer=class XfaLayer{static setupStorage(t,e,i,a,r){const s=window.getFormValueFromAngular(t);s.value&&a.setValue(e,s);const n=s.value?s:a.getValue(e,{value:null});window.registerXFAField(t,n);t.addEventListener("updateFromAngular",(t=>a.setValue(e,{value:t.detail})));switch(i.name){case"textarea":null!==n.value&&(t.textContent=n.value);if("print"===r)break;t.addEventListener("input",(i=>{window.updateAngularFormValue(t,{value:i.target.value});a.setValue(e,{value:i.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){n.value===i.attributes.xfaOn?t.setAttribute("checked",!0):t.removeAttribute("checked");if("print"===r)break;t.addEventListener("change",(i=>{window.updateAngularFormValue(t,{value:i.target.checked?i.target.getAttribute("xfaOn"):i.target.getAttribute("xfaOff")});a.setValue(e,{value:i.target.checked?i.target.getAttribute("xfaOn"):i.target.getAttribute("xfaOff")})}))}else{null!==n.value&&t.setAttribute("value",n.value);if("print"===r)break;t.addEventListener("input",(i=>{window.updateAngularFormValue(t,{value:i.target.value});a.setValue(e,{value:i.target.value})}))}break;case"select":if(null!==n.value){i.attributes.value=n.value;for(const t of i.children)t.attributes.value===n.value?t.attributes.selected=!0:delete t.attributes.selected}t.addEventListener("input",(i=>{const r=i.target.options,s=-1===r.selectedIndex?"":r[r.selectedIndex].value;window.updateAngularFormValue(t,{value:s});a.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:i,storage:a=null,intent:r,linkService:s}=t;const{attributes:n}=i,o=e instanceof HTMLAnchorElement;"radio"===n.type&&(n.name=`${n.name}-${r}`);for(const[t,i]of Object.entries(n))if(null!=i)switch(t){case"class":i.length&&e.setAttribute(t,i.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",i);break;case"style":Object.assign(e.style,i);break;case"textContent":e.textContent=i;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,i)}o&&s.addLinkAttributes(e,n.href,n.newWindow);a&&n.dataId&&this.setupStorage(e,n.dataId,i,a)}static render(t){const e=t.annotationStorage,i=t.linkService,r=t.xfaHtml,s=t.intent||"display",n=document.createElement(r.name);r.attributes&&this.setAttributes({html:n,element:r,intent:s,linkService:i});const o=[[r,-1,n]],l=t.div;l.append(n);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[t,r,n]=o.at(-1);if(r+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);n.append(t);continue}let u;u=null!=l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);n.append(u);l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:s,linkService:i});if(l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);a.XfaText.shouldBuildText(h)&&c.push(t);u.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;var a=i(141),r=i(1);i(145);let s=class{constructor(){(0,r.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=s;{const n={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},o="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/1999/xlink",c=["butt","round","square"],d=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([t],{type:e}));const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r=`data:${e};base64,`;for(let e=0,i=t.length;e<i;e+=3){const s=255&t[e],n=255&t[e+1],o=255&t[e+2];r+=a[s>>2]+a[(3&s)<<4|n>>4]+a[e+1<i?(15&n)<<2|o>>6:64]+a[e+2<i?63&o:64]}return r},h=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let t=0;t<256;t++){let i=t;for(let t=0;t<8;t++)i=1&i?3988292384^i>>1&2147483647:i>>1&2147483647;e[t]=i}function writePngChunk(t,i,a,r){let s=r;const n=i.length;a[s]=n>>24&255;a[s+1]=n>>16&255;a[s+2]=n>>8&255;a[s+3]=255&n;s+=4;a[s]=255&t.charCodeAt(0);a[s+1]=255&t.charCodeAt(1);a[s+2]=255&t.charCodeAt(2);a[s+3]=255&t.charCodeAt(3);s+=4;a.set(i,s);s+=i.length;const o=function crc32(t,i,a){let r=-1;for(let s=i;s<a;s++){const i=255&(r^t[s]);r=r>>>8^e[i]}return-1^r}(a,r+4,s);a[s]=o>>24&255;a[s+1]=o>>16&255;a[s+2]=o>>8&255;a[s+3]=255&o}function deflateSync(t){return function deflateSyncUncompressed(t){let e=t.length;const i=65535,a=Math.ceil(e/i),r=new Uint8Array(2+e+5*a+4);let s=0;r[s++]=120;r[s++]=156;let n=0;for(;e>i;){r[s++]=0;r[s++]=255;r[s++]=255;r[s++]=0;r[s++]=0;r.set(t.subarray(n,n+i),s);s+=i;n+=i;e-=i}r[s++]=1;r[s++]=255&e;r[s++]=e>>8&255;r[s++]=255&~e;r[s++]=(65535&~e)>>8&255;r.set(t.subarray(n),s);s+=t.length-n;const o=function adler32(t,e,i){let a=1,r=0;for(let s=e;s<i;++s){a=(a+(255&t[s]))%65521;r=(r+a)%65521}return r<<16|a}(t,0,t.length);r[s++]=o>>24&255;r[s++]=o>>16&255;r[s++]=o>>8&255;r[s++]=255&o;return r}(t)}return function convertImgDataToPng(e,i,a){return function encode(e,i,a,s){const n=e.width,o=e.height;let l,c,d;const h=e.data;switch(i){case r.ImageKind.GRAYSCALE_1BPP:c=0;l=1;d=n+7>>3;break;case r.ImageKind.RGB_24BPP:c=2;l=8;d=3*n;break;case r.ImageKind.RGBA_32BPP:c=6;l=8;d=4*n;break;default:throw new Error("invalid format")}const u=new Uint8Array((1+d)*o);let p=0,f=0;for(let t=0;t<o;++t){u[p++]=0;u.set(h.subarray(f,f+d),p);f+=d;p+=d}if(i===r.ImageKind.GRAYSCALE_1BPP&&s){p=0;for(let t=0;t<o;t++){p++;for(let t=0;t<d;t++)u[p++]^=255}}const g=new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,l,c,0,0,0]),v=deflateSync(u),m=t.length+36+g.length+v.length,_=new Uint8Array(m);let b=0;_.set(t,b);b+=t.length;writePngChunk("IHDR",g,_,b);b+=12+g.length;writePngChunk("IDATA",v,_,b);b+=12+v.length;writePngChunk("IEND",new Uint8Array(0),_,b);return createObjectURL(_,"image/png",a)}(e,void 0===e.kind?r.ImageKind.GRAYSCALE_1BPP:e.kind,i,a)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=n.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=n.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 opListToTree(t){let e=[];const i=[];for(const a of t)if("save"!==a.fn)"restore"===a.fn?e=i.pop():e.push(a);else{e.push({fnId:92,fn:"group",items:[]});i.push(e);e=e.at(-1).items}return e}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let 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 pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let u=0,p=0,f=0;e.SVGGraphics=s=class{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,a.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new a.DOMSVGFactory;this.current=new SVGExtraState;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=[];for(const t in r.OPS)this._operatorIdMapping[r.OPS[t]]=t}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const 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){const e=t.fnArray,i=t.argsArray;for(let t=0,a=e.length;t<a;t++)if(e[t]===r.OPS.dependency)for(const e of i[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,i=new Promise((i=>{t.get(e,i)}));this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(t,e,i,a,s,n){const o=[t,e,i,a,s,n];this.transformMatrix=r.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const i=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=r.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return i}))}convertOpList(t){const e=this._operatorIdMapping,i=t.argsArray,a=t.fnArray,r=[];for(let t=0,s=a.length;t<s;t++){const s=a[t];r.push({fnId:s,fn:e[s],args:i[t]})}return opListToTree(r)}executeOpTree(t){for(const e of t){const t=e.fn,i=e.fnId,a=e.args;switch(0|i){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;default:(0,r.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,i,a,r,s){const n=this.current;n.textMatrix=n.lineMatrix=[t,e,i,a,r,s];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",`${pf(n.fontSize)}px`);n.tspan.setAttributeNS(null,"y",pf(-n.y));n.txtElement=this.svgFactory.createElement("svg:text");n.txtElement.append(n.tspan)}beginText(){const 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){const 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",`${pf(i.fontSize)}px`);i.tspan.setAttributeNS(null,"y",pf(-i.y))}showText(t){const e=this.current,i=e.font,a=e.fontSize;if(0===a)return;const s=e.fontSizeScale,l=e.charSpacing,c=e.wordSpacing,d=e.fontDirection,h=e.textHScale*d,u=i.vertical,p=u?1:-1,f=i.defaultVMetrics,g=a*e.fontMatrix[0];let v=0;for(const r of t){if(null===r){v+=d*c;continue}if("number"==typeof r){v+=p*r*a/1e3;continue}const t=(r.isSpace?c:0)+l,n=r.fontChar;let o,h,m,_=r.width;if(u){let t;const e=r.vmetric||f;t=r.vmetric?e[1]:.5*_;t=-t*g;const i=e[2]*g;_=e?-e[0]:_;o=t/s;h=(v+i)/s}else{o=v/s;h=0}if(r.isInFont||i.missingFile){e.xcoords.push(e.x+o);u&&e.ycoords.push(-e.y+h);e.tspan.textContent+=n}m=u?_*g-t*d:_*g+t*d;v+=m}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" "));u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y));u?e.y-=v:e.x+=v*h;e.tspan.setAttributeNS(null,"font-family",e.fontFamily);e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`);e.fontStyle!==n.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle);e.fontWeight!==n.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const m=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(m===r.TextRenderingMode.FILL||m===r.TextRenderingMode.FILL_STROKE){e.fillColor!==n.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor);e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)}else e.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none");if(m===r.TextRenderingMode.STROKE||m===r.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let _=e.textMatrix;if(0!==e.textRise){_=_.slice();_[5]+=e.textRise}e.txtElement.setAttributeNS(null,"transform",`${pm(_)} scale(${pf(h)}, -1)`);e.txtElement.setAttributeNS(o,"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 new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.append(this.cssStyle)}const e=createObjectURL(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,i=this.commonObjs.get(t[0]);let a=t[1];e.font=i;if(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 s="normal";i.black?s="900":i.bold&&(s="bold");const n=i.italic?"italic":"normal";if(a<0){a=-a;e.fontDirection=-1}else e.fontDirection=1;e.fontSize=a;e.fontFamily=i.loadedName;e.fontWeight=s;e.fontStyle=n;e.tspan=this.svgFactory.createElement("svg:tspan");e.tspan.setAttributeNS(null,"y",pf(-e.y));e.xcoords=[];e.ycoords=[]}endText(){var t;const e=this.current;if(e.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()){e.element=e.txtElement;this.clip("nonzero");this.endPath()}}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=c[t]}setLineJoin(t){this.current.lineJoin=d[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){const e=this.viewport.width,i=this.viewport.height,a=r.Util.inverseTransform(this.transformMatrix),s=r.Util.applyTransform([0,0],a),n=r.Util.applyTransform([0,i],a),o=r.Util.applyTransform([e,0],a),l=r.Util.applyTransform([e,i],a),c=Math.min(s[0],n[0],o[0],l[0]),d=Math.min(s[1],n[1],o[1],l[1]),h=Math.max(s[0],n[0],o[0],l[0]),u=Math.max(s[1],n[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",d);p.setAttributeNS(null,"width",h-c);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){const e=t[1],i=t[2],a=t[3]||r.IDENTITY_MATRIX,[s,n,o,l]=t[4],c=t[5],d=t[6],h=t[7],u="shading"+f++,[p,g,v,m]=r.Util.normalizeRect([...r.Util.applyTransform([s,n],a),...r.Util.applyTransform([o,l],a)]),[_,b]=r.Util.singularValueDecompose2dScale(a),y=c*_,A=d*b,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",u);P.setAttributeNS(null,"patternUnits","userSpaceOnUse");P.setAttributeNS(null,"width",y);P.setAttributeNS(null,"height",A);P.setAttributeNS(null,"x",`${p}`);P.setAttributeNS(null,"y",`${g}`);const S=this.svg,w=this.transformMatrix,x=this.current.fillColor,E=this.current.strokeColor,C=this.svgFactory.create(v-p,m-g);this.svg=C;this.transformMatrix=a;if(2===h){const t=r.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(i));this.svg=S;this.transformMatrix=w;this.current.fillColor=x;this.current.strokeColor=E;P.append(C.childNodes[0]);this.defs.append(P);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+f++,i=t[3];let a;switch(t[1]){case"axial":const i=t[4],r=t[5];a=this.svgFactory.createElement("svg:linearGradient");a.setAttributeNS(null,"id",e);a.setAttributeNS(null,"gradientUnits","userSpaceOnUse");a.setAttributeNS(null,"x1",i[0]);a.setAttributeNS(null,"y1",i[1]);a.setAttributeNS(null,"x2",r[0]);a.setAttributeNS(null,"y2",r[1]);break;case"radial":const s=t[4],n=t[5],o=t[6],l=t[7];a=this.svgFactory.createElement("svg:radialGradient");a.setAttributeNS(null,"id",e);a.setAttributeNS(null,"gradientUnits","userSpaceOnUse");a.setAttributeNS(null,"cx",n[0]);a.setAttributeNS(null,"cy",n[1]);a.setAttributeNS(null,"r",l);a.setAttributeNS(null,"fx",s[0]);a.setAttributeNS(null,"fy",s[1]);a.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of i){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);a.append(e)}this.defs.append(a);return`url(#${e})`;case"Mesh":(0,r.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const i=this.current;let a=i.x,s=i.y,n=[],o=0;for(const i of t)switch(0|i){case r.OPS.rectangle:a=e[o++];s=e[o++];const t=a+e[o++],i=s+e[o++];n.push("M",pf(a),pf(s),"L",pf(t),pf(s),"L",pf(t),pf(i),"L",pf(a),pf(i),"Z");break;case r.OPS.moveTo:a=e[o++];s=e[o++];n.push("M",pf(a),pf(s));break;case r.OPS.lineTo:a=e[o++];s=e[o++];n.push("L",pf(a),pf(s));break;case r.OPS.curveTo:a=e[o+4];s=e[o+5];n.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(a),pf(s));o+=6;break;case r.OPS.curveTo2:n.push("C",pf(a),pf(s),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));a=e[o+2];s=e[o+3];o+=4;break;case r.OPS.curveTo3:a=e[o+2];s=e[o+3];n.push("C",pf(e[o]),pf(e[o+1]),pf(a),pf(s),pf(a),pf(s));o+=4;break;case r.OPS.closePath:n.push("Z")}n=n.join(" ");if(i.path&&t.length>0&&t[0]!==r.OPS.rectangle&&t[0]!==r.OPS.moveTo)n=i.path.getAttributeNS(null,"d")+n;else{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(a,s)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+u++,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"transform",pm(this.transformMatrix));const a=t.element.cloneNode(!0);"evenodd"===this.pendingClip?a.setAttributeNS(null,"clip-rule","evenodd"):a.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;i.append(a);this.defs.append(i);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;i.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const 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(const[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(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=this.current;let a=i.dashArray;1!==e&&a.length>0&&(a=a.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",i.strokeColor);t.setAttributeNS(null,"stroke-opacity",i.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(i.miterLimit));t.setAttributeNS(null,"stroke-linecap",i.lineCap);t.setAttributeNS(null,"stroke-linejoin",i.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*i.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",a.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*i.dashPhase)+"px")}eoFill(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const 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){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,r.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const i=t.width,a=t.height,r=h(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0");s.setAttributeNS(null,"y","0");s.setAttributeNS(null,"width",pf(i));s.setAttributeNS(null,"height",pf(a));this.current.element=s;this.clip("nonzero");const n=this.svgFactory.createElement("svg:image");n.setAttributeNS(l,"xlink:href",r);n.setAttributeNS(null,"x","0");n.setAttributeNS(null,"y",pf(-a));n.setAttributeNS(null,"width",pf(i)+"px");n.setAttributeNS(null,"height",pf(a)+"px");n.setAttributeNS(null,"transform",`scale(${pf(1/i)} ${pf(-1/a)})`);e?e.append(n):this._ensureTransformGroup().append(n)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap){(0,r.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const i=this.current,a=e.width,s=e.height,n=i.fillColor;i.maskId="mask"+p++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",i.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(a));l.setAttributeNS(null,"height",pf(s));l.setAttributeNS(null,"fill",n);l.setAttributeNS(null,"mask",`url(#${i.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],i=e[3]-e[1],a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",e[0]);a.setAttributeNS(null,"y",e[1]);a.setAttributeNS(null,"width",pf(t));a.setAttributeNS(null,"height",pf(i));this.current.element=a;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),i=this.svgFactory.createElement("svg:defs");e.append(i);this.defs=i;const a=this.svgFactory.createElement("svg:g");a.setAttributeNS(null,"transform",pm(t.transform));e.append(a);this.svg=a;return e}_ensureClipGroup(){if(!this.current.clipGroup){const 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(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}}],__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:{}};__webpack_modules__[t](i,i.exports,__w_pdfjs_require__);return i.exports}var __webpack_exports__={};(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return s.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 n.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.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,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});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 i.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return a.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return i.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 a.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return a.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}});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 d.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return i.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 i.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return a.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return a.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return a.getXfaPageViewport}});Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return a.isDataScheme}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return a.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return r.renderTextLayer}});Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return a.setLayerDimensions}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return r.updateTextLayer}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return i.version}});var e=__w_pdfjs_require__(1),i=__w_pdfjs_require__(137),a=__w_pdfjs_require__(141),r=__w_pdfjs_require__(161),s=__w_pdfjs_require__(162),n=__w_pdfjs_require__(140),o=__w_pdfjs_require__(167),l=__w_pdfjs_require__(149),c=__w_pdfjs_require__(170),d=__w_pdfjs_require__(169)})();return __webpack_exports__})()));
});