mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-29 05:31:43 +02:00
2 lines
348 KiB
JavaScript
2 lines
348 KiB
JavaScript
((t,e)=>{"object"==typeof exports&&"object"==typeof module?module.exports=t.pdfjsLib=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>t.pdfjsLib=e()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t.pdfjsLib=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()})(globalThis,()=>(()=>{var __webpack_modules__=[,(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||a(e)},e.bytesToString=h,e.createValidAbsoluteUrl=function(e){let t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(e)try{if(r&&"string"==typeof e){if(r.addDefaultProtocol&&e.startsWith("www.")){let t=e.match(/\./g);2<=t?.length&&(e="http://"+e)}if(r.tryConvertEncoding)try{e=p(e)}catch{}}var i=t?new URL(e,t):new URL(e);if((t=>{switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}})(i))return i}catch{}return null},e.getModificationDate=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();var e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return h(e)},e.getVerbosityLevel=function(){return s},e.info=function(t){s>=i.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"==typeof t&&void 0!==t?.byteLength},e.isArrayEqual=function(r,i){if(r.length!==i.length)return!1;for(let t=0,e=r.length;t<e;t++)if(r[t]!==i[t])return!1;return!0},e.isNodeJS=void 0,e.normalizeUnicode=function(t){return f||(f=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,g=new Map([["ſt","ſt"]])),t.replaceAll(f,(t,e,r)=>e?e.normalize("NFKC"):g.get(r))},e.objectFromMap=function(t){var e,r,i=Object.create(null);for([e,r]of t)i[e]=r;return i},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(s=t)},e.shadow=o,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=d,e.stringToPDFString=function(r){if("ï"<=r[0]){let t;if("þ"===r[0]&&"ÿ"===r[1]?t="utf-16be":"ÿ"===r[0]&&"þ"===r[1]?t="utf-16le":"ï"===r[0]&&"»"===r[1]&&"¿"===r[2]&&(t="utf-8"),t)try{var e=new TextDecoder(t,{fatal:!0}),i=d(r);return e.decode(i)}catch(r){n(`stringToPDFString: "${r}".`)}}var s=[];for(let t=0,e=r.length;t<e;t++){var a=u[r.charCodeAt(t)];s.push(a?String.fromCharCode(a):r.charAt(t))}return s.join("")},e.stringToUTF8String=p,e.unreachable=a,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=n,r(2),r(84),r(86),r(87),r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r,e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.MAX_IMAGE_SIZE_TO_CACHE=1e7,e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35,e.BASELINE_FACTOR=.25925925925925924,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},e.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},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.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"};let i={ERRORS:0,WARNINGS:1,INFOS:5},s=(e.VerbosityLevel=i,e.CMapCompressionType={NONE:0,BINARY:1},e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},i.WARNINGS);function n(t){s>=i.WARNINGS&&console.log("Warning: "+t)}function a(t){throw new Error(t)}function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!(3<arguments.length&&void 0!==arguments[3]&&arguments[3]),configurable:!0,writable:!1}),r}l.prototype=new Error;r=l.constructor=l;function l(t,e){this.constructor===l&&a("Cannot initialize BaseException."),this.message=t,this.name=e}function h(e){"object"==typeof e&&void 0!==e?.length||a("Invalid argument for bytesToString");var r=e.length;if(r<8192)return String.fromCharCode.apply(null,e);var i=[];for(let t=0;t<r;t+=8192){var s=Math.min(t+8192,r),s=e.subarray(t,s);i.push(String.fromCharCode.apply(null,s))}return i.join("")}function d(e){"string"!=typeof e&&a("Invalid argument for stringToBytes");var r=e.length,i=new Uint8Array(r);for(let t=0;t<r;++t)i[t]=255&e.charCodeAt(t);return i}e.BaseException=r,e.PasswordException=class extends r{constructor(t,e){super(t,"PasswordException"),this.code=e}},e.UnknownErrorException=class extends r{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},e.InvalidPDFException=class extends r{constructor(t){super(t,"InvalidPDFException")}},e.MissingPDFException=class extends r{constructor(t){super(t,"MissingPDFException")}},e.UnexpectedResponseException=class extends r{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},e.FormatError=class extends r{constructor(t){super(t,"FormatError")}},e.AbortException=class extends r{constructor(t){super(t,"AbortException")}},e.FeatureTest=class{static get isLittleEndian(){return o(this,"isLittleEndian",((t=new Uint8Array(4))[0]=1)===new Uint32Array(t.buffer,0,1)[0]);var t}static get isEvalSupported(){return o(this,"isEvalSupported",(()=>{try{return new Function(""),!0}catch{return!1}})())}static get isOffscreenCanvasSupported(){return o(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?o(this,"platform",{isWin:!1,isMac:!1}):o(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return o(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};let c=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0")),u=(e.Util=class{static makeHexColor(t,e,r){return"#"+c[t]+c[e]+c[r]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[1],e[1]=r),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[2],e[2]=r,r=e[1],e[1]=e[3],e[3]=r,t[1]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[1],e[3]*=t[1],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){var 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){var r=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),t=this.applyTransform([t[2],t[1]],e);return[Math.min(r[0],i[0],s[0],t[0]),Math.min(r[1],i[1],s[1],t[1]),Math.max(r[0],i[0],s[0],t[0]),Math.max(r[1],i[1],s[1],t[1])]}static inverseTransform(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){var e=[t[0],t[2],t[1],t[3]],r=t[0]*e[0]+t[1]*e[2],i=t[2]*e[1]+t[3]*e[3],s=(r+i)/2,r=Math.sqrt((r+i)**2-4*(r*i-(t[2]*e[0]+t[3]*e[2])*(t[0]*e[1]+t[1]*e[3])))/2,i=s-r||1;return[Math.sqrt(s+r||1),Math.sqrt(i)]}static normalizeRect(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[3]<t[1]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){var r,i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));return s<i||(r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),(t=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3])))<r)?null:[i,r,s,t]}static bezierBoundingBox(e,r,i,s,a,n,o,l){var h=[],t=[[],[]];let d,c,u,p,f,g,m,v;for(let t=0;t<2;++t)u=0===t?(c=6*e-12*i+6*a,d=-3*e+9*i-9*a+3*o,3*i-3*e):(c=6*r-12*s+6*n,d=-3*r+9*s-9*n+3*l,3*s-3*r),Math.abs(d)<1e-12?Math.abs(c)<1e-12||0<(p=-u/c)&&p<1&&h.push(p):(m=c*c-4*u*d,v=Math.sqrt(m),m<0||(0<(f=(-c+v)/(2*d))&&f<1&&h.push(f),0<(g=(-c-v)/(2*d))&&g<1&&h.push(g)));let _,b=h.length;for(var y=b;b--;)_=1-(p=h[b]),t[0][b]=_*_*_*e+3*_*_*p*i+3*_*p*p*a+p*p*p*o,t[1][b]=_*_*_*r+3*_*_*p*s+3*_*p*p*n+p*p*p*l;return t[0][y]=e,t[1][y]=r,t[0][y+1]=o,t[1][y+1]=l,t[0].length=t[1].length=y+2,[Math.min(...t[0]),Math.min(...t[1]),Math.max(...t[0]),Math.max(...t[1])]}},[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 p(t){return decodeURIComponent(escape(t))}e.PromiseCapability=class{#t=!1;constructor(){this.promise=new Promise((e,r)=>{this.resolve=t=>{this.#t=!0,e(t)},this.reject=t=>{this.#t=!0,r(t)}})}get settled(){return this.#t}};let f=null,g=null;e.AnnotationPrefix="pdfjs_internal_id_"},(t,e,r)=>{function i(t,e){var r={};r[t]=l(t,e,c),a({global:!0,constructor:!0,arity:1,forced:c},r)}function s(t,e){var r;d&&d[t]&&((r={})[t]=l(h+"."+t,e,c),a({target:h,stat:!0,constructor:!0,arity:1,forced:c},r))}var a=r(3),n=r(4),o=r(69),l=r(70),h="WebAssembly",d=n[h],c=7!==Error("e",{cause:7}).cause;i("Error",function(e){return function(t){return o(e,this,arguments)}}),i("EvalError",function(e){return function(t){return o(e,this,arguments)}}),i("RangeError",function(e){return function(t){return o(e,this,arguments)}}),i("ReferenceError",function(e){return function(t){return o(e,this,arguments)}}),i("SyntaxError",function(e){return function(t){return o(e,this,arguments)}}),i("TypeError",function(e){return function(t){return o(e,this,arguments)}}),i("URIError",function(e){return function(t){return o(e,this,arguments)}}),s("CompileError",function(e){return function(t){return o(e,this,arguments)}}),s("LinkError",function(e){return function(t){return o(e,this,arguments)}}),s("RuntimeError",function(e){return function(t){return o(e,this,arguments)}})},(t,e,r)=>{var h=r(4),d=r(5).f,c=r(44),u=r(48),p=r(38),f=r(56),g=r(68);t.exports=function(t,e){var r,i,s,a,n=t.target,o=t.global,l=t.stat;if(r=o?h:l?h[n]||p(n,{}):(h[n]||{}).prototype)for(i in e){if(s=e[i],a=t.dontCallGetSet?(a=d(r,i))&&a.value:r[i],!g(o?i:n+(l?".":"#")+i,t.forced)&&void 0!==a){if(typeof s==typeof a)continue;f(s,a)}(t.sham||a&&a.sham)&&c(s,"sham",!0),u(r,i,s,t)}}},function(t){function e(t){return t&&t.Math===Math&&t}t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,r)=>{var i=r(6),s=r(8),a=r(10),n=r(11),o=r(12),l=r(18),h=r(39),d=r(42),c=Object.getOwnPropertyDescriptor;e.f=i?c:function(t,e){if(t=o(t),e=l(e),d)try{return c(t,e)}catch(t){}if(h(t,e))return n(!s(a.f,t,e),t[e])}},(t,e,r)=>{r=r(7);t.exports=!r(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 r=r(9),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!r.call({1:2},1);e.f=s?function(t){t=i(this,t);return!!t&&t.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),s=r(16);t.exports=function(t){return i(s(t))}},(t,e,r)=>{var i=r(14),s=r(7),a=r(15),n=Object,o=i("".split);t.exports=s(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"===a(t)?o(t,""):n(t)}:n},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.call,i=r&&i.bind.bind(s,s);t.exports=r?i:function(t){return function(){return s.apply(t,arguments)}}},(t,e,r)=>{var r=r(14),i=r({}.toString),s=r("".slice);t.exports=function(t){return s(i(t),8,-1)}},(t,e,r)=>{var i=r(17),s=TypeError;t.exports=function(t){if(i(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,r)=>{var i=r(19),s=r(23);t.exports=function(t){t=i(t,"string");return s(t)?t:t+""}},(t,e,r)=>{var i=r(8),s=r(20),a=r(23),n=r(30),o=r(33),r=r(34),l=TypeError,h=r("toPrimitive");t.exports=function(t,e){if(!s(t)||a(t))return t;var r=n(t,h);if(r){if(r=i(r,t,e=void 0===e?"default":e),!s(r)||a(r))return r;throw l("Can't convert object to primitive value")}return o(t,e=void 0===e?"number":e)}},(t,e,r)=>{var i=r(21),r=r(22),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},(t,e,r)=>{var r=r(22),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all;t.exports={all:e,IS_HTMLDDA:void 0===e&&void 0!==e}},(t,e,r)=>{var i=r(24),s=r(21),a=r(25),r=r(26),n=Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return s(e)&&a(e.prototype,n(t))}},(t,e,r)=>{var i=r(4),s=r(21);t.exports=function(t,e){return arguments.length<2?(r=i[t],s(r)?r:void 0):i[t]&&i[t][e];var r}},(t,e,r)=>{r=r(14);t.exports=r({}.isPrototypeOf)},(t,e,r)=>{r=r(27);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var i=r(28),s=r(7),a=r(4).String;t.exports=!!Object.getOwnPropertySymbols&&!s(function(){var t=Symbol("symbol detection");return!a(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41})},(t,e,r)=>{var i,s,a=r(4),r=r(29),n=a.process,a=a.Deno,n=n&&n.versions||a&&a.version,a=n&&n.v8;!(s=a?0<(i=a.split("."))[0]&&i[0]<4?1:+(i[0]+i[1]):s)&&r&&(!(i=r.match(/Edge\/(\d+)/))||74<=i[1])&&(i=r.match(/Chrome\/(\d+)/))&&(s=+i[1]),t.exports=s},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,r)=>{var i=r(31),s=r(17);t.exports=function(t,e){t=t[e];return s(t)?void 0:i(t)}},(t,e,r)=>{var i=r(21),s=r(32),a=TypeError;t.exports=function(t){if(i(t))return t;throw a(s(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 s=r(8),a=r(21),n=r(20),o=TypeError;t.exports=function(t,e){var r,i;if("string"===e&&a(r=t.toString)&&!n(i=s(r,t)))return i;if(a(r=t.valueOf)&&!n(i=s(r,t)))return i;if("string"!==e&&a(r=t.toString)&&!n(i=s(r,t)))return i;throw o("Can't convert object to primitive value")}},(t,e,r)=>{var i=r(4),s=r(35),a=r(39),n=r(41),o=r(27),r=r(26),l=i.Symbol,h=s("wks"),d=r?l.for||l:l&&l.withoutSetter||n;t.exports=function(t){return a(h,t)||(h[t]=o&&a(l,t)?l[t]:d("Symbol."+t)),h[t]}},(t,e,r)=>{var i=r(36),s=r(37);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.32.2",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var i=r(4),r=r(38),s="__core-js_shared__",i=i[s]||r(s,{});t.exports=i},(t,e,r)=>{var i=r(4),s=Object.defineProperty;t.exports=function(e,r){try{s(i,e,{value:r,configurable:!0,writable:!0})}catch(t){i[e]=r}return r}},(t,e,r)=>{var i=r(14),s=r(40),a=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return a(s(t),e)}},(t,e,r)=>{var i=r(16),s=Object;t.exports=function(t){return s(i(t))}},(t,e,r)=>{var r=r(14),i=0,s=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+s,36)}},(t,e,r)=>{var i=r(6),s=r(7),a=r(43);t.exports=!i&&!s(function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},(t,e,r)=>{var i=r(4),r=r(20),s=i.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},(t,e,r)=>{var i=r(6),s=r(45),a=r(11);t.exports=i?function(t,e,r){return s.f(t,e,a(1,r))}:function(t,e,r){return t[e]=r,t}},(t,e,r)=>{var i=r(6),s=r(42),a=r(46),n=r(47),o=r(18),l=TypeError,h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",p="writable";e.f=i?a?function(t,e,r){var i;return n(t),e=o(e),n(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]&&(i=d(t,e))&&i[p]&&(t[e]=r.value,r={configurable:(u in r?r:i)[u],enumerable:(c in r?r:i)[c],writable:!1}),h(t,e,r)}:h:function(t,e,r){if(n(t),e=o(e),n(r),s)try{return h(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},(t,e,r)=>{var i=r(6),r=r(7);t.exports=i&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,r)=>{var i=r(20),s=String,a=TypeError;t.exports=function(t){if(i(t))return t;throw a(s(t)+" is not an object")}},(t,e,r)=>{var n=r(21),o=r(45),l=r(49),h=r(38);t.exports=function(t,e,r,i){var s=(i=i||{}).enumerable,a=void 0!==i.name?i.name:e;if(n(r)&&l(r,a,i),i.global)s?t[e]=r:h(e,r);else{try{i.unsafe?t[e]&&(s=!0):delete t[e]}catch(t){}s?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t}},(t,e,r)=>{var i=r(14),s=r(7),a=r(21),n=r(39),o=r(6),l=r(50).CONFIGURABLE,h=r(51),r=r(52),d=r.enforce,c=r.get,u=String,p=Object.defineProperty,f=i("".slice),g=i("".replace),m=i([].join),v=o&&!s(function(){return 8!==p(function(){},"length",{value:8}).length}),_=String(String).split("String"),r=t.exports=function(t,e,r){"Symbol("===f(u(e),0,7)&&(e="["+g(u(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!n(t,"name")||l&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),v&&r&&n(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&n(r,"constructor")&&r.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}r=d(t);return n(r,"source")||(r.source=m(_,"string"==typeof e?e:"")),t};Function.prototype.toString=r(function(){return a(this)&&c(this).source||h(this)},"toString")},(t,e,r)=>{var i=r(6),r=r(39),s=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,r=r(s,"name"),n=r&&"something"===function(){}.name,i=r&&(!i||a(s,"name").configurable);t.exports={EXISTS:r,PROPER:n,CONFIGURABLE:i}},(t,e,r)=>{var i=r(14),s=r(21),r=r(37),a=i(Function.toString);s(r.inspectSource)||(r.inspectSource=function(t){return a(t)}),t.exports=r.inspectSource},(t,e,r)=>{var i,s,a,n,o=r(53),l=r(4),h=r(20),d=r(44),c=r(39),u=r(37),p=r(54),r=r(55),f="Object already initialized",g=l.TypeError,l=l.WeakMap,m=o||u.state?((a=u.state||(u.state=new l)).get=a.get,a.has=a.has,a.set=a.set,i=function(t,e){if(a.has(t))throw g(f);return e.facade=t,a.set(t,e),e},s=function(t){return a.get(t)||{}},function(t){return a.has(t)}):(r[n=p("state")]=!0,i=function(t,e){if(c(t,n))throw g(f);return e.facade=t,d(t,n,e),e},s=function(t){return c(t,n)?t[n]:{}},function(t){return c(t,n)});t.exports={set:i,get:s,has:m,enforce:function(t){return m(t)?s(t):i(t,{})},getterFor:function(e){return function(t){if(h(t)&&(t=s(t)).type===e)return t;throw g("Incompatible receiver, "+e+" required")}}}},(t,e,r)=>{var i=r(4),r=r(21),i=i.WeakMap;t.exports=r(i)&&/native code/.test(String(i))},(t,e,r)=>{var i=r(35),s=r(41),a=i("keys");t.exports=function(t){return a[t]||(a[t]=s(t))}},t=>{t.exports={}},(t,e,r)=>{var l=r(39),h=r(57),d=r(5),c=r(45);t.exports=function(t,e,r){for(var i=h(e),s=c.f,a=d.f,n=0;n<i.length;n++){var o=i[n];l(t,o)||r&&l(r,o)||s(t,o,a(e,o))}}},(t,e,r)=>{var i=r(24),s=r(14),a=r(58),n=r(67),o=r(47),l=s([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=a.f(o(t)),r=n.f;return r?l(e,r(t)):e}},(t,e,r)=>{var i=r(59),s=r(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,s)}},(t,e,r)=>{var i=r(14),n=r(39),o=r(12),l=r(60).indexOf,h=r(55),d=i([].push);t.exports=function(t,e){var r,i=o(t),s=0,a=[];for(r in i)!n(h,r)&&n(i,r)&&d(a,r);for(;e.length>s;)!n(i,r=e[s++])||~l(a,r)||d(a,r);return a}},(t,e,r)=>{function i(o){return function(t,e,r){var i,s=l(t),a=d(s),n=h(r,a);if(o&&e!=e){for(;n<a;)if((i=s[n++])!=i)return!0}else for(;n<a;n++)if((o||n in s)&&s[n]===e)return o||n||0;return!o&&-1}}var l=r(12),h=r(61),d=r(64);t.exports={includes:i(!0),indexOf:i(!1)}},(t,e,r)=>{var i=r(62),s=Math.max,a=Math.min;t.exports=function(t,e){t=i(t);return t<0?s(t+e,0):a(t,e)}},(t,e,r)=>{var i=r(63);t.exports=function(t){t=+t;return t!=t||0==t?0:i(t)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){t=+t;return(0<t?r:e)(t)}},(t,e,r)=>{var i=r(65);t.exports=function(t){return i(t.length)}},(t,e,r)=>{var i=r(62),s=Math.min;t.exports=function(t){return 0<t?s(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{function i(t,e){return(t=l[o(t)])===d||t!==h&&(a(e)?s(e):!!e)}var s=r(7),a=r(21),n=/#|\.prototype\./,o=i.normalize=function(t){return String(t).replace(n,".").toLowerCase()},l=i.data={},h=i.NATIVE="N",d=i.POLYFILL="P";t.exports=i},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},(t,e,r)=>{var c=r(24),u=r(39),p=r(44),f=r(25),g=r(71),m=r(56),v=r(74),_=r(75),b=r(76),y=r(80),A=r(81),S=r(6),x=r(36);t.exports=function(t,e,r,i){var s="stackTraceLimit",a=i?2:1,n=t.split("."),o=n[n.length-1],l=c.apply(null,n);if(l){var h=l.prototype;if(!x&&u(h,"cause")&&delete h.cause,!r)return l;var n=c("Error"),d=e(function(t,e){e=b(i?e:t,void 0),t=i?new l(t):new l;return void 0!==e&&p(t,"message",e),A(t,d,t.stack,2),this&&f(h,this)&&_(t,this,d),a<arguments.length&&y(t,arguments[a]),t});if(d.prototype=h,"Error"!==o?g?g(d,n):m(d,n,{name:!0}):S&&s in l&&(v(d,l,s),v(d,l,"prepareStackTrace")),m(d,l),!x)try{h.name!==o&&p(h,"name",o),h.constructor=d}catch(t){}return d}}},(t,e,r)=>{var s=r(72),a=r(47),n=r(73);t.exports=Object.setPrototypeOf||("__proto__"in{}?(()=>{var r,i=!1,t={};try{(r=s(Object.prototype,"__proto__","set"))(t,[]),i=t instanceof Array}catch(r){}return function(t,e){return a(t),n(e),i?r(t,e):t.__proto__=e,t}})():void 0)},(t,e,r)=>{var i=r(14),s=r(31);t.exports=function(t,e,r){try{return i(s(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},(t,e,r)=>{var i=r(21),s=String,a=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+s(t)+" as a prototype")}},(t,e,r)=>{var i=r(45).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)=>{var i=r(21),s=r(20),a=r(71);t.exports=function(t,e,r){return a&&i(e=e.constructor)&&e!==r&&s(e=e.prototype)&&e!==r.prototype&&a(t,e),t}},(t,e,r)=>{var i=r(77);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},(t,e,r)=>{var i=r(78),s=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return s(t)}},(t,e,r)=>{var i=r(79),s=r(21),a=r(15),n=r(34)("toStringTag"),o=Object,l="Arguments"===a(function(){return arguments}());t.exports=i?a:function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=((t,e)=>{try{return t[e]}catch(t){}})(t=o(t),n))?e:l?a(t):"Object"===(e=a(t))&&s(t.callee)?"Arguments":e}},(t,e,r)=>{var i={};i[r(34)("toStringTag")]="z",t.exports="[object z]"===String(i)},(t,e,r)=>{var i=r(20),s=r(44);t.exports=function(t,e){i(e)&&"cause"in e&&s(t,"cause",e.cause)}},(t,e,r)=>{var s=r(44),a=r(82),n=r(83),o=Error.captureStackTrace;t.exports=function(t,e,r,i){n&&(o?o(t,e):s(t,"stack",a(r,i)))}},(t,e,r)=>{var r=r(14),i=Error,s=r("".replace),r=String(i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,n=a.test(r);t.exports=function(t,e){if(n&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},(t,e,r)=>{var i=r(7),s=r(11);t.exports=!i(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",s(1,7)),7!==t.stack)})},(t,e,r)=>{var i=r(48),s=r(14),c=r(77),u=r(85),r=URLSearchParams,a=r.prototype,p=s(a.append),f=s(a.delete),g=s(a.forEach),m=s([].push),s=new r("a=1&a=2&b=3");s.delete("a",1),s.delete("b",void 0),s+""!="a=2"&&i(a,"delete",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return f(this,t);var i=[];g(this,function(t,e){m(i,{key:e,value:t})}),u(e,1);for(var s,a=c(t),n=c(r),o=0,l=0,h=!1,d=i.length;o<d;)s=i[o++],h||s.key===a?(h=!0,f(this,s.key)):l++;for(;l<d;)(s=i[l++]).key===a&&s.value===n||p(this,s.key,s.value)},{enumerable:!0,unsafe:!0})},t=>{var r=TypeError;t.exports=function(t,e){if(t<e)throw r("Not enough arguments");return t}},(t,e,r)=>{var i=r(48),s=r(14),n=r(77),o=r(85),r=URLSearchParams,a=r.prototype,l=s(a.getAll),h=s(a.has),s=new r("a=1");!s.has("a",2)&&s.has("a",void 0)||i(a,"has",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=l(this,t);o(e,1);for(var s=n(r),a=0;a<i.length;)if(i[a++]===s)return!0;return!1},{enumerable:!0,unsafe:!0})},(t,e,r)=>{var i=r(6),s=r(14),r=r(88),a=URLSearchParams.prototype,n=s(a.forEach);!i||"size"in a||r(a,"size",{get:function(){var t=0;return n(this,function(){t++}),t},configurable:!0,enumerable:!0})},(t,e,r)=>{var i=r(49),s=r(45);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),s.f(t,e,r)}},(t,e,r)=>{var i=r(3),a=r(40),n=r(64),o=r(90),l=r(92);i({target:"Array",proto:!0,arity:1,forced:r(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!(()=>{try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}})()},{push:function(t){var e=a(this),r=n(e),i=arguments.length;l(r+i);for(var s=0;s<i;s++)e[r]=arguments[s],r++;return o(e,r),r}})},(t,e,r)=>{var i=r(6),s=r(91),a=TypeError,n=Object.getOwnPropertyDescriptor,r=i&&!function(){if(void 0!==this)return 1;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=r?function(t,e){if(s(t)&&!n(t,"length").writable)throw a("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},(t,e,r)=>{var i=r(15);t.exports=Array.isArray||function(t){return"Array"===i(t)}},t=>{var e=TypeError;t.exports=function(t){if(9007199254740991<t)throw e("Maximum allowed index exceeded");return t}},(t,e,r)=>{var i=r(94),s=r(98).findLast,a=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",function(t){return s(a(this),t,1<arguments.length?arguments[1]:void 0)})},(t,e,r)=>{function i(t){var e,t=y(t);if(u(t))return(e=E(t))&&p(e,F)?e[F]:i(t)}function s(t){return!!u(t)&&(t=f(t),p(I,t)||p(O,t))}var a,n,o,l=r(95),h=r(6),d=r(4),c=r(21),u=r(20),p=r(39),f=r(78),g=r(32),m=r(44),v=r(48),_=r(88),b=r(25),y=r(96),A=r(71),S=r(34),x=r(41),r=r(52),w=r.enforce,E=r.get,r=d.Int8Array,T=r&&r.prototype,C=d.Uint8ClampedArray,C=C&&C.prototype,P=r&&y(r),k=T&&y(T),r=Object.prototype,M=d.TypeError,S=S("toStringTag"),R=x("TYPED_ARRAY_TAG"),F="TypedArrayConstructor",D=l&&!!A&&"Opera"!==f(d.opera),x=!1,I={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},O={BigInt64Array:8,BigUint64Array:8};for(a in I)(o=(n=d[a])&&n.prototype)?w(o)[F]=n:D=!1;for(a in O)(o=(n=d[a])&&n.prototype)&&(w(o)[F]=n);if((!D||!c(P)||P===Function.prototype)&&(P=function(){throw M("Incorrect invocation")},D))for(a in I)d[a]&&A(d[a],P);if((!D||!k||k===r)&&(k=P.prototype,D))for(a in I)d[a]&&A(d[a].prototype,k);if(D&&y(C)!==k&&A(C,k),h&&!p(k,S))for(a in _(k,S,{configurable:x=!0,get:function(){return u(this)?this[R]:void 0}}),I)d[a]&&m(d[a],R,a);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_TAG:x&&R,aTypedArray:function(t){if(s(t))return t;throw M("Target is not a typed array")},aTypedArrayConstructor:function(t){if(!c(t)||A&&!b(P,t))throw M(g(t)+" is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r,i){if(h){if(r)for(var s in I){s=d[s];if(s&&p(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}k[t]&&!r||v(k,t,!r&&D&&T[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,s;if(h){if(A){if(r)for(i in I)if((s=d[i])&&p(s,t))try{delete s[t]}catch(t){}if(P[t]&&!r)return;try{return v(P,t,!r&&D&&P[t]||e)}catch(t){}}for(i in I)!(s=d[i])||s[t]&&!r||v(s,t,e)}},getTypedArrayConstructor:i,isView:function(t){return!!u(t)&&("DataView"===(t=f(t))||p(I,t)||p(O,t))},isTypedArray:s,TypedArray:P,TypedArrayPrototype:k}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{var i=r(39),s=r(21),a=r(40),n=r(54),r=r(97),o=n("IE_PROTO"),l=Object,h=l.prototype;t.exports=r?l.getPrototypeOf:function(t){var e,t=a(t);return i(t,o)?t[o]:(e=t.constructor,s(e)&&t instanceof e?e.prototype:t instanceof l?h:null)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,r)=>{function i(l){var h=1===l;return function(t,e,r){for(var i,s=u(t),a=c(s),n=d(e,r),o=p(a);0<o--;)if(n(i=a[o],o,s))switch(l){case 0:return i;case 1:return o}return h?-1:void 0}}var d=r(99),c=r(13),u=r(40),p=r(64);t.exports={findLast:i(0),findLastIndex:i(1)}},(t,e,r)=>{var i=r(100),s=r(31),a=r(9),n=i(i.bind);t.exports=function(t,e){return s(t),void 0===e?t:a?n(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var i=r(15),s=r(14);t.exports=function(t){if("Function"===i(t))return s(t)}},(t,e,r)=>{var i=r(94),s=r(98).findLastIndex,a=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",function(t){return s(a(this),t,1<arguments.length?arguments[1]:void 0)})},(t,e,r)=>{var i=r(4),a=r(8),s=r(94),n=r(64),o=r(103),l=r(40),r=r(7),h=i.RangeError,d=i.Int8Array,i=d&&d.prototype,c=i&&i.set,u=s.aTypedArray,i=s.exportTypedArrayMethod,p=!r(function(){var t=new Uint8ClampedArray(2);return a(c,t,{length:1,0:3},1),3!==t[1]}),s=p&&s.NATIVE_ARRAY_BUFFER_VIEWS&&r(function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});i("set",function(t){u(this);var e=o(1<arguments.length?arguments[1]:void 0,1),r=l(t);if(p)return a(c,this,r,e);var t=this.length,i=n(r),s=0;if(t<i+e)throw h("Wrong length");for(;s<i;)this[e+s]=r[s++]},!p||s)},(t,e,r)=>{var i=r(104),s=RangeError;t.exports=function(t,e){t=i(t);if(t%e)throw s("Wrong offset");return t}},(t,e,r)=>{var i=r(62),s=RangeError;t.exports=function(t){t=i(t);if(t<0)throw s("The argument can't be less than 0");return t}},(t,e,r)=>{var i=r(106),r=r(94),s=r.aTypedArray,a=r.exportTypedArrayMethod,n=r.getTypedArrayConstructor;a("toReversed",function(){return i(s(this),n(this))})},(t,e,r)=>{var a=r(64);t.exports=function(t,e){for(var r=a(t),i=new e(r),s=0;s<r;s++)i[s]=t[r-s-1];return i}},(t,e,r)=>{var i=r(94),s=r(14),a=r(31),n=r(108),o=i.aTypedArray,l=i.getTypedArrayConstructor,r=i.exportTypedArrayMethod,h=s(i.TypedArrayPrototype.sort);r("toSorted",function(t){void 0!==t&&a(t);var e=o(this),e=n(l(e),e);return h(e,t)})},(t,e,r)=>{var a=r(64);t.exports=function(t,e){for(var r=0,i=a(e),s=new t(i);r<i;)s[r]=e[r++];return s}},(t,e,r)=>{var i=r(110),s=r(94),a=r(111),n=r(62),o=r(112),l=s.aTypedArray,h=s.getTypedArrayConstructor;(0,s.exportTypedArrayMethod)("with",function(t,e){var r=l(this),t=n(t),e=a(r)?o(e):+e;return i(r,h(r),t,e)},!!!(()=>{try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}})())},(t,e,r)=>{var l=r(64),h=r(62),d=RangeError;t.exports=function(t,e,r,i){var s=l(t),r=h(r),a=r<0?s+r:r;if(s<=a||a<0)throw d("Incorrect index");for(var n=new e(s),o=0;o<s;o++)n[o]=o===a?i:t[o];return n}},(t,e,r)=>{var i=r(78);t.exports=function(t){t=i(t);return"BigInt64Array"===t||"BigUint64Array"===t}},(t,e,r)=>{var i=r(19),s=TypeError;t.exports=function(t){t=i(t,"number");if("number"==typeof t)throw s("Can't convert number to bigint");return BigInt(t)}},(t,e,r)=>{var i=r(6),s=r(88),a=r(114),r=ArrayBuffer.prototype;!i||"detached"in r||s(r,"detached",{configurable:!0,get:function(){return a(this)}})},(t,e,r)=>{var i=r(14),s=r(115),a=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==s(t))return!1;try{return a(t,0,0),!1}catch(t){return!0}}},(t,e,r)=>{var i=r(72),s=r(15),a=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw a("ArrayBuffer expected");return t.byteLength}},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return s(this,arguments.length?arguments[0]:void 0,!0)}})},(t,e,r)=>{var i=r(4),s=r(14),a=r(72),h=r(118),d=r(114),c=r(115),r=r(119),u=i.TypeError,p=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,m=Math.min,i=f.prototype,n=g.prototype,v=s(i.slice),_=a(i,"resizable","get"),b=a(i,"maxByteLength","get"),y=s(n.getInt8),A=s(n.setInt8);t.exports=r&&function(t,e,r){var i=c(t),e=void 0===e?i:h(e),s=!_||!_(t);if(d(t))throw u("ArrayBuffer is detached");t=p(t,{transfer:[t]});if(i===e&&(r||s))return t;if(e<=i&&(!r||s))return v(t,0,e);for(var r=r&&!s&&b?{maxByteLength:b(t)}:void 0,s=new f(e,r),a=new g(t),n=new g(s),o=m(e,i),l=0;l<o;l++)A(n,l,y(a,l));return s}},(t,e,r)=>{var i=r(62),s=r(65),a=RangeError;t.exports=function(t){if(void 0===t)return 0;var t=i(t),e=s(t);if(t!==e)throw a("Wrong length or index");return e}},(t,e,r)=>{var i=r(4),s=r(7),a=r(28),n=r(120),o=r(121),l=r(122),h=i.structuredClone;t.exports=!!h&&!s(function(){var t,e;return!(o&&92<a||l&&94<a||n&&97<a)&&(t=new ArrayBuffer(8),e=h(t,{transfer:[t]}),0!==t.byteLength||8!==e.byteLength)})},(t,e,r)=>{var i=r(121),r=r(122);t.exports=!i&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var i=r(4),r=r(15);t.exports="process"===r(i.process)},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return s(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=(exports.DefaultCanvasFactory=DefaultCanvasFactory,_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory),DefaultFilterFactory=(exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory,_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory),DefaultStandardFontDataFactory=(exports.DefaultFilterFactory=DefaultFilterFactory,_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory);function getDocument(t){if("string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");let r=new PDFDocumentLoadingTask,i=r.docId,s=t.url?getUrlProp(t.url):null,a=t.data?getDataProp(t.data):null,n=t.httpHeaders||null,o=!0===t.withCredentials,e=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&0<t.rangeChunkSize?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,d=t.worker instanceof PDFWorker?t.worker:null,c=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||DefaultStandardFontDataFactory,_=!0!==t.stopAtErrors,b=Number.isInteger(t.maxImageSize)&&-1<t.maxImageSize?t.maxImageSize:-1,y=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,w=!0===t.fontExtraProperties,E=!0===t.enableXfa,T=t.ownerDocument||globalThis.document,C=!0===t.disableRange,P=!0===t.disableStream,k=!0===t.disableAutoFetch,M=!0===t.pdfBug,R=l?l.length:t.length??NaN,F="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!x,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&v===_display_utils.DOMStandardFontDataFactory&&p&&m&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),I=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:T}),L=t.filterFactory||new DefaultFilterFactory({docId:i,ownerDocument:T}),O=((0,_util.setVerbosityLevel)(c),{canvasFactory:I,filterFactory:L});if(D||(O.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),O.standardFontDataFactory=new v({baseUrl:m})),!d){let t={verbosity:c,port:_worker_options.GlobalWorkerOptions.workerPort};d=t.port?PDFWorker.fromPort(t):new PDFWorker(t),r._worker=d}let N={docId:i,apiVersion:"3.11.174",data:a,password:e,disableAutoFetch:k,rangeChunkSize:h,length:R,docBaseUrl:u,enableXfa:E,evaluatorOptions:{maxImageSize:b,disableFontFace:x,ignoreErrors:_,isEvalSupported:y,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:w,useSystemFonts:F,cMapUrl:D?p:null,standardFontDataUrl:D?m:null}},j={ignoreErrors:_,isEvalSupported:y,disableFontFace:x,fontExtraProperties:w,enableXfa:E,ownerDocument:T,disableAutoFetch:k,pdfBug:M,styleElement:null};return d.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(d,N),e=new Promise(function(t){let e;var r;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:C,disableStream:P},l):a||(e=(r={url:s,length:R,httpHeaders:n,withCredentials:o,rangeChunkSize:h,disableRange:C,disableStream:P},new(_util.isNodeJS?_displayNode_stream.PDFNodeStream:(0,_display_utils.isValidFetchUrl)(r.url)?_displayFetch_stream.PDFFetchStream:_displayNetwork.PDFNetworkStream)(r))),t(e)});return Promise.all([t,e]).then(function(t){var[t,e]=t;if(r.destroyed)throw new Error("Loading aborted");t=new _message_handler.MessageHandler(i,t,d.port),e=new WorkerTransport(t,r,e,j,O);r._transport=e,t.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");e=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return e}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_util.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&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=new _util.PromiseCapability}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(var r of this._rangeListeners)r(t,e)}onDataProgress(e,r){this._readyCapability.promise.then(()=>{for(var t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(var t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(var 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,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(t=>{if(!t)return t;var e,r=[];for(e in t)r.push(...t[e]);return r}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){return this._transport.startCleanup(0<arguments.length&&void 0!==arguments[0]&&arguments[0]||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(t,e,r){var i=3<arguments.length&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=r,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){var{scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations(){var{intent:t="display"}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:r,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:a=null,background:n=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:d=null}=t;this._stats?.time("Overall");t=this._transport.getRenderingIntent(i,s,d);this.#i=!1,this.#r(),o=o||this._transport.getOptionalContentConfig();let c=this._intentStates.get(t.cacheKey),u=(c||(c=Object.create(null),this._intentStates.set(t.cacheKey,c)),c.streamReaderCancelTimeout&&(clearTimeout(c.streamReaderCancelTimeout),c.streamReaderCancelTimeout=null),!!(t.renderingIntent&_util.RenderingIntentFlag.PRINT)),p=(c.displayReadyCapability||(c.displayReadyCapability=new _util.PromiseCapability,c.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(t)),t=>{c.renderTasks.delete(f),(this._maybeCleanupAfterRender||u)&&(this.#i=!0),this.#s(!u),t?(f.capability.reject(t),this._abortOperatorList({intentState:c,reason:t instanceof Error?t:new Error(t)})):f.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")}),f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:r,transform:a,background:n},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:c.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,pageColors:h});(c.renderTasks||=new Set).add(f);t=f.task;return Promise.all([c.displayReadyCapability.promise,o]).then(t=>{var[t,e]=t;this.destroyed?p():(this._stats?.time("Rendering"),f.initializeGraphics({transparency:t,optionalContentConfig:e}),f.operatorListChanged())}).catch(p),t}getOperatorList(){var{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=this._transport.getRenderingIntent(t,e,r,!0);let i,s=this._intentStates.get(t.cacheKey);return s||(s=Object.create(null),this._intentStates.set(t.cacheKey,s)),s.opListReadCapability||((i=Object.create(null)).operatorListChanged=function(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(i))},s.opListReadCapability=new _util.PromiseCapability,(s.renderTasks||=new Set).add(i),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(t)),s.opListReadCapability.promise}streamTextContent(){var{includeMarkedContent:t=!1,disableNormalization:e=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>_xfa_text.XfaText.textContent(t));let r=this.streamTextContent(t);return new Promise(function(i,t){let e=r.getReader(),s={items:[],styles:Object.create(null)};!function r(){e.read().then(function(t){var{value:t,done:e}=t;e?i(s):(Object.assign(s.styles,t.styles),s.items.push(...t.items),r())},t)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;var t,e=[];for(t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(var r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#i=!1,this.#r(),Promise.all(e)}cleanup(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=(this.#i=!0,this.#s(!1));return t&&e&&(this._stats&&=new _display_utils.StatTimer),e}#s(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#r(),!this.#i||this.destroyed)return!1;if(t)return this.#n=setTimeout(()=>{this.#n=null,this.#s(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(0<t.size||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),!(this.#i=!1)}#r(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(t,e){e=this._intentStates.get(e);e&&(this._stats?.timeEnd("Page Request"),e.displayReadyCapability?.resolve(t))}_renderPageChunk(r,i){for(let t=0,e=r.length;t<e;t++)i.operatorList.fnArray.push(r.fnArray[t]),i.operatorList.argsArray.push(r.argsArray[t]);i.operatorList.lastChunk=r.lastChunk,i.operatorList.separateAnnots=r.separateAnnots;for(let t of i.renderTasks)t.operatorListChanged();r.lastChunk&&this.#s(!0)}_pumpOperatorList(t){var{renderingIntent:t,cacheKey:e,annotationStorageSerializable:r}=t;let{map:i,transfers:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:i},s).getReader(),n=this._intentStates.get(e),o=(n.streamReader=a,()=>{a.read().then(t=>{var{value:t,done:e}=t;e?n.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,n),o())},t=>{if(n.streamReader=null,!this._transport.destroyed){if(n.operatorList){n.operatorList.lastChunk=!0;for(let t of n.renderTasks)t.operatorListChanged();this.#s(!0)}if(n.displayReadyCapability)n.displayReadyCapability.reject(t);else{if(!n.opListReadCapability)throw t;n.opListReadCapability.reject(t)}}})});o()}_abortOperatorList(t){let{intentState:r,reason:e,force:i=!1}=t;if(r.streamReader){if(r.streamReaderCancelTimeout&&(clearTimeout(r.streamReaderCancelTimeout),r.streamReaderCancelTimeout=null),!i){if(0<r.renderTasks.size)return;if(e instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;return 0<e.extraDelay&&e.extraDelay<1e3&&(t+=e.extraDelay),void(r.streamReaderCancelTimeout=setTimeout(()=>{r.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:r,reason:e,force:!0})},t))}}if(r.streamReader.cancel(new _util.AbortException(e.message)).catch(()=>{}),r.streamReader=null,!this._transport.destroyed){for(let[t,e]of this._intentStates)if(e===r){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){let r={data:structuredClone(t,null)};this.#o.then(()=>{for(var t of this.#a)t.call(this,r)})}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let r;try{if(!(r=new URL(t)).origin||"null"===r.origin)return!1}catch{return!1}t=new URL(e,r);return r.origin===t.origin},PDFWorkerUtil.createCDNWrapper=function(t){return URL.createObjectURL(new Blob([`importScripts("${t}");`]))};class PDFWorker{static#l;constructor(){var{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=r,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){if(PDFWorker.#l?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).set(e,this),this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let t=PDFWorker.workerSrc;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t),r=new _message_handler.MessageHandler("main","worker",e),i=()=>{e.removeEventListener("error",s),r.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||i()},a=(e.addEventListener("error",s),r.on("test",t=>{e.removeEventListener("error",s),this.destroyed?i():t?(this._messageHandler=r,this._port=e,this._webWorker=e,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),e.terminate())}),r.on("ready",t=>{if(e.removeEventListener("error",s),this.destroyed)i();else try{a()}catch{this._setupFakeWorker()}}),()=>{var t=new Uint8Array;r.send("test",t,[t.buffer])});return void a()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(t=>{var e,r,i;this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):(e=new LoopbackPort,this._port=e,r="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(r+"_worker",r,e),t.setup(i,e),t=new _message_handler.MessageHandler(r,r+"_worker",e),this._messageHandler=t,this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity}))}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var e=this.#l?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&"function"==typeof require){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#h=new Map;#d=new Map;#u=null;constructor(t,e,r,i,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=this.#c.get(t);return r||(r=this.messageHandler.sendWithPromise(t,e),this.#c.set(t,r),r)}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,a=_annotation_storage.SerializableEmpty;switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: "+t)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,a=(s&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: "+e)}return i&&(s+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:s,cacheKey:s+"_"+a.hash,annotationStorageSerializable:a}}destroy(){if(!this.destroyCapability){this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(new Error("Worker was destroyed during onPassword callback"));var e=[];for(let t of this.#h.values())e.push(t._destroy());this.#h.clear(),this.#d.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject)}return this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:a,loadingTask:i}=this;a.on("GetReader",(t,r)=>{(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}},r.onPull=()=>{this._fullReader.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{this._fullReader.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}}),a.on("ReaderHeadersReady",t=>{let e=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&i.onProgress?.(this._lastProgress),r.onProgress=t=>{i.onProgress?.({loaded:t.loaded,total:t.total})}),e.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},e.reject),e.promise}),a.on("GetRangeReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let e=this._networkStream.getRangeReader(t.begin,t.end);e?(r.onPull=()=>{e.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{e.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}):r.close()}),a.on("GetDoc",t=>{t=t.pdfInfo;this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,i._capability.resolve(new PDFDocumentProxy(t,this))}),a.on("DocException",function(t){let e;switch(t.name){case"PasswordException":e=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":e=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":e=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":e=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":e=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}i._capability.reject(e)}),a.on("PasswordRequest",t=>{if(this.#u=new _util.PromiseCapability,i.onPassword){var e=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{i.onPassword(e,t.code)}catch(t){this.#u.reject(t)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}),a.on("DataLoaded",t=>{i.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),a.on("StartRenderPage",t=>{this.destroyed||this.#h.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),a.on("commonobj",t=>{let[i,e,s]=t;if(!this.destroyed&&!this.commonObjs.has(i))switch(e){case"Font":let r=this._params;if("error"in s){let t=s.error;(0,_util.warn)("Error during font loading: "+t),this.commonObjs.resolve(i,t)}else{let t=r.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,e=new _font_loader.FontFaceObject(s,{isEvalSupported:r.isEvalSupported,disableFontFace:r.disableFontFace,ignoreErrors:r.ignoreErrors,inspectFont:t});this.fontLoader.bind(e).catch(t=>a.sendWithPromise("FontFallback",{id:i})).finally(()=>{!r.fontExtraProperties&&e.data&&(e.data=null),this.commonObjs.resolve(i,e)})}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error("Got unknown common object type "+e)}}),a.on("obj",t=>{let[e,r,i,s]=t;if(!this.destroyed){var a=this.#h.get(r);if(!a.objs.has(e))switch(i){case"Image":if(a.objs.resolve(e,s),s){let r;if(s.bitmap){let{width:t,height:e}=s;r=t*e*4}else r=s.data?.length||0;r>_util.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error("Got unknown object type "+i)}}}),a.on("DocProgress",t=>{this.destroyed||i.onProgress?.({loaded:t.loaded,total:t.total})}),a.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."))),a.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));let e=t-1,r=this.#d.get(e);return r||(t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t=new PDFPageProxy(e,t,this,this._params.pdfBug);return this.#h.set(e,t),t}),this.#d.set(e,t),t)}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#p("GetDocJSActions")}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(){var t="GetMetadata",e=this.#c.get(t);return e||(e=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})),this.#c.set(t,e),e)}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let t of this.#h.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){var{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#f=Object.create(null);#g(t){return this.#f[t]||={capability:new _util.PromiseCapability,data:null}}get(e){let r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(r){let t=this.#g(e);return t.capability.promise.then(()=>r(t.data)),null}let t=this.#f[e];if(t?.capability.settled)return t.data;throw new Error(`Requesting object that isn't resolved yet ${e}.`)}has(t){return this.#f[t]?.capability.settled||!1}resolve(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,t=this.#g(t);t.data=e,t.capability.resolve()}clear(){for(var t in this.#f){t=this.#f[t].data;t?.bitmap?.close()}this.#f=Object.create(null)}}class RenderTask{#m=null;constructor(t){this.#m=t,this.onContinue=null}get promise(){return this.#m.capability.promise}cancel(){this.#m.cancel(null,0<arguments.length&&void 0!==arguments[0]?arguments[0]:0)}get separateAnnots(){var t,e=this.#m.operatorList.separateAnnots;return!!e&&(t=this.#m.annotationCanvasMap,e.form||e.canvas&&0<t?.size)}}exports.RenderTask=RenderTask;class InternalRenderTask{static#b=new WeakSet;constructor(t){var{callback:t,params:e,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:a,pageIndex:n,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:c=null}=t;this.callback=t,this.params=e,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=n,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=d,this.pageColors=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var{transparency:t=!1,optionalContentConfig:e}=t;if(!this.cancelled){if(this._canvas){if(InternalRenderTask.#b.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#b.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var{canvasContext:r,viewport:i,transform:s,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:i,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}}cancel(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page "+(this._pageIndex+1),e))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk)&&(this.gfx.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback()))}}let version="3.11.174",build=(exports.version=version,"ce8716743");exports.build=build},(t,e,r)=>{var i=r(3),s=r(126);i({target:"Set",proto:!0,real:!0,forced:!r(135)("difference")},{difference:s})},(t,e,r)=>{var s=r(127),i=r(128),a=r(129),n=r(132),o=r(133),l=r(130),h=r(131),d=i.has,c=i.remove;t.exports=function(t){var e=s(this),r=o(t),i=a(e);return n(e)<=r.size?l(e,function(t){r.includes(t)&&c(i,t)}):h(r.getIterator(),function(t){d(e,t)&&c(i,t)}),i}},(t,e,r)=>{var i=r(128).has;t.exports=function(t){return i(t),t}},(t,e,r)=>{var r=r(14),i=Set.prototype;t.exports={Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{var i=r(128),s=r(130),a=i.Set,n=i.add;t.exports=function(t){var e=new a;return s(t,function(t){n(e,t)}),e}},(t,e,r)=>{var i=r(14),s=r(131),r=r(128),a=r.Set,r=r.proto,n=i(r.forEach),o=i(r.keys),l=o(new a).next;t.exports=function(t,e,r){return r?s({iterator:o(t),next:l},e):n(t,e)}},(t,e,r)=>{var n=r(8);t.exports=function(t,e,r){for(var i,s=r?t:t.iterator,a=t.next;!(i=n(a,s)).done;)if(void 0!==(i=e(i.value)))return i}},(t,e,r)=>{var i=r(72),r=r(128);t.exports=i(r.proto,"size","get")||function(t){return t.size}},(t,e,r)=>{function i(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i}var s=r(31),a=r(47),n=r(8),o=r(62),l=r(134),h="Invalid size",d=RangeError,c=TypeError,u=Math.max;i.prototype={getIterator:function(){return l(a(n(this.keys,this.set)))},includes:function(t){return n(this.has,this.set,t)}},t.exports=function(t){a(t);var e=+t.size;if(e!=e)throw c(h);e=o(e);if(e<0)throw d(h);return new i(t,u(e,0),s(t.has),s(t.keys))}},t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},(t,e,r)=>{function i(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}}var s=r(24);t.exports=function(t){var e=s("Set");try{(new e)[t](i(0));try{return(new e)[t](i(-1)),!1}catch(t){return!0}}catch(t){return!1}}},(t,e,r)=>{var i=r(3),s=r(7),a=r(137);i({target:"Set",proto:!0,real:!0,forced:!r(135)("intersection")||s(function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))})},{intersection:a})},(t,e,r)=>{var s=r(127),i=r(128),a=r(132),n=r(133),o=r(130),l=r(131),h=i.Set,d=i.add,c=i.has;t.exports=function(t){var e=s(this),r=n(t),i=new h;return a(e)>r.size?l(r.getIterator(),function(t){c(e,t)&&d(i,t)}):o(e,function(t){r.includes(t)&&d(i,t)}),i}},(t,e,r)=>{var i=r(3),s=r(139);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isDisjointFrom")},{isDisjointFrom:s})},(t,e,r)=>{var s=r(127),a=r(128).has,n=r(132),o=r(133),l=r(130),h=r(131),d=r(140);t.exports=function(t){var e,r=s(this),i=o(t);return n(r)<=i.size?!1!==l(r,function(t){if(i.includes(t))return!1},!0):(e=i.getIterator(),!1!==h(e,function(t){if(a(r,t))return d(e,"normal",!1)}))}},(t,e,r)=>{var a=r(8),n=r(47),o=r(30);t.exports=function(t,e,r){var i,s;n(t);try{if(!(i=o(t,"return"))){if("throw"===e)throw r;return r}i=a(i,t)}catch(t){s=!0,i=t}if("throw"===e)throw r;if(s)throw i;return n(i),r}},(t,e,r)=>{var i=r(3),s=r(142);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSubsetOf")},{isSubsetOf:s})},(t,e,r)=>{var i=r(127),s=r(132),a=r(130),n=r(133);t.exports=function(t){var e=i(this),r=n(t);return!(s(e)>r.size)&&!1!==a(e,function(t){if(!r.includes(t))return!1},!0)}},(t,e,r)=>{var i=r(3),s=r(144);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSupersetOf")},{isSupersetOf:s})},(t,e,r)=>{var i=r(127),s=r(128).has,a=r(132),n=r(133),o=r(131),l=r(140);t.exports=function(t){var e,r=i(this),t=n(t);return!(a(r)<t.size)&&(e=t.getIterator(),!1!==o(e,function(t){if(!s(r,t))return l(e,"normal",!1)}))}},(t,e,r)=>{var i=r(3),s=r(146);i({target:"Set",proto:!0,real:!0,forced:!r(135)("symmetricDifference")},{symmetricDifference:s})},(t,e,r)=>{var i=r(127),s=r(128),a=r(129),n=r(133),o=r(131),l=s.add,h=s.has,d=s.remove;t.exports=function(t){var e=i(this),t=n(t).getIterator(),r=a(e);return o(t,function(t){(h(e,t)?d:l)(r,t)}),r}},(t,e,r)=>{var i=r(3),s=r(148);i({target:"Set",proto:!0,real:!0,forced:!r(135)("union")},{union:s})},(t,e,r)=>{var i=r(127),s=r(128).add,a=r(129),n=r(133),o=r(131);t.exports=function(t){var e=i(this),t=n(t).getIterator(),r=a(e);return o(t,function(t){s(r,t)}),r}},(t,e,r)=>{function i(){c(this,y);var t=p((e=arguments.length)<1?void 0:arguments[0]),e=p(e<2?void 0:arguments[1],"Error"),e=new b(t,e);return(t=_(t)).name=v,h(e,"stack",l(1,g(t.stack,1))),u(e,this,i),e}var s,a=r(3),n=r(4),o=r(24),l=r(11),h=r(45).f,d=r(39),c=r(150),u=r(75),p=r(76),f=r(151),g=r(82),m=r(6),r=r(36),v="DOMException",_=o("Error"),b=o(v),y=i.prototype=b.prototype,A="stack"in _(v),S="stack"in new b(1,2),m=b&&m&&Object.getOwnPropertyDescriptor(n,v),n=!(!m||m.writable&&m.configurable),m=A&&!n&&!S,x=(a({global:!0,constructor:!0,forced:r||m},{DOMException:m?i:b}),o(v)),A=x.prototype;if(A.constructor!==x)for(var w in r||h(A,"constructor",l(1,x)),f)!d(f,w)||d(x,s=(w=f[w]).s)||h(x,s,l(6,w.c))},(t,e,r)=>{var i=r(25),s=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw s("Incorrect invocation")}},t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(l,h,t)=>{function e(i){return!a(function(){var t=new v.Set([7]),e=i(t),r=i(T(7));return e===t||!e.has(7)||"object"!=typeof r||7!=+r})&&i}function r(r,i){return!a(function(){var t=new i,e=r({a:t,b:t});return!(e&&e.a===e.b&&e.a instanceof i&&e.a.stack===t.stack)})}function u(t){throw new P("Uncloneable type: "+t,D)}function p(t,e){return L||N(e),L(t)}function f(t,e,r,i,s){var a=v[e];return y(a)||N(e),new a(j(t.buffer,s),r,i)}function g(t,e,r){this.object=t,this.type=e,this.metadata=r}function m(t,r,i){if(q(t)&&u("Symbol"),!y(t))return t;if(r){if(M(r,t))return R(r,t)}else r=new k;var e,s,a,n,o,l,h,d,c=S(t);switch(c){case"Array":a=J(w(t));break;case"Object":a={};break;case"Map":a=new k;break;case"Set":a=new ht;break;case"RegExp":a=new RegExp(t.source,K(t));break;case"Error":switch(s=t.name){case"AggregateError":a=_("AggregateError")([]);break;case"EvalError":a=Z();break;case"RangeError":a=tt();break;case"ReferenceError":a=et();break;case"SyntaxError":a=rt();break;case"TypeError":a=it();break;case"URIError":a=st();break;case"CompileError":a=nt();break;case"LinkError":a=ot();break;case"RuntimeError":a=lt();break;default:a=C()}break;case"DOMException":a=new P(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=i?new g(t,c):j(t,r,c);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":l="DataView"===c?t.byteLength:t.length,a=i?new g(t,c,{offset:t.byteOffset,length:l}):f(t,c,t.byteOffset,l,r);break;case"DOMQuad":try{a=new DOMQuad(m(t.p1,r,i),m(t.p2,r,i),m(t.p3,r,i),m(t.p4,r,i))}catch(r){a=p(t,c)}break;case"File":if(L)try{a=L(t),S(a)!==c&&(a=void 0)}catch(t){}if(!a)try{a=new File([t],t.name,t)}catch(t){}a||N(c);break;case"FileList":if(n=(()=>{var e;try{e=new v.DataTransfer}catch(t){try{e=new v.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null})()){for(o=0,l=w(t);o<l;o++)n.items.add(m(t[o],r,i));a=n.files}else a=p(t,c);break;case"ImageData":try{a=new ImageData(m(t.data,r,i),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){a=p(t,c)}break;default:if(L)a=L(t);else switch(c){case"BigInt":a=T(t.valueOf());break;case"Boolean":a=T(pt(t));break;case"Number":a=T(ft(t));break;case"String":a=T(gt(t));break;case"Date":a=new Q(mt(t));break;case"Blob":try{a=t.slice(0,t.size,t.type)}catch(t){N(c)}break;case"DOMPoint":case"DOMPointReadOnly":e=v[c];try{a=e.fromPoint?e.fromPoint(t):new e(t.x,t.y,t.z,t.w)}catch(t){N(c)}break;case"DOMRect":case"DOMRectReadOnly":e=v[c];try{a=e.fromRect?e.fromRect(t):new e(t.x,t.y,t.width,t.height)}catch(t){N(c)}break;case"DOMMatrix":case"DOMMatrixReadOnly":e=v[c];try{a=e.fromMatrix?e.fromMatrix(t):new e(t)}catch(t){N(c)}break;case"AudioData":case"VideoFrame":b(t.clone)||N(c);try{a=t.clone()}catch(t){u(c)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":N(c);default:u(c)}}switch(F(r,t,a),c){case"Array":case"Object":for(h=ct(t),o=0,l=w(h);o<l;o++)d=h[o],V(a,d,m(t[d],r,i));break;case"Map":t.forEach(function(t,e){F(a,m(e,r,i),m(t,r,i))});break;case"Set":t.forEach(function(t){dt(a,m(t,r,i))});break;case"Error":x(a,"message",m(t.message,r,i)),G(t,"cause")&&x(a,"cause",m(t.cause,r,i)),"AggregateError"===s&&(a.errors=m(t.errors,r,i));case"DOMException":$&&x(a,"stack",m(t.stack,r,i))}return a}function c(t,r){if(!y(t))return t;if(M(r,t))return R(r,t);var e,i,s,a,n,o,l,h;if(t instanceof g)switch(e=t.type,i=t.object,e){case"ArrayBuffer":case"SharedArrayBuffer":h=j(i,r,e);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":s=t.metadata,h=f(i,e,s.offset,s.length,r)}else switch(S(t)){case"Array":case"Object":for(o=ct(t),a=0,n=w(o);a<n;a++)t[l=o[a]]=c(t[l],r);break;case"Map":h=new k,t.forEach(function(t,e){F(h,c(e,r),c(t,r))});break;case"Set":h=new ht,t.forEach(function(t){dt(h,c(t,r))});break;case"Error":t.message=c(t.message,r),G(t,"cause")&&(t.cause=c(t.cause,r)),"AggregateError"===t.name&&(t.errors=c(t.errors,r));case"DOMException":$&&(t.stack=c(t.stack,r))}return F(r,t,h||t),h||t}var i,d=t(36),B=t(3),v=t(4),_=t(24),s=t(14),a=t(7),U=t(41),b=t(21),z=t(153),W=t(17),y=t(20),q=t(23),H=t(154),A=t(47),S=t(78),G=t(39),V=t(159),x=t(44),w=t(64),X=t(85),K=t(160),n=t(162),Y=t(128),$=t(83),E=t(119),T=v.Object,J=v.Array,Q=v.Date,C=v.Error,Z=v.EvalError,tt=v.RangeError,et=v.ReferenceError,rt=v.SyntaxError,it=v.TypeError,st=v.URIError,at=v.PerformanceMark,t=v.WebAssembly,nt=t&&t.CompileError||C,ot=t&&t.LinkError||C,lt=t&&t.RuntimeError||C,P=_("DOMException"),k=n.Map,M=n.has,R=n.get,F=n.set,ht=Y.Set,dt=Y.add,ct=_("Object","keys"),ut=s([].push),pt=s((!0).valueOf),ft=s(1..valueOf),gt=s("".valueOf),mt=s(Q.prototype.getTime),o=U("structuredClone"),D="DataCloneError",I="Transferring",O=v.structuredClone,t=d||!r(O,C)||!r(O,P)||(i=O,!!a(function(){var t=i(new v.AggregateError([1],o,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==o||3!==t.cause})),n=!O&&e(function(t){return new at(o,{detail:t}).detail}),L=e(O)||n,N=function(t,e){throw new P((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",D)},j=function(t,e,r){if(M(e,t))return R(e,t);var i,s,a,n,o,l;if("SharedArrayBuffer"===(r||S(t)))i=L?L(t):t;else{r=v.DataView;r||"function"==typeof t.slice||N("ArrayBuffer");try{if("function"!=typeof t.slice||t.resizable){s=t.byteLength,a="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(s,a),n=new r(t),o=new r(i);for(l=0;l<s;l++)o.setUint8(l,n.getUint8(l))}else i=t.slice(0)}catch(t){throw new P("ArrayBuffer is detached",D)}}return F(e,t,i),i};B({global:!0,enumerable:!0,sham:!E,forced:t},{structuredClone:function(t){var e,r=1<X(arguments.length,1)&&!W(arguments[1])?A(arguments[1]):void 0,r=r?r.transfer:void 0,i=!1,s=(void 0!==r&&(s=((t,e)=>{if(!y(t))throw it("Transfer option cannot be converted to a sequence");var r=[];H(t,function(t){ut(r,A(t))});for(var i,s,a,n,o,l=0,h=w(r),d=[];l<h;)if(i=r[l++],"ArrayBuffer"!==(s=S(i))){if(M(e,i))throw new P("Duplicate transferable",D);if(E)n=O(i,{transfer:[i]});else switch(s){case"ImageBitmap":a=v.OffscreenCanvas,z(a)||N(s,I);try{(o=new a(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i),n=o.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":b(i.clone)&&b(i.close)||N(s,I);try{n=i.clone(),i.close()}catch(t){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":N(s,I)}if(void 0===n)throw new P("This object cannot be transferred: "+s,D);F(e,i,n)}else ut(d,i);return d})(r,e=new k),i=!!w(s)),m(t,e,i));if(i){for(var a,n,o=r,l=e=new k,h=0,d=w(o);h<d;){if(a=o[h++],M(l,a))throw new P("Duplicate transferable",D);n=E?O(a,{transfer:[a]}):(b(a.transfer)||N("ArrayBuffer",I),a.transfer()),F(l,a,n)}s=c(s,e)}return s}})},(t,e,r)=>{function i(){}function s(t){if(!l(t))return!1;try{return p(i,u,t),!0}catch(t){return!1}}function a(t){if(!l(t))return!1;switch(h(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!g(f,c(t))}catch(t){return!0}}var n=r(14),o=r(7),l=r(21),h=r(78),d=r(24),c=r(51),u=[],p=d("Reflect","construct"),f=/^\s*(?:class|function)\b/,g=n(f.exec),m=!f.exec(i);a.sham=!0,t.exports=!p||o(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?a:s},(t,e,r)=>{function v(t,e){this.stopped=t,this.result=e}var _=r(99),b=r(8),y=r(47),A=r(32),S=r(155),x=r(64),w=r(25),E=r(157),T=r(158),C=r(140),P=TypeError,k=v.prototype;t.exports=function(t,e,r){function i(t){return a&&C(a,"normal",t),new v(!0,t)}function s(t){return u?(y(t),g?m(t[0],t[1],i):m(t[0],t[1])):g?m(t,i):m(t)}var a,n,o,l,h,d,c=r&&r.that,u=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),m=_(e,c);if(p)a=t.iterator;else if(f)a=t;else{if(!(r=T(t)))throw P(A(t)+" is not iterable");if(S(r)){for(n=0,o=x(t);n<o;n++)if((l=s(t[n]))&&w(k,l))return l;return new v(!1)}a=E(t,r)}for(h=(p?t:a).next;!(d=b(h,a)).done;){try{l=s(d.value)}catch(t){C(a,"throw",t)}if("object"==typeof l&&l&&w(k,l))return l}return new v(!1)}},(t,e,r)=>{var i=r(34),s=r(156),a=i("iterator"),n=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||n[a]===t)}},t=>{t.exports={}},(t,e,r)=>{var i=r(8),s=r(31),a=r(47),n=r(32),o=r(158),l=TypeError;t.exports=function(t,e){e=arguments.length<2?o(t):e;if(s(e))return a(i(e,t));throw l(n(t)+" is not iterable")}},(t,e,r)=>{var i=r(78),s=r(30),a=r(17),n=r(156),o=r(34)("iterator");t.exports=function(t){if(!a(t))return s(t,o)||s(t,"@@iterator")||n[i(t)]}},(t,e,r)=>{var i=r(18),s=r(45),a=r(11);t.exports=function(t,e,r){e=i(e);e in t?s.f(t,e,a(0,r)):t[e]=r}},(t,e,r)=>{var i=r(8),s=r(39),a=r(25),n=r(161),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!a(o,t)?e:i(n,t)}},(t,e,r)=>{var i=r(47);t.exports=function(){var t=i(this),e="";return 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"),e}},(t,e,r)=>{var r=r(14),i=Map.prototype;t.exports={Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0,r(89),r(149),r(152);var i=r(1),o=r(164),l=r(170);let h=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=h;class s{#v=!1;#y=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){t=this.#y.get(t);return void 0===t?e:Object.assign(e,t)}getRawValue(t){return this.#y.get(t)}remove(t){if(this.#y.delete(t),0===this.#y.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let t of this.#y.values())if(t instanceof o.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,r){var i=this.#y.get(t);let s=!1;if(void 0!==i)for(let[t,e]of Object.entries(r))i[t]!==e&&(s=!0,i[t]=e);else s=!0,this.#y.set(t,r);s&&this.#_(),r instanceof o.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#y.has(t)}getAll(){return 0<this.#y.size?(0,i.objectFromMap)(this.#y):null}setAll(t){for(var[e,r]of Object.entries(t))this.setValue(e,r)}get size(){return this.#y.size}#_(){this.#v||(this.#v=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#v&&(this.#v=!1,"function"==typeof this.onResetModified)&&this.onResetModified()}get print(){return new a(this)}get serializable(){if(0===this.#y.size)return h;let i=new Map,s=new l.MurmurHash3_64,e=[],a=Object.create(null),n=!1;for(let[e,r]of this.#y){let t=r instanceof o.AnnotationEditor?r.serialize(!1,a):r;t&&(i.set(e,t),s.update(e+":"+JSON.stringify(t)),n||=!!t.bitmap)}if(n)for(let t of i.values())t.bitmap&&e.push(t.bitmap);return 0<i.size?{map:i,hash:s.hexdigest(),transfers:e}:h}}e.AnnotationStorage=s;class a extends s{#A;constructor(t){super();var{map:t,hash:e,transfers:r}=t.serializable,t=structuredClone(t,null);this.#A={map:t,hash:e,transfers:r}}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}e.PrintAnnotationStorage=a},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0,r(89),r(2);var i=r(165),n=r(1),s=r(168);class C{#S="";#E=!1;#x=null;#w=null;#C=null;#T=!1;#P=null;#k=this.focusin.bind(this);#M=this.focusout.bind(this);#F=!1;#R=!1;#D=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#I=!1;#O=C._zIndex++;static _borderLineWidth=-1;static _colorManager=new i.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===C&&(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,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;var{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport,[e,r]=(this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a],this.parentDimensions);this.x=t.x/e,this.y=t.y/r,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){var e=new a({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(C._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(t=>[t,e.get(t)])),r?.strings)for(let t of r.strings)C._l10nPromise.set(t,e.get(t));if(-1===C._borderLineWidth){let t=getComputedStyle(document.documentElement);C._borderLineWidth=parseFloat(t.getPropertyValue("--outline-width"))||0}}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(t){this.#I=t,this.div?.classList.toggle("draggable",t)}center(){var[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#O}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#F?this.#F=!1:this.parent.setSelected(this))}focusout(t){this._focusEventsAllowed&&this.isAttachedToDOM&&!t.relatedTarget?.closest("#"+this.id)&&(t.preventDefault(),!this.parent?.isMultipleSelection)&&this.commitOrRemove()}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){var[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/s,this.y=(e+i)/a,this.fixAndSetPosition()}#L(t,e,r){var[t,i]=t;[e,r]=this.screenToPageTranslation(e,r),this.x+=e/t,this.y+=r/i,this.fixAndSetPosition()}translate(t,e){this.#L(this.parentDimensions,t,e)}translateInPage(t,e){this.#L(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){var[r,i]=this.parentDimensions;if(this.x+=t/r,this.y+=e/i,this.parent&&(this.x<0||1<this.x||this.y<0||1<this.y)){let{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}var{x:t,y:r}=this,[e,i]=this.#N();r+=i,this.div.style.left=(100*(t+=e)).toFixed(2)+"%",this.div.style.top=(100*r).toFixed(2)+"%",this.div.scrollIntoView({block:"nearest"})}#N(){var[t,e]=this.parentDimensions,r=C._borderLineWidth,i=r/t,s=r/e;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}fixAndSetPosition(){var[t,e]=this.pageDimensions;let{x:r,y:i,width:s,height:a}=this;switch(s*=t,a*=e,r*=t,i*=e,this.rotation){case 0:r=Math.max(0,Math.min(t-s,r)),i=Math.max(0,Math.min(e-a,i));break;case 90:r=Math.max(0,Math.min(t-a,r)),i=Math.min(e,Math.max(s,i));break;case 180:r=Math.min(t,Math.max(s,r)),i=Math.min(e,Math.max(a,i));break;case 270:r=Math.min(t,Math.max(a,r)),i=Math.max(0,Math.min(e-s,i))}this.x=r/=t,this.y=i/=e;var[n,o]=this.#N(),n=(r+=n,i+=o,this.div).style;n.left=(100*r).toFixed(2)+"%",n.top=(100*i).toFixed(2)+"%",this.moveInDOM()}static#B(t,e,r){switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return C.#B(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return C.#B(t,e,360-this.parentRotation)}#j(t){switch(t){case 90:{let[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){var{parentScale:t,pageDimensions:[e,r]}=this,e=e*t,r=r*t;return n.FeatureTest.isCSSRoundSupported?[Math.round(e),Math.round(r)]:[e,r]}setDims(t,e){var[r,i]=this.parentDimensions;this.div.style.width=(100*t/r).toFixed(2)+"%",this.#T||(this.div.style.height=(100*e/i).toFixed(2)+"%"),this.#x?.classList.toggle("small",t<C.SMALL_EDITOR_SIZE||e<C.SMALL_EDITOR_SIZE)}fixDims(){var t,e,r=this.div.style,{height:i,width:s}=r,a=s.endsWith("%"),n=!this.#T&&i.endsWith("%");a&&n||([t,e]=this.parentDimensions,a||(r.width=(100*parseFloat(s)/t).toFixed(2)+"%"),this.#T)||n||(r.height=(100*parseFloat(i)/e).toFixed(2)+"%")}getInitialTranslation(){return[0,0]}#U(){if(!this.#P){this.#P=document.createElement("div"),this.#P.classList.add("resizers");let t=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||t.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(var e of t){let t=document.createElement("div");this.#P.append(t),t.classList.add("resizer",e),t.addEventListener("pointerdown",this.#z.bind(this,e)),t.addEventListener("contextmenu",s.noContextMenu)}this.div.prepend(this.#P)}}#z(r,i){i.preventDefault();var t=n.FeatureTest.platform.isMac;if(!(0!==i.button||i.ctrlKey&&t)){let t=this.#W.bind(this,r),e=this._isDraggable,n={passive:!(this._isDraggable=!1),capture:!0},o=(window.addEventListener("pointermove",t,n),this.x),l=this.y,h=this.width,d=this.height,c=this.parent.div.style.cursor,u=this.div.style.cursor,p=(this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor,()=>{this._isDraggable=e,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",t,n),this.parent.div.style.cursor=c,this.div.style.cursor=u;let r=this.x,i=this.y,s=this.width,a=this.height;r===o&&i===l&&s===h&&a===d||this.addCommands({cmd:()=>{this.width=s,this.height=a,this.x=r,this.y=i;var[t,e]=this.parentDimensions;this.setDims(t*s,e*a),this.fixAndSetPosition()},undo:()=>{this.width=h,this.height=d,this.x=o,this.y=l;var[t,e]=this.parentDimensions;this.setDims(t*h,e*d),this.fixAndSetPosition()},mustExec:!0})});window.addEventListener("pointerup",p),window.addEventListener("blur",p)}}#W(t,e){let[r,i]=this.parentDimensions,s=this.x,a=this.y,n=this.width,o=this.height,l=C.MIN_SIZE/r,h=C.MIN_SIZE/i,d=t=>Math.round(1e4*t)/1e4,c=this.#j(this.rotation),u=(t,e)=>[c[0]*t+c[2]*e,c[1]*t+c[3]*e],p=this.#j(360-this.rotation),f,g,m=!1,v=!1;switch(t){case"topLeft":m=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":m=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":v=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":v=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}var _=f(n,o),b=g(n,o),t=u(...b),y=d(s+t[0]),A=d(a+t[1]);let S=1,x=1,[w,E]=this.screenToPageTranslation(e.movementX,e.movementY);if([w,E]=[p[0]*(e=w/r)+p[2]*(T=E/i),p[1]*e+p[3]*T],m){let t=Math.hypot(n,o);S=x=Math.max(Math.min(Math.hypot(b[0]-_[0]-w,b[1]-_[1]-E)/t,1/n,1/o),l/n,h/o)}else v?S=Math.max(l,Math.min(1,Math.abs(b[0]-_[0]-w)))/n:x=Math.max(h,Math.min(1,Math.abs(b[1]-_[1]-E)))/o;var e=d(n*S),T=d(o*x),b=y-(t=u(...g(e,T)))[0],_=A-t[1];this.width=e,this.height=T,this.x=b,this.y=_,this.setDims(r*e,i*T),this.fixAndSetPosition()}async addAltTextButton(){if(!this.#x){let e=this.#x=document.createElement("button"),t=(e.className="altText",await C._l10nPromise.get("editor_alt_text_button_label"));if(e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",t=>t.stopPropagation()),e.addEventListener("click",t=>{t.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(t.preventDefault(),this._uiManager.editAltText(this))}),this.#H(),this.div.append(e),!C.SMALL_EDITOR_SIZE)C.SMALL_EDITOR_SIZE=Math.min(128,Math.round(1.4*e.getBoundingClientRect().width))}}async#H(){let e=this.#x;if(e)if(this.#S||this.#E){C._l10nPromise.get("editor_alt_text_edit_button_label").then(t=>{e.setAttribute("aria-label",t)});let t=this.#w;if(!t){this.#w=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip");var r=t.id="alt-text-tooltip-"+this.id;e.setAttribute("aria-describedby",r);e.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},100)}),e.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}e.classList.add("done"),t.innerText=this.#E?await C._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,t.parentNode||e.append(t)}else e.classList.remove("done"),this.#w?.remove()}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(t){var{altText:t,decorative:e}=t;this.#S===t&&this.#E===e||(this.#S=t,this.#E=e,this.#H())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#k),this.div.addEventListener("focusout",this.#M);var[t,e]=this.parentDimensions,[t,e]=(this.parentRotation%180!=0&&(this.div.style.maxWidth=(100*e/t).toFixed(2)+"%",this.div.style.maxHeight=(100*t/e).toFixed(2)+"%"),this.getInitialTranslation());return this.translate(t,e),(0,i.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){var e=n.FeatureTest.platform.isMac;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#F=!0,this.#q(t))}#q(s){if(this._isDraggable){let t=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let e,r,i=(t&&(e={passive:!0,capture:!0},r=t=>{var[t,e]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(t,e)},window.addEventListener("pointermove",r,e)),()=>{if(window.removeEventListener("pointerup",i),window.removeEventListener("blur",i),t&&window.removeEventListener("pointermove",r,e),this.#F=!1,!this._uiManager.endDragSession()){let t=n.FeatureTest.platform.isMac;s.ctrlKey&&!t||s.shiftKey||s.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}});window.addEventListener("pointerup",i),window.addEventListener("blur",i)}}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition()}getRect(t,e){var r=this.parentScale,[i,s]=this.pageDimensions,[a,n]=this.pageTranslation,o=t/r,l=e/r,h=this.x*i,d=this.y*s,c=this.width*i,u=this.height*s;switch(this.rotation){case 0:return[h+o+a,s-d-l-u+n,h+o+c+a,s-d-l+n];case 90:return[h+l+a,s-d+o+n,h+l+u+a,s-d+o+c+n];case 180:return[h-o-c+a,s-d+l+n,h-o+a,s-d+l+u+n];case 270:return[h-l-u+a,s-d-o-c+n,h-l+a,s-d-o+n];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){var[r,i,s,a]=t,n=s-r,o=a-i;switch(this.rotation){case 0:return[r,e-a,n,o];case 90:return[r,e-i,o,n];case 180:return[s,e-i,n,o];case 270:return[s,e-a,o,n];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#D=!0}disableEditMode(){this.#D=!1}isInEditMode(){return this.#D}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#k),this.div?.addEventListener("focusout",this.#M)}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e,r){var e=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r}),[r,i]=(e.rotation=t.rotation,e.pageDimensions),[t,s,a,n]=e.getRectInCurrentCoords(t.rect,i);return e.x=t/r,e.y=s/i,e.width=a/r,e.height=n/i,e}remove(){this.div.removeEventListener("focusin",this.#k),this.div.removeEventListener("focusout",this.#M),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#x?.remove(),this.#x=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#U(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}disableEditing(){this.#x&&(this.#x.hidden=!0)}enableEditing(){this.#x&&(this.#x.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#R}set isEditing(t){this.#R=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#T=!0;var r=this.div.style;r.aspectRatio=t/e,r.height="auto"}static get MIN_SIZE(){return 16}}e.AnnotationEditor=C;class a extends C{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function(t,e,r){for(var i of r)e.addEventListener(i,t[i].bind(t))},e.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")},r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(166);var n=r(1),o=r(168);class i{#G=0;getId(){return""+n.AnnotationEditorPrefix+this.#G++}}class l{#V=(0,n.getUuid)();#G=0;#$=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';var r=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]));return(0,n.shadow)(this,"_isSVGFittingCanvas",r)}async#X(t,r){this.#$||=new Map;let a=this.#$.get(t);if(null===a)return null;if(a?.bitmap)a.refCounter+=1;else{try{a||={bitmap:null,id:`image_${this.#V}_`+this.#G++,refCounter:0,isSvg:!1};let e;if("string"==typeof r){a.url=r;var i=await fetch(r);if(!i.ok)throw new Error(i.statusText);e=await i.blob()}else e=a.file=r;if("image/svg+xml"===e.type){let r=l._isSVGFittingCanvas,i=new FileReader,s=new Image,t=new Promise((t,e)=>{s.onload=()=>{a.bitmap=s,a.isSvg=!0,t()},i.onload=async()=>{var t=a.svgUrl=i.result;s.src=await r?t+"#svgView(preserveAspectRatio(none))":t},s.onerror=i.onerror=e});i.readAsDataURL(e),await t}else a.bitmap=await createImageBitmap(e);a.refCounter=1}catch(t){console.error(t),a=null}this.#$.set(t,a),a&&this.#$.set(a.id,a)}return a}async getFromFile(t){var{lastModified:e,name:r,size:i,type:s}=t;return this.#X(e+`_${r}_${i}_`+s,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#$||=new Map;t=this.#$.get(t);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(t){t=this.#$.get(t);return t?.isSvg?t.svgUrl:null}deleteId(t){this.#$||=new Map;t=this.#$.get(t);t&&(--t.refCounter,0===t.refCounter)&&(t.bitmap=null)}isValidId(t){return t.startsWith(`image_${this.#V}_`)}}class s{#K=[];#Y=!1;#J;#Q=-1;constructor(){this.#J=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128}add(t){var{cmd:t,undo:e,mustExec:r,type:i=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}=t;r&&t(),this.#Y||(r={cmd:t,undo:e,type:i},-1===this.#Q?(0<this.#K.length&&(this.#K.length=0),this.#Q=0,this.#K.push(r)):s&&this.#K[this.#Q].type===i?(a&&(r.undo=this.#K[this.#Q].undo),this.#K[this.#Q]=r):((t=this.#Q+1)===this.#J?this.#K.splice(0,1):(this.#Q=t)<this.#K.length&&this.#K.splice(t),this.#K.push(r)))}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,--this.#Q)}redo(){this.#Q<this.#K.length-1&&(this.#Q+=1,this.#Y=!0,this.#K[this.#Q].cmd(),this.#Y=!1)}hasSomethingToUndo(){return-1!==this.#Q}hasSomethingToRedo(){return this.#Q<this.#K.length-1}destroy(){this.#K=null}}e.CommandManager=s;class a{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;var s=n.FeatureTest.platform.isMac;for(let[e,r,i={}]of t)for(let t of e){var a=t.startsWith("mac+");s&&a?(this.callbacks.set(t.slice(4),{callback:r,options:i}),this.allKeys.add(t.split("+").at(-1))):s||a||(this.callbacks.set(t,{callback:r,options:i}),this.allKeys.add(t.split("+").at(-1)))}}#Z(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);t=this.buffer.join("+");return this.buffer.length=0,t}exec(t,e){var r,i,s,a;this.allKeys.has(e.key)&&(r=this.callbacks.get(this.#Z(e)))&&({callback:r,options:{bubbles:i=!1,args:s=[],checker:a=null}}=r,a&&!a(t,e)||(r.bind(t,...s)(),i)||(e.stopPropagation(),e.preventDefault()))}}e.KeyboardManager=a;class h{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){var t=new Map([["CanvasText",null],["Canvas",null]]);return(0,o.getColorValues)(t),(0,n.shadow)(this,"_colors",t)}convert(t){let r=(0,o.getRGB)(t);if(window.matchMedia("(forced-colors: active)").matches)for(let[t,e]of this._colors)if(e.every((t,e)=>t===r[e]))return h._colorsMapping.get(t);return r}getHexCode(t){var e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}e.ColorManager=h;class d{#tt=null;#et=new Map;#nt=new Map;#it=null;#rt=null;#st=new s;#at=0;#ot=new Set;#lt=null;#ct=null;#ht=new Set;#dt=null;#ut=new i;#pt=!1;#ft=!1;#gt=null;#mt=n.AnnotationEditorType.NONE;#bt=new Set;#vt=null;#yt=this.blur.bind(this);#_t=this.focus.bind(this);#At=this.copy.bind(this);#St=this.cut.bind(this);#Et=this.paste.bind(this);#xt=this.keydown.bind(this);#wt=this.onEditingAction.bind(this);#Ct=this.onPageChanging.bind(this);#Tt=this.onScaleChanging.bind(this);#Pt=this.onRotationChanging.bind(this);#kt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Mt=[0,0];#Ft=null;#Rt=null;#Dt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){var t=d.prototype,e=t=>{var e=document.activeElement;return e&&t.#Rt.contains(e)&&t.hasSomethingToControl()},r=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new a([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}]]))}constructor(t,e,r,i,s,a){this.#Rt=t,this.#Dt=e,this.#it=r,this._eventBus=i,this._eventBus._on("editingaction",this.#wt),this._eventBus._on("pagechanging",this.#Ct),this._eventBus._on("scalechanging",this.#Tt),this._eventBus._on("rotationchanging",this.#Pt),this.#rt=s.annotationStorage,this.#dt=s.filterFactory,this.#vt=a,this.viewParameters={realScale:o.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#It(),this.#Ot(),this._eventBus._off("editingaction",this.#wt),this._eventBus._off("pagechanging",this.#Ct),this._eventBus._off("scalechanging",this.#Tt),this._eventBus._off("rotationchanging",this.#Pt);for(var t of this.#nt.values())t.destroy();this.#nt.clear(),this.#et.clear(),this.#ht.clear(),this.#tt=null,this.#bt.clear(),this.#st.destroy(),this.#it.destroy()}get hcmFilter(){return(0,n.shadow)(this,"hcmFilter",this.#vt?this.#dt.addHCMFilter(this.#vt.foreground,this.#vt.background):"none")}get direction(){return(0,n.shadow)(this,"direction",getComputedStyle(this.#Rt).direction)}editAltText(t){this.#it?.editAltText(this,t)}onPageChanging(t){t=t.pageNumber;this.#at=t-1}focusMainContainer(){this.#Rt.focus()}findParent(t,e){for(var r of this.#nt.values()){var{x:i,y:s,width:a,height:n}=r.div.getBoundingClientRect();if(i<=t&&t<=i+a&&s<=e&&e<=s+n)return r}return null}disableUserSelect(){this.#Dt.classList.toggle("noUserSelect",0<arguments.length&&void 0!==arguments[0]&&arguments[0])}addShouldRescale(t){this.#ht.add(t)}removeShouldRescale(t){this.#ht.delete(t)}onScaleChanging(t){t=t.scale;this.commitOrRemove(),this.viewParameters.realScale=t*o.PixelsPerInch.PDF_TO_CSS_UNITS;for(let t of this.#ht)t.onScaleChanging()}onRotationChanging(t){t=t.pagesRotation;this.commitOrRemove(),this.viewParameters.rotation=t}addToAnnotationStorage(t){t.isEmpty()||!this.#rt||this.#rt.has(t.id)||this.#rt.setValue(t.id,t)}#Lt(){window.addEventListener("focus",this.#_t),window.addEventListener("blur",this.#yt)}#Ot(){window.removeEventListener("focus",this.#_t),window.removeEventListener("blur",this.#yt)}blur(){if(this.hasSelection){var t,e=document.activeElement;for(t of this.#bt)if(t.div.contains(e)){this.#gt=[t,e],t._focusEventsAllowed=!1;break}}}focus(){if(this.#gt){let[t,e]=this.#gt;this.#gt=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus()}}#Nt(){window.addEventListener("keydown",this.#xt,{capture:!0})}#It(){window.removeEventListener("keydown",this.#xt,{capture:!0})}#Bt(){document.addEventListener("copy",this.#At),document.addEventListener("cut",this.#St),document.addEventListener("paste",this.#Et)}#jt(){document.removeEventListener("copy",this.#At),document.removeEventListener("cut",this.#St),document.removeEventListener("paste",this.#Et)}addEditListeners(){this.#Nt(),this.#Bt()}removeEditListeners(){this.#It(),this.#jt()}copy(t){if(t.preventDefault(),this.#tt?.commitOrRemove(),this.hasSelection){var e=[];for(let t of this.#bt){var r=t.serialize(!0);r&&e.push(r)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let r=t.clipboardData;for(let e of r.items)for(let t of this.#ct)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let i=r.getData("application/pdfjs");if(i){try{i=JSON.parse(i)}catch(t){return void(0,n.warn)(`paste: "${t.message}".`)}if(Array.isArray(i)){this.unselectAll();var s=this.currentLayer;try{let r=[];for(let e of i){let t=s.deserialize(e);if(!t)return;r.push(t)}this.addCommands({cmd:()=>{for(var t of r)this.#Ut(t);this.#zt(r)},undo:()=>{for(var t of r)t.remove()},mustExec:!0})}catch(t){(0,n.warn)(`paste: "${t.message}".`)}}}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||d._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#Wt(t){Object.entries(t).some(t=>{var[t,e]=t;return this.#kt[t]!==e})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,t)})}#Ht(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Lt(),this.#Nt(),this.#Bt(),this.#Wt({isEditing:this.#mt!==n.AnnotationEditorType.NONE,isEmpty:this.#qt(),hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:this.#st.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ot(),this.#It(),this.#jt(),this.#Wt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#ct){this.#ct=t;for(let t of this.#ct)this.#Ht(t.defaultPropertiesToUpdate)}}getId(){return this.#ut.getId()}get currentLayer(){return this.#nt.get(this.#at)}getLayer(t){return this.#nt.get(t)}get currentPageIndex(){return this.#at}addLayer(t){this.#nt.set(t.pageIndex,t),this.#pt?t.enable():t.disable()}removeLayer(t){this.#nt.delete(t.pageIndex)}updateMode(e){let r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.#mt!==e)if((this.#mt=e)!==n.AnnotationEditorType.NONE){this.setEditingState(!0),this.#Gt(),this.unselectAll();for(let t of this.#nt.values())t.updateMode(e);if(r)for(let t of this.#et.values())if(t.annotationElementId===r){this.setSelected(t),t.enterInEditMode();break}}else this.setEditingState(!1),this.#Vt()}updateToolbar(t){t!==this.#mt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#ct)if(t!==n.AnnotationEditorParamsType.CREATE){for(var r of this.#bt)r.updateParams(t,e);for(var i of this.#ct)i.updateDefaultParams(t,e)}else this.currentLayer.addNewEditor(t)}enableWaiting(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#ft!==t){this.#ft=t;for(var e of this.#nt.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}#Gt(){if(!this.#pt){this.#pt=!0;for(var t of this.#nt.values())t.enable()}}#Vt(){if(this.unselectAll(),this.#pt){this.#pt=!1;for(var t of this.#nt.values())t.disable()}}getEditors(t){var e,r=[];for(e of this.#et.values())e.pageIndex===t&&r.push(e);return r}getEditor(t){return this.#et.get(t)}addEditor(t){this.#et.set(t.id,t)}removeEditor(t){this.#et.delete(t.id),this.unselect(t),t.annotationElementId&&this.#ot.has(t.annotationElementId)||this.#rt?.remove(t.id)}addDeletedAnnotationElement(t){this.#ot.add(t.annotationElementId),t.deleted=!0}isDeletedAnnotationElement(t){return this.#ot.has(t)}removeDeletedAnnotationElement(t){this.#ot.delete(t.annotationElementId),t.deleted=!1}#Ut(t){var e=this.#nt.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){this.#tt!==t&&(this.#tt=t)&&this.#Ht(t.propertiesToUpdate)}toggleSelected(t){this.#bt.has(t)?(this.#bt.delete(t),t.unselect(),this.#Wt({hasSelectedEditor:this.hasSelection})):(this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0}))}setSelected(t){for(var e of this.#bt)e!==t&&e.unselect();this.#bt.clear(),this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0})}isSelected(t){return this.#bt.has(t)}unselect(t){t.unselect(),this.#bt.delete(t),this.#Wt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#bt.size}undo(){this.#st.undo(),this.#Wt({hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#qt()})}redo(){this.#st.redo(),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#st.hasSomethingToRedo(),isEmpty:this.#qt()})}addCommands(t){this.#st.add(t),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#qt()})}#qt(){if(0===this.#et.size)return!0;if(1===this.#et.size)for(var t of this.#et.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),this.hasSelection){let e=[...this.#bt];this.addCommands({cmd:()=>{for(var t of e)t.remove()},undo:()=>{for(var t of e)this.#Ut(t)},mustExec:!0})}}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#zt(t){this.#bt.clear();for(var e of t)e.isEmpty()||(this.#bt.add(e),e.select());this.#Wt({hasSelectedEditor:!0})}selectAll(){for(var t of this.#bt)t.commit();this.#zt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(var t of this.#bt)t.unselect();this.#bt.clear(),this.#Wt({hasSelectedEditor:!1})}}translateSelectedEditors(s,a){if(2<arguments.length&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),this.hasSelection){this.#Mt[0]+=s,this.#Mt[1]+=a;let[e,r]=this.#Mt,i=[...this.#bt];this.#Ft&&clearTimeout(this.#Ft),this.#Ft=setTimeout(()=>{this.#Ft=null,this.#Mt[0]=this.#Mt[1]=0,this.addCommands({cmd:()=>{for(var t of i)this.#et.has(t.id)&&t.translateInPage(e,r)},undo:()=>{for(var t of i)this.#et.has(t.id)&&t.translateInPage(-e,-r)},mustExec:!1})},1e3);for(let t of i)t.translateInPage(s,a)}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#lt=new Map;for(var t of this.#bt)this.#lt.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#lt)return!1;this.disableUserSelect(!1);let s=this.#lt,t=(this.#lt=null,!1);for(var[{x:e,y:r,pageIndex:i},a]of s)a.newX=e,a.newY=r,a.newPageIndex=i,t||=e!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(t,e,r,i)=>{var s;this.#et.has(t.id)&&((s=this.#nt.get(i))?t._setParentAndPosition(s,e,r):(t.pageIndex=i,t.x=e,t.y=r))};return this.addCommands({cmd:()=>{for(var[t,{newX:e,newY:r,newPageIndex:i}]of s)n(t,e,r,i)},undo:()=>{for(var[t,{savedX:e,savedY:r,savedPageIndex:i}]of s)n(t,e,r,i)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#lt)for(var r of this.#lt.keys())r.drag(t,e)}rebuild(t){var e;null===t.parent?(e=this.getLayer(t.pageIndex))?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild()):t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#mt}get imageManager(){return(0,n.shadow)(this,"imageManager",new l)}}e.AnnotationEditorUIManager=d},(t,L,e)=>{function f(t,e,r,i){var s,a,n,o,l,h=t[e],d=i&&h===i.value,c=d&&"string"==typeof i.source?{source:i.source}:{};if(v(h)){var u=_(h),p=d?i.nodes:u?[]:{};if(u)for(s=p.length,n=y(h),o=0;o<n;o++)g(h,o,f(h,""+o,r,o<s?p[o]:void 0));else for(a=E(h),n=y(a),o=0;o<n;o++)l=a[o],g(h,l,f(h,l,r,b(p,l)?p[l]:void 0))}return m(r,t,e,h,c)}function g(t,e,r){if(s){var i=T(t,e);if(i&&!i.configurable)return}void 0===r?delete t[e]:c(t,e,r)}function a(t,e,r,i){this.value=t,this.end=e,this.source=r,this.nodes=i}function n(t,e){this.source=t,this.index=e}var r=e(3),s=e(6),i=e(4),o=e(24),l=e(14),m=e(8),h=e(21),v=e(20),_=e(91),b=e(39),d=e(77),y=e(64),c=e(159),u=e(7),p=e(167),e=e(27),A=i.JSON,S=i.Number,x=i.SyntaxError,w=A&&A.parse,E=o("Object","keys"),T=Object.getOwnPropertyDescriptor,C=l("".charAt),P=l("".slice),k=l(/./.exec),M=l([].push),R=/^\d$/,F=/^[1-9]$/,D=/^(?:-|\d)$/,I=/^[\t\n\r ]$/,i=(n.prototype={fork:function(t){return new n(this.source,t)},parse:function(){var t=this.source,e=this.skip(I,this.index),r=this.fork(e),t=C(t,e);if(k(D,t))return r.number();switch(t){case"{":return r.object();case"[":return r.array();case'"':return r.string();case"t":return r.keyword(!0);case"f":return r.keyword(!1);case"n":return r.keyword(null)}throw x('Unexpected character: "'+t+'" at: '+e)},node:function(t,e,r,i,s){return new a(e,i,t?null:P(this.source,r,i),s)},object:function(){for(var t=this.source,e=this.index+1,r=!1,i={},s={};e<t.length;){if(e=this.until(['"',"}"],e),"}"===C(t,e)&&!r){e++;break}var a=this.fork(e).string(),n=a.value,e=a.end,n=(e=this.until([":"],e)+1,e=this.skip(I,e),a=this.fork(e).parse(),c(s,n,a),c(i,n,a.value),e=this.until([",","}"],a.end),C(t,e));if(","===n)r=!0,e++;else if("}"===n){e++;break}}return this.node(1,i,this.index,e,s)},array:function(){for(var t=this.source,e=this.index+1,r=!1,i=[],s=[];e<t.length;){if(e=this.skip(I,e),"]"===C(t,e)&&!r){e++;break}var a=this.fork(e).parse();if(M(s,a),M(i,a.value),e=this.until([",","]"],a.end),","===C(t,e))r=!0,e++;else if("]"===C(t,e)){e++;break}}return this.node(1,i,this.index,e,s)},string:function(){var t=this.index,e=p(this.source,this.index+1);return this.node(0,e.value,t,e.end)},number:function(){var t=this.source,e=this.index,r=e;if("-"===C(t,r)&&r++,"0"===C(t,r))r++;else{if(!k(F,C(t,r)))throw x("Failed to parse number at: "+r);r=this.skip(R,++r)}if("."===C(t,r)&&(r=this.skip(R,++r)),"e"!==C(t,r)&&"E"!==C(t,r)||("+"!==C(t,++r)&&"-"!==C(t,r)||r++,r!==(r=this.skip(R,r))))return this.node(0,S(P(t,e,r)),e,r);throw x("Failed to parse number's exponent value at: "+r)},keyword:function(t){var e=""+t,r=this.index,i=r+e.length;if(P(this.source,r,i)!==e)throw x("Failed to parse value at: "+r);return this.node(0,t,r,i)},skip:function(t,e){for(var r=this.source;e<r.length&&k(t,C(r,e));e++);return e},until:function(t,e){e=this.skip(I,e);for(var r=C(this.source,e),i=0;i<t.length;i++)if(t[i]===r)return e;throw x('Unexpected character: "'+r+'" at: '+e)}},u(function(){var i,t="9007199254740993";return w(t,function(t,e,r){i=r.source}),i!==t})),O=e&&!u(function(){return 1/w("-0 \t")!=-1/0});r({target:"JSON",stat:!0,forced:i},{parse:function(t,e){if(O&&!h(e))return w(t);var r=0,t=(r=d(t),new n(r,0)),i=t.parse(),s=i.value;if((t=t.skip(I,i.end))<r.length)throw x('Unexpected extra character: "'+C(r,t)+'" after the parsed data at: '+t);return h(e)?f({"":s},"",e,i):s}})},(t,e,r)=>{var i=r(14),n=r(39),o=SyntaxError,l=parseInt,h=String.fromCharCode,d=i("".charAt),c=i("".slice),u=i(/./.exec),p={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e<t.length;){var s=d(t,e);if("\\"===s){var a=c(t,e,e+2);if(n(p,a))i+=p[a],e+=2;else{if("\\u"!==a)throw o('Unknown escape sequence: "'+a+'"');a=c(t,e+=2,e+4);if(!u(f,a))throw o("Bad Unicode escape at: "+e);i+=h(l(a,16)),e+=4}}else{if('"'===s){r=!1,e++;break}if(u(g,s))throw o("Bad control character in string literal at: "+e);i+=s,e++}}if(r)throw o("Unterminated string at: "+e);return{value:i,end:e}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){var e,r=document.createElement("span");r.style.visibility="hidden",document.body.append(r);for(e of t.keys()){r.style.color=e;var i=window.getComputedStyle(r).color;t.set(e,_(i))}r.remove()},e.getCurrentTransform=function(t){var{a:t,b:e,c:r,d:i,e:s,f:a}=t.getTransform();return[t,e,r,i,s,a]},e.getCurrentTransformInverse=function(t){var{a:t,b:e,c:r,d:i,e:s,f:a}=t.getTransform().invertSelf();return[t,e,r,i,s,a]},e.getFilenameFromUrl=function(t){return 1<arguments.length&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(g(t))return(0,c.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;var r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let i=r.exec(t[1])||r.exec(t[2])||r.exec(t[3]);if(i&&(i=i[0]).includes("%"))try{i=r.exec(decodeURIComponent(i))[0]}catch{}return i||e},e.getRGB=_,e.getXfaPageViewport=function(t,e){var{scale:e=1,rotation:r=0}=e,{width:t,height:i}=t.attributes.style,t=[0,0,parseInt(t),parseInt(i)];return new p({viewBox:t,scale:e,rotation:r})},e.isDataScheme=g,e.isPdfFile=function(t){return"string"==typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=m,e.loadScript=function(i){let s=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return new Promise((e,t)=>{let r=document.createElement("script");r.src=i,r.onload=function(t){s&&r.remove(),e(t)},r.onerror=function(){t(new Error("Cannot load script at: "+r.src))},(document.head||document.documentElement).append(r)})},e.noContextMenu=function(t){t.preventDefault()},e.setLayerDimensions=function(l,h){let d=2<arguments.length&&void 0!==arguments[2]&&arguments[2],t=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];if(h instanceof p){let{pageWidth:t,pageHeight:e}=h.rawDims,r=l.style,i=c.FeatureTest.isCSSRoundSupported,s=`var(--scale-factor) * ${t}px`,a=`var(--scale-factor) * ${e}px`,n=i?`round(${s}, 1px)`:`calc(${s})`,o=i?`round(${a}, 1px)`:`calc(${a})`;d&&h.rotation%180!=0?(r.width=o,r.height=n):(r.width=n,r.height=o)}t&&l.setAttribute("data-main-rotation",h.rotation)},r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89),r(84),r(86),r(87);var i=r(169),c=r(1);let a="http://www.w3.org/2000/svg";class s{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=s;class n extends i.BaseFilterFactory{#$t;#Xt;#e;#Kt;#Yt;#Jt;#Qt;#Zt;#te;#ee;#G=0;constructor(){var{docId:t,ownerDocument:e=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=t,this.#Kt=e}get#$(){return this.#$t||=new Map}get#ne(){var t,e;return this.#Xt||(e=(t=this.#Kt.createElement("div")).style,e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1,(e=this.#Kt.createElementNS(a,"svg")).setAttribute("width",0),e.setAttribute("height",0),this.#Xt=this.#Kt.createElementNS(a,"defs"),t.append(e),e.append(this.#Xt),this.#Kt.body.append(t)),this.#Xt}addFilter(t){if(!t)return"none";let o,l,h,d,e=this.#$.get(t);if(e)return e;if(1===t.length){let e=t[0],r=new Array(256);for(let t=0;t<256;t++)r[t]=e[t]/255;d=o=l=h=r.join(",")}else{let[e,r,i]=t,s=new Array(256),a=new Array(256),n=new Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,a[t]=r[t]/255,n[t]=i[t]/255;o=s.join(","),l=a.join(","),h=n.join(","),d=""+o+l+h}if(e=this.#$.get(d))return this.#$.set(t,e),e;let r=`g_${this.#e}_transfer_map_`+this.#G++,i=`url(#${r})`,s=(this.#$.set(t,i),this.#$.set(d,i),this.#ie(r));return this.#re(o,l,h,s),i}addHCMFilter(t,e){var r=t+"-"+e;if(this.#Jt!==r&&(this.#Jt=r,this.#Qt="none",this.#Yt?.remove(),t)&&e){let a=this.#se(t),n=(t=c.Util.makeHexColor(...a),this.#se(e));if(e=c.Util.makeHexColor(...n),this.#ne.style.color="",("#000000"!==t||"#ffffff"!==e)&&t!==e){var i=new Array(256);for(let e=0;e<=255;e++){let t=e/255;i[e]=t<=.03928?t/12.92:((.055+t)/1.055)**2.4}r=i.join(","),t=`g_${this.#e}_hcm_filter`,e=this.#Zt=this.#ie(t),r=(this.#re(r,r,r,e),this.#ae(e),(t,e)=>{var r=a[t]/255,i=n[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=r+t/e*(i-r);return s.join(",")});this.#re(r(0,5),r(1,5),r(2,5),e),this.#Qt=`url(#${t})`}}return this.#Qt}addHighlightHCMFilter(r,i,s,a){var n=r+`-${i}-${s}-`+a;if(this.#te!==n&&(this.#te=n,this.#ee="none",this.#Zt?.remove(),r)&&i){var[n,r]=[r,i].map(this.#se.bind(this));let l=Math.round(.2126*n[0]+.7152*n[1]+.0722*n[2]),h=Math.round(.2126*r[0]+.7152*r[1]+.0722*r[2]),[t,e]=[s,a].map(this.#se.bind(this));h<l&&([l,h,t,e]=[h,l,e,t]),this.#ne.style.color="";i=(t,e,r)=>{var i=new Array(256),s=(h-l)/r,a=t/255,n=(e-t)/(255*r);let o=0;for(let t=0;t<=r;t++){let e=Math.round(l+t*s),r=a+t*n;for(let t=o;t<=e;t++)i[t]=r;o=e+1}for(let t=o;t<256;t++)i[t]=i[o-1];return i.join(",")},n=`g_${this.#e}_hcm_highlight_filter`,r=this.#Zt=this.#ie(n);this.#ae(r),this.#re(i(t[0],e[0],5),i(t[1],e[1],5),i(t[2],e[2],5),r),this.#ee=`url(#${n})`}return this.#ee}destroy(){0<arguments.length&&void 0!==arguments[0]&&arguments[0]&&(this.#Qt||this.#ee)||(this.#Xt&&(this.#Xt.parentNode.parentNode.remove(),this.#Xt=null),this.#$t&&(this.#$t.clear(),this.#$t=null),this.#G=0)}#ae(t){var e=this.#Kt.createElementNS(a,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#ie(t){var e=this.#Kt.createElementNS(a,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#ne.append(e),e}#oe(t,e,r){e=this.#Kt.createElementNS(a,e);e.setAttribute("type","discrete"),e.setAttribute("tableValues",r),t.append(e)}#re(t,e,r,i){var s=this.#Kt.createElementNS(a,"feComponentTransfer");i.append(s),this.#oe(s,"feFuncR",t),this.#oe(s,"feFuncG",e),this.#oe(s,"feFuncB",r)}#se(t){return this.#ne.style.color=t,_(getComputedStyle(this.#ne).getPropertyValue("color"))}}e.DOMFilterFactory=n;class o extends i.BaseCanvasFactory{constructor(){var{ownerDocument:t=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){var r=this._document.createElement("canvas");return r.width=t,r.height=e,r}}async function l(i,t){let s=1<arguments.length&&void 0!==t&&t;if(m(i,document.baseURI)){t=await fetch(i);if(t.ok)return s?new Uint8Array(await t.arrayBuffer()):(0,c.stringToBytes)(await t.text());throw new Error(t.statusText)}return new Promise((e,t)=>{let r=new XMLHttpRequest;r.open("GET",i,!0),s&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(s&&r.response?t=new Uint8Array(r.response):!s&&r.responseText&&(t=(0,c.stringToBytes)(r.responseText)),t)return void e(t)}t(new Error(r.statusText))}},r.send(null)})}e.DOMCanvasFactory=o;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return l(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=h;class d extends i.BaseStandardFontDataFactory{_fetchData(t){return l(t,!0)}}e.DOMStandardFontDataFactory=d;class u extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS(a,t)}}e.DOMSVGFactory=u;class p{constructor(t){let{viewBox:e,scale:r,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:n=!1}=t;this.viewBox=e,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=a;var t=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,h,d,c,u,p,f,g;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,h=0,d=0,c=1;break;case 90:l=0,h=1,d=1,c=0;break;case 270:l=0,h=-1,d=-1,c=0;break;case 0:l=1,h=0,d=0,c=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(d=-d,c=-c),g=0===l?(u=Math.abs(o-e[1])*r+s,p=Math.abs(t-e[0])*r+a,f=(e[3]-e[1])*r,(e[2]-e[0])*r):(u=Math.abs(t-e[0])*r+s,p=Math.abs(o-e[1])*r+a,f=(e[2]-e[0])*r,(e[3]-e[1])*r),this.transform=[l*r,h*r,d*r,c*r,u-l*r*t-d*r*o,p-h*r*t-c*r*o],this.width=f,this.height=g}get rawDims(){var t=this.viewBox;return(0,c.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){var{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new p({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}convertToViewportPoint(t,e){return c.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){var e=c.Util.applyTransform([t[0],t[1]],this.transform),t=c.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],t[0],t[1]]}convertToPdfPoint(t,e){return c.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=p;class f extends c.BaseException{constructor(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function g(t){var e=t.length;let r=0;for(;r<e&&""===t[r].trim();)r++;return"data:"===t.substring(r,r+5).toLowerCase()}function m(t,e){try{var r=(e?new URL(t,e):new URL(t)).protocol;return"http:"===r||"https:"===r}catch{return!1}}e.RenderingCancelledException=f,e.StatTimer=class{started=Object.create(null);times=[];time(t){t in this.started&&(0,c.warn)("Timer is already running for "+t),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,c.warn)("Timer has not been started for "+t),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],e=0;for(let{name:t}of this.times)e=Math.max(t.length,e);for(var{name:r,start:i,end:s}of this.times)t.push(`${r.padEnd(e)} ${s-i}ms\n`);return t.join("")}};let v;function _(t){var e;return t.startsWith("#")?[(16711680&(e=parseInt(t.slice(1),16)))>>16,(65280&e)>>8,255&e]:t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):((0,c.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class{static toDateObject(t){if(!t||"string"!=typeof t)return null;t=(v||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(t);if(!t)return null;var e=parseInt(t[1],10),r=1<=(r=parseInt(t[2],10))&&r<=12?r-1:0,i=1<=(i=parseInt(t[3],10))&&i<=31?i:1;let s=parseInt(t[4],10),a=(s=0<=s&&s<=23?s:0,parseInt(t[5],10));a=0<=a&&a<=59?a:0;var n=0<=(n=parseInt(t[6],10))&&n<=59?n:0,o=t[7]||"Z",l=0<=(l=parseInt(t[8],10))&&l<=23?l:0,t=0<=(t=parseInt(t[9],10)||0)&&t<=59?t:0;return"-"===o?(s+=l,a+=t):"+"===o&&(s-=l,a-=t),new Date(Date.UTC(e,r,i,s,a,n))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0,r(2);var i=r(1);e.BaseFilterFactory=class s{constructor(){this.constructor===s&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,r,i){return"none"}destroy(){}};e.BaseCanvasFactory=class a{constructor(){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");return{canvas:t=this._createCanvas(t,e),context:t.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.BaseCMapReaderFactory=class n{constructor(t){var{baseUrl:t=null,isCompressed:e=!0}=t;this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch(t){if(t=t.name,!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":""),r=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(e,r).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: `+e)})}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseStandardFontDataFactory=class o{constructor(t){var{baseUrl:t=null}=t;this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(t){if(t=t.filename,!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");let e=""+this.baseUrl+t;return this._fetchData(e).catch(t=>{throw new Error("Unable to load font data at: "+e)})}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseSVGFactory=class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");var i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",t+"px"),i.setAttribute("height",e+"px")),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} `+e),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.")}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2);var u=r(1);let i=3285377520,p=4294901760,f=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:i,this.h2=t?4294967295&t:i}update(r){let i,s;if("string"==typeof r){i=new Uint8Array(2*r.length);for(let e=s=0,t=r.length;e<t;e++){let t=r.charCodeAt(e);t<=255?i[s++]=t:(i[s++]=t>>>8,i[s++]=255&t)}}else{if(!(0,u.isArrayBuffer)(r))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");i=r.slice(),s=i.byteLength}let e=s>>2,t=s-4*e,a=new Uint32Array(i.buffer,0,e),n=0,o,l=this.h1,h=this.h2;var d=3432918353,c=461845907;for(let t=0;t<e;t++)1&t?(n=(n=(n=(n=a[t])*d&p|11601*n&f)<<15|n>>>17)*c&p|13715*n&f,l=5*(l=(l^=n)<<13|l>>>19)+3864292196):(o=(o=(o=(o=a[t])*d&p|11601*o&f)<<15|o>>>17)*c&p|13715*o&f,h=5*(h=(h^=o)<<13|h>>>19)+3864292196);switch(n=0,t){case 3:n^=i[4*e+2]<<16;case 2:n^=i[4*e+1]<<8;case 1:n=(n=(n=(n^=i[4*e])*d&p|11601*n&f)<<15|n>>>17)*c&p|13715*n&f,1&e?l^=n:h^=n}this.h1=l,this.h2=h}hexdigest(){var t=this.h1,e=this.h2,t=3981806797*(t^=e>>>1)&p|36045*t&f;return t=444984403*(t^=(e=4283543511*e&p|(2950163797*(e<<16|t>>>16)&p)>>>16)>>>1)&p|60499*t&f,((t^=(e=3301882366*e&p|(3120437893*(e<<16|t>>>16)&p)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(89),r(149);var p=r(1);e.FontLoader=class{#le=new Set;constructor(t){var{ownerDocument:t=globalThis.document}=t;this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));var e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(var t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!this.#le.has(t.loadedName))if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){var{loadedName:e,src:r,style:i}=t,r=new FontFace(e,r,i);this.addNativeFontFace(r);try{await r.load(),this.#le.add(e)}catch{(0,p.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(r){if(!(r.attached||r.missingFile&&!r.systemFontInfo))if(r.attached=!0,r.systemFontInfo)await this.loadSystemFont(r.systemFontInfo);else if(this.isFontLoadingAPISupported){let e=r.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(t){throw(0,p.warn)(`Failed to load font '${e.family}': '${t}'.`),r.disableFontFace=!0,t}}}else{let t=r.createFontFaceRule();t&&(this.insertRule(t),this.isSyncFontLoadingSupported||await new Promise(t=>{t=this._queueLoadingCallback(t);this._prepareFontLoadEvent(r,t)}))}}get isFontLoadingAPISupported(){var t=!!this._document?.fonts;return(0,p.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(p.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){let e=this.loadingRequests,r={done:!1,complete:function(){for((0,p.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;0<e.length&&e[0].done;){var t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(r),r}get _loadTestFont(){var t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function i(t,e,r,i){return t.substring(0,e)+i+t.substring(e+r)}let s,a;var n=this._document.createElement("canvas");n.width=1,n.height=1;let o=n.getContext("2d"),l=0;var h="lt"+Date.now()+this.loadTestFontId++,d=1482184792;let c=r(n=i(this._loadTestFont,976,h.length,h),16);for(s=0,a=h.length-3;s<a;s+=4)c=c-d+r(h,s)|0;s<h.length&&(c=c-d+r(h+"XXX",s)|0),n=i(n,16,4,(0,p.string32)(c));n=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(n)});`}}`;this.insertRule(n);let u=this._document.createElement("div");u.style.visibility="hidden",u.style.width=u.style.height="10px",u.style.position="absolute",u.style.top=u.style.left="0px";for(let e of[t.loadedName,h]){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,u.append(t)}this._document.body.append(u),function t(e,r){30<++l?((0,p.warn)("Load test font never loaded."),r()):(o.font="30px "+e,o.fillText(".",0,20),0<o.getImageData(0,0,1,1).data[3]?r():setTimeout(t.bind(null,e,r)))}(h,()=>{u.remove(),e.complete()})}},e.FontFaceObject=class{constructor(e,t){var{isEvalSupported:t=!0,disableFontFace:r=!1,ignoreErrors:i=!1,inspectFont:s=null}=t;this.compiledGlyphs=Object.create(null);for(let t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===r,this.ignoreErrors=!0===i,this._inspectFont=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;var e;return t=this.cssFontInfo?(e={weight:this.cssFontInfo.fontWeight},this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),new FontFace(this.cssFontInfo.fontFamily,this.data,e)):new FontFace(this.loadedName,this.data,{}),this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var e=(0,p.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(this.ignoreErrors)return(0,p.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){};throw t}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){let r=[];for(let e of i){let t=void 0!==e.args?e.args.join(","):"";r.push("c.",e.cmd,"(",t,");\n")}return this.compiledGlyphs[e]=new Function("c","size",r.join(""))}return this.compiledGlyphs[e]=function(t,e){for(var r of i)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var i=r(169),r=r(1);if(!globalThis.DOMMatrix&&r.isNodeJS)try{globalThis.DOMMatrix=require("canvas").DOMMatrix}catch(t){(0,r.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${t}".`)}if(!globalThis.Path2D&&r.isNodeJS)try{var s=require("canvas").CanvasRenderingContext2D,a=require("path2d-polyfill").polyfillPath2D;globalThis.CanvasRenderingContext2D=s,a(globalThis)}catch(t){(0,r.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${t}".`)}function n(t){return new Promise((r,i)=>{require("fs").readFile(t,(t,e)=>{!t&&e?r(new Uint8Array(e)):i(new Error(t))})})}class o extends i.BaseFilterFactory{}e.NodeFilterFactory=o;class l extends i.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=l;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return n(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=h;class d extends i.BaseStandardFontDataFactory{_fetchData(t){return n(t)}}e.NodeStandardFontDataFactory=d},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var A=r(1),w=r(168),S=r(174),c=r(175);let u=4096;class h{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(var t in this.cache){var e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function v(l,h,d,c,u,p,f,g,m,v){var[_,b,y,A,S,x]=(0,w.getCurrentTransform)(l);if(0===b&&0===y){let t=f*_+S,e=Math.round(t),r=g*A+x,i=Math.round(r),s=(f+m)*_+S,a=Math.abs(Math.round(s)-e)||1,n=(g+v)*A+x,o=Math.abs(Math.round(n)-i)||1;l.setTransform(Math.sign(_),0,0,Math.sign(A),e,i),l.drawImage(h,d,c,u,p,0,0,a,o),void l.setTransform(_,b,y,A,S,x)}else if(0===_&&0===A){let t=g*y+S,e=Math.round(t),r=f*b+x,i=Math.round(r),s=(g+v)*y+S,a=Math.abs(Math.round(s)-e)||1,n=(f+m)*b+x,o=Math.abs(Math.round(n)-i)||1;l.setTransform(0,Math.sign(b),Math.sign(y),0,e,i),l.drawImage(h,d,c,u,p,0,0,o,a),void l.setTransform(_,b,y,A,S,x)}else l.drawImage(h,d,c,u,p,f,g,m,v),Math.hypot(_,b),Math.hypot(y,A)}class p{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=A.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=A.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=A.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){var t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,r){[e,r]=A.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){var r=A.Util.applyTransform(e,t),e=A.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,r[0],e[0]),this.minY=Math.min(this.minY,r[1],e[1]),this.maxX=Math.max(this.maxX,r[0],e[0]),this.maxY=Math.max(this.maxY,r[1],e[1])}updateScalingPathMinMax(t,e){A.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,r,i,s,a,n,o,l,h){e=A.Util.bezierBoundingBox(e,r,i,s,a,n,o,l);h?(h[0]=Math.min(h[0],e[0],e[2]),h[1]=Math.max(h[1],e[0],e[2]),h[2]=Math.min(h[2],e[1],e[3]),h[3]=Math.max(h[3],e[1],e[3])):this.updateRectMinMax(t,e)}getPathBoundingBox(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:S.PathType.FILL,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;var s=[this.minX,this.minY,this.maxX,this.maxY];if(t===S.PathType.STROKE){i||(0,A.unreachable)("Stroke bounding box must include transform.");let t=A.Util.singularValueDecompose2dScale(i),e=t[0]*this.lineWidth/2,r=t[1]*this.lineWidth/2;s[0]-=e,s[1]-=r,s[2]+=e,s[3]+=r}return s}updateClipFromPath(){var t=A.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:S.PathType.FILL;return A.Util.intersect(this.clipBox,this.getPathBoundingBox(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:null))}}function n(m,o){if("undefined"!=typeof ImageData&&o instanceof ImageData)m.putImageData(o,0,0);else{let t=o.height,c=o.width,e=t%16,r=(t-e)/16,i=0===e?r:r+1,s=m.createImageData(c,16),u,p=0;var v=o.data,_=s.data;let a,f,g,n;if(o.kind===A.ImageKind.GRAYSCALE_1BPP){let n=v.byteLength,o=new Uint32Array(_.buffer,0,_.byteLength>>2),t=o.length,l=c+7>>3,h=4294967295,d=A.FeatureTest.isLittleEndian?4278190080:255;for(a=0;a<i;a++){for(g=a<r?16:e,u=0,f=0;f<g;f++){let t=n-p,e=0,r=t>l?c:8*t-7,i=-8&r,s=0,a=0;for(;e<i;e+=8)a=v[p++],o[u++]=128&a?h:d,o[u++]=64&a?h:d,o[u++]=32&a?h:d,o[u++]=16&a?h:d,o[u++]=8&a?h:d,o[u++]=4&a?h:d,o[u++]=2&a?h:d,o[u++]=1&a?h:d;for(;e<r;e++)0===s&&(a=v[p++],s=128),o[u++]=a&s?h:d,s>>=1}for(;u<t;)o[u++]=0;m.putImageData(s,0,16*a)}}else if(o.kind===A.ImageKind.RGBA_32BPP){for(f=0,n=16*c*4,a=0;a<r;a++)_.set(v.subarray(p,p+n)),p+=n,m.putImageData(s,0,f),f+=16;a<i&&(n=c*e*4,_.set(v.subarray(p,p+n)),m.putImageData(s,0,f))}else{if(o.kind!==A.ImageKind.RGB_24BPP)throw new Error("bad image kind: "+o.kind);for(g=16,n=c*g,a=0;a<i;a++){for(a>=r&&(g=e,n=c*g),u=0,f=n;f--;)_[u++]=v[p++],_[u++]=v[p++],_[u++]=v[p++],_[u++]=255;m.putImageData(s,0,16*a)}}}}function _(l,e){if(e.bitmap)l.drawImage(e.bitmap,0,0);else{let t=e.height,r=e.width,i=t%16,s=(t-i)/16,a=0==i?s:1+s,n=l.createImageData(r,16),o=0;var h=e.data,d=n.data;for(let e=0;e<a;e++){let t=e<s?16:i;({srcPos:o}=(0,c.convertBlackAndWhiteToRGBA)({src:h,srcPos:o,dest:d,width:r,height:t,nonBlackColor:0})),l.putImageData(n,0,16*e)}}}function f(t,e){var r;for(r of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==t[r]&&(e[r]=t[r]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function g(t){var e;t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),A.isNodeJS||(e=t.filter,"none"!==e&&""!==e&&(t.filter="none"))}function P(r,i,s){let t=r.length;for(let e=3;e<t;e+=4){let t=s?s[r[e]]:r[e];i[e]=i[e]*t*.00392156862745098|0}}function k(r,i,s){let t=r.length;for(let e=3;e<t;e+=4){let t=77*r[e-3]+152*r[e-2]+28*r[e-1];i[e]=s?i[e]*s[t>>8]>>8:i[e]*t>>16}}function b(t,e){var t=A.Util.singularValueDecompose2dScale(t),r=(t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]),Math.fround((globalThis.devicePixelRatio||1)*w.PixelsPerInch.PDF_TO_CSS_UNITS));return void 0!==e?e:t[0]<=r||t[1]<=r}let i=["butt","round","square"],s=["miter","round","bevel"],a={},o={};class l{constructor(t,e,r,i,s,a,n,o){var{optionalContentConfig:a,markedContentStack:l=null}=a;this.ctx=t,this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=l||[],this.optionalContentConfig=a,this.cachedCanvases=new h(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=n,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}beginDrawing(t){var{transform:t,viewport:e,transparency:r=!1,background:i=null}=t,s=this.ctx.canvas.width,a=this.ctx.canvas.height,n=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,a),this.ctx.fillStyle=n,r){let t=this.cachedCanvases.getCanvas("transparent",s,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,w.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),g(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=(0,w.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,r,i){var s=t.argsArray,a=t.fnArray;let n=e||0;var o=s.length;if(o===n)return n;var l=10<o-n&&"function"==typeof r,h=l?Date.now()+15:0;let d=0;for(var c,u=this.commonObjs,p=this.objs;;){if(void 0!==i&&n===i.nextBreakPoint)return i.breakIt(n,r),n;if((c=a[n])!==A.OPS.dependency)this[c].apply(this,s[n]);else for(let e of s[n]){let t=e.startsWith("g_")?u:p;if(!t.has(e))return t.get(e,r),n}if(++n===o)return n;if(l&&10<++d){if(Date.now()>h)return r(),n;d=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#ce(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(var t of this._cachedBitmapsMap.values()){for(var e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#he()}#he(){var t,e;this.pageColors&&"none"!==(t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background))&&(e=this.ctx.filter,this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e)}_scaleImage(r,t){var e=r.width,i=r.height;let s,a,n=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=e,h=i,d="prescale1";for(;2<n&&1<l||2<o&&1<h;){let t=l,e=h;2<n&&1<l&&(t=16384<=l?Math.floor(l/2)-1||1:Math.ceil(l/2),n/=l/t),2<o&&1<h&&(e=16384<=h?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/e),s=this.cachedCanvases.getCanvas(d,t,e),(a=s.context).clearRect(0,0,t,e),a.drawImage(r,0,0,l,h,0,0,t,e),r=s.canvas,l=t,h=e,d="prescale1"===d?"prescale2":"prescale1"}return{img:r,paintWidth:l,paintHeight:h}}_createMaskCanvas(r){let t=this.ctx,{width:e,height:i}=r,s=this.current.fillColor,a=this.current.patternFill,n=(0,w.getCurrentTransform)(t),o,l,h,d;if((r.bitmap||r.data)&&1<r.count){let t=r.bitmap||r.data.buffer,e=(l=JSON.stringify(a?n:[n.slice(0,4),s]),(o=this._cachedBitmapsMap.get(t))||(o=new Map,this._cachedBitmapsMap.set(t,o)),o.get(l));if(e&&!a)return{canvas:e,offsetX:Math.round(Math.min(n[0],n[2])+n[4]),offsetY:Math.round(Math.min(n[1],n[3])+n[5])};h=e}h||_((d=this.cachedCanvases.getCanvas("maskCanvas",e,i)).context,r);var c=A.Util.transform(n,[1/e,0,0,-1/i,0,0]),c=A.Util.transform(c,[1,0,0,1,0,-i]),u=A.Util.applyTransform([0,0],c),p=A.Util.applyTransform([e,i],c),f=A.Util.normalizeRect([u[0],u[1],p[0],p[1]]),g=Math.round(f[2]-f[0])||1,f=Math.round(f[3]-f[1])||1,g=this.cachedCanvases.getCanvas("fillCanvas",g,f),f=g.context,m=Math.min(u[0],p[0]),u=Math.min(u[1],p[1]),p=(f.translate(-m,-u),f.transform(...c),h||(h=(h=this._scaleImage(d.canvas,(0,w.getCurrentTransformInverse)(f))).img,o&&a&&o.set(l,h)),f.imageSmoothingEnabled=b((0,w.getCurrentTransform)(f),r.interpolate),v(f,h,0,0,h.width,h.height,0,0,e,i),f.globalCompositeOperation="source-in",A.Util.transform((0,w.getCurrentTransformInverse)(f),[1,0,0,1,-m,-u]));return f.fillStyle=a?s.getPattern(t,this,p,S.PathType.FILL):s,f.fillRect(0,0,e,i),o&&!a&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,g.canvas)),{canvas:g.canvas,offsetX:Math.round(m),offsetY:Math.round(u)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=i[t]}setLineJoin(t){this.ctx.lineJoin=s[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(t),r.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(var[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[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){var 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");var t=this.ctx.canvas.width,e=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(r,t,e),t=(this.suspendedCtx=this.ctx,this.ctx=r.context,this.ctx),i=(t.setTransform(...(0,w.getCurrentTransform)(this.suspendedCtx)),f(this.suspendedCtx,t),t),n=this.suspendedCtx;if(i._removeMirroring)throw new Error("Context is already forwarding operations.");i.__originalSave=i.save,i.__originalRestore=i.restore,i.__originalRotate=i.rotate,i.__originalScale=i.scale,i.__originalTranslate=i.translate,i.__originalTransform=i.transform,i.__originalSetTransform=i.setTransform,i.__originalResetTransform=i.resetTransform,i.__originalClip=i.clip,i.__originalMoveTo=i.moveTo,i.__originalLineTo=i.lineTo,i.__originalBezierCurveTo=i.bezierCurveTo,i.__originalRect=i.rect,i.__originalClosePath=i.closePath,i.__originalBeginPath=i.beginPath,i._removeMirroring=()=>{i.save=i.__originalSave,i.restore=i.__originalRestore,i.rotate=i.__originalRotate,i.scale=i.__originalScale,i.translate=i.__originalTranslate,i.transform=i.__originalTransform,i.setTransform=i.__originalSetTransform,i.resetTransform=i.__originalResetTransform,i.clip=i.__originalClip,i.moveTo=i.__originalMoveTo,i.lineTo=i.__originalLineTo,i.bezierCurveTo=i.__originalBezierCurveTo,i.rect=i.__originalRect,i.closePath=i.__originalClosePath,i.beginPath=i.__originalBeginPath,delete i._removeMirroring},i.save=function(){n.save(),this.__originalSave()},i.restore=function(){n.restore(),this.__originalRestore()},i.translate=function(t,e){n.translate(t,e),this.__originalTranslate(t,e)},i.scale=function(t,e){n.scale(t,e),this.__originalScale(t,e)},i.transform=function(t,e,r,i,s,a){n.transform(t,e,r,i,s,a),this.__originalTransform(t,e,r,i,s,a)},i.setTransform=function(t,e,r,i,s,a){n.setTransform(t,e,r,i,s,a),this.__originalSetTransform(t,e,r,i,s,a)},i.resetTransform=function(){n.resetTransform(),this.__originalResetTransform()},i.rotate=function(t){n.rotate(t),this.__originalRotate(t)},i.clip=function(t){n.clip(t),this.__originalClip(t)},i.moveTo=function(t,e){n.moveTo(t,e),this.__originalMoveTo(t,e)},i.lineTo=function(t,e){n.lineTo(t,e),this.__originalLineTo(t,e)},i.bezierCurveTo=function(t,e,r,i,s,a){n.bezierCurveTo(t,e,r,i,s,a),this.__originalBezierCurveTo(t,e,r,i,s,a)},i.rect=function(t,e,r,i){n.rect(t,e,r,i),this.__originalRect(t,e,r,i)},i.closePath=function(){n.closePath(),this.__originalClosePath()},i.beginPath=function(){n.beginPath(),this.__originalBeginPath()},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(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(this.current.activeSMask){t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var e=this.current.activeSMask,r=this.suspendedCtx,i=this.ctx,s=(t=t)[0],a=t[1],n=t[2]-s,t=t[3]-a;if(0!=n&&0!=t){var o,l=e.context,h=i,d=n,c=t,n=e.subtype,u=e.backdrop,p=e.transferMap,f=s,g=a,m=e.offsetX,v=e.offsetY,_=!!u,b=_?u[0]:0,y=_?u[1]:0,A=_?u[2]:0,S="Luminosity"===n?k:P,x=Math.min(c,Math.ceil(1048576/d));for(let i=0;i<c;i+=x){let t=Math.min(x,c-i),e=l.getImageData(f-m,i+(g-v),d,t),r=h.getImageData(f,i+g,d,t);if(_){w=void 0;E=void 0;T=void 0;C=void 0;o=void 0;var w=e.data;var E=b;var T=y;var C=A;let t=w.length;for(let e=3;e<t;e+=4){let t=w[e];0===t?(w[e-3]=E,w[e-2]=T,w[e-1]=C):t<255&&(o=255-t,w[e-3]=w[e-3]*t+E*o>>8,w[e-2]=w[e-2]*t+T*o>>8,w[e-1]=w[e-1]*t+C*o>>8)}}S(e.data,r.data,p),h.putImageData(r,f,i+g)}r.save(),r.globalAlpha=1,r.globalCompositeOperation="source-over",r.setTransform(1,0,0,1,0,0),r.drawImage(i.canvas,0,0),r.restore()}this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}}save(){(this.inSMaskMode?(f(this.ctx,this.suspendedCtx),this.suspendedCtx):this.ctx).save();var t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),f(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,r,i,s,a){this.ctx.transform(t,e,r,i,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(r,a,t){var n=this.ctx,o=this.current;let l,h,d=o.x,c=o.y;var u=(0,w.getCurrentTransform)(n),p=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],f=p?t.slice(0):null;for(let t=0,s=0,e=r.length;t<e;t++)switch(0|r[t]){case A.OPS.rectangle:d=a[s++],c=a[s++];let t=a[s++],e=a[s++],r=d+t,i=c+e;n.moveTo(d,c),0===t||0===e?n.lineTo(r,i):(n.lineTo(r,c),n.lineTo(r,i),n.lineTo(d,i)),p||o.updateRectMinMax(u,[d,c,r,i]),n.closePath();break;case A.OPS.moveTo:d=a[s++],c=a[s++],n.moveTo(d,c),p||o.updatePathMinMax(u,d,c);break;case A.OPS.lineTo:d=a[s++],c=a[s++],n.lineTo(d,c),p||o.updatePathMinMax(u,d,c);break;case A.OPS.curveTo:l=d,h=c,d=a[s+4],c=a[s+5],n.bezierCurveTo(a[s],a[s+1],a[s+2],a[s+3],d,c),o.updateCurvePathMinMax(u,l,h,a[s],a[s+1],a[s+2],a[s+3],d,c,f),s+=6;break;case A.OPS.curveTo2:l=d,h=c,n.bezierCurveTo(d,c,a[s],a[s+1],a[s+2],a[s+3]),o.updateCurvePathMinMax(u,l,h,d,c,a[s],a[s+1],a[s+2],a[s+3],f),d=a[s+2],c=a[s+3],s+=4;break;case A.OPS.curveTo3:l=d,h=c,d=a[s+2],c=a[s+3],n.bezierCurveTo(a[s],a[s+1],d,c,d,c),o.updateCurvePathMinMax(u,l,h,a[s],a[s+1],d,c,d,c,f),s+=4;break;case A.OPS.closePath:n.closePath()}p&&o.updateScalingPathMinMax(u,f),o.setCurrentPoint(d,c)}closePath(){this.ctx.closePath()}stroke(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=this.ctx,r=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof r&&r?.getPattern?(e.save(),e.strokeStyle=r.getPattern(e,this,(0,w.getCurrentTransformInverse)(e),S.PathType.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=this.ctx,r=this.current.fillColor;let i=!1;this.current.patternFill&&(e.save(),e.fillStyle=r.getPattern(e,this,(0,w.getCurrentTransformInverse)(e),S.PathType.FILL),i=!0);r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),i&&e.restore(),t&&this.consumePath(r)}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=a}eoClip(){this.pendingClip=o}beginText(){this.current.textMatrix=A.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){var t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(var r of t)e.setTransform(...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(r,i){var s=this.commonObjs.get(r),a=this.current;if(!s)throw new Error("Can't find font for "+r);if(a.fontMatrix=s.fontMatrix||A.FONT_IDENTITY_MATRIX,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||(0,A.warn)("Invalid font matrix for font "+r),i<0?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=s,this.current.fontSize=i,!s.isType3Font){r=s.systemFontInfo?.css||`"${s.loadedName||"sans-serif"}", `+s.fallbackName;let t="normal";s.black?t="900":s.bold&&(t="bold");a=s.italic?"italic":"normal";let e=i;i<16?e=16:100<i&&(e=100),this.current.fontSizeScale=i/e,this.ctx.font=a+` ${t} ${e}px `+r}}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,s,a){this.current.textMatrix=[t,e,r,i,s,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,i){var s=this.ctx,a=this.current,n=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,h=o&A.TextRenderingMode.FILL_STROKE_MASK,o=!!(o&A.TextRenderingMode.ADD_TO_PATH_FLAG),a=a.patternFill&&!n.missingFile;let d;(n.disableFontFace||o||a)&&(d=n.getPathGenerator(this.commonObjs,t)),n.disableFontFace||a?(s.save(),s.translate(e,r),s.beginPath(),d(s,l),i&&s.setTransform(...i),h!==A.TextRenderingMode.FILL&&h!==A.TextRenderingMode.FILL_STROKE||s.fill(),h!==A.TextRenderingMode.STROKE&&h!==A.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(h!==A.TextRenderingMode.FILL&&h!==A.TextRenderingMode.FILL_STROKE||s.fillText(t,e,r),h!==A.TextRenderingMode.STROKE&&h!==A.TextRenderingMode.FILL_STROKE||s.strokeText(t,e,r)),o&&(this.pendingTextPaths||=[]).push({transform:(0,w.getCurrentTransform)(s),x:e,y:r,fontSize:l,addToPath:d})}get isFontSubpixelAAEnabled(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context,e=(t.scale(1.5,1),t.fillText("I",0,10),t.getImageData(0,0,10,10).data);let r=!1;for(let t=3;t<e.length;t+=4)if(0<e[t]&&e[t]<255){r=!0;break}return(0,A.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(n){let o=this.current,b=o.font;if(b.isType3Font)return this.showType3Text(n);var y=o.fontSize;if(0!==y){let d=this.ctx,c=o.fontSizeScale,e=o.charSpacing,u=o.wordSpacing,p=o.fontDirection,i=o.textHScale*p,r=n.length,f=b.vertical,s=f?1:-1,g=b.defaultVMetrics,m=y*o.fontMatrix[0],v=o.textRenderingMode===A.TextRenderingMode.FILL&&!b.disableFontFace&&!o.patternFill;d.save(),d.transform(...o.textMatrix),d.translate(o.x,o.y+o.textRise),0<p?d.scale(i,-1):d.scale(i,1);let _;if(o.patternFill){d.save();let t=o.fillColor.getPattern(d,this,(0,w.getCurrentTransformInverse)(d),S.PathType.FILL);_=(0,w.getCurrentTransform)(d),d.restore(),d.fillStyle=t}let a=o.lineWidth;var t=o.textMatrixScale;if(0===t||0===a){let t=o.textRenderingMode&A.TextRenderingMode.FILL_STROKE_MASK;t!==A.TextRenderingMode.STROKE&&t!==A.TextRenderingMode.FILL_STROKE||(a=this.getSinglePixelWidth())}else a/=t;if(1!==c&&(d.scale(c,c),a/=c),d.lineWidth=a,b.isInvalidPDFjsFont){let e=[],r=0;for(let t of n)e.push(t.unicode),r+=t.width;d.fillText(e.join(""),0,0),o.x+=r*m*i,d.restore(),void this.compose()}else{let t,h=0;for(t=0;t<r;++t){let l=n[t];if("number"==typeof l)h+=s*l*y/1e3;else{let r=!1,t=(l.isSpace?u:0)+e,i=l.fontChar,s=l.accent,a,n,o=l.width;if(f){let t=l.vmetric||g,e=-(l.vmetric?t[1]:.5*o)*m,r=t[2]*m;o=t?-t[0]:o,a=e/c,n=(h+r)/c}else a=h/c,n=0;if(b.remeasure&&0<o){let e=1e3*d.measureText(i).width/y*c;if(o<e&&this.isFontSubpixelAAEnabled){let t=o/e;r=!0,d.save(),d.scale(t,1),a/=t}else o!==e&&(a+=(o-e)/2e3*y/c)}if(this.contentVisible&&(l.isInFont||b.missingFile))if(v&&!s)d.fillText(i,a,n);else if(this.paintChar(i,a,n,_),s){let t=a+y*s.offset.x/c,e=n-y*s.offset.y/c;this.paintChar(s.fontChar,t,e,_)}h+=f?o*m-t*p:o*m+t*p,r&&d.restore()}}f?o.y-=h:o.x+=h*i,d.restore(),this.compose()}}}showType3Text(t){let r=this.ctx,i=this.current,s=i.font,a=i.fontSize,e=i.fontDirection,n=s.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,h=i.textHScale*e,d=i.fontMatrix||A.FONT_IDENTITY_MATRIX,c=t.length,u,p,f,g;if(i.textRenderingMode!==A.TextRenderingMode.INVISIBLE&&0!==a){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),r.transform(...i.textMatrix),r.translate(i.x,i.y),r.scale(h,e),u=0;u<c;++u)if("number"==typeof(p=t[u]))this.ctx.translate(g=n*p*a/1e3,0),i.x+=g*h;else{let t=(p.isSpace?l:0)+o,e=s.charProcOperatorList[p.operatorListId];e?(this.contentVisible&&(this.processingType3=p,this.save(),r.scale(a,a),r.transform(...d),this.executeOperatorList(e),this.restore()),f=A.Util.applyTransform([p.width,0],d)[0]*a+t,r.translate(f,0),i.x+=f*h):(0,A.warn)(`Type3 character "${p.operatorListId}" is not available.`)}r.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,r,i,s,a){this.ctx.rect(r,i,s-r,a-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;var r,i;return e="TilingPattern"===t[0]?(r=t[1],i=this.baseTransform||(0,w.getCurrentTransform)(this.ctx),new S.TilingPattern(t,r,this.ctx,{createCanvasGraphics:t=>new l(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},i)):this._getPattern(t[1],t[2])}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,r){t=A.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=t,this.current.strokeColor=t}setFillRGBColor(t,e,r){t=A.Util.makeHexColor(t,e,r);this.ctx.fillStyle=t,this.current.fillColor=t,this.current.patternFill=!1}_getPattern(t){let e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,S.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,e)),r&&(e.matrix=r),e}shadingFill(e){if(this.contentVisible){var n=this.ctx;this.save();let t=this._getPattern(e);n.fillStyle=t.getPattern(n,this,(0,w.getCurrentTransformInverse)(n),S.PathType.SHADING);var o=(0,w.getCurrentTransformInverse)(n);if(o){let{width:t,height:e}=n.canvas,[r,i,s,a]=A.Util.getAxialAlignedBoundingBox([0,0,t,e],o);this.ctx.fillRect(r,i,s-r,a-i)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}}beginInlineImage(){(0,A.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,A.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,r){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,w.getCurrentTransform)(this.ctx),r)){let t=r[2]-r[0],e=r[3]-r[1];this.ctx.rect(r[0],r[1],t,e),this.current.updateRectMinMax((0,w.getCurrentTransform)(this.ctx),r),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(a){if(this.contentVisible){this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);var n=this.ctx,o=(a.isolated||(0,A.info)("TODO: Support non-isolated groups."),a.knockout&&(0,A.warn)("Knockout groups not supported."),(0,w.getCurrentTransform)(n));if(a.matrix&&n.transform(...a.matrix),!a.bbox)throw new Error("Bounding box is required.");var l=A.Util.getAxialAlignedBoundingBox(a.bbox,(0,w.getCurrentTransform)(n)),h=[0,0,n.canvas.width,n.canvas.height],l=A.Util.intersect(l,h)||[0,0,0,0],h=Math.floor(l[0]),d=Math.floor(l[1]);let t=Math.max(Math.ceil(l[2])-h,1),e=Math.max(Math.ceil(l[3])-d,1),r=1,i=1,s=(t>u&&(r=t/u,t=u),e>u&&(i=e/u,e=u),this.current.startNewPathAndClipBox([0,0,t,e]),"groupAt"+this.groupLevel);a.smask&&(s+="_smask_"+this.smaskCounter++%2);var l=this.cachedCanvases.getCanvas(s,t,e),c=l.context;c.scale(1/r,1/i),c.translate(-h,-d),c.transform(...o),a.smask?this.smaskStack.push({canvas:l.canvas,context:c,offsetX:h,offsetY:d,scaleX:r,scaleY:i,subtype:a.smask.subtype,backdrop:a.smask.backdrop,transferMap:a.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(h,d),n.scale(r,i),n.save()),f(n,c),this.ctx=c,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}}endGroup(e){if(this.contentVisible){this.groupLevel--;let r=this.ctx,t=this.groupStack.pop();if(this.ctx=t,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=(0,w.getCurrentTransform)(this.ctx),e=(this.restore(),this.ctx.save(),this.ctx.setTransform(...t),A.Util.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],t));this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(e)}}}beginAnnotation(o,l,h,t,e){if(this.#ce(),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(l)&&4===l.length){let a=l[2]-l[0],n=l[3]-l[1];if(e&&this.annotationCanvasMap){(h=h.slice())[4]-=l[0],h[5]-=l[1],(l=l.slice())[0]=l[1]=0,l[2]=a,l[3]=n;let[t,e]=A.Util.singularValueDecompose2dScale((0,w.getCurrentTransform)(this.ctx)),r=this.viewportScale,i=Math.ceil(a*this.outputScaleX*r),s=Math.ceil(n*this.outputScaleY*r);this.annotationCanvas=this.canvasFactory.create(i,s);var{canvas:d,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(o,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(t,0,0,-e,0,n*e),g(this.ctx)}else g(this.ctx),this.ctx.rect(l[0],l[1],a,n),this.ctx.clip(),this.endPath()}this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...h),this.transform(...t)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#he(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){var e,r;this.contentVisible&&(e=t.count,(t=this.getObject(t.data,t)).count=e,e=this.ctx,(r=this.processingType3)&&(void 0===r.compiled&&(r.compiled=(t=>{let{width:e,height:r}=t;if(1e3<e||1e3<r)return null;let i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1,a,n,o,l=new Uint8Array(s*(r+1));var h=e+7&-8;let d=new Uint8Array(h*r),c=0;for(let e of t.data){let t=128;for(;0<t;)d[c++]=e&t?0:255,t>>=1}let u=0;for((c=0)!==d[c]&&(l[0]=1,++u),n=1;n<e;n++)d[c]!==d[c+1]&&(l[n]=d[c]?2:1,++u),c++;for(0!==d[c]&&(l[n]=2,++u),a=1;a<r;a++){c=a*h,o=a*s,d[c-h]!==d[c]&&(l[o]=d[c]?1:8,++u);let t=(d[c]?4:0)+(d[c-h]?8:0);for(n=1;n<e;n++)t=(t>>2)+(d[c+1]?4:0)+(d[c-h+1]?8:0),i[t]&&(l[o+n]=i[t],++u),c++;if(d[c-h]!==d[c]&&(l[o+n]=d[c]?2:4,++u),1e3<u)return null}for(c=h*(r-1),o=a*s,0!==d[c]&&(l[o]=8,++u),n=1;n<e;n++)d[c]!==d[c+1]&&(l[o+n]=d[c]?4:8,++u),c++;if(0!==d[c]&&(l[o+n]=4,++u),1e3<u)return null;let p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=r;a++){let i=a*s,t=i+e;for(;i<t&&!l[i];)i++;if(i!==t){f.moveTo(i%s,a);let t=i,r=l[i];do{let t=p[r];for(;i+=t,!l[i];);let e=l[i];5!==e&&10!==e?(r=e,l[i]=0):(r=e&51*r>>4,l[i]&=r>>2|r<<2),f.lineTo(i%s,i/s|0),l[i]||--u}while(t!==i);--a}}return d=null,l=null,function(t){t.save(),t.scale(1/e,-1/r),t.translate(0,-r),t.fill(f),t.beginPath(),t.restore()}})(t)),r.compiled)?r.compiled(e):(t=(r=this._createMaskCanvas(t)).canvas,e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(t,r.offsetX,r.offsetY),e.restore(),this.compose()))}paintImageMaskXObjectRepeat(t,s){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,o=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0;if(this.contentVisible){t=this.getObject(t.data,t);var h=this.ctx,d=(h.save(),(0,w.getCurrentTransform)(h)),c=(h.transform(s,a,n,o,0,0),this._createMaskCanvas(t));h.setTransform(1,0,0,1,c.offsetX-d[4],c.offsetY-d[5]);for(let i=0,t=l.length;i<t;i+=2){let t=A.Util.transform(d,[s,a,n,o,l[i],l[i+1]]),[e,r]=A.Util.applyTransform([0,0],t);h.drawImage(c.canvas,e,r)}h.restore(),this.compose()}}paintImageMaskXObjectGroup(t){if(this.contentVisible){var n,o=this.ctx,l=this.current.fillColor,h=this.current.patternFill;for(n of t){let{data:t,width:e,height:r,transform:i}=n,s=this.cachedCanvases.getCanvas("maskCanvas",e,r),a=s.context;a.save(),_(a,this.getObject(t,n)),a.globalCompositeOperation="source-in",a.fillStyle=h?l.getPattern(a,this,(0,w.getCurrentTransformInverse)(o),S.PathType.FILL):l,a.fillRect(0,0,e,r),a.restore(),o.save(),o.transform(...i),o.scale(1,-1),v(o,s.canvas,0,0,e,r,0,-1,1,1),o.restore()}this.compose()}}paintImageXObject(t){this.contentVisible&&((t=this.getObject(t))?this.paintInlineImageXObject(t):(0,A.warn)("Dependent image isn't ready yet"))}paintImageXObjectRepeat(t,r,i,s){if(this.contentVisible){t=this.getObject(t);if(t){var a=t.width,n=t.height,o=[];for(let t=0,e=s.length;t<e;t+=2)o.push({transform:[r,0,0,i,s[t],s[t+1]],x:0,y:0,w:a,h:n});this.paintInlineImageXObjectGroup(t,o)}else(0,A.warn)("Dependent image isn't ready yet")}}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){var e,r;return"none"===this.current.transferMaps?t.bitmap:({bitmap:t,width:e,height:r}=t,(r=(e=this.cachedCanvases.getCanvas("inlineImage",e,r)).context).filter=this.current.transferMaps,r.drawImage(t,0,0),r.filter="none",e.canvas)}paintInlineImageXObject(r){if(this.contentVisible){var i=r.width,s=r.height,a=this.ctx;if(this.save(),!A.isNodeJS){let t=a.filter;"none"!==t&&""!==t&&(a.filter="none")}a.scale(1/i,-1/s);let e;if(r.bitmap)e=this.applyTransferMapsToBitmap(r);else if("function"==typeof HTMLElement&&r instanceof HTMLElement||!r.data)e=r;else{let t=this.cachedCanvases.getCanvas("inlineImage",i,s).context;n(t,r),e=this.applyTransferMapsToCanvas(t)}var t=this._scaleImage(e,(0,w.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=b((0,w.getCurrentTransform)(a),r.interpolate),v(a,t.img,0,0,t.paintWidth,t.paintHeight,0,-s,i,s),this.compose(),this.restore()}}paintInlineImageXObjectGroup(s,r){if(this.contentVisible){let e=this.ctx,i;if(s.bitmap)i=s.bitmap;else{let t=s.width,e=s.height,r=this.cachedCanvases.getCanvas("inlineImage",t,e).context;n(r,s),i=this.applyTransferMapsToCanvas(r)}for(let t of r)e.save(),e.transform(...t.transform),e.scale(1,-1),v(e,i,t.x,t.y,t.w,t.h,0,-1,1,1),e.restore();this.compose()}}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){var e=this.current.isEmptyClip(),t=(this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t),this.ctx);this.pendingClip&&(e||(this.pendingClip===o?t.clip("evenodd"):t.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),t.beginPath()}getSinglePixelWidth(){var t,e,r;return this._cachedGetSinglePixelWidth||(0===(r=(0,w.getCurrentTransform)(this.ctx))[1]&&0===r[2]?this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(r[0]),Math.abs(r[3])):(t=Math.abs(r[0]*r[3]-r[2]*r[1]),e=Math.hypot(r[0],r[2]),r=Math.hypot(r[1],r[3]),this._cachedGetSinglePixelWidth=Math.max(e,r)/t)),this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){var r,i,s,a=this.current.lineWidth,{a:n,b:o,c:l,d:h}=this.ctx.getTransform();let t,e;0===o&&0===l?(s=Math.abs(n))===(r=Math.abs(h))?t=e=0===a?1/s:(i=s*a)<1?1/i:1:e=0===a?(t=1/s,1/r):(i=s*a,s=r*a,t=i<1?1/i:1,s<1?1/s:1):(r=Math.abs(n*h-o*l),i=Math.hypot(n,o),s=Math.hypot(l,h),e=0===a?(t=s/r,i/r):(n=a*r,t=n<s?s/n:1,n<i?i/n:1)),this._cachedScaleForStroking[0]=t,this._cachedScaleForStroking[1]=e}return this._cachedScaleForStroking}rescaleAndStroke(t){var r=this.ctx,i=this.current.lineWidth,[s,a]=this.getScaleForStroking();if(r.lineWidth=i||1,1===s&&1===a)r.stroke();else{i=r.getLineDash();if(t&&r.save(),r.scale(s,a),0<i.length){let e=Math.max(s,a);r.setLineDash(i.map(t=>t/e)),r.lineDashOffset/=e}r.stroke(),t&&r.restore()}}isContentVisible(){for(let t=this.markedContentStack.length-1;0<=t;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=l;for(let t in A.OPS)void 0!==l.prototype[t]&&(l.prototype[A.OPS[t]]=l.prototype[t])},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new s(t);case"Mesh":return new a(t);case"Dummy":return new n}throw new Error("Unknown IR type: "+t[0])},r(2);var v=r(1),_=r(168);let d={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function c(t,e){var r,i,s;e&&(r=e[2]-e[0],i=e[3]-e[1],(s=new Path2D).rect(e[0],e[1],r,i),t.clip(s))}e.PathType=d;class i{constructor(){this.constructor===i&&(0,v.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,v.unreachable)("Abstract method `getPattern` called.")}}class s extends i{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(let t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(a,n,o,l){let h;if(l===d.STROKE||l===d.FILL){let t=n.current.getClippedPathBoundingBox(l,(0,_.getCurrentTransform)(a))||[0,0,0,0],e=Math.ceil(t[2]-t[0])||1,r=Math.ceil(t[3]-t[1])||1,i=n.cachedCanvases.getCanvas("pattern",e,r,!0),s=i.context;s.clearRect(0,0,s.canvas.width,s.canvas.height),s.beginPath(),s.rect(0,0,s.canvas.width,s.canvas.height),s.translate(-t[0],-t[1]),o=v.Util.transform(o,[1,0,0,1,t[0],t[1]]),s.transform(...n.baseTransform),this.matrix&&s.transform(...this.matrix),c(s,this._bbox),s.fillStyle=this._createGradient(s),s.fill(),h=a.createPattern(i.canvas,"no-repeat");l=new DOMMatrix(o);h.setTransform(l)}else c(a,this._bbox),h=this._createGradient(a);return h}}function b(t,e,r,i,s,a,f,g){var n=e.coords,m=e.colors,v=t.data,_=4*t.width;let o;n[r+1]>n[i+1]&&(o=r,r=i,i=o,o=a,a=f,f=o),n[s+1]<n[i+1]&&(o=i,i=s,s=o,o=f,f=g,g=o),n[i+1]<n[r+1]&&(o=r,r=i,i=o,o=a,a=f,f=o);var b=(n[r]+e.offsetX)*e.scaleX,y=(n[r+1]+e.offsetY)*e.scaleY,A=(n[i]+e.offsetX)*e.scaleX,S=(n[i+1]+e.offsetY)*e.scaleY,x=(n[s]+e.offsetX)*e.scaleX,w=(n[s+1]+e.offsetY)*e.scaleY;if(!(w<=y)){var E=m[a],T=m[a+1],C=m[a+2],P=m[f],k=m[f+1],M=m[f+2],R=m[g],F=m[g+1],D=m[g+2],t=Math.round(y),I=Math.round(w);let n,o,l,h,d,c,u,p;for(let a=t;a<=I;a++){if(a<S){let t=a<y?0:(y-a)/(y-S);n=b-(b-A)*t,o=E-(E-P)*t,l=T-(T-k)*t,h=C-(C-M)*t}else{var O=a>w?1:S==w?0:(S-a)/(S-w);n=A-(A-x)*O,o=P-(P-R)*O,l=k-(k-F)*O,h=M-(M-D)*O}let e,r=(d=b-(b-x)*(e=a<y?0:a>w?1:(y-a)/(y-w)),c=E-(E-R)*e,u=T-(T-F)*e,p=C-(C-D)*e,Math.round(Math.min(n,d))),i=Math.round(Math.max(n,d)),s=_*a+4*r;for(let t=r;t<=i;t++)(e=(n-t)/(n-d))<0?e=0:1<e&&(e=1),v[s++]=o-(o-c)*e|0,v[s++]=l-(l-u)*e|0,v[s++]=h-(h-p)*e|0,v[s++]=255}}}class a extends i{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,i,e){var r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,n=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),t=Math.min(Math.ceil(Math.abs(n*t[1]*1.1)),3e3),a=a/o,n=n/t,l={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-s,scaleX:1/a,scaleY:1/n},e=e.getCanvas("mesh",o+4,t+4,!1),h=e.context,d=h.createImageData(o,t);if(i){let r=d.data;for(let t=0,e=r.length;t<e;t+=4)r[t]=i[0],r[t+1]=i[1],r[t+2]=i[2],r[t+3]=255}for(let r of this._figures){c=void 0;u=void 0;p=void 0;f=void 0;g=void 0;m=void 0;v=void 0;_=void 0;var c=d;var u=r;var p=l;var f=u.coords,g=u.colors;let t,e;switch(u.type){case"lattice":var m=u.verticesPerRow,v=Math.floor(f.length/m)-1,_=m-1;for(t=0;t<v;t++){let e=t*m;for(let t=0;t<_;t++,e++)b(c,p,f[e],f[e+1],f[e+m],g[e],g[e+1],g[e+m]),b(c,p,f[e+m+1],f[e+1],f[e+m],g[e+m+1],g[e+1],g[e+m])}break;case"triangles":for(t=0,e=f.length;t<e;t+=3)b(c,p,f[t],f[t+1],f[t+2],g[t],g[t+1],g[t+2]);break;default:throw new Error("illegal figure")}}return h.putImageData(d,2,2),{canvas:e.canvas,offsetX:r-2*a,offsetY:s-2*n,scaleX:a,scaleY:n}}getPattern(t,e,r,i){c(t,this._bbox);let s;if(i===d.SHADING)s=v.Util.singularValueDecompose2dScale((0,_.getCurrentTransform)(t));else if(s=v.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){let t=v.Util.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}var a=this._createMeshCanvas(s,i===d.SHADING?null:this._background,e.cachedCanvases);return i!==d.SHADING&&(t.setTransform(...e.baseTransform),this.matrix)&&t.transform(...this.matrix),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class n extends i{getPattern(){return"hotpink"}}e.TilingPattern=class o{static MAX_PATTERN_SIZE=3e3;constructor(t,e,r,i,s){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=s}createPatternCanvas(t){var e=this.operatorList,r=this.bbox,i=this.xstep,s=this.ystep,a=this.paintType,n=this.tilingType,o=this.color,l=this.canvasGraphicsFactory,n=((0,v.info)("TilingType: "+n),r[0]),h=r[1],d=r[2],r=r[3],c=v.Util.singularValueDecompose2dScale(this.matrix),u=v.Util.singularValueDecompose2dScale(this.baseTransform),c=[c[0]*u[0],c[1]*u[1]],u=this.getSizeAndScale(i,this.ctx.canvas.width,c[0]),i=this.getSizeAndScale(s,this.ctx.canvas.height,c[1]),c=(s=t.cachedCanvases.getCanvas("pattern",u.size,i.size,!0)).context;(l=l.createCanvasGraphics(c)).groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(l,a,o);let p=n,f=h,g=d,m=r;return n<0&&(p=0,g+=Math.abs(n)),h<0&&(f=0,m+=Math.abs(h)),c.translate(-u.scale*p,-i.scale*f),l.transform(u.scale,0,0,i.scale,0,0),c.save(),this.clipBbox(l,p,f,g,m),l.baseTransform=(0,_.getCurrentTransform)(l.ctx),l.executeOperatorList(e),l.endDrawing(),{canvas:s.canvas,scaleX:u.scale,scaleY:i.scale,offsetX:p,offsetY:f}}getSizeAndScale(t,e,r){t=Math.abs(t),e=Math.max(o.MAX_PATTERN_SIZE,e);let i=Math.ceil(t*r);return i>=e?i=e:r=i/t,{scale:r,size:i}}clipBbox(t,e,r,i,s){t.ctx.rect(e,r,i-e,s-r),t.current.updateRectMinMax((0,_.getCurrentTransform)(t.ctx),[e,r,i,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){var i=t.ctx,s=t.current;switch(e){case 1:let t=this.ctx;i.fillStyle=t.fillStyle,i.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case 2:var a=v.Util.makeHexColor(r[0],r[1],r[2]);i.fillStyle=a,i.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new v.FormatError("Unsupported paint type: "+e)}}getPattern(t,e,r,i){let s=r,a=(i!==d.SHADING&&(s=v.Util.transform(s,e.baseTransform),this.matrix)&&(s=v.Util.transform(s,this.matrix)),r=this.createPatternCanvas(e),new DOMMatrix(s));return a=(a=a.translate(r.offsetX,r.offsetY)).scale(1/r.scaleX,1/r.scaleY),(i=t.createPattern(r.canvas,"repeat")).setTransform(a),i}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=i,e.convertToRGBA=function(e){switch(e.kind){case f.ImageKind.GRAYSCALE_1BPP:return i(e);case f.ImageKind.RGB_24BPP:{var n=e;let{src:r,srcPos:t=0,dest:i,destPos:s=0}=n,a=0;var o=r.length>>2,l=new Uint32Array(r.buffer,t,o);if(f.FeatureTest.isLittleEndian){for(;a<o-2;a+=3,s+=4){let t=l[a],e=l[a+1],r=l[a+2];i[s]=4278190080|t,i[s+1]=t>>>24|e<<8|4278190080,i[s+2]=e>>>16|r<<16|4278190080,i[s+3]=r>>>8|4278190080}for(let t=4*a,e=r.length;t<e;t+=3)i[s++]=r[t]|r[t+1]<<8|r[t+2]<<16|4278190080}else{for(;a<o-2;a+=3,s+=4){let t=l[a],e=l[a+1],r=l[a+2];i[s]=255|t,i[s+1]=t<<24|e>>>8|255,i[s+2]=e<<16|r>>>16|255,i[s+3]=r<<8|255}for(let t=4*a,e=r.length;t<e;t+=3)i[s++]=r[t]<<24|r[t+1]<<16|r[t+2]<<8|255}return{srcPos:t,destPos:s};return}}return null},e.grayToRGBA=function(r,i){if(f.FeatureTest.isLittleEndian)for(let t=0,e=r.length;t<e;t++)i[t]=65793*r[t]|4278190080;else for(let t=0,e=r.length;t<e;t++)i[t]=16843008*r[t]|255},r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var f=r(1);function i(t){let{src:r,srcPos:i=0,dest:s,width:e,height:a,nonBlackColor:n=4294967295,inverseDecode:o=!1}=t;var t=f.FeatureTest.isLittleEndian?4278190080:255,[l,h]=o?[n,t]:[t,n],d=e>>3,c=7&e,u=r.length;s=new Uint32Array(s.buffer);let p=0;for(let t=0;t<a;t++){for(let t=i+d;i<t;i++){let t=i<u?r[i]:255;s[p++]=128&t?h:l,s[p++]=64&t?h:l,s[p++]=32&t?h:l,s[p++]=16&t?h:l,s[p++]=8&t?h:l,s[p++]=4&t?h:l,s[p++]=2&t?h:l,s[p++]=1&t?h:l}if(0!=c){let e=i<u?r[i++]:255;for(let t=0;t<c;t++)s[p++]=e&1<<7-t?h:l}}return{srcPos:i,destPos:p}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;var r=Object.create(null);(e.GlobalWorkerOptions=r).workerPort=null,r.workerSrc=""},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0,r(2);var h=r(1);function d(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,h.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new h.AbortException(t.message);case"MissingPDFException":return new h.MissingPDFException(t.message);case"PasswordException":return new h.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new h.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new h.UnknownErrorException(t.message,t.details);default:return new h.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class{constructor(t,e,a){this.sourceName=t,this.targetName=e,this.comObj=a,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{let s=t.data;if(s.targetName===this.sourceName)if(s.stream)this.#de(s);else if(s.callback){let t=s.callbackId,e=this.callbackCapabilities[t];if(!e)throw new Error("Cannot resolve callback "+t);if(delete this.callbackCapabilities[t],1===s.callback)e.resolve(s.data);else{if(2!==s.callback)throw new Error("Unexpected callback case");e.reject(d(s.reason))}}else{let i=this.actionHandler[s.action];if(!i)throw new Error("Unknown action from worker: "+s.action);if(s.callbackId){let e=this.sourceName,r=s.sourceName;new Promise(function(t){t(i(s.data))}).then(function(t){a.postMessage({sourceName:e,targetName:r,callback:1,callbackId:s.callbackId,data:t})},function(t){a.postMessage({sourceName:e,targetName:r,callback:2,callbackId:s.callbackId,reason:d(t)})})}else s.streamId?this.#ue(s):i(s.data)}},a.addEventListener("message",this._onComObjOnMessage)}on(t,e){var r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${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){var i=this.callbackId++,s=new h.PromiseCapability;this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(t){s.reject(t)}return s.promise}sendWithStream(r,i,t,s){let a=this.streamId++,n=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:t=>{var e=new h.PromiseCapability;return this.streamControllers[a]={controller:t,startCall:e,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:n,targetName:o,action:r,streamId:a,data:i,desiredSize:t.desiredSize},s),e.promise},pull:t=>{var e=new h.PromiseCapability;return this.streamControllers[a].pullCall=e,l.postMessage({sourceName:n,targetName:o,stream:6,streamId:a,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,h.assert)(t instanceof Error,"cancel must have a valid reason");var e=new h.PromiseCapability;return this.streamControllers[a].cancelCall=e,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:n,targetName:o,stream:1,streamId:a,reason:d(t)}),e.promise}},t)}#ue(e){let s=e.streamId,a=this.sourceName,n=e.sourceName,o=this.comObj,t=this,r=this.actionHandler[e.action],i={enqueue(t){var e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,i=2<arguments.length?arguments[2]:void 0;this.isCancelled||(e=this.desiredSize,this.desiredSize-=r,0<e&&this.desiredSize<=0&&(this.sinkCapability=new h.PromiseCapability,this.ready=this.sinkCapability.promise),o.postMessage({sourceName:a,targetName:n,stream:4,streamId:s,chunk:t},i))},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:a,targetName:n,stream:3,streamId:s}),delete t.streamSinks[s])},error(t){(0,h.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:a,targetName:n,stream:5,streamId:s,reason:d(t)}))},sinkCapability:new h.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};i.sinkCapability.resolve(),i.ready=i.sinkCapability.promise,this.streamSinks[s]=i,new Promise(function(t){t(r(e.data,i))}).then(function(){o.postMessage({sourceName:a,targetName:n,stream:8,streamId:s,success:!0})},function(t){o.postMessage({sourceName:a,targetName:n,stream:8,streamId:s,reason:d(t)})})}#de(e){let r=e.streamId,i=this.sourceName,s=e.sourceName,a=this.comObj,t=this.streamControllers[r],n=this.streamSinks[r];switch(e.stream){case 8:e.success?t.startCall.resolve():t.startCall.reject(d(e.reason));break;case 7:e.success?t.pullCall.resolve():t.pullCall.reject(d(e.reason));break;case 6:n?(n.desiredSize<=0&&0<e.desiredSize&&n.sinkCapability.resolve(),n.desiredSize=e.desiredSize,new Promise(function(t){t(n.onPull?.())}).then(function(){a.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,success:!0})},function(t){a.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,reason:d(t)})})):a.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,success:!0});break;case 4:(0,h.assert)(t,"enqueue should have stream controller"),t.isClosed||t.controller.enqueue(e.chunk);break;case 3:(0,h.assert)(t,"close should have stream controller"),t.isClosed||(t.isClosed=!0,t.controller.close(),this.#pe(t,r));break;case 5:(0,h.assert)(t,"error should have stream controller"),t.controller.error(d(e.reason)),this.#pe(t,r);break;case 2:e.success?t.cancelCall.resolve():t.cancelCall.reject(d(e.reason)),this.#pe(t,r);break;case 1:n&&(new Promise(function(t){t(n.onCancel?.(d(e.reason)))}).then(function(){a.postMessage({sourceName:i,targetName:s,stream:2,streamId:r,success:!0})},function(t){a.postMessage({sourceName:i,targetName:s,stream:2,streamId:r,reason:d(t)})}),n.sinkCapability.reject(d(e.reason)),n.isCancelled=!0,delete this.streamSinks[r]);break;default:throw new Error("Unexpected stream case")}}async#pe(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=r(1);e.Metadata=class{#fe;#ge;constructor(t){var{parsedData:t,rawData:e}=t;this.#fe=t,this.#ge=e}getRaw(){return this.#ge}get(t){return this.#fe.get(t)??null}getAll(){return(0,i.objectFromMap)(this.#fe)}has(t){return this.#fe.has(t)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var a=r(1),i=r(170);let s=Symbol("INTERNAL");class n{#me=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#me}_setVisible(t,e){t!==s&&(0,a.unreachable)("Internal method `_setVisible` called."),this.#me=e}}e.OptionalContentConfig=class{#be=null;#ve=new Map;#ye=null;#_e=null;constructor(t){if(this.name=null,(this.creator=null)!==t){this.name=t.name,this.creator=t.creator,this.#_e=t.order;for(var e of t.groups)this.#ve.set(e.id,new n(e.name,e.intent));if("OFF"===t.baseState)for(let t of this.#ve.values())t._setVisible(s,!1);for(var r of t.on)this.#ve.get(r)._setVisible(s,!0);for(var i of t.off)this.#ve.get(i)._setVisible(s,!1);this.#ye=this.getHash()}}#Ae(i){let t=i.length;if(t<2)return!0;var s=i[0];for(let r=1;r<t;r++){let t=i[r],e;if(Array.isArray(t))e=this.#Ae(t);else{if(!this.#ve.has(t))return(0,a.warn)("Optional content group not found: "+t),!0;e=this.#ve.get(t).visible}switch(s){case"And":if(e)break;return!1;case"Or":if(e)return!0;break;case"Not":return!e;default:return!0}}return"And"===s}isVisible(t){if(0!==this.#ve.size)if(t){if("OCG"===t.type)return this.#ve.has(t.id)?this.#ve.get(t.id).visible:((0,a.warn)("Optional content group not found: "+t.id),!0);if("OCMD"===t.type){if(t.expression)return this.#Ae(t.expression);if(!t.policy||"AnyOn"===t.policy){for(var e of t.ids){if(!this.#ve.has(e))return(0,a.warn)("Optional content group not found: "+e),!0;if(this.#ve.get(e).visible)return!0}return!1}if("AllOn"===t.policy)for(var r of t.ids){if(!this.#ve.has(r))return(0,a.warn)("Optional content group not found: "+r),!0;if(!this.#ve.get(r).visible)return!1}else{if("AnyOff"===t.policy){for(var i of t.ids){if(!this.#ve.has(i))return(0,a.warn)("Optional content group not found: "+i),!0;if(!this.#ve.get(i).visible)return!0}return!1}if("AllOff"===t.policy)for(var s of t.ids){if(!this.#ve.has(s))return(0,a.warn)("Optional content group not found: "+s),!0;if(this.#ve.get(s).visible)return!1}else(0,a.warn)(`Unknown optional content policy ${t.policy}.`)}}else(0,a.warn)(`Unknown group type ${t.type}.`)}else(0,a.warn)("Optional content group not defined.");return!0}setVisibility(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.#ve.has(t)?(this.#ve.get(t)._setVisible(s,!!e),this.#be=null):(0,a.warn)("Optional content group not found: "+t)}get hasInitialVisibility(){return null===this.#ye||this.getHash()===this.#ye}getOrder(){return this.#ve.size?this.#_e?this.#_e.slice():[...this.#ve.keys()]:null}getGroups(){return 0<this.#ve.size?(0,a.objectFromMap)(this.#ve):null}getGroup(t){return this.#ve.get(t)||null}getHash(){if(null!==this.#be)return this.#be;var t,e,r=new i.MurmurHash3_64;for([t,e]of this.#ve)r.update(t+":"+e.visible);return this.#be=r.hexdigest()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var o=r(1),s=r(168);e.PDFDataTransportStream=class{constructor(t,e){var{length:t,initialData:r,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:a=!1,disableStream:n=!1}=t;if((0,o.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,0<r?.length){let t=(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!a,this._contentLength=t,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),this._pdfDataRangeTransport.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),this._pdfDataRangeTransport.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:r}=t,i=(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{let t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(i),!0)});(0,o.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){t=this._rangeReaders.indexOf(t);0<=t&&this._rangeReaders.splice(t,1)}getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;return this._queuedChunks=null,new i(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){var r;return e<=this._progressiveDataLength?null:(r=new a(this,t,e),this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class i{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=r||!1,this._filename=(0,s.isPdfFile)(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(let t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),(t._fullRequestReader=this).onProgress=null}_enqueue(t){this._done||(0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):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(){var t;return 0<this._queuedChunks.length?{value:this._queuedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=new o.PromiseCapability,this._requests.push(t),t.promise)}cancel(t){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class a{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(let 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){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=new o.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var a=r(1),n=r(182);function o(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function l(t){var e,r=new Headers;for(e in t){var i=t[e];void 0!==i&&r.append(e,i)}return r}function i(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,a.warn)("getArrayBuffer - unexpected data format: "+t),new Uint8Array(t).buffer)}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new s(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new h(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;t=t.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new a.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=l(this._stream.httpHeaders);let s=t.url;fetch(s,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,n.validateResponseStatus)(e.status))throw(0,n.createResponseStatusError)(e.status,s);this._reader=e.body.getReader(),this._headersCapability.resolve();var t=t=>e.headers.get(t),{allowRangeRequests:r,suggestedLength:i}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=i||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new a.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class h{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;t=t.source;this._withCredentials=t.withCredentials||!1,this._readCapability=new a.PromiseCapability,this._isStreamingSupported=!t.disableStream,this._abortController=new AbortController,this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-`+(r-1));let i=t.url;fetch(i,o(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,i);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;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function(e){e=e("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,a.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){var{getResponseHeader:t,isHttp:e,rangeChunkSize:r,disableRange:i}=t,s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);return!Number.isInteger(a)||(s.suggestedLength=a)<=2*r||!i&&e&&"bytes"===t("Accept-Ranges")&&"identity"===(t("Content-Encoding")||"identity")&&(s.allowRangeRequests=!0),s},e.validateResponseStatus=function(t){return 200===t||206===t};var i=r(1),s=r(183),a=r(168)},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let s=!0,e=o("filename\\*","i").exec(t);var r;return e?(r=l(e=e[1]),i(r=n(r=h(r=unescape(r))))):(e=(t=>{for(var i=[],e=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=e.exec(t));){var[,r,s,a]=r;if((r=parseInt(r,10))in i){if(0===r)break}else i[r]=[s,a]}var n=[];for(let r=0;r<i.length&&r in i;++r){let[t,e]=i[r];e=l(e),t&&(e=unescape(e),0===r)&&(e=h(e)),n.push(e)}return n.join("")})(t))?i(n(e)):(e=o("filename","i").exec(t))?i(n(l(e=e[1]))):"";function o(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function a(t,e){if(t){if(!/^[\x00-\xFF]+$/.test(e))return e;try{var r=new TextDecoder(t,{fatal:!0}),i=(0,d.stringToBytes)(e);e=r.decode(i),s=!1}catch{}}return e}function i(t){return t=s&&/[\x80-\xff]/.test(t)&&(t=a("utf-8",t),s)?a("iso-8859-1",t):t}function l(t){if(t.startsWith('"')){var e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){var r=e[t].indexOf('"');-1!==r&&(e[t]=e[t].slice(0,r),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function h(t){var e=t.indexOf("'");return-1===e?t:a(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function n(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,r,i){if("q"===r||"Q"===r)return a(e,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{i=atob(i)}catch{}return a(e,i)})}},r(89),r(149);var d=r(1)},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0,r(89);var a=r(1),n=r(182);class i{constructor(t){var e=1<arguments.length&&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.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,r){var i={begin:t,end:e};for(let t in r)i[t]=r[t];return this.request(i)}requestFull(t){return this.request(t)}request(e){let r=new XMLHttpRequest,t=this.currXhrId++,i=this.pendingRequests[t]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(let e in this.httpHeaders){let t=this.httpHeaders[e];void 0!==t&&r.setRequestHeader(e,t)}return this.isHttp&&"begin"in e&&"end"in e?(r.setRequestHeader("Range",`bytes=${e.begin}-`+(e.end-1)),i.expectedStatus=206):i.expectedStatus=200,r.responseType="arraybuffer",e.onError&&(r.onerror=function(t){e.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,t),r.onprogress=this.onProgress.bind(this,t),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,r.send(null),t}onProgress(t,e){t=this.pendingRequests[t];t&&t.onProgress?.(e)}onStateChange(t,e){var r=this.pendingRequests[t];if(r){var i=r.xhr;if(2<=i.readyState&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4===i.readyState&&t in this.pendingRequests)if(delete this.pendingRequests[t],0===i.status&&this.isHttp)r.onError?.(i.status);else{t=i.status||200;if(200===t&&206===r.expectedStatus||t===r.expectedStatus){var s=(t=>"string"!=typeof(t=t.response)?t:(0,a.stringToBytes)(t).buffer)(i);if(206===t){let t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError?.(i.status)}else r.onError?.(i.status)}}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){var e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new i(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){t=this._rangeRequestReaders.indexOf(t);0<=t&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){t=new o(this._manager,t,e);return t.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(t),t}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t,e){this._manager=t;var 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=new a.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t),r=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:s}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(0<this._requests.length?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(0<this._cachedChunks.length)){for(let 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(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;var t;return 0<this._cachedChunks.length?{value:this._cachedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=new a.PromiseCapability,this._requests.push(t),t.promise)}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(let 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 o{constructor(t,e,r){this._manager=t;var 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(){this.onClosed?.(this)}_onDone(t){t=t.chunk;0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let 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(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=new a.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(let 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)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0,r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var s=r(1),a=r(182);let n=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=(t=>{var e=require("url"),r=e.parse(t);if("file:"!==r.protocol&&!r.host){if(/^[a-z]:[/\\]/i.test(t))return e.parse("file:///"+t);r.host||(r.protocol="file:")}return r})(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new(this.isFsUrl?c:h)(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new(this.isFsUrl?u:d)(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class i{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;t=t.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new s.PromiseCapability,this._headersCapability=new s.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{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).on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new s.PromiseCapability;t=t.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{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).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 l(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class h extends i{constructor(i){super(i);var t,e=t=>{if(404===t.statusCode){let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t,void this._headersCapability.reject(t)}else{this._headersCapability.resolve(),this._setReadableStream(t);var t=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:e,suggestedLength:r}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:i.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=r||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(t)}};this._request=null,"http:"===this._url.protocol?(t=require("http"),this._request=t.request(l(this._url,i.httpHeaders),e)):(t=require("https"),this._request=t.request(l(this._url,i.httpHeaders),e)),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class d extends o{constructor(r,e,t){super(r),this._httpHeaders={};for(let e in r.httpHeaders){let t=r.httpHeaders[e];void 0!==t&&(this._httpHeaders[e]=t)}this._httpHeaders.Range=`bytes=${e}-`+(t-1);e=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){let t=require("http");this._request=t.request(l(this._url,this._httpHeaders),e)}else{let t=require("https");this._request=t.request(l(this._url,this._httpHeaders),e)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class c extends i{constructor(t){super(t);let r=decodeURIComponent(this._url.path),i=(n.test(this._url.href)&&(r=r.replace(/^\//,"")),require("fs"));i.lstat(r,(t,e)=>{t?("ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${r}".`)),this._storedError=t,this._headersCapability.reject(t)):(this._contentLength=e.size,this._setReadableStream(i.createReadStream(r)),this._headersCapability.resolve())})}}class u extends o{constructor(t,e,r){super(t);let i=decodeURIComponent(this._url.path);n.test(this._url.href)&&(i=i.replace(/^\//,""));t=require("fs");this._setReadableStream(t.createReadStream(i,{start:e,end:r-1}))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0,r(84),r(86),r(87),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(187);var i=r(168),v=r(1);function _(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(URL.createObjectURL&&"undefined"!=typeof Blob&&!(2<arguments.length&&void 0!==arguments[2]&&arguments[2]))return URL.createObjectURL(new Blob([r],{type:t}));var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${t};base64,`;for(let t=0,e=r.length;t<e;t+=3){var a=255&r[t],n=255&r[t+1],o=255&r[t+2];s+=i[a>>2]+i[(3&a)<<4|n>>4]+i[t+1<e?(15&n)<<2|o>>6:64]+i[t+2<e?63&o:64]}return s}let s=["butt","round","square"],a=["miter","round","bevel"],n=(()=>{let f=new Uint8Array([137,80,78,71,13,10,26,10]),n=new Int32Array(256);for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>1&2147483647:e>>1&2147483647;n[t]=e}function g(t,e,r,i){var s=i,a=e.length,a=(r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a,r[s+=4]=255&t.charCodeAt(0),r[s+1]=255&t.charCodeAt(1),r[s+2]=255&t.charCodeAt(2),r[s+3]=255&t.charCodeAt(3),r.set(e,s+=4),((r,t,i)=>{let s=-1;for(let e=t;e<i;e++){let t=255&(s^r[e]);s=s>>>8^n[t]}return-1^s})(r,i+4,s+=e.length));r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a}function m(t){let e=t.length;var r=65535,i=Math.ceil(e/r),s=new Uint8Array(2+e+5*i+4);let a=0,n=(s[a++]=120,s[a++]=156,0);for(;e>r;)s[a++]=0,s[a++]=255,s[a++]=255,s[a++]=0,s[a++]=0,s.set(t.subarray(n,n+r),a),a+=r,n+=r,e-=r;s[a++]=1,s[a++]=255&e,s[a++]=e>>8&255,s[a++]=255&~e,s[a++]=(65535&~e)>>8&255,s.set(t.subarray(n),a),a+=t.length-n;i=((e,r,i)=>{let s=1,a=0;for(let t=r;t<i;++t)s=(s+(255&e[t]))%65521,a=(a+s)%65521;return a<<16|s})(t,0,t.length);return s[a++]=i>>24&255,s[a++]=i>>16&255,s[a++]=i>>8&255,s[a++]=255&i,s}function i(t,e,r,i){var s=t.width,a=t.height;let n,o,l;var h=t.data;switch(e){case v.ImageKind.GRAYSCALE_1BPP:o=0,n=1,l=s+7>>3;break;case v.ImageKind.RGB_24BPP:o=2,n=8,l=3*s;break;case v.ImageKind.RGBA_32BPP:o=6,n=8,l=4*s;break;default:throw new Error("invalid format")}var d=new Uint8Array((1+l)*a);let c=0,u=0;for(let t=0;t<a;++t)d[c++]=0,d.set(h.subarray(u,u+l),c),u+=l,c+=l;if(e===v.ImageKind.GRAYSCALE_1BPP&&i)for(let t=c=0;t<a;t++){c++;for(let t=0;t<l;t++)d[c++]^=255}var t=new Uint8Array([s>>24&255,s>>16&255,s>>8&255,255&s,a>>24&255,a>>16&255,a>>8&255,255&a,n,o,0,0,0]),e=(t=>{if(v.isNodeJS)try{var e=8<=parseInt(process.versions.node)?t:Buffer.from(t),r=require("zlib").deflateSync(e,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(t){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return m(t)})(d),i=f.length+36+t.length+e.length,i=new Uint8Array(i),p=0;return i.set(f,0),g("IHDR",t,i,p+=f.length),g("IDATA",e,i,p+=12+t.length),p+=12+e.length,g("IEND",new Uint8Array(0),i,p),_(i,"image/png",r)}return function(t,e,r){return i(t,void 0===t.kind?v.ImageKind.GRAYSCALE_1BPP:t.kind,e,r)}})();class o{constructor(){this.fontSizeScale=1,this.fontWeight="normal",this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.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="#000000",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 b(t){if(Number.isInteger(t))return t.toString();var e=t.toFixed(10);let r=e.length-1;if("0"!==e[r])return e;for(;"0"===e[--r];);return e.substring(0,"."===e[r]?r:r+1)}function y(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${b(t[0])} ${b(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2])return`rotate(${b(180*Math.acos(t[0])/Math.PI)})`}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${b(t[4])} ${b(t[5])})`;return`matrix(${b(t[0])} ${b(t[1])} ${b(t[2])} ${b(t[3])} ${b(t[4])} ${b(t[5])})`}let l=0,h=0,f=0;e.SVGGraphics=class{constructor(t,e){var r=2<arguments.length&&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 o,this.transformMatrix=v.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(let t in v.OPS)this._operatorIdMapping[v.OPS[t]]=t}getObject(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}save(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(t){let r=t.fnArray,i=t.argsArray;for(let t=0,e=r.length;t<e;t++)if(r[t]===v.OPS.dependency)for(let r of i[t]){let e=r.startsWith("g_")?this.commonObjs:this.objs,t=new Promise(t=>{e.get(r,t)});this.current.dependencies.push(t)}return Promise.all(this.current.dependencies)}transform(t,e,r,i,s,a){this.transformMatrix=v.Util.transform(this.transformMatrix,[t,e,r,i,s,a]),this.tgrp=null}getSVG(t,e){this.viewport=e;let r=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),r))}convertOpList(e){var r=this._operatorIdMapping,i=e.argsArray,s=e.fnArray,a=[];for(let t=0,e=s.length;t<e;t++){var n=s[t];a.push({fnId:n,fn:r[n],args:i[t]})}{let t=[];var o,l=[];for(o of e=a)"save"!==o.fn?"restore"===o.fn?t=l.pop():t.push(o):(t.push({fnId:92,fn:"group",items:[]}),l.push(t),t=t.at(-1).items);return t}}executeOpTree(t){for(var i of t){let t=i.fn,e=i.fnId,r=i.args;switch(0|e){case v.OPS.beginText:this.beginText();break;case v.OPS.dependency:break;case v.OPS.setLeading:this.setLeading(r);break;case v.OPS.setLeadingMoveText:this.setLeadingMoveText(r[0],r[1]);break;case v.OPS.setFont:this.setFont(r);break;case v.OPS.showText:case v.OPS.showSpacedText:this.showText(r[0]);break;case v.OPS.endText:this.endText();break;case v.OPS.moveText:this.moveText(r[0],r[1]);break;case v.OPS.setCharSpacing:this.setCharSpacing(r[0]);break;case v.OPS.setWordSpacing:this.setWordSpacing(r[0]);break;case v.OPS.setHScale:this.setHScale(r[0]);break;case v.OPS.setTextMatrix:this.setTextMatrix(r[0],r[1],r[2],r[3],r[4],r[5]);break;case v.OPS.setTextRise:this.setTextRise(r[0]);break;case v.OPS.setTextRenderingMode:this.setTextRenderingMode(r[0]);break;case v.OPS.setLineWidth:this.setLineWidth(r[0]);break;case v.OPS.setLineJoin:this.setLineJoin(r[0]);break;case v.OPS.setLineCap:this.setLineCap(r[0]);break;case v.OPS.setMiterLimit:this.setMiterLimit(r[0]);break;case v.OPS.setFillRGBColor:this.setFillRGBColor(r[0],r[1],r[2]);break;case v.OPS.setStrokeRGBColor:this.setStrokeRGBColor(r[0],r[1],r[2]);break;case v.OPS.setStrokeColorN:this.setStrokeColorN(r);break;case v.OPS.setFillColorN:this.setFillColorN(r);break;case v.OPS.shadingFill:this.shadingFill(r[0]);break;case v.OPS.setDash:this.setDash(r[0],r[1]);break;case v.OPS.setRenderingIntent:this.setRenderingIntent(r[0]);break;case v.OPS.setFlatness:this.setFlatness(r[0]);break;case v.OPS.setGState:this.setGState(r[0]);break;case v.OPS.fill:this.fill();break;case v.OPS.eoFill:this.eoFill();break;case v.OPS.stroke:this.stroke();break;case v.OPS.fillStroke:this.fillStroke();break;case v.OPS.eoFillStroke:this.eoFillStroke();break;case v.OPS.clip:this.clip("nonzero");break;case v.OPS.eoClip:this.clip("evenodd");break;case v.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case v.OPS.paintImageXObject:this.paintImageXObject(r[0]);break;case v.OPS.paintInlineImageXObject:this.paintInlineImageXObject(r[0]);break;case v.OPS.paintImageMaskXObject:this.paintImageMaskXObject(r[0]);break;case v.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(r[0],r[1]);break;case v.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case v.OPS.closePath:this.closePath();break;case v.OPS.closeStroke:this.closeStroke();break;case v.OPS.closeFillStroke:this.closeFillStroke();break;case v.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case v.OPS.nextLine:this.nextLine();break;case v.OPS.transform:this.transform(r[0],r[1],r[2],r[3],r[4],r[5]);break;case v.OPS.constructPath:this.constructPath(r[0],r[1]);break;case v.OPS.endPath:this.endPath();break;case 92:this.group(i.items);break;default:(0,v.warn)("Unimplemented operator "+t)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,r,i,s,a){var n=this.current;n.textMatrix=n.lineMatrix=[t,e,r,i,s,a],n.textMatrixScale=Math.hypot(t,e),n.x=n.lineX=0,n.y=n.lineY=0,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",b(n.fontSize)+"px"),n.tspan.setAttributeNS(null,"y",b(-n.y)),n.txtElement=this.svgFactory.createElement("svg:text"),n.txtElement.append(n.tspan)}beginText(){var t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=v.IDENTITY_MATRIX,t.lineMatrix=v.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){var 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",b(r.fontSize)+"px"),r.tspan.setAttributeNS(null,"y",b(-r.y))}showText(e){let o=this.current,l=o.font,r=o.fontSize;if(0!==r){var h,d=o.fontSizeScale,c=o.charSpacing,u=o.wordSpacing,p=o.fontDirection,i=o.textHScale*p,f=l.vertical,s=f?1:-1,g=l.defaultVMetrics,m=r*o.fontMatrix[0];let n=0;for(let a of e)if(null===a)n+=p*u;else if("number"==typeof a)n+=s*a*r/1e3;else{let t=(a.isSpace?u:0)+c,e=a.fontChar,r,i,s=a.width;if(f){let t=a.vmetric||g,e=(h=a.vmetric?t[1]:.5*s,t[2]*m);s=t?-t[0]:s,r=-h*m/d,i=(n+e)/d}else r=n/d,i=0;(a.isInFont||l.missingFile)&&(o.xcoords.push(o.x+r),f&&o.ycoords.push(-o.y+i),o.tspan.textContent+=e),n+=f?s*m-t*p:s*m+t*p}o.tspan.setAttributeNS(null,"x",o.xcoords.map(b).join(" ")),f?o.tspan.setAttributeNS(null,"y",o.ycoords.map(b).join(" ")):o.tspan.setAttributeNS(null,"y",b(-o.y)),f?o.y-=n:o.x+=n*i,o.tspan.setAttributeNS(null,"font-family",o.fontFamily),o.tspan.setAttributeNS(null,"font-size",b(o.fontSize)+"px"),"normal"!==o.fontStyle&&o.tspan.setAttributeNS(null,"font-style",o.fontStyle),"normal"!==o.fontWeight&&o.tspan.setAttributeNS(null,"font-weight",o.fontWeight);e=o.textRenderingMode&v.TextRenderingMode.FILL_STROKE_MASK;if(e===v.TextRenderingMode.FILL||e===v.TextRenderingMode.FILL_STROKE?("#000000"!==o.fillColor&&o.tspan.setAttributeNS(null,"fill",o.fillColor),o.fillAlpha<1&&o.tspan.setAttributeNS(null,"fill-opacity",o.fillAlpha)):o.textRenderingMode===v.TextRenderingMode.ADD_TO_PATH?o.tspan.setAttributeNS(null,"fill","transparent"):o.tspan.setAttributeNS(null,"fill","none"),e===v.TextRenderingMode.STROKE||e===v.TextRenderingMode.FILL_STROKE){let t=1/(o.textMatrixScale||1);this._setStrokeAttributes(o.tspan,t)}let t=o.textMatrix;0!==o.textRise&&((t=t.slice())[5]+=o.textRise),o.txtElement.setAttributeNS(null,"transform",`${y(t)} scale(${b(i)}, -1)`),o.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.txtElement.append(o.tspan),o.txtgrp.append(o.txtElement),this._ensureTransformGroup().append(o.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.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));var e=_(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }
|
||
`}setFont(t){var e=this.current,r=this.commonObjs.get(t[0]);let i=t[1],s=(e.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),e.fontMatrix=r.fontMatrix||v.FONT_IDENTITY_MATRIX,"normal");r.black?s="900":r.bold&&(s="bold");t=r.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=r.loadedName,e.fontWeight=s,e.fontStyle=t,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",b(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t=this.current;t.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){0<t&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=s[t]}setLineJoin(t){this.current.lineJoin=a[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=v.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=v.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){var{width:e,height:r}=this.viewport,i=v.Util.inverseTransform(this.transformMatrix),[e,r,i,s]=v.Util.getAxialAlignedBoundingBox([0,0,e,r],i),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",e),a.setAttributeNS(null,"y",r),a.setAttributeNS(null,"width",i-e),a.setAttributeNS(null,"height",s-r),a.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&a.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(a)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){var e=t[1],r=t[2],i=t[3]||v.IDENTITY_MATRIX,[s,a,n,o]=t[4],l=t[5],h=t[6],t=t[7],d="shading"+f++,[s,a,n,o]=v.Util.normalizeRect([...v.Util.applyTransform([s,a],i),...v.Util.applyTransform([n,o],i)]),[c,u]=v.Util.singularValueDecompose2dScale(i),l=l*c,c=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",d),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",c),h.setAttributeNS(null,"x",""+s),h.setAttributeNS(null,"y",""+a),this.svg),l=this.transformMatrix,c=this.current.fillColor,p=this.current.strokeColor,n=this.svgFactory.create(n-s,o-a);if(this.svg=n,this.transformMatrix=i,2===t){let t=v.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(r)),this.svg=u,this.transformMatrix=l,this.current.fillColor=c,this.current.strokeColor=p,h.append(n.childNodes[0]),this.defs.append(h),`url(#${d})`}_makeShadingPattern(i){switch((i="string"==typeof i?this.objs.get(i):i)[0]){case"RadialAxial":var s="shading"+f++,e=i[3];let r;switch(i[1]){case"axial":let t=i[4],e=i[5];(r=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",s),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",t[0]),r.setAttributeNS(null,"y1",t[1]),r.setAttributeNS(null,"x2",e[0]),r.setAttributeNS(null,"y2",e[1]);break;case"radial":var a=i[4],n=i[5],o=i[6],l=i[7];(r=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",s),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",n[0]),r.setAttributeNS(null,"cy",n[1]),r.setAttributeNS(null,"r",l),r.setAttributeNS(null,"fx",a[0]),r.setAttributeNS(null,"fy",a[1]),r.setAttributeNS(null,"fr",o);break;default:throw new Error("Unknown RadialAxial type: "+i[1])}for(let t of e){var h=this.svgFactory.createElement("svg:stop");h.setAttributeNS(null,"offset",t[0]),h.setAttributeNS(null,"stop-color",t[1]),r.append(h)}return this.defs.append(r),`url(#${s})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+i[0])}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(e,r){let t=this.current,i=t.x,s=t.y,a=[],n=0;for(let t of e)switch(0|t){case v.OPS.rectangle:i=r[n++],s=r[n++];let t=i+r[n++],e=s+r[n++];a.push("M",b(i),b(s),"L",b(t),b(s),"L",b(t),b(e),"L",b(i),b(e),"Z");break;case v.OPS.moveTo:i=r[n++],s=r[n++],a.push("M",b(i),b(s));break;case v.OPS.lineTo:i=r[n++],s=r[n++],a.push("L",b(i),b(s));break;case v.OPS.curveTo:i=r[n+4],s=r[n+5],a.push("C",b(r[n]),b(r[n+1]),b(r[n+2]),b(r[n+3]),b(i),b(s)),n+=6;break;case v.OPS.curveTo2:a.push("C",b(i),b(s),b(r[n]),b(r[n+1]),b(r[n+2]),b(r[n+3])),i=r[n+2],s=r[n+3],n+=4;break;case v.OPS.curveTo3:i=r[n+2],s=r[n+3],a.push("C",b(r[n]),b(r[n+1]),b(i),b(s),b(i),b(s)),n+=4;break;case v.OPS.closePath:a.push("Z")}a=a.join(" "),t.path&&0<e.length&&e[0]!==v.OPS.rectangle&&e[0]!==v.OPS.moveTo?a=t.path.getAttributeNS(null,"d")+a:(t.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(t.path)),t.path.setAttributeNS(null,"d",a),t.path.setAttributeNS(null,"fill","none"),t.element=t.path,t.setCurrentPoint(i,s)}endPath(){let t=this.current;if(t.path=null,this.pendingClip)if(t.element){var e="clippath"+l++,r=this.svgFactory.createElement("svg:clipPath"),i=(r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"transform",y(this.transformMatrix)),t.element.cloneNode(!0));if("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),t.activeClipUrl){t.clipGroup=null;for(let t of this.extraStack)t.clipGroup=null;r.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}else this.pendingClip=null}clip(t){this.pendingClip=t}closePath(){var t,e=this.current;e.path&&(t=e.path.getAttributeNS(null,"d")+"Z",e.path.setAttributeNS(null,"d",t))}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(var[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,v.warn)("Unimplemented graphic state operator "+e)}}fill(){var t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){var t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;var r=this.current;let i=r.dashArray;1!==e&&0<i.length&&(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",b(r.miterLimit)),t.setAttributeNS(null,"stroke-linecap",r.lineCap),t.setAttributeNS(null,"stroke-linejoin",r.lineJoin),t.setAttributeNS(null,"stroke-width",b(e*r.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",i.map(b).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",b(e*r.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){var 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){var e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,v.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){var r=t.width,i=t.height,t=n(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect"),s=(s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",b(r)),s.setAttributeNS(null,"height",b(i)),this.current.element=s,this.clip("nonzero"),this.svgFactory.createElement("svg:image"));s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",b(-i)),s.setAttributeNS(null,"width",b(r)+"px"),s.setAttributeNS(null,"height",b(i)+"px"),s.setAttributeNS(null,"transform",`scale(${b(1/r)} ${b(-1/i)})`),(e||this._ensureTransformGroup()).append(s)}paintImageMaskXObject(t){var e,r,i,s,a,n,t=this.getObject(t.data,t);t.bitmap?(0,v.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled."):(e=this.current,r=t.width,i=t.height,s=e.fillColor,e.maskId="mask"+h++,(a=this.svgFactory.createElement("svg:mask")).setAttributeNS(null,"id",e.maskId),(n=this.svgFactory.createElement("svg:rect")).setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width",b(r)),n.setAttributeNS(null,"height",b(i)),n.setAttributeNS(null,"fill",s),n.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(a),this._ensureTransformGroup().append(n),this.paintInlineImageXObject(t,a))}paintFormXObjectBegin(t,i){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),i){let t=i[2]-i[0],e=i[3]-i[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",i[0]),r.setAttributeNS(null,"y",i[1]),r.setAttributeNS(null,"width",b(t)),r.setAttributeNS(null,"height",b(e)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){var e=this.svgFactory.create(t.width,t.height),r=this.svgFactory.createElement("svg:defs"),r=(e.append(r),this.defs=r,this.svgFactory.createElement("svg:g"));return r.setAttributeNS(null,"transform",y(t.transform)),e.append(r),this.svg=r,e}_ensureClipGroup(){var t;return this.current.clipGroup||((t=this.svgFactory.createElement("svg:g")).setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t),this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),(this.current.activeClipUrl?this._ensureClipGroup():this.svg).append(this.tgrp)),this.tgrp}}},(t,e,r)=>{var i=r(3),s=r(188),r=r(193);i({target:"Array",proto:!0},{group:function(t){return s(this,t,1<arguments.length?arguments[1]:void 0)}}),r("group")},(t,e,r)=>{var p=r(99),i=r(14),f=r(13),g=r(40),m=r(18),v=r(64),_=r(189),b=r(108),y=Array,A=i([].push);t.exports=function(t,e,r,i){for(var s,a,n,o=g(t),l=f(o),h=p(e,r),d=_(null),c=v(l),u=0;u<c;u++)n=l[u],(a=m(h(n,u,o)))in d?A(d[a],n):d[a]=[n];if(i&&(s=i(o))!==y)for(a in d)d[a]=b(s,d[a]);return d}},(t,e,r)=>{function i(){}function s(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e}var a,n=r(47),o=r(190),l=r(66),h=r(55),d=r(192),c=r(43),r=r(54),u="prototype",p="script",f=r("IE_PROTO"),g=function(t){return"<"+p+">"+t+"</"+p+">"},m=function(){try{a=new ActiveXObject("htmlfile")}catch(r){}var t,e;m="undefined"==typeof document||document.domain&&a?s(a):(t=c("iframe"),e="java"+p+":",t.style.display="none",d.appendChild(t),t.src=String(e),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var r=l.length;r--;)delete m[u][l[r]];return m()};h[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(i[u]=n(t),r=new i,i[u]=null,r[f]=t):r=m(),void 0===e?r:o.f(r,e)}},(t,e,r)=>{var i=r(6),s=r(46),o=r(45),l=r(47),h=r(12),d=r(191);e.f=i&&!s?Object.defineProperties:function(t,e){l(t);for(var r,i=h(e),s=d(e),a=s.length,n=0;n<a;)o.f(t,r=s[n++],i[r]);return t}},(t,e,r)=>{var i=r(59),s=r(66);t.exports=Object.keys||function(t){return i(t,s)}},(t,e,r)=>{r=r(24);t.exports=r("document","documentElement")},(t,e,r)=>{var i=r(34),s=r(189),r=r(45).f,a=i("unscopables"),n=Array.prototype;void 0===n[a]&&r(n,a,{configurable:!0,value:s(null)}),t.exports=function(t){n[a][t]=!0}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0,r(89);class a{static textContent(t){let s=[],e={items:s,styles:Object.create(null)};return function e(r){if(r){let t=null;var i=r.name;if("#text"===i)t=r.value;else{if(!a.shouldBuildText(i))return;r?.attributes?.textContent?t=r.attributes.textContent:r.value&&(t=r.value)}if(null!==t&&s.push({str:t}),r.children)for(let t of r.children)e(t)}}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=a},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,l.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);var{container:e,viewport:r}=t,e=getComputedStyle(e),i=e.getPropertyValue("visibility"),e=parseFloat(e.getPropertyValue("--scale-factor")),i=("visible"===i&&(!e||1e-5<Math.abs(e-r.scale))&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM."),new s(t));return i._render(),i},e.updateTextLayer=function(t){let{container:e,viewport:r,textDivs:i,textDivProperties:s,isOffscreenCanvasSupported:a,mustRotate:n=!0,mustRescale:o=!0}=t;if(n&&(0,l.setLayerDimensions)(e,{rotation:r.rotation}),o){let t=f(0,a),e={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(let t of i)e.properties=s.get(t),e.div=t,h(e)}},r(89),r(2);var u=r(1),l=r(168);let p=new Map;function f(e,t){let r;if(t&&u.FeatureTest.isOffscreenCanvasSupported)r=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{let t=document.createElement("canvas");t.width=t.height=e,r=t.getContext("2d",{alpha:!1})}return r}function i(t,r,e){var i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==r.str,hasEOL:r.hasEOL,fontSize:0},a=(t._textDivs.push(i),u.Util.transform(t._transform,r.transform));let n=Math.atan2(a[1],a[0]);var e=e[r.fontName],o=(e.vertical&&(n+=Math.PI/2),Math.hypot(a[2],a[3])),l=o*((e,t)=>{var r=p.get(e);if(r)return r;(r=f(30,t)).font="30px "+e;let i=(t=r.measureText("")).fontBoundingBoxAscent,s=Math.abs(t.fontBoundingBoxDescent);if(i){let t=i/(i+s);return p.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle="red",r.clearRect(0,0,30,30),r.strokeText("g",0,0);let a=r.getImageData(0,0,30,30).data;s=0;for(let t=a.length-1-3;0<=t;t-=4)if(0<a[t]){s=Math.ceil(t/4/30);break}r.clearRect(0,0,30,30),r.strokeText("A",0,30),a=r.getImageData(0,0,30,30).data;for(let t=i=0,e=a.length;t<e;t+=4)if(0<a[t]){i=30-Math.floor(t/4/30);break}if(r.canvas.width=r.canvas.height=0,i){let t=i/(i+s);return p.set(e,t),t}return p.set(e,.8),.8})(e.fontFamily,t._isOffscreenCanvasSupported);let h,d;d=0===n?(h=a[4],a[5]-l):(h=a[4]+l*Math.sin(n),a[5]-l*Math.cos(n));a="calc(var(--scale-factor)*",l=i.style;t._container===t._rootContainer?(l.left=(100*h/t._pageWidth).toFixed(2)+"%",l.top=(100*d/t._pageHeight).toFixed(2)+"%"):(l.left=a+h.toFixed(2)+"px)",l.top=a+d.toFixed(2)+"px)"),l.fontSize=a+o.toFixed(2)+"px)",l.fontFamily=e.fontFamily,s.fontSize=o,i.setAttribute("role","presentation"),i.textContent=r.str,i.dir=r.dir,t._fontInspectorEnabled&&(i.dataset.fontName=r.fontName),0!==n&&(s.angle=n*(180/Math.PI));let c=!1;if(1<r.str.length)c=!0;else if(" "!==r.str&&r.transform[0]!==r.transform[3]){let t=Math.abs(r.transform[0]),e=Math.abs(r.transform[3]);t!==e&&1.5<Math.max(t,e)/Math.min(t,e)&&(c=!0)}c&&(s.canvasWidth=e.vertical?r.height:r.width),t._textDivProperties.set(i,s),t._isReadableStream&&t._layoutText(i)}function h(t){var e,r,i,{div:s,scale:a,properties:n,ctx:o,prevFontSize:l,prevFontFamily:h}=t,d=s.style;let c="";0!==n.canvasWidth&&n.hasText&&(e=d.fontFamily,{canvasWidth:r,fontSize:i}=n,l=(l===i&&h===e||(o.font=i*a+"px "+e,t.prevFontSize=i,t.prevFontFamily=e),o.measureText(s.textContent)).width,0<l)&&(c=`scaleX(${r*a/l})`),0<(c=0!==n.angle?`rotate(${n.angle}deg) `+c:c).length&&(d.transform=c)}class s{constructor(t){var{textContentSource:t,container:e,viewport:r,textDivs:i,textDivProperties:s,textContentItemsStr:a,isOffscreenCanvasSupported:n}=t,{pageWidth:t,pageHeight:i,pageX:a,pageY:s}=(this._textContentSource=t,this._isReadableStream=t instanceof ReadableStream,this._container=this._rootContainer=e,this._textDivs=i||[],this._textContentItemsStr=a||[],this._isOffscreenCanvasSupported=n,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=s||new WeakMap,this._canceled=!1,this._capability=new u.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:f(0,n)},r.rawDims);this._transform=[1,0,0,-1,-a,s+i],this._pageWidth=t,this._pageHeight=i,(0,l.setLayerDimensions)(e,r),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new u.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new u.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(var r of t)if(void 0!==r.str)this._textContentItemsStr.push(r.str),i(this,r,e);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){let t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==r.id&&this._container.setAttribute("id",""+r.id),t.append(this._container)}else"endMarkedContent"===r.type&&(this._container=this._container.parentNode)}_layoutText(t){var e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,h(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){let i=new u.PromiseCapability,s=Object.create(null);if(this._isReadableStream){let r=()=>{this._reader.read().then(t=>{var{value:t,done:e}=t;e?i.resolve():(Object.assign(s,t.styles),this._processItems(t.items,s),r())},i.reject)};this._reader=this._textContentSource.getReader(),r()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{let{items:t,styles:e}=this._textContentSource;this._processItems(t,e),i.resolve()}}i.promise.then(()=>{s=null;var r=this;if(!r._canceled){let e=r._textDivs,t=r._capability;if(!(1e5<e.length||r._isReadableStream))for(let t of e)r._layoutText(t);t.resolve()}},this._capability.reject)}}e.TextLayerRenderTask=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147);var i=r(1),s=r(164),l=r(197),h=r(202),a=r(168),d=r(203);class c{#Se;#Ee=!1;#xe=null;#we=this.pointerup.bind(this);#Ce=this.pointerdown.bind(this);#Te=new Map;#Pe=!1;#ke=!1;#Me=!1;#Fe;static _initialized=!1;constructor(t){var{uiManager:t,pageIndex:e,div:r,accessibilityManager:i,annotationLayer:s,viewport:a,l10n:n}=t,o=[l.FreeTextEditor,h.InkEditor,d.StampEditor];if(!c._initialized){c._initialized=!0;for(let t of o)t.initialize(n)}t.registerEditorTypes(o),this.#Fe=t,this.pageIndex=e,this.div=r,this.#Se=i,this.#xe=s,this.viewport=a,this.#Fe.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(t){this.#Fe.updateToolbar(t)}updateMode(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.#Fe.getMode();this.#Re(),t===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),t!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",t===i.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(t||this.#Fe.getMode()===i.AnnotationEditorType.INK){if(!t)for(let t of this.#Te.values())if(t.isEmpty())return void t.setInBackground();this.#De({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){this.#Fe.setEditingState(t)}addCommands(t){this.#Fe.addCommands(t)}enable(){this.div.style.pointerEvents="auto";var e=new Set;for(let t of this.#Te.values())t.enableEditing(),t.annotationElementId&&e.add(t.annotationElementId);if(this.#xe){let t=this.#xe.getEditableAnnotations();for(var r of t)if(r.hide(),!this.#Fe.isDeletedAnnotationElement(r.data.id)&&!e.has(r.data.id)){let t=this.deserialize(r);t&&(this.addOrRebuild(t),t.enableEditing())}}}disable(){this.#Me=!0,this.div.style.pointerEvents="none";var t,e,r=new Set;for(t of this.#Te.values())t.disableEditing(),t.annotationElementId&&null===t.serialize()?(this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()):r.add(t.annotationElementId);if(this.#xe)for(e of this.#xe.getEditableAnnotations()){var i=e.data.id;r.has(i)||this.#Fe.isDeletedAnnotationElement(i)||e.show()}this.#Re(),this.isEmpty&&(this.div.hidden=!0),this.#Me=!1}getEditableAnnotation(t){return this.#xe?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#Fe.getActive()!==t&&this.#Fe.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Ce),this.div.addEventListener("pointerup",this.#we)}disableClick(){this.div.removeEventListener("pointerdown",this.#Ce),this.div.removeEventListener("pointerup",this.#we)}attach(t){this.#Te.set(t.id,t);var e=t.annotationElementId;e&&this.#Fe.isDeletedAnnotationElement(e)&&this.#Fe.removeDeletedAnnotationElement(t)}detach(t){this.#Te.delete(t.id),this.#Se?.removePointerInTextLayer(t.contentDiv),!this.#Me&&t.annotationElementId&&this.#Fe.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#Fe.removeEditor(t),t.div.contains(document.activeElement)&&setTimeout(()=>{this.#Fe.focusMainContainer()},0),t.div.remove(),t.isAttachedToDOM=!1,this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.annotationElementId&&(this.#Fe.addDeletedAnnotationElement(t.annotationElementId),s.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div)&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div))}add(t){var e;this.changeParent(t),this.#Fe.addEditor(t),this.attach(t),t.isAttachedToDOM||(e=t.render(),this.div.append(e),t.isAttachedToDOM=!0),t.fixAndSetPosition(),t.onceAdded(),this.#Fe.addToAnnotationStorage(t)}moveEditorInDOM(e){if(e.isAttachedToDOM){let t=document.activeElement;e.div.contains(t)&&(e._focusEventsAllowed=!1,setTimeout(()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),t.focus())},0)),e._structTreeParentId=this.#Se?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Fe.getId()}#Ie(t){switch(this.#Fe.getMode()){case i.AnnotationEditorType.FREETEXT:return new l.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new h.InkEditor(t);case i.AnnotationEditorType.STAMP:return new d.StampEditor(t)}return null}pasteEditor(t,e){this.#Fe.updateToolbar(t),this.#Fe.updateMode(t);var{offsetX:t,offsetY:r}=this.#Oe(),i=this.getNextId(),i=this.#Ie({parent:this,id:i,x:t,y:r,uiManager:this.#Fe,isCentered:!0,...e});i&&this.add(i)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return l.FreeTextEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.INK:return h.InkEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.STAMP:return d.StampEditor.deserialize(t,this,this.#Fe)}return null}#De(t,e){var r=this.getNextId(),r=this.#Ie({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#Fe,isCentered:e});return r&&this.add(r),r}#Oe(){var{x:t,y:e,width:r,height:i}=this.div.getBoundingClientRect(),s=Math.max(0,t),a=Math.max(0,e),s=(s+Math.min(window.innerWidth,t+r))/2-t,r=(a+Math.min(window.innerHeight,e+i))/2-e,[t,a]=this.viewport.rotation%180==0?[s,r]:[r,s];return{offsetX:t,offsetY:a}}addNewEditor(){this.#De(this.#Oe(),!0)}setSelected(t){this.#Fe.setSelected(t)}toggleSelected(t){this.#Fe.toggleSelected(t)}isSelected(t){return this.#Fe.isSelected(t)}unselect(t){this.#Fe.unselect(t)}pointerup(t){var e=i.FeatureTest.platform.isMac;0!==t.button||t.ctrlKey&&e||t.target!==this.div||!this.#Pe||(this.#Pe=!1,this.#Ee?this.#Fe.getMode()!==i.AnnotationEditorType.STAMP?this.#De(t,!1):this.#Fe.unselectAll():this.#Ee=!0)}pointerdown(t){var e;this.#Pe?this.#Pe=!1:(e=i.FeatureTest.platform.isMac,0!==t.button||t.ctrlKey&&e||t.target===this.div&&(this.#Pe=!0,e=this.#Fe.getActive(),this.#Ee=!e||e.isEmpty()))}findNewParent(t,e,r){e=this.#Fe.findParent(e,r);return null!==e&&e!==this&&(e.changeParent(t),!0)}destroy(){this.#Fe.getActive()?.parent===this&&(this.#Fe.commitOrRemove(),this.#Fe.setActiveEditor(null));for(var t of this.#Te.values())this.#Se?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Te.clear(),this.#Fe.removeLayer(this)}#Re(){this.#ke=!0;for(var t of this.#Te.values())t.isEmpty()&&t.remove();this.#ke=!1}render(t){t=t.viewport;this.viewport=t,(0,a.setLayerDimensions)(this.div,t);for(let t of this.#Fe.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){t=t.viewport;this.#Fe.commitOrRemove(),this.viewport=t,(0,a.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){var{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=c},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0,r(89);var d=r(1),s=r(165),i=r(164),a=r(198);class n extends i.AnnotationEditor{#Le=this.editorDivBlur.bind(this);#Ne=this.editorDivFocus.bind(this);#Be=this.editorDivInput.bind(this);#je=this.editorDivKeydown.bind(this);#Ue;#ze="";#We=this.id+"-editor";#He;#qe=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){var t=n.prototype,e=t=>t.isEmpty(),r=s.AnnotationEditorUIManager.TRANSLATE_SMALL,i=s.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,d.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#Ue=t.color||n._defaultColor||i.AnnotationEditor._defaultLineColor,this.#He=t.fontSize||n._defaultFontSize}static initialize(t){i.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case d.AnnotationEditorParamsType.FREETEXT_SIZE:n._defaultFontSize=e;break;case d.AnnotationEditorParamsType.FREETEXT_COLOR:n._defaultColor=e}}updateParams(t,e){switch(t){case d.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ge(e);break;case d.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ve(e)}}static get defaultPropertiesToUpdate(){return[[d.AnnotationEditorParamsType.FREETEXT_SIZE,n._defaultFontSize],[d.AnnotationEditorParamsType.FREETEXT_COLOR,n._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[d.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[d.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ge(t){let e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#He)*this.parentScale),this.#He=t,this.#$e()},r=this.#He;this.addCommands({cmd:()=>{e(t)},undo:()=>{e(r)},mustExec:!0,type:d.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){let e=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=t},undo:()=>{this.#Ue=this.editorDiv.style.color=e},mustExec:!0,type:d.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){var t=this.parentScale;return[-n._internalPadding*t,-(n._internalPadding+this.#He)*t]}rebuild(){this.parent&&(super.rebuild(),null===this.div||this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(d.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#je),this.editorDiv.addEventListener("focus",this.#Ne),this.editorDiv.addEventListener("blur",this.#Le),this.editorDiv.addEventListener("input",this.#Be))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#We),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#je),this.editorDiv.removeEventListener("focus",this.#Ne),this.editorDiv.removeEventListener("blur",this.#Le),this.editorDiv.removeEventListener("input",this.#Be),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv)&&this.editorDiv.focus()}onceAdded(){this.width?this.#Xe():(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#Ke(){var t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;var e,r=[];for(e of t)r.push(e.innerText.replace(/\r\n?|\n/,""));return r.join("\n")}#$e(){let[t,e]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:t,div:e}=this,r=e.style.display;e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=r}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(this.isInEditMode()){super.commit(),this.disableEditMode();let e=this.#ze,r=this.#ze=this.#Ke().trimEnd();if(e!==r){let t=t=>{(this.#ze=t)?(this.#Ye(),this._uiManager.rebuild(this),this.#$e()):this.remove()};this.addCommands({cmd:()=>{t(r)},undo:()=>{t(e)},mustExec:!1}),this.#$e()}}}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){n._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(!this.div){let o,l,t=(this.width&&(o=this.x,l=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#We),this.enableEditing(),i.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),i.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0,this.editorDiv).style;if(t.fontSize=`calc(${this.#He}px * var(--scale-factor))`,t.color=this.#Ue,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,s.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[a,n]=this.parentDimensions;if(this.annotationElementId){let t=this.#qe.position,[e,r]=this.getInitialTranslation();[e,r]=this.pageTranslationToScreen(e,r);var[h,d]=this.pageDimensions,[c,u]=this.pageTranslation;let i,s;switch(this.rotation){case 0:i=o+(t[0]-c)/h,s=l+this.height-(t[1]-u)/d;break;case 90:i=o+(t[0]-c)/h,s=l-(t[1]-u)/d,[e,r]=[r,-e];break;case 180:i=o-this.width+(t[0]-c)/h,s=l-(t[1]-u)/d,[e,r]=[-e,-r];break;case 270:i=o+(t[0]-c-this.height*d)/h,s=l+(t[1]-u-this.width*h)/d,[e,r]=[-r,e]}this.setAt(i*a,s*n,e,r)}else this.setAt(o*a,l*n,this.width*a,this.height*n);this.#Ye(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0}return this.div}#Ye(){if(this.editorDiv.replaceChildren(),this.#ze)for(var t of this.#ze.split("\n")){var e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(l,t,e){let h=null;if(l instanceof a.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:t,fontColor:e},rect:r,rotation:i,id:s},textContent:a,textPosition:n,parent:{page:{pageNumber:o}}}=l;if(!a||0===a.length)return null;h=l={annotationType:d.AnnotationEditorType.FREETEXT,color:Array.from(e),fontSize:t,value:a.join("\n"),position:n,pageIndex:o-1,rect:r,rotation:i,id:s,deleted:!1}}let r=super.deserialize(l,t,e);return r.#He=l.fontSize,r.#Ue=d.Util.makeHexColor(...l.color),r.#ze=l.value,r.annotationElementId=l.id||null,r.#qe=h,r}serialize(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};var e=n._internalPadding*this.parentScale,e=this.getRect(e,e),r=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Ue),r={annotationType:d.AnnotationEditorType.FREETEXT,color:r,fontSize:this.#He,value:this.#ze,pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(!t){if(this.annotationElementId&&!this.#Je(r))return null;r.id=this.annotationElementId}return r}#Je(t){let{value:e,fontSize:r,color:i,rect:s,pageIndex:a}=this.#qe;return t.value!==e||t.fontSize!==r||t.rect.some((t,e)=>1<=Math.abs(t-s[e]))||t.color.some((t,e)=>t!==i[e])||t.pageIndex!==a}#Xe(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.annotationElementId&&(this.#$e(),t||0!==this.width&&0!==this.height?(t=n._internalPadding*this.parentScale,this.#qe.rect=this.getRect(t,t)):setTimeout(()=>this.#Xe(!0),0))}}e.FreeTextEditor=n},(L,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0,e(89),e(125),e(136),e(138),e(141),e(143),e(145),e(147);var u=e(1),c=e(168),i=e(163),s=e(199),n=e(200),p=e(201);let f=new WeakSet;function g(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class o{static create(t){switch(t.data.annotationType){case u.AnnotationType.LINK:return new r(t);case u.AnnotationType.TEXT:return new l(t);case u.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new h(t);case"Btn":return new(t.data.radioButton?_:t.data.checkBox?v:b)(t);case"Ch":return new y(t);case"Sig":return new d(t)}return new m(t);case u.AnnotationType.POPUP:return new A(t);case u.AnnotationType.FREETEXT:return new x(t);case u.AnnotationType.LINE:return new w(t);case u.AnnotationType.SQUARE:return new E(t);case u.AnnotationType.CIRCLE:return new T(t);case u.AnnotationType.POLYLINE:return new C(t);case u.AnnotationType.CARET:return new k(t);case u.AnnotationType.INK:return new M(t);case u.AnnotationType.POLYGON:return new P(t);case u.AnnotationType.HIGHLIGHT:return new R(t);case u.AnnotationType.UNDERLINE:return new F(t);case u.AnnotationType.SQUIGGLY:return new D(t);case u.AnnotationType.STRIKEOUT:return new I(t);case u.AnnotationType.STAMP:return new O(t);case u.AnnotationType.FILEATTACHMENT:return new N(t);default:return new a(t)}}}class a{#Qe=!1;constructor(t){var{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,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.parent=t.parent,e&&(this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData(t){var{titleObj:t,contentsObj:e,richText:r}=t;return!!(t?.str||e?.str||r?.str)}get hasPopupData(){return a._hasPopupData(this.data)}_createContainer(t){let{data:i,parent:{page:e,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",i.id),this instanceof m||(s.tabIndex=1e3),s.style.zIndex=this.parent.zIndex++,this.data.popupRef&&s.setAttribute("aria-haspopup","dialog"),i.noRotate&&s.classList.add("norotate");var{pageWidth:a,pageHeight:n,pageX:o,pageY:l}=r.rawDims;if(!i.rect||this instanceof A){let t=i.rotation;i.hasOwnCanvas||0===t||this.setRotation(t,s)}else{var{width:h,height:d}=g(i.rect),c=u.Util.normalizeRect([i.rect[0],e.view[3]-i.rect[1]+e.view[1],i.rect[2],e.view[3]-i.rect[3]+e.view[1]]);if(!t&&0<i.borderStyle.width){s.style.borderWidth=i.borderStyle.width+"px";let e=i.borderStyle.horizontalCornerRadius,r=i.borderStyle.verticalCornerRadius;if(0<e||0<r){let t=`calc(${e}px * var(--scale-factor)) / calc(${r}px * var(--scale-factor))`;s.style.borderRadius=t}else if(this instanceof _){let t=`calc(${h}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;s.style.borderRadius=t}switch(i.borderStyle.style){case u.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case u.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case u.AnnotationBorderStyleType.BEVELED:(0,u.warn)("Unimplemented border style: beveled");break;case u.AnnotationBorderStyleType.INSET:(0,u.warn)("Unimplemented border style: inset");break;case u.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}let t=i.borderColor||null;t?(this.#Qe=!0,s.style.borderColor=u.Util.makeHexColor(0|t[0],0|t[1],0|t[2])):s.style.borderWidth=0}s.style.left=100*(c[0]-o)/a+"%",s.style.top=100*(c[1]-l)/n+"%";t=i.rotation;i.hasOwnCanvas||0===t?(s.style.width=100*h/a+"%",s.style.height=100*d/n+"%"):this.setRotation(t,s)}return s}setRotation(r){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var{pageWidth:s,pageHeight:a}=this.parent.viewport.rawDims,{width:n,height:o}=g(this.data.rect);let t,e;e=r%180==0?(t=100*n/s,100*o/a):(t=100*o/s,100*n/a),i.style.width=t+"%",i.style.height=e+"%",i.setAttribute("data-main-rotation",(360-r)%360)}}get _commonActions(){let e=(t,e,r)=>{var t=r.detail[t],i=t[0],t=t.slice(1);r.target.style[e]=s.ColorConverters[i+"_HTML"](t),this.annotationStorage.setValue(this.data.id,{[e]:s.ColorConverters[i+"_rgb"](t)})};return(0,u.shadow)(this,"_commonActions",{display:t=>{var t=t.detail.display,e=t%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:e,noPrint:1===t||2===t})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{t=t.detail.hidden;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{t=t.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(t,e){var r,i=this._commonActions;for(r of Object.keys(e.detail))(t[r]||i[r])?.(e)}_setDefaultPropertiesFromJS(t){if(this.enableScripting){var e=this.annotationStorage.getRawValue(this.data.id);if(e){var r,i,s=this._commonActions;for([r,i]of Object.entries(e)){var a=s[r];a&&(a({detail:{[r]:i},target:t}),delete e[r])}}}}_createQuadrilaterals(){if(this.container){let m=this.data.quadPoints;if(m){let[h,s,a,d]=this.data.rect;if(1===m.length){let[,{x:t,y:e},{x:r,y:i}]=m[0];if(a===t&&d===e&&h===r&&s===i)return}let r=this.container.style,c;if(this.#Qe){let{borderColor:t,borderWidth:e}=r;r.borderWidth=0,c=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${t}" stroke-width="${e}">`],this.container.classList.add("hasBorder")}let u=a-h,p=d-s,f=this.svgFactory,t=f.createElement("svg"),e=(t.classList.add("quadrilateralsContainer"),t.setAttribute("width",0),t.setAttribute("height",0),f.createElement("defs")),g=(t.append(e),f.createElement("clipPath")),i="clippath_"+this.data.id;g.setAttribute("id",i),g.setAttribute("clipPathUnits","objectBoundingBox"),e.append(g);for(let[,{x:a,y:n},{x:o,y:l}]of m){let t=f.createElement("rect"),e=(o-h)/u,r=(d-n)/p,i=(a-o)/u,s=(n-l)/p;t.setAttribute("x",e),t.setAttribute("y",r),t.setAttribute("width",i),t.setAttribute("height",s),g.append(t),c?.push(`<rect vector-effect="non-scaling-stroke" x="${e}" y="${r}" width="${i}" height="${s}"/>`)}this.#Qe&&(c.push("</g></svg>')"),r.backgroundImage=c.join("")),this.container.append(t),this.container.style.clipPath=`url(#${i})`}}}_createPopup(){var{container:t,data:e}=this,t=(t.setAttribute("aria-haspopup","dialog"),new A({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_"+e.id,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(t.render())}render(){(0,u.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,s=[];if(this._fieldObjects){var a,n,o=this._fieldObjects[t];if(o)for(let{page:t,id:e,exportValues:r}of o)-1!==t&&e!==i&&(a="string"==typeof r?r:null,!(n=document.querySelector(`[data-element-id="${e}"]`))||f.has(n)?s.push({id:e,exportValue:a,domElement:n}):(0,u.warn)("_getElementsByName - element not allowed: "+e))}else for(let r of document.getElementsByName(t)){let t=r.exportValue,e=r.getAttribute("data-element-id");e!==i&&f.has(r)&&s.push({id:e,exportValue:t,domElement:r})}return s}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){var t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(var e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){let{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class r extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!!(1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){var{data:t,linkService:e}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(r,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(r,t.action),i=!0):t.attachment?(this._bindAttachment(r,t.attachment),i=!0):t.setOCGState?(this.#Ze(r,t.setOCGState),i=!0):t.dest?(this._bindLink(r,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),i=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(r),this.container}#tn(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),!e&&""!==e||this.#tn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#tn()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename),!1),this.#tn()}#Ze(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#tn()}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let t of Object.keys(r.actions)){var s=i.get(t);s&&(e[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:t}}),!1))}e.onclick||(e.onclick=()=>!1),this.#tn()}_bindResetFormAction(t,r){let o=t.onclick;o||(t.href=this.linkService.getAnchorUrl("")),this.#tn(),this._fieldObjects?t.onclick=()=>{o?.();let{fields:e,refs:t,include:i}=r,s=[];if(0!==e.length||0!==t.length){let r=new Set(t);for(let t of e){let e=this._fieldObjects[t]||[];for(let{id:t}of e)r.add(t)}for(let e of Object.values(this._fieldObjects))for(let t of e)r.has(t.id)===i&&s.push(t)}else for(let t of Object.values(this._fieldObjects))s.push(...t);var a=this.annotationStorage,n=[];for(let r of s){let e=r.id;switch(n.push(e),r.type){case"text":{let t=r.defaultValue||"";a.setValue(e,{value:t});break}case"checkbox":case"radiobutton":{let t=r.defaultValue===r.exportValues;a.setValue(e,{value:t});break}case"combobox":case"listbox":{let t=r.defaultValue||"";a.setValue(e,{value:t});break}default:continue}let t=document.querySelector(`[data-element-id="${e}"]`);t&&(f.has(t)?t.dispatchEvent(new Event("resetform")):(0,u.warn)("_bindResetFormAction - element not allowed: "+e))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:n,name:"ResetForm"}}),!1}:((0,u.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),o||(t.onclick=()=>!1))}}class l extends a{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");var t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class m extends a{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){var{isWin:e,isMac:r}=u.FeatureTest.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,i,s){r.includes("mouse")?t.addEventListener(r,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(r,t=>{if("blur"===r){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===r){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t)}})})}_setEventListeners(t,e,r,i){for(var[s,a]of r)"Action"!==a&&!this.data.actions?.[a]||("Focus"!==a&&"Blur"!==a||(e||={focused:!1}),this._setEventListener(t,e,s,a,i),"Focus"!==a||this.data.actions?.Blur?"Blur"!==a||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){var e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":u.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e=["left","center","right"],r=this.data.defaultAppearanceData.fontColor,i=this.data.defaultAppearanceData.fontSize||9,s=t.style,a;var n=t=>Math.round(10*t)/10;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(u.LINE_FACTOR*i))||1);a=Math.min(i,n(e/u.LINE_FACTOR))}else{let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(i,n(t/u.LINE_FACTOR))}s.fontSize=`calc(${a}px * var(--scale-factor))`,s.color=u.Util.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class h extends m{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,r,i){var s,a=this.annotationStorage;for(s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=r),a.setValue(s.id,{[i]:r})}render(){let s=this.annotationStorage,h=this.data.id,a=(this.container.classList.add("textWidgetAnnotation"),null);if(this.renderForms){var r=s.getValue(h,{value:this.data.fieldValue});let t=r.value||"";var n=s.getValue(h,{charLimit:this.data.maxLen}).charLimit;n&&t.length>n&&(t=t.slice(0,n));let e=r.formattedValue||this.data.textContent?.join("\n")||null,l=(e&&this.data.comb&&(e=e.replaceAll(/\s+/g,"")),{userValue:t,formattedValue:e,lastCommittedValue:null,commitKey:1,focused:!1}),i=(this.data.multiLine?((a=document.createElement("textarea")).textContent=e??t,this.data.doNotScroll&&(a.style.overflowY="hidden")):((a=document.createElement("input")).type="text",a.setAttribute("value",e??t),this.data.doNotScroll&&(a.style.overflowX="hidden")),this.data.hasOwnCanvas&&(a.hidden=!0),f.add(a),a.setAttribute("data-element-id",h),a.disabled=this.data.readOnly,a.name=this.data.fieldName,a.tabIndex=1e3,this._setRequired(a,this.data.required),n&&(a.maxLength=n),a.addEventListener("input",t=>{s.setValue(h,{value:t.target.value}),this.setPropertyOnSiblings(a,"value",t.target.value,"value"),l.formattedValue=null}),a.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue??"";a.value=l.userValue=e,l.formattedValue=null}),t=>{var e=l.formattedValue;null!=e&&(t.target.value=e),t.target.scrollLeft=0});if(this.enableScripting&&this.hasJSActions){a.addEventListener("focus",t=>{l.focused||(t=t.target,l.userValue&&(t.value=l.userValue),l.lastCommittedValue=t.value,l.commitKey=1,l.focused=!0)}),a.addEventListener("updatefromsandbox",t=>{this.showElementAndHideCanvas(t.target),this._dispatchEventFromSandbox({value(t){l.userValue=t.detail.value??"",s.setValue(h,{value:l.userValue.toString()}),t.target.value=l.userValue},formattedValue(t){var e=t.detail.formattedValue;null!=(l.formattedValue=e)&&t.target!==document.activeElement&&(t.target.value=e),s.setValue(h,{formattedValue:e})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:e=>{var r=e.detail.charLimit,e=e.target;if(0===r)e.removeAttribute("maxLength");else{e.setAttribute("maxLength",r);let t=l.userValue;!t||t.length<=r||(t=t.slice(0,r),e.value=l.userValue=t,s.setValue(h,{value:t}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:t,willCommit:!0,commitKey:1,selStart:e.selectionStart,selEnd:e.selectionEnd}}))}}},t)}),a.addEventListener("keydown",t=>{let e=-(l.commitKey=1);var r;"Escape"===t.key?e=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(l.commitKey=3):e=2,-1!==e&&(r=t.target.value,l.lastCommittedValue!==r)&&(l.lastCommittedValue=r,l.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:r,willCommit:!0,commitKey:e,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let r=i;i=null,a.addEventListener("blur",t=>{var e;l.focused&&t.relatedTarget&&(l.focused=!1,e=t.target.value,l.userValue=e,l.lastCommittedValue!==e&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:e,willCommit:!0,commitKey:l.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),r(t))}),this.data.actions?.Keystroke&&a.addEventListener("beforeinput",t=>{l.lastCommittedValue=null;var{data:e,target:r}=t,{value:i,selectionStart:s,selectionEnd:a}=r;let n=s,o=a;switch(t.inputType){case"deleteWordBackward":{let t=i.substring(0,s).match(/\w*[^\w]*$/);t&&(n-=t[0].length);break}case"deleteWordForward":{let t=i.substring(s).match(/^[^\w]*\w*/);t&&(o+=t[0].length);break}case"deleteContentBackward":s===a&&--n;break;case"deleteContentForward":s===a&&(o+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:i,change:e||"",willCommit:!1,selStart:n,selEnd:o}})}),this._setEventListeners(a,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(i&&a.addEventListener("blur",i),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/n;a.classList.add("comb"),a.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else(a=document.createElement("div")).textContent=this.data.fieldValue,a.style.verticalAlign="middle",a.style.display="table-cell";return this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class d extends m{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class v extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let s=this.annotationStorage,a=this.data,n=a.id,t=s.getValue(n,{value:a.exportValue===a.fieldValue}).value;"string"==typeof t&&(t="Off"!==t,s.setValue(n,{value:t})),this.container.classList.add("buttonWidgetAnnotation","checkBox");var e=document.createElement("input");return f.add(e),e.setAttribute("data-element-id",n),e.disabled=a.readOnly,this._setRequired(e,this.data.required),e.type="checkbox",e.name=a.fieldName,t&&e.setAttribute("checked",!0),e.setAttribute("exportValue",a.exportValue),e.tabIndex=1e3,e.addEventListener("change",t=>{var{name:r,checked:i}=t.target;for(let e of this._getElementsByName(r,n)){let t=i&&e.exportValue===a.exportValue;e.domElement&&(e.domElement.checked=t),s.setValue(e.id,{value:t})}s.setValue(n,{value:i})}),e.addEventListener("resetform",t=>{var e=a.defaultFieldValue||"Off";t.target.checked=e===a.exportValue}),this.enableScripting&&this.hasJSActions&&(e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){t.target.checked="Off"!==t.detail.value,s.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(e,null,[["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(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class _ extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let i=this.annotationStorage,r=this.data,s=r.id,t=i.getValue(s,{value:r.fieldValue===r.buttonValue}).value;"string"==typeof t&&(t=t!==r.buttonValue,i.setValue(s,{value:t}));var a=document.createElement("input");if(f.add(a),a.setAttribute("data-element-id",s),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=r.fieldName,t&&a.setAttribute("checked",!0),a.tabIndex=1e3,a.addEventListener("change",t=>{var{name:e,checked:t}=t.target;for(let t of this._getElementsByName(e,s))i.setValue(t.id,{value:!1});i.setValue(s,{value:t})}),a.addEventListener("resetform",t=>{var e=r.defaultFieldValue;t.target.checked=null!=e&&e===r.buttonValue}),this.enableScripting&&this.hasJSActions){let e=r.buttonValue;a.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value:t=>{var r=e===t.detail.value;for(let e of this._getElementsByName(t.target.name)){let t=r&&e.id===s;e.domElement&&(e.domElement.checked=t),i.setValue(e.id,{value:t})}}},t)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class b extends r{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){var t=super.render(),e=(t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText),t.lastChild);return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class y extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let a=this.annotationStorage,n=this.data.id,r=a.getValue(n,{value:this.data.fieldValue}),o=document.createElement("select"),i=(f.add(o),o.setAttribute("data-element-id",n),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=1e3,this.data.combo&&0<this.data.options.length);this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue;for(let t of o.options)t.selected=t.value===e});for(let e of this.data.options){let t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,r.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),o.append(t)}let s=null;if(i){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),o.prepend(t),s=()=>{t.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}let l=t=>{let e=t?"value":"textContent",{options:r,multiple:i}=o;return i?Array.prototype.filter.call(r,t=>t.selected).map(t=>t[e]):-1===r.selectedIndex?null:r[r.selectedIndex][e]},h=l(!1),d=t=>{t=t.target.options;return Array.prototype.map.call(t,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){s?.();var t=t.detail.value,e=new Set(Array.isArray(t)?t:[t]);for(let t of o.options)t.selected=e.has(t.value);a.setValue(n,{value:l(!0)}),h=l(!1)},multipleSelection(t){o.multiple=!0},remove(t){var e=o.options,r=t.detail.remove;e[r].selected=!1,o.remove(r),0<e.length&&-1===Array.prototype.findIndex.call(e,t=>t.selected)&&(e[0].selected=!0),a.setValue(n,{value:l(!0),items:d(t)}),h=l(!1)},clear(t){for(;0!==o.length;)o.remove(0);a.setValue(n,{value:null,items:[]}),h=l(!1)},insert(t){var{index:e,displayValue:r,exportValue:i}=t.detail.insert,e=o.children[e],s=document.createElement("option");s.textContent=r,s.value=i,e?e.before(s):o.append(s),a.setValue(n,{value:l(!0),items:d(t)}),h=l(!1)},items(t){let e=t.detail.items;for(;0!==o.length;)o.remove(0);for(let i of e){let{displayValue:t,exportValue:e}=i,r=document.createElement("option");r.textContent=t,r.value=e,o.append(r)}0<o.options.length&&(o.options[0].selected=!0),a.setValue(n,{value:l(!0),items:d(t)}),h=l(!1)},indices(e){var r=new Set(e.detail.indices);for(let t of e.target.options)t.selected=r.has(t.index);a.setValue(n,{value:l(!0)}),h=l(!1)},editable(t){t.target.disabled=!t.detail.editable}},t)}),o.addEventListener("input",t=>{var e=l(!0);a.setValue(n,{value:e}),t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:h,changeEx:e,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):o.addEventListener("input",function(t){a.setValue(n,{value:l(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class A extends a{constructor(t){var{data:e,elements:r}=t;super(t,{isRenderable:a._hasPopupData(e)}),this.elements=r}render(){this.container.classList.add("popupAnnotation");var t,e=new S({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),r=[];for(t of this.elements)t.popup=e,r.push(t.data.id),t.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(t=>""+u.AnnotationPrefix+t).join(",")),this.container}}class S{#en=null;#nn=this.#in.bind(this);#rn=this.#sn.bind(this);#an=this.#on.bind(this);#ln=this.#cn.bind(this);#Ue=null;#Rt=null;#hn=null;#dn=null;#un=null;#pn=null;#fn=!1;#gn=null;#mn=null;#bn=null;#vn=null;#yn=!1;constructor(t){var{container:t,color:e,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:n,parent:o,rect:l,parentRect:h,open:d}=t,t=(this.#Rt=t,this.#vn=i,this.#hn=a,this.#bn=n,this.#un=o,this.#Ue=e,this.#mn=l,this.#pn=h,this.#dn=r,c.PDFDateString.toDateObject(s));t&&(this.#en=o.l10n.get("annotation_date_string",{date:t.toLocaleDateString(),time:t.toLocaleTimeString()})),this.trigger=r.flatMap(t=>t.getElementsToTriggerPopup());for(let t of this.trigger)t.addEventListener("click",this.#ln),t.addEventListener("mouseenter",this.#an),t.addEventListener("mouseleave",this.#rn),t.classList.add("popupTriggerArea");for(let t of r)t.container?.addEventListener("keydown",this.#nn);this.#Rt.hidden=!0,d&&this.#cn()}render(){if(!this.#gn){let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:r,pageX:i,pageY:s}}}=this.#un,a=this.#gn=document.createElement("div");if(a.className="popup",this.#Ue){let t=a.style.outlineColor=u.Util.makeHexColor(...this.#Ue);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else a.style.backgroundColor=u.Util.makeHexColor(...this.#Ue.map(t=>Math.floor(.7*(255-t)+t)))}var l=document.createElement("span"),h=(l.className="header",document.createElement("h1"));if(l.append(h),{dir:h.dir,str:h.textContent}=this.#vn,a.append(l),this.#en){let e=document.createElement("span");e.classList.add("popupDate"),this.#en.then(t=>{e.textContent=t}),l.append(e)}h=this.#hn,l=this.#bn;if(!l?.str||h?.str&&h.str!==l.str){let t=this._formatContents(h);a.append(t)}else p.XfaLayer.render({xfaHtml:l.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");let n=!!this.#pn,o=n?this.#pn:this.#mn;for(let t of this.#dn)if(!o||null!==u.Util.intersect(t.data.rect,o)){o=t.data.rect,n=!0;break}var h=u.Util.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),l=n?o[2]-o[0]+5:0,l=h[0]+l,h=h[1],d=this.#Rt.style;d.left=100*(l-i)/e+"%",d.top=100*(h-s)/r+"%",this.#Rt.append(a)}}_formatContents(t){let{str:e,dir:r}=t;var i=document.createElement("p"),s=(i.classList.add("popupContent"),i.dir=r,e.split(/(?:\r\n?|\n)/));for(let e=0,r=s.length;e<r;++e){let t=s[e];i.append(document.createTextNode(t)),e<r-1&&i.append(document.createElement("br"))}return i}#in(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#fn)&&this.#cn()}#cn(){this.#fn=!this.#fn,this.#fn?(this.#on(),this.#Rt.addEventListener("click",this.#ln),this.#Rt.addEventListener("keydown",this.#nn)):(this.#sn(),this.#Rt.removeEventListener("click",this.#ln),this.#Rt.removeEventListener("keydown",this.#nn))}#on(){this.#gn||this.render(),this.isVisible?this.#fn&&this.#Rt.classList.add("focused"):(this.#Rt.hidden=!1,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)+1e3)}#sn(){this.#Rt.classList.remove("focused"),!this.#fn&&this.isVisible&&(this.#Rt.hidden=!0,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)-1e3)}forceHide(){this.#yn=this.isVisible,this.#yn&&(this.#Rt.hidden=!0)}maybeShow(){this.#yn&&(this.#yn=!1,this.#Rt.hidden=!1)}get isVisible(){return!1===this.#Rt.hidden}}class x extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=u.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){var t,e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(t of this.textContent){var r=document.createElement("span");r.textContent=t,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}t.FreeTextAnnotationElement=x;class w extends a{#_n=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),e=this.svgFactory.create(e,r,!0),r=this.#_n=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),e.append(r),this.container.append(e),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#_n}addHighlightArea(){this.container.classList.add("highlightArea")}}class E extends a{#An=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),i=this.svgFactory.create(e,r,!0),s=t.borderStyle.width,a=this.#An=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",e-s),a.setAttribute("height",r-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#An}addHighlightArea(){this.container.classList.add("highlightArea")}}class T extends a{#Sn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),i=this.svgFactory.create(e,r,!0),s=t.borderStyle.width,a=this.#Sn=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",e/2),a.setAttribute("cy",r/2),a.setAttribute("rx",e/2-s/2),a.setAttribute("ry",r/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),i.append(a),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Sn}addHighlightArea(){this.container.classList.add("highlightArea")}}class C extends a{#En=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let i=this.data,{width:t,height:e}=g(i.rect),r=this.svgFactory.create(t,e,!0),s=[];for(let r of i.vertices){let t=r.x-i.rect[0],e=i.rect[3]-r.y;s.push(t+","+e)}s=s.join(" ");var a=this.#En=this.svgFactory.createElement(this.svgElementName);return a.setAttribute("points",s),a.setAttribute("stroke-width",i.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#En}addHighlightArea(){this.container.classList.add("highlightArea")}}class P extends C{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class k extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class M extends a{#xn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=u.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let s=this.data,{width:t,height:e}=g(s.rect),r=this.svgFactory.create(t,e,!0);for(let t of s.inkLists){let i=[];for(let r of t){let t=r.x-s.rect[0],e=s.rect[3]-r.y;i.push(t+","+e)}i=i.join(" ");var a=this.svgFactory.createElement(this.svgElementName);this.#xn.push(a),a.setAttribute("points",i),a.setAttribute("stroke-width",s.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),!s.popupRef&&this.hasPopupData&&this._createPopup(),r.append(a)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return this.#xn}addHighlightArea(){this.container.classList.add("highlightArea")}}t.InkAnnotationElement=M;class R extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class F extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class D extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class I extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class O extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}t.StampAnnotationElement=O;class N extends a{#wn=null;constructor(t){super(t,{isRenderable:!0});var{filename:t,content:e}=this.data.file;this.filename=(0,c.getFilenameFromUrl)(t,!0),this.content=e,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:t,content:e})}render(){this.container.classList.add("fileAttachmentAnnotation");var{container:t,data:e}=this;let r,i=(e.hasAppearance||0===e.fillAlpha?r=document.createElement("div"):((r=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),r.addEventListener("dblclick",this.#Cn.bind(this)),this.#wn=r,u.FeatureTest.platform).isMac;return t.addEventListener("keydown",t=>{"Enter"===t.key&&(i?t.metaKey:t.ctrlKey)&&this.#Cn()}),!e.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),t.append(r),t}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}t.AnnotationLayer=class{#Se=null;#Tn=null;#Pn=new Map;constructor(t){var{div:t,accessibilityManager:e,annotationCanvasMap:r,l10n:i,page:s,viewport:a}=t;this.div=t,this.#Se=e,this.#Tn=r,this.l10n=i,this.page=s,this.viewport=a,this.zIndex=0,this.l10n||=n.NullL10n}#kn(t,e){var r=t.firstChild||t;r.id=""+u.AnnotationPrefix+e,this.div.append(t),this.#Se?.moveElementInDOM(this.div,t,r,!1)}async render(t){let e=t.annotations,r=this.div;(0,c.setLayerDimensions)(r,this.viewport);var s=new Map,a={data:null,layer:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new c.DOMSVGFactory,annotationStorage:t.annotationStorage||new i.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let i of e)if(!i.noHTML){let e=i.annotationType===u.AnnotationType.POPUP;if(e){let t=s.get(i.id);if(!t)continue;a.elements=t}else{let{width:t,height:e}=g(i.rect);if(t<=0||e<=0)continue}a.data=i;let r=o.create(a);if(r.isRenderable){if(!e&&i.popupRef){let t=s.get(i.popupRef);t?t.push(r):s.set(i.popupRef,[r])}0<r.annotationEditorType&&this.#Pn.set(r.data.id,r);let t=r.render();i.hidden&&(t.style.visibility="hidden"),this.#kn(t,i.id)}}this.#Mn(),await this.l10n.translate(r)}update(t){var t=t.viewport,e=this.div;this.viewport=t,(0,c.setLayerDimensions)(e,{rotation:t.rotation}),this.#Mn(),e.hidden=!1}#Mn(){if(this.#Tn){var t,e,r=this.div;for([t,e]of this.#Tn){var i,s=r.querySelector(`[data-annotation-id="${t}"]`);s&&(i=s.firstChild,i?"CANVAS"===i.nodeName?i.replaceWith(e):i.before(e):s.append(e))}this.#Tn.clear()}}getEditableAnnotations(){return Array.from(this.#Pn.values())}getEditableAnnotation(t){return this.#Pn.get(t)}}},(t,e)=>{function r(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function s(t){return Math.max(0,Math.min(255,255*t))}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G(t){var[t,e,r,i]=t;return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK(t){var[t]=t;return["CMYK",0,0,0,1-t]}static G_RGB(t){var[t]=t;return["RGB",t,t,t]}static G_rgb(t){var[t]=t;return[t=s(t),t,t]}static G_HTML(t){var[t]=t,t=r(t);return"#"+t+t+t}static RGB_G(t){var[t,e,r]=t;return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(s)}static RGB_HTML(t){return"#"+t.map(r).join("")}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){var[t,e,r,i]=t;return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb(t){var[t,e,r,i]=t;return[s(1-Math.min(1,t+i)),s(1-Math.min(1,r+i)),s(1-Math.min(1,e+i))]}static CMYK_HTML(t){t=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(t){var[t,e,r]=t,t=1-t,e=1-e,r=1-r;return["CMYK",t,e,r,Math.min(t,e,r)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=i;let r={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative",print_progress_percent:"{{progress}}%"};function i(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return r[t]||""}e.NullL10n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){var r,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:i(t,e),(r=e)?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(t,e)=>e in r?r[e]:"{{"+e+"}}"):t},async translate(t){}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0,r(89);var c=r(194);e.XfaLayer=class{static setupStorage(t,e,r,i,s){var a=i.getValue(e,{value:null});switch(r.name){case"textarea":null!==a.value&&(t.textContent=a.value),"print"!==s&&t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})});break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(a.value===r.attributes.xfaOn?t.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===s)break;t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})})}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(let t of r.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{t=t.target.options,t=-1===t.selectedIndex?"":t[t.selectedIndex].value;i.setValue(e,{value:t})})}}static setAttributes(t){let{html:r,element:e,storage:i=null,intent:s,linkService:a}=t;var n=e.attributes,o=r instanceof HTMLAnchorElement;"radio"===n.type&&(n.name=n.name+"-"+s);for(let[t,e]of Object.entries(n))if(null!=e)switch(t){case"class":e.length&&r.setAttribute(t,e.join(" "));break;case"dataId":break;case"id":r.setAttribute("data-element-id",e);break;case"style":Object.assign(r.style,e);break;case"textContent":r.textContent=e;break;default:o&&("href"===t||"newWindow"===t)||r.setAttribute(t,e)}o&&a.addLinkAttributes(r,n.href,n.newWindow),i&&n.dataId&&this.setupStorage(r,n.dataId,e,i)}static render(e){let i=e.annotationStorage,s=e.linkService,t=e.xfaHtml,a=e.intent||"display",r=document.createElement(t.name),n=(t.attributes&&this.setAttributes({html:r,element:t,intent:a,linkService:s}),[[t,-1,r]]),o=e.div;if(o.append(r),e.viewport){let t=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=t}"richText"!==a&&o.setAttribute("class","xfaLayer xfaFont");for(var l=[];0<n.length;){let[t,e,r]=n.at(-1);if(e+1===t.children.length)n.pop();else{let e=t.children[++n.at(-1)[1]];if(null!==e){var h=e.name;if("#text"===h){let t=document.createTextNode(e.value);l.push(t),r.append(t)}else{var d=e?.attributes?.xmlns?document.createElementNS(e.attributes.xmlns,h):document.createElement(h);if(r.append(d),e.attributes&&this.setAttributes({html:d,element:e,storage:i,intent:a,linkService:s}),e.children&&0<e.children.length)n.push([e,-1,d]);else if(e.value){let t=document.createTextNode(e.value);c.XfaText.shouldBuildText(h)&&l.push(t),d.append(t)}}}}}for(let t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){var e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,r(89),r(2);var h=r(1),l=r(164),g=r(198),i=r(168),n=r(165);class _ extends l.AnnotationEditor{#Fn=0;#Rn=0;#Dn=this.canvasPointermove.bind(this);#In=this.canvasPointerleave.bind(this);#On=this.canvasPointerup.bind(this);#Ln=this.canvasPointerdown.bind(this);#Nn=new Path2D;#Bn=!1;#jn=!1;#Un=!1;#zn=null;#Wn=0;#Hn=0;#qn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t){l.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case h.AnnotationEditorParamsType.INK_THICKNESS:_._defaultThickness=e;break;case h.AnnotationEditorParamsType.INK_COLOR:_._defaultColor=e;break;case h.AnnotationEditorParamsType.INK_OPACITY:_._defaultOpacity=e/100}}updateParams(t,e){switch(t){case h.AnnotationEditorParamsType.INK_THICKNESS:this.#Gn(e);break;case h.AnnotationEditorParamsType.INK_COLOR:this.#Ve(e);break;case h.AnnotationEditorParamsType.INK_OPACITY:this.#Vn(e)}}static get defaultPropertiesToUpdate(){return[[h.AnnotationEditorParamsType.INK_THICKNESS,_._defaultThickness],[h.AnnotationEditorParamsType.INK_COLOR,_._defaultColor||l.AnnotationEditor._defaultLineColor],[h.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*_._defaultOpacity)]]}get propertiesToUpdate(){return[[h.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||_._defaultThickness],[h.AnnotationEditorParamsType.INK_COLOR,this.color||_._defaultColor||l.AnnotationEditor._defaultLineColor],[h.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??_._defaultOpacity))]]}#Gn(t){let e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#$n()},undo:()=>{this.thickness=e,this.#$n()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){let e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#Xn()},undo:()=>{this.color=e,this.#Xn()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vn(t){t/=100;let e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#Xn()},undo:()=>{this.opacity=e,this.#Xn()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div)&&(this.canvas||(this.#Kn(),this.#Yn()),this.isAttachedToDOM||(this.parent.add(this),this.#Jn()),this.#$n())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#zn.disconnect(),this.#zn=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){var[t,e]=this.parentDimensions,t=this.width*t,e=this.height*e;this.setDimensions(t,e)}enableEditMode(){this.#Bn||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ln))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ln))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Qn(){var{parentRotation:t,parentDimensions:[e,r]}=this;switch(t){case 90:return[0,r,r,e];case 180:return[e,r,e,r];case 270:return[e,0,r,e];default:return[0,0,e,r]}}#Zn(){var{ctx:t,color:e,opacity:r,thickness:i,parentScale:s,scaleFactor:a}=this;t.lineWidth=i*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=""+e+(0,n.opacityToHex)(r)}#ti(t,e){this.canvas.addEventListener("contextmenu",i.noContextMenu),this.canvas.addEventListener("pointerleave",this.#In),this.canvas.addEventListener("pointermove",this.#Dn),this.canvas.addEventListener("pointerup",this.#On),this.canvas.removeEventListener("pointerdown",this.#Ln),this.isEditing=!0,this.#Un||(this.#Un=!0,this.#Jn(),this.thickness||=_._defaultThickness,this.color||=_._defaultColor||l.AnnotationEditor._defaultLineColor,this.opacity??=_._defaultOpacity),this.currentPath.push([t,e]),this.#jn=!1,this.#Zn(),this.#qn=()=>{this.#ei(),this.#qn&&window.requestAnimationFrame(this.#qn)},window.requestAnimationFrame(this.#qn)}#ni(e,r){var[i,t]=this.currentPath.at(-1);if(!(1<this.currentPath.length&&e===i&&r===t)){i=this.currentPath;let t=this.#Nn;i.push([e,r]),this.#jn=!0,i.length<=2?(t.moveTo(...i[0]),t.lineTo(e,r)):(3===i.length&&(this.#Nn=t=new Path2D,t.moveTo(...i[0])),this.#ii(t,...i.at(-3),...i.at(-2),e,r))}}#ri(){var t;0!==this.currentPath.length&&(t=this.currentPath.at(-1),this.#Nn.lineTo(...t))}#si(e,r){this.#qn=null,e=Math.min(Math.max(e,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),this.#ni(e,r),this.#ri();let i;if(1!==this.currentPath.length)i=this.#ai();else{let t=[e,r];i=[[t,t.slice(),t.slice(),t]]}let t=this.#Nn,s=this.currentPath;this.currentPath=[],this.#Nn=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(t),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Kn(),this.#Yn()),this.#$n())},mustExec:!0})}#ei(){if(this.#jn){this.#jn=!1;let t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),r=e.map(t=>t[0]),i=e.map(t=>t[1]),s=(Math.min(...r),Math.max(...r),Math.min(...i),Math.max(...i),this).ctx;s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(let t of this.bezierPath2D)s.stroke(t);s.stroke(this.#Nn),s.restore()}}#ii(t,e,r,i,s,a,n){e=(e+i)/2,r=(r+s)/2,a=(i+a)/2,n=(s+n)/2;t.bezierCurveTo(e+2*(i-e)/3,r+2*(s-r)/3,a+2*(i-a)/3,n+2*(s-n)/3,a,n)}#ai(){var l=this.currentPath;if(l.length<=2)return[[l[0],l[0],l.at(-1),l.at(-1)]];var h=[];let d,[c,u]=l[0];for(d=1;d<l.length-2;d++){let[t,e]=l[d],[r,i]=l[d+1],s=(t+r)/2,a=(e+i)/2,n=[c+2*(t-c)/3,u+2*(e-u)/3],o=[s+2*(t-s)/3,a+2*(e-a)/3];h.push([[c,u],n,o,[s,a]]),[c,u]=[s,a]}let[t,e]=l[d],[r,i]=l[d+1],s=[c+2*(t-c)/3,u+2*(e-u)/3],a=[r+2*(t-r)/3,i+2*(e-i)/3];return h.push([[c,u],s,a,[r,i]]),h}#Xn(){if(this.isEmpty())this.#oi();else{this.#Zn();let{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#oi();for(let t of this.bezierPath2D)e.stroke(t)}}commit(){this.#Bn||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Bn=!0,this.div.classList.add("disabled"),this.#$n(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#Bn&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),this.#ti(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#ni(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#li(t)}canvasPointerleave(t){this.#li(t)}#li(t){this.canvas.removeEventListener("pointerleave",this.#In),this.canvas.removeEventListener("pointermove",this.#Dn),this.canvas.removeEventListener("pointerup",this.#On),this.canvas.addEventListener("pointerdown",this.#Ln),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",i.noContextMenu)},10),this.#si(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Kn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#zn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(!this.div){let r,i,[t,e,s,a]=(this.width&&(r=this.x,i=this.y),super.render(),l.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(t=>this.div?.setAttribute("aria-label",t)),this.#Qn());if(this.setAt(t,e,0,0),this.setDims(s,a),this.#Kn(),this.width){let[t,e]=this.parentDimensions;this.setAspectRatio(this.width*t,this.height*e),this.setAt(r*t,i*e,this.width*t,this.height*e),this.#Un=!0,this.#Jn(),this.setDims(this.width*t,this.height*e),this.#Xn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();this.#Yn()}return this.div}#Jn(){var t,e;this.#Un&&([t,e]=this.parentDimensions,this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#oi())}setDimensions(t,e){var r=Math.round(t),i=Math.round(e);this.#Wn===r&&this.#Hn===i||(this.#Wn=r,this.#Hn=i,this.canvas.style.visibility="hidden",[r,i]=this.parentDimensions,this.width=t/r,this.height=e/i,this.fixAndSetPosition(),this.#Bn&&this.#ci(t,e),this.#Jn(),this.#Xn(),this.canvas.style.visibility="visible",this.fixDims())}#ci(t,e){var r=this.#hi(),t=(t-r)/this.#Rn,e=(e-r)/this.#Fn;this.scaleFactor=Math.min(t,e)}#oi(){var t=this.#hi()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#di(r){var i=new Path2D;for(let t=0,e=r.length;t<e;t++){var[s,a,n,o]=r[t];0===t&&i.moveTo(...s),i.bezierCurveTo(a[0],a[1],n[0],n[1],o[0],o[1])}return i}static#ui(r,t,e){var[i,s,a,n]=t;switch(e){case 0:for(let t=0,e=r.length;t<e;t+=2)r[t]+=i,r[t+1]=n-r[t+1];break;case 90:for(let e=0,t=r.length;e<t;e+=2){let t=r[e];r[e]=r[e+1]+i,r[e+1]=t+s}break;case 180:for(let t=0,e=r.length;t<e;t+=2)r[t]=a-r[t],r[t+1]+=s;break;case 270:for(let e=0,t=r.length;e<t;e+=2){let t=r[e];r[e]=a-r[e+1],r[e+1]=n-t}break;default:throw new Error("Invalid rotation")}return r}static#pi(r,t,e){var[i,s,a,n]=t;switch(e){case 0:for(let t=0,e=r.length;t<e;t+=2)r[t]-=i,r[t+1]=n-r[t+1];break;case 90:for(let e=0,t=r.length;e<t;e+=2){let t=r[e];r[e]=r[e+1]-s,r[e+1]=t-i}break;case 180:for(let t=0,e=r.length;t<e;t+=2)r[t]=a-r[t],r[t+1]-=s;break;case 270:for(let e=0,t=r.length;e<t;e+=2){let t=r[e];r[e]=n-r[e+1],r[e+1]=a-t}break;default:throw new Error("Invalid rotation")}return r}#fi(a,t,e,n){let o=[],r=this.thickness/2,l=a*t+r,h=a*e+r;for(let s of this.paths){let r=[],i=[];for(let t=0,e=s.length;t<e;t++){var[d,c,u,p]=s[t],f=a*d[0]+l,d=a*d[1]+h,g=a*c[0]+l,c=a*c[1]+h,m=a*u[0]+l,u=a*u[1]+h,v=a*p[0]+l,p=a*p[1]+h;0===t&&(r.push(f,d),i.push(f,d)),r.push(g,c,m,u,v,p),i.push(g,c),t===e-1&&i.push(v,p)}o.push({bezier:_.#ui(r,n,this.rotation),points:_.#ui(i,n,this.rotation)})}return o}#gi(){let t=1/0,e=-1/0,r=1/0,i=-1/0;for(var s of this.paths)for(var[a,n,o,l]of s){a=h.Util.bezierBoundingBox(...a,...n,...o,...l);t=Math.min(t,a[0]),r=Math.min(r,a[1]),e=Math.max(e,a[2]),i=Math.max(i,a[3])}return[t,r,e,i]}#hi(){return this.#Bn?Math.ceil(this.thickness*this.parentScale):0}#$n(){var t,e,r,i,s,a,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.isEmpty()||(this.#Bn?(a=this.#gi(),t=this.#hi(),this.#Rn=Math.max(l.AnnotationEditor.MIN_SIZE,a[2]-a[0]),this.#Fn=Math.max(l.AnnotationEditor.MIN_SIZE,a[3]-a[1]),e=Math.ceil(t+this.#Rn*this.scaleFactor),r=Math.ceil(t+this.#Fn*this.scaleFactor),[i,s]=this.parentDimensions,this.width=e/i,this.height=r/s,this.setAspectRatio(e,r),i=this.translationX,s=this.translationY,this.translationX=-a[0],this.translationY=-a[1],this.#Jn(),this.#Xn(),this.#Wn=e,this.#Hn=r,this.setDims(e,r),a=n?t/this.scaleFactor/2:0,this.translate(i-this.translationX-a,s-this.translationY-a)):this.#Xn())}static deserialize(t,e,r){if(t instanceof g.InkAnnotationElement)return null;let i=super.deserialize(t,e,r),[s,a]=(i.thickness=t.thickness,i.color=h.Util.makeHexColor(...t.color),i.opacity=t.opacity,i.pageDimensions),n=i.width*s,o=i.height*a,d=i.parentScale,c=t.thickness/2;i.#Bn=!0,i.#Wn=Math.round(n),i.#Hn=Math.round(o);var u,{paths:e,rect:p,rotation:f}=t;for({bezier:u}of e){u=_.#pi(u,p,f);let o=[],l=(i.paths.push(o),d*(u[0]-c)),h=d*(u[1]-c);for(let n=2,t=u.length;n<t;n+=6){let t=d*(u[n]-c),e=d*(u[n+1]-c),r=d*(u[n+2]-c),i=d*(u[n+3]-c),s=d*(u[n+4]-c),a=d*(u[n+5]-c);o.push([[l,h],[t,e],[r,i],[s,a]]),l=s,h=a}let t=this.#di(o);i.bezierPath2D.push(t)}r=i.#gi();return i.#Rn=Math.max(l.AnnotationEditor.MIN_SIZE,r[2]-r[0]),i.#Fn=Math.max(l.AnnotationEditor.MIN_SIZE,r[3]-r[1]),i.#ci(n,o),i}serialize(){var t,e;return this.isEmpty()?null:(t=this.getRect(0,0),e=l.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle),{annotationType:h.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#fi(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId})}}e.InkEditor=_},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0,r(149),r(152);var a=r(1),i=r(164),n=r(168),o=r(198);class s extends i.AnnotationEditor{#mi=null;#bi=null;#vi=null;#yi=null;#_i=null;#Ai=null;#zn=null;#Si=null;#Ei=!1;#xi=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"}),this.#yi=t.bitmapUrl,this.#_i=t.bitmapFile}static initialize(t){i.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,a.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/"+t))}static get supportedTypesStr(){return(0,a.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(a.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#wi(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];t?(this.#mi=t.bitmap,e||(this.#bi=t.id,this.#Ei=t.isSvg),this.#Kn()):this.remove()}#Ci(){this.#vi=null,this._uiManager.enableWaiting(!1),this.#Ai&&this.div.focus()}#Ti(){if(this.#bi)this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#bi).then(t=>this.#wi(t,!0)).finally(()=>this.#Ci());else if(this.#yi){let t=this.#yi;this.#yi=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else if(this.#_i){let t=this.#_i;this.#_i=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromFile(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else{let e=document.createElement("input");e.type="file",e.accept=s.supportedTypesStr,this.#vi=new Promise(t=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this.#wi(t)}else this.remove();t()}),e.addEventListener("cancel",()=>{this.remove(),t()})}).finally(()=>this.#Ci()),e.click()}}remove(){this.#bi&&(this.#mi=null,this._uiManager.imageManager.deleteId(this.#bi),this.#Ai?.remove(),this.#Ai=null,this.#zn?.disconnect(),this.#zn=null),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#bi&&this.#Ti(),this.isAttachedToDOM||this.parent.add(this))):this.#bi&&this.#Ti()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#vi||this.#mi||this.#yi||this.#_i)}get isResizable(){return!0}render(){if(!this.div){let t,e;var r,i;this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#mi?this.#Kn():this.#Ti(),this.width&&([r,i]=this.parentDimensions,this.setAt(t*r,e*i,this.width*r,this.height*i))}return this.div}#Kn(){let t=this.div,{width:e,height:r}=this.#mi;var[i,s]=this.pageDimensions;if(this.width)e=this.width*i,r=this.height*s;else if(e>.75*i||r>.75*s){let t=Math.min(.75*i/e,.75*s/r);e*=t,r*=t}var[a,n]=this.parentDimensions,a=(this.setDims(e*a/i,r*n/s),this._uiManager.enableWaiting(!1),this.#Ai=document.createElement("canvas"));t.append(a),t.hidden=!1,this.#Pi(e,r),this.#Yn(),this.#xi||(this.parent.addUndoableEditor(this),this.#xi=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#ki(t,e){var[r,i]=this.parentDimensions;this.width=t/r,this.height=e/i,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),(this._initialOptions=null)!==this.#Si&&clearTimeout(this.#Si),this.#Si=setTimeout(()=>{this.#Si=null,this.#Pi(t,e)},200)}#Mi(r,i){let{width:t,height:e}=this.#mi,s=t,a=e,n=this.#mi;for(;s>2*r||a>2*i;){let t=s,e=a;s>2*r&&(s=16384<=s?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*i&&(a=16384<=a?Math.floor(a/2)-1:Math.ceil(a/2));var o=new OffscreenCanvas(s,a);o.getContext("2d").drawImage(n,0,0,t,e,0,0,s,a),n=o.transferToImageBitmap()}return n}#Pi(t,e){t=Math.ceil(t),e=Math.ceil(e);var r,i=this.#Ai;!i||i.width===t&&i.height===e||(i.width=t,i.height=e,r=this.#Ei?this.#mi:this.#Mi(t,e),(i=i.getContext("2d")).filter=this._uiManager.hcmFilter,i.drawImage(r,0,0,r.width,r.height,0,0,t,e))}#Fi(t){if(t){if(this.#Ei){let t=this._uiManager.imageManager.getSvgUrl(this.#bi);if(t)return t}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#mi,t.getContext("2d").drawImage(this.#mi,0,0),t.toDataURL()}if(this.#Ei){let[t,e]=this.pageDimensions,r=Math.round(this.width*t*n.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*n.PixelsPerInch.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(r,i);return s.getContext("2d").drawImage(this.#mi,0,0,this.#mi.width,this.#mi.height,0,0,r,i),s.transferToImageBitmap()}return structuredClone(this.#mi)}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.#ki(t.width,t.height)}),this.#zn.observe(this.div)}static deserialize(t,e,r){var i,s,a,n;return t instanceof o.StampAnnotationElement?null:(e=super.deserialize(t,e,r),{rect:t,bitmapUrl:i,bitmapId:n,isSvg:s,accessibilityData:a}=t,[r,n]=(n&&r.imageManager.isValidId(n)?e.#bi=n:e.#yi=i,e.#Ei=s,e.pageDimensions),e.width=(t[2]-t[0])/r,e.height=(t[3]-t[1])/n,a&&(e.altTextData=a),e)}serialize(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var r={annotationType:a.AnnotationEditorType.STAMP,bitmapId:this.#bi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Ei,structTreeParentId:this._structTreeParentId};if(t)r.bitmapUrl=this.#Fi(!0),r.accessibilityData=this.altTextData;else{var{decorative:i,altText:s}=this.altTextData;if(!i&&s&&(r.accessibilityData={type:"Figure",alt:s}),null!==e){e.stamps||=new Map;i=this.#Ei?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(e.stamps.has(this.#bi)){if(this.#Ei){let t=e.stamps.get(this.#bi);i>t.area&&(t.area=i,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Fi(!1))}}else e.stamps.set(this.#bi,{area:i,serialized:r}),r.bitmap=this.#Fi(!1)}}return r}}e.StampEditor=s}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];return void 0!==e||(e=__webpack_module_cache__[t]={exports:{}},__webpack_modules__[t].call(e.exports,e,e.exports,__w_pdfjs_require__)),e.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__,e=(Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return n.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"DOMSVGFactory",{enumerable:!0,get:function(){return i.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return r.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return r.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return r.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return r.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return r.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return i.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),__w_pdfjs_require__(1)),r=__w_pdfjs_require__(124),i=__w_pdfjs_require__(168),s=__w_pdfjs_require__(195),a=__w_pdfjs_require__(196),n=__w_pdfjs_require__(165),o=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),h=__w_pdfjs_require__(201)})(),__webpack_exports__})()); |