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 430 kB
window.ngxZone.runOutsideAngular(() => {
/**
 * @licstart The following is the entire license notice for the
 * JavaScript code in this page
 *
 * Copyright 2022 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?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.StreamType=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FontType=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0;e.arrayByteLength=arrayByteLength;e.arraysToBytes=function arraysToBytes(t){const e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];let r=0;for(let i=0;i<e;i++)r+=arrayByteLength(t[i]);let i=0;const n=new Uint8Array(r);for(let r=0;r<e;r++){let e=t[r];e instanceof Uint8Array||(e="string"==typeof e?stringToBytes(e):new Uint8Array(e));const a=e.byteLength;n.set(e,i);i+=a}return n};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,r=8192;if(e<r)return String.fromCharCode.apply(null,t);const i=[];for(let n=0;n<e;n+=r){const a=Math.min(n+r,e),s=t.subarray(n,a);i.push(String.fromCharCode.apply(null,s))}return i.join("")};e.createPromiseCapability=function createPromiseCapability(){const t=Object.create(null);let e=!1;Object.defineProperty(t,"settled",{get:()=>e});t.promise=new Promise((function(r,i){t.resolve=function(t){e=!0;r(t)};t.reject=function(t){e=!0;i(t)}}));return t};e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(r&&"string"==typeof t){if(r.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t="http://".concat(t))}if(r.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const i=e?new URL(t,e):new URL(t);if(_isValidProtocol(i))return i}catch(t){}return null};e.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(t=>"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)))};e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const e=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return e.join("")};e.getVerbosityLevel=function getVerbosityLevel(){return n};e.info=function info(t){n>=i.INFOS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Info: ".concat(t)):Window&&Window.ngxConsole?Window.ngxConsole.log("Info: ".concat(t)):console.log("Info: ".concat(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 r=0,i=t.length;r<i;r++)if(t[r]!==e[r])return!1;return!0};e.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[r,i]of t)e[r]=i;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(n=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 r=new TextDecoder(e,{fatal:!0}),i=stringToBytes(t);return r.decode(i)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}const e=[];for(let r=0,i=t.length;r<i;r++){const i=o[t.charCodeAt(r)];e.push(i?String.fromCharCode(i):t.charAt(r))}return e.join("")};e.stringToUTF16BEString=function stringToUTF16BEString(t){const e=["þÿ"];for(let r=0,i=t.length;r<i;r++){const i=t.charCodeAt(r);e.push(String.fromCharCode(i>>8&255),String.fromCharCode(255&i))}return e.join("")};e.stringToUTF8String=stringToUTF8String;e.unreachable=unreachable;e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};e.warn=warn;r(2);r(79);r(93);r(116);r(117);r(138);r(140);r(141);r(145);r(146);r(152);r(177);e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,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"};e.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const i={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=i;e.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};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,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let n=i.WARNINGS;function warn(t){n>=i.WARNINGS&&("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?console.log("Warning: ".concat(t)):Window&&Window.ngxConsole?Window.ngxConsole.log("Warning: ".concat(t)):console.log("Warning: ".concat(t)))}function unreachable(t){throw new Error(t)}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}}function shadow(t,e,r){Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!1});return r}const a=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=a;e.PasswordException=class PasswordException extends a{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends a{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends a{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends a{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends a{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends a{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends a{constructor(t){super(t,"AbortException")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,r=new Uint8Array(e);for(let i=0;i<e;++i)r[i]=255&t.charCodeAt(i);return r}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}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)}};const s=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,r){return"#".concat(s[t]).concat(s[e]).concat(s[r])}static scaleMinMax(t,e){let r;if(t[0]){if(t[0]<0){r=e[0];e[0]=e[1];e[1]=r}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){r=e[2];e[2]=e[3];e[3]=r}e[2]*=t[3];e[3]*=t[3]}else{r=e[0];e[0]=e[2];e[2]=r;r=e[1];e[1]=e[3];e[3]=r;if(t[1]<0){r=e[2];e[2]=e[3];e[3]=r}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){r=e[0];e[0]=e[1];e[1]=r}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 r=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])/r,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/r]}static getAxialAlignedBoundingBox(t,e){const r=Util.applyTransform(t,e),i=Util.applyTransform(t.slice(2,4),e),n=Util.applyTransform([t[0],t[3]],e),a=Util.applyTransform([t[2],t[1]],e);return[Math.min(r[0],i[0],n[0],a[0]),Math.min(r[1],i[1],n[1],a[1]),Math.max(r[0],i[0],n[0],a[0]),Math.max(r[1],i[1],n[1],a[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 apply3dTransform(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],r=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],n=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],s=(r+a)/2,o=Math.sqrt((r+a)**2-4*(r*a-n*i))/2,l=s+o||1,c=s-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 r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>i)return null;const n=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>a?null:[r,n,i,a]}static bezierBoundingBox(t,e,r,i,n,a,s,o){const l=[],c=[[],[]];let h,d,u,p,f,g,v,m;for(let c=0;c<2;++c){if(0===c){d=6*t-12*r+6*n;h=-3*t+9*r-9*n+3*s;u=3*r-3*t}else{d=6*e-12*i+6*a;h=-3*e+9*i-9*a+3*o;u=3*i-3*e}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0<p&&p<1&&l.push(p)}else{v=d*d-4*u*h;m=Math.sqrt(v);if(!(v<0)){f=(-d+m)/(2*h);0<f&&f<1&&l.push(f);g=(-d-m)/(2*h);0<g&&g<1&&l.push(g)}}}let _,y=l.length;const b=y;for(;y--;){p=l[y];_=1-p;c[0][y]=_*_*_*t+3*_*_*p*r+3*_*p*p*n+p*p*p*s;c[1][y]=_*_*_*e+3*_*_*p*i+3*_*p*p*a+p*p*p*o}c[0][b]=t;c[1][b]=e;c[0][b+1]=s;c[1][b+1]=o;c[0].length=c[1].length=b+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,r)=>{"use strict";var i=r(3),n=r(67);i({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},(t,e,r)=>{var i=r(4),n=r(5).f,a=r(42),s=r(46),o=r(36),l=r(54),c=r(66);t.exports=function(t,e){var r,h,d,u,p,f=t.target,g=t.global,v=t.stat;if(r=g?i:v?i[f]||o(f,{}):(i[f]||{}).prototype)for(h in e){u=e[h];d=t.dontCallGetSet?(p=n(r,h))&&p.value:r[h];if(!c(g?h:f+(v?".":"#")+h,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&a(u,"sham",!0);s(r,h,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,r)=>{var i=r(6),n=r(8),a=r(10),s=r(11),o=r(12),l=r(17),c=r(37),h=r(40),d=Object.getOwnPropertyDescriptor;e.f=i?d:function getOwnPropertyDescriptor(t,e){t=o(t);e=l(e);if(h)try{return d(t,e)}catch(t){}if(c(t,e))return s(!n(a.f,t,e),t[e])}},(t,e,r)=>{var i=r(7);t.exports=!i((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,r)=>{var i=r(9),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},(t,e,r)=>{var i=r(7);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function propertyIsEnumerable(t){var e=i(this,t);return!!e&&e.enumerable}:r},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,r)=>{var i=r(13),n=r(16);t.exports=function(t){return i(n(t))}},(t,e,r)=>{var i=r(14),n=r(7),a=r(15),s=Object,o=i("".split);t.exports=n((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?o(t,""):s(t)}:s},(t,e,r)=>{var i=r(9),n=Function.prototype,a=n.bind,s=n.call,o=i&&a.bind(s,s);t.exports=i?function(t){return t&&o(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},(t,e,r)=>{var i=r(14),n=i({}.toString),a=i("".slice);t.exports=function(t){return a(n(t),8,-1)}},t=>{var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},(t,e,r)=>{var i=r(18),n=r(21);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},(t,e,r)=>{var i=r(8),n=r(19),a=r(21),s=r(28),o=r(31),l=r(32),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!n(t)||a(t))return t;var r,l=s(t,h);if(l){void 0===e&&(e="default");r=i(l,t,e);if(!n(r)||a(r))return r;throw c("Can't convert object to primitive value")}void 0===e&&(e="number");return o(t,e)}},(t,e,r)=>{var i=r(20);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},t=>{t.exports=function(t){return"function"==typeof t}},(t,e,r)=>{var i=r(22),n=r(20),a=r(23),s=r(24),o=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&a(e.prototype,o(t))}},(t,e,r)=>{var i=r(4),n=r(20),aFunction=function(t){return n(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?aFunction(i[t]):i[t]&&i[t][e]}},(t,e,r)=>{var i=r(14);t.exports=i({}.isPrototypeOf)},(t,e,r)=>{var i=r(25);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var i=r(26),n=r(7);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},(t,e,r)=>{var i,n,a=r(4),s=r(27),o=a.process,l=a.Deno,c=o&&o.versions||l&&l.version,h=c&&c.v8;h&&(n=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!n&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(n=+i[1]);t.exports=n},(t,e,r)=>{var i=r(22);t.exports=i("navigator","userAgent")||""},(t,e,r)=>{var i=r(29);t.exports=function(t,e){var r=t[e];return null==r?void 0:i(r)}},(t,e,r)=>{var i=r(20),n=r(30),a=TypeError;t.exports=function(t){if(i(t))return t;throw a(n(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,r)=>{var i=r(8),n=r(20),a=r(19),s=TypeError;t.exports=function(t,e){var r,o;if("string"===e&&n(r=t.toString)&&!a(o=i(r,t)))return o;if(n(r=t.valueOf)&&!a(o=i(r,t)))return o;if("string"!==e&&n(r=t.toString)&&!a(o=i(r,t)))return o;throw s("Can't convert object to primitive value")}},(t,e,r)=>{var i=r(4),n=r(33),a=r(37),s=r(39),o=r(25),l=r(24),c=n("wks"),h=i.Symbol,d=h&&h.for,u=l?h:h&&h.withoutSetter||s;t.exports=function(t){if(!a(c,t)||!o&&"string"!=typeof c[t]){var e="Symbol."+t;o&&a(h,t)?c[t]=h[t]:c[t]=l&&d?d(e):u(e)}return c[t]}},(t,e,r)=>{var i=r(34),n=r(35);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.5",mode:i?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var i=r(4),n=r(36),a="__core-js_shared__",s=i[a]||n(a,{});t.exports=s},(t,e,r)=>{var i=r(4),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},(t,e,r)=>{var i=r(14),n=r(38),a=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return a(n(t),e)}},(t,e,r)=>{var i=r(16),n=Object;t.exports=function(t){return n(i(t))}},(t,e,r)=>{var i=r(14),n=0,a=Math.random(),s=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+a,36)}},(t,e,r)=>{var i=r(6),n=r(7),a=r(41);t.exports=!i&&!n((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},(t,e,r)=>{var i=r(4),n=r(19),a=i.document,s=n(a)&&n(a.createElement);t.exports=function(t){return s?a.createElement(t):{}}},(t,e,r)=>{var i=r(6),n=r(43),a=r(11);t.exports=i?function(t,e,r){return n.f(t,e,a(1,r))}:function(t,e,r){t[e]=r;return t}},(t,e,r)=>{var i=r(6),n=r(40),a=r(44),s=r(45),o=r(17),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?a?function defineProperty(t,e,r){s(t);e=o(e);s(r);if("function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r.writable){var i=h(t,e);if(i&&i.writable){t[e]=r.value;r={configurable:u in r?r.configurable:i.configurable,enumerable:d in r?r.enumerable:i.enumerable,writable:!1}}}return c(t,e,r)}:c:function defineProperty(t,e,r){s(t);e=o(e);s(r);if(n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");"value"in r&&(t[e]=r.value);return t}},(t,e,r)=>{var i=r(6),n=r(7);t.exports=i&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,r)=>{var i=r(19),n=String,a=TypeError;t.exports=function(t){if(i(t))return t;throw a(n(t)+" is not an object")}},(t,e,r)=>{var i=r(20),n=r(43),a=r(47),s=r(36);t.exports=function(t,e,r,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;i(r)&&a(r,c,o);if(o.global)l?t[e]=r:s(e,r);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,r)=>{var i=r(7),n=r(20),a=r(37),s=r(6),o=r(48).CONFIGURABLE,l=r(49),c=r(50),h=c.enforce,d=c.get,u=Object.defineProperty,p=s&&!i((function(){return 8!==u((function(){}),"length",{value:8}).length})),f=String(String).split("String"),g=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");r&&r.getter&&(e="get "+e);r&&r.setter&&(e="set "+e);(!a(t,"name")||o&&t.name!==e)&&(s?u(t,"name",{value:e,configurable:!0}):t.name=e);p&&r&&a(r,"arity")&&t.length!==r.arity&&u(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&u(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=h(t);a(i,"source")||(i.source=f.join("string"==typeof e?e:""));return t};Function.prototype.toString=g((function toString(){return n(this)&&d(this).source||l(this)}),"toString")},(t,e,r)=>{var i=r(6),n=r(37),a=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,o=n(a,"name"),l=o&&"something"===function something(){}.name,c=o&&(!i||i&&s(a,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,r)=>{var i=r(14),n=r(20),a=r(35),s=i(Function.toString);n(a.inspectSource)||(a.inspectSource=function(t){return s(t)});t.exports=a.inspectSource},(t,e,r)=>{var i,n,a,s=r(51),o=r(4),l=r(14),c=r(19),h=r(42),d=r(37),u=r(35),p=r(52),f=r(53),g="Object already initialized",v=o.TypeError,m=o.WeakMap;if(s||u.state){var _=u.state||(u.state=new m),y=l(_.get),b=l(_.has),A=l(_.set);i=function(t,e){if(b(_,t))throw new v(g);e.facade=t;A(_,t,e);return e};n=function(t){return y(_,t)||{}};a=function(t){return b(_,t)}}else{var P=p("state");f[P]=!0;i=function(t,e){if(d(t,P))throw new v(g);e.facade=t;h(t,P,e);return e};n=function(t){return d(t,P)?t[P]:{}};a=function(t){return d(t,P)}}t.exports={set:i,get:n,has:a,enforce:function(t){return a(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!c(e)||(r=n(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return r}}}},(t,e,r)=>{var i=r(4),n=r(20),a=r(49),s=i.WeakMap;t.exports=n(s)&&/native code/.test(a(s))},(t,e,r)=>{var i=r(33),n=r(39),a=i("keys");t.exports=function(t){return a[t]||(a[t]=n(t))}},t=>{t.exports={}},(t,e,r)=>{var i=r(37),n=r(55),a=r(5),s=r(43);t.exports=function(t,e,r){for(var o=n(e),l=s.f,c=a.f,h=0;h<o.length;h++){var d=o[h];i(t,d)||r&&i(r,d)||l(t,d,c(e,d))}}},(t,e,r)=>{var i=r(22),n=r(14),a=r(56),s=r(65),o=r(45),l=n([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var e=a.f(o(t)),r=s.f;return r?l(e,r(t)):e}},(t,e,r)=>{var i=r(57),n=r(64).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,n)}},(t,e,r)=>{var i=r(14),n=r(37),a=r(12),s=r(58).indexOf,o=r(53),l=i([].push);t.exports=function(t,e){var r,i=a(t),c=0,h=[];for(r in i)!n(o,r)&&n(i,r)&&l(h,r);for(;e.length>c;)n(i,r=e[c++])&&(~s(h,r)||l(h,r));return h}},(t,e,r)=>{var i=r(12),n=r(59),a=r(62),createMethod=function(t){return function(e,r,s){var o,l=i(e),c=a(l),h=n(s,c);if(t&&r!=r){for(;c>h;)if((o=l[h++])!=o)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,r)=>{var i=r(60),n=Math.max,a=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):a(r,e)}},(t,e,r)=>{var i=r(61);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function trunc(t){var i=+t;return(i>0?r:e)(i)}},(t,e,r)=>{var i=r(63);t.exports=function(t){return i(t.length)}},(t,e,r)=>{var i=r(60),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{var i=r(7),n=r(20),a=/#|\.prototype\./,isForced=function(t,e){var r=o[s(t)];return r==c||r!=l&&(n(e)?i(e):!!e)},s=isForced.normalize=function(t){return String(t).replace(a,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,r)=>{"use strict";var i=r(8),n=r(14),a=r(68),s=r(71),o=r(72),l=r(33),c=r(73),h=r(50).get,d=r(77),u=r(78),p=l("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,g=f,v=n("".charAt),m=n("".indexOf),_=n("".replace),y=n("".slice),b=function(){var t=/a/,e=/b*/g;i(f,t,"a");i(f,e,"a");return 0!==t.lastIndex||0!==e.lastIndex}(),A=o.BROKEN_CARET,P=void 0!==/()??/.exec("")[1];(b||P||A||d||u)&&(g=function exec(t){var e,r,n,o,l,d,u,S=this,x=h(S),w=a(t),E=x.raw;if(E){E.lastIndex=S.lastIndex;e=i(g,E,w);S.lastIndex=E.lastIndex;return e}var k=x.groups,T=A&&S.sticky,C=i(s,S),M=S.source,R=0,I=w;if(T){C=_(C,"y","");-1===m(C,"g")&&(C+="g");I=y(w,S.lastIndex);if(S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==v(w,S.lastIndex-1))){M="(?: "+M+")";I=" "+I;R++}r=new RegExp("^(?:"+M+")",C)}P&&(r=new RegExp("^"+M+"$(?!\\s)",C));b&&(n=S.lastIndex);o=i(f,T?r:S,I);if(T)if(o){o.input=y(o.input,R);o[0]=y(o[0],R);o.index=S.lastIndex;S.lastIndex+=o[0].length}else S.lastIndex=0;else b&&o&&(S.lastIndex=S.global?o.index+o[0].length:n);P&&o&&o.length>1&&i(p,o[0],r,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(o[l]=void 0)}));if(o&&k){o.groups=d=c(null);for(l=0;l<k.length;l++)d[(u=k[l])[0]]=o[u[1]]}return o});t.exports=g},(t,e,r)=>{var i=r(69),n=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return n(t)}},(t,e,r)=>{var i=r(70),n=r(20),a=r(15),s=r(32)("toStringTag"),o=Object,l="Arguments"==a(function(){return arguments}());t.exports=i?a:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=o(t),s))?r:l?a(e):"Object"==(i=a(e))&&n(e.callee)?"Arguments":i}},(t,e,r)=>{var i={};i[r(32)("toStringTag")]="z";t.exports="[object z]"===String(i)},(t,e,r)=>{"use strict";var i=r(45);t.exports=function(){var t=i(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,r)=>{var i=r(7),n=r(4).RegExp,a=i((function(){var t=n("a","y");t.lastIndex=2;return null!=t.exec("abcd")})),s=a||i((function(){return!n("a","y").sticky})),o=a||i((function(){var t=n("^r","gy");t.lastIndex=2;return null!=t.exec("str")}));t.exports={BROKEN_CARET:o,MISSED_STICKY:s,UNSUPPORTED_Y:a}},(t,e,r)=>{var i,n=r(45),a=r(74),s=r(64),o=r(53),l=r(76),c=r(41),h=r(52),d=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,e=c("iframe");e.style.display="none";l.appendChild(e);e.src=String("javascript:");(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=s.length;t--;)delete NullProtoObject.prototype[s[t]];return NullProtoObject()};o[d]=!0;t.exports=Object.create||function create(t,e){var r;if(null!==t){EmptyConstructor.prototype=n(t);r=new EmptyConstructor;EmptyConstructor.prototype=null;r[d]=t}else r=NullProtoObject();return void 0===e?r:a.f(r,e)}},(t,e,r)=>{var i=r(6),n=r(44),a=r(43),s=r(45),o=r(12),l=r(75);e.f=i&&!n?Object.defineProperties:function defineProperties(t,e){s(t);for(var r,i=o(e),n=l(e),c=n.length,h=0;c>h;)a.f(t,r=n[h++],i[r]);return t}},(t,e,r)=>{var i=r(57),n=r(64);t.exports=Object.keys||function keys(t){return i(t,n)}},(t,e,r)=>{var i=r(22);t.exports=i("document","documentElement")},(t,e,r)=>{var i=r(7),n=r(4).RegExp;t.exports=i((function(){var t=n(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},(t,e,r)=>{var i=r(7),n=r(4).RegExp;t.exports=i((function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},(t,e,r)=>{var i=r(4),n=r(80),a=r(81),s=r(82),o=r(42),l=r(32),c=l("iterator"),h=l("toStringTag"),d=s.values,handlePrototype=function(t,e){if(t){if(t[c]!==d)try{o(t,c,d)}catch(e){t[c]=d}t[h]||o(t,h,e);if(n[e])for(var r in s)if(t[r]!==s[r])try{o(t,r,s[r])}catch(e){t[r]=s[r]}}};for(var u in n)handlePrototype(i[u]&&i[u].prototype,u);handlePrototype(a,"DOMTokenList")},t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},(t,e,r)=>{var i=r(41)("span").classList,n=i&&i.constructor&&i.constructor.prototype;t.exports=n===Object.prototype?void 0:n},(t,e,r)=>{"use strict";var i=r(12),n=r(83),a=r(84),s=r(50),o=r(43).f,l=r(85),c=r(34),h=r(6),d="Array Iterator",u=s.set,p=s.getterFor(d);t.exports=l(Array,"Array",(function(t,e){u(this,{type:d,target:i(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,r=t.kind,i=t.index++;if(!e||i>=e.length){t.target=void 0;return{value:void 0,done:!0}}return"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");var f=a.Arguments=a.Array;n("keys");n("values");n("entries");if(!c&&h&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(t){}},(t,e,r)=>{var i=r(32),n=r(73),a=r(43).f,s=i("unscopables"),o=Array.prototype;null==o[s]&&a(o,s,{configurable:!0,value:n(null)});t.exports=function(t){o[s][t]=!0}},t=>{t.exports={}},(t,e,r)=>{"use strict";var i=r(3),n=r(8),a=r(34),s=r(48),o=r(20),l=r(86),c=r(88),h=r(91),d=r(90),u=r(42),p=r(46),f=r(32),g=r(84),v=r(87),m=s.PROPER,_=s.CONFIGURABLE,y=v.IteratorPrototype,b=v.BUGGY_SAFARI_ITERATORS,A=f("iterator"),P="keys",S="values",x="entries",returnThis=function(){return this};t.exports=function(t,e,r,s,f,v,w){l(r,e,s);var E,k,T,getIterationMethod=function(t){if(t===f&&D)return D;if(!b&&t in R)return R[t];switch(t){case P:return function keys(){return new r(this,t)};case S:return function values(){return new r(this,t)};case x:return function entries(){return new r(this,t)}}return function(){return new r(this)}},C=e+" Iterator",M=!1,R=t.prototype,I=R[A]||R["@@iterator"]||f&&R[f],D=!b&&I||getIterationMethod(f),O="Array"==e&&R.entries||I;if(O&&(E=c(O.call(new t)))!==Object.prototype&&E.next){a||c(E)===y||(h?h(E,y):o(E[A])||p(E,A,returnThis));d(E,C,!0,!0);a&&(g[C]=returnThis)}if(m&&f==S&&I&&I.name!==S)if(!a&&_)u(R,"name",S);else{M=!0;D=function values(){return n(I,this)}}if(f){k={values:getIterationMethod(S),keys:v?D:getIterationMethod(P),entries:getIterationMethod(x)};if(w)for(T in k)(b||M||!(T in R))&&p(R,T,k[T]);else i({target:e,proto:!0,forced:b||M},k)}a&&!w||R[A]===D||p(R,A,D,{name:f});g[e]=D;return k}},(t,e,r)=>{"use strict";var i=r(87).IteratorPrototype,n=r(73),a=r(11),s=r(90),o=r(84),returnThis=function(){return this};t.exports=function(t,e,r,l){var c=e+" Iterator";t.prototype=n(i,{next:a(+!l,r)});s(t,c,!1,!0);o[c]=returnThis;return t}},(t,e,r)=>{"use strict";var i,n,a,s=r(7),o=r(20),l=r(73),c=r(88),h=r(46),d=r(32),u=r(34),p=d("iterator"),f=!1;[].keys&&("next"in(a=[].keys())?(n=c(c(a)))!==Object.prototype&&(i=n):f=!0);null==i||s((function(){var t={};return i[p].call(t)!==t}))?i={}:u&&(i=l(i));o(i[p])||h(i,p,(function(){return this}));t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}},(t,e,r)=>{var i=r(37),n=r(20),a=r(38),s=r(52),o=r(89),l=s("IE_PROTO"),c=Object,h=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=a(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof c?h:null}},(t,e,r)=>{var i=r(7);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,r)=>{var i=r(43).f,n=r(37),a=r(32)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype);t&&!n(t,a)&&i(t,a,{configurable:!0,value:e})}},(t,e,r)=>{var i=r(14),n=r(45),a=r(92);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]);e=r instanceof Array}catch(t){}return function setPrototypeOf(r,i){n(r);a(i);e?t(r,i):r.__proto__=i;return r}}():void 0)},(t,e,r)=>{var i=r(20),n=String,a=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+n(t)+" as a prototype")}},(t,e,r)=>{r(94)},(t,e,r)=>{"use strict";r(95);var i,n=r(3),a=r(6),s=r(97),o=r(4),l=r(98),c=r(14),h=r(46),d=r(99),u=r(100),p=r(37),f=r(101),g=r(102),v=r(110),m=r(96).codeAt,_=r(111),y=r(68),b=r(90),A=r(112),P=r(113),S=r(50),x=S.set,w=S.getterFor("URL"),E=P.URLSearchParams,k=P.getState,T=o.URL,C=o.TypeError,M=o.parseInt,R=Math.floor,I=Math.pow,D=c("".charAt),O=c(/./.exec),L=c([].join),G=c(1..toString),N=c([].pop),j=c([].push),U=c("".replace),B=c([].shift),W=c("".split),q=c("".slice),z=c("".toLowerCase),V=c([].unshift),H="Invalid scheme",X="Invalid host",Y="Invalid port",K=/[a-z]/i,J=/[\d+-.a-z]/i,Q=/\d/,$=/^0x/i,Z=/^[0-7]+$/,tt=/^\d+$/,et=/^[\da-f]+$/i,rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,it=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,st=/[\t\n\r]/g,serializeHost=function(t){var e,r,i,n;if("number"==typeof t){e=[];for(r=0;r<4;r++){V(e,t%256);t=R(t/256)}return L(e,".")}if("object"==typeof t){e="";i=function(t){for(var e=null,r=1,i=null,n=0,a=0;a<8;a++)if(0!==t[a]){if(n>r){e=i;r=n}i=null;n=0}else{null===i&&(i=a);++n}if(n>r){e=i;r=n}return e}(t);for(r=0;r<8;r++)if(!n||0!==t[r]){n&&(n=!1);if(i===r){e+=r?":":"::";n=!0}else{e+=G(t[r],16);r<7&&(e+=":")}}return"["+e+"]"}return t},ot={},lt=f({},ot,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ht=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,e){var r=m(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(t,e){var r;return 2==t.length&&O(K,D(t,0))&&(":"==(r=D(t,1))||!e&&"|"==r)},startsWithWindowsDriveLetter=function(t){var e;return t.length>1&&isWindowsDriveLetter(q(t,0,2))&&(2==t.length||"/"===(e=D(t,2))||"\\"===e||"?"===e||"#"===e)},isSingleDot=function(t){return"."===t||"%2e"===z(t)},ut={},pt={},ft={},gt={},vt={},mt={},_t={},yt={},bt={},At={},Pt={},St={},xt={},wt={},Ft={},Et={},kt={},Tt={},Ct={},Mt={},Rt={},URLState=function(t,e,r){var i,n,a,s=y(t);if(e){if(n=this.parse(s))throw C(n);this.searchParams=null}else{void 0!==r&&(i=new URLState(r,!0));if(n=this.parse(s,null,i))throw C(n);(a=k(new E)).bindURL(this);this.searchParams=a}};URLState.prototype={type:"URL",parse:function(t,e,r){var n,a,s,o,l,c=this,h=e||ut,d=0,u="",f=!1,m=!1,_=!1;t=y(t);if(!e){c.scheme="";c.username="";c.password="";c.host=null;c.port=null;c.path=[];c.query=null;c.fragment=null;c.cannotBeABaseURL=!1;t=U(t,nt,"")}t=U(t,st,"");n=g(t);for(;d<=n.length;){a=n[d];switch(h){case ut:if(!a||!O(K,a)){if(e)return H;h=ft;continue}u+=z(a);h=pt;break;case pt:if(a&&(O(J,a)||"+"==a||"-"==a||"."==a))u+=z(a);else{if(":"!=a){if(e)return H;u="";h=ft;d=0;continue}if(e&&(c.isSpecial()!=p(dt,u)||"file"==u&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;c.scheme=u;if(e){c.isSpecial()&&dt[c.scheme]==c.port&&(c.port=null);return}u="";if("file"==c.scheme)h=wt;else if(c.isSpecial()&&r&&r.scheme==c.scheme)h=gt;else if(c.isSpecial())h=yt;else if("/"==n[d+1]){h=vt;d++}else{c.cannotBeABaseURL=!0;j(c.path,"");h=Ct}}break;case ft:if(!r||r.cannotBeABaseURL&&"#"!=a)return H;if(r.cannotBeABaseURL&&"#"==a){c.scheme=r.scheme;c.path=v(r.path);c.query=r.query;c.fragment="";c.cannotBeABaseURL=!0;h=Rt;break}h="file"==r.scheme?wt:mt;continue;case gt:if("/"!=a||"/"!=n[d+1]){h=mt;continue}h=bt;d++;break;case vt:if("/"==a){h=At;break}h=Tt;continue;case mt:c.scheme=r.scheme;if(a==i){c.username=r.username;c.password=r.password;c.host=r.host;c.port=r.port;c.path=v(r.path);c.query=r.query}else if("/"==a||"\\"==a&&c.isSpecial())h=_t;else if("?"==a){c.username=r.username;c.password=r.password;c.host=r.host;c.port=r.port;c.path=v(r.path);c.query="";h=Mt}else{if("#"!=a){c.username=r.username;c.password=r.password;c.host=r.host;c.port=r.port;c.path=v(r.path);c.path.length--;h=Tt;continue}c.username=r.username;c.password=r.password;c.host=r.host;c.port=r.port;c.path=v(r.path);c.query=r.query;c.fragment="";h=Rt}break;case _t:if(!c.isSpecial()||"/"!=a&&"\\"!=a){if("/"!=a){c.username=r.username;c.password=r.password;c.host=r.host;c.port=r.port;h=Tt;continue}h=At}else h=bt;break;case yt:h=bt;if("/"!=a||"/"!=D(u,d+1))continue;d++;break;case bt:if("/"!=a&&"\\"!=a){h=At;continue}break;case At:if("@"==a){f&&(u="%40"+u);f=!0;s=g(u);for(var b=0;b<s.length;b++){var A=s[b];if(":"!=A||_){var P=percentEncode(A,ht);_?c.password+=P:c.username+=P}else _=!0}u=""}else if(a==i||"/"==a||"?"==a||"#"==a||"\\"==a&&c.isSpecial()){if(f&&""==u)return"Invalid authority";d-=g(u).length+1;u="";h=Pt}else u+=a;break;case Pt:case St:if(e&&"file"==c.scheme){h=Et;continue}if(":"!=a||m){if(a==i||"/"==a||"?"==a||"#"==a||"\\"==a&&c.isSpecial()){if(c.isSpecial()&&""==u)return X;if(e&&""==u&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(u))return o;u="";h=kt;if(e)return;continue}"["==a?m=!0:"]"==a&&(m=!1);u+=a}else{if(""==u)return X;if(o=c.parseHost(u))return o;u="";h=xt;if(e==St)return}break;case xt:if(!O(Q,a)){if(a==i||"/"==a||"?"==a||"#"==a||"\\"==a&&c.isSpecial()||e){if(""!=u){var S=M(u,10);if(S>65535)return Y;c.port=c.isSpecial()&&S===dt[c.scheme]?null:S;u=""}if(e)return;h=kt;continue}return Y}u+=a;break;case wt:c.scheme="file";if("/"==a||"\\"==a)h=Ft;else{if(!r||"file"!=r.scheme){h=Tt;continue}if(a==i){c.host=r.host;c.path=v(r.path);c.query=r.query}else if("?"==a){c.host=r.host;c.path=v(r.path);c.query="";h=Mt}else{if("#"!=a){if(!startsWithWindowsDriveLetter(L(v(n,d),""))){c.host=r.host;c.path=v(r.path);c.shortenPath()}h=Tt;continue}c.host=r.host;c.path=v(r.path);c.query=r.query;c.fragment="";h=Rt}}break;case Ft:if("/"==a||"\\"==a){h=Et;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(L(v(n,d),""))&&(isWindowsDriveLetter(r.path[0],!0)?j(c.path,r.path[0]):c.host=r.host);h=Tt;continue;case Et:if(a==i||"/"==a||"\\"==a||"?"==a||"#"==a){if(!e&&isWindowsDriveLetter(u))h=Tt;else if(""==u){c.host="";if(e)return;h=kt}else{if(o=c.parseHost(u))return o;"localhost"==c.host&&(c.host="");if(e)return;u="";h=kt}continue}u+=a;break;case kt:if(c.isSpecial()){h=Tt;if("/"!=a&&"\\"!=a)continue}else if(e||"?"!=a)if(e||"#"!=a){if(a!=i){h=Tt;if("/"!=a)continue}}else{c.fragment="";h=Rt}else{c.query="";h=Mt}break;case Tt:if(a==i||"/"==a||"\\"==a&&c.isSpecial()||!e&&("?"==a||"#"==a)){if(".."===(l=z(l=u))||"%2e."===l||".%2e"===l||"%2e%2e"===l){c.shortenPath();"/"==a||"\\"==a&&c.isSpecial()||j(c.path,"")}else if(isSingleDot(u))"/"==a||"\\"==a&&c.isSpecial()||j(c.path,"");else{if("file"==c.scheme&&!c.path.length&&isWindowsDriveLetter(u)){c.host&&(c.host="");u=D(u,0)+":"}j(c.path,u)}u="";if("file"==c.scheme&&(a==i||"?"==a||"#"==a))for(;c.path.length>1&&""===c.path[0];)B(c.path);if("?"==a){c.query="";h=Mt}else if("#"==a){c.fragment="";h=Rt}}else u+=percentEncode(a,ct);break;case Ct:if("?"==a){c.query="";h=Mt}else if("#"==a){c.fragment="";h=Rt}else a!=i&&(c.path[0]+=percentEncode(a,ot));break;case Mt:if(e||"#"!=a)a!=i&&("'"==a&&c.isSpecial()?c.query+="%27":c.query+="#"==a?"%23":percentEncode(a,ot));else{c.fragment="";h=Rt}break;case Rt:a!=i&&(c.fragment+=percentEncode(a,lt))}d++}},parseHost:function(t){var e,r,i;if("["==D(t,0)){if("]"!=D(t,t.length-1))return X;e=function(t){var e,r,i,n,a,s,o,l=[0,0,0,0,0,0,0,0],c=0,h=null,d=0,chr=function(){return D(t,d)};if(":"==chr()){if(":"!=D(t,1))return;d+=2;h=++c}for(;chr();){if(8==c)return;if(":"!=chr()){e=r=0;for(;r<4&&O(et,chr());){e=16*e+M(chr(),16);d++;r++}if("."==chr()){if(0==r)return;d-=r;if(c>6)return;i=0;for(;chr();){n=null;if(i>0){if(!("."==chr()&&i<4))return;d++}if(!O(Q,chr()))return;for(;O(Q,chr());){a=M(chr(),10);if(null===n)n=a;else{if(0==n)return;n=10*n+a}if(n>255)return;d++}l[c]=256*l[c]+n;2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==chr()){d++;if(!chr())return}else if(chr())return;l[c++]=e}else{if(null!==h)return;d++;h=++c}}if(null!==h){s=c-h;c=7;for(;0!=c&&s>0;){o=l[c];l[c--]=l[h+s-1];l[h+--s]=o}}else if(8!=c)return;return l}(q(t,1,-1));if(!e)return X;this.host=e}else if(this.isSpecial()){t=_(t);if(O(rt,t))return X;e=function(t){var e,r,i,n,a,s,o,l=W(t,".");l.length&&""==l[l.length-1]&&l.length--;if((e=l.length)>4)return t;r=[];for(i=0;i<e;i++){if(""==(n=l[i]))return t;a=10;if(n.length>1&&"0"==D(n,0)){a=O($,n)?16:8;n=q(n,8==a?1:2)}if(""===n)s=0;else{if(!O(10==a?tt:8==a?Z:et,n))return t;s=M(n,a)}j(r,s)}for(i=0;i<e;i++){s=r[i];if(i==e-1){if(s>=I(256,5-e))return null}else if(s>255)return null}o=N(r);for(i=0;i<r.length;i++)o+=r[i]*I(256,3-i);return o}(t);if(null===e)return X;this.host=e}else{if(O(it,t))return X;e="";r=g(t);for(i=0;i<r.length;i++)e+=percentEncode(r[i],ot);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(dt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&isWindowsDriveLetter(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,i=t.password,n=t.host,a=t.port,s=t.path,o=t.query,l=t.fragment,c=e+":";if(null!==n){c+="//";t.includesCredentials()&&(c+=r+(i?":"+i:"")+"@");c+=serializeHost(n);null!==a&&(c+=":"+a)}else"file"==e&&(c+="//");c+=t.cannotBeABaseURL?s[0]:s.length?"/"+L(s,"/"):"";null!==o&&(c+="?"+o);null!==l&&(c+="#"+l);return c},setHref:function(t){var e=this.parse(t);if(e)throw C(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new It(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+serializeHost(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(y(t)+":",ut)},getUsername:function(){return this.username},setUsername:function(t){var e=g(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=percentEncode(e[r],ht)}},getPassword:function(){return this.password},setPassword:function(t){var e=g(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=percentEncode(e[r],ht)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?serializeHost(t):serializeHost(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Pt)},getHostname:function(){var t=this.host;return null===t?"":serializeHost(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,St)},getPort:function(){var t=this.port;return null===t?"":y(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=y(t))?this.port=null:this.parse(t,xt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+L(t,"/"):""},setPathname:function(t){if(!this.cannotBeABaseURL){this.path=[];this.parse(t,kt)}},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){if(""==(t=y(t)))this.query=null;else{"?"==D(t,0)&&(t=q(t,1));this.query="";this.parse(t,Mt)}this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(""!=(t=y(t))){"#"==D(t,0)&&(t=q(t,1));this.fragment="";this.parse(t,Rt)}else this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var It=function URL(t){var e=u(this,Dt),r=A(arguments.length,1)>1?arguments[1]:void 0,i=x(e,new URLState(t,!1,r));if(!a){e.href=i.serialize();e.origin=i.getOrigin();e.protocol=i.getProtocol();e.username=i.getUsername();e.password=i.getPassword();e.host=i.getHost();e.hostname=i.getHostname();e.port=i.getPort();e.pathname=i.getPathname();e.search=i.getSearch();e.searchParams=i.getSearchParams();e.hash=i.getHash()}},Dt=It.prototype,accessorDescriptor=function(t,e){return{get:function(){return w(this)[t]()},set:e&&function(t){return w(this)[e](t)},configurable:!0,enumerable:!0}};if(a){d(Dt,"href",accessorDescriptor("serialize","setHref"));d(Dt,"origin",accessorDescriptor("getOrigin"));d(Dt,"protocol",accessorDescriptor("getProtocol","setProtocol"));d(Dt,"username",accessorDescriptor("getUsername","setUsername"));d(Dt,"password",accessorDescriptor("getPassword","setPassword"));d(Dt,"host",accessorDescriptor("getHost","setHost"));d(Dt,"hostname",accessorDescriptor("getHostname","setHostname"));d(Dt,"port",accessorDescriptor("getPort","setPort"));d(Dt,"pathname",accessorDescriptor("getPathname","setPathname"));d(Dt,"search",accessorDescriptor("getSearch","setSearch"));d(Dt,"searchParams",accessorDescriptor("getSearchParams"));d(Dt,"hash",accessorDescriptor("getHash","setHash"))}h(Dt,"toJSON",(function toJSON(){return w(this).serialize()}),{enumerable:!0});h(Dt,"toString",(function toString(){return w(this).serialize()}),{enumerable:!0});if(T){var Ot=T.createObjectURL,Lt=T.revokeObjectURL;Ot&&h(It,"createObjectURL",l(Ot,T));Lt&&h(It,"revokeObjectURL",l(Lt,T))}b(It,"URL");n({global:!0,constructor:!0,forced:!s,sham:!a},{URL:It})},(t,e,r)=>{"use strict";var i=r(96).charAt,n=r(68),a=r(50),s=r(85),o="String Iterator",l=a.set,c=a.getterFor(o);s(String,"String",(function(t){l(this,{type:o,string:n(t),index:0})}),(function next(){var t,e=c(this),r=e.string,n=e.index;if(n>=r.length)return{value:void 0,done:!0};t=i(r,n);e.index+=t.length;return{value:t,done:!1}}))},(t,e,r)=>{var i=r(14),n=r(60),a=r(68),s=r(16),o=i("".charAt),l=i("".charCodeAt),c=i("".slice),createMethod=function(t){return function(e,r){var i,h,d=a(s(e)),u=n(r),p=d.length;return u<0||u>=p?t?"":void 0:(i=l(d,u))<55296||i>56319||u+1===p||(h=l(d,u+1))<56320||h>57343?t?o(d,u):i:t?c(d,u,u+2):h-56320+(i-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},(t,e,r)=>{var i=r(7),n=r(32),a=r(34),s=n("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";t.pathname="c%20d";e.forEach((function(t,i){e.delete("b");r+=i+t}));return a&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},(t,e,r)=>{var i=r(14),n=r(29),a=r(9),s=i(i.bind);t.exports=function(t,e){n(t);return void 0===e?t:a?s(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var i=r(47),n=r(43);t.exports=function(t,e,r){r.get&&i(r.get,e,{getter:!0});r.set&&i(r.set,e,{setter:!0});return n.f(t,e,r)}},(t,e,r)=>{var i=r(23),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw n("Incorrect invocation")}},(t,e,r)=>{"use strict";var i=r(6),n=r(14),a=r(8),s=r(7),o=r(75),l=r(65),c=r(10),h=r(38),d=r(13),u=Object.assign,p=Object.defineProperty,f=n([].concat);t.exports=!u||s((function(){if(i&&1!==u({b:1},u(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";t[r]=7;n.split("").forEach((function(t){e[t]=t}));return 7!=u({},t)[r]||o(u({},e)).join("")!=n}))?function assign(t,e){for(var r=h(t),n=arguments.length,s=1,u=l.f,p=c.f;n>s;)for(var g,v=d(arguments[s++]),m=u?f(o(v),u(v)):o(v),_=m.length,y=0;_>y;){g=m[y++];i&&!a(p,v,g)||(r[g]=v[g])}return r}:u},(t,e,r)=>{"use strict";var i=r(98),n=r(8),a=r(38),s=r(103),o=r(105),l=r(106),c=r(62),h=r(107),d=r(108),u=r(109),p=Array;t.exports=function from(t){var e=a(t),r=l(this),f=arguments.length,g=f>1?arguments[1]:void 0,v=void 0!==g;v&&(g=i(g,f>2?arguments[2]:void 0));var m,_,y,b,A,P,S=u(e),x=0;if(!S||this===p&&o(S)){m=c(e);_=r?new this(m):p(m);for(;m>x;x++){P=v?g(e[x],x):e[x];h(_,x,P)}}else{A=(b=d(e,S)).next;_=r?new this:[];for(;!(y=n(A,b)).done;x++){P=v?s(b,g,[y.value,x],!0):y.value;h(_,x,P)}}_.length=x;return _}},(t,e,r)=>{var i=r(45),n=r(104);t.exports=function(t,e,r,a){try{return a?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}},(t,e,r)=>{var i=r(8),n=r(45),a=r(28);t.exports=function(t,e,r){var s,o;n(t);try{if(!(s=a(t,"return"))){if("throw"===e)throw r;return r}s=i(s,t)}catch(t){o=!0;s=t}if("throw"===e)throw r;if(o)throw s;n(s);return r}},(t,e,r)=>{var i=r(32),n=r(84),a=i("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||s[a]===t)}},(t,e,r)=>{var i=r(14),n=r(7),a=r(20),s=r(69),o=r(22),l=r(49),noop=function(){},c=[],h=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,u=i(d.exec),p=!d.exec(noop),f=function isConstructor(t){if(!a(t))return!1;try{h(noop,c,t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!a(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(d,l(t))}catch(t){return!0}};g.sham=!0;t.exports=!h||n((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},(t,e,r)=>{"use strict";var i=r(17),n=r(43),a=r(11);t.exports=function(t,e,r){var s=i(e);s in t?n.f(t,s,a(0,r)):t[s]=r}},(t,e,r)=>{var i=r(8),n=r(29),a=r(45),s=r(30),o=r(109),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?o(t):e;if(n(r))return a(i(r,t));throw l(s(t)+" is not iterable")}},(t,e,r)=>{var i=r(69),n=r(28),a=r(84),s=r(32)("iterator");t.exports=function(t){if(null!=t)return n(t,s)||n(t,"@@iterator")||a[i(t)]}},(t,e,r)=>{var i=r(59),n=r(62),a=r(107),s=Array,o=Math.max;t.exports=function(t,e,r){for(var l=n(t),c=i(e,l),h=i(void 0===r?l:r,l),d=s(o(h-c,0)),u=0;c<h;c++,u++)a(d,u,t[c]);d.length=u;return d}},(t,e,r)=>{"use strict";var i=r(14),n=2147483647,a=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",l=RangeError,c=i(s.exec),h=Math.floor,d=String.fromCharCode,u=i("".charCodeAt),p=i([].join),f=i([].push),g=i("".replace),v=i("".split),m=i("".toLowerCase),digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,e,r){var i=0;t=r?h(t/700):t>>1;t+=h(t/e);for(;t>455;){t=h(t/35);i+=36}return h(i+36*t/(t+38))},encode=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r<i;){var n=u(t,r++);if(n>=55296&&n<=56319&&r<i){var a=u(t,r++);if(56320==(64512&a))f(e,((1023&n)<<10)+(1023&a)+65536);else{f(e,n);r--}}else f(e,n)}return e}(t);var r,i,a=t.length,s=128,c=0,g=72;for(r=0;r<t.length;r++)(i=t[r])<128&&f(e,d(i));var v=e.length,m=v;v&&f(e,"-");for(;m<a;){var _=n;for(r=0;r<t.length;r++)(i=t[r])>=s&&i<_&&(_=i);var y=m+1;if(_-s>h((n-c)/y))throw l(o);c+=(_-s)*y;s=_;for(r=0;r<t.length;r++){if((i=t[r])<s&&++c>n)throw l(o);if(i==s){for(var b=c,A=36;;){var P=A<=g?1:A>=g+26?26:A-g;if(b<P)break;var S=b-P,x=36-P;f(e,d(digitToBasic(P+S%x)));b=h(S/x);A+=36}f(e,d(digitToBasic(b)));g=adapt(c,y,m==v);c=0;m++}}c++;s++}return p(e,"")};t.exports=function(t){var e,r,i=[],n=v(g(m(t),s,"."),".");for(e=0;e<n.length;e++){r=n[e];f(i,c(a,r)?"xn--"+encode(r):r)}return p(i,".")}},t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw e("Not enough arguments");return t}},(t,e,r)=>{"use strict";r(82);var i=r(3),n=r(4),a=r(8),s=r(14),o=r(6),l=r(97),c=r(46),h=r(114),d=r(90),u=r(86),p=r(50),f=r(100),g=r(20),v=r(37),m=r(98),_=r(69),y=r(45),b=r(19),A=r(68),P=r(73),S=r(11),x=r(108),w=r(109),E=r(112),k=r(32),T=r(115),C=k("iterator"),M="URLSearchParams",R="URLSearchParamsIterator",I=p.set,D=p.getterFor(M),O=p.getterFor(R),L=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(t){if(!o)return n[t];var e=L(n,t);return e&&e.value},G=safeGetBuiltIn("fetch"),N=safeGetBuiltIn("Request"),j=safeGetBuiltIn("Headers"),U=N&&N.prototype,B=j&&j.prototype,W=n.RegExp,q=n.TypeError,z=n.decodeURIComponent,V=n.encodeURIComponent,H=s("".charAt),X=s([].join),Y=s([].push),K=s("".replace),J=s([].shift),Q=s([].splice),$=s("".split),Z=s("".slice),tt=/\+/g,et=Array(4),percentSequence=function(t){return et[t-1]||(et[t-1]=W("((?:%[\\da-f]{2}){"+t+"})","gi"))},percentDecode=function(t){try{return z(t)}catch(e){return t}},deserialize=function(t){var e=K(t,tt," "),r=4;try{return z(e)}catch(t){for(;r;)e=K(e,percentSequence(r--),percentDecode);return e}},rt=/[!'()~]|%20/g,it={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return it[t]},serialize=function(t){return K(V(t),rt,replacer)},nt=u((function Iterator(t,e){I(this,{type:R,iterator:x(D(t).entries),kind:e})}),"Iterator",(function next(){var t=O(this),e=t.kind,r=t.iterator.next(),i=r.value;r.done||(r.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]);return r}),!0),URLSearchParamsState=function(t){this.entries=[];this.url=null;void 0!==t&&(b(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===H(t,0)?Z(t,1):t:A(t)))};URLSearchParamsState.prototype={type:M,bindURL:function(t){this.url=t;this.update()},parseObject:function(t){var e,r,i,n,s,o,l,c=w(t);if(c){r=(e=x(t,c)).next;for(;!(i=a(r,e)).done;){s=(n=x(y(i.value))).next;if((o=a(s,n)).done||(l=a(s,n)).done||!a(s,n).done)throw q("Expected sequence with length 2");Y(this.entries,{key:A(o.value),value:A(l.value)})}}else for(var h in t)v(t,h)&&Y(this.entries,{key:h,value:A(t[h])})},parseQuery:function(t){if(t)for(var e,r,i=$(t,"&"),n=0;n<i.length;)if((e=i[n++]).length){r=$(e,"=");Y(this.entries,{key:deserialize(J(r)),value:deserialize(X(r,"="))})}},serialize:function(){for(var t,e=this.entries,r=[],i=0;i<e.length;){t=e[i++];Y(r,serialize(t.key)+"="+serialize(t.value))}return X(r,"&")},update:function(){this.entries.length=0;this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var st=function URLSearchParams(){f(this,ot);var t=arguments.length>0?arguments[0]:void 0;I(this,new URLSearchParamsState(t))},ot=st.prototype;h(ot,{append:function append(t,e){E(arguments.length,2);var r=D(this);Y(r.entries,{key:A(t),value:A(e)});r.updateURL()},delete:function(t){E(arguments.length,1);for(var e=D(this),r=e.entries,i=A(t),n=0;n<r.length;)r[n].key===i?Q(r,n,1):n++;e.updateURL()},get:function get(t){E(arguments.length,1);for(var e=D(this).entries,r=A(t),i=0;i<e.length;i++)if(e[i].key===r)return e[i].value;return null},getAll:function getAll(t){E(arguments.length,1);for(var e=D(this).entries,r=A(t),i=[],n=0;n<e.length;n++)e[n].key===r&&Y(i,e[n].value);return i},has:function has(t){E(arguments.length,1);for(var e=D(this).entries,r=A(t),i=0;i<e.length;)if(e[i++].key===r)return!0;return!1},set:function set(t,e){E(arguments.length,1);for(var r,i=D(this),n=i.entries,a=!1,s=A(t),o=A(e),l=0;l<n.length;l++)if((r=n[l]).key===s)if(a)Q(n,l--,1);else{a=!0;r.value=o}a||Y(n,{key:s,value:o});i.updateURL()},sort:function sort(){var t=D(this);T(t.entries,(function(t,e){return t.key>e.key?1:-1}));t.updateURL()},forEach:function forEach(t){for(var e,r=D(this).entries,i=m(t,arguments.length>1?arguments[1]:void 0),n=0;n<r.length;)i((e=r[n++]).value,e.key,this)},keys:function keys(){return new nt(this,"keys")},values:function values(){return new nt(this,"values")},entries:function entries(){return new nt(this,"entries")}},{enumerable:!0});c(ot,C,ot.entries,{name:"entries"});c(ot,"toString",(function toString(){return D(this).serialize()}),{enumerable:!0});d(st,M);i({global:!0,constructor:!0,forced:!l},{URLSearchParams:st});if(!l&&g(j)){var lt=s(B.has),ct=s(B.set),wrapRequestOptions=function(t){if(b(t)){var e,r=t.body;if(_(r)===M){e=t.headers?new j(t.headers):new j;lt(e,"content-type")||ct(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8");return P(t,{body:S(0,A(r)),headers:S(0,e)})}}return t};g(G)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function fetch(t){return G(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})}});if(g(N)){var ht=function Request(t){f(this,U);return new N(t,arguments.length>1?wrapRequestOptions(arguments[1]):{})};U.constructor=ht;ht.prototype=U;i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ht})}}t.exports={URLSearchParams:st,getState:D}},(t,e,r)=>{var i=r(46);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},(t,e,r)=>{var i=r(110),n=Math.floor,mergeSort=function(t,e){var r=t.length,a=n(r/2);return r<8?insertionSort(t,e):merge(t,mergeSort(i(t,0,a),e),mergeSort(i(t,a),e),e)},insertionSort=function(t,e){for(var r,i,n=t.length,a=1;a<n;){i=a;r=t[a];for(;i&&e(t[i-1],r)>0;)t[i]=t[--i];i!==a++&&(t[i]=r)}return t},merge=function(t,e,r,i){for(var n=e.length,a=r.length,s=0,o=0;s<n||o<a;)t[s+o]=s<n&&o<a?i(e[s],r[o])<=0?e[s++]:r[o++]:s<n?e[s++]:r[o++];return t};t.exports=mergeSort},(t,e,r)=>{r(113)},(t,e,r)=>{r(118)("Uint8",(function(t){return function Uint8Array(e,r,i){return t(this,e,r,i)}}))},(t,e,r)=>{"use strict";var i=r(3),n=r(4),a=r(8),s=r(6),o=r(119),l=r(121),c=r(123),h=r(100),d=r(11),u=r(42),p=r(127),f=r(63),g=r(124),v=r(128),m=r(17),_=r(37),y=r(69),b=r(19),A=r(21),P=r(73),S=r(23),x=r(91),w=r(56).f,E=r(130),k=r(132).forEach,T=r(136),C=r(43),M=r(5),R=r(50),I=r(137),D=R.get,O=R.set,L=R.enforce,G=C.f,N=M.f,j=Math.round,U=n.RangeError,B=c.ArrayBuffer,W=B.prototype,q=c.DataView,z=l.NATIVE_ARRAY_BUFFER_VIEWS,V=l.TYPED_ARRAY_TAG,H=l.TypedArray,X=l.TypedArrayPrototype,Y=l.aTypedArrayConstructor,K=l.isTypedArray,J="BYTES_PER_ELEMENT",Q="Wrong length",fromList=function(t,e){Y(t);for(var r=0,i=e.length,n=new t(i);i>r;)n[r]=e[r++];return n},addGetter=function(t,e){G(t,e,{get:function(){return D(this)[e]}})},isArrayBuffer=function(t){var e;return S(W,t)||"ArrayBuffer"==(e=y(t))||"SharedArrayBuffer"==e},isTypedArrayIndex=function(t,e){return K(t)&&!A(e)&&e in t&&p(+e)&&e>=0},$=function getOwnPropertyDescriptor(t,e){e=m(e);return isTypedArrayIndex(t,e)?d(2,t[e]):N(t,e)},Z=function defineProperty(t,e,r){e=m(e);if(isTypedArrayIndex(t,e)&&b(r)&&_(r,"value")&&!_(r,"get")&&!_(r,"set")&&!r.configurable&&(!_(r,"writable")||r.writable)&&(!_(r,"enumerable")||r.enumerable)){t[e]=r.value;return t}return G(t,e,r)};if(s){if(!z){M.f=$;C.f=Z;addGetter(X,"buffer");addGetter(X,"byteOffset");addGetter(X,"byteLength");addGetter(X,"length")}i({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:$,defineProperty:Z});t.exports=function(t,e,r){var s=t.match(/\d+$/)[0]/8,l=t+(r?"Clamped":"")+"Array",c="get"+t,d="set"+t,p=n[l],m=p,_=m&&m.prototype,y={},addElement=function(t,e){G(t,e,{get:function(){return function(t,e){var r=D(t);return r.view[c](e*s+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var n=D(t);r&&(i=(i=j(i))<0?0:i>255?255:255&i);n.view[d](e*s+n.byteOffset,i,!0)}(this,e,t)},enumerable:!0})};if(z){if(o){m=e((function(t,e,r,i){h(t,_);return I(b(e)?isArrayBuffer(e)?void 0!==i?new p(e,v(r,s),i):void 0!==r?new p(e,v(r,s)):new p(e):K(e)?fromList(m,e):a(E,m,e):new p(g(e)),t,m)}));x&&x(m,H);k(w(p),(function(t){t in m||u(m,t,p[t])}));m.prototype=_}}else{m=e((function(t,e,r,i){h(t,_);var n,o,l,c=0,d=0;if(b(e)){if(!isArrayBuffer(e))return K(e)?fromList(m,e):a(E,m,e);n=e;d=v(r,s);var u=e.byteLength;if(void 0===i){if(u%s)throw U(Q);if((o=u-d)<0)throw U(Q)}else if((o=f(i)*s)+d>u)throw U(Q);l=o/s}else{l=g(e);n=new B(o=l*s)}O(t,{buffer:n,byteOffset:d,byteLength:o,length:l,view:new q(n)});for(;c<l;)addElement(t,c++)}));x&&x(m,H);_=m.prototype=P(X)}_.constructor!==m&&u(_,"constructor",m);L(_).TypedArrayConstructor=m;V&&u(_,V,l);var A=m!=p;y[l]=m;i({global:!0,constructor:!0,forced:A,sham:!z},y);J in m||u(m,J,s);J in _||u(_,J,s);T(l)}}else t.exports=function(){}},(t,e,r)=>{var i=r(4),n=r(7),a=r(120),s=r(121).NATIVE_ARRAY_BUFFER_VIEWS,o=i.ArrayBuffer,l=i.Int8Array;t.exports=!s||!n((function(){l(1)}))||!n((function(){new l(-1)}))||!a((function(t){new l;new l(null);new l(1.5);new l(t)}),!0)||n((function(){return 1!==new l(new o(2),1,void 0).length}))},(t,e,r)=>{var i=r(32)("iterator"),n=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){n=!0}};s[i]=function(){return this};Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var a={};a[i]=function(){return{next:function(){return{done:r=!0}}}};t(a)}catch(t){}return r}},(t,e,r)=>{"use strict";var i,n,a,s=r(122),o=r(6),l=r(4),c=r(20),h=r(19),d=r(37),u=r(69),p=r(30),f=r(42),g=r(46),v=r(43).f,m=r(23),_=r(88),y=r(91),b=r(32),A=r(39),P=r(50),S=P.enforce,x=P.get,w=l.Int8Array,E=w&&w.prototype,k=l.Uint8ClampedArray,T=k&&k.prototype,C=w&&_(w),M=E&&_(E),R=Object.prototype,I=l.TypeError,D=b("toStringTag"),O=A("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",G=s&&!!y&&"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},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=_(t);if(h(e)){var r=x(e);return r&&d(r,L)?r.TypedArrayConstructor:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!h(t))return!1;var e=u(t);return d(j,e)||d(U,e)};for(i in j)(a=(n=l[i])&&n.prototype)?S(a).TypedArrayConstructor=n:G=!1;for(i in U)(a=(n=l[i])&&n.prototype)&&(S(a).TypedArrayConstructor=n);if(!G||!c(C)||C===Function.prototype){C=function TypedArray(){throw I("Incorrect invocation")};if(G)for(i in j)l[i]&&y(l[i],C)}if(!G||!M||M===R){M=C.prototype;if(G)for(i in j)l[i]&&y(l[i].prototype,M)}G&&_(T)!==M&&y(T,M);if(o&&!d(M,D)){N=!0;v(M,D,{get:function(){return h(this)?this[O]:void 0}});for(i in j)l[i]&&f(l[i],O,i)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:G,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)&&(!y||m(C,t)))return t;throw I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,i){if(o){if(r)for(var n in j){var a=l[n];if(a&&d(a.prototype,t))try{delete a.prototype[t]}catch(r){try{a.prototype[t]=e}catch(t){}}}M[t]&&!r||g(M,t,r?e:G&&E[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,n;if(o){if(y){if(r)for(i in j)if((n=l[i])&&d(n,t))try{delete n[t]}catch(t){}if(C[t]&&!r)return;try{return g(C,t,r?e:G&&C[t]||e)}catch(t){}}for(i in j)!(n=l[i])||n[t]&&!r||g(n,t,e)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!h(t))return!1;var e=u(t);return"DataView"===e||d(j,e)||d(U,e)},isTypedArray:isTypedArray,TypedArray:C,TypedArrayPrototype:M}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{"use strict";var i=r(4),n=r(14),a=r(6),s=r(122),o=r(48),l=r(42),c=r(114),h=r(7),d=r(100),u=r(60),p=r(63),f=r(124),g=r(125),v=r(88),m=r(91),_=r(56).f,y=r(43).f,b=r(126),A=r(110),P=r(90),S=r(50),x=o.PROPER,w=o.CONFIGURABLE,E=S.get,k=S.set,T="ArrayBuffer",C="DataView",M="Wrong index",R=i.ArrayBuffer,I=R,D=I&&I.prototype,O=i.DataView,L=O&&O.prototype,G=Object.prototype,N=i.Array,j=i.RangeError,U=n(b),B=n([].reverse),W=g.pack,q=g.unpack,packInt8=function(t){return[255&t]},packInt16=function(t){return[255&t,t>>8&255]},packInt32=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},unpackInt32=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},packFloat32=function(t){return W(t,23,4)},packFloat64=function(t){return W(t,52,8)},addGetter=function(t,e){y(t.prototype,e,{get:function(){return E(this)[e]}})},get=function(t,e,r,i){var n=f(r),a=E(t);if(n+e>a.byteLength)throw j(M);var s=E(a.buffer).bytes,o=n+a.byteOffset,l=A(s,o,o+e);return i?l:B(l)},set=function(t,e,r,i,n,a){var s=f(r),o=E(t);if(s+e>o.byteLength)throw j(M);for(var l=E(o.buffer).bytes,c=s+o.byteOffset,h=i(+n),d=0;d<e;d++)l[c+d]=h[a?d:e-d-1]};if(s){var z=x&&R.name!==T;if(h((function(){R(1)}))&&h((function(){new R(-1)}))&&!h((function(){new R;new R(1.5);new R(NaN);return z&&!w})))z&&w&&l(R,"name",T);else{(I=function ArrayBuffer(t){d(this,D);return new R(f(t))}).prototype=D;for(var V,H=_(R),X=0;H.length>X;)(V=H[X++])in I||l(I,V,R[V]);D.constructor=I}m&&v(L)!==G&&m(L,G);var Y=new O(new I(2)),K=n(L.setInt8);Y.setInt8(0,2147483648);Y.setInt8(1,2147483649);!Y.getInt8(0)&&Y.getInt8(1)||c(L,{setInt8:function setInt8(t,e){K(this,t,e<<24>>24)},setUint8:function setUint8(t,e){K(this,t,e<<24>>24)}},{unsafe:!0})}else{D=(I=function ArrayBuffer(t){d(this,D);var e=f(t);k(this,{bytes:U(N(e),0),byteLength:e});a||(this.byteLength=e)}).prototype;L=(O=function DataView(t,e,r){d(this,L);d(t,D);var i=E(t).byteLength,n=u(e);if(n<0||n>i)throw j("Wrong offset");if(n+(r=void 0===r?i-n:p(r))>i)throw j("Wrong length");k(this,{buffer:t,byteLength:r,byteOffset:n});if(!a){this.buffer=t;this.byteLength=r;this.byteOffset=n}}).prototype;if(a){addGetter(I,"byteLength");addGetter(O,"buffer");addGetter(O,"byteLength");addGetter(O,"byteOffset")}c(L,{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var e=get(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function getUint16(t){var e=get(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function getInt32(t){return unpackInt32(get(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function getUint32(t){return unpackInt32(get(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function getFloat32(t){return q(get(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function getFloat64(t){return q(get(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function setInt8(t,e){set(this,1,t,packInt8,e)},setUint8:function setUint8(t,e){set(this,1,t,packInt8,e)},setInt16:function setInt16(t,e){set(this,2,t,packInt16,e,arguments.length>2?arguments[2]:void 0)},setUint16:function setUint16(t,e){set(this,2,t,packInt16,e,arguments.length>2?arguments[2]:void 0)},setInt32:function setInt32(t,e){set(this,4,t,packInt32,e,arguments.length>2?arguments[2]:void 0)},setUint32:function setUint32(t,e){set(this,4,t,packInt32,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function setFloat32(t,e){set(this,4,t,packFloat32,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function setFloat64(t,e){set(this,8,t,packFloat64,e,arguments.length>2?arguments[2]:void 0)}})}P(I,T);P(O,C);t.exports={ArrayBuffer:I,DataView:O}},(t,e,r)=>{var i=r(60),n=r(63),a=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),r=n(e);if(e!==r)throw a("Wrong length or index");return r}},t=>{var e=Array,r=Math.abs,i=Math.pow,n=Math.floor,a=Math.log,s=Math.LN2;t.exports={pack:function(t,o,l){var c,h,d,u=e(l),p=8*l-o-1,f=(1<<p)-1,g=f>>1,v=23===o?i(2,-24)-i(2,-77):0,m=t<0||0===t&&1/t<0?1:0,_=0;if((t=r(t))!=t||t===1/0){h=t!=t?1:0;c=f}else{c=n(a(t)/s);if(t*(d=i(2,-c))<1){c--;d*=2}if((t+=c+g>=1?v/d:v*i(2,1-g))*d>=2){c++;d/=2}if(c+g>=f){h=0;c=f}else if(c+g>=1){h=(t*d-1)*i(2,o);c+=g}else{h=t*i(2,g-1)*i(2,o);c=0}}for(;o>=8;){u[_++]=255&h;h/=256;o-=8}c=c<<o|h;p+=o;for(;p>0;){u[_++]=255&c;c/=256;p-=8}u[--_]|=128*m;return u},unpack:function(t,e){var r,n=t.length,a=8*n-e-1,s=(1<<a)-1,o=s>>1,l=a-7,c=n-1,h=t[c--],d=127&h;h>>=7;for(;l>0;){d=256*d+t[c--];l-=8}r=d&(1<<-l)-1;d>>=-l;l+=e;for(;l>0;){r=256*r+t[c--];l-=8}if(0===d)d=1-o;else{if(d===s)return r?NaN:h?-1/0:1/0;r+=i(2,e);d-=o}return(h?-1:1)*r*i(2,d-e)}}},(t,e,r)=>{"use strict";var i=r(38),n=r(59),a=r(62);t.exports=function fill(t){for(var e=i(this),r=a(e),s=arguments.length,o=n(s>1?arguments[1]:void 0,r),l=s>2?arguments[2]:void 0,c=void 0===l?r:n(l,r);c>o;)e[o++]=t;return e}},(t,e,r)=>{var i=r(19),n=Math.floor;t.exports=Number.isInteger||function isInteger(t){return!i(t)&&isFinite(t)&&n(t)===t}},(t,e,r)=>{var i=r(129),n=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw n("Wrong offset");return r}},(t,e,r)=>{var i=r(60),n=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw n("The argument can't be less than 0");return e}},(t,e,r)=>{var i=r(98),n=r(8),a=r(131),s=r(38),o=r(62),l=r(108),c=r(109),h=r(105),d=r(121).aTypedArrayConstructor;t.exports=function from(t){var e,r,u,p,f,g,v=a(this),m=s(t),_=arguments.length,y=_>1?arguments[1]:void 0,b=void 0!==y,A=c(m);if(A&&!h(A)){g=(f=l(m,A)).next;m=[];for(;!(p=n(g,f)).done;)m.push(p.value)}b&&_>2&&(y=i(y,arguments[2]));r=o(m);u=new(d(v))(r);for(e=0;r>e;e++)u[e]=b?y(m[e],e):m[e];return u}},(t,e,r)=>{var i=r(106),n=r(30),a=TypeError;t.exports=function(t){if(i(t))return t;throw a(n(t)+" is not a constructor")}},(t,e,r)=>{var i=r(98),n=r(14),a=r(13),s=r(38),o=r(62),l=r(133),c=n([].push),createMethod=function(t){var e=1==t,r=2==t,n=3==t,h=4==t,d=6==t,u=7==t,p=5==t||d;return function(f,g,v,m){for(var _,y,b=s(f),A=a(b),P=i(g,v),S=o(A),x=0,w=m||l,E=e?w(f,S):r||u?w(f,0):void 0;S>x;x++)if(p||x in A){y=P(_=A[x],x,b);if(t)if(e)E[x]=y;else if(y)switch(t){case 3:return!0;case 5:return _;case 6:return x;case 2:c(E,_)}else switch(t){case 4:return!1;case 7:c(E,_)}}return d?-1:n||h?h:E}};t.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},(t,e,r)=>{var i=r(134);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},(t,e,r)=>{var i=r(135),n=r(106),a=r(19),s=r(32)("species"),o=Array;t.exports=function(t){var e;if(i(t)){e=t.constructor;(n(e)&&(e===o||i(e.prototype))||a(e)&&null===(e=e[s]))&&(e=void 0)}return void 0===e?o:e}},(t,e,r)=>{var i=r(15);t.exports=Array.isArray||function isArray(t){return"Array"==i(t)}},(t,e,r)=>{"use strict";var i=r(22),n=r(43),a=r(32),s=r(6),o=a("species");t.exports=function(t){var e=i(t),r=n.f;s&&e&&!e[o]&&r(e,o,{configurable:!0,get:function(){return this}})}},(t,e,r)=>{var i=r(20),n=r(19),a=r(91);t.exports=function(t,e,r){var s,o;a&&i(s=e.constructor)&&s!==r&&n(o=s.prototype)&&o!==r.prototype&&a(t,o);return t}},(t,e,r)=>{"use strict";var i=r(121),n=r(126),a=r(139),s=r(69),o=r(8),l=r(14),c=r(7),h=i.aTypedArray,d=i.exportTypedArrayMethod,u=l("".slice);d("fill",(function fill(t){var e=arguments.length;h(this);var r="Big"===u(s(this),0,3)?a(t):+t;return o(n,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;new Int8Array(2).fill({valueOf:function(){return t++}});return 1!==t})))},(t,e,r)=>{var i=r(18),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw n("Can't convert number to bigint");return BigInt(e)}},(t,e,r)=>{"use strict";var i=r(4),n=r(8),a=r(121),s=r(62),o=r(128),l=r(38),c=r(7),h=i.RangeError,d=i.Int8Array,u=d&&d.prototype,p=u&&u.set,f=a.aTypedArray,g=a.exportTypedArrayMethod,v=!c((function(){var t=new Uint8ClampedArray(2);n(p,t,{length:1,0:3},1);return 3!==t[1]})),m=v&&a.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new d(2);t.set(1);t.set("2",1);return 0!==t[0]||2!==t[1]}));g("set",(function set(t){f(this);var e=o(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(v)return n(p,this,r,e);var i=this.length,a=s(r),c=0;if(a+e>i)throw h("Wrong length");for(;c<a;)this[e+c]=r[c++]}),!v||m)},(t,e,r)=>{"use strict";var i=r(4),n=r(14),a=r(7),s=r(29),o=r(115),l=r(121),c=r(142),h=r(143),d=r(26),u=r(144),p=l.aTypedArray,f=l.exportTypedArrayMethod,g=i.Uint16Array,v=g&&n(g.prototype.sort),m=!(!v||a((function(){v(new g(2),null)}))&&a((function(){v(new g(2),{})}))),_=!!v&&!a((function(){if(d)return d<74;if(c)return c<67;if(h)return!0;if(u)return u<602;var t,e,r=new g(516),i=Array(516);for(t=0;t<516;t++){e=t%4;r[t]=515-t;i[t]=t-2*e+3}v(r,(function(t,e){return(t/4|0)-(e/4|0)}));for(t=0;t<516;t++)if(r[t]!==i[t])return!0}));f("sort",(function sort(t){void 0!==t&&s(t);return _?v(this,t):o(p(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!_||m)},(t,e,r)=>{var i=r(27).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},(t,e,r)=>{var i=r(27);t.exports=/MSIE|Trident/.test(i)},(t,e,r)=>{var i=r(27).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},(t,e,r)=>{r(118)("Uint32",(function(t){return function Uint32Array(e,r,i){return t(this,e,r,i)}}))},(t,e,r)=>{"use strict";var i=r(147),n=r(8),a=r(14),s=r(148),o=r(7),l=r(45),c=r(20),h=r(60),d=r(63),u=r(68),p=r(16),f=r(149),g=r(28),v=r(150),m=r(151),_=r(32)("replace"),y=Math.max,b=Math.min,A=a([].concat),P=a([].push),S=a("".indexOf),x=a("".slice),w="$0"==="a".replace(/./,"$0"),E=!!/./[_]&&""===/./[_]("a","$0");s("replace",(function(t,e,r){var a=E?"$":"$0";return[function replace(t,r){var i=p(this),a=null==t?void 0:g(t,_);return a?n(a,t,i,r):n(e,u(i),t,r)},function(t,n){var s=l(this),o=u(t);if("string"==typeof n&&-1===S(n,a)&&-1===S(n,"$<")){var p=r(e,s,o,n);if(p.done)return p.value}var g=c(n);g||(n=u(n));var _=s.global;if(_){var w=s.unicode;s.lastIndex=0}for(var E=[];;){var k=m(s,o);if(null===k)break;P(E,k);if(!_)break;""===u(k[0])&&(s.lastIndex=f(o,d(s.lastIndex),w))}for(var T,C="",M=0,R=0;R<E.length;R++){for(var I=u((k=E[R])[0]),D=y(b(h(k.index),o.length),0),O=[],L=1;L<k.length;L++)P(O,void 0===(T=k[L])?T:String(T));var G=k.groups;if(g){var N=A([I],O,D,o);void 0!==G&&P(N,G);var j=u(i(n,void 0,N))}else j=v(I,o,D,O,G,n);if(D>=M){C+=x(o,M,D)+j;M=D+I.length}}return C+x(o,M)}]}),!!o((function(){var t=/./;t.exec=function(){var t=[];t.groups={a:"7"};return t};return"7"!=="".replace(t,"$<a>")}))||!w||E)},(t,e,r)=>{var i=r(9),n=Function.prototype,a=n.apply,s=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(a):function(){return s.apply(a,arguments)})},(t,e,r)=>{"use strict";r(2);var i=r(14),n=r(46),a=r(67),s=r(7),o=r(32),l=r(42),c=o("species"),h=RegExp.prototype;t.exports=function(t,e,r,d){var u=o(t),p=!s((function(){var e={};e[u]=function(){return 7};return 7!=""[t](e)})),f=p&&!s((function(){var e=!1,r=/a/;if("split"===t){(r={}).constructor={};r.constructor[c]=function(){return r};r.flags="";r[u]=/./[u]}r.exec=function(){e=!0;return null};r[u]("");return!e}));if(!p||!f||r){var g=i(/./[u]),v=e(u,""[t],(function(t,e,r,n,s){var o=i(t),l=e.exec;return l===a||l===h.exec?p&&!s?{done:!0,value:g(e,r,n)}:{done:!0,value:o(r,e,n)}:{done:!1}}));n(String.prototype,t,v[0]);n(h,u,v[1])}d&&l(h[u],"sham",!0)}},(t,e,r)=>{"use strict";var i=r(96).charAt;t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},(t,e,r)=>{var i=r(14),n=r(38),a=Math.floor,s=i("".charAt),o=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,i,d,u){var p=r+t.length,f=i.length,g=h;if(void 0!==d){d=n(d);g=c}return o(u,g,(function(n,o){var c;switch(s(o,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,p);case"<":c=d[l(o,1,-1)];break;default:var h=+o;if(0===h)return n;if(h>f){var u=a(h/10);return 0===u?n:u<=f?void 0===i[u-1]?s(o,1):i[u-1]+s(o,1):n}c=i[h-1]}return void 0===c?"":c}))}},(t,e,r)=>{var i=r(8),n=r(45),a=r(20),s=r(15),o=r(67),l=TypeError;t.exports=function(t,e){var r=t.exec;if(a(r)){var c=i(r,t,e);null!==c&&n(c);return c}if("RegExp"===s(t))return i(o,t,e);throw l("RegExp#exec called on incompatible receiver")}},(t,e,r)=>{r(153);r(169);r(172);r(173);r(174);r(175)},(t,e,r)=>{"use strict";var i,n,a,s=r(3),o=r(34),l=r(154),c=r(4),h=r(8),d=r(46),u=r(91),p=r(90),f=r(136),g=r(29),v=r(20),m=r(19),_=r(100),y=r(155),b=r(156).set,A=r(159),P=r(162),S=r(163),x=r(164),w=r(50),E=r(165),k=r(166),T=r(168),C="Promise",M=k.CONSTRUCTOR,R=k.REJECTION_EVENT,I=k.SUBCLASSING,D=w.getterFor(C),O=w.set,L=E&&E.prototype,G=E,N=L,j=c.TypeError,U=c.document,B=c.process,W=T.f,q=W,z=!!(U&&U.createEvent&&c.dispatchEvent),V="unhandledrejection",isThenable=function(t){var e;return!(!m(t)||!v(e=t.then))&&e},callReaction=function(t,e){var r,i,n,a=e.value,s=1==e.state,o=s?t.ok:t.fail,l=t.resolve,c=t.reject,d=t.domain;try{if(o){if(!s){2===e.rejection&&onHandleUnhandled(e);e.rejection=1}if(!0===o)r=a;else{d&&d.enter();r=o(a);if(d){d.exit();n=!0}}r===t.promise?c(j("Promise-chain cycle")):(i=isThenable(r))?h(i,r,l,c):l(r)}else c(a)}catch(t){d&&!n&&d.exit();c(t)}},notify=function(t,e){if(!t.notified){t.notified=!0;A((function(){for(var r,i=t.reactions;r=i.get();)callReaction(r,t);t.notified=!1;e&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,e,r){var i,n;if(z){(i=U.createEvent("Event")).promise=e;i.reason=r;i.initEvent(t,!1,!0);c.dispatchEvent(i)}else i={promise:e,reason:r};!R&&(n=c["on"+t])?n(i):t===V&&P("Unhandled promise rejection",r)},onUnhandled=function(t){h(b,c,(function(){var e,r=t.facade,i=t.value;if(isUnhandled(t)){e=S((function(){l?B.emit("unhandledRejection",i,r):dispatchEvent(V,r,i)}));t.rejection=l||isUnhandled(t)?2:1;if(e.error)throw e.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){h(b,c,(function(){var e=t.facade;l?B.emit("rejectionHandled",e):dispatchEvent("rejectionhandled",e,t.value)}))},bind=function(t,e,r){return function(i){t(e,i,r)}},internalReject=function(t,e,r){if(!t.done){t.done=!0;r&&(t=r);t.value=e;t.state=2;notify(t,!0)}},internalResolve=function(t,e,r){if(!t.done){t.done=!0;r&&(t=r);try{if(t.facade===e)throw j("Promise can't be resolved itself");var i=isThenable(e);if(i)A((function(){var r={done:!1};try{h(i,e,bind(internalResolve,r,t),bind(internalReject,r,t))}catch(e){internalReject(r,e,t)}}));else{t.value=e;t.state=1;notify(t,!1)}}catch(e){internalReject({done:!1},e,t)}}};if(M){N=(G=function Promise(t){_(this,N);g(t);h(i,this);var e=D(this);try{t(bind(internalResolve,e),bind(internalReject,e))}catch(t){internalReject(e,t)}}).prototype;(i=function Promise(t){O(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:void 0})}).prototype=d(N,"then",(function then(t,e){var r=D(this),i=W(y(this,G));r.parent=!0;i.ok=!v(t)||t;i.fail=v(e)&&e;i.domain=l?B.domain:void 0;0==r.state?r.reactions.add(i):A((function(){callReaction(i,r)}));return i.promise}));n=function(){var t=new i,e=D(t);this.promise=t;this.resolve=bind(internalResolve,e);this.reject=bind(internalReject,e)};T.f=W=function(t){return t===G||undefined===t?new n(t):q(t)};if(!o&&v(E)&&L!==Object.prototype){a=L.then;I||d(L,"then",(function then(t,e){var r=this;return new G((function(t,e){h(a,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete L.constructor}catch(t){}u&&u(L,N)}}s({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:G});p(G,C,!1,!0);f(C)},(t,e,r)=>{var i=r(15),n=r(4);t.exports="process"==i(n.process)},(t,e,r)=>{var i=r(45),n=r(131),a=r(32)("species");t.exports=function(t,e){var r,s=i(t).constructor;return void 0===s||null==(r=i(s)[a])?e:n(r)}},(t,e,r)=>{var i,n,a,s,o=r(4),l=r(147),c=r(98),h=r(20),d=r(37),u=r(7),p=r(76),f=r(157),g=r(41),v=r(112),m=r(158),_=r(154),y=o.setImmediate,b=o.clearImmediate,A=o.process,P=o.Dispatch,S=o.Function,x=o.MessageChannel,w=o.String,E=0,k={},T="onreadystatechange";try{i=o.location}catch(t){}var run=function(t){if(d(k,t)){var e=k[t];delete k[t];e()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){o.postMessage(w(t),i.protocol+"//"+i.host)};if(!y||!b){y=function setImmediate(t){v(arguments.length,1);var e=h(t)?t:S(t),r=f(arguments,1);k[++E]=function(){l(e,void 0,r)};n(E);return E};b=function clearImmediate(t){delete k[t]};if(_)n=function(t){A.nextTick(runner(t))};else if(P&&P.now)n=function(t){P.now(runner(t))};else if(x&&!m){s=(a=new x).port2;a.port1.onmessage=listener;n=c(s.postMessage,s)}else if(o.addEventListener&&h(o.postMessage)&&!o.importScripts&&i&&"file:"!==i.protocol&&!u(post)){n=post;o.addEventListener("message",listener,!1)}else n=T in g("script")?function(t){p.appendChild(g("script")).onreadystatechange=function(){p.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:y,clear:b}},(t,e,r)=>{var i=r(14);t.exports=i([].slice)},(t,e,r)=>{var i=r(27);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},(t,e,r)=>{var i,n,a,s,o,l,c,h,d=r(4),u=r(98),p=r(5).f,f=r(156).set,g=r(158),v=r(160),m=r(161),_=r(154),y=d.MutationObserver||d.WebKitMutationObserver,b=d.document,A=d.process,P=d.Promise,S=p(d,"queueMicrotask"),x=S&&S.value;if(!x){i=function(){var t,e;_&&(t=A.domain)&&t.exit();for(;n;){e=n.fn;n=n.next;try{e()}catch(t){n?s():a=void 0;throw t}}a=void 0;t&&t.enter()};if(g||_||m||!y||!b)if(!v&&P&&P.resolve){(c=P.resolve(void 0)).constructor=P;h=u(c.then,c);s=function(){h(i)}}else if(_)s=function(){A.nextTick(i)};else{f=u(f,d);s=function(){f(i)}}else{o=!0;l=b.createTextNode("");new y(i).observe(l,{characterData:!0});s=function(){l.data=o=!o}}}t.exports=x||function(t){var e={fn:t,next:void 0};a&&(a.next=e);if(!n){n=e;s()}a=e}},(t,e,r)=>{var i=r(27),n=r(4);t.exports=/ipad|iphone|ipod/i.test(i)&&void 0!==n.Pebble},(t,e,r)=>{var i=r(27);t.exports=/web0s(?!.*chrome)/i.test(i)},(t,e,r)=>{var i=r(4);t.exports=function(t,e){var r=i.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))}},t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},t=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e;this.tail=e},get:function(){var t=this.head;if(t){this.head=t.next;this.tail===t&&(this.tail=null);return t.item}}};t.exports=Queue},(t,e,r)=>{var i=r(4);t.exports=i.Promise},(t,e,r)=>{var i=r(4),n=r(165),a=r(20),s=r(66),o=r(49),l=r(32),c=r(167),h=r(34),d=r(26),u=n&&n.prototype,p=l("species"),f=!1,g=a(i.PromiseRejectionEvent),v=s("Promise",(function(){var t=o(n),e=t!==String(n);if(!e&&66===d)return!0;if(h&&(!u.catch||!u.finally))return!0;if(d>=51&&/native code/.test(t))return!1;var r=new n((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};(r.constructor={})[p]=FakePromise;return!(f=r.then((function(){}))instanceof FakePromise)||!e&&c&&!g}));t.exports={CONSTRUCTOR:v,REJECTION_EVENT:g,SUBCLASSING:f}},t=>{t.exports="object"==typeof window&&"object"!=typeof Deno},(t,e,r)=>{"use strict";var i=r(29),PromiseCapability=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t;r=i}));this.resolve=i(e);this.reject=i(r)};t.exports.f=function(t){return new PromiseCapability(t)}},(t,e,r)=>{"use strict";var i=r(3),n=r(8),a=r(29),s=r(168),o=r(163),l=r(170);i({target:"Promise",stat:!0,forced:r(171)},{all:function all(t){var e=this,r=s.f(e),i=r.resolve,c=r.reject,h=o((function(){var r=a(e.resolve),s=[],o=0,h=1;l(t,(function(t){var a=o++,l=!1;h++;n(r,e,t).then((function(t){if(!l){l=!0;s[a]=t;--h||i(s)}}),c)}));--h||i(s)}));h.error&&c(h.value);return r.promise}})},(t,e,r)=>{var i=r(98),n=r(8),a=r(45),s=r(30),o=r(105),l=r(62),c=r(23),h=r(108),d=r(109),u=r(104),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},f=Result.prototype;t.exports=function(t,e,r){var g,v,m,_,y,b,A,P=r&&r.that,S=!(!r||!r.AS_ENTRIES),x=!(!r||!r.IS_RECORD),w=!(!r||!r.IS_ITERATOR),E=!(!r||!r.INTERRUPTED),k=i(e,P),stop=function(t){g&&u(g,"normal",t);return new Result(!0,t)},callFn=function(t){if(S){a(t);return E?k(t[0],t[1],stop):k(t[0],t[1])}return E?k(t,stop):k(t)};if(x)g=t.iterator;else if(w)g=t;else{if(!(v=d(t)))throw p(s(t)+" is not iterable");if(o(v)){for(m=0,_=l(t);_>m;m++)if((y=callFn(t[m]))&&c(f,y))return y;return new Result(!1)}g=h(t,v)}b=x?t.next:g.next;for(;!(A=n(b,g)).done;){try{y=callFn(A.value)}catch(t){u(g,"throw",t)}if("object"==typeof y&&y&&c(f,y))return y}return new Result(!1)}},(t,e,r)=>{var i=r(165),n=r(120),a=r(166).CONSTRUCTOR;t.exports=a||!n((function(t){i.all(t).then(void 0,(function(){}))}))},(t,e,r)=>{"use strict";var i=r(3),n=r(34),a=r(166).CONSTRUCTOR,s=r(165),o=r(22),l=r(20),c=r(46),h=s&&s.prototype;i({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(t){return this.then(void 0,t)}});if(!n&&l(s)){var d=o("Promise").prototype.catch;h.catch!==d&&c(h,"catch",d,{unsafe:!0})}},(t,e,r)=>{"use strict";var i=r(3),n=r(8),a=r(29),s=r(168),o=r(163),l=r(170);i({target:"Promise",stat:!0,forced:r(171)},{race:function race(t){var e=this,r=s.f(e),i=r.reject,c=o((function(){var s=a(e.resolve);l(t,(function(t){n(s,e,t).then(r.resolve,i)}))}));c.error&&i(c.value);return r.promise}})},(t,e,r)=>{"use strict";var i=r(3),n=r(8),a=r(168);i({target:"Promise",stat:!0,forced:r(166).CONSTRUCTOR},{reject:function reject(t){var e=a.f(this);n(e.reject,void 0,t);return e.promise}})},(t,e,r)=>{"use strict";var i=r(3),n=r(22),a=r(34),s=r(165),o=r(166).CONSTRUCTOR,l=r(176),c=n("Promise"),h=a&&!o;i({target:"Promise",stat:!0,forced:a||o},{resolve:function resolve(t){return l(h&&this===c?s:this,t)}})},(t,e,r)=>{var i=r(45),n=r(19),a=r(168);t.exports=function(t,e){i(t);if(n(e)&&e.constructor===t)return e;var r=a.f(t);(0,r.resolve)(e);return r.promise}},(t,e,r)=>{"use strict";r(117);r(138);r(140);r(141);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){globalThis.btoa}();!function checkNodeAtob(){globalThis.atob}();!function checkDOMMatrix(){globalThis.DOMMatrix}();!function checkReadableStream(){globalThis.ReadableStream}();!function checkArrayAt(){Array.prototype.at||r(178)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||r(181)}();!function checkStructuredClone(){globalThis.structuredClone||r(183)}()}},(t,e,r)=>{r(179);var i=r(180);t.exports=i("Array","at")},(t,e,r)=>{"use strict";var i=r(3),n=r(38),a=r(62),s=r(60),o=r(83);i({target:"Array",proto:!0},{at:function at(t){var e=n(this),r=a(e),i=s(t),o=i>=0?i:r+i;return o<0||o>=r?void 0:e[o]}});o("at")},(t,e,r)=>{var i=r(4),n=r(14);t.exports=function(t,e){return n(i[t].prototype[e])}},(t,e,r)=>{r(182)},(t,e,r)=>{"use strict";var i=r(121),n=r(62),a=r(60),s=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function at(t){var e=s(this),r=n(e),i=a(t),o=i>=0?i:r+i;return o<0||o>=r?void 0:e[o]}))},(t,e,r)=>{r(82);r(184);r(186);r(195);r(197);var i=r(201);t.exports=i.structuredClone},(t,e,r)=>{var i=r(70),n=r(46),a=r(185);i||n(Object.prototype,"toString",a,{unsafe:!0})},(t,e,r)=>{"use strict";var i=r(70),n=r(69);t.exports=i?{}.toString:function toString(){return"[object "+n(this)+"]"}},(t,e,r)=>{r(187)},(t,e,r)=>{"use strict";r(188)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),r(194))},(t,e,r)=>{"use strict";var i=r(3),n=r(4),a=r(14),s=r(66),o=r(46),l=r(189),c=r(170),h=r(100),d=r(20),u=r(19),p=r(7),f=r(120),g=r(90),v=r(137);t.exports=function(t,e,r){var m=-1!==t.indexOf("Map"),_=-1!==t.indexOf("Weak"),y=m?"set":"add",b=n[t],A=b&&b.prototype,P=b,S={},fixMethod=function(t){var e=a(A[t]);o(A,t,"add"==t?function add(t){e(this,0===t?0:t);return this}:"delete"==t?function(t){return!(_&&!u(t))&&e(this,0===t?0:t)}:"get"==t?function get(t){return _&&!u(t)?void 0:e(this,0===t?0:t)}:"has"==t?function has(t){return!(_&&!u(t))&&e(this,0===t?0:t)}:function set(t,r){e(this,0===t?0:t,r);return this})};if(s(t,!d(b)||!(_||A.forEach&&!p((function(){(new b).entries().next()}))))){P=r.getConstructor(e,t,m,y);l.enable()}else if(s(t,!0)){var x=new P,w=x[y](_?{}:-0,1)!=x,E=p((function(){x.has(1)})),k=f((function(t){new b(t)})),T=!_&&p((function(){for(var t=new b,e=5;e--;)t[y](e,e);return!t.has(-0)}));if(!k){(P=e((function(t,e){h(t,A);var r=v(new b,t,P);null!=e&&c(e,r[y],{that:r,AS_ENTRIES:m});return r}))).prototype=A;A.constructor=P}if(E||T){fixMethod("delete");fixMethod("has");m&&fixMethod("get")}(T||w)&&fixMethod(y);_&&A.clear&&delete A.clear}S[t]=P;i({global:!0,constructor:!0,forced:P!=b},S);g(P,t);_||r.setStrong(P,t,m);return P}},(t,e,r)=>{var i=r(3),n=r(14),a=r(53),s=r(19),o=r(37),l=r(43).f,c=r(56),h=r(190),d=r(191),u=r(39),p=r(193),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=n([].splice),r={};r[g]=1;if(t(r).length){c.f=function(r){for(var i=t(r),n=0,a=i.length;n<a;n++)if(i[n]===g){e(i,n,1);break}return i};i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f})}},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,g)){if(!d(t))return"F";if(!e)return"E";setMetadata(t)}return t[g].objectID},getWeakData:function(t,e){if(!o(t,g)){if(!d(t))return!0;if(!e)return!1;setMetadata(t)}return t[g].weakData},onFreeze:function(t){p&&f&&d(t)&&!o(t,g)&&setMetadata(t);return t}};a[g]=!0},(t,e,r)=>{var i=r(15),n=r(12),a=r(56).f,s=r(110),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return o&&"Window"==i(t)?function(t){try{return a(t)}catch(t){return s(o)}}(t):a(n(t))}},(t,e,r)=>{var i=r(7),n=r(19),a=r(15),s=r(192),o=Object.isExtensible,l=i((function(){o(1)}));t.exports=l||s?function isExtensible(t){return!!n(t)&&((!s||"ArrayBuffer"!=a(t))&&(!o||o(t)))}:o},(t,e,r)=>{var i=r(7);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,e,r)=>{var i=r(7);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,e,r)=>{"use strict";var i=r(43).f,n=r(73),a=r(114),s=r(98),o=r(100),l=r(170),c=r(85),h=r(136),d=r(6),u=r(189).fastKey,p=r(50),f=p.set,g=p.getterFor;t.exports={getConstructor:function(t,e,r,c){var h=t((function(t,i){o(t,p);f(t,{type:e,index:n(null),first:void 0,last:void 0,size:0});d||(t.size=0);null!=i&&l(i,t[c],{that:t,AS_ENTRIES:r})})),p=h.prototype,v=g(e),define=function(t,e,r){var i,n,a=v(t),s=getEntry(t,e);if(s)s.value=r;else{a.last=s={index:n=u(e,!0),key:e,value:r,previous:i=a.last,next:void 0,removed:!1};a.first||(a.first=s);i&&(i.next=s);d?a.size++:t.size++;"F"!==n&&(a.index[n]=s)}return t},getEntry=function(t,e){var r,i=v(t),n=u(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key==e)return r};a(p,{clear:function clear(){for(var t=v(this),e=t.index,r=t.first;r;){r.removed=!0;r.previous&&(r.previous=r.previous.next=void 0);delete e[r.index];r=r.next}t.first=t.last=void 0;d?t.size=0:this.size=0},delete:function(t){var e=this,r=v(e),i=getEntry(e,t);if(i){var n=i.next,a=i.previous;delete r.index[i.index];i.removed=!0;a&&(a.next=n);n&&(n.previous=a);r.first==i&&(r.first=n);r.last==i&&(r.last=a);d?r.size--:e.size--}return!!i},forEach:function forEach(t){for(var e,r=v(this),i=s(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;){i(e.value,e.key,this);for(;e&&e.removed;)e=e.previous}},has:function has(t){return!!getEntry(this,t)}});a(p,r?{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)}});d&&i(p,"size",{get:function(){return v(this).size}});return h},setStrong:function(t,e,r){var i=e+" Iterator",n=g(e),a=g(i);c(t,e,(function(t,e){f(this,{type:i,target:t,state:n(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;if(!t.target||!(t.last=r=r?r.next:t.state.first)){t.target=void 0;return{value:void 0,done:!0}}return"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}}),r?"entries":"values",!r,!0);h(e)}}},(t,e,r)=>{r(196)},(t,e,r)=>{"use strict";r(188)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),r(194))},(t,e,r)=>{var i,n=r(34),a=r(3),s=r(4),o=r(22),l=r(14),c=r(7),h=r(39),d=r(20),u=r(106),p=r(19),f=r(21),g=r(170),v=r(45),m=r(69),_=r(37),y=r(107),b=r(42),A=r(62),P=r(112),S=r(198),x=r(199),w=r(26),E=r(167),k=r(200),T=r(154),C=s.Object,M=s.Date,R=s.Error,I=s.EvalError,D=s.RangeError,O=s.ReferenceError,L=s.SyntaxError,G=s.TypeError,N=s.URIError,j=s.PerformanceMark,U=s.WebAssembly,B=U&&U.CompileError||R,W=U&&U.LinkError||R,q=U&&U.RuntimeError||R,z=o("DOMException"),V=o("Set"),H=o("Map"),X=H.prototype,Y=l(X.has),K=l(X.get),J=l(X.set),Q=l(V.prototype.add),$=o("Object","keys"),Z=l([].push),tt=l((!0).valueOf),et=l(1..valueOf),rt=l("".valueOf),it=l(M.prototype.getTime),nt=h("structuredClone"),st="DataCloneError",ot="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new s.Set([7]),r=t(e),i=t(C(7));return r==e||!r.has(7)||"object"!=typeof i||7!=i}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)}))},lt=s.structuredClone,ct=n||!checkErrorsCloning(lt,R)||!checkErrorsCloning(lt,z)||!(i=lt,!c((function(){var t=i(new s.AggregateError([1],nt,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=nt||3!=t.cause}))),ht=!lt&&checkBasicSemantic((function(t){return new j(nt,{detail:t}).detail})),dt=checkBasicSemantic(lt)||ht,throwUncloneable=function(t){throw new z("Uncloneable type: "+t,st)},throwUnpolyfillable=function(t,e){throw new z((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",st)},structuredCloneInternal=function(t,e){f(t)&&throwUncloneable("Symbol");if(!p(t))return t;if(e){if(Y(e,t))return K(e,t)}else e=new H;var r,i,n,a,l,c,h,g,v,P,w=m(t),E=!1;switch(w){case"Array":n=[];E=!0;break;case"Object":n={};E=!0;break;case"Map":n=new H;E=!0;break;case"Set":n=new V;E=!0;break;case"RegExp":n=new RegExp(t.source,S(t));break;case"Error":switch(i=t.name){case"AggregateError":n=o("AggregateError")([]);break;case"EvalError":n=I();break;case"RangeError":n=D();break;case"ReferenceError":n=O();break;case"SyntaxError":n=L();break;case"TypeError":n=G();break;case"URIError":n=N();break;case"CompileError":n=B();break;case"LinkError":n=W();break;case"RuntimeError":n=q();break;default:n=R()}E=!0;break;case"DOMException":n=new z(t.message,t.name);E=!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":r=s[w];p(r)||throwUnpolyfillable(w);n=new r(structuredCloneInternal(t.buffer,e),t.byteOffset,"DataView"===w?t.byteLength:t.length);break;case"DOMQuad":try{n=new DOMQuad(structuredCloneInternal(t.p1,e),structuredCloneInternal(t.p2,e),structuredCloneInternal(t.p3,e),structuredCloneInternal(t.p4,e))}catch(e){dt?n=dt(t):throwUnpolyfillable(w)}break;case"FileList":r=s.DataTransfer;if(u(r)){a=new r;for(l=0,c=A(t);l<c;l++)a.items.add(structuredCloneInternal(t[l],e));n=a.files}else dt?n=dt(t):throwUnpolyfillable(w);break;case"ImageData":try{n=new ImageData(structuredCloneInternal(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){dt?n=dt(t):throwUnpolyfillable(w)}break;default:if(dt)n=dt(t);else switch(w){case"BigInt":n=C(t.valueOf());break;case"Boolean":n=C(tt(t));break;case"Number":n=C(et(t));break;case"String":n=C(rt(t));break;case"Date":n=new M(it(t));break;case"ArrayBuffer":(r=s.DataView)||"function"==typeof t.slice||throwUnpolyfillable(w);try{if("function"==typeof t.slice)n=t.slice(0);else{c=t.byteLength;n=new ArrayBuffer(c);v=new r(t);P=new r(n);for(l=0;l<c;l++)P.setUint8(l,v.getUint8(l))}}catch(t){throw new z("ArrayBuffer is detached",st)}break;case"SharedArrayBuffer":n=t;break;case"Blob":try{n=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(w)}break;case"DOMPoint":case"DOMPointReadOnly":r=s[w];try{n=r.fromPoint?r.fromPoint(t):new r(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(w)}break;case"DOMRect":case"DOMRectReadOnly":r=s[w];try{n=r.fromRect?r.fromRect(t):new r(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(w)}break;case"DOMMatrix":case"DOMMatrixReadOnly":r=s[w];try{n=r.fromMatrix?r.fromMatrix(t):new r(t)}catch(t){throwUnpolyfillable(w)}break;case"AudioData":case"VideoFrame":d(t.clone)||throwUnpolyfillable(w);try{n=t.clone()}catch(t){throwUncloneable(w)}break;case"File":try{n=new File([t],t.name,t)}catch(t){throwUnpolyfillable(w)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(w);default:throwUncloneable(w)}}J(e,t,n);if(E)switch(w){case"Array":case"Object":h=$(t);for(l=0,c=A(h);l<c;l++){g=h[l];y(n,g,structuredCloneInternal(t[g],e))}break;case"Map":t.forEach((function(t,r){J(n,structuredCloneInternal(r,e),structuredCloneInternal(t,e))}));break;case"Set":t.forEach((function(t){Q(n,structuredCloneInternal(t,e))}));break;case"Error":b(n,"message",structuredCloneInternal(t.message,e));_(t,"cause")&&b(n,"cause",structuredCloneInternal(t.cause,e));"AggregateError"==i&&(n.errors=structuredCloneInternal(t.errors,e));case"DOMException":x&&b(n,"stack",structuredCloneInternal(t.stack,e))}return n},ut=lt&&!c((function(){if(k&&w>92||T&&w>94||E&&w>97)return!1;var t=new ArrayBuffer(8),e=lt(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength})),tryToTransfer=function(t,e){if(!p(t))throw G("Transfer option cannot be converted to a sequence");var r=[];g(t,(function(t){Z(r,v(t))}));var i,n,a,o,l,c,h=0,f=A(r);if(ut){o=lt(r,{transfer:r});for(;h<f;)J(e,r[h],o[h++])}else for(;h<f;){i=r[h++];if(Y(e,i))throw new z("Duplicate transferable",st);switch(n=m(i)){case"ImageBitmap":a=s.OffscreenCanvas;u(a)||throwUnpolyfillable(n,ot);try{(c=new a(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i);l=c.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":d(i.clone)&&d(i.close)||throwUnpolyfillable(n,ot);try{l=i.clone();i.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(n,ot)}if(void 0===l)throw new z("This object cannot be transferred: "+n,st);J(e,i,l)}};a({global:!0,enumerable:!0,sham:!ut,forced:ct},{structuredClone:function structuredClone(t){var e,r=P(arguments.length,1)>1&&null!=arguments[1]?v(arguments[1]):void 0,i=r?r.transfer:void 0;if(void 0!==i){e=new H;tryToTransfer(i,e)}return structuredCloneInternal(t,e)}})},(t,e,r)=>{var i=r(8),n=r(37),a=r(23),s=r(71),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||n(t,"flags")||!a(o,t)?e:i(s,t)}},(t,e,r)=>{var i=r(7),n=r(11);t.exports=!i((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",n(1,7));return 7!==t.stack}))},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var i=r(4);t.exports=i},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0;e.binarySearchFirstItem=function binarySearchFirstItem(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=r,n=t.length-1;if(n<0||!e(t[n]))return t.length;if(e(t[i]))return i;for(;i<n;){const r=i+n>>1,a=t[r];e(a)?n=r:i=r+1}return i};e.deprecated=function deprecated(t){Window.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 r of t.keys()){e.style.color=r;const i=window.getComputedStyle(e).color;t.set(r,getRGB(i))}e.remove()};e.getFilenameFromUrl=function getFilenameFromUrl(t){const e=t.indexOf("#"),r=t.indexOf("?"),i=Math.min(e>0?e:t.length,r>0?r:t.length);return t.substring(t.lastIndexOf("/",i)+1,i)};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,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=r.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:r=1,rotation:i=0}=e;const{width:n,height:a}=t.attributes.style,s=[0,0,parseInt(n),parseInt(a)];return new PageViewport({viewBox:s,scale:r,rotation:i})};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(((r,i)=>{const n=document.createElement("script");"Function"===t.constructor.name?n.src=t():n.src=t;n.onload=function(t){e&&n.remove();r(t)};n.onerror=function(t){Window.ngxConsole.log(t);i(new Error("Cannot load script at: ".concat(n.src)))};(document.head||document.documentElement).append(n)}))};r(152);r(117);r(138);r(140);r(141);r(2);r(203);r(79);r(93);r(116);r(204);var i=r(207),n=r(1);function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}class PixelsPerInch{}e.PixelsPerInch=PixelsPerInch;_defineProperty(PixelsPerInch,"CSS",96);_defineProperty(PixelsPerInch,"PDF",72);_defineProperty(PixelsPerInch,"PDF_TO_CSS_UNITS",PixelsPerInch.CSS/PixelsPerInch.PDF);class DOMCanvasFactory extends i.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=t}_createCanvas(t,e){const r=this._document.createElement("canvas");r.width=t;r.height=e;return r}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const r=await fetch(t);if(!r.ok)throw new Error(r.statusText);return e?new Uint8Array(await r.arrayBuffer()):(0,n.stringToBytes)(await r.text())}return new Promise(((r,i)=>{const a=new XMLHttpRequest;a.open("GET",t,!0);e&&(a.responseType="arraybuffer");a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let t;e&&a.response?t=new Uint8Array(a.response):!e&&a.responseText&&(t=(0,n.stringToBytes)(a.responseText));if(t){r(t);return}}i(new Error(a.statusText))}};a.send(null)}))}class DOMCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:r,rotation:i,offsetX:n=0,offsetY:a=0,dontFlip:s=!1}=t;this.viewBox=e;this.scale=r;this.rotation=i;this.offsetX=n;this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,f,g,v;i%=360;i<0&&(i+=360);switch(i){case 180:c=-1;h=0;d=0;u=1;break;case 90:c=0;h=1;d=1;u=0;break;case 270:c=0;h=-1;d=-1;u=0;break;case 0:c=1;h=0;d=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(s){d=-d;u=-u}if(0===c){p=Math.abs(l-e[1])*r+n;f=Math.abs(o-e[0])*r+a;g=Math.abs(e[3]-e[1])*r;v=Math.abs(e[2]-e[0])*r}else{p=Math.abs(o-e[0])*r+n;f=Math.abs(l-e[1])*r+a;g=Math.abs(e[2]-e[0])*r;v=Math.abs(e[3]-e[1])*r}this.transform=[c*r,h*r,d*r,u*r,p-c*r*o-d*r*l,f-h*r*o-u*r*l];this.width=g;this.height=v}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){return n.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=n.Util.applyTransform([t[0],t[1]],this.transform),r=n.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],r[0],r[1]]}convertToPdfPoint(t,e){return n.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends n.BaseException{constructor(t,e){super(t,"RenderingCancelledException");this.type=e}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let r=0;for(;r<e&&""===t[r].trim();)r++;return"data:"===t.substring(r,r+5).toLowerCase()}e.StatTimer=class StatTimer{constructor(){this.started=Object.create(null);this.times=[]}time(t){t in this.started&&(0,n.warn)("Timer is already running for ".concat(t));this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,n.warn)("Timer has not been started for ".concat(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 t of this.times){const r=t.name;r.length>e&&(e=r.length)}for(const r of this.times){const i=r.end-r.start;t.push("".concat(r.name.padEnd(e)," ").concat(i,"ms\n"))}return t.join("")}};function isValidFetchUrl(t,e){try{const{protocol:r}=e?new URL(t,e):new URL(t);return"http:"===r||"https:"===r||"capacitor:"===r}catch(t){return!1}}let a;e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;a||(a=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=a.exec(t);if(!e)return null;const r=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let n=parseInt(e[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===c){s+=h;o+=d}else if("+"===c){s-=h;o-=d}return new Date(Date.UTC(r,i,n,s,o,l))}};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,n.warn)('Not a valid color format: "'.concat(t,'"'));return[0,0,0]}},(t,e,r)=>{"use strict";var i=r(3),n=r(58).includes,a=r(7),s=r(83);i({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function includes(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}});s("includes")},(t,e,r)=>{var i=r(6),n=r(4),a=r(14),s=r(66),o=r(137),l=r(42),c=r(56).f,h=r(23),d=r(205),u=r(68),p=r(198),f=r(72),g=r(206),v=r(46),m=r(7),_=r(37),y=r(50).enforce,b=r(136),A=r(32),P=r(77),S=r(78),x=A("match"),w=n.RegExp,E=w.prototype,k=n.SyntaxError,T=a(E.exec),C=a("".charAt),M=a("".replace),R=a("".indexOf),I=a("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,L=/a/g,G=new w(O)!==O,N=f.MISSED_STICKY,j=f.UNSUPPORTED_Y,U=i&&(!G||N||P||S||m((function(){L[x]=!1;return w(O)!=O||w(L)==L||"/a/i"!=w(O,"i")})));if(s("RegExp",U)){for(var B=function RegExp(t,e){var r,i,n,a,s,c,f=h(E,this),g=d(t),v=void 0===e,m=[],b=t;if(!f&&g&&v&&t.constructor===B)return t;if(g||h(E,t)){t=t.source;v&&(e=p(b))}t=void 0===t?"":u(t);e=void 0===e?"":u(e);b=t;P&&"dotAll"in O&&(i=!!e&&R(e,"s")>-1)&&(e=M(e,/s/g,""));r=e;N&&"sticky"in O&&(n=!!e&&R(e,"y")>-1)&&j&&(e=M(e,/y/g,""));if(S){a=function(t){for(var e,r=t.length,i=0,n="",a=[],s={},o=!1,l=!1,c=0,h="";i<=r;i++){if("\\"===(e=C(t,i)))e+=C(t,++i);else if("]"===e)o=!1;else if(!o)switch(!0){case"["===e:o=!0;break;case"("===e:if(T(D,I(t,i+1))){i+=2;l=!0}n+=e;c++;continue;case">"===e&&l:if(""===h||_(s,h))throw new k("Invalid capture group name");s[h]=!0;a[a.length]=[h,c];l=!1;h="";continue}l?h+=e:n+=e}return[n,a]}(t);t=a[0];m=a[1]}s=o(w(t,e),f?this:E,B);if(i||n||m.length){c=y(s);if(i){c.dotAll=!0;c.raw=B(function(t){for(var e,r=t.length,i=0,n="",a=!1;i<=r;i++)if("\\"!==(e=C(t,i)))if(a||"."!==e){"["===e?a=!0:"]"===e&&(a=!1);n+=e}else n+="[\\s\\S]";else n+=e+C(t,++i);return n}(t),r)}n&&(c.sticky=!0);m.length&&(c.groups=m)}if(t!==b)try{l(s,"source",""===b?"(?:)":b)}catch(t){}return s},W=c(w),q=0;W.length>q;)g(B,w,W[q++]);E.constructor=B;B.prototype=E;v(n,"RegExp",B,{constructor:!0})}b("RegExp")},(t,e,r)=>{var i=r(19),n=r(15),a=r(32)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==n(t))}},(t,e,r)=>{var i=r(43).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;r(152);var i=r(1);class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d")}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=r}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,i.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:r=!1}=t;this.constructor===BaseCMapReaderFactory&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=e;this.isCompressed=r}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 r=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(r,n).catch((t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(r))}))}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,i.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 r="".concat(this.baseUrl).concat(e);return this._fetchData(r).catch((t=>{throw new Error("Unable to load font data at: ".concat(r))}))}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");i.setAttribute("version","1.1");if(!r){i.setAttribute("width","".concat(t,"px"));i.setAttribute("height","".concat(e,"px"))}i.setAttribute("preserveAspectRatio","none");i.setAttribute("viewBox","0 0 ".concat(t," ").concat(e));return i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(__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.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory;exports.version=void 0;__w_pdfjs_require__(79);__w_pdfjs_require__(93);__w_pdfjs_require__(116);__w_pdfjs_require__(117);__w_pdfjs_require__(138);__w_pdfjs_require__(140);__w_pdfjs_require__(141);__w_pdfjs_require__(152);__w_pdfjs_require__(2);__w_pdfjs_require__(146);__w_pdfjs_require__(209);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(210),_display_utils=__w_pdfjs_require__(202),_font_loader=__w_pdfjs_require__(214),_canvas=__w_pdfjs_require__(215),_worker_options=__w_pdfjs_require__(221),_is_node=__w_pdfjs_require__(219),_message_handler=__w_pdfjs_require__(222),_metadata=__w_pdfjs_require__(225),_optional_content_config=__w_pdfjs_require__(226),_transport_stream=__w_pdfjs_require__(227),_xfa_text=__w_pdfjs_require__(228);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){_classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}function _classPrivateFieldGet(t,e){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _classStaticPrivateFieldSpecSet(t,e,r,i){_classCheckPrivateStaticAccess(t,e);_classCheckPrivateStaticFieldDescriptor(r,"set");_classApplyDescriptorSet(t,r,i);return i}function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function _classStaticPrivateFieldSpecGet(t,e,r){_classCheckPrivateStaticAccess(t,e);_classCheckPrivateStaticFieldDescriptor(r,"get");return _classApplyDescriptorGet(t,r)}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 _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,ServiceWorkerOptions={showUnverifiedSignatures:!1};window.ServiceWorkerOptions=ServiceWorkerOptions;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeStandardFontDataFactory:r}=__w_pdfjs_require__(229);exports.DefaultCanvasFactory=DefaultCanvasFactory=t;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=r}function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){const e=new PDFDocumentLoadingTask;let r;if("string"==typeof t||t instanceof URL)r={url:t};else if((0,_util.isArrayBuffer)(t))r={data:t};else if(t instanceof PDFDataRangeTransport)r={range:t};else{if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=t}const i=t.baseHref,n=Object.create(null);let a=null,s=null;for(const t in r){const e=r[t];switch(t){case"url":if("undefined"!=typeof window)try{n[t]=i?new URL(e,window.location.origin+i).href:new URL(e,window.location).href;continue}catch(t){(0,_util.warn)('Cannot create valid URL: "'.concat(t,'".'))}else if("string"==typeof e||e instanceof URL){n[t]=e.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":a=e;continue;case"worker":s=e;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer)n[t]=new Uint8Array(e);else{if(e instanceof Uint8Array)break;if("string"==typeof e)n[t]=(0,_util.stringToBytes)(e);else if("object"!=typeof e||null===e||isNaN(e.length)){if(!(0,_util.isArrayBuffer)(e))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");n[t]=new Uint8Array(e)}else n[t]=new Uint8Array(e)}continue}n[t]=e}n.CMapReaderFactory=n.CMapReaderFactory||DefaultCMapReaderFactory;n.StandardFontDataFactory=n.StandardFontDataFactory||DefaultStandardFontDataFactory;n.ignoreErrors=!0!==n.stopAtErrors;n.fontExtraProperties=!0===n.fontExtraProperties;n.pdfBug=!0===n.pdfBug;n.enableXfa=!0===n.enableXfa;(!Number.isInteger(n.rangeChunkSize)||n.rangeChunkSize<1)&&(n.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE);("string"!=typeof n.docBaseUrl||(0,_display_utils.isDataScheme)(n.docBaseUrl))&&(n.docBaseUrl=null);(!Number.isInteger(n.maxImageSize)||n.maxImageSize<-1)&&(n.maxImageSize=-1);"function"==typeof n.cMapUrl?n.cMapUrl=n.cMapUrl():"string"!=typeof n.cMapUrl&&(n.cMapUrl=null);"function"==typeof n.standardFontDataUrl&&(n.standardFontDataUrl=n.standardFontDataUrl());"string"!=typeof n.standardFontDataUrl&&(n.standardFontDataUrl=null);"boolean"!=typeof n.useWorkerFetch&&(n.useWorkerFetch=n.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&n.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory);"boolean"!=typeof n.isEvalSupported&&(n.isEvalSupported=!0);"boolean"!=typeof n.disableFontFace&&(n.disableFontFace=_is_node.isNodeJS);"boolean"!=typeof n.useSystemFonts&&(n.useSystemFonts=!_is_node.isNodeJS&&!n.disableFontFace);"object"==typeof n.ownerDocument&&null!==n.ownerDocument||(n.ownerDocument=globalThis.document);"boolean"!=typeof n.disableRange&&(n.disableRange=!1);"boolean"!=typeof n.disableStream&&(n.disableStream=!1);"boolean"!=typeof n.disableAutoFetch&&(n.disableAutoFetch=!1);(0,_util.setVerbosityLevel)(n.verbosity);if(!s){const t={verbosity:n.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};s=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=s}const o=e.docId;s.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(s,n,a,o),r=new Promise((function(t){let e;a?e=new _transport_stream.PDFDataTransportStream({length:n.length,initialData:n.initialData,progressiveDone:n.progressiveDone,contentDispositionFilename:n.contentDispositionFilename,disableRange:n.disableRange,disableStream:n.disableStream},a):n.data||(e=createPDFNetworkStream({url:n.url,length:n.length,httpHeaders:n.httpHeaders,withCredentials:n.withCredentials,rangeChunkSize:n.rangeChunkSize,disableRange:n.disableRange,disableStream:n.disableStream}));t(e)}));return Promise.all([t,r]).then((function(t){let[r,i]=t;if(e.destroyed)throw new Error("Loading aborted");const a=new _message_handler.MessageHandler(o,r,s.port),l=new WorkerTransport(a,e,i,n);e._transport=l;a.send("showUnverifiedSignatures",window.ServiceWorkerOptions.showUnverifiedSignatures);a.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e,r,i){var n;if(t.destroyed)throw new Error("Worker was destroyed");if(r){e.length=r.length;e.initialData=r.initialData;e.progressiveDone=r.progressiveDone;e.contentDispositionFilename=r.contentDispositionFilename}let a=e.cMapUrl;"Function"===(null===(n=a)||void 0===n?void 0:n.constructor.name)&&(a=a());const s=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:i,apiVersion:"2.16.323",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,enableXfa:e.enableXfa,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?a:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null});e.data&&(e.data=null);if(t.destroyed)throw new Error("Worker was destroyed");return s}class PDFDocumentLoadingTask{constructor(){var t,e;this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d".concat((_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId,(t=_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId),e=t++,t)),e));this.destroyed=!1;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=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;var _docId={writable:!0,value:0};class PDFDataRangeTransport{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t;this.initialData=e;this.progressiveDone=r;this.contentDispositionFilename=i;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 r of this._rangeListeners)r(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const r of this._progressListeners)r(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;Object.defineProperty(this,"fingerprint",{get(){(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead.");return this.fingerprints[0]}});Object.defineProperty(this,"getStats",{value:async()=>{(0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead.");return this.stats||{streamTypes:{},fontTypes:{}}}})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){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}saveDocument(){this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._pageIndex=t;this._pageInfo=e;this._ownerDocument=i;this._transport=r;this._stats=n?new _display_utils.StatTimer:null;this._pdfBug=n;this.commonObjs=r.commonObjs;this.objs=new PDFObjects;this._bitmaps=new Set;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this._annotationPromises=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);let r=this._annotationPromises.get(e.cacheKey);if(!r){r=this._transport.getAnnotations(this._pageIndex,e.renderingIntent);this._annotationPromises.set(e.cacheKey,r);r=r.then((t=>{for(const e of t){void 0!==e.titleObj&&Object.defineProperty(e,"title",{get(){(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead.");return e.titleObj.str}});void 0!==e.contentsObj&&Object.defineProperty(e,"contents",{get(){(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead.");return e.contentsObj.str}})}return t}))}return r}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,r,i;let{canvasContext:n,viewport:a,intent:s="display",annotationMode:o=_util.AnnotationMode.ENABLE,transform:l=null,imageLayer:c=null,canvasFactory:h=null,background:d=null,backgroundColorToReplace:u=null,optionalContentConfigPromise:p=null,annotationCanvasMap:f=null,pageColors:g=null,printAnnotationStorage:v=null}=t;if(void 0!==(null===(e=arguments[0])||void 0===e?void 0:e.renderInteractiveForms)){(0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead.");!0===arguments[0].renderInteractiveForms&&o===_util.AnnotationMode.ENABLE&&(o=_util.AnnotationMode.ENABLE_FORMS)}if(void 0!==(null===(r=arguments[0])||void 0===r?void 0:r.includeAnnotationStorage)){(0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead.");!0===arguments[0].includeAnnotationStorage&&o===_util.AnnotationMode.ENABLE&&(o=_util.AnnotationMode.ENABLE_STORAGE)}this._stats&&this._stats.time("Overall");const m=this._transport.getRenderingIntent(s,o,v);this.pendingCleanup=!1;p||(p=this._transport.getOptionalContentConfig());let _=this._intentStates.get(m.cacheKey);if(!_){_=Object.create(null);this._intentStates.set(m.cacheKey,_)}if(_.streamReaderCancelTimeout){clearTimeout(_.streamReaderCancelTimeout);_.streamReaderCancelTimeout=null}const y=h||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),b=!!(m.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!_.displayReadyCapability){_.displayReadyCapability=(0,_util.createPromiseCapability)();_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats&&this._stats.time("Page Request");this._pumpOperatorList(m)}const complete=t=>{_.renderTasks.delete(A);(this.cleanupAfterRender||b)&&(this.pendingCleanup=!0);this._tryCleanup();if(t){A.capability.reject(t);this._abortOperatorList({intentState:_,reason:t instanceof Error?t:new Error(t)})}else A.capability.resolve();if(this._stats){this._stats.timeEnd("Rendering");this._stats.timeEnd("Overall")}},A=new InternalRenderTask({callback:complete,params:{canvasContext:n,viewport:a,transform:l,imageLayer:c,background:d,backgroundColorToReplace:u},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:f,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:y,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:g});((i=_).renderTasks||(i.renderTasks=new Set)).add(A);const P=A.task;Promise.all([_.displayReadyCapability.promise,p]).then((t=>{let[e,r]=t;if(this.pendingCleanup)complete();else{this._stats&&this._stats.time("Rendering");A.initializeGraphics({transparency:e,optionalContentConfig:r});A.operatorListChanged()}})).catch(complete);return P}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this._transport.getRenderingIntent(t,e,r,!0);let n,a=this._intentStates.get(i.cacheKey);if(!a){a=Object.create(null);this._intentStates.set(i.cacheKey,a)}if(!a.opListReadCapability){var s;n=Object.create(null);n.operatorListChanged=function operatorListChanged(){if(a.operatorList.lastChunk){a.opListReadCapability.resolve(a.operatorList);a.renderTasks.delete(n)}};a.opListReadCapability=(0,_util.createPromiseCapability)();((s=a).renderTasks||(s.renderTasks=new Set)).add(n);a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats&&this._stats.time("Page Request");this._pumpOperatorList(i)}return a.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:t=!1,includeMarkedContent:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{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,r){const i=e.getReader(),n={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(e){let{value:r,done:i}=e;if(i)t(n);else{Object.assign(n.styles,r.styles);n.items.push(...r.items);pump()}}),r)}()}))}getStructTree(){return this._structTreePromise||(this._structTreePromise=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 r of e.renderTasks){t.push(r.completed);r.cancel()}}this.objs.clear();for(const t of this._bitmaps)t.close();this._bitmaps.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;this.pendingCleanup=!1;return Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0;this._tryCleanup(t)||(this.cleanupAfterRender=!0);return!0}_tryCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)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();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;t&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const t of this._bitmaps)t.close();this._bitmaps.clear();this.pendingCleanup=!1;return!0}_startRenderPage(t,e){const r=this._intentStates.get(e);if(r){this._stats&&this._stats.timeEnd("Page Request");r.displayReadyCapability&&r.displayReadyCapability.resolve(t)}}_renderPageChunk(t,e){for(let r=0,i=t.length;r<i;r++){e.operatorList.fnArray.push(t.fnArray[r]);e.operatorList.argsArray.push(t.argsArray[r])}e.operatorList.lastChunk=t.lastChunk;e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:r,annotationStorageMap:i}=t;const n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:r,annotationStorage:i}).getReader(),a=this._intentStates.get(r);a.streamReader=n;const pump=()=>{n.read().then((t=>{let{value:e,done:r}=t;if(r)a.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(e,a);pump()}}),(t=>{a.streamReader=null;if(!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();this._tryCleanup()}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:r,force:i=!1}=t;if(e.streamReader){if(!i){if(e.renderTasks.size>0)return;if(r instanceof _display_utils.RenderingCancelledException){e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:r,force:!0});e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT);return}}e.streamReader.cancel(new _util.AbortException(r.message)).catch((()=>{}));e.streamReader=null;if(!this._transport.destroyed){for(const[t,r]of this._intentStates)if(r===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[];this._deferred=Promise.resolve()}postMessage(t,e){const r={data:structuredClone(t,e)};this._deferred.then((()=>{for(const t of this._listeners)t.call(this,r)}))}addEventListener(t,e){this._listeners.push(e)}removeEventListener(t,e){const r=this._listeners.indexOf(e);this._listeners.splice(r,1)}terminate(){this._listeners.length=0}}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 r;try{r=new URL(t);if(!r.origin||"null"===r.origin)return!1}catch(t){return!1}const i=new URL(e,r);return r.origin===i.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e='importScripts("'.concat(t,'");');return URL.createObjectURL(new Blob([e]))};class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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=r;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()}_initialize(){if("undefined"!=typeof Worker&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let t=PDFWorker.workerSrc;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),r=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);r.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);r.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=r;this._port=e;this._webWorker=e;this._readyCapability.resolve();r.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();r.destroy();e.terminate()}}));r.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;r.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 r="fake".concat(PDFWorkerUtil.fakeWorkerId++),i=new _message_handler.MessageHandler(r+"_worker",r,e);t.setup(i,e);const n=new _message_handler.MessageHandler(r,r+"_worker",e);this._messageHandler=n;this._readyCapability.resolve();n.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(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;var _workerPorts={writable:!0,value:new WeakMap};PDFWorker.getWorkerSrc=function(){(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.");return this.workerSrc};var _docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap;class WorkerTransport{constructor(t,e,r,i){_classPrivateFieldInitSpec(this,_docStats,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_metadataPromise,{writable:!0,value:null});this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({docId:e.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:i.ownerDocument,styleElement:i.styleElement});this._params=i;if(!i.useWorkerFetch){var n;let t=i.cMapUrl;"Function"===(null===(n=t)||void 0===n?void 0:n.constructor.name)&&(t=t());this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:t,isCompressed:i.cMapPacked});this.StandardFontDataFactory=new i.StandardFontDataFactory({baseUrl:i.standardFontDataUrl})}this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=r;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return _classPrivateFieldGet(this,_docStats)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":n=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":n=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case _util.AnnotationMode.DISABLE:n+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:n+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:n+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=(n&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(e))}i&&(n+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:n,cacheKey:"".concat(n,"_").concat(_annotation_storage.AnnotationStorage.getHash(a)),annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(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();_classPrivateFieldSet(this,_metadataPromise,null);this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null;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:r,done:i}=t;if(i)e.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(r),1,[r])}})).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 r=(0,_util.createPromiseCapability)(),i=this._fullReader;i.headersReady.then((()=>{if(!i.isStreamingSupported||!i.isRangeSupported){if(this._lastProgress){var t;null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)}i.onProgress=t=>{var r;null===(r=e.onProgress)||void 0===r||r.call(e,{loaded:t.loaded,total:t.total})}}r.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),r.reject);return r.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(t.begin,t.end);if(r){e.onPull=()=>{r.read().then((function(t){let{value:r,done:i}=t;if(i)e.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(r),1,[r])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{r.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(t=>{let{pdfInfo:r}=t;this._numPages=r.numPages;this._htmlForXfa=r.htmlForXfa;delete r.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(r,this))}));t.on("DocException",(function(t){let r;switch(t.name){case"PasswordException":r=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":r=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(r)}));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 r;null===(r=e.onProgress)||void 0===r||r.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 r;let[i,n,a]=e;if(!this.destroyed&&!this.commonObjs.has(i))switch(n){case"Font":const e=this._params;if("error"in a){const t=a.error;(0,_util.warn)("Error during font loading: ".concat(t));this.commonObjs.resolve(i,t);break}let s=null;e.pdfBug&&null!==(r=globalThis.FontInspector)&&void 0!==r&&r.enabled&&(s={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const o=new _font_loader.FontFaceObject(a,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:s});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:i}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null);this.commonObjs.resolve(i,o)}));break;case"FontPath":case"Image":this.commonObjs.resolve(i,a);break;default:throw new Error("Got unknown common object type ".concat(n))}}));t.on("obj",(t=>{let[e,r,i,n]=t;if(this.destroyed)return;const a=_classPrivateFieldGet(this,_pageCache).get(r);if(!a.objs.has(e))switch(i){case"Image":a.objs.resolve(e,n);const t=8e6;if(n){let e;if(n.bitmap){const{bitmap:t,width:r,height:i}=n;e=r*i*4;a._bitmaps.add(t)}else{var s;e=(null===(s=n.data)||void 0===s?void 0:s.length)||0}e>t&&(a.cleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,n);break;default:throw new Error("Got unknown object type ".concat(i))}}));t.on("DocProgress",(t=>{var r;this.destroyed||null===(r=e.onProgress)||void 0===r||r.call(e,{loaded:t.loaded,total:t.total})}));t.on("DocStats",(t=>{this.destroyed||_classPrivateFieldSet(this,_docStats,Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))}));t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(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."))))}_onUnsupportedFeature(t){var e,r;let{featureId:i}=t;this.destroyed||null===(e=(r=this.loadingTask).onUnsupportedFeature)||void 0===e||e.call(r,i)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,r=_classPrivateFieldGet(this,_pagePromises).get(e);if(r)return r;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const r=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);_classPrivateFieldGet(this,_pageCache).set(e,r);return r}));_classPrivateFieldGet(this,_pagePromises).set(e,i);return i}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})}saveDocument(){var t,e;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null}).finally((()=>{this.annotationStorage.resetModified()}))}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(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(){return _classPrivateFieldGet(this,_metadataPromise)||_classPrivateFieldSet(this,_metadataPromise,this.messageHandler.sendWithPromise("GetMetadata",null).then((t=>{var e,r,i,n;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:null!==(e=null===(r=this._fullReader)||void 0===r?void 0:r.filename)&&void 0!==e?e:null,contentLength:null!==(i=null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)&&void 0!==i?i:null}})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];await this.messageHandler.sendWithPromise("Cleanup",null);if(!this.destroyed){for(const t of _classPrivateFieldGet(this,_pageCache).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear();t||this.fontLoader.clear();_classPrivateFieldSet(this,_metadataPromise,null);this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null}}get loadingParams(){const t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}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 r=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);r.capability.promise.then((()=>e(r.data)));return null}const r=_classPrivateFieldGet(this,_objs)[t];if(null==r||!r.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return r.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 r=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);r.data=e;r.capability.resolve()}clear(){_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})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(t){_classPrivateFieldInitSpec(this,_internalRenderTask,{writable:!0,value:null});_classPrivateFieldSet(this,_internalRenderTask,t);this.onContinue=null}get promise(){return _classPrivateFieldGet(this,_internalRenderTask).capability.promise}cancel(){_classPrivateFieldGet(this,_internalRenderTask).cancel()}get separateAnnots(){const{separateAnnots:t}=_classPrivateFieldGet(this,_internalRenderTask).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=_classPrivateFieldGet(this,_internalRenderTask);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){let{callback:e,params:r,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:s,pageIndex:o,canvasFactory:l,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:d=null}=t;this.callback=e;this.params=r;this.objs=i;this.commonObjs=n;this.annotationCanvasMap=a;this.operatorListIdx=null;this.operatorList=s;this._pageIndex=o;this.canvasFactory=l;this._pdfBug=h;this.pageColors=d;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===c&&"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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e;let{transparency:r=!1,optionalContentConfig:i}=t;if(this.cancelled)return;if(this._canvas){if(_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).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.");_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).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:n,viewport:a,transform:s,imageLayer:o,background:l,backgroundColorToReplace:c}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,o,i,this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:s,viewport:a,transparency:r,background:l,backgroundColorToReplace:c});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1;this.cancelled=!0;this.gfx&&this.gfx.endDrawing();this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))}operatorListChanged(){if(this.graphicsReady){this.stepper&&this.stepper.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._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback()}}}}}var _canvasInUse={writable:!0,value:new WeakSet};const version="2.16.323";exports.version=version;const build="662d38f49";exports.build=build},(t,e,r)=>{"use strict";var i=r(3),n=r(34),a=r(165),s=r(7),o=r(22),l=r(20),c=r(155),h=r(176),d=r(46),u=a&&a.prototype;i({target:"Promise",proto:!0,real:!0,forced:!!a&&s((function(){u.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,o("Promise")),r=l(t);return this.then(r?function(r){return h(e,t()).then((function(){return r}))}:t,r?function(r){return h(e,t()).then((function(){throw r}))}:t)}});if(!n&&l(a)){var p=o("Promise").prototype.finally;u.finally!==p&&d(u,"finally",p,{unsafe:!0})}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PrintAnnotationStorage=e.AnnotationStorage=void 0;r(79);var i=r(1),n=r(211),a=r(213);function _classPrivateFieldSet(t,e,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}var s=new WeakSet;class AnnotationStorage{constructor(){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,s);this._storage=new Map;this._modified=!1;this.onSetModified=null;this.onResetModified=null}getValue(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,n=this._storage.get(t);if(void 0===n&&window.getFormValue){window.assignFormIdAndFieldName(t,e,i);const a=window.getFormValue(e);if(void 0!==a&&void 0!==a.value){if(i){n={value:a.value===i}}else n=a;this.setValue(t,void 0,n,void 0,!0)}void 0===n&&void 0!==r&&void 0!==r.value&&""!==r.value&&(i?r.value&&window.setFormValue(e,i):window.setFormValue(e,r.value))}return void 0===n?r:Object.assign(r,n)}getRawValue(t){return this._storage.get(t)}removeKey(t){this._storage.delete(t);0===this._storage.size&&this.resetModified()}setValue(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=this._storage.get(t);let o=!1;if(void 0!==a){for(const[t,e]of Object.entries(r))if("radioValue"!==t&&"emitMessage"!==t&&a[t]!==e){o=!0;a[t]=e}}else{n||(o=!0);this._storage.set(t,r)}if(o){(function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r})(this,s,_setModified2).call(this);if("FreeTextEditor"!==(null==e?void 0:e.constructor.name)&&(e||i)&&window.setFormValue)if(r.items)window.setFormValue(e,r.items);else if(!1===r.emitMessage);else if(r.radioValue)window.setFormValue(e,r.radioValue);else if(r.exportValue)window.setFormValue(e,r.exportValue);else for(const t of Object.values(r))window.setFormValue(e,t)}}has(t){return this._storage.has(t)}getAll(){return this._storage.size>0?(0,i.objectFromMap)(this._storage):null}get size(){return this._storage.size}resetModified(){if(this._modified){this._modified=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this._storage.size)return null;const t=new Map;for(const[e,r]of this._storage){const i=r instanceof n.AnnotationEditor?r.serialize():r;i&&t.set(e,i)}return t}static getHash(t){if(!t)return"";const e=new a.MurmurHash3_64;for(const[r,i]of t)e.update("".concat(r,":").concat(JSON.stringify(i)));return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;function _setModified2(){if(!this._modified){this._modified=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}var o=new WeakMap;class PrintAnnotationStorage extends AnnotationStorage{constructor(t){super();!function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}(this,o,{writable:!0,value:null});_classPrivateFieldSet(this,o,structuredClone(t.serializable))}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}(this,o)}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;r(79);var i=r(212),n=r(1);function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function _classPrivateFieldInitSpec(t,e,r){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.set(t,r)}function _classPrivateFieldSet(t,e,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}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,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var a=new WeakMap,s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap;class AnnotationEditor{constructor(t){_classPrivateFieldInitSpec(this,a,{writable:!0,value:this.focusin.bind(this)});_classPrivateFieldInitSpec(this,s,{writable:!0,value:this.focusout.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,l,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,c,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,h,{writable:!0,value:AnnotationEditor._zIndex++});this.constructor===AnnotationEditor&&(0,n.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;const[e,r]=this.parent.viewportBaseDimensions;this.x=t.x/e;this.y=t.y/r;this.rotation=this.parent.viewport.rotation;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(this,h)}focusin(t){_classPrivateFieldGet(this,o)?_classPrivateFieldSet(this,o,!1):this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;const e=t.relatedTarget;if(null==e||!e.closest("#".concat(this.id))){t.preventDefault();this.parent.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.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,r,i){const[n,a]=this.parent.viewportBaseDimensions;[r,i]=this.screenToPageTranslation(r,i);this.x=(t+r)/n;this.y=(e+i)/a;this.div.style.left="".concat(100*this.x,"%");this.div.style.top="".concat(100*this.y,"%")}translate(t,e){const[r,i]=this.parent.viewportBaseDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/r;this.y+=e/i;this.div.style.left="".concat(100*this.x,"%");this.div.style.top="".concat(100*this.y,"%")}screenToPageTranslation(t,e){const{rotation:r}=this.parent.viewport;switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}setDims(t,e){const[r,i]=this.parent.viewportBaseDimensions;this.div.style.width="".concat(100*t/r,"%");this.div.style.height="".concat(100*e/i,"%")}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",_classPrivateFieldGet(this,a));this.div.addEventListener("focusout",_classPrivateFieldGet(this,s));const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,i.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const e=i.KeyboardManager.platform.isMac;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);_classPrivateFieldSet(this,o,!0)}}getRect(t,e){const[r,i]=this.parent.viewportBaseDimensions,[n,a]=this.parent.pageDimensions,s=n*t/r,o=a*e/i,l=this.x*n,c=this.y*a,h=this.width*n,d=this.height*a;switch(this.rotation){case 0:return[l+s,a-c-o-d,l+s+h,a-c-o];case 90:return[l+o,a-c+s,l+o+d,a-c+s+h];case 180:return[l-s-h,a-c+o,l-s,a-c+o+d];case 270:return[l-o-d,a-c-s-h,l-o,a-c-s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[r,i,n,a]=t,s=n-r,o=a-i;switch(this.rotation){case 0:return[r,e-a,s,o];case 90:return[r,e-i,o,s];case 180:return[n,e-i,s,o];case 270:return[n,e-a,o,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(this,c,!0)}disableEditMode(){_classPrivateFieldSet(this,c,!1)}isInEditMode(){return _classPrivateFieldGet(this,c)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",_classPrivateFieldGet(this,a))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e){const r=new this.prototype.constructor({parent:e,id:e.getNextId()});r.rotation=t.rotation;const[i,n]=e.pageDimensions,[a,s,o,l]=r.getRectInCurrentCoords(t.rect,n);r.x=a/i;r.y=s/n;r.width=o/i;r.height=l/n;return r}remove(){this.div.removeEventListener("focusin",_classPrivateFieldGet(this,a));this.div.removeEventListener("focusout",_classPrivateFieldGet(this,s));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(){}getIdForTextLayer(){return this.id}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(this,l)}set isEditing(t){_classPrivateFieldSet(this,l,t);if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor;_defineProperty(AnnotationEditor,"_colorManager",new i.ColorManager);_defineProperty(AnnotationEditor,"_zIndex",1)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,r){for(const i of r)e.addEventListener(i,t[i].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};r(79);r(2);r(203);var i=r(1),n=r(202);function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}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,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var a=new WeakMap;class IdManager{constructor(){_classPrivateFieldInitSpec(this,a,{writable:!0,value:0})}getId(){var t,e;return"".concat(i.AnnotationEditorPrefix).concat((_classPrivateFieldSet(this,a,(t=_classPrivateFieldGet(this,a),e=t++,t)),e))}}var s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap;class CommandManager{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,s,{writable:!0,value:[]});_classPrivateFieldInitSpec(this,o,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:-1});_classPrivateFieldSet(this,l,t)}add(t){let{cmd:e,undo:r,mustExec:i,type:n=NaN,overwriteIfSameType:a=!1,keepUndo:h=!1}=t;i&&e();if(_classPrivateFieldGet(this,o))return;const d={cmd:e,undo:r,type:n};if(-1===_classPrivateFieldGet(this,c)){_classPrivateFieldGet(this,s).length>0&&(_classPrivateFieldGet(this,s).length=0);_classPrivateFieldSet(this,c,0);_classPrivateFieldGet(this,s).push(d);return}if(a&&_classPrivateFieldGet(this,s)[_classPrivateFieldGet(this,c)].type===n){h&&(d.undo=_classPrivateFieldGet(this,s)[_classPrivateFieldGet(this,c)].undo);_classPrivateFieldGet(this,s)[_classPrivateFieldGet(this,c)]=d;return}const u=_classPrivateFieldGet(this,c)+1;if(u===_classPrivateFieldGet(this,l))_classPrivateFieldGet(this,s).splice(0,1);else{_classPrivateFieldSet(this,c,u);u<_classPrivateFieldGet(this,s).length&&_classPrivateFieldGet(this,s).splice(u)}_classPrivateFieldGet(this,s).push(d)}undo(){if(-1!==_classPrivateFieldGet(this,c)){_classPrivateFieldSet(this,o,!0);_classPrivateFieldGet(this,s)[_classPrivateFieldGet(this,c)].undo();_classPrivateFieldSet(this,o,!1);_classPrivateFieldSet(this,c,_classPrivateFieldGet(this,c)-1)}}redo(){if(_classPrivateFieldGet(this,c)<_classPrivateFieldGet(this,s).length-1){_classPrivateFieldSet(this,c,_classPrivateFieldGet(this,c)+1);_classPrivateFieldSet(this,o,!0);_classPrivateFieldGet(this,s)[_classPrivateFieldGet(this,c)].cmd();_classPrivateFieldSet(this,o,!1)}}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(this,c)}hasSomethingToRedo(){return _classPrivateFieldGet(this,c)<_classPrivateFieldGet(this,s).length-1}destroy(){_classPrivateFieldSet(this,s,null)}}e.CommandManager=CommandManager;var h=new WeakSet;class KeyboardManager{constructor(t){_classPrivateMethodInitSpec(this,h);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const e=KeyboardManager.platform.isMac;for(const[r,i]of t)for(const t of r){const r=t.startsWith("mac+");if(e&&r){this.callbacks.set(t.slice(4),i);this.allKeys.add(t.split("+").at(-1))}else if(!e&&!r){this.callbacks.set(t,i);this.allKeys.add(t.split("+").at(-1))}}}static get platform(){const t="undefined"!=typeof navigator?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}exec(t,e){if(!this.allKeys.has(e.key))return;const r=this.callbacks.get(_classPrivateMethodGet(this,h,_serialize2).call(this,e));if(r){r.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}var d=new WeakMap;class ClipboardManager{constructor(){_classPrivateFieldInitSpec(this,d,{writable:!0,value:null})}copy(t){if(t){Array.isArray(t)?_classPrivateFieldSet(this,d,t.map((t=>t.serialize()))):_classPrivateFieldSet(this,d,[t.serialize()]);_classPrivateFieldSet(this,d,_classPrivateFieldGet(this,d).filter((t=>!!t)));0===_classPrivateFieldGet(this,d).length&&_classPrivateFieldSet(this,d,null)}}paste(){return _classPrivateFieldGet(this,d)}isEmpty(){return null===_classPrivateFieldGet(this,d)}destroy(){_classPrivateFieldSet(this,d,null)}}class ColorManager{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);(0,n.getColorValues)(t);return(0,i.shadow)(this,"_colors",t)}convert(t){const e=(0,n.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,r]of this._colors)if(r.every(((t,r)=>t===e[r])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?i.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;_defineProperty(ColorManager,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,y=new WeakMap,b=new WeakMap,A=new WeakMap,P=new WeakMap,S=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakMap,k=new WeakMap,T=new WeakMap,C=new WeakMap,M=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,L=new WeakSet,G=new WeakSet,N=new WeakSet,j=new WeakSet;class AnnotationEditorUIManager{constructor(t,e){_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,M);_classPrivateFieldInitSpec(this,u,{writable:!0,value:null});_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,f,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,g,{writable:!0,value:new ClipboardManager});_classPrivateFieldInitSpec(this,v,{writable:!0,value:new CommandManager});_classPrivateFieldInitSpec(this,m,{writable:!0,value:0});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,y,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:new IdManager});_classPrivateFieldInitSpec(this,A,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,P,{writable:!0,value:i.AnnotationEditorType.NONE});_classPrivateFieldInitSpec(this,S,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,x,{writable:!0,value:this.keydown.bind(this)});_classPrivateFieldInitSpec(this,w,{writable:!0,value:this.onEditingAction.bind(this)});_classPrivateFieldInitSpec(this,E,{writable:!0,value:this.onPageChanging.bind(this)});_classPrivateFieldInitSpec(this,k,{writable:!0,value:this.onTextLayerRendered.bind(this)});_classPrivateFieldInitSpec(this,T,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});_classPrivateFieldInitSpec(this,C,{writable:!0,value:null});_classPrivateFieldSet(this,C,t);_classPrivateFieldSet(this,y,e);_classPrivateFieldGet(this,y)._on("editingaction",_classPrivateFieldGet(this,w));_classPrivateFieldGet(this,y)._on("pagechanging",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,y)._on("textlayerrendered",_classPrivateFieldGet(this,k))}destroy(){_classPrivateMethodGet(this,R,_removeKeyboardManager2).call(this);_classPrivateFieldGet(this,y)._off("editingaction",_classPrivateFieldGet(this,w));_classPrivateFieldGet(this,y)._off("pagechanging",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,y)._off("textlayerrendered",_classPrivateFieldGet(this,k));for(const t of _classPrivateFieldGet(this,f).values())t.destroy();_classPrivateFieldGet(this,f).clear();_classPrivateFieldGet(this,p).clear();_classPrivateFieldSet(this,u,null);_classPrivateFieldGet(this,S).clear();_classPrivateFieldGet(this,g).destroy();_classPrivateFieldGet(this,v).destroy()}onPageChanging(t){let{pageNumber:e}=t;_classPrivateFieldSet(this,m,e-1)}onTextLayerRendered(t){let{pageNumber:e}=t;const r=e-1,i=_classPrivateFieldGet(this,f).get(r);null==i||i.onTextLayerRendered()}focusMainContainer(){_classPrivateFieldGet(this,C).focus()}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","cut","copy","paste","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){if(t){_classPrivateMethodGet(this,M,_addKeyboardManager2).call(this);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{isEditing:_classPrivateFieldGet(this,P)!==i.AnnotationEditorType.NONE,isEmpty:_classPrivateMethodGet(this,N,_isEmpty2).call(this),hasSomethingToUndo:_classPrivateFieldGet(this,v).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(this,v).hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:_classPrivateFieldGet(this,g).isEmpty()})}else{_classPrivateMethodGet(this,R,_removeKeyboardManager2).call(this);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{isEditing:!1})}}registerEditorTypes(t){_classPrivateFieldSet(this,_,t);for(const t of _classPrivateFieldGet(this,_))_classPrivateMethodGet(this,D,_dispatchUpdateUI2).call(this,t.defaultPropertiesToUpdate)}getId(){return _classPrivateFieldGet(this,b).getId()}addLayer(t){_classPrivateFieldGet(this,f).set(t.pageIndex,t);_classPrivateFieldGet(this,A)?t.enable():t.disable()}removeLayer(t){_classPrivateFieldGet(this,f).delete(t.pageIndex)}updateMode(t){_classPrivateFieldSet(this,P,t);if(t===i.AnnotationEditorType.NONE){this.setEditingState(!1);_classPrivateMethodGet(this,L,_disableAll2).call(this)}else{this.setEditingState(!0);_classPrivateMethodGet(this,O,_enableAll2).call(this);for(const e of _classPrivateFieldGet(this,f).values())e.updateMode(t)}}updateToolbar(t){t!==_classPrivateFieldGet(this,P)&&_classPrivateFieldGet(this,y).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){for(const r of _classPrivateFieldGet(this,S))r.updateParams(t,e);for(const r of _classPrivateFieldGet(this,_))r.updateDefaultParams(t,e)}getEditors(t){const e=[];for(const r of _classPrivateFieldGet(this,p).values())r.pageIndex===t&&e.push(r);return e}getEditor(t){return _classPrivateFieldGet(this,p).get(t)}addEditor(t){_classPrivateFieldGet(this,p).set(t.id,t)}removeEditor(t){_classPrivateFieldGet(this,p).delete(t.id);this.unselect(t)}setActiveEditor(t){if(_classPrivateFieldGet(this,u)!==t){_classPrivateFieldSet(this,u,t);t&&_classPrivateMethodGet(this,D,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}}toggleSelected(t){if(_classPrivateFieldGet(this,S).has(t)){_classPrivateFieldGet(this,S).delete(t);t.unselect();_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{_classPrivateFieldGet(this,S).add(t);t.select();_classPrivateMethodGet(this,D,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}setSelected(t){for(const e of _classPrivateFieldGet(this,S))e!==t&&e.unselect();_classPrivateFieldGet(this,S).clear();_classPrivateFieldGet(this,S).add(t);t.select();_classPrivateMethodGet(this,D,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}isSelected(t){return _classPrivateFieldGet(this,S).has(t)}unselect(t){t.unselect();_classPrivateFieldGet(this,S).delete(t);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(this,S).size}undo(){_classPrivateFieldGet(this,v).undo();_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:_classPrivateFieldGet(this,v).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_classPrivateMethodGet(this,N,_isEmpty2).call(this)})}redo(){_classPrivateFieldGet(this,v).redo();_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(this,v).hasSomethingToRedo(),isEmpty:_classPrivateMethodGet(this,N,_isEmpty2).call(this)})}addCommands(t){_classPrivateFieldGet(this,v).add(t);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_classPrivateMethodGet(this,N,_isEmpty2).call(this)})}delete(){_classPrivateFieldGet(this,u)&&_classPrivateFieldGet(this,u).commitOrRemove();if(!this.hasSelection)return;const t=[..._classPrivateFieldGet(this,S)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)_classPrivateMethodGet(this,G,_addEditorToLayer2).call(this,e)},mustExec:!0})}copy(){_classPrivateFieldGet(this,u)&&_classPrivateFieldGet(this,u).commitOrRemove();if(this.hasSelection){const t=[];for(const e of _classPrivateFieldGet(this,S))e.isEmpty()||t.push(e);if(0===t.length)return;_classPrivateFieldGet(this,g).copy(t);_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasEmptyClipboard:!1})}}cut(){this.copy();this.delete()}paste(){if(_classPrivateFieldGet(this,g).isEmpty())return;this.unselectAll();const t=_classPrivateFieldGet(this,f).get(_classPrivateFieldGet(this,m)),e=_classPrivateFieldGet(this,g).paste().map((e=>t.deserialize(e)));this.addCommands({cmd:()=>{for(const t of e)_classPrivateMethodGet(this,G,_addEditorToLayer2).call(this,t);_classPrivateMethodGet(this,j,_selectEditors2).call(this,e)},undo:()=>{for(const t of e)t.remove()},mustExec:!0})}selectAll(){for(const t of _classPrivateFieldGet(this,S))t.commit();_classPrivateMethodGet(this,j,_selectEditors2).call(this,_classPrivateFieldGet(this,p).values())}unselectAll(){if(_classPrivateFieldGet(this,u))_classPrivateFieldGet(this,u).commitOrRemove();else if(0!==_classPrivateMethodGet(this,j,_selectEditors2).size){for(const t of _classPrivateFieldGet(this,S))t.unselect();_classPrivateFieldGet(this,S).clear();_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}isActive(t){return _classPrivateFieldGet(this,u)===t}getActive(){return _classPrivateFieldGet(this,u)}getMode(){return _classPrivateFieldGet(this,P)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager;function _addKeyboardManager2(){_classPrivateFieldGet(this,C).addEventListener("keydown",_classPrivateFieldGet(this,x))}function _removeKeyboardManager2(){_classPrivateFieldGet(this,C).removeEventListener("keydown",_classPrivateFieldGet(this,x))}function _dispatchUpdateStates2(t){Object.entries(t).some((t=>{let[e,r]=t;return _classPrivateFieldGet(this,T)[e]!==r}))&&_classPrivateFieldGet(this,y).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(this,T),t)})}function _dispatchUpdateUI2(t){_classPrivateFieldGet(this,y).dispatch("annotationeditorparamschanged",{source:this,details:t})}function _enableAll2(){if(!_classPrivateFieldGet(this,A)){_classPrivateFieldSet(this,A,!0);for(const t of _classPrivateFieldGet(this,f).values())t.enable()}}function _disableAll2(){this.unselectAll();if(_classPrivateFieldGet(this,A)){_classPrivateFieldSet(this,A,!1);for(const t of _classPrivateFieldGet(this,f).values())t.disable()}}function _addEditorToLayer2(t){const e=_classPrivateFieldGet(this,f).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function _isEmpty2(){if(0===_classPrivateFieldGet(this,p).size)return!0;if(1===_classPrivateFieldGet(this,p).size)for(const t of _classPrivateFieldGet(this,p).values())return t.isEmpty();return!1}function _selectEditors2(t){_classPrivateFieldGet(this,S).clear();for(const e of t)if(!e.isEmpty()){_classPrivateFieldGet(this,S).add(e);e.select()}_classPrivateMethodGet(this,I,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}_defineProperty(AnnotationEditorUIManager,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+c","mac+meta+c"],AnnotationEditorUIManager.prototype.copy],[["ctrl+v","mac+meta+v"],AnnotationEditorUIManager.prototype.paste],[["ctrl+x","mac+meta+x"],AnnotationEditorUIManager.prototype.cut],[["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,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;r(117);r(138);r(140);r(141);r(145);var i=r(1);const n=3285377520,a=4294901760,s=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:n;this.h2=t?4294967295&t:n}update(t){let e,r;if("string"==typeof t){e=new Uint8Array(2*t.length);r=0;for(let i=0,n=t.length;i<n;i++){const n=t.charCodeAt(i);if(n<=255)e[r++]=n;else{e[r++]=n>>>8;e[r++]=255&n}}}else{if(!(0,i.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();r=e.byteLength}const n=r>>2,o=r-4*n,l=new Uint32Array(e.buffer,0,n);let c=0,h=0,d=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,v=13715;for(let t=0;t<n;t++)if(1&t){c=l[t];c=c*p&a|c*g&s;c=c<<15|c>>>17;c=c*f&a|c*v&s;d^=c;d=d<<13|d>>>19;d=5*d+3864292196}else{h=l[t];h=h*p&a|h*g&s;h=h<<15|h>>>17;h=h*f&a|h*v&s;u^=h;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*n+2]<<16;case 2:c^=e[4*n+1]<<8;case 1:c^=e[4*n];c=c*p&a|c*g&s;c=c<<15|c>>>17;c=c*f&a|c*v&s;1&n?d^=c:u^=c}this.h1=d;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&a|36045*t&s;e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;t=444984403*t&a|60499*t&s;e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;const r=(t>>>0).toString(16),i=(e>>>0).toString(16);return r.padStart(8,"0")+i.padStart(8,"0")}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;r(79);r(152);r(2);var i=r(1);class BaseFontLoader{constructor(t){let{docId:e,onUnsupportedFeature:r,ownerDocument:n=globalThis.document,styleElement:a=null}=t;this.constructor===BaseFontLoader&&(0,i.unreachable)("Cannot initialize BaseFontLoader.");this.docId=e;this._onUnsupportedFeature=r;this._document=n;this.nativeFontFaces=[];this.styleElement=null}addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}insertRule(t){let e=this.styleElement;if(!e){e=this.styleElement=this._document.createElement("style");e.id="PDFJS_FONT_STYLE_TAG_".concat(this.docId);this._document.documentElement.getElementsByTagName("head")[0].append(e)}const r=e.sheet;r.insertRule(t,r.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(r){this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,i.warn)("Failed to load font '".concat(e.family,"': '").concat(r,"'."));t.disableFontFace=!0;throw r}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent([e],[t],i)}))}}_queueLoadingCallback(t){(0,i.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,i.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,i.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(t,e,r){(0,i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let n;e.FontLoader=n;e.FontLoader=n=class GenericFontLoader extends BaseFontLoader{constructor(t){super(t);this.loadingContext={requests:[],nextRequestId:0};this.loadTestFontId=0}get isSyncFontLoadingSupported(){let t=!1;if("undefined"==typeof navigator)t=!0;else{const e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(null==e?void 0:e[1])>=14&&(t=!0)}return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const e=this.loadingContext,r={id:"pdfjs-font-loading-".concat(e.nextRequestId++),done:!1,complete:function completeRequest(){(0,i.assert)(!r.done,"completeRequest() cannot be called twice.");r.done=!0;for(;e.requests.length>0&&e.requests[0].done;){const t=e.requests.shift();setTimeout(t.callback,0)}},callback:t};e.requests.push(r);return r}get _loadTestFont(){return(0,i.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e,r){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,r,i){return t.substring(0,e)+i+t.substring(e+r)}let n,a;const s=this._document.createElement("canvas");s.width=1;s.height=1;const o=s.getContext("2d");let l=0;const c="lt".concat(Date.now()).concat(this.loadTestFontId++);let h=this._loadTestFont;h=spliceString(h,976,c.length,c);const d=1482184792;let u=int32(h,16);for(n=0,a=c.length-3;n<a;n+=4)u=u-d+int32(c,n)|0;n<c.length&&(u=u-d+int32(c+"XXX",n)|0);h=spliceString(h,16,4,(0,i.string32)(u));const p="url(data:font/opentype;base64,".concat(btoa(h),");"),f='@font-face {font-family:"'.concat(c,'";src:').concat(p,"}");this.insertRule(f);const g=[];for(const t of e)g.push(t.loadedName);g.push(c);const v=this._document.createElement("div");v.style.visibility="hidden";v.style.width=v.style.height="10px";v.style.position="absolute";v.style.top=v.style.left="0px";for(const t of g){const e=this._document.createElement("span");e.textContent="Hi";e.style.fontFamily=t;v.append(e)}this._document.body.append(v);!function isFontReady(t,e){l++;if(l>30){(0,i.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,(()=>{v.remove();r.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:r=!0,disableFontFace:i=!1,ignoreErrors:n=!1,onUnsupportedFeature:a,fontRegistry:s=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==r;this.disableFontFace=!0===i;this.ignoreErrors=!0===n;this._onUnsupportedFeature=a;this.fontRegistry=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg"));t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});this.fontRegistry&&this.fontRegistry.registerFont(this);return t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,i.bytesToString)(this.data),e="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");");let r;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;"));r='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(e,"}")}else r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(e,"}");this.fontRegistry&&this.fontRegistry.registerFont(this,e);return r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let r;try{r=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontGetPath});(0,i.warn)('getPathGenerator - ignoring character: "'.concat(t,'".'));return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const t=[];for(const e of r){const r=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",r,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const i of r){"scale"===i.cmd&&(i.args=[e,-e]);t[i.cmd].apply(t,i.args)}}}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;r(79);r(216);r(117);r(138);r(140);r(141);r(217);r(145);r(2);var i=r(1),n=r(202),a=r(218),s=r(220),o=r(219);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,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const l=4096,c=16;function addContextCurrentTransform(t){t._transformStack&&(t._transformStack=[]);if(!t.mozCurrentTransform){t._originalSave=t.save;t._originalRestore=t.restore;t._originalRotate=t.rotate;t._originalScale=t.scale;t._originalTranslate=t.translate;t._originalTransform=t.transform;t._originalSetTransform=t.setTransform;t._originalResetTransform=t.resetTransform;t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0];t._transformStack=[];try{const e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"lineWidth");t._setLineWidth=e.set;t._getLineWidth=e.get;Object.defineProperty(t,"lineWidth",{set:function setLineWidth(t){this._setLineWidth(1.000001*t)},get:function getLineWidth(){return this._getLineWidth()}})}catch(t){}Object.defineProperty(t,"mozCurrentTransform",{get:function getCurrentTransform(){return this._transformMatrix}});Object.defineProperty(t,"mozCurrentTransformInverse",{get:function getCurrentTransformInverse(){const[t,e,r,i,n,a]=this._transformMatrix,s=t*i-e*r,o=e*r-t*i;return[i/s,e/o,r/o,t/s,(i*n-r*a)/o,(e*n-t*a)/s]}});t.save=function ctxSave(){const t=this._transformMatrix;this._transformStack.push(t);this._transformMatrix=t.slice(0,6);this._originalSave()};t.restore=function ctxRestore(){0===this._transformStack.length&&(0,i.warn)("Tried to restore a ctx when the stack was already empty.");const t=this._transformStack.pop();if(t){this._transformMatrix=t;this._originalRestore()}};t.translate=function ctxTranslate(t,e){const r=this._transformMatrix;r[4]=r[0]*t+r[2]*e+r[4];r[5]=r[1]*t+r[3]*e+r[5];this._originalTranslate(t,e)};t.scale=function ctxScale(t,e){const r=this._transformMatrix;r[0]*=t;r[1]*=t;r[2]*=e;r[3]*=e;this._originalScale(t,e)};t.transform=function ctxTransform(e,r,i,n,a,s){const o=this._transformMatrix;this._transformMatrix=[o[0]*e+o[2]*r,o[1]*e+o[3]*r,o[0]*i+o[2]*n,o[1]*i+o[3]*n,o[0]*a+o[2]*s+o[4],o[1]*a+o[3]*s+o[5]];t._originalTransform(e,r,i,n,a,s)};t.setTransform=function ctxSetTransform(e,r,i,n,a,s){this._transformMatrix=[e,r,i,n,a,s];t._originalSetTransform(e,r,i,n,a,s)};t.resetTransform=function ctxResetTransform(){this._transformMatrix=[1,0,0,1,0,0];t._originalResetTransform()};t.rotate=function ctxRotate(t){const e=Math.cos(t),r=Math.sin(t),i=this._transformMatrix;this._transformMatrix=[i[0]*e+i[2]*r,i[1]*e+i[3]*r,i[0]*-r+i[2]*e,i[1]*-r+i[3]*e,i[4],i[5]];this._originalRotate(t)}}}class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,r,i){let n;if(void 0!==this.cache[t]){n=this.cache[t];this.canvasFactory.reset(n,e,r);n.context.setTransform(1,0,0,1,0,0)}else{n=this.canvasFactory.create(e,r);this.cache[t]=n}i&&addContextCurrentTransform(n.context);return n}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,r,i,n,a,s,o,l,c){const[h,d,u,p,f,g]=t.mozCurrentTransform;if(0===d&&0===u){const v=s*h+f,m=Math.round(v),_=o*p+g,y=Math.round(_),b=(s+l)*h+f,A=Math.abs(Math.round(b)-m)||1,P=(o+c)*p+g,S=Math.abs(Math.round(P)-y)||1;t.setTransform(Math.sign(h),0,0,Math.sign(p),m,y);t.drawImage(e,r,i,n,a,0,0,A,S);t.setTransform(h,d,u,p,f,g);return[A,S]}if(0===h&&0===p){const v=o*u+f,m=Math.round(v),_=s*d+g,y=Math.round(_),b=(o+c)*u+f,A=Math.abs(Math.round(b)-m)||1,P=(s+l)*d+g,S=Math.abs(Math.round(P)-y)||1;t.setTransform(0,Math.sign(d),Math.sign(u),0,m,y);t.drawImage(e,r,i,n,a,0,0,S,A);t.setTransform(h,d,u,p,f,g);return[S,A]}t.drawImage(e,r,i,n,a,s,o,l,c);return[Math.hypot(h,d)*l,Math.hypot(u,p)*c]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=i.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=i.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,r){[e,r]=i.Util.applyTransform([e,r],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,r);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,r)}updateRectMinMax(t,e){const r=i.Util.applyTransform(e,t),n=i.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,r[0],n[0]);this.minY=Math.min(this.minY,r[1],n[1]);this.maxX=Math.max(this.maxX,r[0],n[0]);this.maxY=Math.max(this.maxY,r[1],n[1])}updateScalingPathMinMax(t,e){i.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,r,n,a,s,o,l,c,h){const d=i.Util.bezierBoundingBox(e,r,n,a,s,o,l,c);if(h){h[0]=Math.min(h[0],d[0],d[2]);h[1]=Math.max(h[1],d[0],d[2]);h[2]=Math.min(h[2],d[1],d[3]);h[3]=Math.max(h[3],d[1],d[3])}else this.updateRectMinMax(t,d)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,i.unreachable)("Stroke bounding box must include transform.");const t=i.Util.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;r[0]-=n;r[1]-=a;r[2]+=n;r[3]+=a}return r}updateClipFromPath(){const t=i.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]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,a=e.width,s=n%c,o=(n-s)/c,l=0===s?o:o+1,h=t.createImageData(a,c);let d,u=0;const p=e.data,f=h.data;let g,v,m,_,y,b,A,P;if(r)switch(r.length){case 1:y=r[0];b=r[0];A=r[0];P=r[0];break;case 4:y=r[0];b=r[1];A=r[2];P=r[3]}if(e.kind===i.ImageKind.GRAYSCALE_1BPP){const e=p.byteLength,r=new Uint32Array(f.buffer,0,f.byteLength>>2),n=r.length,_=a+7>>3;let y=4294967295,b=i.FeatureTest.isLittleEndian?4278190080:255;P&&255===P[0]&&0===P[255]&&([y,b]=[b,y]);for(g=0;g<l;g++){m=g<o?c:s;d=0;for(v=0;v<m;v++){const t=e-u;let i=0;const n=t>_?a:8*t-7,s=-8&n;let o=0,l=0;for(;i<s;i+=8){l=p[u++];r[d++]=128&l?y:b;r[d++]=64&l?y:b;r[d++]=32&l?y:b;r[d++]=16&l?y:b;r[d++]=8&l?y:b;r[d++]=4&l?y:b;r[d++]=2&l?y:b;r[d++]=1&l?y:b}for(;i<n;i++){if(0===o){l=p[u++];o=128}r[d++]=l&o?y:b;o>>=1}}for(;d<n;)r[d++]=0;t.putImageData(h,0,g*c)}}else if(e.kind===i.ImageKind.RGBA_32BPP){const e=!!(y||b||A);v=0;_=a*c*4;for(g=0;g<o;g++){f.set(p.subarray(u,u+_));u+=_;if(e)for(let t=0;t<_;t+=4){y&&(f[t+0]=y[f[t+0]]);b&&(f[t+1]=b[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(h,0,v);v+=c}if(g<l){_=a*s*4;f.set(p.subarray(u,u+_));if(e)for(let t=0;t<_;t+=4){y&&(f[t+0]=y[f[t+0]]);b&&(f[t+1]=b[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(h,0,v)}}else{if(e.kind!==i.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));{const e=!!(y||b||A);m=c;_=a*m;for(g=0;g<l;g++){if(g>=o){m=s;_=a*m}d=0;for(v=_;v--;){f[d++]=p[u++];f[d++]=p[u++];f[d++]=p[u++];f[d++]=255}if(e)for(let t=0;t<d;t+=4){y&&(f[t+0]=y[f[t+0]]);b&&(f[t+1]=b[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(h,0,g*c)}}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const r=e.height,i=e.width,n=r%c,a=(r-n)/c,o=0===n?a:a+1,l=t.createImageData(i,c);let h=0;const d=e.data,u=l.data;for(let e=0;e<o;e++){const r=e<a?c:n;({srcPos:h}=(0,s.applyMaskImageData)({src:d,srcPos:h,dest:u,width:i,height:r}));t.putImageData(l,0,e*c)}}function copyCtxState(t,e){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let i=0,n=r.length;i<n;i++){const n=r[i];void 0!==t[n]&&(e[n]=t[n])}if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t,e){t.strokeStyle=t.fillStyle=e||"#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,e,r,i){const n=t.length;for(let a=3;a<n;a+=4){const n=t[a];if(0===n){t[a-3]=e;t[a-2]=r;t[a-1]=i}else if(n<255){const s=255-n;t[a-3]=t[a-3]*n+e*s>>8;t[a-2]=t[a-2]*n+r*s>>8;t[a-1]=t[a-1]*n+i*s>>8}}}function composeSMaskAlpha(t,e,r){const i=t.length;for(let n=3;n<i;n+=4){const i=r?r[t[n]]:t[n];e[n]=e[n]*i*.00392156862745098|0}}function composeSMaskLuminosity(t,e,r){const i=t.length;for(let n=3;n<i;n+=4){const i=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=r?e[n]*r[i>>8]>>8:e[n]*i>>16}}function composeSMask(t,e,r,i){const n=i[0],a=i[1],s=i[2]-n,o=i[3]-a;if(0!==s&&0!==o){!function genericComposeSMask(t,e,r,i,n,a,s,o,l,c,h){const d=!!a,u=d?a[0]:0,p=d?a[1]:0,f=d?a[2]:0;let g;g="Luminosity"===n?composeSMaskLuminosity:composeSMaskAlpha;const v=Math.min(i,Math.ceil(1048576/r));for(let n=0;n<i;n+=v){const a=Math.min(v,i-n),m=t.getImageData(o-c,n+(l-h),r,a),_=e.getImageData(o,n+l,r,a);d&&composeSMaskBackdrop(m.data,u,p,f);g(m.data,_.data,s);e.putImageData(_,o,n+l)}}(e.context,r,s,o,e.subtype,e.backdrop,e.transferMap,n,a,e.offsetX,e.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(r.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,e){const r=i.Util.singularValueDecompose2dScale(t);r[0]=Math.fround(r[0]);r[1]=Math.fround(r[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:r[0]<=a||r[1]<=a}const h=["butt","round","square"],d=["miter","round","bevel"],u={},p={};var f=new WeakSet;class CanvasGraphics{constructor(t,e,r,i,n,a,s,o){_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=r;this.canvasFactory=i;this.imageLayer=n;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=[];this.optionalContentConfig=a;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=s;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.backgroundColor=(null==o?void 0:o.background)||null;this.foregroundColor=(null==o?void 0:o.foreground)||null;t&&addContextCurrentTransform(t);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:r,transparency:i=!1,background:a=null,backgroundColorToReplace:s=null}=t;const o=this.ctx.canvas.width,l=this.ctx.canvas.height,c=a||"#ffffff";this.ctx.save();if("function"==typeof a)a({context:this.ctx,width:o,height:l});else if(this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const t=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const e=this.backgroundColor=this.ctx.fillStyle;let r=!0,i=c;this.ctx.fillStyle=c;i=this.ctx.fillStyle;r="string"==typeof i&&/^#[0-9A-Fa-f]{6}$/.test(i);if("#000000"===t&&"#ffffff"===e||t===e||!r)this.foregroundColor=this.backgroundColor=null;else{const[r,a,s]=(0,n.getRGB)(i),newComp=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,o=Math.round(.2126*newComp(r)+.7152*newComp(a)+.0722*newComp(s));this.selectColor=(r,i,n)=>{const a=.2126*newComp(r)+.7152*newComp(i)+.0722*newComp(n);return Math.round(a)===o?e:t}}}else{a&&(this.background=a);this.backgroundColor=a}if("function"!=typeof a){this.ctx.fillStyle=this.backgroundColor||c;this.ctx.fillRect(0,0,o,l)}this.ctx.restore();this.backgroundColorToReplace=s;if(i){const t=this.cachedCanvases.getCanvas("transparent",o,l,!0);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save();resetCtxToDefault(this.ctx,this.foregroundColor);if(e){this.ctx.transform.apply(this.ctx,e);this.outputScaleX=e[0];this.outputScaleY=e[0]}this.ctx.transform.apply(this.ctx,r.transform);this.viewportScale=r.scale;this.baseTransform=this.ctx.mozCurrentTransform.slice();this.imageLayer&&this.imageLayer.beginLayout()}executeOperatorList(t,e,r,n){const a=t.argsArray,s=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"==typeof r,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==n&&o===n.nextBreakPoint){n.breakIt(o,r);return o}f=s[o];if(f!==i.OPS.dependency)this[f].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,r);return o}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){r();return o}d=0}}}endDrawing(){_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();this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(t,e){const r=t.width,i=t.height;let n,a,s=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=r,c=i,h="prescale1";for(;s>2&&l>1||o>2&&c>1;){let e=l,r=c;if(s>2&&l>1){e=Math.ceil(l/2);s/=l/e}if(o>2&&c>1){r=Math.ceil(c/2);o/=c/r}n=this.cachedCanvases.getCanvas(h,e,r,!1);a=n.context;a.clearRect(0,0,e,r);a.drawImage(t,0,0,l,c,0,0,e,r);t=n.canvas;l=e;c=r;h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:r,height:n}=t,s=this.current.fillColor,o=this.current.patternFill,l=e.mozCurrentTransform;let c,h,d,u;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer,r=l.slice(0,4);h=JSON.stringify(o?r:[r,s]);c=this._cachedBitmapsMap.get(e);if(!c){c=new Map;this._cachedBitmapsMap.set(e,c)}const i=c.get(h);if(i&&!o){return{canvas:i,offsetX:Math.round(Math.min(l[0],l[2])+l[4]),offsetY:Math.round(Math.min(l[1],l[3])+l[5])}}d=i}if(!d){u=this.cachedCanvases.getCanvas("maskCanvas",r,n,!1);putBinaryImageMask(u.context,t)}let p=i.Util.transform(l,[1/r,0,0,-1/n,0,0]);p=i.Util.transform(p,[1,0,0,1,0,-n]);const f=i.Util.applyTransform([0,0],p),g=i.Util.applyTransform([r,n],p),v=i.Util.normalizeRect([f[0],f[1],g[0],g[1]]),m=Math.round(v[2]-v[0])||1,_=Math.round(v[3]-v[1])||1,y=this.cachedCanvases.getCanvas("fillCanvas",m,_,!0),b=y.context,A=Math.min(f[0],g[0]),P=Math.min(f[1],g[1]);b.translate(-A,-P);b.transform.apply(b,p);if(!d){d=this._scaleImage(u.canvas,b.mozCurrentTransformInverse);d=d.img;c&&o&&c.set(h,d)}b.imageSmoothingEnabled=getImageSmoothingEnabled(b.mozCurrentTransform,t.interpolate);drawImageAtIntegerCoords(b,d,0,0,d.width,d.height,0,0,r,n);b.globalCompositeOperation="source-in";const S=i.Util.transform(b.mozCurrentTransformInverse,[1,0,0,1,-A,-P]);b.fillStyle=o?s.getPattern(e,this,S,a.PathType.FILL):s;b.fillRect(0,0,r,n);if(c&&!o){this.cachedCanvases.delete("fillCanvas");c.set(h,y.canvas)}return{canvas:y.canvas,offsetX:Math.round(A),offsetY:Math.round(P)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=d[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const r=this.ctx;if(void 0!==r.setLineDash){r.setLineDash(t);r.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let e=0,r=t.length;e<r;e++){const r=t[e],i=r[0],n=r[1];switch(i){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=r[1];break;case"ca":this.current.fillAlpha=r[1];this.ctx.globalAlpha=r[1];break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=n}}}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,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,t,e,!0);this.suspendedCtx=this.ctx;this.ctx=i.context;const n=this.ctx;n.setTransform.apply(n,this.suspendedCtx.mozCurrentTransform);copyCtxState(this.suspendedCtx,n);!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,r){e.translate(t,r);this.__originalTranslate(t,r)};t.scale=function ctxScale(t,r){e.scale(t,r);this.__originalScale(t,r)};t.transform=function ctxTransform(t,r,i,n,a,s){e.transform(t,r,i,n,a,s);this.__originalTransform(t,r,i,n,a,s)};t.setTransform=function ctxSetTransform(t,r,i,n,a,s){e.setTransform(t,r,i,n,a,s);this.__originalSetTransform(t,r,i,n,a,s)};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,r){e.moveTo(t,r);this.__originalMoveTo(t,r)};t.lineTo=function(t,r){e.lineTo(t,r);this.__originalLineTo(t,r)};t.bezierCurveTo=function(t,r,i,n,a,s){e.bezierCurveTo(t,r,i,n,a,s);this.__originalBezierCurveTo(t,r,i,n,a,s)};t.rect=function(t,r,i,n){e.rect(t,r,i,n);this.__originalRect(t,r,i,n)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(n,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,r,i,n,a){this.ctx.transform(t,e,r,i,n,a);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(t,e,r){const n=this.ctx,a=this.current;let s,o,l=a.x,c=a.y;const h=n.mozCurrentTransform,d=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],u=d?r.slice(0):null;for(let r=0,p=0,f=t.length;r<f;r++)switch(0|t[r]){case i.OPS.rectangle:l=e[p++];c=e[p++];const t=e[p++],r=e[p++],f=l+t,g=c+r;n.moveTo(l,c);if(0===t||0===r)n.lineTo(f,g);else{n.lineTo(f,c);n.lineTo(f,g);n.lineTo(l,g)}d||a.updateRectMinMax(h,[l,c,f,g]);n.closePath();break;case i.OPS.moveTo:l=e[p++];c=e[p++];n.moveTo(l,c);d||a.updatePathMinMax(h,l,c);break;case i.OPS.lineTo:l=e[p++];c=e[p++];n.lineTo(l,c);d||a.updatePathMinMax(h,l,c);break;case i.OPS.curveTo:s=l;o=c;l=e[p+4];c=e[p+5];n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],l,c);a.updateCurvePathMinMax(h,s,o,e[p],e[p+1],e[p+2],e[p+3],l,c,u);p+=6;break;case i.OPS.curveTo2:s=l;o=c;n.bezierCurveTo(l,c,e[p],e[p+1],e[p+2],e[p+3]);a.updateCurvePathMinMax(h,s,o,l,c,e[p],e[p+1],e[p+2],e[p+3],u);l=e[p+2];c=e[p+3];p+=4;break;case i.OPS.curveTo3:s=l;o=c;l=e[p+2];c=e[p+3];n.bezierCurveTo(e[p],e[p+1],l,c,l,c);a.updateCurvePathMinMax(h,s,o,e[p],e[p+1],l,c,l,c,u);p+=4;break;case i.OPS.closePath:n.closePath()}d&&a.updateScalingPathMinMax(h,u);a.setCurrentPoint(l,c)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;const e=this.ctx,r=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof r&&null!=r&&r.getPattern){e.save();e.strokeStyle=r.getPattern(e,this,e.mozCurrentTransformInverse,a.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(t){t=void 0===t||t;const e=this.ctx;let r=!0,i=this.current.fillColor;this.backgroundColorToReplace&&i===this.backgroundColorToReplace&&(this.background&&"function"!=typeof this.background?i=this.background:r=!1);let n=!1;if(this.current.patternFill){e.save();e.fillStyle=i.getPattern(e,this,e.mozCurrentTransformInverse,a.PathType.FILL);n=!0}const s=this.current.getClippedPathBoundingBox();if(r&&this.contentVisible&&null!==s)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();n&&e.restore();t&&this.consumePath(s)}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=i.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 r of t){e.setTransform.apply(e,r.transform);e.translate(r.x,r.y);r.addToPath(e,r.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 r=this.commonObjs.get(t),n=this.current;if(!r)throw new Error("Can't find font for ".concat(t));n.fontMatrix=r.fontMatrix||i.FONT_IDENTITY_MATRIX;0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;n.fontDirection=-1}else n.fontDirection=1;this.current.font=r;this.current.fontSize=e;if(r.isType3Font)return;const a=r.loadedName||"sans-serif";let s="normal";r.black?s="900":r.bold&&(s="bold");const o=r.italic?"italic":"normal",l='"'.concat(a,'", ').concat(r.fallbackName);let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font="".concat(o," ").concat(s," ").concat(c,"px ").concat(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,r,i,n,a){this.current.textMatrix=[t,e,r,i,n,a];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,r,n){const a=this.ctx,s=this.current,o=s.font,l=s.textRenderingMode,c=s.fontSize/s.fontSizeScale,h=l&i.TextRenderingMode.FILL_STROKE_MASK,d=!!(l&i.TextRenderingMode.ADD_TO_PATH_FLAG),u=s.patternFill&&!o.missingFile;let p;(o.disableFontFace||d||u)&&(p=o.getPathGenerator(this.commonObjs,t));if(o.disableFontFace||u){a.save();a.translate(e,r);a.beginPath();p(a,c);n&&a.setTransform.apply(a,n);h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||a.fill();h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||a.stroke();a.restore()}else{h!==i.TextRenderingMode.FILL&&h!==i.TextRenderingMode.FILL_STROKE||a.fillText(t,e,r);h!==i.TextRenderingMode.STROKE&&h!==i.TextRenderingMode.FILL_STROKE||a.strokeText(t,e,r)}if(d){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:a.mozCurrentTransform,x:e,y:r,fontSize:c,addToPath:p})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10,!1);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let r=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){r=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(t){const e=this.current,r=e.font;if(r.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,o=e.fontSizeScale,l=e.charSpacing,c=e.wordSpacing,h=e.fontDirection,d=e.textHScale*h,u=t.length,p=r.vertical,f=p?1:-1,g=r.defaultVMetrics,v=n*e.fontMatrix[0],m=e.textRenderingMode===i.TextRenderingMode.FILL&&!r.disableFontFace&&!e.patternFill;s.save();s.transform.apply(s,e.textMatrix);s.translate(e.x,e.y+e.textRise);h>0?s.scale(d,-1):s.scale(d,1);let _;if(e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,s.mozCurrentTransformInverse,a.PathType.FILL);_=s.mozCurrentTransform;s.restore();s.fillStyle=t}let y=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===y){const t=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;t!==i.TextRenderingMode.STROKE&&t!==i.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=b;if(1!==o){s.scale(o,o);y/=o}s.lineWidth=y;let A,P=0;for(A=0;A<u;++A){const e=t[A];if("number"==typeof e){P+=f*e*n/1e3;continue}let i=!1;const a=(e.isSpace?c:0)+l,d=e.fontChar,u=e.accent;let y,b,S,x=e.width;if(p){const t=e.vmetric||g,r=-(e.vmetric?t[1]:.5*x)*v,i=t[2]*v;x=t?-t[0]:x;y=r/o;b=(P+i)/o}else{y=P/o;b=0}if(r.remeasure&&x>0){const t=1e3*s.measureText(d).width/n*o;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;i=!0;s.save();s.scale(e,1);y/=e}else x!==t&&(y+=(x-t)/2e3*n/o)}if(this.contentVisible&&(e.isInFont||r.missingFile))if(m&&!u)s.fillText(d,y,b);else{this.paintChar(d,y,b,_);if(u){const t=y+n*u.offset.x/o,e=b-n*u.offset.y/o;this.paintChar(u.fontChar,t,e,_)}}S=p?x*v-a*h:x*v+a*h;P+=S;i&&s.restore()}p?e.y-=P:e.x+=P*d;s.restore();this.compose()}showType3Text(t){const e=this.ctx,r=this.current,n=r.font,a=r.fontSize,s=r.fontDirection,o=n.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,h=r.textHScale*s,d=r.fontMatrix||i.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,v;if(!(r.textRenderingMode===i.TextRenderingMode.INVISIBLE)&&0!==a){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;e.save();e.transform.apply(e,r.textMatrix);e.translate(r.x,r.y);e.scale(h,s);for(p=0;p<u;++p){f=t[p];if("number"==typeof f){v=o*f*a/1e3;this.ctx.translate(v,0);r.x+=v*h;continue}const s=(f.isSpace?c:0)+l,u=n.charProcOperatorList[f.operatorListId];if(!u){(0,i.warn)('Type3 character "'.concat(f.operatorListId,'" is not available.'));continue}if(this.contentVisible){this.processingType3=f;this.save();e.scale(a,a);e.transform.apply(e,d);this.executeOperatorList(u);this.restore()}g=i.Util.applyTransform([f.width,0],d)[0]*a+s;e.translate(g,0);r.x+=g*h}e.restore();this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,r,i,n,a){this.ctx.rect(r,i,n-r,a-i);this.ctx.clip();this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const r=t[1],i=this.baseTransform||this.ctx.mozCurrentTransform.slice(),n={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory)};e=new a.TilingPattern(t,r,this.ctx,n,i)}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,r){var n;const a=(null===(n=this.selectColor)||void 0===n?void 0:n.call(this,t,e,r))||i.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=a;this.current.strokeColor=a}setFillRGBColor(t,e,r){var n;let a=(null===(n=this.selectColor)||void 0===n?void 0:n.call(this,t,e,r))||i.Util.makeHexColor(t,e,r);this.backgroundColorToReplace&&a===this.backgroundColorToReplace&&this.background&&"function"!=typeof this.background&&(a=this.background);this.ctx.fillStyle=a;this.current.fillColor=a;this.current.patternFill=!1}_getPattern(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))e=this.cachedPatterns.get(t);else{e=(0,a.getShadingPattern)(this.objs.get(t));this.cachedPatterns.set(t,e)}r&&(e.matrix=r);return e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const r=this._getPattern(t);e.fillStyle=r.getPattern(e,this,e.mozCurrentTransformInverse,a.PathType.SHADING);const n=e.mozCurrentTransformInverse;if(n){const t=e.canvas,r=t.width,a=t.height,s=i.Util.applyTransform([0,0],n),o=i.Util.applyTransform([0,a],n),l=i.Util.applyTransform([r,0],n),c=i.Util.applyTransform([r,a],n),h=Math.min(s[0],o[0],l[0],c[0]),d=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(h,d,u-h,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform.apply(this,t);this.baseTransform=this.ctx.mozCurrentTransform;if(e){const t=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],t,r);this.current.updateRectMinMax(this.ctx.mozCurrentTransform,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,i.info)("TODO: Support non-isolated groups.");t.knockout&&(0,i.warn)("Knockout groups not supported.");const r=e.mozCurrentTransform;t.matrix&&e.transform.apply(e,t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let n=i.Util.getAxialAlignedBoundingBox(t.bbox,e.mozCurrentTransform);const a=[0,0,e.canvas.width,e.canvas.height];n=i.Util.intersect(n,a)||[0,0,0,0];const s=Math.floor(n[0]),o=Math.floor(n[1]);let c=Math.max(Math.ceil(n[2])-s,1),h=Math.max(Math.ceil(n[3])-o,1),d=1,u=1;if(c>l){d=c/l;c=l}if(h>l){u=h/l;h=l}this.current.startNewPathAndClipBox([0,0,c,h]);let p="groupAt"+this.groupLevel;t.smask&&(p+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(p,c,h,!0),g=f.context;g.scale(1/d,1/u);g.translate(-s,-o);g.transform.apply(g,r);if(t.smask)this.smaskStack.push({canvas:f.canvas,context:g,offsetX:s,offsetY:o,scaleX:d,scaleY:u,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(s,o);e.scale(d,u);e.save()}copyCtxState(e,g);this.ctx=g;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,r=this.groupStack.pop();this.ctx=r;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=this.ctx.mozCurrentTransform;this.restore();this.ctx.save();this.ctx.setTransform.apply(this.ctx,t);const r=i.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(r)}}beginAnnotation(t,e,r,n,a){_classPrivateMethodGet(this,f,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform);if(Array.isArray(e)&&4===e.length){const n=e[2]-e[0],s=e[3]-e[1];if(a&&this.annotationCanvasMap){(r=r.slice())[4]-=e[0];r[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=n;e[3]=s;const[a,o]=i.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),{viewportScale:l}=this,c=Math.ceil(n*this.outputScaleX*l),h=Math.ceil(s*this.outputScaleY*l);this.annotationCanvas=this.canvasFactory.create(c,h);const{canvas:d,context:u}=this.annotationCanvas;this.annotationCanvasMap.set(t,d);this.annotationCanvas.savedCtx=this.ctx;this.ctx=u;addContextCurrentTransform(this.ctx);this.ctx.setTransform(a,0,0,-o,0,s*o);resetCtxToDefault(this.ctx,this.foregroundColor)}else{resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.rect(e[0],e[1],n,s);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform.apply(this,r);this.transform.apply(this,n)}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 r=this.ctx,i=this.processingType3;if(i){void 0===i.compiled&&(i.compiled=function compileType3Glyph(t){const{width:e,height:r}=t;if(e>1e3||r>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e+1;let a,s,l,c=new Uint8Array(n*(r+1));const h=e+7&-8;let d=new Uint8Array(h*r),u=0;for(const e of t.data){let t=128;for(;t>0;){d[u++]=e&t?0:255;t>>=1}}let p=0;u=0;if(0!==d[u]){c[0]=1;++p}for(s=1;s<e;s++){if(d[u]!==d[u+1]){c[s]=d[u]?2:1;++p}u++}if(0!==d[u]){c[s]=2;++p}for(a=1;a<r;a++){u=a*h;l=a*n;if(d[u-h]!==d[u]){c[l]=d[u]?1:8;++p}let t=(d[u]?4:0)+(d[u-h]?8:0);for(s=1;s<e;s++){t=(t>>2)+(d[u+1]?4:0)+(d[u-h+1]?8:0);if(i[t]){c[l+s]=i[t];++p}u++}if(d[u-h]!==d[u]){c[l+s]=d[u]?2:4;++p}if(p>1e3)return null}u=h*(r-1);l=a*n;if(0!==d[u]){c[l]=8;++p}for(s=1;s<e;s++){if(d[u]!==d[u+1]){c[l+s]=d[u]?4:8;++p}u++}if(0!==d[u]){c[l+s]=4;++p}if(p>1e3)return null;const f=new Int32Array([0,n,-1,0,-n,0,0,0,1]);let g,v,m;o.isNodeJS?v=[]:g=new Path2D;for(a=0;p&&a<=r;a++){let t=a*n;const r=t+e;for(;t<r&&!c[t];)t++;if(t===r)continue;g?g.moveTo(t%n,a):m=[t%n,a];const i=t;let s=c[t];do{const e=f[s];do{t+=e}while(!c[t]);const r=c[t];if(5!==r&&10!==r){s=r;c[t]=0}else{s=r&51*s>>4;c[t]&=s>>2|s<<2}g?g.lineTo(t%n,t/n|0):m.push(t%n,t/n|0);c[t]||--p}while(i!==t);g||v.push(m);--a}d=null;c=null;return function(t){t.save();t.scale(1/e,-1/r);t.translate(0,-r);if(g)t.fill(g);else{t.beginPath();for(const e of v){t.moveTo(e[0],e[1]);for(let r=2,i=e.length;r<i;r+=2)t.lineTo(e[r],e[r+1])}t.fill()}t.beginPath();t.restore()}}(t));if(i.compiled){i.compiled(r);return}}const n=this._createMaskCanvas(t),a=n.canvas;r.save();r.setTransform(1,0,0,1,0,0);r.drawImage(a,n.offsetX,n.offsetY);r.restore();this.compose()}paintImageMaskXObjectRepeat(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const o=this.ctx;o.save();const l=o.mozCurrentTransform;o.transform(e,r,n,a,0,0);const c=this._createMaskCanvas(t);o.setTransform(1,0,0,1,0,0);for(let t=0,h=s.length;t<h;t+=2){const h=i.Util.transform(l,[e,r,n,a,s[t],s[t+1]]),[d,u]=i.Util.applyTransform([0,0],h);o.drawImage(c.canvas,d,u)}o.restore();this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(const n of t){const{data:t,width:s,height:o,transform:l}=n,c=this.cachedCanvases.getCanvas("maskCanvas",s,o,!1),h=c.context;h.save();putBinaryImageMask(h,this.getObject(t,n));h.globalCompositeOperation="source-in";h.fillStyle=i?r.getPattern(h,this,e.mozCurrentTransformInverse,a.PathType.FILL):r;h.fillRect(0,0,s,o);h.restore();e.save();e.transform.apply(e,l);e.scale(1,-1);drawImageAtIntegerCoords(e,c.canvas,0,0,s,o,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,i.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,r,n){if(!this.contentVisible)return;const a=this.getObject(t);if(!a){(0,i.warn)("Dependent image isn't ready yet");return}const s=a.width,o=a.height,l=[];for(let t=0,i=n.length;t<i;t+=2)l.push({transform:[e,0,0,r,n[t],n[t+1]],x:0,y:0,w:s,h:o});this.paintInlineImageXObjectGroup(a,l)}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,r=t.height,i=this.ctx;this.save();i.scale(1/e,-1/r);let n;if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)n=t;else{const i=this.cachedCanvases.getCanvas("inlineImage",e,r,!1);putBinaryImageData(i.context,t,this.current.transferMaps);n=i.canvas}const a=this._scaleImage(n,i.mozCurrentTransformInverse);i.imageSmoothingEnabled=getImageSmoothingEnabled(i.mozCurrentTransform,t.interpolate);const[s,o]=drawImageAtIntegerCoords(i,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,e,r);if(this.imageLayer){const e=this.getCanvasPosition(0,-r);this.imageLayer.appendImage({imgData:t,left:e[0],top:e[1],width:s,height:o})}this.compose();this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const r=this.ctx,i=t.width,n=t.height,a=this.cachedCanvases.getCanvas("inlineImage",i,n,!1);putBinaryImageData(a.context,t,this.current.transferMaps);for(let s=0,o=e.length;s<o;s++){const o=e[s];r.save();r.transform.apply(r,o.transform);r.scale(1,-1);drawImageAtIntegerCoords(r,a.canvas,o.x,o.y,o.w,o.h,0,-1,1,1);if(this.imageLayer){const e=this.getCanvasPosition(o.x,o.y);this.imageLayer.appendImage({imgData:t,left:e[0],top:e[1],width:i,height:n})}r.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 r=this.ctx;if(this.pendingClip){e||(this.pendingClip===p?r.clip("evenodd"):r.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=this.ctx.mozCurrentTransform;if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=this.ctx.mozCurrentTransform;let r,i;if(0===e[1]&&0===e[2]){const n=Math.abs(e[0]),a=Math.abs(e[3]);if(0===t){r=1/n;i=1/a}else{const e=n*t,s=a*t;r=e<1?1/e:1;i=s<1?1/s:1}}else{const n=Math.abs(e[0]*e[3]-e[2]*e[1]),a=Math.hypot(e[0],e[1]),s=Math.hypot(e[2],e[3]);if(0===t){r=s/n;i=a/n}else{const e=t*n;r=s>e?s/e:1;i=a>e?a/e:1}}this._cachedScaleForStroking=[r,i]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:r}=this.current,[i,n]=this.getScaleForStroking();e.lineWidth=r||1;if(1===i&&1===n){e.stroke();return}let a,s,o;if(t){a=e.mozCurrentTransform.slice();s=e.getLineDash().slice();o=e.lineDashOffset}e.scale(i,n);const l=Math.max(i,n);e.setLineDash(e.getLineDash().map((t=>t/l)));e.lineDashOffset/=l;e.stroke();if(t){e.setTransform(...a);e.setLineDash(s);e.lineDashOffset=o}}getCanvasPosition(t,e){const r=this.ctx.mozCurrentTransform;return[r[0]*t+r[2]*e+r[4],r[1]*t+r[3]*e+r[5]]}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 i.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[i.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,r)=>{var i=r(3),n=Math.hypot,a=Math.abs,s=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function hypot(t,e){for(var r,i,n=0,o=0,l=arguments.length,c=0;o<l;)if(c<(r=a(arguments[o++]))){n=n*(i=c/r)*i+1;c=r}else n+=r>0?(i=r/c)*i:r;return c===1/0?1/0:c*s(n)}})},(t,e,r)=>{r(118)("Int32",(function(t){return function Int32Array(e,r,i){return t(this,e,r,i)}}))},(t,e,r)=>{"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: ".concat(t[0]))};r(79);var i=r(1),n=r(219);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=a;function applyBoundingBox(t,e){if(!e||n.isNodeJS)return;const r=e[2]-e[0],i=e[3]-e[1],a=new Path2D;a.rect(e[0],e[1],r,i);t.clip(a)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.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,r,n){let s;if(n===a.STROKE||n===a.FILL){const a=e.current.getClippedPathBoundingBox(n,t.mozCurrentTransform)||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,c=e.cachedCanvases.getCanvas("pattern",o,l,!0),h=c.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(-a[0],-a[1]);r=i.Util.transform(r,[1,0,0,1,a[0],a[1]]);h.transform.apply(h,e.baseTransform);this.matrix&&h.transform.apply(h,this.matrix);applyBoundingBox(h,this._bbox);h.fillStyle=this._createGradient(h);h.fill();s=t.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(r);try{s.setTransform(d)}catch(t){(0,i.warn)('RadialAxialShadingPattern.getPattern: "'.concat(null==t?void 0:t.message,'".'))}}else{applyBoundingBox(t,this._bbox);s=this._createGradient(t)}return s}}function drawTriangle(t,e,r,i,n,a,s,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;if(l[r+1]>l[i+1]){u=r;r=i;i=u;u=a;a=s;s=u}if(l[i+1]>l[n+1]){u=i;i=n;n=u;u=s;s=o;o=u}if(l[r+1]>l[i+1]){u=r;r=i;i=u;u=a;a=s;s=u}const p=(l[r]+e.offsetX)*e.scaleX,f=(l[r+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,v=(l[i+1]+e.offsetY)*e.scaleY,m=(l[n]+e.offsetX)*e.scaleX,_=(l[n+1]+e.offsetY)*e.scaleY;if(f>=_)return;const y=c[a],b=c[a+1],A=c[a+2],P=c[s],S=c[s+1],x=c[s+2],w=c[o],E=c[o+1],k=c[o+2],T=Math.round(f),C=Math.round(_);let M,R,I,D,O,L,G,N;for(let t=T;t<=C;t++){if(t<v){let e;e=t<f?0:(f-t)/(f-v);M=p-(p-g)*e;R=y-(y-P)*e;I=b-(b-S)*e;D=A-(A-x)*e}else{let e;e=t>_?1:v===_?0:(v-t)/(v-_);M=g-(g-m)*e;R=P-(P-w)*e;I=S-(S-E)*e;D=x-(x-k)*e}let e;e=t<f?0:t>_?1:(f-t)/(f-_);O=p-(p-m)*e;L=y-(y-w)*e;G=b-(b-E)*e;N=A-(A-k)*e;const r=Math.round(Math.min(M,O)),i=Math.round(Math.max(M,O));let n=d*t+4*r;for(let t=r;t<=i;t++){e=(M-t)/(M-O);e<0?e=0:e>1&&(e=1);h[n++]=R-(R-L)*e|0;h[n++]=I-(I-G)*e|0;h[n++]=D-(D-N)*e|0;h[n++]=255}}}function drawFigure(t,e,r){const i=e.coords,n=e.colors;let a,s;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++){drawTriangle(t,r,i[e],i[e+1],i[e+o],n[e],n[e+1],n[e+o]);drawTriangle(t,r,i[e+o+1],i[e+1],i[e+o],n[e+o+1],n[e+1],n[e+o])}}break;case"triangles":for(a=0,s=i.length;a<s;a+=3)drawTriangle(t,r,i[a],i[a+1],i[a+2],n[a],n[a+1],n[a+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,r){const i=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-i,s=Math.ceil(this._bounds[3])-n,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(s*t[1]*1.1)),3e3),c=a/o,h=s/l,d={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-n,scaleX:1/c,scaleY:1/h},u=o+4,p=l+4,f=r.getCanvas("mesh",u,p,!1),g=f.context,v=g.createImageData(o,l);if(e){const t=v.data;for(let r=0,i=t.length;r<i;r+=4){t[r]=e[0];t[r+1]=e[1];t[r+2]=e[2];t[r+3]=255}}for(const t of this._figures)drawFigure(v,t,d);g.putImageData(v,2,2);return{canvas:f.canvas,offsetX:i-2*c,offsetY:n-2*h,scaleX:c,scaleY:h}}getPattern(t,e,r,n){applyBoundingBox(t,this._bbox);let s;if(n===a.SHADING)s=i.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else{s=i.Util.singularValueDecompose2dScale(e.baseTransform);if(this.matrix){const t=i.Util.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}}const o=this._createMeshCanvas(s,n===a.SHADING?null:this._background,e.cachedCanvases);if(n!==a.SHADING){t.setTransform.apply(t,e.baseTransform);this.matrix&&t.transform.apply(t,this.matrix)}t.translate(o.offsetX,o.offsetY);t.scale(o.scaleX,o.scaleY);return t.createPattern(o.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const s=1,o=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,i.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,r,i,n){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=r;this.canvasGraphicsFactory=i;this.baseTransform=n}createPatternCanvas(t){const e=this.operatorList,r=this.bbox,n=this.xstep,a=this.ystep,s=this.paintType,o=this.tilingType,l=this.color,c=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+o);const h=r[0],d=r[1],u=r[2],p=r[3],f=i.Util.singularValueDecompose2dScale(this.matrix),g=i.Util.singularValueDecompose2dScale(this.baseTransform),v=[f[0]*g[0],f[1]*g[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,v[0]),_=this.getSizeAndScale(a,this.ctx.canvas.height,v[1]),y=t.cachedCanvases.getCanvas("pattern",m.size,_.size,!0),b=y.context,A=c.createCanvasGraphics(b);A.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(A,s,l);let P=h,S=d,x=u,w=p;if(h<0){P=0;x+=Math.abs(h)}if(d<0){S=0;w+=Math.abs(d)}b.translate(-m.scale*P,-_.scale*S);A.transform(m.scale,0,0,_.scale,0,0);b.save();this.clipBbox(A,P,S,x,w);A.baseTransform=A.ctx.mozCurrentTransform.slice();A.executeOperatorList(e);A.endDrawing();return{canvas:y.canvas,scaleX:m.scale,scaleY:_.scale,offsetX:P,offsetY:S}}getSizeAndScale(t,e,r){t=Math.abs(t);const i=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let n=Math.ceil(t*r);n>=i?n=i:r=n/t;return{scale:r,size:n}}clipBbox(t,e,r,i,n){const a=i-e,s=n-r;t.ctx.rect(e,r,a,s);t.current.updateRectMinMax(t.ctx.mozCurrentTransform,[e,r,i,n]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,r){const n=t.ctx,a=t.current;switch(e){case s:const t=this.ctx;n.fillStyle=t.fillStyle;n.strokeStyle=t.strokeStyle;a.fillColor=t.fillStyle;a.strokeColor=t.strokeStyle;break;case o:const l=i.Util.makeHexColor(r[0],r[1],r[2]);n.fillStyle=l;n.strokeStyle=l;a.fillColor=l;a.strokeColor=l;break;default:throw new i.FormatError("Unsupported paint type: ".concat(e))}}getPattern(t,e,r,n){let s=r;if(n!==a.SHADING){s=i.Util.transform(s,e.baseTransform);this.matrix&&(s=i.Util.transform(s,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(s);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");try{c.setTransform(l)}catch(t){(0,i.warn)('TilingPattern.getPattern: "'.concat(null==t?void 0:t.message,'".'))}return c}}e.TilingPattern=TilingPattern},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.applyMaskImageData=function applyMaskImageData(t){let{src:e,srcPos:r=0,dest:n,destPos:a=0,width:s,height:o,inverseDecode:l=!1}=t;const c=i.FeatureTest.isLittleEndian?4278190080:255,[h,d]=l?[0,c]:[c,0],u=s>>3,p=7&s,f=e.length;n=new Uint32Array(n.buffer);for(let t=0;t<o;t++){for(const t=r+u;r<t;r++){const t=r<f?e[r]:255;n[a++]=128&t?d:h;n[a++]=64&t?d:h;n[a++]=32&t?d:h;n[a++]=16&t?d:h;n[a++]=8&t?d:h;n[a++]=4&t?d:h;n[a++]=2&t?d:h;n[a++]=1&t?d:h}if(0===p)continue;const t=r<f?e[r++]:255;for(let e=0;e<p;e++)n[a++]=t&1<<7-e?d:h}return{srcPos:r,destPos:a}};r(79);r(145);r(138);r(140);r(141);var i=r(1)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const r=Object.create(null);e.GlobalWorkerOptions=r;r.workerPort=void 0===r.workerPort?null:r.workerPort;r.workerSrc=void 0===r.workerSrc?"":r.workerSrc},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;r(152);r(223);r(79);var i=r(1);const n=1,a=2,s=1,o=2,l=3,c=4,h=5,d=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,r){this.sourceName=t;this.targetName=e;this.comObj=r;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,r=this.callbackCapabilities[t];if(!r)throw new Error("Cannot resolve callback ".concat(t));delete this.callbackCapabilities[t];if(e.callback===n)r.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");r.reject(wrapReason(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(i(e.data))})).then((function(i){r.postMessage({sourceName:t,targetName:s,callback:n,callbackId:e.callbackId,data:i})}),(function(i){r.postMessage({sourceName:t,targetName:s,callback:a,callbackId:e.callbackId,reason:wrapReason(i)})}))}else e.streamId?this._createStreamSink(e):i(e.data)};r.addEventListener("message",this._onComObjOnMessage)}on(t,e){const r=this.actionHandler;if(r[t])throw new Error('There is already an actionName called "'.concat(t,'"'));r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){const n=this.callbackId++,a=(0,i.createPromiseCapability)();this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},r)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,e,r,n){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,i.createPromiseCapability)();this.streamControllers[a]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:r.desiredSize},n);return s.promise},pull:t=>{const e=(0,i.createPromiseCapability)();this.streamControllers[a].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:d,streamId:a,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,i.createPromiseCapability)();this.streamControllers[a].cancelCall=e;this.streamControllers[a].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:s,streamId:a,reason:wrapReason(t)});return e.promise}},r)}_createStreamSink(t){const e=t.streamId,r=this.sourceName,n=t.sourceName,a=this.comObj,s=this,o=this.actionHandler[t.action],d={enqueue(t){let s=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-=s;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,i.createPromiseCapability)();this.ready=this.sinkCapability.promise}a.postMessage({sourceName:r,targetName:n,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:r,targetName:n,stream:l,streamId:e});delete s.streamSinks[e]}},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:r,targetName:n,stream:h,streamId:e,reason:wrapReason(t)})}},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[e]=d;new Promise((function(e){e(o(t.data,d))})).then((function(){a.postMessage({sourceName:r,targetName:n,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:r,targetName:n,stream:p,streamId:e,reason:wrapReason(t)})}))}_processStreamMessage(t){const e=t.streamId,r=this.sourceName,n=t.sourceName,a=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 d:if(!g){a.postMessage({sourceName:r,targetName:n,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(){a.postMessage({sourceName:r,targetName:n,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:r,targetName:n,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,i.assert)(f,"enqueue should have stream controller");if(f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:(0,i.assert)(f,"close should have stream controller");if(f.isClosed)break;f.isClosed=!0;f.controller.close();this._deleteStreamController(f,e);break;case h:(0,i.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 s:if(!g)break;new Promise((function(e){e(g.onCancel&&g.onCancel(wrapReason(t.reason)))})).then((function(){a.postMessage({sourceName:r,targetName:n,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:r,targetName:n,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,r)=>{r(224)},(t,e,r)=>{"use strict";var i=r(3),n=r(8),a=r(29),s=r(168),o=r(163),l=r(170);i({target:"Promise",stat:!0},{allSettled:function allSettled(t){var e=this,r=s.f(e),i=r.resolve,c=r.reject,h=o((function(){var r=a(e.resolve),s=[],o=0,c=1;l(t,(function(t){var a=o++,l=!1;c++;n(r,e,t).then((function(t){if(!l){l=!0;s[a]={status:"fulfilled",value:t};--c||i(s)}}),(function(t){if(!l){l=!0;s[a]={status:"rejected",reason:t};--c||i(s)}}))}));--c||i(s)}));h.error&&c(h.value);return r.promise}})},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;r(79);var i=r(1);function _classPrivateFieldInitSpec(t,e,r){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.set(t,r)}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,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var n=new WeakMap,a=new WeakMap;e.Metadata=class Metadata{constructor(t){let{parsedData:e,rawData:r}=t;_classPrivateFieldInitSpec(this,n,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,a,{writable:!0,value:void 0});_classPrivateFieldSet(this,n,e);_classPrivateFieldSet(this,a,r)}getRaw(){return _classPrivateFieldGet(this,a)}get(t){var e;return null!==(e=_classPrivateFieldGet(this,n).get(t))&&void 0!==e?e:null}getAll(){return(0,i.objectFromMap)(_classPrivateFieldGet(this,n))}has(t){return _classPrivateFieldGet(this,n).has(t)}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;r(79);var i=r(1);function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}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,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}const n=Symbol("INTERNAL");var a=new WeakMap;class OptionalContentGroup{constructor(t,e){_classPrivateFieldInitSpec(this,a,{writable:!0,value:!0});this.name=t;this.intent=e}get visible(){return _classPrivateFieldGet(this,a)}_setVisible(t,e){t!==n&&(0,i.unreachable)("Internal method `_setVisible` called.");_classPrivateFieldSet(this,a,e)}}var s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakSet;e.OptionalContentConfig=class OptionalContentConfig{constructor(t){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,h);_classPrivateFieldInitSpec(this,s,{writable:!0,value:!0});_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(n,!1);for(const e of t.on)_classPrivateFieldGet(this,o).get(e)._setVisible(n,!0);for(const e of t.off)_classPrivateFieldGet(this,o).get(e)._setVisible(n,!1);_classPrivateFieldSet(this,l,new Map);for(const[t,e]of _classPrivateFieldGet(this,o))_classPrivateFieldGet(this,l).set(t,e.visible)}}isVisible(t){if(0===_classPrivateFieldGet(this,o).size)return!0;if(!t){(0,i.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!_classPrivateFieldGet(this,o).has(t.id)){(0,i.warn)("Optional content group not found: ".concat(t.id));return!0}return _classPrivateFieldGet(this,o).get(t.id).visible}if("OCMD"===t.type){if(t.expression)return _classPrivateMethodGet(this,h,_evaluateVisibilityExpression2).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,o).has(e)){(0,i.warn)("Optional content group not found: ".concat(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,i.warn)("Optional content group not found: ".concat(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,i.warn)("Optional content group not found: ".concat(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,i.warn)("Optional content group not found: ".concat(e));return!0}if(_classPrivateFieldGet(this,o).get(e).visible)return!1}return!0}(0,i.warn)("Unknown optional content policy ".concat(t.policy,"."));return!0}(0,i.warn)("Unknown group type ".concat(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(n,!!e);_classPrivateFieldSet(this,s,null)}else(0,i.warn)("Optional content group not found: ".concat(t))}get hasInitialVisibility(){if(null!==_classPrivateFieldGet(this,s))return _classPrivateFieldGet(this,s);for(const[t,e]of _classPrivateFieldGet(this,o)){const r=_classPrivateFieldGet(this,l).get(t);if(e.visible!==r)return _classPrivateFieldSet(this,s,!1)}return _classPrivateFieldSet(this,s,!0)}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,i.objectFromMap)(_classPrivateFieldGet(this,o)):null}getGroup(t){return _classPrivateFieldGet(this,o).get(t)||null}};function _evaluateVisibilityExpression2(t){const e=t.length;if(e<2)return!0;const r=t[0];for(let n=1;n<e;n++){const e=t[n];let a;if(Array.isArray(e))a=_classPrivateMethodGet(this,h,_evaluateVisibilityExpression2).call(this,e);else{if(!_classPrivateFieldGet(this,o).has(e)){(0,i.warn)("Optional content group not found: ".concat(e));return!0}a=_classPrivateFieldGet(this,o).get(e).visible}switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===r}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;r(117);r(138);r(140);r(141);r(79);r(152);var i=r(1),n=r(202);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){(0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=t.progressiveDone||!1;this._contentDispositionFilename=t.contentDispositionFilename||null;const r=t.initialData;if((null==r?void 0:r.length)>0){const t=new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e;this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._contentLength=t.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})}));this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})}));this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){const e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{const r=this._rangeReaders.some((function(r){if(r._begin!==t.begin)return!1;r._enqueue(e);return!0}));(0,i.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){if(void 0===t.total){const e=this._rangeReaders[0];null!=e&&e.onProgress&&e.onProgress({loaded:t.loaded})}else{const e=this._fullRequestReader;null!=e&&e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.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 r=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(r);return r}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t;this._done=r||!1;this._filename=(0,n.isPdfFile)(i)?i: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,i.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,r){this._stream=t;this._begin=e;this._end=r;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,i.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,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;r(79);class XfaText{static textContent(t){const e=[],r={items:e,styles:Object.create(null)};!function walk(t){var r;if(!t)return;let i=null;const n=t.name;if("#text"===n)i=t.value;else{if(!XfaText.shouldBuildText(n))return;null!=t&&null!==(r=t.attributes)&&void 0!==r&&r.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}null!==i&&e.push({str:i});if(t.children)for(const e of t.children)walk(e)}(t);return r}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;r(152);r(117);r(138);r(140);r(141);var i=r(207);const fetchData=function(t){return new Promise(((e,r)=>{require("fs").readFile(t,((t,i)=>{!t&&i?e(new Uint8Array(i)):r(new Error(t))}))}))};class NodeCanvasFactory extends i.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;r(79);r(203);r(2);var i=r(1),n=r(212),a=r(202),s=r(231),o=r(232);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _classStaticPrivateMethodGet(t,e,r){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return r}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,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var l=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakSet,y=new WeakSet,b=new WeakSet,A=new WeakSet;class AnnotationEditorLayer{constructor(t){_classPrivateMethodInitSpec(this,A);_classPrivateMethodInitSpec(this,b);_classPrivateMethodInitSpec(this,y);_classPrivateMethodInitSpec(this,_);_classPrivateFieldInitSpec(this,m,{get:_get_hasTextLayer,set:void 0});_classPrivateFieldInitSpec(this,l,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,c,{writable:!0,value:this.pointerup.bind(this)});_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.pointerdown.bind(this)});_classPrivateFieldInitSpec(this,d,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,u,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,p,{writable:!0,value:new WeakMap});_classPrivateFieldInitSpec(this,f,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,g,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,v,{writable:!0,value:new Set});if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;s.FreeTextEditor.initialize(t.l10n);o.InkEditor.initialize(t.l10n);t.uiManager.registerEditorTypes([s.FreeTextEditor,o.InkEditor])}_classPrivateFieldSet(this,g,t.uiManager);this.annotationStorage=t.annotationStorage;this.pageIndex=t.pageIndex;this.div=t.div;_classPrivateFieldGet(this,g).addLayer(this)}get textLayerElements(){const t=this.div.parentNode.getElementsByClassName("textLayer").item(0);if(!t)return(0,i.shadow)(this,"textLayerElements",null);let e=_classPrivateFieldGet(this,p).get(t);if(e)return e;e=t.querySelectorAll('span[role="presentation"]');if(0===e.length)return(0,i.shadow)(this,"textLayerElements",null);e=Array.from(e);e.sort(_classStaticPrivateMethodGet(AnnotationEditorLayer,AnnotationEditorLayer,_compareElementPositions));_classPrivateFieldGet(this,p).set(t,e);return e}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,A,_cleanup2).call(this);if(t===i.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();_classPrivateFieldGet(this,g).unselectAll()}addInkEditorIfNeeded(t){if(!t&&_classPrivateFieldGet(this,g).getMode()!==i.AnnotationEditorType.INK)return;if(!t)for(const t of _classPrivateFieldGet(this,d).values())if(t.isEmpty()){t.setInBackground();return}_classPrivateMethodGet(this,b,_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,d).values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of _classPrivateFieldGet(this,d).values())t.disableEditing()}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,c))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(this,h));this.div.removeEventListener("pointerup",_classPrivateFieldGet(this,c))}attach(t){_classPrivateFieldGet(this,d).set(t.id,t)}detach(t){_classPrivateFieldGet(this,d).delete(t.id);this.removePointerInTextLayer(t)}remove(t){_classPrivateFieldGet(this,g).removeEditor(t);this.detach(t);this.annotationStorage.removeKey(t.id);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&_classPrivateFieldGet(this,g).focusMainContainer()}),0);_classPrivateFieldGet(this,u)||this.addInkEditorIfNeeded(!1)}onTextLayerRendered(){_classPrivateFieldGet(this,f).clear();for(const t of _classPrivateFieldGet(this,v))t.isAttachedToDOM&&this.addPointerInTextLayer(t);_classPrivateFieldGet(this,v).clear()}removePointerInTextLayer(t){var e;if(!_classPrivateFieldGet(this,m)){_classPrivateFieldGet(this,v).delete(t);return}const{id:r}=t,i=_classPrivateFieldGet(this,f).get(r);if(!i)return;_classPrivateFieldGet(this,f).delete(r);let n=i.getAttribute("aria-owns");if(null!==(e=n)&&void 0!==e&&e.includes(r)){n=n.split(" ").filter((t=>t!==r)).join(" ");if(n)i.setAttribute("aria-owns",n);else{i.removeAttribute("aria-owns");i.setAttribute("role","presentation")}}}addPointerInTextLayer(t){if(!_classPrivateFieldGet(this,m)){_classPrivateFieldGet(this,v).add(t);return}this.removePointerInTextLayer(t);const e=this.textLayerElements;if(!e)return;const{contentDiv:r}=t,i=t.getIdForTextLayer(),n=(0,a.binarySearchFirstItem)(e,(t=>_classStaticPrivateMethodGet(AnnotationEditorLayer,AnnotationEditorLayer,_compareElementPositions).call(AnnotationEditorLayer,r,t)<0)),s=e[Math.max(0,n-1)],o=s.getAttribute("aria-owns");null!=o&&o.includes(i)||s.setAttribute("aria-owns",o?"".concat(o," ").concat(i):i);s.removeAttribute("role");_classPrivateFieldGet(this,f).set(i,s)}moveDivInDOM(t){this.addPointerInTextLayer(t);const{div:e,contentDiv:r}=t;if(!this.div.hasChildNodes()){this.div.append(e);return}const i=Array.from(this.div.childNodes).filter((t=>t!==e));if(0===i.length)return;const n=(0,a.binarySearchFirstItem)(i,(t=>_classStaticPrivateMethodGet(AnnotationEditorLayer,AnnotationEditorLayer,_compareElementPositions).call(AnnotationEditorLayer,r,t)<0));0===n?i[0].before(e):i[n-1].after(e)}add(t){_classPrivateMethodGet(this,_,_changeParent2).call(this,t);this.addToAnnotationStorage(t);_classPrivateFieldGet(this,g).addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveDivInDOM(t);t.onceAdded()}addToAnnotationStorage(t){t.isEmpty()||this.annotationStorage.has(t.id)||this.annotationStorage.setValue(t.id,t)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){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 i.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this);case i.AnnotationEditorType.INK:return o.InkEditor.deserialize(t,this)}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 e=n.KeyboardManager.platform.isMac;0!==t.button||t.ctrlKey&&e||t.target===this.div&&(_classPrivateFieldGet(this,l)?_classPrivateMethodGet(this,b,_createAndAddNewEditor2).call(this,t):_classPrivateFieldSet(this,l,!0))}pointerdown(t){const e=n.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;const r=_classPrivateFieldGet(this,g).getActive();_classPrivateFieldSet(this,l,!r||r.isEmpty())}drop(t){const e=t.dataTransfer.getData("text/plain"),r=_classPrivateFieldGet(this,g).getEditor(e);if(!r)return;t.preventDefault();t.dataTransfer.dropEffect="move";_classPrivateMethodGet(this,_,_changeParent2).call(this,r);const i=this.div.getBoundingClientRect(),n=t.clientX-i.x,a=t.clientY-i.y;r.translate(n-r.startX,a-r.startY);this.moveDivInDOM(r);r.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,d).values()){this.removePointerInTextLayer(t);t.isAttachedToDOM=!1;t.div.remove();t.parent=null}_classPrivateFieldGet(this,f).clear();this.div=null;_classPrivateFieldGet(this,d).clear();_classPrivateFieldGet(this,v).clear();_classPrivateFieldGet(this,g).removeLayer(this)}render(t){this.viewport=t.viewport;(0,n.bindEvents)(this,this.div,["dragover","drop"]);this.setDimensions();for(const t of _classPrivateFieldGet(this,g).getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){this.viewport=t.viewport;this.setDimensions();this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[t,e,r,i]=this.viewport.viewBox;return[r-t,i-e]}get viewportBaseDimensions(){const{width:t,height:e,rotation:r}=this.viewport;return r%180==0?[t,e]:[e,t]}setDimensions(){const{width:t,height:e,rotation:r}=this.viewport,i=r%180!=0,n=Math.floor(t)+"px",a=Math.floor(e)+"px";this.div.style.width=i?a:n;this.div.style.height=i?n:a;this.div.setAttribute("data-main-rotation",r)}}e.AnnotationEditorLayer=AnnotationEditorLayer;function _get_hasTextLayer(){return!!this.div.parentNode.querySelector(".textLayer .endOfContent")}function _changeParent2(t){var e;if(t.parent!==this){this.attach(t);t.pageIndex=this.pageIndex;null===(e=t.parent)||void 0===e||e.detach(t);t.parent=this;if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}function _compareElementPositions(t,e){const r=t.getBoundingClientRect(),i=e.getBoundingClientRect();if(r.y+r.height<=i.y)return-1;if(i.y+i.height<=r.y)return 1;return r.x+r.width/2-(i.x+i.width/2)}function _createNewEditor2(t){switch(_classPrivateFieldGet(this,g).getMode()){case i.AnnotationEditorType.FREETEXT:return new s.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new o.InkEditor(t)}return null}function _createAndAddNewEditor2(t){const e=this.getNextId(),r=_classPrivateMethodGet(this,y,_createNewEditor2).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY});r&&this.add(r);return r}function _cleanup2(){_classPrivateFieldSet(this,u,!0);for(const t of _classPrivateFieldGet(this,d).values())t.isEmpty()&&t.remove();_classPrivateFieldSet(this,u,!1)}!function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}(AnnotationEditorLayer,"_initialized",!1)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;r(79);r(2);var i=r(1),n=r(212),a=r(211);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _classPrivateFieldSet(t,e,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}var s=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakSet,g=new WeakSet,v=new WeakSet,m=new WeakSet;class FreeTextEditor extends a.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"});_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,g);_classPrivateMethodInitSpec(this,f);_classPrivateFieldInitSpec(this,s,{writable:!0,value:this.editorDivBlur.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:this.editorDivFocus.bind(this)});_classPrivateFieldInitSpec(this,l,{writable:!0,value:this.editorDivKeydown.bind(this)});_classPrivateFieldInitSpec(this,c,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:""});_classPrivateFieldInitSpec(this,d,{writable:!0,value:""});_classPrivateFieldInitSpec(this,u,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,p,{writable:!0,value:void 0});_classPrivateFieldSet(this,c,t.color||FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor);_classPrivateFieldSet(this,p,t.fontSize||FreeTextEditor._defaultFontSize)}static initialize(t){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_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 i.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:_classPrivateMethodGet(this,f,_updateFontSize2).call(this,e);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:_classPrivateMethodGet(this,g,_updateColor2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(this,p)],[i.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(this,c)]]}getInitialTranslation(){return[-FreeTextEditor._internalPadding*this.parent.scaleFactor,-(FreeTextEditor._internalPadding+_classPrivateFieldGet(this,p))*this.parent.scaleFactor]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(i.AnnotationEditorType.FREETEXT);super.enableEditMode();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(this,l));this.editorDiv.addEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.addEventListener("blur",_classPrivateFieldGet(this,s))}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(this,l));this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(this,s));this.div.focus();this.isEditing=!1}}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);super.remove()}commit(){super.commit();if(!_classPrivateFieldGet(this,u)){_classPrivateFieldSet(this,u,!0);this.parent.addUndoableEditor(this)}this.disableEditMode();_classPrivateFieldSet(this,d,this.editorDiv.innerHTML);_classPrivateFieldSet(this,h,_classPrivateMethodGet(this,v,_extractText2).call(this).trimEnd());_classPrivateMethodGet(this,m,_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}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}getIdForTextLayer(){return this.editorDiv.id}render(){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","".concat(this.id,"-editor"));this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text_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_text_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:r}=this.editorDiv;r.fontSize="calc(".concat(_classPrivateFieldGet(this,p),"px * var(--scale-factor))");r.color=_classPrivateFieldGet(this,c);this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,n.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[r,i]=this.parent.viewportBaseDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i);this.editorDiv.innerHTML=_classPrivateFieldGet(this,d);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){const r=super.deserialize(t,e);_classPrivateFieldSet(r,p,t.fontSize);_classPrivateFieldSet(r,c,i.Util.makeHexColor(...t.color));_classPrivateFieldSet(r,h,t.value);_classPrivateFieldSet(r,d,t.value.split("\n").map((t=>"<div>".concat(t,"</div>"))).join(""));return r}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parent.scaleFactor,e=this.getRect(t,t),r=a.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:i.AnnotationEditorType.FREETEXT,color:r,fontSize:_classPrivateFieldGet(this,p),value:_classPrivateFieldGet(this,h),pageIndex:this.parent.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor;function _updateFontSize2(t){const setFontsize=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))");this.translate(0,-(t-_classPrivateFieldGet(this,p))*this.parent.scaleFactor);_classPrivateFieldSet(this,p,t);_classPrivateMethodGet(this,m,_setEditorDimensions2).call(this)},e=_classPrivateFieldGet(this,p);this.parent.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=_classPrivateFieldGet(this,c);this.parent.addCommands({cmd:()=>{_classPrivateFieldSet(this,c,t);this.editorDiv.style.color=t},undo:()=>{_classPrivateFieldSet(this,c,e);this.editorDiv.style.color=e},mustExec:!0,type:i.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(let r=0,i=t.length;r<i;r++){const i=t[r].firstChild;"#text"===(null==i?void 0:i.nodeName)?e.push(i.data):e.push("")}return e.join("\n")}function _setEditorDimensions2(){const[t,e]=this.parent.viewportBaseDimensions,r=this.div.getBoundingClientRect();this.width=r.width/t;this.height=r.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 n.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]))},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});r(79);var i=r(1),n=r(211),a=r(233),s=r(212);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e);e.set(t,r)}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,r){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return r}function _classPrivateFieldSet(t,e,r){!function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}(t,_classExtractFieldDescriptor(t,e,"set"),r);return r}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,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const o=16;var l=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,y=new WeakMap,b=new WeakMap,A=new WeakMap,P=new WeakSet,S=new WeakSet,x=new WeakSet,w=new WeakSet,E=new WeakSet,k=new WeakSet,T=new WeakSet,C=new WeakSet,M=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,L=new WeakSet,G=new WeakSet,N=new WeakSet,j=new WeakSet,U=new WeakSet,B=new WeakSet,W=new WeakSet,q=new WeakSet,z=new WeakSet;class InkEditor extends n.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"});_classPrivateMethodInitSpec(this,z);_classPrivateMethodInitSpec(this,q);_classPrivateMethodInitSpec(this,W);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,w);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,S);_classPrivateMethodInitSpec(this,P);_classPrivateFieldInitSpec(this,l,{writable:!0,value:0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:0});_classPrivateFieldInitSpec(this,d,{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,y,{writable:!0,value:0});_classPrivateFieldInitSpec(this,b,{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_ink_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case i.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case i.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:_classPrivateMethodGet(this,P,_updateThickness2).call(this,e);break;case i.AnnotationEditorParamsType.INK_COLOR:_classPrivateMethodGet(this,S,_updateColor2).call(this,e);break;case i.AnnotationEditorParamsType.INK_OPACITY:_classPrivateMethodGet(this,x,_updateOpacity2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||n.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||n.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t: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()}}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.moveDivInDOM(this);this.div.focus()}}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,d));_classPrivateMethodGet(this,k,_startDrawing2).call(this,t.offsetX,t.offsetY)}}canvasPointermove(t){t.stopPropagation();_classPrivateMethodGet(this,T,_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_ink_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[r,i,n,a]=_classPrivateMethodGet(this,w,_getInitialBBox2).call(this);this.setAt(r,i,0,0);this.setDims(n,a);_classPrivateMethodGet(this,I,_createCanvas2).call(this);if(this.width){const[r,i]=this.parent.viewportBaseDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i);_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.setDims(this.width*r,this.height*i);_classPrivateMethodGet(this,M,_redraw2).call(this);_classPrivateMethodGet(this,z,_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 r=Math.round(t),i=Math.round(e);if(_classPrivateFieldGet(this,y)===r&&_classPrivateFieldGet(this,b)===i)return;_classPrivateFieldSet(this,y,r);_classPrivateFieldSet(this,b,i);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[n,a]=this.parent.viewportBaseDimensions;this.width=t/n;this.height=e/a;_classPrivateFieldGet(this,g)&&_classPrivateMethodGet(this,L,_setScaleFactor2).call(this,t,e);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,M,_redraw2).call(this);this.canvas.style.visibility="visible"}static deserialize(t,e){const r=super.deserialize(t,e);r.thickness=t.thickness;r.color=i.Util.makeHexColor(...t.color);r.opacity=t.opacity;const[n,a]=e.pageDimensions,s=r.width*n,o=r.height*a,d=e.scaleFactor,u=t.thickness/2;_classPrivateFieldSet(r,l,s/o);_classPrivateFieldSet(r,g,!0);_classPrivateFieldSet(r,y,Math.round(s));_classPrivateFieldSet(r,b,Math.round(o));for(const{bezier:e}of t.paths){const t=[];r.paths.push(t);let i=d*(e[0]-u),n=d*(o-e[1]-u);for(let r=2,a=e.length;r<a;r+=6){const a=d*(e[r]-u),s=d*(o-e[r+1]-u),l=d*(e[r+2]-u),c=d*(o-e[r+3]-u),h=d*(e[r+4]-u),p=d*(o-e[r+5]-u);t.push([[i,n],[a,s],[l,c],[h,p]]);i=h;n=p}const a=_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,t);r.bezierPath2D.push(a)}const p=_classPrivateMethodGet(r,B,_getBbox2).call(r);_classPrivateFieldSet(r,h,p[2]-p[0]);_classPrivateFieldSet(r,c,p[3]-p[1]);_classPrivateMethodGet(r,L,_setScaleFactor2).call(r,s,o);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],r=n.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:i.AnnotationEditorType.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:_classPrivateMethodGet(this,N,_serializePaths2).call(this,this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,e),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor;function _updateThickness2(t){const e=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=t;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},undo:()=>{this.thickness=e;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=this.color;this.parent.addCommands({cmd:()=>{this.color=t;_classPrivateMethodGet(this,M,_redraw2).call(this)},undo:()=>{this.color=e;_classPrivateMethodGet(this,M,_redraw2).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(t){t/=100;const e=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=t;_classPrivateMethodGet(this,M,_redraw2).call(this)},undo:()=>{this.opacity=e;_classPrivateMethodGet(this,M,_redraw2).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){const{width:t,height:e,rotation:r}=this.parent.viewport;switch(r){case 90:return[0,t,t,e];case 180:return[t,e,t,e];case 270:return[e,0,t,e];default:return[0,0,t,e]}}function _setStroke2(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor;this.ctx.lineCap="round";this.ctx.lineJoin="round";this.ctx.miterLimit=10;this.ctx.strokeStyle="".concat(this.color).concat((0,s.opacityToHex)(this.opacity))}function _startDrawing2(t,e){this.isEditing=!0;if(!_classPrivateFieldGet(this,v)){var r;_classPrivateFieldSet(this,v,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.thickness||(this.thickness=InkEditor._defaultThickness);this.color||(this.color=InkEditor._defaultColor||n.AnnotationEditor._defaultLineColor);null!==(r=this.opacity)&&void 0!==r||(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,M,_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[r,i]=this.currentPath.at(-1);if(t!==r||e!==i){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[r,i]=this.currentPath.at(-1);t===r&&e===i||this.currentPath.push([t,e]);let n;if(1!==this.currentPath.length)n=(0,a.fitCurve)(this.currentPath,30,null);else{const r=[t,e];n=[[r,r.slice(),r.slice(),r]]}const s=_classStaticPrivateMethodGet(InkEditor,InkEditor,_buildPath2D).call(InkEditor,n);this.currentPath.length=0;this.parent.addCommands({cmd:()=>{this.paths.push(n);this.bezierPath2D.push(s);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,G,_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,G,_updateTransform2).call(this);for(const t of this.bezierPath2D)e.stroke(t)}function _endDrawing2(t){_classPrivateMethodGet(this,C,_stopDrawing2).call(this,t.offsetX,t.offsetY);this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(this,u));this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(this,d));this.parent.addToAnnotationStorage(this)}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);this.ctx=this.canvas.getContext("2d")}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.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);_classPrivateMethodGet(this,G,_updateTransform2).call(this)}function _setScaleFactor2(t,e){const r=_classPrivateMethodGet(this,W,_getPadding2).call(this),i=(t-r)/_classPrivateFieldGet(this,h),n=(e-r)/_classPrivateFieldGet(this,c);this.scaleFactor=Math.min(i,n)}function _updateTransform2(){const t=_classPrivateMethodGet(this,W,_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 r=0,i=t.length;r<i;r++){const[i,n,a,s]=t[r];0===r&&e.moveTo(...i);e.bezierCurveTo(n[0],n[1],a[0],a[1],s[0],s[1])}return e}function _serializePaths2(t,e,r,i){const n=[],a=this.thickness/2;let s,o;for(const l of this.paths){s=[];o=[];for(let n=0,c=l.length;n<c;n++){const[c,h,d,u]=l[n],p=t*(c[0]+e)+a,f=i-t*(c[1]+r)-a,g=t*(h[0]+e)+a,v=i-t*(h[1]+r)-a,m=t*(d[0]+e)+a,_=i-t*(d[1]+r)-a,y=t*(u[0]+e)+a,b=i-t*(u[1]+r)-a;if(0===n){s.push(p,f);o.push(p,f)}s.push(g,v,m,_,y,b);_classPrivateMethodGet(this,j,_extractPointsOnBezier2).call(this,p,f,g,v,m,_,y,b,4,o)}n.push({bezier:s,points:o})}return n}function _extractPointsOnBezier2(t,e,r,i,n,a,s,o,l,c){if(_classPrivateMethodGet(this,U,_isAlmostFlat2).call(this,t,e,r,i,n,a,s,o))c.push(s,o);else{for(let h=1;h<l-1;h++){const d=h/l,u=1-d;let p=d*t+u*r,f=d*e+u*i,g=d*r+u*n,v=d*i+u*a;p=d*p+u*g;f=d*f+u*v;g=d*g+u*(d*n+u*s);v=d*v+u*(d*a+u*o);p=d*p+u*g;f=d*f+u*v;c.push(p,f)}c.push(s,o)}}function _isAlmostFlat2(t,e,r,i,n,a,s,o){const l=(3*r-2*t-s)**2,c=(3*i-2*e-o)**2,h=(3*n-t-2*s)**2,d=(3*a-e-2*o)**2;return Math.max(l,h)+Math.max(c,d)<=10}function _getBbox2(){let t=1/0,e=-1/0,r=1/0,n=-1/0;for(const a of this.paths)for(const[s,o,l,c]of a){const a=i.Util.bezierBoundingBox(...s,...o,...l,...c);t=Math.min(t,a[0]);r=Math.min(r,a[1]);e=Math.max(e,a[2]);n=Math.max(n,a[3])}return[t,r,e,n]}function _getPadding2(){return _classPrivateFieldGet(this,g)?Math.ceil(this.thickness*this.parent.scaleFactor):0}function _fitToContent2(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(this,g)){_classPrivateMethodGet(this,M,_redraw2).call(this);return}const e=_classPrivateMethodGet(this,B,_getBbox2).call(this),r=_classPrivateMethodGet(this,W,_getPadding2).call(this);_classPrivateFieldSet(this,h,Math.max(o,e[2]-e[0]));_classPrivateFieldSet(this,c,Math.max(o,e[3]-e[1]));const i=Math.ceil(r+_classPrivateFieldGet(this,h)*this.scaleFactor),n=Math.ceil(r+_classPrivateFieldGet(this,c)*this.scaleFactor),[a,s]=this.parent.viewportBaseDimensions;this.width=i/a;this.height=n/s;_classPrivateFieldSet(this,l,i/n);_classPrivateMethodGet(this,z,_setMinDims2).call(this);const d=this.translationX,u=this.translationY;this.translationX=-e[0];this.translationY=-e[1];_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,M,_redraw2).call(this);_classPrivateFieldSet(this,y,i);_classPrivateFieldSet(this,b,n);this.setDims(i,n);const p=t?r/this.scaleFactor/2:0;this.translate(d-this.translationX-p,u-this.translationY-p)}function _setMinDims2(){const{style:t}=this.div;if(_classPrivateFieldGet(this,l)>=1){t.minHeight="".concat(o,"px");t.minWidth="".concat(Math.round(_classPrivateFieldGet(this,l)*o),"px")}else{t.minWidth="".concat(o,"px");t.minHeight="".concat(Math.round(o/_classPrivateFieldGet(this,l)),"px")}}_defineProperty(InkEditor,"_defaultColor",null);_defineProperty(InkEditor,"_defaultOpacity",1);_defineProperty(InkEditor,"_defaultThickness",1);_defineProperty(InkEditor,"_l10nPromise",void 0)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.fitCurve=void 0;const i=r(234);e.fitCurve=i},(t,e,r)=>{"use strict";r(79);r(235);r(216);function fitCubic(t,e,r,i,n){var a,s,o,l,c,h,d,u,p,f,g,v,m;if(2===t.length){v=maths.vectorLen(maths.subtract(t[0],t[1]))/3;return[a=[t[0],maths.addArrays(t[0],maths.mulItems(e,v)),maths.addArrays(t[1],maths.mulItems(r,v)),t[1]]]}s=function chordLengthParameterize(t){var e,r,i,n=[];t.forEach(((t,a)=>{e=a?r+maths.vectorLen(maths.subtract(t,i)):0;n.push(e);r=e;i=t}));return n=n.map((t=>t/r))}(t);[a,l,h]=generateAndReport(t,s,s,e,r,n);if(0===l||l<i)return[a];if(l<i*i){o=s;c=l;d=h;for(m=0;m<20;m++){o=reparameterize(a,t,o);[a,l,h]=generateAndReport(t,s,o,e,r,n);if(l<i)return[a];if(h===d){let t=l/c;if(t>.9999&&t<1.0001)break}c=l;d=h}}g=[];if((u=maths.subtract(t[h-1],t[h+1])).every((t=>0===t))){u=maths.subtract(t[h-1],t[h]);[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,h+1),e,p,i,n))).concat(fitCubic(t.slice(h),f,r,i,n))}function generateAndReport(t,e,r,i,n,a){var s,o,l;s=function generateBezier(t,e,r,i){var n,a,s,o,l,c,h,d,u,p,f,g,v,m,_,y,b,A=t[0],P=t[t.length-1];n=[A,null,null,P];a=maths.zeros_Xx2x2(e.length);for(v=0,m=e.length;v<m;v++){b=1-(y=e[v]);(s=a[v])[0]=maths.mulItems(r,3*y*(b*b));s[1]=maths.mulItems(i,3*b*(y*y))}o=[[0,0],[0,0]];l=[0,0];for(v=0,m=t.length;v<m;v++){y=e[v];s=a[v];o[0][0]+=maths.dot(s[0],s[0]);o[0][1]+=maths.dot(s[0],s[1]);o[1][0]+=maths.dot(s[0],s[1]);o[1][1]+=maths.dot(s[1],s[1]);_=maths.subtract(t[v],bezier.q([A,A,P,P],y));l[0]+=maths.dot(s[0],_);l[1]+=maths.dot(s[1],_)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];h=o[0][0]*l[1]-o[1][0]*l[0];d=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:d/c;p=0===c?0:h/c;g=maths.vectorLen(maths.subtract(A,P));if(u<(f=1e-6*g)||p<f){n[1]=maths.addArrays(A,maths.mulItems(r,g/3));n[2]=maths.addArrays(P,maths.mulItems(i,g/3))}else{n[1]=maths.addArrays(A,maths.mulItems(r,u));n[2]=maths.addArrays(P,maths.mulItems(i,p))}return n}(t,r,i,n);[o,l]=function computeMaxError(t,e,r){var i,n,a,s,o,l,c,h;n=0;a=Math.floor(t.length/2);const d=mapTtoRelativeDistances(e,10);for(o=0,l=t.length;o<l;o++){c=t[o];h=find_t(e,r[o],d,10);if((i=(s=maths.subtract(bezier.q(e,h),c))[0]*s[0]+s[1]*s[1])>n){n=i;a=o}}return[n,a]}(t,s,e);a&&a({bez:s,points:t,params:e,maxErr:o,maxPoint:l});return[s,o,l]}function reparameterize(t,e,r){return r.map(((r,i)=>newtonRaphsonRootFind(t,e[i],r)))}function newtonRaphsonRootFind(t,e,r){var i=maths.subtract(bezier.q(t,r),e),n=bezier.qprime(t,r),a=maths.mulMatrix(i,n),s=maths.sum(maths.squareItems(n))+2*maths.mulMatrix(i,bezier.qprimeprime(t,r));return 0===s?r:r-a/s}var mapTtoRelativeDistances=function(t,e){for(var r,i=[0],n=t[0],a=0,s=1;s<=e;s++){r=bezier.q(t,s/e);a+=maths.vectorLen(maths.subtract(r,n));i.push(a);n=r}return i=i.map((t=>t/a))};function find_t(t,e,r,i){if(e<0)return 0;if(e>1)return 1;for(var n,a,s,o,l=1;l<=i;l++)if(e<=r[l]){s=(l-1)/i;a=l/i;o=(e-(n=r[l-1]))/(r[l]-n)*(a-s)+s;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,r,i)=>t+r*e[i]),0)}static subtract(t,e){return t.map(((t,r)=>t-e[r]))}static addArrays(t,e){return t.map(((t,r)=>t+e[r]))}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 r=1-e,i=maths.mulItems(t[0],r*r*r),n=maths.mulItems(t[1],3*r*r*e),a=maths.mulItems(t[2],3*r*e*e),s=maths.mulItems(t[3],e*e*e);return maths.addArrays(maths.addArrays(i,n),maths.addArrays(a,s))}static qprime(t,e){var r=1-e,i=maths.mulItems(maths.subtract(t[1],t[0]),3*r*r),n=maths.mulItems(maths.subtract(t[2],t[1]),6*r*e),a=maths.mulItems(maths.subtract(t[3],t[2]),3*e*e);return maths.addArrays(maths.addArrays(i,n),a)}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,r){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,r)=>0===r||!e.every(((e,i)=>e===t[r-1][i]))))).length<2)return[];const i=t.length,n=createTangent(t[1],t[0]),a=createTangent(t[i-2],t[i-1]);return fitCubic(t,n,a,e,r)};t.exports.fitCubic=fitCubic;t.exports.createTangent=createTangent},(t,e,r)=>{"use strict";var i=r(3),n=r(236).left,a=r(237),s=r(26),o=r(154);i({target:"Array",proto:!0,forced:!a("reduce")||!o&&s>79&&s<83},{reduce:function reduce(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},(t,e,r)=>{var i=r(29),n=r(38),a=r(13),s=r(62),o=TypeError,createMethod=function(t){return function(e,r,l,c){i(r);var h=n(e),d=a(h),u=s(h),p=t?u-1:0,f=t?-1:1;if(l<2)for(;;){if(p in d){c=d[p];p+=f;break}p+=f;if(t?p<0:u<=p)throw o("Reduce of empty array with no initial value")}for(;t?p>=0:u>p;p+=f)p in d&&(c=r(c,d[p],p,h));return c}};t.exports={left:createMethod(!1),right:createMethod(!0)}},(t,e,r)=>{"use strict";var i=r(7);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){return 1},1)}))}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationLayer=void 0;r(79);r(203);r(2);var i=r(1),n=r(202),a=r(210),s=r(239),o=r(240);function _classStaticPrivateMethodGet(t,e,r){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return r}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 i.AnnotationType.LINK:return new LinkAnnotationElement(t);case i.AnnotationType.TEXT:return new TextAnnotationElement(t);case i.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 i.AnnotationType.POPUP:return new PopupAnnotationElement(t);case i.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case i.AnnotationType.LINE:return new LineAnnotationElement(t);case i.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case i.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case i.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case i.AnnotationType.CARET:return new CaretAnnotationElement(t);case i.AnnotationType.INK:return new InkAnnotationElement(t);case i.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case i.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case i.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case i.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case i.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case i.AnnotationType.STAMP:return new StampAnnotationElement(t);case i.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t){let{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!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;this._mouseState=t.mouseState;e&&(this.container=this._createContainer(r));i&&(this.quadrilaterals=this._createQuadrilaterals(r))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this.data,r=this.page,n=this.viewport,a=document.createElement("section"),{width:s,height:o}=getRectDims(e.rect),[l,c,h,d]=n.viewBox,u=h-l,p=d-c;a.setAttribute("data-annotation-id",e.id);const f=i.Util.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,r=e.borderStyle.verticalCornerRadius;if(t>0||r>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(r,"px * var(--scale-factor))");a.style.borderRadius=e}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const n=e.borderColor||null;n?a.style.borderColor=i.Util.makeHexColor(0|n[0],0|n[1],0|n[2]):a.style.borderWidth=0}a.style.left="".concat(100*(f[0]-l)/u,"%");a.style.top="".concat(100*(f[1]-c)/p,"%");const{rotation:g}=e;if(e.hasOwnCanvas||0===g){a.style.width="".concat(100*s/u,"%");a.style.height="".concat(100*o/p,"%")}else this.setRotation(g,a);return a}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const[r,i,n,a]=this.viewport.viewBox,s=n-r,o=a-i,{width:l,height:c}=getRectDims(this.data.rect);let h,d;if(t%180==0){h=100*l/s;d=100*c/o}else{h=100*c/s;d=100*l/o}e.style.width="".concat(h,"%");e.style.height="".concat(d,"%");e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,r)=>{const i=r.detail[t];r.target.style[e]=s.ColorConverters["".concat(i[0],"_HTML")](i.slice(1))};return(0,i.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 r=this._commonActions;for(const i of Object.keys(e.detail)){const n=t[i]||r[i];n&&n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const r=this._commonActions;for(const[i,n]of Object.entries(e)){const a=r[i];if(a){a({detail:n,target:t});delete e[i]}}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],r=this.data.rect;for(const r of this.data.quadPoints){this.data.rect=[r[2].x,r[2].y,r[1].x,r[1].y];e.push(this._createContainer(t))}this.data.rect=r;return e}_createPopup(t,e){let r=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;r=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).className="popupTriggerArea";r.append(t)}const i=new PopupElement({container:r,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();i.style.left="100%";r.append(i)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:a,exportValues:s}of n){if(-1===t)continue;if(a===e)continue;const n="string"==typeof s?s:null,o=document.querySelector('[data-element-id="'.concat(a,'"]'));!o||c.has(o)?r.push({id:a,exportValue:n,domElement:o}):(0,i.warn)("_getElementsByName - element not allowed: ".concat(a))}return r}for(const i of document.getElementsByName(t)){const{id:t,exportValue:n}=i;t!==e&&(c.has(i)&&r.push({id:t,exportValue:n,domElement:i}))}return r}static get platform(){const t="undefined"!=typeof navigator?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}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});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let i=!1;if(t.url){e.addLinkAttributes(r,t.url,t.newWindow);i=!0}else if(t.action){this._bindNamedAction(r,t.action);i=!0}else if(t.dest){this._bindLink(r,t.dest);i=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(r,t);i=!0}if(t.resetForm){this._bindResetFormAction(r,t.resetForm);i=!0}else if(this.isTooltipOnly&&!i){this._bindLink(r,"");i=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const i=0===e?r:r.cloneNode();t.append(i);return t}));this.container.className="linkAnnotation";i&&this.container.append(r);return this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&(t.className="internalLink")}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};t.className="internalLink"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const n=r.get(i);n&&(t[n]=()=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}});return!1})}t.onclick||(t.onclick=()=>!1);t.className="internalLink"}_bindResetFormAction(t,e){const r=t.onclick;r||(t.href=this.linkService.getAnchorUrl(""));t.className="internalLink";if(this._fieldObjects)t.onclick=()=>{r&&r();const{fields:t,refs:n,include:a}=e,s=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const r of t){const t=this._fieldObjects[r]||[];for(const{id:r}of t)e.add(r)}for(const t of Object.values(this._fieldObjects))for(const r of t)e.has(r.id)===a&&s.push(r)}else for(const t of Object.values(this._fieldObjects))s.push(...t);const o=this.annotationStorage,l=[];for(const t of s){const{id:e}=t;l.push(e);switch(t.type){case"text":{const r=t.defaultValue||"";o.setValue(e,{value:r});break}case"checkbox":case"radiobutton":{const r=t.defaultValue===t.exportValues;o.setValue(e,{value:r});break}case"combobox":case"listbox":{const r=t.defaultValue||"";o.setValue(e,{value:r});break}default:continue}const r=document.querySelector('[data-element-id="'.concat(e,'"]'));r&&(c.has(r)?r.dispatchEvent(new Event("resetform")):(0,i.warn)("_bindResetFormAction - element not allowed: ".concat(e)))}if(this.enableScripting){var h;null===(h=this.linkService.eventBus)||void 0===h||h.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})}return!1};else{(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');r||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str)})}render(){this.container.className="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:r}=AnnotationElement.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,i){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:r,value:i(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:r,value:i(t)}})}))}_setEventListeners(t,e,r){for(const[n,a]of e){var i;("Action"===a||null!==(i=this.data.actions)&&void 0!==i&&i[a])&&this._setEventListener(t,n,a,r)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,a=t.style;let s;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]),e=t/(Math.round(t/(i.LINE_FACTOR*n))||1);s=Math.min(n,Math.round(e/i.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]);s=Math.min(n,Math.round(t/i.LINE_FACTOR))}a.fontSize="calc(".concat(s,"px * var(--scale-factor))");a.color=i.Util.makeHexColor(r[0],r[1],r[2]);null!==this.data.textAlignment&&(a.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,r,i){const n=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id)){a.domElement&&(a.domElement[e]=r);n.setValue(a.id,this.data.fieldName,{[i]:r})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let r=null;if(this.renderForms){const n=t.getValue(e,this.data.fieldName,{value:this.data.fieldValue}),a=n.formattedValue||n.value||"",s={userValue:a,formattedValue:null,valueOnFocus:""};if(this.data.multiLine){r=document.createElement("textarea");r.textContent=a;this.data.doNotScroll&&(r.style.overflowY="hidden")}else{r=document.createElement("input");r.type="text";r.setAttribute("value",a);this.data.doNotScroll&&(r.style.overflowX="hidden")}c.add(r);r.setAttribute("data-element-id",e);r.disabled=this.data.readOnly;r.name=this.data.fieldName;r.tabIndex=l;this._setRequired(r,this.data.required);r.addEventListener("input",(i=>{t.setValue(e,this.data.fieldName,{value:i.target.value});this.setPropertyOnSiblings(r,"value",i.target.value,"value")}));r.addEventListener("resetform",(t=>{var e;const i=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";r.value=s.userValue=i;s.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=s;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var i;r.addEventListener("focus",(t=>{s.userValue&&(t.target.value=s.userValue);s.valueOnFocus=t.target.value}));const n=this.data.fieldName;r.addEventListener("updatefromsandbox",(r=>{const i={value(r){var i;s.userValue=null!==(i=r.detail.value)&&void 0!==i?i:"";t.setValue(e,n,{value:s.userValue.toString()});r.target.value=s.userValue},formattedValue(r){const{formattedValue:i}=r.detail;s.formattedValue=i;null!=i&&r.target!==document.activeElement&&(r.target.value=i);t.setValue(e,n,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)}};this._dispatchEventFromSandbox(i,r)}));r.addEventListener("keydown",(t=>{var r;let i=-1;"Escape"===t.key?i=0:"Enter"===t.key?i=2:"Tab"===t.key&&(i=3);if(-1===i)return;const{value:n}=t.target;if(s.valueOnFocus!==n){s.userValue=n;null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const a=blurListener;blurListener=null;r.addEventListener("blur",(t=>{const{value:r}=t.target;s.userValue=r;if(this._mouseState.isDown&&s.valueOnFocus!==r){var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}a(t)}));null!==(i=this.data.actions)&&void 0!==i&&i.Keystroke&&r.addEventListener("beforeinput",(t=>{var r;const{data:i,target:n}=t,{value:a,selectionStart:s,selectionEnd:o}=n;let l=s,c=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,s).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(s).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":s===o&&(l-=1);break;case"deleteContentForward":s===o&&(c+=1)}t.preventDefault();null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:i||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&r.addEventListener("blur",blurListener);null!==this.data.maxLen&&(r.maxLength=this.data.maxLen);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;r.classList.add("comb");r.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else{r=document.createElement("div");r.textContent=this.data.fieldValue;r.style.verticalAlign="middle";r.style.display="table-cell"}this._setTextStyle(r);this._setBackgroundColor(r);this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,r=e.id;let i=t.getValue(r,"".concat(this.data.fieldName,"/").concat(this.data.exportValue),{value:e.exportValue===e.fieldValue}).value;if("string"==typeof i){i="Off"!==i;t.setValue(r,this.data.fieldName,{value:i})}this.container.className="buttonWidgetAnnotation checkBox";const n=document.createElement("input");c.add(n);n.setAttribute("data-element-id",r);n.disabled=e.readOnly;this._setRequired(n,this.data.required);n.type="checkbox";n.name=e.fieldName;i&&n.setAttribute("checked",!0);n.setAttribute("exportValue",e.exportValue);n.tabIndex=l;n.addEventListener("change",(i=>{const{name:n,checked:a}=i.target;for(const i of this._getElementsByName(n,r)){const r=a&&i.exportValue===e.exportValue;i.domElement&&(i.domElement.checked=r);t.setValue(i.id,this.data.fieldName,{value:r,emitMessage:!1})}t.setValue(r,this.data.fieldName,{value:a,exportValue:a?e.exportValue:null})}));n.addEventListener("resetform",(t=>{const r=e.defaultFieldValue||"Off";t.target.checked=r===e.exportValue}));if(this.enableScripting&&this.hasJSActions){const e=this.data.fieldName;n.addEventListener("updatefromsandbox",(i=>{const n={value(i){i.target.checked="Off"!==i.detail.value;t.setValue(r,e,{value:i.target.checked})}};this._dispatchEventFromSandbox(n,i)}));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.className="buttonWidgetAnnotation radioButton";const t=this.annotationStorage,e=this.data,r=e.id;let i=t.getValue(r,this.data.fieldName,{value:e.fieldValue===e.buttonValue},this.data.buttonValue).value;if("string"==typeof i){i=i!==e.buttonValue;t.setValue(r,this.data.fieldName,{value:i},this.data.buttonValue)}const n=document.createElement("input");c.add(n);n.setAttribute("data-element-id",r);n.disabled=e.readOnly;this._setRequired(n,this.data.required);n.type="radio";n.name=e.fieldName;i&&n.setAttribute("checked",!0);n.tabIndex=l;n.addEventListener("change",(e=>{const{name:i,checked:n}=e.target;for(const e of this._getElementsByName(i,r))t.setValue(e.id,this.data.fieldName,{value:!1,emitMessage:!1});t.setValue(r,this.data.fieldName,{value:n,radioValue:this.data.buttonValue})}));n.addEventListener("resetform",(t=>{const r=e.defaultFieldValue;t.target.checked=null!=r&&r===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const i=e.buttonValue;n.addEventListener("updatefromsandbox",(e=>{const n=this.data.fieldName,a={value:e=>{const a=i===e.detail.value;for(const i of this._getElementsByName(e.target.name)){const e=a&&i.id===r;i.domElement&&(i.domElement.checked=e);t.setValue(i.id,n,{value:e})}}};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 PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.className="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.className="choiceWidgetAnnotation";const t=this.annotationStorage,e=this.data.id,r=t.getValue(e,this.data.fieldName,{value:this.data.fieldValue}),i=document.createElement("select");c.add(i);i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;this._setRequired(i,this.data.required);i.name=this.data.fieldName;i.tabIndex=l;let n=this.data.combo&&this.data.options.length>0;if(!this.data.combo){i.size=this.data.options.length;this.data.multiSelect&&(i.multiple=!0)}i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of i.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(r.value.includes(t.exportValue)){e.setAttribute("selected",!0);n=!1}i.append(e)}let a=null;if(n){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);i.prepend(t);a=()=>{t.remove();i.removeEventListener("input",a);a=null};i.addEventListener("input",a)}const getValue=(t,e)=>{const r=e?"value":"textContent",i=t.target.options;return t.target.multiple?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[r])):-1===i.selectedIndex?null:i[i.selectedIndex][r]},getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(r=>{const n=this.data.fieldName,s={value(r){var s;null===(s=a)||void 0===s||s();const o=r.detail.value,l=new Set(Array.isArray(o)?o:[o]);for(const t of i.options)t.selected=l.has(t.value);t.setValue(e,n,{value:getValue(r,!0)})},multipleSelection(t){i.multiple=!0},remove(r){const n=i.options,a=r.detail.remove;n[a].selected=!1;i.remove(a);if(n.length>0){-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0)}t.setValue(e,this.data.fieldName,{value:getValue(r,!0),items:getItems(r)})},clear(r){for(;0!==i.length;)i.remove(0);t.setValue(e,this.data.fieldName,{value:null,items:[]})},insert(r){const{index:n,displayValue:a,exportValue:s}=r.detail.insert,o=i.children[n],l=document.createElement("option");l.textContent=a;l.value=s;o?o.before(l):i.append(l);t.setValue(e,this.data.fieldName,{value:getValue(r,!0),items:getItems(r)})},items(r){const{items:n}=r.detail;for(;0!==i.length;)i.remove(0);for(const t of n){const{displayValue:e,exportValue:r}=t,n=document.createElement("option");n.textContent=e;n.value=r;i.append(n)}i.options.length>0&&(i.options[0].selected=!0);t.setValue(e,this.data.fieldName,{value:getValue(r,!0),items:getItems(r)})},indices(r){const i=new Set(r.detail.indices);for(const t of r.target.options)t.selected=i.has(t.index);t.setValue(e,this.data.fieldName,{value:getValue(r,!0)})},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,r)}));i.addEventListener("input",(r=>{var i;const n=getValue(r,!0),a=getValue(r,!1);t.setValue(e,this.data.fieldName,{value:n});null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,changeEx:n,willCommit:!0,commitKey:1,keyDown:!1}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(t=>t.target.checked))}else i.addEventListener("input",(r=>{t.setValue(e,this.data.fieldName,{value:getValue(r,!0),radioValue:getValue(r,!0)})}));this.data.combo&&this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str)})}render(){this.container.className="popupAnnotation";if(["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const t='[data-annotation-id="'.concat(this.data.parentId,'"]'),e=this.layer.querySelectorAll(t);if(0===e.length)return this.container;const r=new PopupElement({container:this.container,trigger:Array.from(e),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),n=this.page,a=i.Util.normalizeRect([this.data.parentRect[0],n.view[3]-this.data.parentRect[1]+n.view[1],this.data.parentRect[2],n.view[3]-this.data.parentRect[3]+n.view[1]]),s=a[0]+this.data.parentRect[2]-this.data.parentRect[0],o=a[1],[l,c,h,d]=this.viewport.viewBox,u=h-l,p=d-c;this.container.style.left="".concat(100*(s-l)/u,"%");this.container.style.top="".concat(100*(o-c)/p,"%");this.container.append(r.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 r=document.createElement("div");r.className="popupWrapper";this.hideElement=this.hideWrapper?r:this.container;this.hideElement.hidden=!0;const a=document.createElement("div");a.className="popup";const s=this.color;if(s){const t=.7*(255-s[0])+s[0],e=.7*(255-s[1])+s[1],r=.7*(255-s[2])+s[2];a.style.backgroundColor=i.Util.makeHexColor(0|t,0|e,0|r)}const l=document.createElement("h1");l.dir=this.titleObj.dir;l.textContent=this.titleObj.str;a.append(l);const c=n.PDFDateString.toDateObject(this.modificationDate);if(c){const t=document.createElement("span");t.className="popupDate";t.textContent="{{date}}, {{time}}";t.dataset.l10nId="annotation_date_string";t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()});a.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);a.append(t)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:a});a.lastChild.className="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))}a.addEventListener("click",this._hide.bind(this,!0));r.append(a);return r}_formatContents(t){let{str:e,dir:r}=t;const i=document.createElement("p");i.className="popupContent";i.dir=r;const n=e.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){const r=n[t];i.append(document.createTextNode(r));t<e-1&&i.append(document.createElement("br"))}return i}_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+=1}}_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-=1}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="freeTextAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const t=this.data,{width:e,height:r}=getRectDims(t.rect),i=this.svgFactory.create(e,r,!0),n=this.svgFactory.createElement("svg:line");n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);n.setAttribute("stroke-width",t.borderStyle.width||1);n.setAttribute("stroke","transparent");n.setAttribute("fill","transparent");i.append(n);this.container.append(i);this._createPopup(n,t);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const t=this.data,{width:e,height:r}=getRectDims(t.rect),i=this.svgFactory.create(e,r,!0),n=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");a.setAttribute("x",n/2);a.setAttribute("y",n/2);a.setAttribute("width",e-n);a.setAttribute("height",r-n);a.setAttribute("stroke-width",n||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");i.append(a);this.container.append(i);this._createPopup(a,t);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const t=this.data,{width:e,height:r}=getRectDims(t.rect),i=this.svgFactory.create(e,r,!0),n=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");a.setAttribute("cx",e/2);a.setAttribute("cy",r/2);a.setAttribute("rx",e/2-n/2);a.setAttribute("ry",r/2-n/2);a.setAttribute("stroke-width",n||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");i.append(a);this.container.append(i);this._createPopup(a,t);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:r}=getRectDims(t.rect),i=this.svgFactory.create(e,r,!0);let n=[];for(const e of t.vertices){const r=e.x-t.rect[0],i=t.rect[3]-e.y;n.push(r+","+i)}n=n.join(" ");const a=this.svgFactory.createElement(this.svgElementName);a.setAttribute("points",n);a.setAttribute("stroke-width",t.borderStyle.width||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");i.append(a);this.container.append(i);this._createPopup(a,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,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:r}=getRectDims(t.rect),i=this.svgFactory.create(e,r,!0);for(const e of t.inkLists){let r=[];for(const i of e){const e=i.x-t.rect[0],n=t.rect[3]-i.y;r.push("".concat(e,",").concat(n))}r=r.join(" ");const n=this.svgFactory.createElement(this.svgElementName);n.setAttribute("points",r);n.setAttribute("stroke-width",t.borderStyle.width||1);n.setAttribute("stroke","transparent");n.setAttribute("fill","transparent");this._createPopup(n,t);i.append(n)}this.container.append(i);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="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:r,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(r);this.content=i;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:r,content:i})}render(){var t,e;this.container.className="fileAttachmentAnnotation";const r=document.createElement("div");r.className="popupTriggerArea";r.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(r,this.data);this.container.append(r);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:r,viewport:s}=t;_classStaticPrivateMethodGet(this,AnnotationLayer,_setDimensions).call(this,r,s);const o=[],l=[];for(const t of e){if(!t)continue;if(t.annotationType===i.AnnotationType.POPUP){l.push(t);continue}const{width:e,height:r}=getRectDims(t.rect);e<=0||r<=0||o.push(t)}l.length&&o.push(...l);window.registerAcroformAnnotations&&window.registerAcroformAnnotations(o);for(const e of o){const i=AnnotationElementFactory.create({data:e,layer:r,page:t.page,viewport:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(i.isRenderable){const t=i.render();e.hidden&&(t.style.visibility="hidden");if(Array.isArray(t))for(const e of t)r.append(e);else i instanceof PopupAnnotationElement?r.prepend(t):r.append(t)}}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,r,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:r,viewport:i}=t;_classStaticPrivateMethodGet(this,AnnotationLayer,_setDimensions).call(this,r,i);_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,r,e);r.hidden=!1}}e.AnnotationLayer=AnnotationLayer;function _setDimensions(t,e){let{width:r,height:i,rotation:n}=e;const{style:a}=t,s=n%180!=0,o=Math.floor(r)+"px",l=Math.floor(i)+"px";a.width=s?l:o;a.height=s?o:l;t.setAttribute("data-main-rotation",n)}function _setAnnotationCanvasMap(t,e){if(e){for(const[r,i]of e){const e=t.querySelector('[data-annotation-id="'.concat(r,'"]'));if(!e)continue;const{firstChild:n}=e;n?"CANVAS"===n.nodeName?n.replaceWith(i):n.before(i):e.append(i)}e.clear()}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;r(79);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,r,i,n]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*r+n)]}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 r=makeColorComp(e);return"#".concat(r).concat(r).concat(r)}static RGB_G(t){let[e,r,i]=t;return["G",.3*e+.59*r+.11*i]}static RGB_HTML(t){let[e,r,i]=t;const n=makeColorComp(e),a=makeColorComp(r),s=makeColorComp(i);return"#".concat(n).concat(a).concat(s)}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,r,i,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,r+n)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,r,i]=t;const n=1-e,a=1-r,s=1-i;return["CMYK",n,a,s,Math.min(n,a,s)]}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;r(79);var i=r(228);e.XfaLayer=class XfaLayer{static setupStorage(t,e,r,i,n){const a=i.getValue(e,{value:null});switch(r.name){case"textarea":null!==a.value&&(t.textContent=a.value);if("print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){a.value===r.attributes.xfaOn?t.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&t.removeAttribute("checked");if("print"===n)break;t.addEventListener("change",(t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==a.value&&t.setAttribute("value",a.value);if("print"===n)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value)for(const t of r.children)t.attributes.value===a.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const r=t.target.options,n=-1===r.selectedIndex?"":r[r.selectedIndex].value;i.setValue(e,{value:n})}))}}static setAttributes(t){let{html:e,element:r,storage:i=null,intent:n,linkService:a}=t;const{attributes:s}=r,o=e instanceof HTMLAnchorElement;"radio"===s.type&&(s.name="".concat(s.name,"-").concat(n));for(const[t,r]of Object.entries(s))if(null!=r)switch(t){case"class":r.length&&e.setAttribute(t,r.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",r);break;case"style":Object.assign(e.style,r);break;case"textContent":e.textContent=r;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,r)}o&&a.addLinkAttributes(e,s.href,s.newWindow);i&&s.dataId&&this.setupStorage(e,s.dataId,r,i)}static render(t){const e=t.annotationStorage,r=t.linkService,n=t.xfaHtml,a=t.intent||"display",s=document.createElement(n.name);n.attributes&&this.setAttributes({html:s,element:n,intent:a,linkService:r});const o=[[n,-1,s]],l=t.div;l.append(s);if(t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var h;const[t,n,s]=o.at(-1);if(n+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:d}=l;if("#text"===d){const t=document.createTextNode(l.value);c.push(t);s.append(t);continue}let u;u=null!=l&&null!==(h=l.attributes)&&void 0!==h&&h.xmlns?document.createElementNS(l.attributes.xmlns,d):document.createElement(d);s.append(u);l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:a,linkService:r});if(l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);i.XfaText.shouldBuildText(d)&&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(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e;t.div.hidden=!1}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){const e=new TextLayerRenderTask({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});e._render(t.timeout);return e};r(79);r(216);r(2);r(242);r(138);r(140);r(141);r(152);r(209);var i=r(1),n=r(202);const a=30,s=new Map,o=/^\s+$/g;function appendText(t,e,r,n){const l=document.createElement("span"),c=t._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(l);const h=i.Util.transform(t._viewport.transform,e.transform);let d=Math.atan2(h[1],h[0]);const u=r[e.fontName];u.vertical&&(d+=Math.PI/2);const p=Math.hypot(h[2],h[3]),f=p*function getAscent(t,e){const r=s.get(t);if(r)return r;e.save();e.font="".concat(a,"px ").concat(t);const i=e.measureText("");let n=null==i?void 0:i.fontBoundingBoxAscent,o=Math.abs(null==i?void 0:i.fontBoundingBoxDescent);if(n){e.restore();const r=n/(n+o);s.set(t,r);return r}e.strokeStyle="red";e.clearRect(0,0,a,a);e.strokeText("g",0,0);let l=e.getImageData(0,0,a,a).data;o=0;for(let t=l.length-1-3;t>=0;t-=4)if(l[t]>0){o=Math.ceil(t/4/a);break}e.clearRect(0,0,a,a);e.strokeText("A",0,a);l=e.getImageData(0,0,a,a).data;n=0;for(let t=0,e=l.length;t<e;t+=4)if(l[t]>0){n=a-Math.floor(t/4/a);break}e.restore();if(n){const e=n/(n+o);s.set(t,e);return e}s.set(t,.8);return.8}(u.fontFamily,n);let g,v;if(0===d){g=h[4];v=h[5]-f}else{g=h[4]+f*Math.sin(d);v=h[5]-f*Math.cos(d)}l.style.left="".concat(g,"px");l.style.top="".concat(v,"px");l.style.fontSize="".concat(p,"px");l.style.fontFamily=u.fontFamily;c.fontSize=p;l.setAttribute("role","presentation");l.textContent=e.str;l.dir=e.dir;t._fontInspectorEnabled&&(l.dataset.fontName=e.fontName);0!==d&&(c.angle=d*(180/Math.PI));let m=!1;if(e.str.length>1||t._enhanceTextSelection&&o.test(e.str))m=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),r=Math.abs(e.transform[3]);t!==r&&Math.max(t,r)/Math.min(t,r)>1.5&&(m=!0)}m&&(u.vertical?c.canvasWidth=e.height*t._viewport.scale:c.canvasWidth=e.width*t._viewport.scale);t._textDivProperties.set(l,c);t._textContentStream&&t._layoutText(l);if(t._enhanceTextSelection&&c.hasText){let r=1,n=0;if(0!==d){r=Math.cos(d);n=Math.sin(d)}const a=(u.vertical?e.height:e.width)*t._viewport.scale,s=p;let o,c;if(0!==d){o=[r,n,-n,r,g,v];c=i.Util.getAxialAlignedBoundingBox([0,0,a,s],o)}else c=[g,v,g+a,v+s];t._bounds.push({left:c[0],top:c[1],right:c[2],bottom:c[3],div:l,size:[a,s],m:o})}}function render(t){if(t._canceled)return;const e=t._textDivs,r=t._capability,i=e.length;if(i>1e5){t._renderingDone=!0;r.resolve()}else{if(!t._textContentStream)for(let r=0;r<i;r++)t._layoutText(e[r]);t._renderingDone=!0;r.resolve()}}function findPositiveMin(t,e,r){let i=0;for(let n=0;n<r;n++){const r=t[e++];r>0&&(i=i?Math.min(r,i):r)}return i}function expand(t){const e=t._bounds,r=t._viewport,n=function expandBounds(t,e,r){const i=r.map((function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}}));expandBoundsLTR(t,i);const n=new Array(r.length);for(const t of i){const e=t.index;n[e]={left:t.x1New,top:0,right:t.x2New,bottom:0}}r.map((function(e,r){const a=n[r],s=i[r];s.x1=e.top;s.y1=t-a.right;s.x2=e.bottom;s.y2=t-a.left;s.index=r;s.x1New=void 0;s.x2New=void 0}));expandBoundsLTR(e,i);for(const t of i){const e=t.index;n[e].top=t.x1New;n[e].bottom=t.x2New}return n}(r.width,r.height,e);for(let r=0;r<n.length;r++){const a=e[r].div,s=t._textDivProperties.get(a);if(0===s.angle){s.paddingLeft=e[r].left-n[r].left;s.paddingTop=e[r].top-n[r].top;s.paddingRight=n[r].right-e[r].right;s.paddingBottom=n[r].bottom-e[r].bottom;t._textDivProperties.set(a,s);continue}const o=n[r],l=e[r],c=l.m,h=c[0],d=c[1],u=[[0,0],[0,l.size[1]],[l.size[0],0],l.size],p=new Float64Array(64);for(let t=0,e=u.length;t<e;t++){const e=i.Util.applyTransform(u[t],c);p[t+0]=h&&(o.left-e[0])/h;p[t+4]=d&&(o.top-e[1])/d;p[t+8]=h&&(o.right-e[0])/h;p[t+12]=d&&(o.bottom-e[1])/d;p[t+16]=d&&(o.left-e[0])/-d;p[t+20]=h&&(o.top-e[1])/h;p[t+24]=d&&(o.right-e[0])/-d;p[t+28]=h&&(o.bottom-e[1])/h;p[t+32]=h&&(o.left-e[0])/-h;p[t+36]=d&&(o.top-e[1])/-d;p[t+40]=h&&(o.right-e[0])/-h;p[t+44]=d&&(o.bottom-e[1])/-d;p[t+48]=d&&(o.left-e[0])/d;p[t+52]=h&&(o.top-e[1])/-h;p[t+56]=d&&(o.right-e[0])/d;p[t+60]=h&&(o.bottom-e[1])/-h}const f=1+Math.min(Math.abs(h),Math.abs(d));s.paddingLeft=findPositiveMin(p,32,16)/f;s.paddingTop=findPositiveMin(p,48,16)/f;s.paddingRight=findPositiveMin(p,0,16)/f;s.paddingBottom=findPositiveMin(p,16,16)/f;t._textDivProperties.set(a,s)}}function expandBoundsLTR(t,e){e.sort((function(t,e){return t.x1-e.x1||t.index-e.index}));const r=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(const t of e){let e=0;for(;e<r.length&&r[e].end<=t.y1;)e++;let i,n,a=r.length-1;for(;a>=0&&r[a].start>=t.y2;)a--;let s,o,l=-1/0;for(s=e;s<=a;s++){i=r[s];n=i.boundary;let e;e=n.x2>t.x1?n.index>t.index?n.x1New:t.x1:void 0===n.x2New?(n.x2+t.x1)/2:n.x2New;e>l&&(l=e)}t.x1New=l;for(s=e;s<=a;s++){i=r[s];n=i.boundary;void 0===n.x2New?n.x2>t.x1?n.index>t.index&&(n.x2New=n.x2):n.x2New=l:n.x2New>l&&(n.x2New=Math.max(l,n.x2))}const c=[];let h=null;for(s=e;s<=a;s++){i=r[s];n=i.boundary;const e=n.x2>t.x2?n:t;if(h===e)c.at(-1).end=i.end;else{c.push({start:i.start,end:i.end,boundary:e});h=e}}if(r[e].start<t.y1){c[0].start=t.y1;c.unshift({start:r[e].start,end:t.y1,boundary:r[e].boundary})}if(t.y2<r[a].end){c.at(-1).end=t.y2;c.push({start:t.y2,end:r[a].end,boundary:r[a].boundary})}for(s=e;s<=a;s++){i=r[s];n=i.boundary;if(void 0!==n.x2New)continue;let t=!1;for(o=e-1;!t&&o>=0&&r[o].start>=n.y1;o--)t=r[o].boundary===n;for(o=a+1;!t&&o<r.length&&r[o].end<=n.y2;o++)t=r[o].boundary===n;for(o=0;!t&&o<c.length;o++)t=c[o].boundary===n;t||(n.x2New=l)}Array.prototype.splice.apply(r,[e,a-e+1,...c])}for(const e of r){const r=e.boundary;void 0===r.x2New&&(r.x2New=Math.max(t,r.x2))}}class TextLayerRenderTask{constructor(t){var e;let{textContent:r,textContentStream:a,container:s,viewport:o,textDivs:l,textContentItemsStr:c,enhanceTextSelection:h}=t;h&&(0,n.deprecated)("The `enhanceTextSelection` functionality will be removed in the future.");this._textContent=r;this._textContentStream=a;this._container=s;this._document=s.ownerDocument;this._viewport=o;this._textDivs=l||[];this._textContentItemsStr=c||[];this._enhanceTextSelection=!!h;this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled);this._reader=null;this._layoutTextLastFontSize=null;this._layoutTextLastFontFamily=null;this._layoutTextCtx=null;this._textDivProperties=new WeakMap;this._renderingDone=!1;this._canceled=!1;this._capability=(0,i.createPromiseCapability)();this._renderTimer=null;this._bounds=[];this._devicePixelRatio=globalThis.devicePixelRatio||1;this._capability.promise.finally((()=>{this._enhanceTextSelection||(this._textDivProperties=null);if(this._layoutTextCtx){this._layoutTextCtx.canvas.width=0;this._layoutTextCtx.canvas.height=0;this._layoutTextCtx=null}})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}if(null!==this._renderTimer){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(t,e){for(let r=0,i=t.length;r<i;r++)if(void 0!==t[r].str){this._textContentItemsStr.push(t[r].str);appendText(this,t[r],e,this._layoutTextCtx)}else if("beginMarkedContentProps"===t[r].type||"beginMarkedContent"===t[r].type){const e=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==t[r].id&&this._container.setAttribute("id","".concat(t[r].id));e.append(this._container)}else"endMarkedContent"===t[r].type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._textDivProperties.get(t);let r="";if(0!==e.canvasWidth&&e.hasText){const{fontFamily:i}=t.style,{fontSize:n}=e;if(n!==this._layoutTextLastFontSize||i!==this._layoutTextLastFontFamily){this._layoutTextCtx.font="".concat(n*this._devicePixelRatio,"px ").concat(i);this._layoutTextLastFontSize=n;this._layoutTextLastFontFamily=i}try{const{width:i}=this._layoutTextCtx.measureText(t.textContent);if(i>0){const t=this._devicePixelRatio*e.canvasWidth/i;this._enhanceTextSelection&&(e.scale=t);r="scaleX(".concat(t,")")}}catch(t){}}0!==e.angle&&(r="rotate(".concat(e.angle,"deg) ").concat(r));if(r.length>0){this._enhanceTextSelection&&(e.originalTransform=r);t.style.transform=r}e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const e=(0,i.createPromiseCapability)();let r=Object.create(null);const n=this._document.createElement("canvas");n.height=n.width=a;this._layoutTextCtx=n.getContext("2d",{alpha:!1});if(this._textContent){const t=this._textContent.items,r=this._textContent.styles;this._processItems(t,r);e.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const pump=()=>{this._reader.read().then((t=>{let{value:i,done:n}=t;if(n)e.resolve();else{Object.assign(r,i.styles);this._processItems(i.items,r);pump()}}),e.reject)};this._reader=this._textContentStream.getReader();pump()}}e.promise.then((()=>{r=null;t?this._renderTimer=setTimeout((()=>{render(this);this._renderTimer=null}),t):render(this)}),this._capability.reject)}expandTextDivs(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._enhanceTextSelection||!this._renderingDone)return;if(null!==this._bounds){expand(this);this._bounds=null}const e=[],r=[];for(let i=0,n=this._textDivs.length;i<n;i++){const n=this._textDivs[i],a=this._textDivProperties.get(n);if(a.hasText)if(t){e.length=0;r.length=0;a.originalTransform&&e.push(a.originalTransform);if(a.paddingTop>0){r.push("".concat(a.paddingTop,"px"));e.push("translateY(".concat(-a.paddingTop,"px)"))}else r.push(0);a.paddingRight>0?r.push("".concat(a.paddingRight/a.scale,"px")):r.push(0);a.paddingBottom>0?r.push("".concat(a.paddingBottom,"px")):r.push(0);if(a.paddingLeft>0){r.push("".concat(a.paddingLeft/a.scale,"px"));e.push("translateX(".concat(-a.paddingLeft/a.scale,"px)"))}else r.push(0);n.style.padding=r.join(" ");e.length&&(n.style.transform=e.join(" "))}else{n.style.padding=null;n.style.transform=a.originalTransform}}}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,r)=>{r(118)("Float64",(function(t){return function Float64Array(e,r,i){return t(this,e,r,i)}}))},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;r(79);r(93);r(116);r(117);r(138);r(140);r(141);r(217);r(152);r(216);var i=r(202),n=r(1);r(219);let a=class{constructor(){(0,n.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=a;{const s={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"],h=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!r)return URL.createObjectURL(new Blob([t],{type:e}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let n="data:".concat(e,";base64,");for(let e=0,r=t.length;e<r;e+=3){const a=255&t[e],s=255&t[e+1],o=255&t[e+2],l=(3&a)<<4|s>>4,c=e+1<r?(15&s)<<2|o>>6:64,h=e+2<r?63&o:64;n+=i[a>>2]+i[l]+i[c]+i[h]}return n},d=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 r=t;for(let t=0;t<8;t++)r=1&r?3988292384^r>>1&2147483647:r>>1&2147483647;e[t]=r}function writePngChunk(t,r,i,n){let a=n;const s=r.length;i[a]=s>>24&255;i[a+1]=s>>16&255;i[a+2]=s>>8&255;i[a+3]=255&s;a+=4;i[a]=255&t.charCodeAt(0);i[a+1]=255&t.charCodeAt(1);i[a+2]=255&t.charCodeAt(2);i[a+3]=255&t.charCodeAt(3);a+=4;i.set(r,a);a+=r.length;const o=function crc32(t,r,i){let n=-1;for(let a=r;a<i;a++){const r=255&(n^t[a]);n=n>>>8^e[r]}return-1^n}(i,n+4,a);i[a]=o>>24&255;i[a+1]=o>>16&255;i[a+2]=o>>8&255;i[a+3]=255&o}function deflateSync(t){return function deflateSyncUncompressed(t){let e=t.length;const r=65535,i=Math.ceil(e/r),n=new Uint8Array(2+e+5*i+4);let a=0;n[a++]=120;n[a++]=156;let s=0;for(;e>r;){n[a++]=0;n[a++]=255;n[a++]=255;n[a++]=0;n[a++]=0;n.set(t.subarray(s,s+r),a);a+=r;s+=r;e-=r}n[a++]=1;n[a++]=255&e;n[a++]=e>>8&255;n[a++]=255&~e;n[a++]=(65535&~e)>>8&255;n.set(t.subarray(s),a);a+=t.length-s;const o=function adler32(t,e,r){let i=1,n=0;for(let a=e;a<r;++a){i=(i+(255&t[a]))%65521;n=(n+i)%65521}return n<<16|i}(t,0,t.length);n[a++]=o>>24&255;n[a++]=o>>16&255;n[a++]=o>>8&255;n[a++]=255&o;return n}(t)}return function convertImgDataToPng(e,r,i){return function encode(e,r,i,a){const s=e.width,o=e.height;let l,c,h;const d=e.data;switch(r){case n.ImageKind.GRAYSCALE_1BPP:c=0;l=1;h=s+7>>3;break;case n.ImageKind.RGB_24BPP:c=2;l=8;h=3*s;break;case n.ImageKind.RGBA_32BPP:c=6;l=8;h=4*s;break;default:throw new Error("invalid format")}const u=new Uint8Array((1+h)*o);let p=0,f=0;for(let t=0;t<o;++t){u[p++]=0;u.set(d.subarray(f,f+h),p);f+=h;p+=h}if(r===n.ImageKind.GRAYSCALE_1BPP&&a){p=0;for(let t=0;t<o;t++){p++;for(let t=0;t<h;t++)u[p++]^=255}}const g=new Uint8Array([s>>24&255,s>>16&255,s>>8&255,255&s,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 y=0;_.set(t,y);y+=t.length;writePngChunk("IHDR",g,_,y);y+=12+g.length;writePngChunk("IDATA",v,_,y);y+=12+v.length;writePngChunk("IEND",new Uint8Array(0),_,y);return createObjectURL(_,"image/png",i)}(e,void 0===e.kind?n.ImageKind.GRAYSCALE_1BPP:e.kind,r,i)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=s.fontWeight;this.fontSize=0;this.textMatrix=n.IDENTITY_MATRIX;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=n.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=s.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 r=[];for(const i of t)if("save"!==i.fn)"restore"===i.fn?e=r.pop():e.push(i);else{e.push({fnId:92,fn:"group",items:[]});r.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 r=e.length-1;if("0"!==e[r])return e;do{r--}while("0"===e[r]);return e.substring(0,"."===e[r]?r:r+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(".concat(pf(t[0])," ").concat(pf(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){const e=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(pf(e),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(pf(t[4])," ").concat(pf(t[5]),")");return"matrix(".concat(pf(t[0])," ").concat(pf(t[1])," ").concat(pf(t[2])," ").concat(pf(t[3])," ").concat(pf(t[4])," ")+"".concat(pf(t[5]),")")}let u=0,p=0,f=0;e.SVGGraphics=a=class{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new i.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=n.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=!!r;this._operatorIdMapping=[];for(const t in n.OPS)this._operatorIdMapping[n.OPS[t]]=t}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,r=t.argsArray;for(let t=0,i=e.length;t<i;t++)if(e[t]===n.OPS.dependency)for(const e of r[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,r=new Promise((r=>{t.get(e,r)}));this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(t,e,r,i,a,s){const o=[t,e,r,i,a,s];this.transformMatrix=n.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const r=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=n.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return r}))}convertOpList(t){const e=this._operatorIdMapping,r=t.argsArray,i=t.fnArray,n=[];for(let t=0,a=i.length;t<a;t++){const a=i[t];n.push({fnId:a,fn:e[a],args:r[t]})}return opListToTree(n)}executeOpTree(t){for(const e of t){const t=e.fn,r=e.fnId,i=e.args;switch(0|r){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(i);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case n.OPS.setFont:this.setFont(i);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(i[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(i[0],i[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case n.OPS.setHScale:this.setHScale(i[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.setTextRise:this.setTextRise(i[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case n.OPS.setLineWidth:this.setLineWidth(i[0]);break;case n.OPS.setLineJoin:this.setLineJoin(i[0]);break;case n.OPS.setLineCap:this.setLineCap(i[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case n.OPS.setFillColorN:this.setFillColorN(i);break;case n.OPS.shadingFill:this.shadingFill(i[0]);break;case n.OPS.setDash:this.setDash(i[0],i[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case n.OPS.setFlatness:this.setFlatness(i[0]);break;case n.OPS.setGState:this.setGState(i[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.constructPath:this.constructPath(i[0],i[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,n.warn)("Unimplemented operator ".concat(t))}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,r,i,n,a){const s=this.current;s.textMatrix=s.lineMatrix=[t,e,r,i,n,a];s.textMatrixScale=Math.hypot(t,e);s.x=s.lineX=0;s.y=s.lineY=0;s.xcoords=[];s.ycoords=[];s.tspan=this.svgFactory.createElement("svg:tspan");s.tspan.setAttributeNS(null,"font-family",s.fontFamily);s.tspan.setAttributeNS(null,"font-size","".concat(pf(s.fontSize),"px"));s.tspan.setAttributeNS(null,"y",pf(-s.y));s.txtElement=this.svgFactory.createElement("svg:text");s.txtElement.append(s.tspan)}beginText(){const t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=n.IDENTITY_MATRIX;t.lineMatrix=n.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 r=this.current;r.x=r.lineX+=t;r.y=r.lineY+=e;r.xcoords=[];r.ycoords=[];r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size","".concat(pf(r.fontSize),"px"));r.tspan.setAttributeNS(null,"y",pf(-r.y))}showText(t){const e=this.current,r=e.font,i=e.fontSize;if(0===i)return;const a=e.fontSizeScale,l=e.charSpacing,c=e.wordSpacing,h=e.fontDirection,d=e.textHScale*h,u=r.vertical,p=u?1:-1,f=r.defaultVMetrics,g=i*e.fontMatrix[0];let v=0;for(const n of t){if(null===n){v+=h*c;continue}if("number"==typeof n){v+=p*n*i/1e3;continue}const t=(n.isSpace?c:0)+l,s=n.fontChar;let o,d,m,_=n.width;if(u){let t;const e=n.vmetric||f;t=n.vmetric?e[1]:.5*_;t=-t*g;const r=e[2]*g;_=e?-e[0]:_;o=t/a;d=(v+r)/a}else{o=v/a;d=0}if(n.isInFont||r.missingFile){e.xcoords.push(e.x+o);u&&e.ycoords.push(-e.y+d);e.tspan.textContent+=s}m=u?_*g-t*h:_*g+t*h;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*d;e.tspan.setAttributeNS(null,"font-family",e.fontFamily);e.tspan.setAttributeNS(null,"font-size","".concat(pf(e.fontSize),"px"));e.fontStyle!==s.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle);e.fontWeight!==s.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const m=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(m===n.TextRenderingMode.FILL||m===n.TextRenderingMode.FILL_STROKE){e.fillColor!==s.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor);e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)}else e.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none");if(m===n.TextRenderingMode.STROKE||m===n.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","".concat(pm(_)," scale(").concat(pf(d),", -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: "'.concat(t.loadedName,'";')+" src: url(".concat(e,"); }\n")}setFont(t){const e=this.current,r=this.commonObjs.get(t[0]);let i=t[1];e.font=r;if(this.embedFonts&&!r.missingFile&&!this.embeddedFonts[r.loadedName]){this.addFontStyle(r);this.embeddedFonts[r.loadedName]=r}e.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX;let a="normal";r.black?a="900":r.bold&&(a="bold");const s=r.italic?"italic":"normal";if(i<0){i=-i;e.fontDirection=-1}else e.fontDirection=1;e.fontSize=i;e.fontFamily=r.loadedName;e.fontWeight=a;e.fontStyle=s;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&n.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=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=n.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=n.Util.makeHexColor(t,e,r);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,r=this.viewport.height,i=n.Util.inverseTransform(this.transformMatrix),a=n.Util.applyTransform([0,0],i),s=n.Util.applyTransform([0,r],i),o=n.Util.applyTransform([e,0],i),l=n.Util.applyTransform([e,r],i),c=Math.min(a[0],s[0],o[0],l[0]),h=Math.min(a[1],s[1],o[1],l[1]),d=Math.max(a[0],s[0],o[0],l[0]),u=Math.max(a[1],s[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",h);p.setAttributeNS(null,"width",d-c);p.setAttributeNS(null,"height",u-h);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],r=t[2],i=t[3]||n.IDENTITY_MATRIX,[a,s,o,l]=t[4],c=t[5],h=t[6],d=t[7],u="shading".concat(f++),[p,g,v,m]=n.Util.normalizeRect([...n.Util.applyTransform([a,s],i),...n.Util.applyTransform([o,l],i)]),[_,y]=n.Util.singularValueDecompose2dScale(i),b=c*_,A=h*y,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",u);P.setAttributeNS(null,"patternUnits","userSpaceOnUse");P.setAttributeNS(null,"width",b);P.setAttributeNS(null,"height",A);P.setAttributeNS(null,"x","".concat(p));P.setAttributeNS(null,"y","".concat(g));const S=this.svg,x=this.transformMatrix,w=this.current.fillColor,E=this.current.strokeColor,k=this.svgFactory.create(v-p,m-g);this.svg=k;this.transformMatrix=i;if(2===d){const t=n.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(r));this.svg=S;this.transformMatrix=x;this.current.fillColor=w;this.current.strokeColor=E;P.append(k.childNodes[0]);this.defs.append(P);return"url(#".concat(u,")")}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading".concat(f++),r=t[3];let i;switch(t[1]){case"axial":const r=t[4],n=t[5];i=this.svgFactory.createElement("svg:linearGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"x1",r[0]);i.setAttributeNS(null,"y1",r[1]);i.setAttributeNS(null,"x2",n[0]);i.setAttributeNS(null,"y2",n[1]);break;case"radial":const a=t[4],s=t[5],o=t[6],l=t[7];i=this.svgFactory.createElement("svg:radialGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"cx",s[0]);i.setAttributeNS(null,"cy",s[1]);i.setAttributeNS(null,"r",l);i.setAttributeNS(null,"fx",a[0]);i.setAttributeNS(null,"fy",a[1]);i.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}for(const t of r){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);i.append(e)}this.defs.append(i);return"url(#".concat(e,")");case"Mesh":(0,n.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const r=this.current;let i=r.x,a=r.y,s=[],o=0;for(const r of t)switch(0|r){case n.OPS.rectangle:i=e[o++];a=e[o++];const t=i+e[o++],r=a+e[o++];s.push("M",pf(i),pf(a),"L",pf(t),pf(a),"L",pf(t),pf(r),"L",pf(i),pf(r),"Z");break;case n.OPS.moveTo:i=e[o++];a=e[o++];s.push("M",pf(i),pf(a));break;case n.OPS.lineTo:i=e[o++];a=e[o++];s.push("L",pf(i),pf(a));break;case n.OPS.curveTo:i=e[o+4];a=e[o+5];s.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(i),pf(a));o+=6;break;case n.OPS.curveTo2:s.push("C",pf(i),pf(a),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));i=e[o+2];a=e[o+3];o+=4;break;case n.OPS.curveTo3:i=e[o+2];a=e[o+3];s.push("C",pf(e[o]),pf(e[o+1]),pf(i),pf(a),pf(i),pf(a));o+=4;break;case n.OPS.closePath:s.push("Z")}s=s.join(" ");if(r.path&&t.length>0&&t[0]!==n.OPS.rectangle&&t[0]!==n.OPS.moveTo)s=r.path.getAttributeNS(null,"d")+s;else{r.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(r.path)}r.path.setAttributeNS(null,"d",s);r.path.setAttributeNS(null,"fill","none");r.element=r.path;r.setCurrentPoint(i,a)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath".concat(u++),r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",e);r.setAttributeNS(null,"transform",pm(this.transformMatrix));const i=t.element.cloneNode(!0);"evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;r.append(i);this.defs.append(r);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;r.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl="url(#".concat(e,")");this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e="".concat(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,r]of t)switch(e){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r);break;case"CA":this.setStrokeAlpha(r);break;case"ca":this.setFillAlpha(r);break;default:(0,n.warn)("Unimplemented graphic state operator ".concat(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 r=this.current;let i=r.dashArray;1!==e&&i.length>0&&(i=i.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",r.strokeColor);t.setAttributeNS(null,"stroke-opacity",r.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(r.miterLimit));t.setAttributeNS(null,"stroke-linecap",r.lineCap);t.setAttributeNS(null,"stroke-linejoin",r.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*r.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",i.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*r.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){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=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,n.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}paintInlineImageXObject(t,e){const r=t.width,i=t.height,n=d(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y","0");a.setAttributeNS(null,"width",pf(r));a.setAttributeNS(null,"height",pf(i));this.current.element=a;this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS(l,"xlink:href",n);s.setAttributeNS(null,"x","0");s.setAttributeNS(null,"y",pf(-i));s.setAttributeNS(null,"width",pf(r)+"px");s.setAttributeNS(null,"height",pf(i)+"px");s.setAttributeNS(null,"transform","scale(".concat(pf(1/r)," ").concat(pf(-1/i),")"));e?e.append(s):this._ensureTransformGroup().append(s)}paintImageMaskXObject(t){const e=this.current,r=t.width,i=t.height,n=e.fillColor;e.maskId="mask".concat(p++);const a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",e.maskId);const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0");s.setAttributeNS(null,"y","0");s.setAttributeNS(null,"width",pf(r));s.setAttributeNS(null,"height",pf(i));s.setAttributeNS(null,"fill",n);s.setAttributeNS(null,"mask","url(#".concat(e.maskId,")"));this.defs.append(a);this._ensureTransformGroup().append(s);this.paintInlineImageXObject(t,a)}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],r=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]);i.setAttributeNS(null,"y",e[1]);i.setAttributeNS(null,"width",pf(t));i.setAttributeNS(null,"height",pf(r));this.current.element=i;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),r=this.svgFactory.createElement("svg:defs");e.append(r);this.defs=r;const i=this.svgFactory.createElement("svg:g");i.setAttributeNS(null,"transform",pm(t.transform));e.append(i);this.svg=i;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}}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;r(2);r(79);r(152);r(117);r(138);r(140);r(141);r(146);var i=r(1),n=r(245);const a=require("fs"),s=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:///".concat(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,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){(0,i.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 r=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(r);return r}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.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,i.createPromiseCapability)();this._headersCapability=(0,i.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(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,i.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).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 i.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,i.createPromiseCapability)();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=(0,i.createPromiseCapability)();return this.read()}this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded});return{value:new Uint8Array(t).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 i.MissingPDFException('Missing PDF "'.concat(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:r,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r;this._contentLength=a||this._contentLength;this._filename=(0,n.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=s.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,r){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const r=t.httpHeaders[e];void 0!==r&&(this._httpHeaders[e]=r)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(r-1);const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=s.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(/^\//,""));a.lstat(e,((t,r)=>{if(t){"ENOENT"===t.code&&(t=new i.MissingPDFException('Missing PDF "'.concat(e,'".')));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=r.size;this._setReadableStream(a.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,r){super(t);let i=decodeURIComponent(this._url.path);c.test(this._url.href)&&(i=i.replace(/^\//,""));this._setReadableStream(a.createReadStream(i,{start:e,end:r-1}))}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new i.MissingPDFException('Missing PDF "'+e+'".');return new i.UnexpectedResponseException("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,n.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,a.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:r,rangeChunkSize:i,disableRange:n}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);if(!Number.isInteger(s))return a;a.suggestedLength=s;if(s<=2*i)return a;if(n||!r)return a;if("bytes"!==e("Accept-Ranges"))return a;if("identity"!==(e("Content-Encoding")||"identity"))return a;a.allowRangeRequests=!0;return a};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};r(203);var i=r(1),n=r(246),a=r(202)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,r=toParamRegExp("filename\\*","i").exec(t);if(r){r=r[1];let t=rfc2616unquote(r);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}r=function rfc2231getparam(t){const e=[];let r;const i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=i.exec(t));){let[,t,i,n]=r;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[i,n]}const n=[];for(let t=0;t<e.length&&t in e;++t){let[r,i]=e[t];i=rfc2616unquote(i);if(r){i=unescape(i);0===t&&(i=rfc5987decode(i))}n.push(i)}return n.join("")}(t);if(r){return fixupEncoding(rfc2047decode(r))}r=toParamRegExp("filename","i").exec(t);if(r){r=r[1];let t=rfc2616unquote(r);t=rfc2047decode(t);return fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,r){if(t){if(!/^[\x00-\xFF]+$/.test(r))return r;try{const n=new TextDecoder(t,{fatal:!0}),a=(0,i.stringToBytes)(r);r=n.decode(a);e=!1}catch(t){}}return r}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 r=e[t].indexOf('"');if(-1!==r){e[t]=e[t].slice(0,r);e.length=t+1}e[t]=e[t].replace(/\\(.)/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.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,r,i){if("q"===r||"Q"===r)return textdecode(e,i=(i=i.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{i=atob(i)}catch(t){}return textdecode(e,i)}))}return""};r(2);r(204);r(79);r(146);var i=r(1)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;r(2);r(79);r(152);var i=r(1),n=r(245);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,r){const i={begin:t,end:e};for(const t in r)i[t]=r[t];return this.request(i)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),r=this.currXhrId++,i=this.pendingRequests[r]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const r=this.httpHeaders[t];void 0!==r&&e.setRequestHeader(t,r)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1));i.expectedStatus=206}else i.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(r){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,r);e.onprogress=this.onProgress.bind(this,r);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;e.send(null);return r}onProgress(t,e){var r;const i=this.pendingRequests[t];i&&(null===(r=i.onProgress)||void 0===r||r.call(i,e))}onStateChange(t,e){const r=this.pendingRequests[t];if(!r)return;const n=r.xhr;if(n.readyState>=2&&r.onHeadersReceived){r.onHeadersReceived();delete r.onHeadersReceived}if(4!==n.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===n.status&&this.isHttp){var a;null===(a=r.onError)||void 0===a||a.call(r,n.status);return}const s=n.status||200;if(!(200===s&&206===r.expectedStatus)&&s!==r.expectedStatus){var o;null===(o=r.onError)||void 0===o||o.call(r,n.status);return}const l=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,i.stringToBytes)(e).buffer}(n);if(206===s){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)r.onDone({begin:0,chunk:l});else{var c;null===(c=r.onError)||void 0===c||c.call(r,n.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,i.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 r=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);r.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(r);return r}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 r={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(r);this._headersReceivedCapability=(0,i.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:r,suggestedLength:i}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0);this._contentLength=i||this._contentLength;this._filename=(0,n.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,n.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,i.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,r){this._manager=t;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,r,i);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,n.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,i.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,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;r(2);r(79);r(152);r(117);r(138);r(140);r(141);var i=r(1),n=r(245);function createFetchOptions(t,e,r){return{method:"GET",headers:t,signal:null==r?void 0:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const r in t){const i=t[r];void 0!==i&&e.append(r,i)}return e}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,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){(0,i.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 r=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(r);return r}cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.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,i.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const r=e.url;fetch(r,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,r);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=a||this._contentLength;this._filename=(0,n.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,r){this._stream=t;this._reader=null;this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1;this._readCapability=(0,i.createPromiseCapability)();this._isStreamingSupported=!a.disableStream;"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(e,"-").concat(r-1));const s=a.url;fetch(s,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,s);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t](r,r.exports,__w_pdfjs_require__);return r.exports}var __webpack_exports__={};(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return n.AnnotationEditorLayer}});Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}});Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}});Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return i.LoopbackPort}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return r.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 r.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}});Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}});Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return d.XfaLayer}});Object.defineProperty(t,"binarySearchFirstItem",{enumerable:!0,get:function(){return r.binarySearchFirstItem}});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 r.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return i.version}});var e=__w_pdfjs_require__(1),r=__w_pdfjs_require__(202),i=__w_pdfjs_require__(208),n=__w_pdfjs_require__(230),a=__w_pdfjs_require__(212),s=__w_pdfjs_require__(238),o=__w_pdfjs_require__(221),l=__w_pdfjs_require__(219),c=__w_pdfjs_require__(241),h=__w_pdfjs_require__(243),d=__w_pdfjs_require__(240);if(l.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(244);(0,i.setPDFNetworkStreamFactory)((e=>new t(e)))}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(247),{PDFFetchStream:e}=__w_pdfjs_require__(248);(0,i.setPDFNetworkStreamFactory)((i=>(0,r.isValidFetchUrl)(i.url)?new e(i):new t(i)))}})();return __webpack_exports__})()));
});