You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
384KB

  1. var tr=Object.defineProperty;var er=(k,l,t)=>l in k?tr(k,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):k[l]=t;var ee=(k,l,t)=>(er(k,typeof l!="symbol"?l+"":l,t),t),Be=(k,l,t)=>{if(!l.has(k))throw TypeError("Cannot "+t)};var r=(k,l,t)=>(Be(k,l,"read from private field"),t?t.call(k):l.get(k)),X=(k,l,t)=>{if(l.has(k))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(k):l.set(k,t)},at=(k,l,t,e)=>(Be(k,l,"write to private field"),e?e.call(k,t):l.set(k,t),t);var ge=(k,l,t,e)=>({set _(n){at(k,l,n,t)},get _(){return r(k,l,e)}}),j=(k,l,t)=>(Be(k,l,"access private method"),t);import{ag as getAugmentedNamespace,ah as commonjsGlobal}from"./index-dd5fae99.js";function commonjsRequire(k){throw new Error('Could not dynamically require "'+k+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$6=getAugmentedNamespace(__viteBrowserExternal$1);var path2dPolyfill_esm={},hasRequiredPath2dPolyfill_esm;function requirePath2dPolyfill_esm(){if(hasRequiredPath2dPolyfill_esm)return path2dPolyfill_esm;hasRequiredPath2dPolyfill_esm=1;function k(d,a,i){if(i||arguments.length===2)for(var f=0,E=a.length,O;f<E;f++)(O||!(f in a))&&(O||(O=Array.prototype.slice.call(a,0,f)),O[f]=a[f]);return d.concat(O||Array.prototype.slice.call(a))}var l={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/gi,e=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function n(d){var a=d.match(e);return a?a.map(Number):[]}function c(d){var a=[],i=String(d).trim();return i[0]!=="M"&&i[0]!=="m"||i.replace(t,function(f,E,O){var R=n(O),u=E.toLowerCase(),m=E;if(u==="m"&&R.length>2&&(a.push(k([m],R.splice(0,2),!0)),u="l",m=m==="m"?"l":"L"),R.length<l[u])return"";for(a.push(k([m],R.splice(0,l[u]),!0));R.length>=l[u]&&R.length&&l[u];)a.push(k([m],R.splice(0,l[u]),!0));return""}),a}function b(d,a){var i=d.x*Math.cos(a)-d.y*Math.sin(a),f=d.y*Math.cos(a)+d.x*Math.sin(a);d.x=i,d.y=f}function F(d,a,i){d.x+=a,d.y+=i}function C(d,a){d.x*=a,d.y*=a}var S=function(){function d(a){var i;this.commands=[],a&&a instanceof d?(i=this.commands).push.apply(i,a.commands):a&&(this.commands=c(a))}return d.prototype.addPath=function(a){var i;a&&a instanceof d&&(i=this.commands).push.apply(i,a.commands)},d.prototype.moveTo=function(a,i){this.commands.push(["M",a,i])},d.prototype.lineTo=function(a,i){this.commands.push(["L",a,i])},d.prototype.arc=function(a,i,f,E,O,R){this.commands.push(["AC",a,i,f,E,O,!!R])},d.prototype.arcTo=function(a,i,f,E,O){this.commands.push(["AT",a,i,f,E,O])},d.prototype.ellipse=function(a,i,f,E,O,R,u,m){this.commands.push(["E",a,i,f,E,O,R,u,!!m])},d.prototype.closePath=function(){this.commands.push(["Z"])},d.prototype.bezierCurveTo=function(a,i,f,E,O,R){this.commands.push(["C",a,i,f,E,O,R])},d.prototype.quadraticCurveTo=function(a,i,f,E){this.commands.push(["Q",a,i,f,E])},d.prototype.rect=function(a,i,f,E){this.commands.push(["R",a,i,f,E])},d.prototype.roundRect=function(a,i,f,E,O){typeof O>"u"?this.commands.push(["RR",a,i,f,E,0]):this.commands.push(["RR",a,i,f,E,O])},d}();function v(d,a){var i=0,f=0,E,O,R,u,m,L,w,y,N,D,V,K,U,_,nt,rt,Y,st,gt,At,wt,W=null,h=null,g=null,s=null,p=null,A=null;d.beginPath();for(var I=0;I<a.length;++I){st=a[I][0],st!=="S"&&st!=="s"&&st!=="C"&&st!=="c"&&(W=null,h=null),st!=="T"&&st!=="t"&&st!=="Q"&&st!=="q"&&(g=null,s=null);var P=void 0;switch(st){case"m":case"M":P=a[I],st==="m"?(i+=P[1],f+=P[2]):(i=P[1],f=P[2]),(st==="M"||!p)&&(p={x:i,y:f}),d.moveTo(i,f);break;case"l":P=a[I],i+=P[1],f+=P[2],d.lineTo(i,f);break;case"L":P=a[I],i=P[1],f=P[2],d.lineTo(i,f);break;case"H":P=a[I],i=P[1],d.lineTo(i,f);break;case"h":P=a[I],i+=P[1],d.lineTo(i,f);break;case"V":P=a[I],f=P[1],d.lineTo(i,f);break;case"v":P=a[I],f+=P[1],d.lineTo(i,f);break;case"a":case"A":if(P=a[I],A===null)throw new Error("This should never happen");st==="a"?(i+=P[6],f+=P[7]):(i=P[6],f=P[7]),_=P[1],nt=P[2],w=P[3]*Math.PI/180,R=!!P[4],u=!!P[5],m={x:i,y:f},L={x:(A.x-m.x)/2,y:(A.y-m.y)/2},b(L,-w),y=L.x*L.x/(_*_)+L.y*L.y/(nt*nt),y>1&&(y=Math.sqrt(y),_*=y,nt*=y),gt={x:_*L.y/nt,y:-(nt*L.x)/_},N=_*_*nt*nt,D=_*_*L.y*L.y+nt*nt*L.x*L.x,u!==R?C(gt,Math.sqrt((N-D)/D)||0):C(gt,-Math.sqrt((N-D)/D)||0),O=Math.atan2((L.y-gt.y)/nt,(L.x-gt.x)/_),E=Math.atan2(-(L.y+gt.y)/nt,-(L.x+gt.x)/_),b(gt,w),F(gt,(m.x+A.x)/2,(m.y+A.y)/2),d.save(),d.translate(gt.x,gt.y),d.rotate(w),d.scale(_,nt),d.arc(0,0,1,O,E,!u),d.restore();break;case"C":P=a[I],W=P[3],h=P[4],i=P[5],f=P[6],d.bezierCurveTo(P[1],P[2],W,h,i,f);break;case"c":P=a[I],d.bezierCurveTo(P[1]+i,P[2]+f,P[3]+i,P[4]+f,P[5]+i,P[6]+f),W=P[3]+i,h=P[4]+f,i+=P[5],f+=P[6];break;case"S":P=a[I],(W===null||h===null)&&(W=i,h=f),d.bezierCurveTo(2*i-W,2*f-h,P[1],P[2],P[3],P[4]),W=P[1],h=P[2],i=P[3],f=P[4];break;case"s":P=a[I],(W===null||h===null)&&(W=i,h=f),d.bezierCurveTo(2*i-W,2*f-h,P[1]+i,P[2]+f,P[3]+i,P[4]+f),W=P[1]+i,h=P[2]+f,i+=P[3],f+=P[4];break;case"Q":P=a[I],g=P[1],s=P[2],i=P[3],f=P[4],d.quadraticCurveTo(g,s,i,f);break;case"q":P=a[I],g=P[1]+i,s=P[2]+f,i+=P[3],f+=P[4],d.quadraticCurveTo(g,s,i,f);break;case"T":P=a[I],(g===null||s===null)&&(g=i,s=f),g=2*i-g,s=2*f-s,i=P[1],f=P[2],d.quadraticCurveTo(g,s,i,f);break;case"t":P=a[I],(g===null||s===null)&&(g=i,s=f),g=2*i-g,s=2*f-s,i+=P[1],f+=P[2],d.quadraticCurveTo(g,s,i,f);break;case"z":case"Z":p&&(i=p.x,f=p.y),p=null,d.closePath();break;case"AC":P=a[I],i=P[1],f=P[2],U=P[3],O=P[4],E=P[5],At=P[6],d.arc(i,f,U,O,E,At);break;case"AT":P=a[I],V=P[1],K=P[2],i=P[3],f=P[4],U=P[5],d.arcTo(V,K,i,f,U);break;case"E":P=a[I],i=P[1],f=P[2],_=P[3],nt=P[4],w=P[5],O=P[6],E=P[7],At=P[8],d.save(),d.translate(i,f),d.rotate(w),d.scale(_,nt),d.arc(0,0,1,O,E,At),d.restore();break;case"R":P=a[I],i=P[1],f=P[2],rt=P[3],Y=P[4],p={x:i,y:f},d.rect(i,f,rt,Y);break;case"RR":P=a[I],i=P[1],f=P[2],rt=P[3],Y=P[4],wt=P[5],p={x:i,y:f},d.roundRect(i,f,rt,Y,wt);break}A?(A.x=i,A.y=f):A={x:i,y:f}}}function M(d){if(!(!d||!d.CanvasRenderingContext2D||d.Path2D)){var a=d.CanvasRenderingContext2D,i=a.prototype.fill,f=a.prototype.stroke,E=a.prototype.isPointInPath;a.prototype.fill=function(){for(var R=[],u=0;u<arguments.length;u++)R[u]=arguments[u];if(R[0]instanceof S){var m=R[0],L=R[1]||"nonzero";v(this,m.commands),i.apply(this,[L])}else{var L=R[0]||"nonzero";return i.apply(this,[L])}},a.prototype.stroke=function(R){R&&v(this,R.commands),f.apply(this)},a.prototype.isPointInPath=function(){for(var R=[],u=0;u<arguments.length;u++)R[u]=arguments[u];if(R[0]instanceof S){var m=R[0],L=R[1],w=R[2],y=R[3]||"nonzero";return v(this,m.commands),E.apply(this,[L,w,y])}else return E.apply(this,R)},d.Path2D=S}}function x(d,a,i,f,E){var O=this;if(E===void 0&&(E=0),typeof E=="number"&&(E=[E]),Array.isArray(E)){if(E.length===0||E.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(E.length," radii provided. Between one and four radii are necessary."));E.forEach(function(y){if(y<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(O.constructor.name,"': Radius value ").concat(y," is negative."))})}else return;if(E.length===1&&E[0]===0)return this.rect(d,a,i,f);var R=Math.min(i,f)/2,u,m,L,w=u=m=L=Math.min(R,E[0]);E.length===2&&(u=L=Math.min(R,E[1])),E.length===3&&(u=L=Math.min(R,E[1]),m=Math.min(R,E[2])),E.length===4&&(u=Math.min(R,E[1]),m=Math.min(R,E[2]),L=Math.min(R,E[3])),this.moveTo(d,a+f-L),this.arcTo(d,a,d+w,a,w),this.arcTo(d+i,a,d+i,a+u,u),this.arcTo(d+i,a+f,d+i-m,a+f,m),this.arcTo(d,a+f,d,a+f-L,L),this.moveTo(d,a)}function T(d){if(!(!d||!d.CanvasRenderingContext2D)){var a=d.CanvasRenderingContext2D,i=d.Path2D;a&&!a.prototype.roundRect&&(a.prototype.roundRect=x),i&&!i.prototype.roundRect&&(i.prototype.roundRect=x)}}return M(window),T(window),path2dPolyfill_esm}(function(module,exports){(function(l,t){module.exports=l.pdfjsLib=t()})(globalThis,()=>(()=>{var __webpack_modules__=[,(k,l,t)=>{var _t;Object.defineProperty(l,"__esModule",{value:!0}),l.VerbosityLevel=l.Util=l.UnknownErrorException=l.UnexpectedResponseException=l.TextRenderingMode=l.RenderingIntentFlag=l.PromiseCapability=l.PermissionFlag=l.PasswordResponses=l.PasswordException=l.PageActionEventType=l.OPS=l.MissingPDFException=l.MAX_IMAGE_SIZE_TO_CACHE=l.LINE_FACTOR=l.LINE_DESCENT_FACTOR=l.InvalidPDFException=l.ImageKind=l.IDENTITY_MATRIX=l.FormatError=l.FeatureTest=l.FONT_IDENTITY_MATRIX=l.DocumentActionEventType=l.CMapCompressionType=l.BaseException=l.BASELINE_FACTOR=l.AnnotationType=l.AnnotationReplyType=l.AnnotationPrefix=l.AnnotationMode=l.AnnotationFlag=l.AnnotationFieldFlag=l.AnnotationEditorType=l.AnnotationEditorPrefix=l.AnnotationEditorParamsType=l.AnnotationBorderStyleType=l.AnnotationActionEventType=l.AbortException=void 0,l.assert=gt,l.bytesToString=tt,l.createValidAbsoluteUrl=wt,l.getModificationDate=zt,l.getUuid=Yt,l.getVerbosityLevel=nt,l.info=rt,l.isArrayBuffer=Rt,l.isArrayEqual=Ft,l.isNodeJS=void 0,l.normalizeUnicode=Kt,l.objectFromMap=Et,l.objectSize=ut,l.setVerbosityLevel=_,l.shadow=W,l.string32=ct,l.stringToBytes=q,l.stringToPDFString=ht,l.stringToUTF8String=it,l.unreachable=st,l.utf8StringToString=ft,l.warn=Y,t(2),t(84),t(86),t(87),t(89),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);const e=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");l.isNodeJS=e;const n=[1,0,0,1,0,0];l.IDENTITY_MATRIX=n;const c=[.001,0,0,.001,0,0];l.FONT_IDENTITY_MATRIX=c;const b=1e7;l.MAX_IMAGE_SIZE_TO_CACHE=b;const F=1.35;l.LINE_FACTOR=F;const C=.35;l.LINE_DESCENT_FACTOR=C;const S=C/F;l.BASELINE_FACTOR=S;const v={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};l.RenderingIntentFlag=v;const M={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};l.AnnotationMode=M;const x="pdfjs_internal_editor_";l.AnnotationEditorPrefix=x;const T={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};l.AnnotationEditorType=T;const d={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};l.AnnotationEditorParamsType=d;const a={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};l.PermissionFlag=a;const i={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};l.TextRenderingMode=i;const f={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};l.ImageKind=f;const E={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};l.AnnotationType=E;const O={GROUP:"Group",REPLY:"R"};l.AnnotationReplyType=O;const R={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};l.AnnotationFlag=R;const u={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};l.AnnotationFieldFlag=u;const m={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};l.AnnotationBorderStyleType=m;const L={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"};l.AnnotationActionEventType=L;const w={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};l.DocumentActionEventType=w;const y={O:"PageOpen",C:"PageClose"};l.PageActionEventType=y;const N={ERRORS:0,WARNINGS:1,INFOS:5};l.VerbosityLevel=N;const D={NONE:0,BINARY:1};l.CMapCompressionType=D;const V={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};l.OPS=V;const K={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};l.PasswordResponses=K;let U=N.WARNINGS;function _(yt){Number.isInteger(yt)&&(U=yt)}function nt(){return U}function rt(yt){U>=N.INFOS&&console.log(`Info: ${yt}`)}function Y(yt){U>=N.WARNINGS&&console.log(`Warning: ${yt}`)}function st(yt){throw new Error(yt)}function gt(yt,Z){yt||st(Z)}function At(yt){switch(yt==null?void 0:yt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function wt(yt){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!yt)return null;try{if(J&&typeof yt=="string"){if(J.addDefaultProtocol&&yt.startsWith("www.")){const jt=yt.match(/\./g);(jt==null?void 0:jt.length)>=2&&(yt=`http://${yt}`)}if(J.tryConvertEncoding)try{yt=it(yt)}catch{}}const dt=Z?new URL(yt,Z):new URL(yt);if(At(dt))return dt}catch{}return null}function W(yt,Z,J){let dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(yt,Z,{value:J,enumerable:!dt,configurable:!0,writable:!1}),J}const h=function(){function Z(J,dt){this.constructor===Z&&st("Cannot initialize BaseException."),this.message=J,this.name=dt}return Z.prototype=new Error,Z.constructor=Z,Z}();l.BaseException=h;class g extends h{constructor(Z,J){super(Z,"PasswordException"),this.code=J}}l.PasswordException=g;class s extends h{constructor(Z,J){super(Z,"UnknownErrorException"),this.details=J}}l.UnknownErrorException=s;class p extends h{constructor(Z){super(Z,"InvalidPDFException")}}l.InvalidPDFException=p;class A extends h{constructor(Z){super(Z,"MissingPDFException")}}l.MissingPDFException=A;class I extends h{constructor(Z,J){super(Z,"UnexpectedResponseException"),this.status=J}}l.UnexpectedResponseException=I;class P extends h{constructor(Z){super(Z,"FormatError")}}l.FormatError=P;class H extends h{constructor(Z){super(Z,"AbortException")}}l.AbortException=H;function tt(yt){(typeof yt!="object"||(yt==null?void 0:yt.length)===void 0)&&st("Invalid argument for bytesToString");const Z=yt.length,J=8192;if(Z<J)return String.fromCharCode.apply(null,yt);const dt=[];for(let jt=0;jt<Z;jt+=J){const ot=Math.min(jt+J,Z),G=yt.subarray(jt,ot);dt.push(String.fromCharCode.apply(null,G))}return dt.join("")}function q(yt){typeof yt!="string"&&st("Invalid argument for stringToBytes");const Z=yt.length,J=new Uint8Array(Z);for(let dt=0;dt<Z;++dt)J[dt]=yt.charCodeAt(dt)&255;return J}function ct(yt){return String.fromCharCode(yt>>24&255,yt>>16&255,yt>>8&255,yt&255)}function ut(yt){return Object.keys(yt).length}function Et(yt){const Z=Object.create(null);for(const[J,dt]of yt)Z[J]=dt;return Z}function mt(){const yt=new Uint8Array(4);return yt[0]=1,new Uint32Array(yt.buffer,0,1)[0]===1}function Ot(){try{return new Function(""),!0}catch{return!1}}class Wt{static get isLittleEndian(){return W(this,"isLittleEndian",mt())}static get isEvalSupported(){return W(this,"isEvalSupported",Ot())}static get isOffscreenCanvasSupported(){return W(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?W(this,"platform",{isWin:!1,isMac:!1}):W(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Z,J;return W(this,"isCSSRoundSupported",(J=(Z=globalThis.CSS)==null?void 0:Z.supports)==null?void 0:J.call(Z,"width: round(1.5px, 1px)"))}}l.FeatureTest=Wt;const kt=[...Array(256).keys()].map(yt=>yt.toString(16).padStart(2,"0"));class Nt{static makeHexColor(Z,J,dt){return`#${kt[Z]}${kt[J]}${kt[dt]}`}static scaleMinMax(Z,J){let dt;Z[0]?(Z[0]<0&&(dt=J[0],J[0]=J[1],J[1]=dt),J[0]*=Z[0],J[1]*=Z[0],Z[3]<0&&(dt=J[2],J[2]=J[3],J[3]=dt),J[2]*=Z[3],J[3]*=Z[3]):(dt=J[0],J[0]=J[2],J[2]=dt,dt=J[1],J[1]=J[3],J[3]=dt,Z[1]<0&&(dt=J[2],J[2]=J[3],J[3]=dt),J[2]*=Z[1],J[3]*=Z[1],Z[2]<0&&(dt=J[0],J[0]=J[1],J[1]=dt),J[0]*=Z[2],J[1]*=Z[2]),J[0]+=Z[4],J[1]+=Z[4],J[2]+=Z[5],J[3]+=Z[5]}static transform(Z,J){return[Z[0]*J[0]+Z[2]*J[1],Z[1]*J[0]+Z[3]*J[1],Z[0]*J[2]+Z[2]*J[3],Z[1]*J[2]+Z[3]*J[3],Z[0]*J[4]+Z[2]*J[5]+Z[4],Z[1]*J[4]+Z[3]*J[5]+Z[5]]}static applyTransform(Z,J){const dt=Z[0]*J[0]+Z[1]*J[2]+J[4],jt=Z[0]*J[1]+Z[1]*J[3]+J[5];return[dt,jt]}static applyInverseTransform(Z,J){const dt=J[0]*J[3]-J[1]*J[2],jt=(Z[0]*J[3]-Z[1]*J[2]+J[2]*J[5]-J[4]*J[3])/dt,ot=(-Z[0]*J[1]+Z[1]*J[0]+J[4]*J[1]-J[5]*J[0])/dt;return[jt,ot]}static getAxialAlignedBoundingBox(Z,J){const dt=this.applyTransform(Z,J),jt=this.applyTransform(Z.slice(2,4),J),ot=this.applyTransform([Z[0],Z[3]],J),G=this.applyTransform([Z[2],Z[1]],J);return[Math.min(dt[0],jt[0],ot[0],G[0]),Math.min(dt[1],jt[1],ot[1],G[1]),Math.max(dt[0],jt[0],ot[0],G[0]),Math.max(dt[1],jt[1],ot[1],G[1])]}static inverseTransform(Z){const J=Z[0]*Z[3]-Z[1]*Z[2];return[Z[3]/J,-Z[1]/J,-Z[2]/J,Z[0]/J,(Z[2]*Z[5]-Z[4]*Z[3])/J,(Z[4]*Z[1]-Z[5]*Z[0])/J]}static singularValueDecompose2dScale(Z){const J=[Z[0],Z[2],Z[1],Z[3]],dt=Z[0]*J[0]+Z[1]*J[2],jt=Z[0]*J[1]+Z[1]*J[3],ot=Z[2]*J[0]+Z[3]*J[2],G=Z[2]*J[1]+Z[3]*J[3],pt=(dt+G)/2,xt=Math.sqrt((dt+G)**2-4*(dt*G-ot*jt))/2,St=pt+xt||1,Pt=pt-xt||1;return[Math.sqrt(St),Math.sqrt(Pt)]}static normalizeRect(Z){const J=Z.slice(0);return Z[0]>Z[2]&&(J[0]=Z[2],J[2]=Z[0]),Z[1]>Z[3]&&(J[1]=Z[3],J[3]=Z[1]),J}static intersect(Z,J){const dt=Math.max(Math.min(Z[0],Z[2]),Math.min(J[0],J[2])),jt=Math.min(Math.max(Z[0],Z[2]),Math.max(J[0],J[2]));if(dt>jt)return null;const ot=Math.max(Math.min(Z[1],Z[3]),Math.min(J[1],J[3])),G=Math.min(Math.max(Z[1],Z[3]),Math.max(J[1],J[3]));return ot>G?null:[dt,ot,jt,G]}static bezierBoundingBox(Z,J,dt,jt,ot,G,pt,xt){const St=[],Pt=[[],[]];let vt,Ht,Tt,Lt,Dt,z,o,B;for(let lt=0;lt<2;++lt){if(lt===0?(Ht=6*Z-12*dt+6*ot,vt=-3*Z+9*dt-9*ot+3*pt,Tt=3*dt-3*Z):(Ht=6*J-12*jt+6*G,vt=-3*J+9*jt-9*G+3*xt,Tt=3*jt-3*J),Math.abs(vt)<1e-12){if(Math.abs(Ht)<1e-12)continue;Lt=-Tt/Ht,0<Lt&&Lt<1&&St.push(Lt);continue}o=Ht*Ht-4*Tt*vt,B=Math.sqrt(o),!(o<0)&&(Dt=(-Ht+B)/(2*vt),0<Dt&&Dt<1&&St.push(Dt),z=(-Ht-B)/(2*vt),0<z&&z<1&&St.push(z))}let $=St.length,Q;const et=$;for(;$--;)Lt=St[$],Q=1-Lt,Pt[0][$]=Q*Q*Q*Z+3*Q*Q*Lt*dt+3*Q*Lt*Lt*ot+Lt*Lt*Lt*pt,Pt[1][$]=Q*Q*Q*J+3*Q*Q*Lt*jt+3*Q*Lt*Lt*G+Lt*Lt*Lt*xt;return Pt[0][et]=Z,Pt[1][et]=J,Pt[0][et+1]=pt,Pt[1][et+1]=xt,Pt[0].length=Pt[1].length=et+2,[Math.min(...Pt[0]),Math.min(...Pt[1]),Math.max(...Pt[0]),Math.max(...Pt[1])]}}l.Util=Nt;const bt=[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 ht(yt){if(yt[0]>="ï"){let J;if(yt[0]==="þ"&&yt[1]==="ÿ"?J="utf-16be":yt[0]==="ÿ"&&yt[1]==="þ"?J="utf-16le":yt[0]==="ï"&&yt[1]==="»"&&yt[2]==="¿"&&(J="utf-8"),J)try{const dt=new TextDecoder(J,{fatal:!0}),jt=q(yt);return dt.decode(jt)}catch(dt){Y(`stringToPDFString: "${dt}".`)}}const Z=[];for(let J=0,dt=yt.length;J<dt;J++){const jt=bt[yt.charCodeAt(J)];Z.push(jt?String.fromCharCode(jt):yt.charAt(J))}return Z.join("")}function it(yt){return decodeURIComponent(escape(yt))}function ft(yt){return unescape(encodeURIComponent(yt))}function Rt(yt){return typeof yt=="object"&&(yt==null?void 0:yt.byteLength)!==void 0}function Ft(yt,Z){if(yt.length!==Z.length)return!1;for(let J=0,dt=yt.length;J<dt;J++)if(yt[J]!==Z[J])return!1;return!0}function zt(){let yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[yt.getUTCFullYear().toString(),(yt.getUTCMonth()+1).toString().padStart(2,"0"),yt.getUTCDate().toString().padStart(2,"0"),yt.getUTCHours().toString().padStart(2,"0"),yt.getUTCMinutes().toString().padStart(2,"0"),yt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Vt{constructor(){X(this,_t,!1);this.promise=new Promise((Z,J)=>{this.resolve=dt=>{at(this,_t,!0),Z(dt)},this.reject=dt=>{at(this,_t,!0),J(dt)}})}get settled(){return r(this,_t)}}_t=new WeakMap,l.PromiseCapability=Vt;let $t=null,Gt=null;function Kt(yt){return $t||($t=/([\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,Gt=new Map([["ſt","ſt"]])),yt.replaceAll($t,(Z,J,dt)=>J?J.normalize("NFKC"):Gt.get(dt))}function Yt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const yt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(yt);else for(let Z=0;Z<32;Z++)yt[Z]=Math.floor(Math.random()*255);return tt(yt)}const Zt="pdfjs_internal_id_";l.AnnotationPrefix=Zt},(k,l,t)=>{var e=t(3),n=t(4),c=t(69),b=t(70),F="WebAssembly",C=n[F],S=Error("e",{cause:7}).cause!==7,v=function(x,T){var d={};d[x]=b(x,T,S),e({global:!0,constructor:!0,arity:1,forced:S},d)},M=function(x,T){if(C&&C[x]){var d={};d[x]=b(F+"."+x,T,S),e({target:F,stat:!0,constructor:!0,arity:1,forced:S},d)}};v("Error",function(x){return function(d){return c(x,this,arguments)}}),v("EvalError",function(x){return function(d){return c(x,this,arguments)}}),v("RangeError",function(x){return function(d){return c(x,this,arguments)}}),v("ReferenceError",function(x){return function(d){return c(x,this,arguments)}}),v("SyntaxError",function(x){return function(d){return c(x,this,arguments)}}),v("TypeError",function(x){return function(d){return c(x,this,arguments)}}),v("URIError",function(x){return function(d){return c(x,this,arguments)}}),M("CompileError",function(x){return function(d){return c(x,this,arguments)}}),M("LinkError",function(x){return function(d){return c(x,this,arguments)}}),M("RuntimeError",function(x){return function(d){return c(x,this,arguments)}})},(k,l,t)=>{var e=t(4),n=t(5).f,c=t(44),b=t(48),F=t(38),C=t(56),S=t(68);k.exports=function(v,M){var x=v.target,T=v.global,d=v.stat,a,i,f,E,O,R;if(T?i=e:d?i=e[x]||F(x,{}):i=(e[x]||{}).prototype,i)for(f in M){if(O=M[f],v.dontCallGetSet?(R=n(i,f),E=R&&R.value):E=i[f],a=S(T?f:x+(d?".":"#")+f,v.forced),!a&&E!==void 0){if(typeof O==typeof E)continue;C(O,E)}(v.sham||E&&E.sham)&&c(O,"sham",!0),b(i,f,O,v)}}},function(k){var l=function(t){return t&&t.Math===Math&&t};k.exports=l(typeof globalThis=="object"&&globalThis)||l(typeof window=="object"&&window)||l(typeof self=="object"&&self)||l(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(k,l,t)=>{var e=t(6),n=t(8),c=t(10),b=t(11),F=t(12),C=t(18),S=t(39),v=t(42),M=Object.getOwnPropertyDescriptor;l.f=e?M:function(T,d){if(T=F(T),d=C(d),v)try{return M(T,d)}catch{}if(S(T,d))return b(!n(c.f,T,d),T[d])}},(k,l,t)=>{var e=t(7);k.exports=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},k=>{k.exports=function(l){try{return!!l()}catch{return!0}}},(k,l,t)=>{var e=t(9),n=Function.prototype.call;k.exports=e?n.bind(n):function(){return n.apply(n,arguments)}},(k,l,t)=>{var e=t(7);k.exports=!e(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")})},(k,l)=>{var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);l.f=n?function(b){var F=e(this,b);return!!F&&F.enumerable}:t},k=>{k.exports=function(l,t){return{enumerable:!(l&1),configurable:!(l&2),writable:!(l&4),value:t}}},(k,l,t)=>{var e=t(13),n=t(16);k.exports=function(c){return e(n(c))}},(k,l,t)=>{var e=t(14),n=t(7),c=t(15),b=Object,F=e("".split);k.exports=n(function(){return!b("z").propertyIsEnumerable(0)})?function(C){return c(C)==="String"?F(C,""):b(C)}:b},(k,l,t)=>{var e=t(9),n=Function.prototype,c=n.call,b=e&&n.bind.bind(c,c);k.exports=e?b:function(F){return function(){return c.apply(F,arguments)}}},(k,l,t)=>{var e=t(14),n=e({}.toString),c=e("".slice);k.exports=function(b){return c(n(b),8,-1)}},(k,l,t)=>{var e=t(17),n=TypeError;k.exports=function(c){if(e(c))throw n("Can't call method on "+c);return c}},k=>{k.exports=function(l){return l==null}},(k,l,t)=>{var e=t(19),n=t(23);k.exports=function(c){var b=e(c,"string");return n(b)?b:b+""}},(k,l,t)=>{var e=t(8),n=t(20),c=t(23),b=t(30),F=t(33),C=t(34),S=TypeError,v=C("toPrimitive");k.exports=function(M,x){if(!n(M)||c(M))return M;var T=b(M,v),d;if(T){if(x===void 0&&(x="default"),d=e(T,M,x),!n(d)||c(d))return d;throw S("Can't convert object to primitive value")}return x===void 0&&(x="number"),F(M,x)}},(k,l,t)=>{var e=t(21),n=t(22),c=n.all;k.exports=n.IS_HTMLDDA?function(b){return typeof b=="object"?b!==null:e(b)||b===c}:function(b){return typeof b=="object"?b!==null:e(b)}},(k,l,t)=>{var e=t(22),n=e.all;k.exports=e.IS_HTMLDDA?function(c){return typeof c=="function"||c===n}:function(c){return typeof c=="function"}},k=>{var l=typeof document=="object"&&document.all,t=typeof l>"u"&&l!==void 0;k.exports={all:l,IS_HTMLDDA:t}},(k,l,t)=>{var e=t(24),n=t(21),c=t(25),b=t(26),F=Object;k.exports=b?function(C){return typeof C=="symbol"}:function(C){var S=e("Symbol");return n(S)&&c(S.prototype,F(C))}},(k,l,t)=>{var e=t(4),n=t(21),c=function(b){return n(b)?b:void 0};k.exports=function(b,F){return arguments.length<2?c(e[b]):e[b]&&e[b][F]}},(k,l,t)=>{var e=t(14);k.exports=e({}.isPrototypeOf)},(k,l,t)=>{var e=t(27);k.exports=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(k,l,t)=>{var e=t(28),n=t(7),c=t(4),b=c.String;k.exports=!!Object.getOwnPropertySymbols&&!n(function(){var F=Symbol("symbol detection");return!b(F)||!(Object(F)instanceof Symbol)||!Symbol.sham&&e&&e<41})},(k,l,t)=>{var e=t(4),n=t(29),c=e.process,b=e.Deno,F=c&&c.versions||b&&b.version,C=F&&F.v8,S,v;C&&(S=C.split("."),v=S[0]>0&&S[0]<4?1:+(S[0]+S[1])),!v&&n&&(S=n.match(/Edge\/(\d+)/),(!S||S[1]>=74)&&(S=n.match(/Chrome\/(\d+)/),S&&(v=+S[1]))),k.exports=v},k=>{k.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(k,l,t)=>{var e=t(31),n=t(17);k.exports=function(c,b){var F=c[b];return n(F)?void 0:e(F)}},(k,l,t)=>{var e=t(21),n=t(32),c=TypeError;k.exports=function(b){if(e(b))return b;throw c(n(b)+" is not a function")}},k=>{var l=String;k.exports=function(t){try{return l(t)}catch{return"Object"}}},(k,l,t)=>{var e=t(8),n=t(21),c=t(20),b=TypeError;k.exports=function(F,C){var S,v;if(C==="string"&&n(S=F.toString)&&!c(v=e(S,F))||n(S=F.valueOf)&&!c(v=e(S,F))||C!=="string"&&n(S=F.toString)&&!c(v=e(S,F)))return v;throw b("Can't convert object to primitive value")}},(k,l,t)=>{var e=t(4),n=t(35),c=t(39),b=t(41),F=t(27),C=t(26),S=e.Symbol,v=n("wks"),M=C?S.for||S:S&&S.withoutSetter||b;k.exports=function(x){return c(v,x)||(v[x]=F&&c(S,x)?S[x]:M("Symbol."+x)),v[x]}},(k,l,t)=>{var e=t(36),n=t(37);(k.exports=function(c,b){return n[c]||(n[c]=b!==void 0?b:{})})("versions",[]).push({version:"3.32.2",mode:e?"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"})},k=>{k.exports=!1},(k,l,t)=>{var e=t(4),n=t(38),c="__core-js_shared__",b=e[c]||n(c,{});k.exports=b},(k,l,t)=>{var e=t(4),n=Object.defineProperty;k.exports=function(c,b){try{n(e,c,{value:b,configurable:!0,writable:!0})}catch{e[c]=b}return b}},(k,l,t)=>{var e=t(14),n=t(40),c=e({}.hasOwnProperty);k.exports=Object.hasOwn||function(F,C){return c(n(F),C)}},(k,l,t)=>{var e=t(16),n=Object;k.exports=function(c){return n(e(c))}},(k,l,t)=>{var e=t(14),n=0,c=Math.random(),b=e(1 .toString);k.exports=function(F){return"Symbol("+(F===void 0?"":F)+")_"+b(++n+c,36)}},(k,l,t)=>{var e=t(6),n=t(7),c=t(43);k.exports=!e&&!n(function(){return Object.defineProperty(c("div"),"a",{get:function(){return 7}}).a!==7})},(k,l,t)=>{var e=t(4),n=t(20),c=e.document,b=n(c)&&n(c.createElement);k.exports=function(F){return b?c.createElement(F):{}}},(k,l,t)=>{var e=t(6),n=t(45),c=t(11);k.exports=e?function(b,F,C){return n.f(b,F,c(1,C))}:function(b,F,C){return b[F]=C,b}},(k,l,t)=>{var e=t(6),n=t(42),c=t(46),b=t(47),F=t(18),C=TypeError,S=Object.defineProperty,v=Object.getOwnPropertyDescriptor,M="enumerable",x="configurable",T="writable";l.f=e?c?function(a,i,f){if(b(a),i=F(i),b(f),typeof a=="function"&&i==="prototype"&&"value"in f&&T in f&&!f[T]){var E=v(a,i);E&&E[T]&&(a[i]=f.value,f={configurable:x in f?f[x]:E[x],enumerable:M in f?f[M]:E[M],writable:!1})}return S(a,i,f)}:S:function(a,i,f){if(b(a),i=F(i),b(f),n)try{return S(a,i,f)}catch{}if("get"in f||"set"in f)throw C("Accessors not supported");return"value"in f&&(a[i]=f.value),a}},(k,l,t)=>{var e=t(6),n=t(7);k.exports=e&&n(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(k,l,t)=>{var e=t(20),n=String,c=TypeError;k.exports=function(b){if(e(b))return b;throw c(n(b)+" is not an object")}},(k,l,t)=>{var e=t(21),n=t(45),c=t(49),b=t(38);k.exports=function(F,C,S,v){v||(v={});var M=v.enumerable,x=v.name!==void 0?v.name:C;if(e(S)&&c(S,x,v),v.global)M?F[C]=S:b(C,S);else{try{v.unsafe?F[C]&&(M=!0):delete F[C]}catch{}M?F[C]=S:n.f(F,C,{value:S,enumerable:!1,configurable:!v.nonConfigurable,writable:!v.nonWritable})}return F}},(k,l,t)=>{var e=t(14),n=t(7),c=t(21),b=t(39),F=t(6),C=t(50).CONFIGURABLE,S=t(51),v=t(52),M=v.enforce,x=v.get,T=String,d=Object.defineProperty,a=e("".slice),i=e("".replace),f=e([].join),E=F&&!n(function(){return d(function(){},"length",{value:8}).length!==8}),O=String(String).split("String"),R=k.exports=function(u,m,L){a(T(m),0,7)==="Symbol("&&(m="["+i(T(m),/^Symbol\(([^)]*)\)/,"$1")+"]"),L&&L.getter&&(m="get "+m),L&&L.setter&&(m="set "+m),(!b(u,"name")||C&&u.name!==m)&&(F?d(u,"name",{value:m,configurable:!0}):u.name=m),E&&L&&b(L,"arity")&&u.length!==L.arity&&d(u,"length",{value:L.arity});try{L&&b(L,"constructor")&&L.constructor?F&&d(u,"prototype",{writable:!1}):u.prototype&&(u.prototype=void 0)}catch{}var w=M(u);return b(w,"source")||(w.source=f(O,typeof m=="string"?m:"")),u};Function.prototype.toString=R(function(){return c(this)&&x(this).source||S(this)},"toString")},(k,l,t)=>{var e=t(6),n=t(39),c=Function.prototype,b=e&&Object.getOwnPropertyDescriptor,F=n(c,"name"),C=F&&(function(){}).name==="something",S=F&&(!e||e&&b(c,"name").configurable);k.exports={EXISTS:F,PROPER:C,CONFIGURABLE:S}},(k,l,t)=>{var e=t(14),n=t(21),c=t(37),b=e(Function.toString);n(c.inspectSource)||(c.inspectSource=function(F){return b(F)}),k.exports=c.inspectSource},(k,l,t)=>{var e=t(53),n=t(4),c=t(20),b=t(44),F=t(39),C=t(37),S=t(54),v=t(55),M="Object already initialized",x=n.TypeError,T=n.WeakMap,d,a,i,f=function(u){return i(u)?a(u):d(u,{})},E=function(u){return function(m){var L;if(!c(m)||(L=a(m)).type!==u)throw x("Incompatible receiver, "+u+" required");return L}};if(e||C.state){var O=C.state||(C.state=new T);O.get=O.get,O.has=O.has,O.set=O.set,d=function(u,m){if(O.has(u))throw x(M);return m.facade=u,O.set(u,m),m},a=function(u){return O.get(u)||{}},i=function(u){return O.has(u)}}else{var R=S("state");v[R]=!0,d=function(u,m){if(F(u,R))throw x(M);return m.facade=u,b(u,R,m),m},a=function(u){return F(u,R)?u[R]:{}},i=function(u){return F(u,R)}}k.exports={set:d,get:a,has:i,enforce:f,getterFor:E}},(k,l,t)=>{var e=t(4),n=t(21),c=e.WeakMap;k.exports=n(c)&&/native code/.test(String(c))},(k,l,t)=>{var e=t(35),n=t(41),c=e("keys");k.exports=function(b){return c[b]||(c[b]=n(b))}},k=>{k.exports={}},(k,l,t)=>{var e=t(39),n=t(57),c=t(5),b=t(45);k.exports=function(F,C,S){for(var v=n(C),M=b.f,x=c.f,T=0;T<v.length;T++){var d=v[T];!e(F,d)&&!(S&&e(S,d))&&M(F,d,x(C,d))}}},(k,l,t)=>{var e=t(24),n=t(14),c=t(58),b=t(67),F=t(47),C=n([].concat);k.exports=e("Reflect","ownKeys")||function(v){var M=c.f(F(v)),x=b.f;return x?C(M,x(v)):M}},(k,l,t)=>{var e=t(59),n=t(66),c=n.concat("length","prototype");l.f=Object.getOwnPropertyNames||function(F){return e(F,c)}},(k,l,t)=>{var e=t(14),n=t(39),c=t(12),b=t(60).indexOf,F=t(55),C=e([].push);k.exports=function(S,v){var M=c(S),x=0,T=[],d;for(d in M)!n(F,d)&&n(M,d)&&C(T,d);for(;v.length>x;)n(M,d=v[x++])&&(~b(T,d)||C(T,d));return T}},(k,l,t)=>{var e=t(12),n=t(61),c=t(64),b=function(F){return function(C,S,v){var M=e(C),x=c(M),T=n(v,x),d;if(F&&S!==S){for(;x>T;)if(d=M[T++],d!==d)return!0}else for(;x>T;T++)if((F||T in M)&&M[T]===S)return F||T||0;return!F&&-1}};k.exports={includes:b(!0),indexOf:b(!1)}},(k,l,t)=>{var e=t(62),n=Math.max,c=Math.min;k.exports=function(b,F){var C=e(b);return C<0?n(C+F,0):c(C,F)}},(k,l,t)=>{var e=t(63);k.exports=function(n){var c=+n;return c!==c||c===0?0:e(c)}},k=>{var l=Math.ceil,t=Math.floor;k.exports=Math.trunc||function(n){var c=+n;return(c>0?t:l)(c)}},(k,l,t)=>{var e=t(65);k.exports=function(n){return e(n.length)}},(k,l,t)=>{var e=t(62),n=Math.min;k.exports=function(c){return c>0?n(e(c),9007199254740991):0}},k=>{k.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(k,l)=>{l.f=Object.getOwnPropertySymbols},(k,l,t)=>{var e=t(7),n=t(21),c=/#|\.prototype\./,b=function(M,x){var T=C[F(M)];return T===v?!0:T===S?!1:n(x)?e(x):!!x},F=b.normalize=function(M){return String(M).replace(c,".").toLowerCase()},C=b.data={},S=b.NATIVE="N",v=b.POLYFILL="P";k.exports=b},(k,l,t)=>{var e=t(9),n=Function.prototype,c=n.apply,b=n.call;k.exports=typeof Reflect=="object"&&Reflect.apply||(e?b.bind(c):function(){return b.apply(c,arguments)})},(k,l,t)=>{var e=t(24),n=t(39),c=t(44),b=t(25),F=t(71),C=t(56),S=t(74),v=t(75),M=t(76),x=t(80),T=t(81),d=t(6),a=t(36);k.exports=function(i,f,E,O){var R="stackTraceLimit",u=O?2:1,m=i.split("."),L=m[m.length-1],w=e.apply(null,m);if(w){var y=w.prototype;if(!a&&n(y,"cause")&&delete y.cause,!E)return w;var N=e("Error"),D=f(function(V,K){var U=M(O?K:V,void 0),_=O?new w(V):new w;return U!==void 0&&c(_,"message",U),T(_,D,_.stack,2),this&&b(y,this)&&v(_,this,D),arguments.length>u&&x(_,arguments[u]),_});if(D.prototype=y,L!=="Error"?F?F(D,N):C(D,N,{name:!0}):d&&R in w&&(S(D,w,R),S(D,w,"prepareStackTrace")),C(D,w),!a)try{y.name!==L&&c(y,"name",L),y.constructor=D}catch{}return D}}},(k,l,t)=>{var e=t(72),n=t(47),c=t(73);k.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var b=!1,F={},C;try{C=e(Object.prototype,"__proto__","set"),C(F,[]),b=F instanceof Array}catch{}return function(v,M){return n(v),c(M),b?C(v,M):v.__proto__=M,v}}():void 0)},(k,l,t)=>{var e=t(14),n=t(31);k.exports=function(c,b,F){try{return e(n(Object.getOwnPropertyDescriptor(c,b)[F]))}catch{}}},(k,l,t)=>{var e=t(21),n=String,c=TypeError;k.exports=function(b){if(typeof b=="object"||e(b))return b;throw c("Can't set "+n(b)+" as a prototype")}},(k,l,t)=>{var e=t(45).f;k.exports=function(n,c,b){b in n||e(n,b,{configurable:!0,get:function(){return c[b]},set:function(F){c[b]=F}})}},(k,l,t)=>{var e=t(21),n=t(20),c=t(71);k.exports=function(b,F,C){var S,v;return c&&e(S=F.constructor)&&S!==C&&n(v=S.prototype)&&v!==C.prototype&&c(b,v),b}},(k,l,t)=>{var e=t(77);k.exports=function(n,c){return n===void 0?arguments.length<2?"":c:e(n)}},(k,l,t)=>{var e=t(78),n=String;k.exports=function(c){if(e(c)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return n(c)}},(k,l,t)=>{var e=t(79),n=t(21),c=t(15),b=t(34),F=b("toStringTag"),C=Object,S=c(function(){return arguments}())==="Arguments",v=function(M,x){try{return M[x]}catch{}};k.exports=e?c:function(M){var x,T,d;return M===void 0?"Undefined":M===null?"Null":typeof(T=v(x=C(M),F))=="string"?T:S?c(x):(d=c(x))==="Object"&&n(x.callee)?"Arguments":d}},(k,l,t)=>{var e=t(34),n=e("toStringTag"),c={};c[n]="z",k.exports=String(c)==="[object z]"},(k,l,t)=>{var e=t(20),n=t(44);k.exports=function(c,b){e(b)&&"cause"in b&&n(c,"cause",b.cause)}},(k,l,t)=>{var e=t(44),n=t(82),c=t(83),b=Error.captureStackTrace;k.exports=function(F,C,S,v){c&&(b?b(F,C):e(F,"stack",n(S,v)))}},(k,l,t)=>{var e=t(14),n=Error,c=e("".replace),b=function(S){return String(n(S).stack)}("zxcasd"),F=/\n\s*at [^:]*:[^\n]*/,C=F.test(b);k.exports=function(S,v){if(C&&typeof S=="string"&&!n.prepareStackTrace)for(;v--;)S=c(S,F,"");return S}},(k,l,t)=>{var e=t(7),n=t(11);k.exports=!e(function(){var c=Error("a");return"stack"in c?(Object.defineProperty(c,"stack",n(1,7)),c.stack!==7):!0})},(k,l,t)=>{var e=t(48),n=t(14),c=t(77),b=t(85),F=URLSearchParams,C=F.prototype,S=n(C.append),v=n(C.delete),M=n(C.forEach),x=n([].push),T=new F("a=1&a=2&b=3");T.delete("a",1),T.delete("b",void 0),T+""!="a=2"&&e(C,"delete",function(d){var a=arguments.length,i=a<2?void 0:arguments[1];if(a&&i===void 0)return v(this,d);var f=[];M(this,function(y,N){x(f,{key:N,value:y})}),b(a,1);for(var E=c(d),O=c(i),R=0,u=0,m=!1,L=f.length,w;R<L;)w=f[R++],m||w.key===E?(m=!0,v(this,w.key)):u++;for(;u<L;)w=f[u++],w.key===E&&w.value===O||S(this,w.key,w.value)},{enumerable:!0,unsafe:!0})},k=>{var l=TypeError;k.exports=function(t,e){if(t<e)throw l("Not enough arguments");return t}},(k,l,t)=>{var e=t(48),n=t(14),c=t(77),b=t(85),F=URLSearchParams,C=F.prototype,S=n(C.getAll),v=n(C.has),M=new F("a=1");(M.has("a",2)||!M.has("a",void 0))&&e(C,"has",function(T){var d=arguments.length,a=d<2?void 0:arguments[1];if(d&&a===void 0)return v(this,T);var i=S(this,T);b(d,1);for(var f=c(a),E=0;E<i.length;)if(i[E++]===f)return!0;return!1},{enumerable:!0,unsafe:!0})},(k,l,t)=>{var e=t(6),n=t(14),c=t(88),b=URLSearchParams.prototype,F=n(b.forEach);e&&!("size"in b)&&c(b,"size",{get:function(){var S=0;return F(this,function(){S++}),S},configurable:!0,enumerable:!0})},(k,l,t)=>{var e=t(49),n=t(45);k.exports=function(c,b,F){return F.get&&e(F.get,b,{getter:!0}),F.set&&e(F.set,b,{setter:!0}),n.f(c,b,F)}},(k,l,t)=>{var e=t(3),n=t(40),c=t(64),b=t(90),F=t(92),C=t(7),S=C(function(){return[].push.call({length:4294967296},1)!==4294967297}),v=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(x){return x instanceof TypeError}},M=S||!v();e({target:"Array",proto:!0,arity:1,forced:M},{push:function(T){var d=n(this),a=c(d),i=arguments.length;F(a+i);for(var f=0;f<i;f++)d[a]=arguments[f],a++;return b(d,a),a}})},(k,l,t)=>{var e=t(6),n=t(91),c=TypeError,b=Object.getOwnPropertyDescriptor,F=e&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(C){return C instanceof TypeError}}();k.exports=F?function(C,S){if(n(C)&&!b(C,"length").writable)throw c("Cannot set read only .length");return C.length=S}:function(C,S){return C.length=S}},(k,l,t)=>{var e=t(15);k.exports=Array.isArray||function(c){return e(c)==="Array"}},k=>{var l=TypeError,t=9007199254740991;k.exports=function(e){if(e>t)throw l("Maximum allowed index exceeded");return e}},(k,l,t)=>{var e=t(94),n=t(98).findLast,c=e.aTypedArray,b=e.exportTypedArrayMethod;b("findLast",function(C){return n(c(this),C,arguments.length>1?arguments[1]:void 0)})},(k,l,t)=>{var e=t(95),n=t(6),c=t(4),b=t(21),F=t(20),C=t(39),S=t(78),v=t(32),M=t(44),x=t(48),T=t(88),d=t(25),a=t(96),i=t(71),f=t(34),E=t(41),O=t(52),R=O.enforce,u=O.get,m=c.Int8Array,L=m&&m.prototype,w=c.Uint8ClampedArray,y=w&&w.prototype,N=m&&a(m),D=L&&a(L),V=Object.prototype,K=c.TypeError,U=f("toStringTag"),_=E("TYPED_ARRAY_TAG"),nt="TypedArrayConstructor",rt=e&&!!i&&S(c.opera)!=="Opera",Y=!1,st,gt,At,wt={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},W={BigInt64Array:8,BigUint64Array:8},h=function(tt){if(!F(tt))return!1;var q=S(tt);return q==="DataView"||C(wt,q)||C(W,q)},g=function(H){var tt=a(H);if(F(tt)){var q=u(tt);return q&&C(q,nt)?q[nt]:g(tt)}},s=function(H){if(!F(H))return!1;var tt=S(H);return C(wt,tt)||C(W,tt)},p=function(H){if(s(H))return H;throw K("Target is not a typed array")},A=function(H){if(b(H)&&(!i||d(N,H)))return H;throw K(v(H)+" is not a typed array constructor")},I=function(H,tt,q,ct){if(n){if(q)for(var ut in wt){var Et=c[ut];if(Et&&C(Et.prototype,H))try{delete Et.prototype[H]}catch{try{Et.prototype[H]=tt}catch{}}}(!D[H]||q)&&x(D,H,q?tt:rt&&L[H]||tt,ct)}},P=function(H,tt,q){var ct,ut;if(n){if(i){if(q){for(ct in wt)if(ut=c[ct],ut&&C(ut,H))try{delete ut[H]}catch{}}if(!N[H]||q)try{return x(N,H,q?tt:rt&&N[H]||tt)}catch{}else return}for(ct in wt)ut=c[ct],ut&&(!ut[H]||q)&&x(ut,H,tt)}};for(st in wt)gt=c[st],At=gt&&gt.prototype,At?R(At)[nt]=gt:rt=!1;for(st in W)gt=c[st],At=gt&&gt.prototype,At&&(R(At)[nt]=gt);if((!rt||!b(N)||N===Function.prototype)&&(N=function(){throw K("Incorrect invocation")},rt))for(st in wt)c[st]&&i(c[st],N);if((!rt||!D||D===V)&&(D=N.prototype,rt))for(st in wt)c[st]&&i(c[st].prototype,D);if(rt&&a(y)!==D&&i(y,D),n&&!C(D,U)){Y=!0,T(D,U,{configurable:!0,get:function(){return F(this)?this[_]:void 0}});for(st in wt)c[st]&&M(c[st],_,st)}k.exports={NATIVE_ARRAY_BUFFER_VIEWS:rt,TYPED_ARRAY_TAG:Y&&_,aTypedArray:p,aTypedArrayConstructor:A,exportTypedArrayMethod:I,exportTypedArrayStaticMethod:P,getTypedArrayConstructor:g,isView:h,isTypedArray:s,TypedArray:N,TypedArrayPrototype:D}},k=>{k.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(k,l,t)=>{var e=t(39),n=t(21),c=t(40),b=t(54),F=t(97),C=b("IE_PROTO"),S=Object,v=S.prototype;k.exports=F?S.getPrototypeOf:function(M){var x=c(M);if(e(x,C))return x[C];var T=x.constructor;return n(T)&&x instanceof T?T.prototype:x instanceof S?v:null}},(k,l,t)=>{var e=t(7);k.exports=!e(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})},(k,l,t)=>{var e=t(99),n=t(13),c=t(40),b=t(64),F=function(C){var S=C===1;return function(v,M,x){for(var T=c(v),d=n(T),a=e(M,x),i=b(d),f,E;i-- >0;)if(f=d[i],E=a(f,i,T),E)switch(C){case 0:return f;case 1:return i}return S?-1:void 0}};k.exports={findLast:F(0),findLastIndex:F(1)}},(k,l,t)=>{var e=t(100),n=t(31),c=t(9),b=e(e.bind);k.exports=function(F,C){return n(F),C===void 0?F:c?b(F,C):function(){return F.apply(C,arguments)}}},(k,l,t)=>{var e=t(15),n=t(14);k.exports=function(c){if(e(c)==="Function")return n(c)}},(k,l,t)=>{var e=t(94),n=t(98).findLastIndex,c=e.aTypedArray,b=e.exportTypedArrayMethod;b("findLastIndex",function(C){return n(c(this),C,arguments.length>1?arguments[1]:void 0)})},(k,l,t)=>{var e=t(4),n=t(8),c=t(94),b=t(64),F=t(103),C=t(40),S=t(7),v=e.RangeError,M=e.Int8Array,x=M&&M.prototype,T=x&&x.set,d=c.aTypedArray,a=c.exportTypedArrayMethod,i=!S(function(){var E=new Uint8ClampedArray(2);return n(T,E,{length:1,0:3},1),E[1]!==3}),f=i&&c.NATIVE_ARRAY_BUFFER_VIEWS&&S(function(){var E=new M(2);return E.set(1),E.set("2",1),E[0]!==0||E[1]!==2});a("set",function(O){d(this);var R=F(arguments.length>1?arguments[1]:void 0,1),u=C(O);if(i)return n(T,this,u,R);var m=this.length,L=b(u),w=0;if(L+R>m)throw v("Wrong length");for(;w<L;)this[R+w]=u[w++]},!i||f)},(k,l,t)=>{var e=t(104),n=RangeError;k.exports=function(c,b){var F=e(c);if(F%b)throw n("Wrong offset");return F}},(k,l,t)=>{var e=t(62),n=RangeError;k.exports=function(c){var b=e(c);if(b<0)throw n("The argument can't be less than 0");return b}},(k,l,t)=>{var e=t(106),n=t(94),c=n.aTypedArray,b=n.exportTypedArrayMethod,F=n.getTypedArrayConstructor;b("toReversed",function(){return e(c(this),F(this))})},(k,l,t)=>{var e=t(64);k.exports=function(n,c){for(var b=e(n),F=new c(b),C=0;C<b;C++)F[C]=n[b-C-1];return F}},(k,l,t)=>{var e=t(94),n=t(14),c=t(31),b=t(108),F=e.aTypedArray,C=e.getTypedArrayConstructor,S=e.exportTypedArrayMethod,v=n(e.TypedArrayPrototype.sort);S("toSorted",function(x){x!==void 0&&c(x);var T=F(this),d=b(C(T),T);return v(d,x)})},(k,l,t)=>{var e=t(64);k.exports=function(n,c){for(var b=0,F=e(c),C=new n(F);F>b;)C[b]=c[b++];return C}},(k,l,t)=>{var e=t(110),n=t(94),c=t(111),b=t(62),F=t(112),C=n.aTypedArray,S=n.getTypedArrayConstructor,v=n.exportTypedArrayMethod,M=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(x){return x===8}}();v("with",function(x,T){var d=C(this),a=b(x),i=c(d)?F(T):+T;return e(d,S(d),a,i)},!M)},(k,l,t)=>{var e=t(64),n=t(62),c=RangeError;k.exports=function(b,F,C,S){var v=e(b),M=n(C),x=M<0?v+M:M;if(x>=v||x<0)throw c("Incorrect index");for(var T=new F(v),d=0;d<v;d++)T[d]=d===x?S:b[d];return T}},(k,l,t)=>{var e=t(78);k.exports=function(n){var c=e(n);return c==="BigInt64Array"||c==="BigUint64Array"}},(k,l,t)=>{var e=t(19),n=TypeError;k.exports=function(c){var b=e(c,"number");if(typeof b=="number")throw n("Can't convert number to bigint");return BigInt(b)}},(k,l,t)=>{var e=t(6),n=t(88),c=t(114),b=ArrayBuffer.prototype;e&&!("detached"in b)&&n(b,"detached",{configurable:!0,get:function(){return c(this)}})},(k,l,t)=>{var e=t(14),n=t(115),c=e(ArrayBuffer.prototype.slice);k.exports=function(b){if(n(b)!==0)return!1;try{return c(b,0,0),!1}catch{return!0}}},(k,l,t)=>{var e=t(72),n=t(15),c=TypeError;k.exports=e(ArrayBuffer.prototype,"byteLength","get")||function(b){if(n(b)!=="ArrayBuffer")throw c("ArrayBuffer expected");return b.byteLength}},(k,l,t)=>{var e=t(3),n=t(117);n&&e({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},(k,l,t)=>{var e=t(4),n=t(14),c=t(72),b=t(118),F=t(114),C=t(115),S=t(119),v=e.TypeError,M=e.structuredClone,x=e.ArrayBuffer,T=e.DataView,d=Math.min,a=x.prototype,i=T.prototype,f=n(a.slice),E=c(a,"resizable","get"),O=c(a,"maxByteLength","get"),R=n(i.getInt8),u=n(i.setInt8);k.exports=S&&function(m,L,w){var y=C(m),N=L===void 0?y:b(L),D=!E||!E(m);if(F(m))throw v("ArrayBuffer is detached");var V=M(m,{transfer:[m]});if(y===N&&(w||D))return V;if(y>=N&&(!w||D))return f(V,0,N);for(var K=w&&!D&&O?{maxByteLength:O(V)}:void 0,U=new x(N,K),_=new T(V),nt=new T(U),rt=d(N,y),Y=0;Y<rt;Y++)u(nt,Y,R(_,Y));return U}},(k,l,t)=>{var e=t(62),n=t(65),c=RangeError;k.exports=function(b){if(b===void 0)return 0;var F=e(b),C=n(F);if(F!==C)throw c("Wrong length or index");return C}},(k,l,t)=>{var e=t(4),n=t(7),c=t(28),b=t(120),F=t(121),C=t(122),S=e.structuredClone;k.exports=!!S&&!n(function(){if(F&&c>92||C&&c>94||b&&c>97)return!1;var v=new ArrayBuffer(8),M=S(v,{transfer:[v]});return v.byteLength!==0||M.byteLength!==8})},(k,l,t)=>{var e=t(121),n=t(122);k.exports=!e&&!n&&typeof window=="object"&&typeof document=="object"},k=>{k.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(k,l,t)=>{var e=t(4),n=t(15);k.exports=n(e.process)==="process"},(k,l,t)=>{var e=t(3),n=t(117);n&&e({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var k,t,e,n,he,b,xe,C,S,v,M,x,T,d,a,i,Te,E,O,Ue,u,m;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);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(w){if(typeof w=="string"||w instanceof URL?w={url:w}:(0,_util.isArrayBuffer)(w)&&(w={data:w}),typeof w!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!w.url&&!w.data&&!w.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const y=new PDFDocumentLoadingTask,{docId:N}=y,D=w.url?getUrlProp(w.url):null,V=w.data?getDataProp(w.data):null,K=w.httpHeaders||null,U=w.withCredentials===!0,_=w.password??null,nt=w.range instanceof PDFDataRangeTransport?w.range:null,rt=Number.isInteger(w.rangeChunkSize)&&w.rangeChunkSize>0?w.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Y=w.worker instanceof PDFWorker?w.worker:null;const st=w.verbosity,gt=typeof w.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(w.docBaseUrl)?w.docBaseUrl:null,At=typeof w.cMapUrl=="string"?w.cMapUrl:null,wt=w.cMapPacked!==!1,W=w.CMapReaderFactory||DefaultCMapReaderFactory,h=typeof w.standardFontDataUrl=="string"?w.standardFontDataUrl:null,g=w.StandardFontDataFactory||DefaultStandardFontDataFactory,s=w.stopAtErrors!==!0,p=Number.isInteger(w.maxImageSize)&&w.maxImageSize>-1?w.maxImageSize:-1,A=w.isEvalSupported!==!1,I=typeof w.isOffscreenCanvasSupported=="boolean"?w.isOffscreenCanvasSupported:!_util.isNodeJS,P=Number.isInteger(w.canvasMaxAreaInBytes)?w.canvasMaxAreaInBytes:-1,H=typeof w.disableFontFace=="boolean"?w.disableFontFace:_util.isNodeJS,tt=w.fontExtraProperties===!0,q=w.enableXfa===!0,ct=w.ownerDocument||globalThis.document,ut=w.disableRange===!0,Et=w.disableStream===!0,mt=w.disableAutoFetch===!0,Ot=w.pdfBug===!0,Wt=nt?nt.length:w.length??NaN,kt=typeof w.useSystemFonts=="boolean"?w.useSystemFonts:!_util.isNodeJS&&!H,Nt=typeof w.useWorkerFetch=="boolean"?w.useWorkerFetch:W===_display_utils.DOMCMapReaderFactory&&g===_display_utils.DOMStandardFontDataFactory&&At&&h&&(0,_display_utils.isValidFetchUrl)(At,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(h,document.baseURI),bt=w.canvasFactory||new DefaultCanvasFactory({ownerDocument:ct}),ht=w.filterFactory||new DefaultFilterFactory({docId:N,ownerDocument:ct}),it=null;(0,_util.setVerbosityLevel)(st);const ft={canvasFactory:bt,filterFactory:ht};if(Nt||(ft.cMapReaderFactory=new W({baseUrl:At,isCompressed:wt}),ft.standardFontDataFactory=new g({baseUrl:h})),!Y){const zt={verbosity:st,port:_worker_options.GlobalWorkerOptions.workerPort};Y=zt.port?PDFWorker.fromPort(zt):new PDFWorker(zt),y._worker=Y}const Rt={docId:N,apiVersion:"3.11.174",data:V,password:_,disableAutoFetch:mt,rangeChunkSize:rt,length:Wt,docBaseUrl:gt,enableXfa:q,evaluatorOptions:{maxImageSize:p,disableFontFace:H,ignoreErrors:s,isEvalSupported:A,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:P,fontExtraProperties:tt,useSystemFonts:kt,cMapUrl:Nt?At:null,standardFontDataUrl:Nt?h:null}},Ft={ignoreErrors:s,isEvalSupported:A,disableFontFace:H,fontExtraProperties:tt,enableXfa:q,ownerDocument:ct,disableAutoFetch:mt,pdfBug:Ot,styleElement:it};return Y.promise.then(function(){if(y.destroyed)throw new Error("Loading aborted");const zt=_fetchDocument(Y,Rt),Vt=new Promise(function($t){let Gt;nt?Gt=new _transport_stream.PDFDataTransportStream({length:Wt,initialData:nt.initialData,progressiveDone:nt.progressiveDone,contentDispositionFilename:nt.contentDispositionFilename,disableRange:ut,disableStream:Et},nt):V||(Gt=(Yt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(Yt):(0,_display_utils.isValidFetchUrl)(Yt.url)?new _displayFetch_stream.PDFFetchStream(Yt):new _displayNetwork.PDFNetworkStream(Yt))({url:D,length:Wt,httpHeaders:K,withCredentials:U,rangeChunkSize:rt,disableRange:ut,disableStream:Et})),$t(Gt)});return Promise.all([zt,Vt]).then(function($t){let[Gt,Kt]=$t;if(y.destroyed)throw new Error("Loading aborted");const Yt=new _message_handler.MessageHandler(N,Gt,Y.port),Zt=new WorkerTransport(Yt,y,Kt,Ft,ft);y._transport=Zt,Yt.send("Ready",null)})}).catch(y._capability.reject),y}async function _fetchDocument(w,y){if(w.destroyed)throw new Error("Worker was destroyed");const N=await w.messageHandler.sendWithPromise("GetDocRequest",y,y.data?[y.data.buffer]:null);if(w.destroyed)throw new Error("Worker was destroyed");return N}function getUrlProp(w){if(w instanceof URL)return w.href;try{return new URL(w,window.location).href}catch{if(_util.isNodeJS&&typeof w=="string")return w}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(w){if(_util.isNodeJS&&typeof Buffer<"u"&&w instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(w instanceof Uint8Array&&w.byteLength===w.buffer.byteLength)return w;if(typeof w=="string")return(0,_util.stringToBytes)(w);if(typeof w=="object"&&!isNaN(w==null?void 0:w.length)||(0,_util.isArrayBuffer)(w))return new Uint8Array(w);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const l=class l{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${ge(l,k)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var y,N,D;this.destroyed=!0;try{(y=this._worker)!=null&&y.port&&(this._worker._pendingDestroy=!0),await((N=this._transport)==null?void 0:N.destroy())}catch(V){throw(D=this._worker)!=null&&D.port&&delete this._worker._pendingDestroy,V}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};k=new WeakMap,X(l,k,0);let PDFDocumentLoadingTask=l;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(y,N){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,V=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=y,this.initialData=N,this.progressiveDone=D,this.contentDispositionFilename=V,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(y){this._rangeListeners.push(y)}addProgressListener(y){this._progressListeners.push(y)}addProgressiveReadListener(y){this._progressiveReadListeners.push(y)}addProgressiveDoneListener(y){this._progressiveDoneListeners.push(y)}onDataRange(y,N){for(const D of this._rangeListeners)D(y,N)}onDataProgress(y,N){this._readyCapability.promise.then(()=>{for(const D of this._progressListeners)D(y,N)})}onDataProgressiveRead(y){this._readyCapability.promise.then(()=>{for(const N of this._progressiveReadListeners)N(y)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const y of this._progressiveDoneListeners)y()})}transportReady(){this._readyCapability.resolve()}requestDataRange(y,N){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(y,N){this._pdfInfo=y,this._transport=N,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(D=>{if(!D)return D;const V=[];for(const K in D)V.push(...D[K]);return V}))})}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(y){return this._transport.getPage(y)}getPageIndex(y){return this._transport.getPageIndex(y)}getDestinations(){return this._transport.getDestinations()}getDestination(y){return this._transport.getDestination(y)}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(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(y||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{constructor(y,N,D){X(this,n);X(this,b);X(this,t,null);X(this,e,!1);let V=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=y,this._pageInfo=N,this._transport=D,this._stats=V?new _display_utils.StatTimer:null,this._pdfBug=V,this.commonObjs=D.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:y,rotation:N=this.rotate,offsetX:D=0,offsetY:V=0,dontFlip:K=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:y,rotation:N,offsetX:D,offsetY:V,dontFlip:K})}getAnnotations(){let{intent:y="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const N=this._transport.getRenderingIntent(y);return this._transport.getAnnotations(this._pageIndex,N.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(){var y;return((y=this._transport._htmlForXfa)==null?void 0:y.children[this._pageIndex])||null}render(y){var s,p;let{canvasContext:N,viewport:D,intent:V="display",annotationMode:K=_util.AnnotationMode.ENABLE,transform:U=null,background:_=null,optionalContentConfigPromise:nt=null,annotationCanvasMap:rt=null,pageColors:Y=null,printAnnotationStorage:st=null}=y;(s=this._stats)==null||s.time("Overall");const gt=this._transport.getRenderingIntent(V,K,st);at(this,e,!1),j(this,b,xe).call(this),nt||(nt=this._transport.getOptionalContentConfig());let At=this._intentStates.get(gt.cacheKey);At||(At=Object.create(null),this._intentStates.set(gt.cacheKey,At)),At.streamReaderCancelTimeout&&(clearTimeout(At.streamReaderCancelTimeout),At.streamReaderCancelTimeout=null);const wt=!!(gt.renderingIntent&_util.RenderingIntentFlag.PRINT);At.displayReadyCapability||(At.displayReadyCapability=new _util.PromiseCapability,At.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(p=this._stats)==null||p.time("Page Request"),this._pumpOperatorList(gt));const W=A=>{var I,P;At.renderTasks.delete(h),(this._maybeCleanupAfterRender||wt)&&at(this,e,!0),j(this,n,he).call(this,!wt),A?(h.capability.reject(A),this._abortOperatorList({intentState:At,reason:A instanceof Error?A:new Error(A)})):h.capability.resolve(),(I=this._stats)==null||I.timeEnd("Rendering"),(P=this._stats)==null||P.timeEnd("Overall")},h=new InternalRenderTask({callback:W,params:{canvasContext:N,viewport:D,transform:U,background:_},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:At.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!wt,pdfBug:this._pdfBug,pageColors:Y});(At.renderTasks||(At.renderTasks=new Set)).add(h);const g=h.task;return Promise.all([At.displayReadyCapability.promise,nt]).then(A=>{var H;let[I,P]=A;if(this.destroyed){W();return}(H=this._stats)==null||H.time("Rendering"),h.initializeGraphics({transparency:I,optionalContentConfig:P}),h.operatorListChanged()}).catch(W),g}getOperatorList(){var nt;let{intent:y="display",annotationMode:N=_util.AnnotationMode.ENABLE,printAnnotationStorage:D=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function V(){U.operatorList.lastChunk&&(U.opListReadCapability.resolve(U.operatorList),U.renderTasks.delete(_))}const K=this._transport.getRenderingIntent(y,N,D,!0);let U=this._intentStates.get(K.cacheKey);U||(U=Object.create(null),this._intentStates.set(K.cacheKey,U));let _;return U.opListReadCapability||(_=Object.create(null),_.operatorListChanged=V,U.opListReadCapability=new _util.PromiseCapability,(U.renderTasks||(U.renderTasks=new Set)).add(_),U.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(nt=this._stats)==null||nt.time("Page Request"),this._pumpOperatorList(K)),U.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:y=!1,disableNormalization:N=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const D=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:y===!0,disableNormalization:N===!0},{highWaterMark:D,size(V){return V.items.length}})}getTextContent(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(D=>_xfa_text.XfaText.textContent(D));const N=this.streamTextContent(y);return new Promise(function(D,V){function K(){U.read().then(function(nt){let{value:rt,done:Y}=nt;if(Y){D(_);return}Object.assign(_.styles,rt.styles),_.items.push(...rt.items),K()},V)}const U=N.getReader(),_={items:[],styles:Object.create(null)};K()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const y=[];for(const N of this._intentStates.values())if(this._abortOperatorList({intentState:N,reason:new Error("Page was destroyed."),force:!0}),!N.opListReadCapability)for(const D of N.renderTasks)y.push(D.completed),D.cancel();return this.objs.clear(),at(this,e,!1),j(this,b,xe).call(this),Promise.all(y)}cleanup(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;at(this,e,!0);const N=j(this,n,he).call(this,!1);return y&&N&&this._stats&&(this._stats=new _display_utils.StatTimer),N}_startRenderPage(y,N){var V,K;const D=this._intentStates.get(N);D&&((V=this._stats)==null||V.timeEnd("Page Request"),(K=D.displayReadyCapability)==null||K.resolve(y))}_renderPageChunk(y,N){for(let D=0,V=y.length;D<V;D++)N.operatorList.fnArray.push(y.fnArray[D]),N.operatorList.argsArray.push(y.argsArray[D]);N.operatorList.lastChunk=y.lastChunk,N.operatorList.separateAnnots=y.separateAnnots;for(const D of N.renderTasks)D.operatorListChanged();y.lastChunk&&j(this,n,he).call(this,!0)}_pumpOperatorList(y){let{renderingIntent:N,cacheKey:D,annotationStorageSerializable:V}=y;const{map:K,transfers:U}=V,nt=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:N,cacheKey:D,annotationStorage:K},U).getReader(),rt=this._intentStates.get(D);rt.streamReader=nt;const Y=()=>{nt.read().then(st=>{let{value:gt,done:At}=st;if(At){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(gt,rt),Y())},st=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const gt of rt.renderTasks)gt.operatorListChanged();j(this,n,he).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(st);else if(rt.opListReadCapability)rt.opListReadCapability.reject(st);else throw st}})};Y()}_abortOperatorList(y){let{intentState:N,reason:D,force:V=!1}=y;if(N.streamReader){if(N.streamReaderCancelTimeout&&(clearTimeout(N.streamReaderCancelTimeout),N.streamReaderCancelTimeout=null),!V){if(N.renderTasks.size>0)return;if(D instanceof _display_utils.RenderingCancelledException){let K=RENDERING_CANCELLED_TIMEOUT;D.extraDelay>0&&D.extraDelay<1e3&&(K+=D.extraDelay),N.streamReaderCancelTimeout=setTimeout(()=>{N.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:N,reason:D,force:!0})},K);return}}if(N.streamReader.cancel(new _util.AbortException(D.message)).catch(()=>{}),N.streamReader=null,!this._transport.destroyed){for(const[K,U]of this._intentStates)if(U===N){this._intentStates.delete(K);break}this.cleanup()}}}get stats(){return this._stats}}t=new WeakMap,e=new WeakMap,n=new WeakSet,he=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(j(this,b,xe).call(this),!r(this,e)||this.destroyed)return!1;if(y)return at(this,t,setTimeout(()=>{at(this,t,null),j(this,n,he).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:N,operatorList:D}of this._intentStates.values())if(N.size>0||!D.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),at(this,e,!1),!0},b=new WeakSet,xe=function(){r(this,t)&&(clearTimeout(r(this,t)),at(this,t,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){X(this,C,new Set);X(this,S,Promise.resolve())}postMessage(y,N){const D={data:structuredClone(y,null)};r(this,S).then(()=>{for(const V of r(this,C))V.call(this,D)})}addEventListener(y,N){r(this,C).add(N)}removeEventListener(y,N){r(this,C).delete(N)}terminate(){r(this,C).clear()}}C=new WeakMap,S=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const w=(v=document==null?void 0:document.currentScript)==null?void 0:v.src;w&&(PDFWorkerUtil.fallbackWorkerSrc=w.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(w,y){let N;try{if(N=new URL(w),!N.origin||N.origin==="null")return!1}catch{return!1}const D=new URL(y,N);return N.origin===D.origin},PDFWorkerUtil.createCDNWrapper=function(w){const y=`importScripts("${w}");`;return URL.createObjectURL(new Blob([y]))}}const _PDFWorker=class _PDFWorker{constructor(){var D;let{name:w=null,port:y=null,verbosity:N=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=w,this.destroyed=!1,this.verbosity=N,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,y){if((D=r(_PDFWorker,M))!=null&&D.has(y))throw new Error("Cannot use more than one PDFWorker per port.");(r(_PDFWorker,M)||at(_PDFWorker,M,new WeakMap)).set(y,this),this._initializeFromPort(y);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(w){this._port=w,this._messageHandler=new _message_handler.MessageHandler("main","worker",w),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:w}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,w)||(w=PDFWorkerUtil.createCDNWrapper(new URL(w,window.location).href));const y=new Worker(w),N=new _message_handler.MessageHandler("main","worker",y),D=()=>{y.removeEventListener("error",V),N.destroy(),y.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},V=()=>{this._webWorker||D()};y.addEventListener("error",V),N.on("test",U=>{if(y.removeEventListener("error",V),this.destroyed){D();return}U?(this._messageHandler=N,this._port=y,this._webWorker=y,this._readyCapability.resolve(),N.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),N.destroy(),y.terminate())}),N.on("ready",U=>{if(y.removeEventListener("error",V),this.destroyed){D();return}try{K()}catch{this._setupFakeWorker()}});const K=()=>{const U=new Uint8Array;N.send("test",U,[U.buffer])};K();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(w=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const y=new LoopbackPort;this._port=y;const N=`fake${PDFWorkerUtil.fakeWorkerId++}`,D=new _message_handler.MessageHandler(N+"_worker",N,y);w.setup(D,y);const V=new _message_handler.MessageHandler(N,N+"_worker",y);this._messageHandler=V,this._readyCapability.resolve(),V.send("configure",{verbosity:this.verbosity})}).catch(w=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${w.message}".`))})}destroy(){var w;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(w=r(_PDFWorker,M))==null||w.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(w){var N;if(!(w!=null&&w.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const y=(N=r(this,M))==null?void 0:N.get(w.port);if(y){if(y._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return y}return new _PDFWorker(w)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var w;try{return((w=globalThis.pdfjsWorker)==null?void 0:w.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const 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())}};M=new WeakMap,X(_PDFWorker,M,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(y,N,D,V,K){X(this,i);X(this,x,new Map);X(this,T,new Map);X(this,d,new Map);X(this,a,null);this.messageHandler=y,this.loadingTask=N,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:V.ownerDocument,styleElement:V.styleElement}),this._params=V,this.canvasFactory=K.canvasFactory,this.filterFactory=K.filterFactory,this.cMapReaderFactory=K.cMapReaderFactory,this.standardFontDataFactory=K.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=D,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(y){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,V=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,K=_util.RenderingIntentFlag.DISPLAY,U=_annotation_storage.SerializableEmpty;switch(y){case"any":K=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":K=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${y}`)}switch(N){case _util.AnnotationMode.DISABLE:K+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:K+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:K+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,U=(K&_util.RenderingIntentFlag.PRINT&&D instanceof _annotation_storage.PrintAnnotationStorage?D:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${N}`)}return V&&(K+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:K,cacheKey:`${K}_${U.hash}`,annotationStorageSerializable:U}}destroy(){var D;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(D=r(this,a))==null||D.reject(new Error("Worker was destroyed during onPassword callback"));const y=[];for(const V of r(this,T).values())y.push(V._destroy());r(this,T).clear(),r(this,d).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const N=this.messageHandler.sendWithPromise("Terminate",null);return y.push(N),Promise.all(y).then(()=>{var V;this.commonObjs.clear(),this.fontLoader.clear(),r(this,x).clear(),this.filterFactory.destroy(),(V=this._networkStream)==null||V.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:y,loadingTask:N}=this;y.on("GetReader",(D,V)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=K=>{this._lastProgress={loaded:K.loaded,total:K.total}},V.onPull=()=>{this._fullReader.read().then(function(K){let{value:U,done:_}=K;if(_){V.close();return}(0,_util.assert)(U instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),V.enqueue(new Uint8Array(U),1,[U])}).catch(K=>{V.error(K)})},V.onCancel=K=>{this._fullReader.cancel(K),V.ready.catch(U=>{if(!this.destroyed)throw U})}}),y.on("ReaderHeadersReady",D=>{const V=new _util.PromiseCapability,K=this._fullReader;return K.headersReady.then(()=>{var U;(!K.isStreamingSupported||!K.isRangeSupported)&&(this._lastProgress&&((U=N.onProgress)==null||U.call(N,this._lastProgress)),K.onProgress=_=>{var nt;(nt=N.onProgress)==null||nt.call(N,{loaded:_.loaded,total:_.total})}),V.resolve({isStreamingSupported:K.isStreamingSupported,isRangeSupported:K.isRangeSupported,contentLength:K.contentLength})},V.reject),V.promise}),y.on("GetRangeReader",(D,V)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const K=this._networkStream.getRangeReader(D.begin,D.end);if(!K){V.close();return}V.onPull=()=>{K.read().then(function(U){let{value:_,done:nt}=U;if(nt){V.close();return}(0,_util.assert)(_ instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),V.enqueue(new Uint8Array(_),1,[_])}).catch(U=>{V.error(U)})},V.onCancel=U=>{K.cancel(U),V.ready.catch(_=>{if(!this.destroyed)throw _})}}),y.on("GetDoc",D=>{let{pdfInfo:V}=D;this._numPages=V.numPages,this._htmlForXfa=V.htmlForXfa,delete V.htmlForXfa,N._capability.resolve(new PDFDocumentProxy(V,this))}),y.on("DocException",function(D){let V;switch(D.name){case"PasswordException":V=new _util.PasswordException(D.message,D.code);break;case"InvalidPDFException":V=new _util.InvalidPDFException(D.message);break;case"MissingPDFException":V=new _util.MissingPDFException(D.message);break;case"UnexpectedResponseException":V=new _util.UnexpectedResponseException(D.message,D.status);break;case"UnknownErrorException":V=new _util.UnknownErrorException(D.message,D.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}N._capability.reject(V)}),y.on("PasswordRequest",D=>{if(at(this,a,new _util.PromiseCapability),N.onPassword){const V=K=>{K instanceof Error?r(this,a).reject(K):r(this,a).resolve({password:K})};try{N.onPassword(V,D.code)}catch(K){r(this,a).reject(K)}}else r(this,a).reject(new _util.PasswordException(D.message,D.code));return r(this,a).promise}),y.on("DataLoaded",D=>{var V;(V=N.onProgress)==null||V.call(N,{loaded:D.length,total:D.length}),this.downloadInfoCapability.resolve(D)}),y.on("StartRenderPage",D=>{if(this.destroyed)return;r(this,T).get(D.pageIndex)._startRenderPage(D.transparency,D.cacheKey)}),y.on("commonobj",D=>{var _;let[V,K,U]=D;if(!this.destroyed&&!this.commonObjs.has(V))switch(K){case"Font":const nt=this._params;if("error"in U){const st=U.error;(0,_util.warn)(`Error during font loading: ${st}`),this.commonObjs.resolve(V,st);break}const rt=nt.pdfBug&&((_=globalThis.FontInspector)!=null&&_.enabled)?(st,gt)=>globalThis.FontInspector.fontAdded(st,gt):null,Y=new _font_loader.FontFaceObject(U,{isEvalSupported:nt.isEvalSupported,disableFontFace:nt.disableFontFace,ignoreErrors:nt.ignoreErrors,inspectFont:rt});this.fontLoader.bind(Y).catch(st=>y.sendWithPromise("FontFallback",{id:V})).finally(()=>{!nt.fontExtraProperties&&Y.data&&(Y.data=null),this.commonObjs.resolve(V,Y)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(V,U);break;default:throw new Error(`Got unknown common object type ${K}`)}}),y.on("obj",D=>{var rt;let[V,K,U,_]=D;if(this.destroyed)return;const nt=r(this,T).get(K);if(!nt.objs.has(V))switch(U){case"Image":if(nt.objs.resolve(V,_),_){let Y;if(_.bitmap){const{width:st,height:gt}=_;Y=st*gt*4}else Y=((rt=_.data)==null?void 0:rt.length)||0;Y>_util.MAX_IMAGE_SIZE_TO_CACHE&&(nt._maybeCleanupAfterRender=!0)}break;case"Pattern":nt.objs.resolve(V,_);break;default:throw new Error(`Got unknown object type ${U}`)}}),y.on("DocProgress",D=>{var V;this.destroyed||(V=N.onProgress)==null||V.call(N,{loaded:D.loaded,total:D.total})}),y.on("FetchBuiltInCMap",D=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(D):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),y.on("FetchStandardFontData",D=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(D):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var D;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:y,transfers:N}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:y,filename:((D=this._fullReader)==null?void 0:D.filename)??null},N).finally(()=>{this.annotationStorage.resetModified()})}getPage(y){if(!Number.isInteger(y)||y<=0||y>this._numPages)return Promise.reject(new Error("Invalid page request."));const N=y-1,D=r(this,d).get(N);if(D)return D;const V=this.messageHandler.sendWithPromise("GetPage",{pageIndex:N}).then(K=>{if(this.destroyed)throw new Error("Transport destroyed");const U=new PDFPageProxy(N,K,this,this._params.pdfBug);return r(this,T).set(N,U),U});return r(this,d).set(N,V),V}getPageIndex(y){return typeof y!="object"||y===null||!Number.isInteger(y.num)||y.num<0||!Number.isInteger(y.gen)||y.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:y.num,gen:y.gen})}getAnnotations(y,N){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:y,intent:N})}getFieldObjects(){return j(this,i,Te).call(this,"GetFieldObjects")}hasJSActions(){return j(this,i,Te).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(y){return typeof y!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:y})}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 j(this,i,Te).call(this,"GetDocJSActions")}getPageJSActions(y){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:y})}getStructTree(y){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:y})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(y=>new _optional_content_config.OptionalContentConfig(y))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const y="GetMetadata",N=r(this,x).get(y);if(N)return N;const D=this.messageHandler.sendWithPromise(y,null).then(V=>{var K,U;return{info:V[0],metadata:V[1]?new _metadata.Metadata(V[1]):null,contentDispositionFilename:((K=this._fullReader)==null?void 0:K.filename)??null,contentLength:((U=this._fullReader)==null?void 0:U.contentLength)??null}});return r(this,x).set(y,D),D}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const N of r(this,T).values())if(!N.cleanup())throw new Error(`startCleanup: Page ${N.pageNumber} is currently rendering.`);this.commonObjs.clear(),y||this.fontLoader.clear(),r(this,x).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:y,enableXfa:N}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:y,enableXfa:N})}}x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakSet,Te=function(y){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const D=r(this,x).get(y);if(D)return D;const V=this.messageHandler.sendWithPromise(y,N);return r(this,x).set(y,V),V};class PDFObjects{constructor(){X(this,O);X(this,E,Object.create(null))}get(y){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(N){const V=j(this,O,Ue).call(this,y);return V.capability.promise.then(()=>N(V.data)),null}const D=r(this,E)[y];if(!(D!=null&&D.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${y}.`);return D.data}has(y){const N=r(this,E)[y];return(N==null?void 0:N.capability.settled)||!1}resolve(y){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const D=j(this,O,Ue).call(this,y);D.data=N,D.capability.resolve()}clear(){var y;for(const N in r(this,E)){const{data:D}=r(this,E)[N];(y=D==null?void 0:D.bitmap)==null||y.close()}at(this,E,Object.create(null))}}E=new WeakMap,O=new WeakSet,Ue=function(y){var N;return(N=r(this,E))[y]||(N[y]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(y){X(this,u,null);at(this,u,y),this.onContinue=null}get promise(){return r(this,u).capability.promise}cancel(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r(this,u).cancel(null,y)}get separateAnnots(){const{separateAnnots:y}=r(this,u).operatorList;if(!y)return!1;const{annotationCanvasMap:N}=r(this,u);return y.form||y.canvas&&(N==null?void 0:N.size)>0}}u=new WeakMap,exports.RenderTask=RenderTask;const L=class L{constructor(y){let{callback:N,params:D,objs:V,commonObjs:K,annotationCanvasMap:U,operatorList:_,pageIndex:nt,canvasFactory:rt,filterFactory:Y,useRequestAnimationFrame:st=!1,pdfBug:gt=!1,pageColors:At=null}=y;this.callback=N,this.params=D,this.objs=V,this.commonObjs=K,this.annotationCanvasMap=U,this.operatorListIdx=null,this.operatorList=_,this._pageIndex=nt,this.canvasFactory=rt,this.filterFactory=Y,this._pdfBug=gt,this.pageColors=At,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=st===!0&&typeof window<"u",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=D.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(y){var nt,rt;let{transparency:N=!1,optionalContentConfig:D}=y;if(this.cancelled)return;if(this._canvas){if(r(L,m).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.");r(L,m).add(this._canvas)}this._pdfBug&&((nt=globalThis.StepperManager)!=null&&nt.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:V,viewport:K,transform:U,background:_}=this.params;this.gfx=new _canvas.CanvasGraphics(V,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:D},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:U,viewport:K,transparency:N,background:_}),this.operatorListIdx=0,this.graphicsReady=!0,(rt=this.graphicsReadyCallback)==null||rt.call(this)}cancel(){var D;let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,(D=this.gfx)==null||D.endDrawing(),r(L,m).delete(this._canvas),this.callback(y||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,N))}operatorListChanged(){var y;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(y=this.stepper)==null||y.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),r(L,m).delete(this._canvas),this.callback())))}};m=new WeakMap,X(L,m,new WeakSet);let InternalRenderTask=L;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(k,l,t)=>{var e=t(3),n=t(126),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("difference")},{difference:n})},(k,l,t)=>{var e=t(127),n=t(128),c=t(129),b=t(132),F=t(133),C=t(130),S=t(131),v=n.has,M=n.remove;k.exports=function(T){var d=e(this),a=F(T),i=c(d);return b(d)<=a.size?C(d,function(f){a.includes(f)&&M(i,f)}):S(a.getIterator(),function(f){v(d,f)&&M(i,f)}),i}},(k,l,t)=>{var e=t(128).has;k.exports=function(n){return e(n),n}},(k,l,t)=>{var e=t(14),n=Set.prototype;k.exports={Set,add:e(n.add),has:e(n.has),remove:e(n.delete),proto:n}},(k,l,t)=>{var e=t(128),n=t(130),c=e.Set,b=e.add;k.exports=function(F){var C=new c;return n(F,function(S){b(C,S)}),C}},(k,l,t)=>{var e=t(14),n=t(131),c=t(128),b=c.Set,F=c.proto,C=e(F.forEach),S=e(F.keys),v=S(new b).next;k.exports=function(M,x,T){return T?n({iterator:S(M),next:v},x):C(M,x)}},(k,l,t)=>{var e=t(8);k.exports=function(n,c,b){for(var F=b?n:n.iterator,C=n.next,S,v;!(S=e(C,F)).done;)if(v=c(S.value),v!==void 0)return v}},(k,l,t)=>{var e=t(72),n=t(128);k.exports=e(n.proto,"size","get")||function(c){return c.size}},(k,l,t)=>{var e=t(31),n=t(47),c=t(8),b=t(62),F=t(134),C="Invalid size",S=RangeError,v=TypeError,M=Math.max,x=function(T,d,a,i){this.set=T,this.size=d,this.has=a,this.keys=i};x.prototype={getIterator:function(){return F(n(c(this.keys,this.set)))},includes:function(T){return c(this.has,this.set,T)}},k.exports=function(T){n(T);var d=+T.size;if(d!==d)throw v(C);var a=b(d);if(a<0)throw S(C);return new x(T,M(a,0),e(T.has),e(T.keys))}},k=>{k.exports=function(l){return{iterator:l,next:l.next,done:!1}}},(k,l,t)=>{var e=t(24),n=function(c){return{size:c,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};k.exports=function(c){var b=e("Set");try{new b()[c](n(0));try{return new b()[c](n(-1)),!1}catch{return!0}}catch{return!1}}},(k,l,t)=>{var e=t(3),n=t(7),c=t(137),b=t(135),F=!b("intersection")||n(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});e({target:"Set",proto:!0,real:!0,forced:F},{intersection:c})},(k,l,t)=>{var e=t(127),n=t(128),c=t(132),b=t(133),F=t(130),C=t(131),S=n.Set,v=n.add,M=n.has;k.exports=function(T){var d=e(this),a=b(T),i=new S;return c(d)>a.size?C(a.getIterator(),function(f){M(d,f)&&v(i,f)}):F(d,function(f){a.includes(f)&&v(i,f)}),i}},(k,l,t)=>{var e=t(3),n=t(139),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("isDisjointFrom")},{isDisjointFrom:n})},(k,l,t)=>{var e=t(127),n=t(128).has,c=t(132),b=t(133),F=t(130),C=t(131),S=t(140);k.exports=function(M){var x=e(this),T=b(M);if(c(x)<=T.size)return F(x,function(a){if(T.includes(a))return!1},!0)!==!1;var d=T.getIterator();return C(d,function(a){if(n(x,a))return S(d,"normal",!1)})!==!1}},(k,l,t)=>{var e=t(8),n=t(47),c=t(30);k.exports=function(b,F,C){var S,v;n(b);try{if(S=c(b,"return"),!S){if(F==="throw")throw C;return C}S=e(S,b)}catch(M){v=!0,S=M}if(F==="throw")throw C;if(v)throw S;return n(S),C}},(k,l,t)=>{var e=t(3),n=t(142),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("isSubsetOf")},{isSubsetOf:n})},(k,l,t)=>{var e=t(127),n=t(132),c=t(130),b=t(133);k.exports=function(C){var S=e(this),v=b(C);return n(S)>v.size?!1:c(S,function(M){if(!v.includes(M))return!1},!0)!==!1}},(k,l,t)=>{var e=t(3),n=t(144),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("isSupersetOf")},{isSupersetOf:n})},(k,l,t)=>{var e=t(127),n=t(128).has,c=t(132),b=t(133),F=t(131),C=t(140);k.exports=function(v){var M=e(this),x=b(v);if(c(M)<x.size)return!1;var T=x.getIterator();return F(T,function(d){if(!n(M,d))return C(T,"normal",!1)})!==!1}},(k,l,t)=>{var e=t(3),n=t(146),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("symmetricDifference")},{symmetricDifference:n})},(k,l,t)=>{var e=t(127),n=t(128),c=t(129),b=t(133),F=t(131),C=n.add,S=n.has,v=n.remove;k.exports=function(x){var T=e(this),d=b(x).getIterator(),a=c(T);return F(d,function(i){S(T,i)?v(a,i):C(a,i)}),a}},(k,l,t)=>{var e=t(3),n=t(148),c=t(135);e({target:"Set",proto:!0,real:!0,forced:!c("union")},{union:n})},(k,l,t)=>{var e=t(127),n=t(128).add,c=t(129),b=t(133),F=t(131);k.exports=function(S){var v=e(this),M=b(S).getIterator(),x=c(v);return F(M,function(T){n(x,T)}),x}},(k,l,t)=>{var e=t(3),n=t(4),c=t(24),b=t(11),F=t(45).f,C=t(39),S=t(150),v=t(75),M=t(76),x=t(151),T=t(82),d=t(6),a=t(36),i="DOMException",f=c("Error"),E=c(i),O=function(){S(this,R);var nt=arguments.length,rt=M(nt<1?void 0:arguments[0]),Y=M(nt<2?void 0:arguments[1],"Error"),st=new E(rt,Y),gt=f(rt);return gt.name=i,F(st,"stack",b(1,T(gt.stack,1))),v(st,this,O),st},R=O.prototype=E.prototype,u="stack"in f(i),m="stack"in new E(1,2),L=E&&d&&Object.getOwnPropertyDescriptor(n,i),w=!!L&&!(L.writable&&L.configurable),y=u&&!w&&!m;e({global:!0,constructor:!0,forced:a||y},{DOMException:y?O:E});var N=c(i),D=N.prototype;if(D.constructor!==N){a||F(D,"constructor",b(1,N));for(var V in x)if(C(x,V)){var K=x[V],U=K.s;C(N,U)||F(N,U,b(6,K.c))}}},(k,l,t)=>{var e=t(25),n=TypeError;k.exports=function(c,b){if(e(b,c))return c;throw n("Incorrect invocation")}},k=>{k.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}}},(k,l,t)=>{var e=t(36),n=t(3),c=t(4),b=t(24),F=t(14),C=t(7),S=t(41),v=t(21),M=t(153),x=t(17),T=t(20),d=t(23),a=t(154),i=t(47),f=t(78),E=t(39),O=t(159),R=t(44),u=t(64),m=t(85),L=t(160),w=t(162),y=t(128),N=t(83),D=t(119),V=c.Object,K=c.Array,U=c.Date,_=c.Error,nt=c.EvalError,rt=c.RangeError,Y=c.ReferenceError,st=c.SyntaxError,gt=c.TypeError,At=c.URIError,wt=c.PerformanceMark,W=c.WebAssembly,h=W&&W.CompileError||_,g=W&&W.LinkError||_,s=W&&W.RuntimeError||_,p=b("DOMException"),A=w.Map,I=w.has,P=w.get,H=w.set,tt=y.Set,q=y.add,ct=b("Object","keys"),ut=F([].push),Et=F((!0).valueOf),mt=F(1 .valueOf),Ot=F("".valueOf),Wt=F(U.prototype.getTime),kt=S("structuredClone"),Nt="DataCloneError",bt="Transferring",ht=function(ot){return!C(function(){var G=new c.Set([7]),pt=ot(G),xt=ot(V(7));return pt===G||!pt.has(7)||typeof xt!="object"||+xt!=7})&&ot},it=function(ot,G){return!C(function(){var pt=new G,xt=ot({a:pt,b:pt});return!(xt&&xt.a===xt.b&&xt.a instanceof G&&xt.a.stack===pt.stack)})},ft=function(ot){return!C(function(){var G=ot(new c.AggregateError([1],kt,{cause:3}));return G.name!=="AggregateError"||G.errors[0]!==1||G.message!==kt||G.cause!==3})},Rt=c.structuredClone,Ft=e||!it(Rt,_)||!it(Rt,p)||!ft(Rt),zt=!Rt&&ht(function(ot){return new wt(kt,{detail:ot}).detail}),Vt=ht(Rt)||zt,$t=function(ot){throw new p("Uncloneable type: "+ot,Nt)},Gt=function(ot,G){throw new p((G||"Cloning")+" of "+ot+" cannot be properly polyfilled in this engine",Nt)},Kt=function(ot,G){return Vt||Gt(G),Vt(ot)},Yt=function(){var ot;try{ot=new c.DataTransfer}catch{try{ot=new c.ClipboardEvent("").clipboardData}catch{}}return ot&&ot.items&&ot.files?ot:null},Zt=function(ot,G,pt){if(I(G,ot))return P(G,ot);var xt=pt||f(ot),St,Pt,vt,Ht,Tt,Lt;if(xt==="SharedArrayBuffer")Vt?St=Vt(ot):St=ot;else{var Dt=c.DataView;!Dt&&typeof ot.slice!="function"&&Gt("ArrayBuffer");try{if(typeof ot.slice=="function"&&!ot.resizable)St=ot.slice(0);else for(Pt=ot.byteLength,vt=("maxByteLength"in ot)?{maxByteLength:ot.maxByteLength}:void 0,St=new ArrayBuffer(Pt,vt),Ht=new Dt(ot),Tt=new Dt(St),Lt=0;Lt<Pt;Lt++)Tt.setUint8(Lt,Ht.getUint8(Lt))}catch{throw new p("ArrayBuffer is detached",Nt)}}return H(G,ot,St),St},_t=function(ot,G,pt,xt,St){var Pt=c[G];return T(Pt)||Gt(G),new Pt(Zt(ot.buffer,St),pt,xt)},yt=function(ot,G,pt){this.object=ot,this.type=G,this.metadata=pt},Z=function(ot,G,pt){if(d(ot)&&$t("Symbol"),!T(ot))return ot;if(G){if(I(G,ot))return P(G,ot)}else G=new A;var xt=f(ot),St,Pt,vt,Ht,Tt,Lt,Dt,z;switch(xt){case"Array":vt=K(u(ot));break;case"Object":vt={};break;case"Map":vt=new A;break;case"Set":vt=new tt;break;case"RegExp":vt=new RegExp(ot.source,L(ot));break;case"Error":switch(Pt=ot.name,Pt){case"AggregateError":vt=b("AggregateError")([]);break;case"EvalError":vt=nt();break;case"RangeError":vt=rt();break;case"ReferenceError":vt=Y();break;case"SyntaxError":vt=st();break;case"TypeError":vt=gt();break;case"URIError":vt=At();break;case"CompileError":vt=h();break;case"LinkError":vt=g();break;case"RuntimeError":vt=s();break;default:vt=_()}break;case"DOMException":vt=new p(ot.message,ot.name);break;case"ArrayBuffer":case"SharedArrayBuffer":vt=pt?new yt(ot,xt):Zt(ot,G,xt);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":Lt=xt==="DataView"?ot.byteLength:ot.length,vt=pt?new yt(ot,xt,{offset:ot.byteOffset,length:Lt}):_t(ot,xt,ot.byteOffset,Lt,G);break;case"DOMQuad":try{vt=new DOMQuad(Z(ot.p1,G,pt),Z(ot.p2,G,pt),Z(ot.p3,G,pt),Z(ot.p4,G,pt))}catch{vt=Kt(ot,xt)}break;case"File":if(Vt)try{vt=Vt(ot),f(vt)!==xt&&(vt=void 0)}catch{}if(!vt)try{vt=new File([ot],ot.name,ot)}catch{}vt||Gt(xt);break;case"FileList":if(Ht=Yt(),Ht){for(Tt=0,Lt=u(ot);Tt<Lt;Tt++)Ht.items.add(Z(ot[Tt],G,pt));vt=Ht.files}else vt=Kt(ot,xt);break;case"ImageData":try{vt=new ImageData(Z(ot.data,G,pt),ot.width,ot.height,{colorSpace:ot.colorSpace})}catch{vt=Kt(ot,xt)}break;default:if(Vt)vt=Vt(ot);else switch(xt){case"BigInt":vt=V(ot.valueOf());break;case"Boolean":vt=V(Et(ot));break;case"Number":vt=V(mt(ot));break;case"String":vt=V(Ot(ot));break;case"Date":vt=new U(Wt(ot));break;case"Blob":try{vt=ot.slice(0,ot.size,ot.type)}catch{Gt(xt)}break;case"DOMPoint":case"DOMPointReadOnly":St=c[xt];try{vt=St.fromPoint?St.fromPoint(ot):new St(ot.x,ot.y,ot.z,ot.w)}catch{Gt(xt)}break;case"DOMRect":case"DOMRectReadOnly":St=c[xt];try{vt=St.fromRect?St.fromRect(ot):new St(ot.x,ot.y,ot.width,ot.height)}catch{Gt(xt)}break;case"DOMMatrix":case"DOMMatrixReadOnly":St=c[xt];try{vt=St.fromMatrix?St.fromMatrix(ot):new St(ot)}catch{Gt(xt)}break;case"AudioData":case"VideoFrame":v(ot.clone)||Gt(xt);try{vt=ot.clone()}catch{$t(xt)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":Gt(xt);default:$t(xt)}}switch(H(G,ot,vt),xt){case"Array":case"Object":for(Dt=ct(ot),Tt=0,Lt=u(Dt);Tt<Lt;Tt++)z=Dt[Tt],O(vt,z,Z(ot[z],G,pt));break;case"Map":ot.forEach(function(o,B){H(vt,Z(B,G,pt),Z(o,G,pt))});break;case"Set":ot.forEach(function(o){q(vt,Z(o,G,pt))});break;case"Error":R(vt,"message",Z(ot.message,G,pt)),E(ot,"cause")&&R(vt,"cause",Z(ot.cause,G,pt)),Pt==="AggregateError"&&(vt.errors=Z(ot.errors,G,pt));case"DOMException":N&&R(vt,"stack",Z(ot.stack,G,pt))}return vt},J=function(ot,G){if(!T(ot))return ot;if(I(G,ot))return P(G,ot);var pt,xt,St,Pt,vt,Ht,Tt,Lt;if(ot instanceof yt)switch(pt=ot.type,xt=ot.object,pt){case"ArrayBuffer":case"SharedArrayBuffer":Lt=Zt(xt,G,pt);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":St=ot.metadata,Lt=_t(xt,pt,St.offset,St.length,G)}else switch(f(ot)){case"Array":case"Object":for(Ht=ct(ot),Pt=0,vt=u(Ht);Pt<vt;Pt++)Tt=Ht[Pt],ot[Tt]=J(ot[Tt],G);break;case"Map":Lt=new A,ot.forEach(function(Dt,z){H(Lt,J(z,G),J(Dt,G))});break;case"Set":Lt=new tt,ot.forEach(function(Dt){q(Lt,J(Dt,G))});break;case"Error":ot.message=J(ot.message,G),E(ot,"cause")&&(ot.cause=J(ot.cause,G)),ot.name==="AggregateError"&&(ot.errors=J(ot.errors,G));case"DOMException":N&&(ot.stack=J(ot.stack,G))}return H(G,ot,Lt||ot),Lt||ot},dt=function(ot,G){if(!T(ot))throw gt("Transfer option cannot be converted to a sequence");var pt=[];a(ot,function(o){ut(pt,i(o))});for(var xt=0,St=u(pt),Pt=[],vt,Ht,Tt,Lt,Dt,z;xt<St;){if(vt=pt[xt++],Ht=f(vt),Ht==="ArrayBuffer"){ut(Pt,vt);continue}if(I(G,vt))throw new p("Duplicate transferable",Nt);if(D)Lt=Rt(vt,{transfer:[vt]});else switch(Ht){case"ImageBitmap":Tt=c.OffscreenCanvas,M(Tt)||Gt(Ht,bt);try{Dt=new Tt(vt.width,vt.height),z=Dt.getContext("bitmaprenderer"),z.transferFromImageBitmap(vt),Lt=Dt.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!v(vt.clone)||!v(vt.close))&&Gt(Ht,bt);try{Lt=vt.clone(),vt.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":Gt(Ht,bt)}if(Lt===void 0)throw new p("This object cannot be transferred: "+Ht,Nt);H(G,vt,Lt)}return Pt},jt=function(ot,G){for(var pt=0,xt=u(ot),St,Pt;pt<xt;){if(St=ot[pt++],I(G,St))throw new p("Duplicate transferable",Nt);D?Pt=Rt(St,{transfer:[St]}):(v(St.transfer)||Gt("ArrayBuffer",bt),Pt=St.transfer()),H(G,St,Pt)}};n({global:!0,enumerable:!0,sham:!D,forced:Ft},{structuredClone:function(G){var pt=m(arguments.length,1)>1&&!x(arguments[1])?i(arguments[1]):void 0,xt=pt?pt.transfer:void 0,St=!1,Pt,vt;xt!==void 0&&(Pt=new A,vt=dt(xt,Pt),St=!!u(vt));var Ht=Z(G,Pt,St);return St&&(Pt=new A,jt(xt,Pt),Ht=J(Ht,Pt)),Ht}})},(k,l,t)=>{var e=t(14),n=t(7),c=t(21),b=t(78),F=t(24),C=t(51),S=function(){},v=[],M=F("Reflect","construct"),x=/^\s*(?:class|function)\b/,T=e(x.exec),d=!x.exec(S),a=function(E){if(!c(E))return!1;try{return M(S,v,E),!0}catch{return!1}},i=function(E){if(!c(E))return!1;switch(b(E)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!T(x,C(E))}catch{return!0}};i.sham=!0,k.exports=!M||n(function(){var f;return a(a.call)||!a(Object)||!a(function(){f=!0})||f})?i:a},(k,l,t)=>{var e=t(99),n=t(8),c=t(47),b=t(32),F=t(155),C=t(64),S=t(25),v=t(157),M=t(158),x=t(140),T=TypeError,d=function(i,f){this.stopped=i,this.result=f},a=d.prototype;k.exports=function(i,f,E){var O=E&&E.that,R=!!(E&&E.AS_ENTRIES),u=!!(E&&E.IS_RECORD),m=!!(E&&E.IS_ITERATOR),L=!!(E&&E.INTERRUPTED),w=e(f,O),y,N,D,V,K,U,_,nt=function(Y){return y&&x(y,"normal",Y),new d(!0,Y)},rt=function(Y){return R?(c(Y),L?w(Y[0],Y[1],nt):w(Y[0],Y[1])):L?w(Y,nt):w(Y)};if(u)y=i.iterator;else if(m)y=i;else{if(N=M(i),!N)throw T(b(i)+" is not iterable");if(F(N)){for(D=0,V=C(i);V>D;D++)if(K=rt(i[D]),K&&S(a,K))return K;return new d(!1)}y=v(i,N)}for(U=u?i.next:y.next;!(_=n(U,y)).done;){try{K=rt(_.value)}catch(Y){x(y,"throw",Y)}if(typeof K=="object"&&K&&S(a,K))return K}return new d(!1)}},(k,l,t)=>{var e=t(34),n=t(156),c=e("iterator"),b=Array.prototype;k.exports=function(F){return F!==void 0&&(n.Array===F||b[c]===F)}},k=>{k.exports={}},(k,l,t)=>{var e=t(8),n=t(31),c=t(47),b=t(32),F=t(158),C=TypeError;k.exports=function(S,v){var M=arguments.length<2?F(S):v;if(n(M))return c(e(M,S));throw C(b(S)+" is not iterable")}},(k,l,t)=>{var e=t(78),n=t(30),c=t(17),b=t(156),F=t(34),C=F("iterator");k.exports=function(S){if(!c(S))return n(S,C)||n(S,"@@iterator")||b[e(S)]}},(k,l,t)=>{var e=t(18),n=t(45),c=t(11);k.exports=function(b,F,C){var S=e(F);S in b?n.f(b,S,c(0,C)):b[S]=C}},(k,l,t)=>{var e=t(8),n=t(39),c=t(25),b=t(161),F=RegExp.prototype;k.exports=function(C){var S=C.flags;return S===void 0&&!("flags"in F)&&!n(C,"flags")&&c(F,C)?e(b,C):S}},(k,l,t)=>{var e=t(47);k.exports=function(){var n=e(this),c="";return n.hasIndices&&(c+="d"),n.global&&(c+="g"),n.ignoreCase&&(c+="i"),n.multiline&&(c+="m"),n.dotAll&&(c+="s"),n.unicode&&(c+="u"),n.unicodeSets&&(c+="v"),n.sticky&&(c+="y"),c}},(k,l,t)=>{var e=t(14),n=Map.prototype;k.exports={Map,set:e(n.set),get:e(n.get),has:e(n.has),remove:e(n.delete),proto:n}},(k,l,t)=>{var S,v,M,An,T;Object.defineProperty(l,"__esModule",{value:!0}),l.SerializableEmpty=l.PrintAnnotationStorage=l.AnnotationStorage=void 0,t(89),t(149),t(152);var e=t(1),n=t(164),c=t(170);const b=Object.freeze({map:null,hash:"",transfers:void 0});l.SerializableEmpty=b;class F{constructor(){X(this,M);X(this,S,!1);X(this,v,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(a,i){const f=r(this,v).get(a);return f===void 0?i:Object.assign(i,f)}getRawValue(a){return r(this,v).get(a)}remove(a){if(r(this,v).delete(a),r(this,v).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of r(this,v).values())if(i instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(a,i){const f=r(this,v).get(a);let E=!1;if(f!==void 0)for(const[O,R]of Object.entries(i))f[O]!==R&&(E=!0,f[O]=R);else E=!0,r(this,v).set(a,i);E&&j(this,M,An).call(this),i instanceof n.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(a){return r(this,v).has(a)}getAll(){return r(this,v).size>0?(0,e.objectFromMap)(r(this,v)):null}setAll(a){for(const[i,f]of Object.entries(a))this.setValue(i,f)}get size(){return r(this,v).size}resetModified(){r(this,S)&&(at(this,S,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new C(this)}get serializable(){if(r(this,v).size===0)return b;const a=new Map,i=new c.MurmurHash3_64,f=[],E=Object.create(null);let O=!1;for(const[R,u]of r(this,v)){const m=u instanceof n.AnnotationEditor?u.serialize(!1,E):u;m&&(a.set(R,m),i.update(`${R}:${JSON.stringify(m)}`),O||(O=!!m.bitmap))}if(O)for(const R of a.values())R.bitmap&&f.push(R.bitmap);return a.size>0?{map:a,hash:i.hexdigest(),transfers:f}:b}}S=new WeakMap,v=new WeakMap,M=new WeakSet,An=function(){r(this,S)||(at(this,S,!0),typeof this.onSetModified=="function"&&this.onSetModified())},l.AnnotationStorage=F;class C extends F{constructor(i){super();X(this,T,void 0);const{map:f,hash:E,transfers:O}=i.serializable,R=structuredClone(f,null);at(this,T,{map:R,hash:E,transfers:O})}get print(){(0,e.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return r(this,T)}}T=new WeakMap,l.PrintAnnotationStorage=C},(k,l,t)=>{var C,S,v,M,x,T,d,a,i,f,E,O,R,u,m,We,w,He,N,ze,V,Ge,U,Sn,nt,En,Y,xn,gt,$e,wt,Tn;Object.defineProperty(l,"__esModule",{value:!0}),l.AnnotationEditor=void 0,t(89),t(2);var e=t(165),n=t(1),c=t(168);const h=class h{constructor(s){X(this,m);X(this,w);X(this,V);X(this,U);X(this,nt);X(this,Y);X(this,gt);X(this,wt);X(this,C,"");X(this,S,!1);X(this,v,null);X(this,M,null);X(this,x,null);X(this,T,!1);X(this,d,null);X(this,a,this.focusin.bind(this));X(this,i,this.focusout.bind(this));X(this,f,!1);X(this,E,!1);X(this,O,!1);ee(this,"_initialOptions",Object.create(null));ee(this,"_uiManager",null);ee(this,"_focusEventsAllowed",!0);ee(this,"_l10nPromise",null);X(this,R,!1);X(this,u,h._zIndex++);this.constructor===h&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=s.parent,this.id=s.id,this.width=this.height=null,this.pageIndex=s.parent.pageIndex,this.name=s.name,this.div=null,this._uiManager=s.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=s.isCentered,this._structTreeParentId=null;const{rotation:p,rawDims:{pageWidth:A,pageHeight:I,pageX:P,pageY:H}}=this.parent.viewport;this.rotation=p,this.pageRotation=(360+p-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[A,I],this.pageTranslation=[P,H];const[tt,q]=this.parentDimensions;this.x=s.x/tt,this.y=s.y/q,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(s){const p=new F({id:s.parent.getNextId(),parent:s.parent,uiManager:s._uiManager});p.annotationElementId=s.annotationElementId,p.deleted=!0,p._uiManager.addToAnnotationStorage(p)}static initialize(s){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(h._l10nPromise||(h._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(I=>[I,s.get(I)]))),p!=null&&p.strings)for(const I of p.strings)h._l10nPromise.set(I,s.get(I));if(h._borderLineWidth!==-1)return;const A=getComputedStyle(document.documentElement);h._borderLineWidth=parseFloat(A.getPropertyValue("--outline-width"))||0}static updateDefaultParams(s,p){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(s){return!1}static paste(s,p){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return r(this,R)}set _isDraggable(s){var p;at(this,R,s),(p=this.div)==null||p.classList.toggle("draggable",s)}center(){const[s,p]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*p/(s*2),this.y+=this.width*s/(p*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*p/(s*2),this.y-=this.width*s/(p*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(s){this._uiManager.addCommands(s)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=r(this,u)}setParent(s){s!==null&&(this.pageIndex=s.pageIndex,this.pageDimensions=s.pageDimensions),this.parent=s}focusin(s){this._focusEventsAllowed&&(r(this,f)?at(this,f,!1):this.parent.setSelected(this))}focusout(s){var A;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const p=s.relatedTarget;p!=null&&p.closest(`#${this.id}`)||(s.preventDefault(),(A=this.parent)!=null&&A.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(s,p,A,I){const[P,H]=this.parentDimensions;[A,I]=this.screenToPageTranslation(A,I),this.x=(s+A)/P,this.y=(p+I)/H,this.fixAndSetPosition()}translate(s,p){j(this,m,We).call(this,this.parentDimensions,s,p)}translateInPage(s,p){j(this,m,We).call(this,this.pageDimensions,s,p),this.div.scrollIntoView({block:"nearest"})}drag(s,p){const[A,I]=this.parentDimensions;if(this.x+=s/A,this.y+=p/I,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ct,y:ut}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ct,ut)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:P,y:H}=this;const[tt,q]=j(this,w,He).call(this);P+=tt,H+=q,this.div.style.left=`${(100*P).toFixed(2)}%`,this.div.style.top=`${(100*H).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[s,p]=this.pageDimensions;let{x:A,y:I,width:P,height:H}=this;switch(P*=s,H*=p,A*=s,I*=p,this.rotation){case 0:A=Math.max(0,Math.min(s-P,A)),I=Math.max(0,Math.min(p-H,I));break;case 90:A=Math.max(0,Math.min(s-H,A)),I=Math.min(p,Math.max(P,I));break;case 180:A=Math.min(s,Math.max(P,A)),I=Math.min(p,Math.max(H,I));break;case 270:A=Math.min(s,Math.max(H,A)),I=Math.max(0,Math.min(p-P,I));break}this.x=A/=s,this.y=I/=p;const[tt,q]=j(this,w,He).call(this);A+=tt,I+=q;const{style:ct}=this.div;ct.left=`${(100*A).toFixed(2)}%`,ct.top=`${(100*I).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(s,p){var A;return j(A=h,N,ze).call(A,s,p,this.parentRotation)}pageTranslationToScreen(s,p){var A;return j(A=h,N,ze).call(A,s,p,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:s,pageDimensions:[p,A]}=this,I=p*s,P=A*s;return n.FeatureTest.isCSSRoundSupported?[Math.round(I),Math.round(P)]:[I,P]}setDims(s,p){var P;const[A,I]=this.parentDimensions;this.div.style.width=`${(100*s/A).toFixed(2)}%`,r(this,T)||(this.div.style.height=`${(100*p/I).toFixed(2)}%`),(P=r(this,v))==null||P.classList.toggle("small",s<h.SMALL_EDITOR_SIZE||p<h.SMALL_EDITOR_SIZE)}fixDims(){const{style:s}=this.div,{height:p,width:A}=s,I=A.endsWith("%"),P=!r(this,T)&&p.endsWith("%");if(I&&P)return;const[H,tt]=this.parentDimensions;I||(s.width=`${(100*parseFloat(A)/H).toFixed(2)}%`),!r(this,T)&&!P&&(s.height=`${(100*parseFloat(p)/tt).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(r(this,v))return;const s=at(this,v,document.createElement("button"));s.className="altText";const p=await h._l10nPromise.get("editor_alt_text_button_label");s.textContent=p,s.setAttribute("aria-label",p),s.tabIndex="0",s.addEventListener("contextmenu",c.noContextMenu),s.addEventListener("pointerdown",A=>A.stopPropagation()),s.addEventListener("click",A=>{A.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),s.addEventListener("keydown",A=>{A.target===s&&A.key==="Enter"&&(A.preventDefault(),this._uiManager.editAltText(this))}),j(this,gt,$e).call(this),this.div.append(s),h.SMALL_EDITOR_SIZE||(h.SMALL_EDITOR_SIZE=Math.min(128,Math.round(s.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:r(this,C),decorative:r(this,S)}}set altTextData(s){let{altText:p,decorative:A}=s;r(this,C)===p&&r(this,S)===A||(at(this,C,p),at(this,S,A),j(this,gt,$e).call(this))}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",r(this,a)),this.div.addEventListener("focusout",r(this,i));const[s,p]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*p/s).toFixed(2)}%`,this.div.style.maxHeight=`${(100*s/p).toFixed(2)}%`);const[A,I]=this.getInitialTranslation();return this.translate(A,I),(0,e.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(s){const{isMac:p}=n.FeatureTest.platform;if(s.button!==0||s.ctrlKey&&p){s.preventDefault();return}at(this,f,!0),j(this,wt,Tn).call(this,s)}moveInDOM(){var s;(s=this.parent)==null||s.moveEditorInDOM(this)}_setParentAndPosition(s,p,A){s.changeParent(this),this.x=p,this.y=A,this.fixAndSetPosition()}getRect(s,p){const A=this.parentScale,[I,P]=this.pageDimensions,[H,tt]=this.pageTranslation,q=s/A,ct=p/A,ut=this.x*I,Et=this.y*P,mt=this.width*I,Ot=this.height*P;switch(this.rotation){case 0:return[ut+q+H,P-Et-ct-Ot+tt,ut+q+mt+H,P-Et-ct+tt];case 90:return[ut+ct+H,P-Et+q+tt,ut+ct+Ot+H,P-Et+q+mt+tt];case 180:return[ut-q-mt+H,P-Et+ct+tt,ut-q+H,P-Et+ct+Ot+tt];case 270:return[ut-ct-Ot+H,P-Et-q-mt+tt,ut-ct+H,P-Et-q+tt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(s,p){const[A,I,P,H]=s,tt=P-A,q=H-I;switch(this.rotation){case 0:return[A,p-H,tt,q];case 90:return[A,p-I,q,tt];case 180:return[P,p-I,tt,q];case 270:return[P,p-H,q,tt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){at(this,O,!0)}disableEditMode(){at(this,O,!1)}isInEditMode(){return r(this,O)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var s,p;(s=this.div)==null||s.addEventListener("focusin",r(this,a)),(p=this.div)==null||p.addEventListener("focusout",r(this,i))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(s,p,A){const I=new this.prototype.constructor({parent:p,id:p.getNextId(),uiManager:A});I.rotation=s.rotation;const[P,H]=I.pageDimensions,[tt,q,ct,ut]=I.getRectInCurrentCoords(s.rect,H);return I.x=tt/P,I.y=q/H,I.width=ct/P,I.height=ut/H,I}remove(){var s;this.div.removeEventListener("focusin",r(this,a)),this.div.removeEventListener("focusout",r(this,i)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(s=r(this,v))==null||s.remove(),at(this,v,null),at(this,M,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(j(this,U,Sn).call(this),r(this,d).classList.remove("hidden"))}select(){var s;this.makeResizable(),(s=this.div)==null||s.classList.add("selectedEditor")}unselect(){var s,p,A;(s=r(this,d))==null||s.classList.add("hidden"),(p=this.div)==null||p.classList.remove("selectedEditor"),(A=this.div)!=null&&A.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(s,p){}disableEditing(){r(this,v)&&(r(this,v).hidden=!0)}enableEditing(){r(this,v)&&(r(this,v).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return r(this,E)}set isEditing(s){at(this,E,s),this.parent&&(s?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(s,p){at(this,T,!0);const A=s/p,{style:I}=this.div;I.aspectRatio=A,I.height="auto"}static get MIN_SIZE(){return 16}};C=new WeakMap,S=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakMap,E=new WeakMap,O=new WeakMap,R=new WeakMap,u=new WeakMap,m=new WeakSet,We=function(s,p,A){let[I,P]=s;[p,A]=this.screenToPageTranslation(p,A),this.x+=p/I,this.y+=A/P,this.fixAndSetPosition()},w=new WeakSet,He=function(){const[s,p]=this.parentDimensions,{_borderLineWidth:A}=h,I=A/s,P=A/p;switch(this.rotation){case 90:return[-I,P];case 180:return[I,P];case 270:return[I,-P];default:return[-I,-P]}},N=new WeakSet,ze=function(s,p,A){switch(A){case 90:return[p,-s];case 180:return[-s,-p];case 270:return[-p,s];default:return[s,p]}},V=new WeakSet,Ge=function(s){switch(s){case 90:{const[p,A]=this.pageDimensions;return[0,-p/A,A/p,0]}case 180:return[-1,0,0,-1];case 270:{const[p,A]=this.pageDimensions;return[0,p/A,-A/p,0]}default:return[1,0,0,1]}},U=new WeakSet,Sn=function(){if(r(this,d))return;at(this,d,document.createElement("div")),r(this,d).classList.add("resizers");const s=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||s.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const p of s){const A=document.createElement("div");r(this,d).append(A),A.classList.add("resizer",p),A.addEventListener("pointerdown",j(this,nt,En).bind(this,p)),A.addEventListener("contextmenu",c.noContextMenu)}this.div.prepend(r(this,d))},nt=new WeakSet,En=function(s,p){p.preventDefault();const{isMac:A}=n.FeatureTest.platform;if(p.button!==0||p.ctrlKey&&A)return;const I=j(this,Y,xn).bind(this,s),P=this._isDraggable;this._isDraggable=!1;const H={passive:!0,capture:!0};window.addEventListener("pointermove",I,H);const tt=this.x,q=this.y,ct=this.width,ut=this.height,Et=this.parent.div.style.cursor,mt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(p.target).cursor;const Ot=()=>{this._isDraggable=P,window.removeEventListener("pointerup",Ot),window.removeEventListener("blur",Ot),window.removeEventListener("pointermove",I,H),this.parent.div.style.cursor=Et,this.div.style.cursor=mt;const Wt=this.x,kt=this.y,Nt=this.width,bt=this.height;Wt===tt&&kt===q&&Nt===ct&&bt===ut||this.addCommands({cmd:()=>{this.width=Nt,this.height=bt,this.x=Wt,this.y=kt;const[ht,it]=this.parentDimensions;this.setDims(ht*Nt,it*bt),this.fixAndSetPosition()},undo:()=>{this.width=ct,this.height=ut,this.x=tt,this.y=q;const[ht,it]=this.parentDimensions;this.setDims(ht*ct,it*ut),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Ot),window.addEventListener("blur",Ot)},Y=new WeakSet,xn=function(s,p){const[A,I]=this.parentDimensions,P=this.x,H=this.y,tt=this.width,q=this.height,ct=h.MIN_SIZE/A,ut=h.MIN_SIZE/I,Et=J=>Math.round(J*1e4)/1e4,mt=j(this,V,Ge).call(this,this.rotation),Ot=(J,dt)=>[mt[0]*J+mt[2]*dt,mt[1]*J+mt[3]*dt],Wt=j(this,V,Ge).call(this,360-this.rotation),kt=(J,dt)=>[Wt[0]*J+Wt[2]*dt,Wt[1]*J+Wt[3]*dt];let Nt,bt,ht=!1,it=!1;switch(s){case"topLeft":ht=!0,Nt=(J,dt)=>[0,0],bt=(J,dt)=>[J,dt];break;case"topMiddle":Nt=(J,dt)=>[J/2,0],bt=(J,dt)=>[J/2,dt];break;case"topRight":ht=!0,Nt=(J,dt)=>[J,0],bt=(J,dt)=>[0,dt];break;case"middleRight":it=!0,Nt=(J,dt)=>[J,dt/2],bt=(J,dt)=>[0,dt/2];break;case"bottomRight":ht=!0,Nt=(J,dt)=>[J,dt],bt=(J,dt)=>[0,0];break;case"bottomMiddle":Nt=(J,dt)=>[J/2,dt],bt=(J,dt)=>[J/2,0];break;case"bottomLeft":ht=!0,Nt=(J,dt)=>[0,dt],bt=(J,dt)=>[J,0];break;case"middleLeft":it=!0,Nt=(J,dt)=>[0,dt/2],bt=(J,dt)=>[J,dt/2];break}const ft=Nt(tt,q),Rt=bt(tt,q);let Ft=Ot(...Rt);const zt=Et(P+Ft[0]),Vt=Et(H+Ft[1]);let $t=1,Gt=1,[Kt,Yt]=this.screenToPageTranslation(p.movementX,p.movementY);if([Kt,Yt]=kt(Kt/A,Yt/I),ht){const J=Math.hypot(tt,q);$t=Gt=Math.max(Math.min(Math.hypot(Rt[0]-ft[0]-Kt,Rt[1]-ft[1]-Yt)/J,1/tt,1/q),ct/tt,ut/q)}else it?$t=Math.max(ct,Math.min(1,Math.abs(Rt[0]-ft[0]-Kt)))/tt:Gt=Math.max(ut,Math.min(1,Math.abs(Rt[1]-ft[1]-Yt)))/q;const Zt=Et(tt*$t),_t=Et(q*Gt);Ft=Ot(...bt(Zt,_t));const yt=zt-Ft[0],Z=Vt-Ft[1];this.width=Zt,this.height=_t,this.x=yt,this.y=Z,this.setDims(A*Zt,I*_t),this.fixAndSetPosition()},gt=new WeakSet,$e=async function(){var A;const s=r(this,v);if(!s)return;if(!r(this,C)&&!r(this,S)){s.classList.remove("done"),(A=r(this,M))==null||A.remove();return}h._l10nPromise.get("editor_alt_text_edit_button_label").then(I=>{s.setAttribute("aria-label",I)});let p=r(this,M);if(!p){at(this,M,p=document.createElement("span")),p.className="tooltip",p.setAttribute("role","tooltip");const I=p.id=`alt-text-tooltip-${this.id}`;s.setAttribute("aria-describedby",I);const P=100;s.addEventListener("mouseenter",()=>{at(this,x,setTimeout(()=>{at(this,x,null),r(this,M).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},P))}),s.addEventListener("mouseleave",()=>{var H;clearTimeout(r(this,x)),at(this,x,null),(H=r(this,M))==null||H.classList.remove("show")})}s.classList.add("done"),p.innerText=r(this,S)?await h._l10nPromise.get("editor_alt_text_decorative_tooltip"):r(this,C),p.parentNode||s.append(p)},wt=new WeakSet,Tn=function(s){if(!this._isDraggable)return;const p=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let A,I;p&&(A={passive:!0,capture:!0},I=H=>{const[tt,q]=this.screenToPageTranslation(H.movementX,H.movementY);this._uiManager.dragSelectedEditors(tt,q)},window.addEventListener("pointermove",I,A));const P=()=>{if(window.removeEventListener("pointerup",P),window.removeEventListener("blur",P),p&&window.removeEventListener("pointermove",I,A),at(this,f,!1),!this._uiManager.endDragSession()){const{isMac:H}=n.FeatureTest.platform;s.ctrlKey&&!H||s.shiftKey||s.metaKey&&H?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",P),window.addEventListener("blur",P)},X(h,N),ee(h,"_borderLineWidth",-1),ee(h,"_colorManager",new e.ColorManager),ee(h,"_zIndex",1),ee(h,"SMALL_EDITOR_SIZE",0);let b=h;l.AnnotationEditor=b;class F extends b{constructor(s){super(s),this.annotationElementId=s.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(k,l,t)=>{var T,d,a,i,f,Ve,R,u,m,L,w,Cn,D,V,K,U,_,nt,rt,Y,st,gt,At,wt,W,h,g,s,p,A,I,P,H,tt,q,ct,ut,Et,mt,Ot,Wt,kt,Nt,bt,ht,it,ft,Pn,Ft,Xe,Vt,Ye,Gt,Ce,Yt,_e,_t,Ke,Z,ie,dt,me,ot,kn,pt,Rn,St,Je,vt,ve,Tt,Qe;Object.defineProperty(l,"__esModule",{value:!0}),l.KeyboardManager=l.CommandManager=l.ColorManager=l.AnnotationEditorUIManager=void 0,l.bindEvents=c,l.opacityToHex=b,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2),t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147),t(166);var e=t(1),n=t(168);function c(z,o,B){for(const $ of B)o.addEventListener($,z[$].bind(z))}function b(z){return Math.round(Math.min(255,Math.max(1,255*z))).toString(16).padStart(2,"0")}class F{constructor(){X(this,T,0)}getId(){return`${e.AnnotationEditorPrefix}${ge(this,T)._++}`}}T=new WeakMap;const O=class O{constructor(){X(this,f);X(this,d,(0,e.getUuid)());X(this,a,0);X(this,i,null)}static get _isSVGFittingCanvas(){const o='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>',$=new OffscreenCanvas(1,3).getContext("2d"),Q=new Image;Q.src=o;const et=Q.decode().then(()=>($.drawImage(Q,0,0,1,1,0,0,1,3),new Uint32Array($.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,e.shadow)(this,"_isSVGFittingCanvas",et)}async getFromFile(o){const{lastModified:B,name:$,size:Q,type:et}=o;return j(this,f,Ve).call(this,`${B}_${$}_${Q}_${et}`,o)}async getFromUrl(o){return j(this,f,Ve).call(this,o,o)}async getFromId(o){r(this,i)||at(this,i,new Map);const B=r(this,i).get(o);return B?B.bitmap?(B.refCounter+=1,B):B.file?this.getFromFile(B.file):this.getFromUrl(B.url):null}getSvgUrl(o){const B=r(this,i).get(o);return B!=null&&B.isSvg?B.svgUrl:null}deleteId(o){r(this,i)||at(this,i,new Map);const B=r(this,i).get(o);B&&(B.refCounter-=1,B.refCounter===0&&(B.bitmap=null))}isValidId(o){return o.startsWith(`image_${r(this,d)}_`)}};d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakSet,Ve=async function(o,B){r(this,i)||at(this,i,new Map);let $=r(this,i).get(o);if($===null)return null;if($!=null&&$.bitmap)return $.refCounter+=1,$;try{$||($={bitmap:null,id:`image_${r(this,d)}_${ge(this,a)._++}`,refCounter:0,isSvg:!1});let Q;if(typeof B=="string"){$.url=B;const et=await fetch(B);if(!et.ok)throw new Error(et.statusText);Q=await et.blob()}else Q=$.file=B;if(Q.type==="image/svg+xml"){const et=O._isSVGFittingCanvas,lt=new FileReader,Ct=new Image,It=new Promise((Mt,Jt)=>{Ct.onload=()=>{$.bitmap=Ct,$.isSvg=!0,Mt()},lt.onload=async()=>{const Ut=$.svgUrl=lt.result;Ct.src=await et?`${Ut}#svgView(preserveAspectRatio(none))`:Ut},Ct.onerror=lt.onerror=Jt});lt.readAsDataURL(Q),await It}else $.bitmap=await createImageBitmap(Q);$.refCounter=1}catch(Q){console.error(Q),$=null}return r(this,i).set(o,$),$&&r(this,i).set($.id,$),$};let C=O;class S{constructor(){X(this,R,[]);X(this,u,!1);X(this,m,void 0);X(this,L,-1);let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;at(this,m,o)}add(o){let{cmd:B,undo:$,mustExec:Q,type:et=NaN,overwriteIfSameType:lt=!1,keepUndo:Ct=!1}=o;if(Q&&B(),r(this,u))return;const It={cmd:B,undo:$,type:et};if(r(this,L)===-1){r(this,R).length>0&&(r(this,R).length=0),at(this,L,0),r(this,R).push(It);return}if(lt&&r(this,R)[r(this,L)].type===et){Ct&&(It.undo=r(this,R)[r(this,L)].undo),r(this,R)[r(this,L)]=It;return}const Mt=r(this,L)+1;Mt===r(this,m)?r(this,R).splice(0,1):(at(this,L,Mt),Mt<r(this,R).length&&r(this,R).splice(Mt)),r(this,R).push(It)}undo(){r(this,L)!==-1&&(at(this,u,!0),r(this,R)[r(this,L)].undo(),at(this,u,!1),at(this,L,r(this,L)-1))}redo(){r(this,L)<r(this,R).length-1&&(at(this,L,r(this,L)+1),at(this,u,!0),r(this,R)[r(this,L)].cmd(),at(this,u,!1))}hasSomethingToUndo(){return r(this,L)!==-1}hasSomethingToRedo(){return r(this,L)<r(this,R).length-1}destroy(){at(this,R,null)}}R=new WeakMap,u=new WeakMap,m=new WeakMap,L=new WeakMap,l.CommandManager=S;class v{constructor(o){X(this,w);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:B}=e.FeatureTest.platform;for(const[$,Q,et={}]of o)for(const lt of $){const Ct=lt.startsWith("mac+");B&&Ct?(this.callbacks.set(lt.slice(4),{callback:Q,options:et}),this.allKeys.add(lt.split("+").at(-1))):!B&&!Ct&&(this.callbacks.set(lt,{callback:Q,options:et}),this.allKeys.add(lt.split("+").at(-1)))}}exec(o,B){if(!this.allKeys.has(B.key))return;const $=this.callbacks.get(j(this,w,Cn).call(this,B));if(!$)return;const{callback:Q,options:{bubbles:et=!1,args:lt=[],checker:Ct=null}}=$;Ct&&!Ct(o,B)||(Q.bind(o,...lt)(),et||(B.stopPropagation(),B.preventDefault()))}}w=new WeakSet,Cn=function(o){o.altKey&&this.buffer.push("alt"),o.ctrlKey&&this.buffer.push("ctrl"),o.metaKey&&this.buffer.push("meta"),o.shiftKey&&this.buffer.push("shift"),this.buffer.push(o.key);const B=this.buffer.join("+");return this.buffer.length=0,B},l.KeyboardManager=v;const N=class N{get _colors(){const o=new Map([["CanvasText",null],["Canvas",null]]);return(0,n.getColorValues)(o),(0,e.shadow)(this,"_colors",o)}convert(o){const B=(0,n.getRGB)(o);if(!window.matchMedia("(forced-colors: active)").matches)return B;for(const[$,Q]of this._colors)if(Q.every((et,lt)=>et===B[lt]))return N._colorsMapping.get($);return B}getHexCode(o){const B=this._colors.get(o);return B?e.Util.makeHexColor(...B):o}};ee(N,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let M=N;l.ColorManager=M;const Dt=class Dt{constructor(o,B,$,Q,et,lt){X(this,ft);X(this,Ft);X(this,Vt);X(this,Gt);X(this,Yt);X(this,_t);X(this,Z);X(this,dt);X(this,ot);X(this,pt);X(this,St);X(this,vt);X(this,Tt);X(this,D,null);X(this,V,new Map);X(this,K,new Map);X(this,U,null);X(this,_,null);X(this,nt,new S);X(this,rt,0);X(this,Y,new Set);X(this,st,null);X(this,gt,null);X(this,At,new Set);X(this,wt,null);X(this,W,new F);X(this,h,!1);X(this,g,!1);X(this,s,null);X(this,p,e.AnnotationEditorType.NONE);X(this,A,new Set);X(this,I,null);X(this,P,this.blur.bind(this));X(this,H,this.focus.bind(this));X(this,tt,this.copy.bind(this));X(this,q,this.cut.bind(this));X(this,ct,this.paste.bind(this));X(this,ut,this.keydown.bind(this));X(this,Et,this.onEditingAction.bind(this));X(this,mt,this.onPageChanging.bind(this));X(this,Ot,this.onScaleChanging.bind(this));X(this,Wt,this.onRotationChanging.bind(this));X(this,kt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});X(this,Nt,[0,0]);X(this,bt,null);X(this,ht,null);X(this,it,null);at(this,ht,o),at(this,it,B),at(this,U,$),this._eventBus=Q,this._eventBus._on("editingaction",r(this,Et)),this._eventBus._on("pagechanging",r(this,mt)),this._eventBus._on("scalechanging",r(this,Ot)),this._eventBus._on("rotationchanging",r(this,Wt)),at(this,_,et.annotationStorage),at(this,wt,et.filterFactory),at(this,I,lt),this.viewParameters={realScale:n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const o=Dt.prototype,B=et=>{const{activeElement:lt}=document;return lt&&r(et,ht).contains(lt)&&et.hasSomethingToControl()},$=this.TRANSLATE_SMALL,Q=this.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new v([[["ctrl+a","mac+meta+a"],o.selectAll],[["ctrl+z","mac+meta+z"],o.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],o.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],o.delete],[["Escape","mac+Escape"],o.unselectAll],[["ArrowLeft","mac+ArrowLeft"],o.translateSelectedEditors,{args:[-$,0],checker:B}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],o.translateSelectedEditors,{args:[-Q,0],checker:B}],[["ArrowRight","mac+ArrowRight"],o.translateSelectedEditors,{args:[$,0],checker:B}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],o.translateSelectedEditors,{args:[Q,0],checker:B}],[["ArrowUp","mac+ArrowUp"],o.translateSelectedEditors,{args:[0,-$],checker:B}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],o.translateSelectedEditors,{args:[0,-Q],checker:B}],[["ArrowDown","mac+ArrowDown"],o.translateSelectedEditors,{args:[0,$],checker:B}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],o.translateSelectedEditors,{args:[0,Q],checker:B}]]))}destroy(){j(this,Gt,Ce).call(this),j(this,Ft,Xe).call(this),this._eventBus._off("editingaction",r(this,Et)),this._eventBus._off("pagechanging",r(this,mt)),this._eventBus._off("scalechanging",r(this,Ot)),this._eventBus._off("rotationchanging",r(this,Wt));for(const o of r(this,K).values())o.destroy();r(this,K).clear(),r(this,V).clear(),r(this,At).clear(),at(this,D,null),r(this,A).clear(),r(this,nt).destroy(),r(this,U).destroy()}get hcmFilter(){return(0,e.shadow)(this,"hcmFilter",r(this,I)?r(this,wt).addHCMFilter(r(this,I).foreground,r(this,I).background):"none")}get direction(){return(0,e.shadow)(this,"direction",getComputedStyle(r(this,ht)).direction)}editAltText(o){var B;(B=r(this,U))==null||B.editAltText(this,o)}onPageChanging(o){let{pageNumber:B}=o;at(this,rt,B-1)}focusMainContainer(){r(this,ht).focus()}findParent(o,B){for(const $ of r(this,K).values()){const{x:Q,y:et,width:lt,height:Ct}=$.div.getBoundingClientRect();if(o>=Q&&o<=Q+lt&&B>=et&&B<=et+Ct)return $}return null}disableUserSelect(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r(this,it).classList.toggle("noUserSelect",o)}addShouldRescale(o){r(this,At).add(o)}removeShouldRescale(o){r(this,At).delete(o)}onScaleChanging(o){let{scale:B}=o;this.commitOrRemove(),this.viewParameters.realScale=B*n.PixelsPerInch.PDF_TO_CSS_UNITS;for(const $ of r(this,At))$.onScaleChanging()}onRotationChanging(o){let{pagesRotation:B}=o;this.commitOrRemove(),this.viewParameters.rotation=B}addToAnnotationStorage(o){!o.isEmpty()&&r(this,_)&&!r(this,_).has(o.id)&&r(this,_).setValue(o.id,o)}blur(){if(!this.hasSelection)return;const{activeElement:o}=document;for(const B of r(this,A))if(B.div.contains(o)){at(this,s,[B,o]),B._focusEventsAllowed=!1;break}}focus(){if(!r(this,s))return;const[o,B]=r(this,s);at(this,s,null),B.addEventListener("focusin",()=>{o._focusEventsAllowed=!0},{once:!0}),B.focus()}addEditListeners(){j(this,Vt,Ye).call(this),j(this,Yt,_e).call(this)}removeEditListeners(){j(this,Gt,Ce).call(this),j(this,_t,Ke).call(this)}copy(o){var $;if(o.preventDefault(),($=r(this,D))==null||$.commitOrRemove(),!this.hasSelection)return;const B=[];for(const Q of r(this,A)){const et=Q.serialize(!0);et&&B.push(et)}B.length!==0&&o.clipboardData.setData("application/pdfjs",JSON.stringify(B))}cut(o){this.copy(o),this.delete()}paste(o){o.preventDefault();const{clipboardData:B}=o;for(const et of B.items)for(const lt of r(this,gt))if(lt.isHandlingMimeForPasting(et.type)){lt.paste(et,this.currentLayer);return}let $=B.getData("application/pdfjs");if(!$)return;try{$=JSON.parse($)}catch(et){(0,e.warn)(`paste: "${et.message}".`);return}if(!Array.isArray($))return;this.unselectAll();const Q=this.currentLayer;try{const et=[];for(const It of $){const Mt=Q.deserialize(It);if(!Mt)return;et.push(Mt)}const lt=()=>{for(const It of et)j(this,St,Je).call(this,It);j(this,Tt,Qe).call(this,et)},Ct=()=>{for(const It of et)It.remove()};this.addCommands({cmd:lt,undo:Ct,mustExec:!0})}catch(et){(0,e.warn)(`paste: "${et.message}".`)}}keydown(o){var B;(B=this.getActive())!=null&&B.shouldGetKeyboardEvents()||Dt._keyboardManager.exec(this,o)}onEditingAction(o){["undo","redo","delete","selectAll"].includes(o.name)&&this[o.name]()}setEditingState(o){o?(j(this,ft,Pn).call(this),j(this,Vt,Ye).call(this),j(this,Yt,_e).call(this),j(this,Z,ie).call(this,{isEditing:r(this,p)!==e.AnnotationEditorType.NONE,isEmpty:j(this,vt,ve).call(this),hasSomethingToUndo:r(this,nt).hasSomethingToUndo(),hasSomethingToRedo:r(this,nt).hasSomethingToRedo(),hasSelectedEditor:!1})):(j(this,Ft,Xe).call(this),j(this,Gt,Ce).call(this),j(this,_t,Ke).call(this),j(this,Z,ie).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(o){if(!r(this,gt)){at(this,gt,o);for(const B of r(this,gt))j(this,dt,me).call(this,B.defaultPropertiesToUpdate)}}getId(){return r(this,W).getId()}get currentLayer(){return r(this,K).get(r(this,rt))}getLayer(o){return r(this,K).get(o)}get currentPageIndex(){return r(this,rt)}addLayer(o){r(this,K).set(o.pageIndex,o),r(this,h)?o.enable():o.disable()}removeLayer(o){r(this,K).delete(o.pageIndex)}updateMode(o){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(r(this,p)!==o){if(at(this,p,o),o===e.AnnotationEditorType.NONE){this.setEditingState(!1),j(this,pt,Rn).call(this);return}this.setEditingState(!0),j(this,ot,kn).call(this),this.unselectAll();for(const $ of r(this,K).values())$.updateMode(o);if(B){for(const $ of r(this,V).values())if($.annotationElementId===B){this.setSelected($),$.enterInEditMode();break}}}}updateToolbar(o){o!==r(this,p)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:o})}updateParams(o,B){if(r(this,gt)){if(o===e.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(o);return}for(const $ of r(this,A))$.updateParams(o,B);for(const $ of r(this,gt))$.updateDefaultParams(o,B)}}enableWaiting(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(r(this,g)!==o){at(this,g,o);for(const B of r(this,K).values())o?B.disableClick():B.enableClick(),B.div.classList.toggle("waiting",o)}}getEditors(o){const B=[];for(const $ of r(this,V).values())$.pageIndex===o&&B.push($);return B}getEditor(o){return r(this,V).get(o)}addEditor(o){r(this,V).set(o.id,o)}removeEditor(o){var B;r(this,V).delete(o.id),this.unselect(o),(!o.annotationElementId||!r(this,Y).has(o.annotationElementId))&&((B=r(this,_))==null||B.remove(o.id))}addDeletedAnnotationElement(o){r(this,Y).add(o.annotationElementId),o.deleted=!0}isDeletedAnnotationElement(o){return r(this,Y).has(o)}removeDeletedAnnotationElement(o){r(this,Y).delete(o.annotationElementId),o.deleted=!1}setActiveEditor(o){r(this,D)!==o&&(at(this,D,o),o&&j(this,dt,me).call(this,o.propertiesToUpdate))}toggleSelected(o){if(r(this,A).has(o)){r(this,A).delete(o),o.unselect(),j(this,Z,ie).call(this,{hasSelectedEditor:this.hasSelection});return}r(this,A).add(o),o.select(),j(this,dt,me).call(this,o.propertiesToUpdate),j(this,Z,ie).call(this,{hasSelectedEditor:!0})}setSelected(o){for(const B of r(this,A))B!==o&&B.unselect();r(this,A).clear(),r(this,A).add(o),o.select(),j(this,dt,me).call(this,o.propertiesToUpdate),j(this,Z,ie).call(this,{hasSelectedEditor:!0})}isSelected(o){return r(this,A).has(o)}unselect(o){o.unselect(),r(this,A).delete(o),j(this,Z,ie).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return r(this,A).size!==0}undo(){r(this,nt).undo(),j(this,Z,ie).call(this,{hasSomethingToUndo:r(this,nt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:j(this,vt,ve).call(this)})}redo(){r(this,nt).redo(),j(this,Z,ie).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:r(this,nt).hasSomethingToRedo(),isEmpty:j(this,vt,ve).call(this)})}addCommands(o){r(this,nt).add(o),j(this,Z,ie).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:j(this,vt,ve).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const o=[...r(this,A)],B=()=>{for(const Q of o)Q.remove()},$=()=>{for(const Q of o)j(this,St,Je).call(this,Q)};this.addCommands({cmd:B,undo:$,mustExec:!0})}commitOrRemove(){var o;(o=r(this,D))==null||o.commitOrRemove()}hasSomethingToControl(){return r(this,D)||this.hasSelection}selectAll(){for(const o of r(this,A))o.commit();j(this,Tt,Qe).call(this,r(this,V).values())}unselectAll(){if(r(this,D)){r(this,D).commitOrRemove();return}if(this.hasSelection){for(const o of r(this,A))o.unselect();r(this,A).clear(),j(this,Z,ie).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(o,B){if((arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1)||this.commitOrRemove(),!this.hasSelection)return;r(this,Nt)[0]+=o,r(this,Nt)[1]+=B;const[Q,et]=r(this,Nt),lt=[...r(this,A)],Ct=1e3;r(this,bt)&&clearTimeout(r(this,bt)),at(this,bt,setTimeout(()=>{at(this,bt,null),r(this,Nt)[0]=r(this,Nt)[1]=0,this.addCommands({cmd:()=>{for(const It of lt)r(this,V).has(It.id)&&It.translateInPage(Q,et)},undo:()=>{for(const It of lt)r(this,V).has(It.id)&&It.translateInPage(-Q,-et)},mustExec:!1})},Ct));for(const It of lt)It.translateInPage(o,B)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),at(this,st,new Map);for(const o of r(this,A))r(this,st).set(o,{savedX:o.x,savedY:o.y,savedPageIndex:o.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!r(this,st))return!1;this.disableUserSelect(!1);const o=r(this,st);at(this,st,null);let B=!1;for(const[{x:Q,y:et,pageIndex:lt},Ct]of o)Ct.newX=Q,Ct.newY=et,Ct.newPageIndex=lt,B||(B=Q!==Ct.savedX||et!==Ct.savedY||lt!==Ct.savedPageIndex);if(!B)return!1;const $=(Q,et,lt,Ct)=>{if(r(this,V).has(Q.id)){const It=r(this,K).get(Ct);It?Q._setParentAndPosition(It,et,lt):(Q.pageIndex=Ct,Q.x=et,Q.y=lt)}};return this.addCommands({cmd:()=>{for(const[Q,{newX:et,newY:lt,newPageIndex:Ct}]of o)$(Q,et,lt,Ct)},undo:()=>{for(const[Q,{savedX:et,savedY:lt,savedPageIndex:Ct}]of o)$(Q,et,lt,Ct)},mustExec:!0}),!0}dragSelectedEditors(o,B){if(r(this,st))for(const $ of r(this,st).keys())$.drag(o,B)}rebuild(o){if(o.parent===null){const B=this.getLayer(o.pageIndex);B?(B.changeParent(o),B.addOrRebuild(o)):(this.addEditor(o),this.addToAnnotationStorage(o),o.rebuild())}else o.parent.addOrRebuild(o)}isActive(o){return r(this,D)===o}getActive(){return r(this,D)}getMode(){return r(this,p)}get imageManager(){return(0,e.shadow)(this,"imageManager",new C)}};D=new WeakMap,V=new WeakMap,K=new WeakMap,U=new WeakMap,_=new WeakMap,nt=new WeakMap,rt=new WeakMap,Y=new WeakMap,st=new WeakMap,gt=new WeakMap,At=new WeakMap,wt=new WeakMap,W=new WeakMap,h=new WeakMap,g=new WeakMap,s=new WeakMap,p=new WeakMap,A=new WeakMap,I=new WeakMap,P=new WeakMap,H=new WeakMap,tt=new WeakMap,q=new WeakMap,ct=new WeakMap,ut=new WeakMap,Et=new WeakMap,mt=new WeakMap,Ot=new WeakMap,Wt=new WeakMap,kt=new WeakMap,Nt=new WeakMap,bt=new WeakMap,ht=new WeakMap,it=new WeakMap,ft=new WeakSet,Pn=function(){window.addEventListener("focus",r(this,H)),window.addEventListener("blur",r(this,P))},Ft=new WeakSet,Xe=function(){window.removeEventListener("focus",r(this,H)),window.removeEventListener("blur",r(this,P))},Vt=new WeakSet,Ye=function(){window.addEventListener("keydown",r(this,ut),{capture:!0})},Gt=new WeakSet,Ce=function(){window.removeEventListener("keydown",r(this,ut),{capture:!0})},Yt=new WeakSet,_e=function(){document.addEventListener("copy",r(this,tt)),document.addEventListener("cut",r(this,q)),document.addEventListener("paste",r(this,ct))},_t=new WeakSet,Ke=function(){document.removeEventListener("copy",r(this,tt)),document.removeEventListener("cut",r(this,q)),document.removeEventListener("paste",r(this,ct))},Z=new WeakSet,ie=function(o){Object.entries(o).some($=>{let[Q,et]=$;return r(this,kt)[Q]!==et})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(r(this,kt),o)})},dt=new WeakSet,me=function(o){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:o})},ot=new WeakSet,kn=function(){if(!r(this,h)){at(this,h,!0);for(const o of r(this,K).values())o.enable()}},pt=new WeakSet,Rn=function(){if(this.unselectAll(),r(this,h)){at(this,h,!1);for(const o of r(this,K).values())o.disable()}},St=new WeakSet,Je=function(o){const B=r(this,K).get(o.pageIndex);B?B.addOrRebuild(o):this.addEditor(o)},vt=new WeakSet,ve=function(){if(r(this,V).size===0)return!0;if(r(this,V).size===1)for(const o of r(this,V).values())return o.isEmpty();return!1},Tt=new WeakSet,Qe=function(o){r(this,A).clear();for(const B of o)B.isEmpty()||(r(this,A).add(B),B.select());j(this,Z,ie).call(this,{hasSelectedEditor:!0})},ee(Dt,"TRANSLATE_SMALL",1),ee(Dt,"TRANSLATE_BIG",10);let x=Dt;l.AnnotationEditorUIManager=x},(k,l,t)=>{var e=t(3),n=t(6),c=t(4),b=t(24),F=t(14),C=t(8),S=t(21),v=t(20),M=t(91),x=t(39),T=t(77),d=t(64),a=t(159),i=t(7),f=t(167),E=t(27),O=c.JSON,R=c.Number,u=c.SyntaxError,m=O&&O.parse,L=b("Object","keys"),w=Object.getOwnPropertyDescriptor,y=F("".charAt),N=F("".slice),D=F(/./.exec),V=F([].push),K=/^\d$/,U=/^[1-9]$/,_=/^(?:-|\d)$/,nt=/^[\t\n\r ]$/,rt=0,Y=1,st=function(s,p){s=T(s);var A=new W(s,0),I=A.parse(),P=I.value,H=A.skip(nt,I.end);if(H<s.length)throw u('Unexpected extra character: "'+y(s,H)+'" after the parsed data at: '+H);return S(p)?gt({"":P},"",p,I):P},gt=function(s,p,A,I){var P=s[p],H=I&&P===I.value,tt=H&&typeof I.source=="string"?{source:I.source}:{},q,ct,ut,Et,mt;if(v(P)){var Ot=M(P),Wt=H?I.nodes:Ot?[]:{};if(Ot)for(q=Wt.length,ut=d(P),Et=0;Et<ut;Et++)At(P,Et,gt(P,""+Et,A,Et<q?Wt[Et]:void 0));else for(ct=L(P),ut=d(ct),Et=0;Et<ut;Et++)mt=ct[Et],At(P,mt,gt(P,mt,A,x(Wt,mt)?Wt[mt]:void 0))}return C(A,s,p,P,tt)},At=function(s,p,A){if(n){var I=w(s,p);if(I&&!I.configurable)return}A===void 0?delete s[p]:a(s,p,A)},wt=function(s,p,A,I){this.value=s,this.end=p,this.source=A,this.nodes=I},W=function(s,p){this.source=s,this.index=p};W.prototype={fork:function(s){return new W(this.source,s)},parse:function(){var s=this.source,p=this.skip(nt,this.index),A=this.fork(p),I=y(s,p);if(D(_,I))return A.number();switch(I){case"{":return A.object();case"[":return A.array();case'"':return A.string();case"t":return A.keyword(!0);case"f":return A.keyword(!1);case"n":return A.keyword(null)}throw u('Unexpected character: "'+I+'" at: '+p)},node:function(s,p,A,I,P){return new wt(p,I,s?null:N(this.source,A,I),P)},object:function(){for(var s=this.source,p=this.index+1,A=!1,I={},P={};p<s.length;){if(p=this.until(['"',"}"],p),y(s,p)==="}"&&!A){p++;break}var H=this.fork(p).string(),tt=H.value;p=H.end,p=this.until([":"],p)+1,p=this.skip(nt,p),H=this.fork(p).parse(),a(P,tt,H),a(I,tt,H.value),p=this.until([",","}"],H.end);var q=y(s,p);if(q===",")A=!0,p++;else if(q==="}"){p++;break}}return this.node(Y,I,this.index,p,P)},array:function(){for(var s=this.source,p=this.index+1,A=!1,I=[],P=[];p<s.length;){if(p=this.skip(nt,p),y(s,p)==="]"&&!A){p++;break}var H=this.fork(p).parse();if(V(P,H),V(I,H.value),p=this.until([",","]"],H.end),y(s,p)===",")A=!0,p++;else if(y(s,p)==="]"){p++;break}}return this.node(Y,I,this.index,p,P)},string:function(){var s=this.index,p=f(this.source,this.index+1);return this.node(rt,p.value,s,p.end)},number:function(){var s=this.source,p=this.index,A=p;if(y(s,A)==="-"&&A++,y(s,A)==="0")A++;else if(D(U,y(s,A)))A=this.skip(K,++A);else throw u("Failed to parse number at: "+A);if(y(s,A)==="."&&(A=this.skip(K,++A)),y(s,A)==="e"||y(s,A)==="E"){A++,(y(s,A)==="+"||y(s,A)==="-")&&A++;var I=A;if(A=this.skip(K,A),I===A)throw u("Failed to parse number's exponent value at: "+A)}return this.node(rt,R(N(s,p,A)),p,A)},keyword:function(s){var p=""+s,A=this.index,I=A+p.length;if(N(this.source,A,I)!==p)throw u("Failed to parse value at: "+A);return this.node(rt,s,A,I)},skip:function(s,p){for(var A=this.source;p<A.length&&D(s,y(A,p));p++);return p},until:function(s,p){p=this.skip(nt,p);for(var A=y(this.source,p),I=0;I<s.length;I++)if(s[I]===A)return p;throw u('Unexpected character: "'+A+'" at: '+p)}};var h=i(function(){var s="9007199254740993",p;return m(s,function(A,I,P){p=P.source}),p!==s}),g=E&&!i(function(){return 1/m("-0 ")!==-1/0});e({target:"JSON",stat:!0,forced:h},{parse:function(p,A){return g&&!S(A)?m(p):st(p,A)}})},(k,l,t)=>{var e=t(14),n=t(39),c=SyntaxError,b=parseInt,F=String.fromCharCode,C=e("".charAt),S=e("".slice),v=e(/./.exec),M={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":`
  2. `,"\\r":"\r","\\t":" "},x=/^[\da-f]{4}$/i,T=/^[\u0000-\u001F]$/;k.exports=function(d,a){for(var i=!0,f="";a<d.length;){var E=C(d,a);if(E==="\\"){var O=S(d,a,a+2);if(n(M,O))f+=M[O],a+=2;else if(O==="\\u"){a+=2;var R=S(d,a,a+4);if(!v(x,R))throw c("Bad Unicode escape at: "+a);f+=F(b(R,16)),a+=4}else throw c('Unknown escape sequence: "'+O+'"')}else if(E==='"'){i=!1,a++;break}else{if(v(T,E))throw c("Bad control character in string literal at: "+a);f+=E,a++}}if(i)throw c("Unterminated string at: "+a);return{value:f,end:a}}},(k,l,t)=>{var rt,Y,st,gt,At,wt,W,h,g,s,p,A,ue,P,de,tt,Ze,ct,Pe,Et,ke,Ot,be,kt,ye;Object.defineProperty(l,"__esModule",{value:!0}),l.StatTimer=l.RenderingCancelledException=l.PixelsPerInch=l.PageViewport=l.PDFDateString=l.DOMStandardFontDataFactory=l.DOMSVGFactory=l.DOMFilterFactory=l.DOMCanvasFactory=l.DOMCMapReaderFactory=void 0,l.deprecated=L,l.getColorValues=V,l.getCurrentTransform=K,l.getCurrentTransformInverse=U,l.getFilenameFromUrl=f,l.getPdfFilenameFromUrl=E,l.getRGB=D,l.getXfaPageViewport=N,l.isDataScheme=a,l.isPdfFile=i,l.isValidFetchUrl=R,l.loadScript=m,l.noContextMenu=u,l.setLayerDimensions=_,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89),t(84),t(86),t(87);var e=t(169),n=t(1);const c="http://www.w3.org/2000/svg",nt=class nt{};ee(nt,"CSS",96),ee(nt,"PDF",72),ee(nt,"PDF_TO_CSS_UNITS",nt.CSS/nt.PDF);let b=nt;l.PixelsPerInch=b;class F extends e.BaseFilterFactory{constructor(){let{docId:it,ownerDocument:ft=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super();X(this,A);X(this,P);X(this,tt);X(this,ct);X(this,Et);X(this,Ot);X(this,kt);X(this,rt,void 0);X(this,Y,void 0);X(this,st,void 0);X(this,gt,void 0);X(this,At,void 0);X(this,wt,void 0);X(this,W,void 0);X(this,h,void 0);X(this,g,void 0);X(this,s,void 0);X(this,p,0);at(this,st,it),at(this,gt,ft)}addFilter(it){if(!it)return"none";let ft=r(this,A,ue).get(it);if(ft)return ft;let Rt,Ft,zt,Vt;if(it.length===1){const Yt=it[0],Zt=new Array(256);for(let _t=0;_t<256;_t++)Zt[_t]=Yt[_t]/255;Vt=Rt=Ft=zt=Zt.join(",")}else{const[Yt,Zt,_t]=it,yt=new Array(256),Z=new Array(256),J=new Array(256);for(let dt=0;dt<256;dt++)yt[dt]=Yt[dt]/255,Z[dt]=Zt[dt]/255,J[dt]=_t[dt]/255;Rt=yt.join(","),Ft=Z.join(","),zt=J.join(","),Vt=`${Rt}${Ft}${zt}`}if(ft=r(this,A,ue).get(Vt),ft)return r(this,A,ue).set(it,ft),ft;const $t=`g_${r(this,st)}_transfer_map_${ge(this,p)._++}`,Gt=`url(#${$t})`;r(this,A,ue).set(it,Gt),r(this,A,ue).set(Vt,Gt);const Kt=j(this,ct,Pe).call(this,$t);return j(this,Ot,be).call(this,Rt,Ft,zt,Kt),Gt}addHCMFilter(it,ft){var Zt;const Rt=`${it}-${ft}`;if(r(this,wt)===Rt)return r(this,W);if(at(this,wt,Rt),at(this,W,"none"),(Zt=r(this,At))==null||Zt.remove(),!it||!ft)return r(this,W);const Ft=j(this,kt,ye).call(this,it);it=n.Util.makeHexColor(...Ft);const zt=j(this,kt,ye).call(this,ft);if(ft=n.Util.makeHexColor(...zt),r(this,P,de).style.color="",it==="#000000"&&ft==="#ffffff"||it===ft)return r(this,W);const Vt=new Array(256);for(let _t=0;_t<=255;_t++){const yt=_t/255;Vt[_t]=yt<=.03928?yt/12.92:((yt+.055)/1.055)**2.4}const $t=Vt.join(","),Gt=`g_${r(this,st)}_hcm_filter`,Kt=at(this,h,j(this,ct,Pe).call(this,Gt));j(this,Ot,be).call(this,$t,$t,$t,Kt),j(this,tt,Ze).call(this,Kt);const Yt=(_t,yt)=>{const Z=Ft[_t]/255,J=zt[_t]/255,dt=new Array(yt+1);for(let jt=0;jt<=yt;jt++)dt[jt]=Z+jt/yt*(J-Z);return dt.join(",")};return j(this,Ot,be).call(this,Yt(0,5),Yt(1,5),Yt(2,5),Kt),at(this,W,`url(#${Gt})`),r(this,W)}addHighlightHCMFilter(it,ft,Rt,Ft){var J;const zt=`${it}-${ft}-${Rt}-${Ft}`;if(r(this,g)===zt)return r(this,s);if(at(this,g,zt),at(this,s,"none"),(J=r(this,h))==null||J.remove(),!it||!ft)return r(this,s);const[Vt,$t]=[it,ft].map(j(this,kt,ye).bind(this));let Gt=Math.round(.2126*Vt[0]+.7152*Vt[1]+.0722*Vt[2]),Kt=Math.round(.2126*$t[0]+.7152*$t[1]+.0722*$t[2]),[Yt,Zt]=[Rt,Ft].map(j(this,kt,ye).bind(this));Kt<Gt&&([Gt,Kt,Yt,Zt]=[Kt,Gt,Zt,Yt]),r(this,P,de).style.color="";const _t=(dt,jt,ot)=>{const G=new Array(256),pt=(Kt-Gt)/ot,xt=dt/255,St=(jt-dt)/(255*ot);let Pt=0;for(let vt=0;vt<=ot;vt++){const Ht=Math.round(Gt+vt*pt),Tt=xt+vt*St;for(let Lt=Pt;Lt<=Ht;Lt++)G[Lt]=Tt;Pt=Ht+1}for(let vt=Pt;vt<256;vt++)G[vt]=G[Pt-1];return G.join(",")},yt=`g_${r(this,st)}_hcm_highlight_filter`,Z=at(this,h,j(this,ct,Pe).call(this,yt));return j(this,tt,Ze).call(this,Z),j(this,Ot,be).call(this,_t(Yt[0],Zt[0],5),_t(Yt[1],Zt[1],5),_t(Yt[2],Zt[2],5),Z),at(this,s,`url(#${yt})`),r(this,s)}destroy(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(r(this,W)||r(this,s))||(r(this,Y)&&(r(this,Y).parentNode.parentNode.remove(),at(this,Y,null)),r(this,rt)&&(r(this,rt).clear(),at(this,rt,null)),at(this,p,0))}}rt=new WeakMap,Y=new WeakMap,st=new WeakMap,gt=new WeakMap,At=new WeakMap,wt=new WeakMap,W=new WeakMap,h=new WeakMap,g=new WeakMap,s=new WeakMap,p=new WeakMap,A=new WeakSet,ue=function(){return r(this,rt)||at(this,rt,new Map)},P=new WeakSet,de=function(){if(!r(this,Y)){const it=r(this,gt).createElement("div"),{style:ft}=it;ft.visibility="hidden",ft.contain="strict",ft.width=ft.height=0,ft.position="absolute",ft.top=ft.left=0,ft.zIndex=-1;const Rt=r(this,gt).createElementNS(c,"svg");Rt.setAttribute("width",0),Rt.setAttribute("height",0),at(this,Y,r(this,gt).createElementNS(c,"defs")),it.append(Rt),Rt.append(r(this,Y)),r(this,gt).body.append(it)}return r(this,Y)},tt=new WeakSet,Ze=function(it){const ft=r(this,gt).createElementNS(c,"feColorMatrix");ft.setAttribute("type","matrix"),ft.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"),it.append(ft)},ct=new WeakSet,Pe=function(it){const ft=r(this,gt).createElementNS(c,"filter");return ft.setAttribute("color-interpolation-filters","sRGB"),ft.setAttribute("id",it),r(this,P,de).append(ft),ft},Et=new WeakSet,ke=function(it,ft,Rt){const Ft=r(this,gt).createElementNS(c,ft);Ft.setAttribute("type","discrete"),Ft.setAttribute("tableValues",Rt),it.append(Ft)},Ot=new WeakSet,be=function(it,ft,Rt,Ft){const zt=r(this,gt).createElementNS(c,"feComponentTransfer");Ft.append(zt),j(this,Et,ke).call(this,zt,"feFuncR",it),j(this,Et,ke).call(this,zt,"feFuncG",ft),j(this,Et,ke).call(this,zt,"feFuncB",Rt)},kt=new WeakSet,ye=function(it){return r(this,P,de).style.color=it,D(getComputedStyle(r(this,P,de)).getPropertyValue("color"))},l.DOMFilterFactory=F;class C extends e.BaseCanvasFactory{constructor(){let{ownerDocument:ht=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=ht}_createCanvas(ht,it){const ft=this._document.createElement("canvas");return ft.width=ht,ft.height=it,ft}}l.DOMCanvasFactory=C;async function S(bt){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R(bt,document.baseURI)){const it=await fetch(bt);if(!it.ok)throw new Error(it.statusText);return ht?new Uint8Array(await it.arrayBuffer()):(0,n.stringToBytes)(await it.text())}return new Promise((it,ft)=>{const Rt=new XMLHttpRequest;Rt.open("GET",bt,!0),ht&&(Rt.responseType="arraybuffer"),Rt.onreadystatechange=()=>{if(Rt.readyState===XMLHttpRequest.DONE){if(Rt.status===200||Rt.status===0){let Ft;if(ht&&Rt.response?Ft=new Uint8Array(Rt.response):!ht&&Rt.responseText&&(Ft=(0,n.stringToBytes)(Rt.responseText)),Ft){it(Ft);return}}ft(new Error(Rt.statusText))}},Rt.send(null)})}class v extends e.BaseCMapReaderFactory{_fetchData(ht,it){return S(ht,this.isCompressed).then(ft=>({cMapData:ft,compressionType:it}))}}l.DOMCMapReaderFactory=v;class M extends e.BaseStandardFontDataFactory{_fetchData(ht){return S(ht,!0)}}l.DOMStandardFontDataFactory=M;class x extends e.BaseSVGFactory{_createSVG(ht){return document.createElementNS(c,ht)}}l.DOMSVGFactory=x;class T{constructor(ht){let{viewBox:it,scale:ft,rotation:Rt,offsetX:Ft=0,offsetY:zt=0,dontFlip:Vt=!1}=ht;this.viewBox=it,this.scale=ft,this.rotation=Rt,this.offsetX=Ft,this.offsetY=zt;const $t=(it[2]+it[0])/2,Gt=(it[3]+it[1])/2;let Kt,Yt,Zt,_t;switch(Rt%=360,Rt<0&&(Rt+=360),Rt){case 180:Kt=-1,Yt=0,Zt=0,_t=1;break;case 90:Kt=0,Yt=1,Zt=1,_t=0;break;case 270:Kt=0,Yt=-1,Zt=-1,_t=0;break;case 0:Kt=1,Yt=0,Zt=0,_t=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Vt&&(Zt=-Zt,_t=-_t);let yt,Z,J,dt;Kt===0?(yt=Math.abs(Gt-it[1])*ft+Ft,Z=Math.abs($t-it[0])*ft+zt,J=(it[3]-it[1])*ft,dt=(it[2]-it[0])*ft):(yt=Math.abs($t-it[0])*ft+Ft,Z=Math.abs(Gt-it[1])*ft+zt,J=(it[2]-it[0])*ft,dt=(it[3]-it[1])*ft),this.transform=[Kt*ft,Yt*ft,Zt*ft,_t*ft,yt-Kt*ft*$t-Zt*ft*Gt,Z-Yt*ft*$t-_t*ft*Gt],this.width=J,this.height=dt}get rawDims(){const{viewBox:ht}=this;return(0,n.shadow)(this,"rawDims",{pageWidth:ht[2]-ht[0],pageHeight:ht[3]-ht[1],pageX:ht[0],pageY:ht[1]})}clone(){let{scale:ht=this.scale,rotation:it=this.rotation,offsetX:ft=this.offsetX,offsetY:Rt=this.offsetY,dontFlip:Ft=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new T({viewBox:this.viewBox.slice(),scale:ht,rotation:it,offsetX:ft,offsetY:Rt,dontFlip:Ft})}convertToViewportPoint(ht,it){return n.Util.applyTransform([ht,it],this.transform)}convertToViewportRectangle(ht){const it=n.Util.applyTransform([ht[0],ht[1]],this.transform),ft=n.Util.applyTransform([ht[2],ht[3]],this.transform);return[it[0],it[1],ft[0],ft[1]]}convertToPdfPoint(ht,it){return n.Util.applyInverseTransform([ht,it],this.transform)}}l.PageViewport=T;class d extends n.BaseException{constructor(ht){let it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;super(ht,"RenderingCancelledException"),this.extraDelay=it}}l.RenderingCancelledException=d;function a(bt){const ht=bt.length;let it=0;for(;it<ht&&bt[it].trim()==="";)it++;return bt.substring(it,it+5).toLowerCase()==="data:"}function i(bt){return typeof bt=="string"&&/\.pdf$/i.test(bt)}function f(bt){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)||([bt]=bt.split(/[#?]/,1)),bt.substring(bt.lastIndexOf("/")+1)}function E(bt){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof bt!="string")return ht;if(a(bt))return(0,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),ht;const it=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ft=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Rt=it.exec(bt);let Ft=ft.exec(Rt[1])||ft.exec(Rt[2])||ft.exec(Rt[3]);if(Ft&&(Ft=Ft[0],Ft.includes("%")))try{Ft=ft.exec(decodeURIComponent(Ft))[0]}catch{}return Ft||ht}class O{constructor(){ee(this,"started",Object.create(null));ee(this,"times",[])}time(ht){ht in this.started&&(0,n.warn)(`Timer is already running for ${ht}`),this.started[ht]=Date.now()}timeEnd(ht){ht in this.started||(0,n.warn)(`Timer has not been started for ${ht}`),this.times.push({name:ht,start:this.started[ht],end:Date.now()}),delete this.started[ht]}toString(){const ht=[];let it=0;for(const{name:ft}of this.times)it=Math.max(ft.length,it);for(const{name:ft,start:Rt,end:Ft}of this.times)ht.push(`${ft.padEnd(it)} ${Ft-Rt}ms
  3. `);return ht.join("")}}l.StatTimer=O;function R(bt,ht){try{const{protocol:it}=ht?new URL(bt,ht):new URL(bt);return it==="http:"||it==="https:"}catch{return!1}}function u(bt){bt.preventDefault()}function m(bt){let ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((it,ft)=>{const Rt=document.createElement("script");Rt.src=bt,Rt.onload=function(Ft){ht&&Rt.remove(),it(Ft)},Rt.onerror=function(){ft(new Error(`Cannot load script at: ${Rt.src}`))},(document.head||document.documentElement).append(Rt)})}function L(bt){console.log("Deprecated API usage: "+bt)}let w;class y{static toDateObject(ht){if(!ht||typeof ht!="string")return null;w||(w=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const it=w.exec(ht);if(!it)return null;const ft=parseInt(it[1],10);let Rt=parseInt(it[2],10);Rt=Rt>=1&&Rt<=12?Rt-1:0;let Ft=parseInt(it[3],10);Ft=Ft>=1&&Ft<=31?Ft:1;let zt=parseInt(it[4],10);zt=zt>=0&&zt<=23?zt:0;let Vt=parseInt(it[5],10);Vt=Vt>=0&&Vt<=59?Vt:0;let $t=parseInt(it[6],10);$t=$t>=0&&$t<=59?$t:0;const Gt=it[7]||"Z";let Kt=parseInt(it[8],10);Kt=Kt>=0&&Kt<=23?Kt:0;let Yt=parseInt(it[9],10)||0;return Yt=Yt>=0&&Yt<=59?Yt:0,Gt==="-"?(zt+=Kt,Vt+=Yt):Gt==="+"&&(zt-=Kt,Vt-=Yt),new Date(Date.UTC(ft,Rt,Ft,zt,Vt,$t))}}l.PDFDateString=y;function N(bt,ht){let{scale:it=1,rotation:ft=0}=ht;const{width:Rt,height:Ft}=bt.attributes.style,zt=[0,0,parseInt(Rt),parseInt(Ft)];return new T({viewBox:zt,scale:it,rotation:ft})}function D(bt){if(bt.startsWith("#")){const ht=parseInt(bt.slice(1),16);return[(ht&16711680)>>16,(ht&65280)>>8,ht&255]}return bt.startsWith("rgb(")?bt.slice(4,-1).split(",").map(ht=>parseInt(ht)):bt.startsWith("rgba(")?bt.slice(5,-1).split(",").map(ht=>parseInt(ht)).slice(0,3):((0,n.warn)(`Not a valid color format: "${bt}"`),[0,0,0])}function V(bt){const ht=document.createElement("span");ht.style.visibility="hidden",document.body.append(ht);for(const it of bt.keys()){ht.style.color=it;const ft=window.getComputedStyle(ht).color;bt.set(it,D(ft))}ht.remove()}function K(bt){const{a:ht,b:it,c:ft,d:Rt,e:Ft,f:zt}=bt.getTransform();return[ht,it,ft,Rt,Ft,zt]}function U(bt){const{a:ht,b:it,c:ft,d:Rt,e:Ft,f:zt}=bt.getTransform().invertSelf();return[ht,it,ft,Rt,Ft,zt]}function _(bt,ht){let it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ft=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(ht instanceof T){const{pageWidth:Rt,pageHeight:Ft}=ht.rawDims,{style:zt}=bt,Vt=n.FeatureTest.isCSSRoundSupported,$t=`var(--scale-factor) * ${Rt}px`,Gt=`var(--scale-factor) * ${Ft}px`,Kt=Vt?`round(${$t}, 1px)`:`calc(${$t})`,Yt=Vt?`round(${Gt}, 1px)`:`calc(${Gt})`;!it||ht.rotation%180===0?(zt.width=Kt,zt.height=Yt):(zt.width=Yt,zt.height=Kt)}ft&&bt.setAttribute("data-main-rotation",ht.rotation)}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BaseStandardFontDataFactory=l.BaseSVGFactory=l.BaseFilterFactory=l.BaseCanvasFactory=l.BaseCMapReaderFactory=void 0,t(2);var e=t(1);class n{constructor(){this.constructor===n&&(0,e.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(v){return"none"}addHCMFilter(v,M){return"none"}addHighlightHCMFilter(v,M,x,T){return"none"}destroy(){}}l.BaseFilterFactory=n;class c{constructor(){this.constructor===c&&(0,e.unreachable)("Cannot initialize BaseCanvasFactory.")}create(v,M){if(v<=0||M<=0)throw new Error("Invalid canvas size");const x=this._createCanvas(v,M);return{canvas:x,context:x.getContext("2d")}}reset(v,M,x){if(!v.canvas)throw new Error("Canvas is not specified");if(M<=0||x<=0)throw new Error("Invalid canvas size");v.canvas.width=M,v.canvas.height=x}destroy(v){if(!v.canvas)throw new Error("Canvas is not specified");v.canvas.width=0,v.canvas.height=0,v.canvas=null,v.context=null}_createCanvas(v,M){(0,e.unreachable)("Abstract method `_createCanvas` called.")}}l.BaseCanvasFactory=c;class b{constructor(v){let{baseUrl:M=null,isCompressed:x=!0}=v;this.constructor===b&&(0,e.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=M,this.isCompressed=x}async fetch(v){let{name:M}=v;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!M)throw new Error("CMap name must be specified.");const x=this.baseUrl+M+(this.isCompressed?".bcmap":""),T=this.isCompressed?e.CMapCompressionType.BINARY:e.CMapCompressionType.NONE;return this._fetchData(x,T).catch(d=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${x}`)})}_fetchData(v,M){(0,e.unreachable)("Abstract method `_fetchData` called.")}}l.BaseCMapReaderFactory=b;class F{constructor(v){let{baseUrl:M=null}=v;this.constructor===F&&(0,e.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=M}async fetch(v){let{filename:M}=v;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!M)throw new Error("Font filename must be specified.");const x=`${this.baseUrl}${M}`;return this._fetchData(x).catch(T=>{throw new Error(`Unable to load font data at: ${x}`)})}_fetchData(v){(0,e.unreachable)("Abstract method `_fetchData` called.")}}l.BaseStandardFontDataFactory=F;class C{constructor(){this.constructor===C&&(0,e.unreachable)("Cannot initialize BaseSVGFactory.")}create(v,M){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(v<=0||M<=0)throw new Error("Invalid SVG dimensions");const T=this._createSVG("svg:svg");return T.setAttribute("version","1.1"),x||(T.setAttribute("width",`${v}px`),T.setAttribute("height",`${M}px`)),T.setAttribute("preserveAspectRatio","none"),T.setAttribute("viewBox",`0 0 ${v} ${M}`),T}createElement(v){if(typeof v!="string")throw new Error("Invalid SVG element type");return this._createSVG(v)}_createSVG(v){(0,e.unreachable)("Abstract method `_createSVG` called.")}}l.BaseSVGFactory=C},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.MurmurHash3_64=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2);var e=t(1);const n=3285377520,c=4294901760,b=65535;class F{constructor(S){this.h1=S?S&4294967295:n,this.h2=S?S&4294967295:n}update(S){let v,M;if(typeof S=="string"){v=new Uint8Array(S.length*2),M=0;for(let L=0,w=S.length;L<w;L++){const y=S.charCodeAt(L);y<=255?v[M++]=y:(v[M++]=y>>>8,v[M++]=y&255)}}else if((0,e.isArrayBuffer)(S))v=S.slice(),M=v.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const x=M>>2,T=M-x*4,d=new Uint32Array(v.buffer,0,x);let a=0,i=0,f=this.h1,E=this.h2;const O=3432918353,R=461845907,u=O&b,m=R&b;for(let L=0;L<x;L++)L&1?(a=d[L],a=a*O&c|a*u&b,a=a<<15|a>>>17,a=a*R&c|a*m&b,f^=a,f=f<<13|f>>>19,f=f*5+3864292196):(i=d[L],i=i*O&c|i*u&b,i=i<<15|i>>>17,i=i*R&c|i*m&b,E^=i,E=E<<13|E>>>19,E=E*5+3864292196);switch(a=0,T){case 3:a^=v[x*4+2]<<16;case 2:a^=v[x*4+1]<<8;case 1:a^=v[x*4],a=a*O&c|a*u&b,a=a<<15|a>>>17,a=a*R&c|a*m&b,x&1?f^=a:E^=a}this.h1=f,this.h2=E}hexdigest(){let S=this.h1,v=this.h2;return S^=v>>>1,S=S*3981806797&c|S*36045&b,v=v*4283543511&c|((v<<16|S>>>16)*2950163797&c)>>>16,S^=v>>>1,S=S*444984403&c|S*60499&b,v=v*3301882366&c|((v<<16|S>>>16)*3120437893&c)>>>16,S^=v>>>1,(S>>>0).toString(16).padStart(8,"0")+(v>>>0).toString(16).padStart(8,"0")}}l.MurmurHash3_64=F},(k,l,t)=>{var b;Object.defineProperty(l,"__esModule",{value:!0}),l.FontLoader=l.FontFaceObject=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147),t(89),t(149);var e=t(1);class n{constructor(C){X(this,b,new Set);let{ownerDocument:S=globalThis.document,styleElement:v=null}=C;this._document=S,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(C){this.nativeFontFaces.add(C),this._document.fonts.add(C)}removeNativeFontFace(C){this.nativeFontFaces.delete(C),this._document.fonts.delete(C)}insertRule(C){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const S=this.styleElement.sheet;S.insertRule(C,S.cssRules.length)}clear(){for(const C of this.nativeFontFaces)this._document.fonts.delete(C);this.nativeFontFaces.clear(),r(this,b).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(C){if(!(!C||r(this,b).has(C.loadedName))){if((0,e.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:S,src:v,style:M}=C,x=new FontFace(S,v,M);this.addNativeFontFace(x);try{await x.load(),r(this,b).add(S)}catch{(0,e.warn)(`Cannot load system font: ${C.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(x)}return}(0,e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(C){if(C.attached||C.missingFile&&!C.systemFontInfo)return;if(C.attached=!0,C.systemFontInfo){await this.loadSystemFont(C.systemFontInfo);return}if(this.isFontLoadingAPISupported){const v=C.createNativeFontFace();if(v){this.addNativeFontFace(v);try{await v.loaded}catch(M){throw(0,e.warn)(`Failed to load font '${v.family}': '${M}'.`),C.disableFontFace=!0,M}}return}const S=C.createFontFaceRule();if(S){if(this.insertRule(S),this.isSyncFontLoadingSupported)return;await new Promise(v=>{const M=this._queueLoadingCallback(v);this._prepareFontLoadEvent(C,M)})}}get isFontLoadingAPISupported(){var S;const C=!!((S=this._document)!=null&&S.fonts);return(0,e.shadow)(this,"isFontLoadingAPISupported",C)}get isSyncFontLoadingSupported(){let C=!1;return(e.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(C=!0),(0,e.shadow)(this,"isSyncFontLoadingSupported",C)}_queueLoadingCallback(C){function S(){for((0,e.assert)(!M.done,"completeRequest() cannot be called twice."),M.done=!0;v.length>0&&v[0].done;){const x=v.shift();setTimeout(x.callback,0)}}const{loadingRequests:v}=this,M={done:!1,complete:S,callback:C};return v.push(M),M}get _loadTestFont(){const C=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,e.shadow)(this,"_loadTestFont",C)}_prepareFontLoadEvent(C,S){function v(D,V){return D.charCodeAt(V)<<24|D.charCodeAt(V+1)<<16|D.charCodeAt(V+2)<<8|D.charCodeAt(V+3)&255}function M(D,V,K,U){const _=D.substring(0,V),nt=D.substring(V+K);return _+U+nt}let x,T;const d=this._document.createElement("canvas");d.width=1,d.height=1;const a=d.getContext("2d");let i=0;function f(D,V){if(++i>30){(0,e.warn)("Load test font never loaded."),V();return}if(a.font="30px "+D,a.fillText(".",0,20),a.getImageData(0,0,1,1).data[3]>0){V();return}setTimeout(f.bind(null,D,V))}const E=`lt${Date.now()}${this.loadTestFontId++}`;let O=this._loadTestFont;O=M(O,976,E.length,E);const u=16,m=1482184792;let L=v(O,u);for(x=0,T=E.length-3;x<T;x+=4)L=L-m+v(E,x)|0;x<E.length&&(L=L-m+v(E+"XXX",x)|0),O=M(O,u,4,(0,e.string32)(L));const w=`url(data:font/opentype;base64,${btoa(O)});`,y=`@font-face {font-family:"${E}";src:${w}}`;this.insertRule(y);const N=this._document.createElement("div");N.style.visibility="hidden",N.style.width=N.style.height="10px",N.style.position="absolute",N.style.top=N.style.left="0px";for(const D of[C.loadedName,E]){const V=this._document.createElement("span");V.textContent="Hi",V.style.fontFamily=D,N.append(V)}this._document.body.append(N),f(E,()=>{N.remove(),S.complete()})}}b=new WeakMap,l.FontLoader=n;class c{constructor(C,S){let{isEvalSupported:v=!0,disableFontFace:M=!1,ignoreErrors:x=!1,inspectFont:T=null}=S;this.compiledGlyphs=Object.create(null);for(const d in C)this[d]=C[d];this.isEvalSupported=v!==!1,this.disableFontFace=M===!0,this.ignoreErrors=x===!0,this._inspectFont=T}createNativeFontFace(){var S;if(!this.data||this.disableFontFace)return null;let C;if(!this.cssFontInfo)C=new FontFace(this.loadedName,this.data,{});else{const v={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(v.style=`oblique ${this.cssFontInfo.italicAngle}deg`),C=new FontFace(this.cssFontInfo.fontFamily,this.data,v)}return(S=this._inspectFont)==null||S.call(this,this),C}createFontFaceRule(){var M;if(!this.data||this.disableFontFace)return null;const C=(0,e.bytesToString)(this.data),S=`url(data:${this.mimetype};base64,${btoa(C)});`;let v;if(!this.cssFontInfo)v=`@font-face {font-family:"${this.loadedName}";src:${S}}`;else{let x=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(x+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),v=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${x}src:${S}}`}return(M=this._inspectFont)==null||M.call(this,this,S),v}getPathGenerator(C,S){if(this.compiledGlyphs[S]!==void 0)return this.compiledGlyphs[S];let v;try{v=C.get(this.loadedName+"_path_"+S)}catch(M){if(!this.ignoreErrors)throw M;return(0,e.warn)(`getPathGenerator - ignoring character: "${M}".`),this.compiledGlyphs[S]=function(x,T){}}if(this.isEvalSupported&&e.FeatureTest.isEvalSupported){const M=[];for(const x of v){const T=x.args!==void 0?x.args.join(","):"";M.push("c.",x.cmd,"(",T,`);
  4. `)}return this.compiledGlyphs[S]=new Function("c","size",M.join(""))}return this.compiledGlyphs[S]=function(M,x){for(const T of v)T.cmd==="scale"&&(T.args=[x,-x]),M[T.cmd].apply(M,T.args)}}}l.FontFaceObject=c},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.NodeStandardFontDataFactory=l.NodeFilterFactory=l.NodeCanvasFactory=l.NodeCMapReaderFactory=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(169),n=t(1);(function(){if(!(globalThis.DOMMatrix||!n.isNodeJS))try{globalThis.DOMMatrix=require$$6.DOMMatrix}catch(M){(0,n.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${M}".`)}})(),function(){if(!(globalThis.Path2D||!n.isNodeJS))try{const{CanvasRenderingContext2D:M}=require$$6,{polyfillPath2D:x}=requirePath2dPolyfill_esm();globalThis.CanvasRenderingContext2D=M,x(globalThis)}catch(M){(0,n.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${M}".`)}}();const c=function(v){return new Promise((M,x)=>{require$$6.readFile(v,(d,a)=>{if(d||!a){x(new Error(d));return}M(new Uint8Array(a))})})};class b extends e.BaseFilterFactory{}l.NodeFilterFactory=b;class F extends e.BaseCanvasFactory{_createCanvas(M,x){return require$$6.createCanvas(M,x)}}l.NodeCanvasFactory=F;class C extends e.BaseCMapReaderFactory{_fetchData(M,x){return c(M).then(T=>({cMapData:T,compressionType:x}))}}l.NodeCMapReaderFactory=C;class S extends e.BaseStandardFontDataFactory{_fetchData(M){return c(M)}}l.NodeStandardFontDataFactory=S},(k,l,t)=>{var Y,je,gt,qe;Object.defineProperty(l,"__esModule",{value:!0}),l.CanvasGraphics=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(168),c=t(174),b=t(175);const F=16,C=100,S=4096,v=15,M=10,x=1e3,T=16;function d(W,h){if(W._removeMirroring)throw new Error("Context is already forwarding operations.");W.__originalSave=W.save,W.__originalRestore=W.restore,W.__originalRotate=W.rotate,W.__originalScale=W.scale,W.__originalTranslate=W.translate,W.__originalTransform=W.transform,W.__originalSetTransform=W.setTransform,W.__originalResetTransform=W.resetTransform,W.__originalClip=W.clip,W.__originalMoveTo=W.moveTo,W.__originalLineTo=W.lineTo,W.__originalBezierCurveTo=W.bezierCurveTo,W.__originalRect=W.rect,W.__originalClosePath=W.closePath,W.__originalBeginPath=W.beginPath,W._removeMirroring=()=>{W.save=W.__originalSave,W.restore=W.__originalRestore,W.rotate=W.__originalRotate,W.scale=W.__originalScale,W.translate=W.__originalTranslate,W.transform=W.__originalTransform,W.setTransform=W.__originalSetTransform,W.resetTransform=W.__originalResetTransform,W.clip=W.__originalClip,W.moveTo=W.__originalMoveTo,W.lineTo=W.__originalLineTo,W.bezierCurveTo=W.__originalBezierCurveTo,W.rect=W.__originalRect,W.closePath=W.__originalClosePath,W.beginPath=W.__originalBeginPath,delete W._removeMirroring},W.save=function(){h.save(),this.__originalSave()},W.restore=function(){h.restore(),this.__originalRestore()},W.translate=function(s,p){h.translate(s,p),this.__originalTranslate(s,p)},W.scale=function(s,p){h.scale(s,p),this.__originalScale(s,p)},W.transform=function(s,p,A,I,P,H){h.transform(s,p,A,I,P,H),this.__originalTransform(s,p,A,I,P,H)},W.setTransform=function(s,p,A,I,P,H){h.setTransform(s,p,A,I,P,H),this.__originalSetTransform(s,p,A,I,P,H)},W.resetTransform=function(){h.resetTransform(),this.__originalResetTransform()},W.rotate=function(s){h.rotate(s),this.__originalRotate(s)},W.clip=function(s){h.clip(s),this.__originalClip(s)},W.moveTo=function(g,s){h.moveTo(g,s),this.__originalMoveTo(g,s)},W.lineTo=function(g,s){h.lineTo(g,s),this.__originalLineTo(g,s)},W.bezierCurveTo=function(g,s,p,A,I,P){h.bezierCurveTo(g,s,p,A,I,P),this.__originalBezierCurveTo(g,s,p,A,I,P)},W.rect=function(g,s,p,A){h.rect(g,s,p,A),this.__originalRect(g,s,p,A)},W.closePath=function(){h.closePath(),this.__originalClosePath()},W.beginPath=function(){h.beginPath(),this.__originalBeginPath()}}class a{constructor(h){this.canvasFactory=h,this.cache=Object.create(null)}getCanvas(h,g,s){let p;return this.cache[h]!==void 0?(p=this.cache[h],this.canvasFactory.reset(p,g,s)):(p=this.canvasFactory.create(g,s),this.cache[h]=p),p}delete(h){delete this.cache[h]}clear(){for(const h in this.cache){const g=this.cache[h];this.canvasFactory.destroy(g),delete this.cache[h]}}}function i(W,h,g,s,p,A,I,P,H,tt){const[q,ct,ut,Et,mt,Ot]=(0,n.getCurrentTransform)(W);if(ct===0&&ut===0){const Nt=I*q+mt,bt=Math.round(Nt),ht=P*Et+Ot,it=Math.round(ht),ft=(I+H)*q+mt,Rt=Math.abs(Math.round(ft)-bt)||1,Ft=(P+tt)*Et+Ot,zt=Math.abs(Math.round(Ft)-it)||1;return W.setTransform(Math.sign(q),0,0,Math.sign(Et),bt,it),W.drawImage(h,g,s,p,A,0,0,Rt,zt),W.setTransform(q,ct,ut,Et,mt,Ot),[Rt,zt]}if(q===0&&Et===0){const Nt=P*ut+mt,bt=Math.round(Nt),ht=I*ct+Ot,it=Math.round(ht),ft=(P+tt)*ut+mt,Rt=Math.abs(Math.round(ft)-bt)||1,Ft=(I+H)*ct+Ot,zt=Math.abs(Math.round(Ft)-it)||1;return W.setTransform(0,Math.sign(ct),Math.sign(ut),0,bt,it),W.drawImage(h,g,s,p,A,0,0,zt,Rt),W.setTransform(q,ct,ut,Et,mt,Ot),[zt,Rt]}W.drawImage(h,g,s,p,A,I,P,H,tt);const Wt=Math.hypot(q,ct),kt=Math.hypot(ut,Et);return[Wt*H,kt*tt]}function f(W){const{width:h,height:g}=W;if(h>x||g>x)return null;const s=1e3,p=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),A=h+1;let I=new Uint8Array(A*(g+1)),P,H,tt;const q=h+7&-8;let ct=new Uint8Array(q*g),ut=0;for(const kt of W.data){let Nt=128;for(;Nt>0;)ct[ut++]=kt&Nt?0:255,Nt>>=1}let Et=0;for(ut=0,ct[ut]!==0&&(I[0]=1,++Et),H=1;H<h;H++)ct[ut]!==ct[ut+1]&&(I[H]=ct[ut]?2:1,++Et),ut++;for(ct[ut]!==0&&(I[H]=2,++Et),P=1;P<g;P++){ut=P*q,tt=P*A,ct[ut-q]!==ct[ut]&&(I[tt]=ct[ut]?1:8,++Et);let kt=(ct[ut]?4:0)+(ct[ut-q]?8:0);for(H=1;H<h;H++)kt=(kt>>2)+(ct[ut+1]?4:0)+(ct[ut-q+1]?8:0),p[kt]&&(I[tt+H]=p[kt],++Et),ut++;if(ct[ut-q]!==ct[ut]&&(I[tt+H]=ct[ut]?2:4,++Et),Et>s)return null}for(ut=q*(g-1),tt=P*A,ct[ut]!==0&&(I[tt]=8,++Et),H=1;H<h;H++)ct[ut]!==ct[ut+1]&&(I[tt+H]=ct[ut]?4:8,++Et),ut++;if(ct[ut]!==0&&(I[tt+H]=4,++Et),Et>s)return null;const mt=new Int32Array([0,A,-1,0,-A,0,0,0,1]),Ot=new Path2D;for(P=0;Et&&P<=g;P++){let kt=P*A;const Nt=kt+h;for(;kt<Nt&&!I[kt];)kt++;if(kt===Nt)continue;Ot.moveTo(kt%A,P);const bt=kt;let ht=I[kt];do{const it=mt[ht];do kt+=it;while(!I[kt]);const ft=I[kt];ft!==5&&ft!==10?(ht=ft,I[kt]=0):(ht=ft&51*ht>>4,I[kt]&=ht>>2|ht<<2),Ot.lineTo(kt%A,kt/A|0),I[kt]||--Et}while(bt!==kt);--P}return ct=null,I=null,function(kt){kt.save(),kt.scale(1/h,-1/g),kt.translate(0,-g),kt.fill(Ot),kt.beginPath(),kt.restore()}}class E{constructor(h,g){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=e.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=e.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=e.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,h,g])}clone(){const h=Object.create(this);return h.clipBox=this.clipBox.slice(),h}setCurrentPoint(h,g){this.x=h,this.y=g}updatePathMinMax(h,g,s){[g,s]=e.Util.applyTransform([g,s],h),this.minX=Math.min(this.minX,g),this.minY=Math.min(this.minY,s),this.maxX=Math.max(this.maxX,g),this.maxY=Math.max(this.maxY,s)}updateRectMinMax(h,g){const s=e.Util.applyTransform(g,h),p=e.Util.applyTransform(g.slice(2),h);this.minX=Math.min(this.minX,s[0],p[0]),this.minY=Math.min(this.minY,s[1],p[1]),this.maxX=Math.max(this.maxX,s[0],p[0]),this.maxY=Math.max(this.maxY,s[1],p[1])}updateScalingPathMinMax(h,g){e.Util.scaleMinMax(h,g),this.minX=Math.min(this.minX,g[0]),this.maxX=Math.max(this.maxX,g[1]),this.minY=Math.min(this.minY,g[2]),this.maxY=Math.max(this.maxY,g[3])}updateCurvePathMinMax(h,g,s,p,A,I,P,H,tt,q){const ct=e.Util.bezierBoundingBox(g,s,p,A,I,P,H,tt);if(q){q[0]=Math.min(q[0],ct[0],ct[2]),q[1]=Math.max(q[1],ct[0],ct[2]),q[2]=Math.min(q[2],ct[1],ct[3]),q[3]=Math.max(q[3],ct[1],ct[3]);return}this.updateRectMinMax(h,ct)}getPathBoundingBox(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.PathType.FILL,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const s=[this.minX,this.minY,this.maxX,this.maxY];if(h===c.PathType.STROKE){g||(0,e.unreachable)("Stroke bounding box must include transform.");const p=e.Util.singularValueDecompose2dScale(g),A=p[0]*this.lineWidth/2,I=p[1]*this.lineWidth/2;s[0]-=A,s[1]-=I,s[2]+=A,s[3]+=I}return s}updateClipFromPath(){const h=e.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(h||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(h){this.clipBox=h,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.PathType.FILL,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e.Util.intersect(this.clipBox,this.getPathBoundingBox(h,g))}}function O(W,h){if(typeof ImageData<"u"&&h instanceof ImageData){W.putImageData(h,0,0);return}const g=h.height,s=h.width,p=g%T,A=(g-p)/T,I=p===0?A:A+1,P=W.createImageData(s,T);let H=0,tt;const q=h.data,ct=P.data;let ut,Et,mt,Ot;if(h.kind===e.ImageKind.GRAYSCALE_1BPP){const Wt=q.byteLength,kt=new Uint32Array(ct.buffer,0,ct.byteLength>>2),Nt=kt.length,bt=s+7>>3,ht=4294967295,it=e.FeatureTest.isLittleEndian?4278190080:255;for(ut=0;ut<I;ut++){for(mt=ut<A?T:p,tt=0,Et=0;Et<mt;Et++){const ft=Wt-H;let Rt=0;const Ft=ft>bt?s:ft*8-7,zt=Ft&-8;let Vt=0,$t=0;for(;Rt<zt;Rt+=8)$t=q[H++],kt[tt++]=$t&128?ht:it,kt[tt++]=$t&64?ht:it,kt[tt++]=$t&32?ht:it,kt[tt++]=$t&16?ht:it,kt[tt++]=$t&8?ht:it,kt[tt++]=$t&4?ht:it,kt[tt++]=$t&2?ht:it,kt[tt++]=$t&1?ht:it;for(;Rt<Ft;Rt++)Vt===0&&($t=q[H++],Vt=128),kt[tt++]=$t&Vt?ht:it,Vt>>=1}for(;tt<Nt;)kt[tt++]=0;W.putImageData(P,0,ut*T)}}else if(h.kind===e.ImageKind.RGBA_32BPP){for(Et=0,Ot=s*T*4,ut=0;ut<A;ut++)ct.set(q.subarray(H,H+Ot)),H+=Ot,W.putImageData(P,0,Et),Et+=T;ut<I&&(Ot=s*p*4,ct.set(q.subarray(H,H+Ot)),W.putImageData(P,0,Et))}else if(h.kind===e.ImageKind.RGB_24BPP)for(mt=T,Ot=s*mt,ut=0;ut<I;ut++){for(ut>=A&&(mt=p,Ot=s*mt),tt=0,Et=Ot;Et--;)ct[tt++]=q[H++],ct[tt++]=q[H++],ct[tt++]=q[H++],ct[tt++]=255;W.putImageData(P,0,ut*T)}else throw new Error(`bad image kind: ${h.kind}`)}function R(W,h){if(h.bitmap){W.drawImage(h.bitmap,0,0);return}const g=h.height,s=h.width,p=g%T,A=(g-p)/T,I=p===0?A:A+1,P=W.createImageData(s,T);let H=0;const tt=h.data,q=P.data;for(let ct=0;ct<I;ct++){const ut=ct<A?T:p;({srcPos:H}=(0,b.convertBlackAndWhiteToRGBA)({src:tt,srcPos:H,dest:q,width:s,height:ut,nonBlackColor:0})),W.putImageData(P,0,ct*T)}}function u(W,h){const g=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of g)W[s]!==void 0&&(h[s]=W[s]);W.setLineDash!==void 0&&(h.setLineDash(W.getLineDash()),h.lineDashOffset=W.lineDashOffset)}function m(W){if(W.strokeStyle=W.fillStyle="#000000",W.fillRule="nonzero",W.globalAlpha=1,W.lineWidth=1,W.lineCap="butt",W.lineJoin="miter",W.miterLimit=10,W.globalCompositeOperation="source-over",W.font="10px sans-serif",W.setLineDash!==void 0&&(W.setLineDash([]),W.lineDashOffset=0),!e.isNodeJS){const{filter:h}=W;h!=="none"&&h!==""&&(W.filter="none")}}function L(W,h,g,s){const p=W.length;for(let A=3;A<p;A+=4){const I=W[A];if(I===0)W[A-3]=h,W[A-2]=g,W[A-1]=s;else if(I<255){const P=255-I;W[A-3]=W[A-3]*I+h*P>>8,W[A-2]=W[A-2]*I+g*P>>8,W[A-1]=W[A-1]*I+s*P>>8}}}function w(W,h,g){const s=W.length,p=1/255;for(let A=3;A<s;A+=4){const I=g?g[W[A]]:W[A];h[A]=h[A]*I*p|0}}function y(W,h,g){const s=W.length;for(let p=3;p<s;p+=4){const A=W[p-3]*77+W[p-2]*152+W[p-1]*28;h[p]=g?h[p]*g[A>>8]>>8:h[p]*A>>16}}function N(W,h,g,s,p,A,I,P,H,tt,q){const ct=!!A,ut=ct?A[0]:0,Et=ct?A[1]:0,mt=ct?A[2]:0,Ot=p==="Luminosity"?y:w,kt=Math.min(s,Math.ceil(1048576/g));for(let Nt=0;Nt<s;Nt+=kt){const bt=Math.min(kt,s-Nt),ht=W.getImageData(P-tt,Nt+(H-q),g,bt),it=h.getImageData(P,Nt+H,g,bt);ct&&L(ht.data,ut,Et,mt),Ot(ht.data,it.data,I),h.putImageData(it,P,Nt+H)}}function D(W,h,g,s){const p=s[0],A=s[1],I=s[2]-p,P=s[3]-A;I===0||P===0||(N(h.context,g,I,P,h.subtype,h.backdrop,h.transferMap,p,A,h.offsetX,h.offsetY),W.save(),W.globalAlpha=1,W.globalCompositeOperation="source-over",W.setTransform(1,0,0,1,0,0),W.drawImage(g.canvas,0,0),W.restore())}function V(W,h){const g=e.Util.singularValueDecompose2dScale(W);g[0]=Math.fround(g[0]),g[1]=Math.fround(g[1]);const s=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return h!==void 0?h:g[0]<=s||g[1]<=s}const K=["butt","round","square"],U=["miter","round","bevel"],_={},nt={},wt=class wt{constructor(h,g,s,p,A,I,P,H){X(this,Y);X(this,gt);let{optionalContentConfig:tt,markedContentStack:q=null}=I;this.ctx=h,this.current=new E(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=g,this.objs=s,this.canvasFactory=p,this.filterFactory=A,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=q||[],this.optionalContentConfig=tt,this.cachedCanvases=new a(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=P,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=H,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(h){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof h=="string"?h.startsWith("g_")?this.commonObjs.get(h):this.objs.get(h):g}beginDrawing(h){let{transform:g,viewport:s,transparency:p=!1,background:A=null}=h;const I=this.ctx.canvas.width,P=this.ctx.canvas.height,H=this.ctx.fillStyle;if(this.ctx.fillStyle=A||"#ffffff",this.ctx.fillRect(0,0,I,P),this.ctx.fillStyle=H,p){const tt=this.cachedCanvases.getCanvas("transparent",I,P);this.compositeCtx=this.ctx,this.transparentCanvas=tt.canvas,this.ctx=tt.context,this.ctx.save(),this.ctx.transform(...(0,n.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),g&&(this.ctx.transform(...g),this.outputScaleX=g[0],this.outputScaleY=g[0]),this.ctx.transform(...s.transform),this.viewportScale=s.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(h,g,s,p){const A=h.argsArray,I=h.fnArray;let P=g||0;const H=A.length;if(H===P)return P;const tt=H-P>M&&typeof s=="function",q=tt?Date.now()+v:0;let ct=0;const ut=this.commonObjs,Et=this.objs;let mt;for(;;){if(p!==void 0&&P===p.nextBreakPoint)return p.breakIt(P,s),P;if(mt=I[P],mt!==e.OPS.dependency)this[mt].apply(this,A[P]);else for(const Ot of A[P]){const Wt=Ot.startsWith("g_")?ut:Et;if(!Wt.has(Ot))return Wt.get(Ot,s),P}if(P++,P===H)return P;if(tt&&++ct>M){if(Date.now()>q)return s(),P;ct=0}}}endDrawing(){j(this,Y,je).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const h of this._cachedBitmapsMap.values()){for(const g of h.values())typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement&&(g.width=g.height=0);h.clear()}this._cachedBitmapsMap.clear(),j(this,gt,qe).call(this)}_scaleImage(h,g){const s=h.width,p=h.height;let A=Math.max(Math.hypot(g[0],g[1]),1),I=Math.max(Math.hypot(g[2],g[3]),1),P=s,H=p,tt="prescale1",q,ct;for(;A>2&&P>1||I>2&&H>1;){let ut=P,Et=H;A>2&&P>1&&(ut=P>=16384?Math.floor(P/2)-1||1:Math.ceil(P/2),A/=P/ut),I>2&&H>1&&(Et=H>=16384?Math.floor(H/2)-1||1:Math.ceil(H)/2,I/=H/Et),q=this.cachedCanvases.getCanvas(tt,ut,Et),ct=q.context,ct.clearRect(0,0,ut,Et),ct.drawImage(h,0,0,P,H,0,0,ut,Et),h=q.canvas,P=ut,H=Et,tt=tt==="prescale1"?"prescale2":"prescale1"}return{img:h,paintWidth:P,paintHeight:H}}_createMaskCanvas(h){const g=this.ctx,{width:s,height:p}=h,A=this.current.fillColor,I=this.current.patternFill,P=(0,n.getCurrentTransform)(g);let H,tt,q,ct;if((h.bitmap||h.data)&&h.count>1){const Rt=h.bitmap||h.data.buffer;tt=JSON.stringify(I?P:[P.slice(0,4),A]),H=this._cachedBitmapsMap.get(Rt),H||(H=new Map,this._cachedBitmapsMap.set(Rt,H));const Ft=H.get(tt);if(Ft&&!I){const zt=Math.round(Math.min(P[0],P[2])+P[4]),Vt=Math.round(Math.min(P[1],P[3])+P[5]);return{canvas:Ft,offsetX:zt,offsetY:Vt}}q=Ft}q||(ct=this.cachedCanvases.getCanvas("maskCanvas",s,p),R(ct.context,h));let ut=e.Util.transform(P,[1/s,0,0,-1/p,0,0]);ut=e.Util.transform(ut,[1,0,0,1,0,-p]);const Et=e.Util.applyTransform([0,0],ut),mt=e.Util.applyTransform([s,p],ut),Ot=e.Util.normalizeRect([Et[0],Et[1],mt[0],mt[1]]),Wt=Math.round(Ot[2]-Ot[0])||1,kt=Math.round(Ot[3]-Ot[1])||1,Nt=this.cachedCanvases.getCanvas("fillCanvas",Wt,kt),bt=Nt.context,ht=Math.min(Et[0],mt[0]),it=Math.min(Et[1],mt[1]);bt.translate(-ht,-it),bt.transform(...ut),q||(q=this._scaleImage(ct.canvas,(0,n.getCurrentTransformInverse)(bt)),q=q.img,H&&I&&H.set(tt,q)),bt.imageSmoothingEnabled=V((0,n.getCurrentTransform)(bt),h.interpolate),i(bt,q,0,0,q.width,q.height,0,0,s,p),bt.globalCompositeOperation="source-in";const ft=e.Util.transform((0,n.getCurrentTransformInverse)(bt),[1,0,0,1,-ht,-it]);return bt.fillStyle=I?A.getPattern(g,this,ft,c.PathType.FILL):A,bt.fillRect(0,0,s,p),H&&!I&&(this.cachedCanvases.delete("fillCanvas"),H.set(tt,Nt.canvas)),{canvas:Nt.canvas,offsetX:Math.round(ht),offsetY:Math.round(it)}}setLineWidth(h){h!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=h,this.ctx.lineWidth=h}setLineCap(h){this.ctx.lineCap=K[h]}setLineJoin(h){this.ctx.lineJoin=U[h]}setMiterLimit(h){this.ctx.miterLimit=h}setDash(h,g){const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(h),s.lineDashOffset=g)}setRenderingIntent(h){}setFlatness(h){}setGState(h){for(const[g,s]of h)switch(g){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.current.fillAlpha=s,this.ctx.globalAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(s);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const h=this.inSMaskMode;this.current.activeSMask&&!h?this.beginSMaskMode():!this.current.activeSMask&&h&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const h=this.ctx.canvas.width,g=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,p=this.cachedCanvases.getCanvas(s,h,g);this.suspendedCtx=this.ctx,this.ctx=p.context;const A=this.ctx;A.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),u(this.suspendedCtx,A),d(A,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),u(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(h){if(!this.current.activeSMask)return;h?(h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]),h[2]=Math.ceil(h[2]),h[3]=Math.ceil(h[3])):h=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const g=this.current.activeSMask,s=this.suspendedCtx;D(s,g,this.ctx,h),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?(u(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const h=this.current;this.stateStack.push(h),this.current=h.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),u(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(h,g,s,p,A,I){this.ctx.transform(h,g,s,p,A,I),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(h,g,s){const p=this.ctx,A=this.current;let I=A.x,P=A.y,H,tt;const q=(0,n.getCurrentTransform)(p),ct=q[0]===0&&q[3]===0||q[1]===0&&q[2]===0,ut=ct?s.slice(0):null;for(let Et=0,mt=0,Ot=h.length;Et<Ot;Et++)switch(h[Et]|0){case e.OPS.rectangle:I=g[mt++],P=g[mt++];const Wt=g[mt++],kt=g[mt++],Nt=I+Wt,bt=P+kt;p.moveTo(I,P),Wt===0||kt===0?p.lineTo(Nt,bt):(p.lineTo(Nt,P),p.lineTo(Nt,bt),p.lineTo(I,bt)),ct||A.updateRectMinMax(q,[I,P,Nt,bt]),p.closePath();break;case e.OPS.moveTo:I=g[mt++],P=g[mt++],p.moveTo(I,P),ct||A.updatePathMinMax(q,I,P);break;case e.OPS.lineTo:I=g[mt++],P=g[mt++],p.lineTo(I,P),ct||A.updatePathMinMax(q,I,P);break;case e.OPS.curveTo:H=I,tt=P,I=g[mt+4],P=g[mt+5],p.bezierCurveTo(g[mt],g[mt+1],g[mt+2],g[mt+3],I,P),A.updateCurvePathMinMax(q,H,tt,g[mt],g[mt+1],g[mt+2],g[mt+3],I,P,ut),mt+=6;break;case e.OPS.curveTo2:H=I,tt=P,p.bezierCurveTo(I,P,g[mt],g[mt+1],g[mt+2],g[mt+3]),A.updateCurvePathMinMax(q,H,tt,I,P,g[mt],g[mt+1],g[mt+2],g[mt+3],ut),I=g[mt+2],P=g[mt+3],mt+=4;break;case e.OPS.curveTo3:H=I,tt=P,I=g[mt+2],P=g[mt+3],p.bezierCurveTo(g[mt],g[mt+1],I,P,I,P),A.updateCurvePathMinMax(q,H,tt,g[mt],g[mt+1],I,P,I,P,ut),mt+=4;break;case e.OPS.closePath:p.closePath();break}ct&&A.updateScalingPathMinMax(q,ut),A.setCurrentPoint(I,P)}closePath(){this.ctx.closePath()}stroke(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const g=this.ctx,s=this.current.strokeColor;g.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof s=="object"&&(s!=null&&s.getPattern)?(g.save(),g.strokeStyle=s.getPattern(g,this,(0,n.getCurrentTransformInverse)(g),c.PathType.STROKE),this.rescaleAndStroke(!1),g.restore()):this.rescaleAndStroke(!0)),h&&this.consumePath(this.current.getClippedPathBoundingBox()),g.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const g=this.ctx,s=this.current.fillColor,p=this.current.patternFill;let A=!1;p&&(g.save(),g.fillStyle=s.getPattern(g,this,(0,n.getCurrentTransformInverse)(g),c.PathType.FILL),A=!0);const I=this.current.getClippedPathBoundingBox();this.contentVisible&&I!==null&&(this.pendingEOFill?(g.fill("evenodd"),this.pendingEOFill=!1):g.fill()),A&&g.restore(),h&&this.consumePath(I)}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=_}eoClip(){this.pendingClip=nt}beginText(){this.current.textMatrix=e.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const h=this.pendingTextPaths,g=this.ctx;if(h===void 0){g.beginPath();return}g.save(),g.beginPath();for(const s of h)g.setTransform(...s.transform),g.translate(s.x,s.y),s.addToPath(g,s.fontSize);g.restore(),g.clip(),g.beginPath(),delete this.pendingTextPaths}setCharSpacing(h){this.current.charSpacing=h}setWordSpacing(h){this.current.wordSpacing=h}setHScale(h){this.current.textHScale=h/100}setLeading(h){this.current.leading=-h}setFont(h,g){var q;const s=this.commonObjs.get(h),p=this.current;if(!s)throw new Error(`Can't find font for ${h}`);if(p.fontMatrix=s.fontMatrix||e.FONT_IDENTITY_MATRIX,(p.fontMatrix[0]===0||p.fontMatrix[3]===0)&&(0,e.warn)("Invalid font matrix for font "+h),g<0?(g=-g,p.fontDirection=-1):p.fontDirection=1,this.current.font=s,this.current.fontSize=g,s.isType3Font)return;const A=s.loadedName||"sans-serif",I=((q=s.systemFontInfo)==null?void 0:q.css)||`"${A}", ${s.fallbackName}`;let P="normal";s.black?P="900":s.bold&&(P="bold");const H=s.italic?"italic":"normal";let tt=g;g<F?tt=F:g>C&&(tt=C),this.current.fontSizeScale=g/tt,this.ctx.font=`${H} ${P} ${tt}px ${I}`}setTextRenderingMode(h){this.current.textRenderingMode=h}setTextRise(h){this.current.textRise=h}moveText(h,g){this.current.x=this.current.lineX+=h,this.current.y=this.current.lineY+=g}setLeadingMoveText(h,g){this.setLeading(-g),this.moveText(h,g)}setTextMatrix(h,g,s,p,A,I){this.current.textMatrix=[h,g,s,p,A,I],this.current.textMatrixScale=Math.hypot(h,g),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(h,g,s,p){const A=this.ctx,I=this.current,P=I.font,H=I.textRenderingMode,tt=I.fontSize/I.fontSizeScale,q=H&e.TextRenderingMode.FILL_STROKE_MASK,ct=!!(H&e.TextRenderingMode.ADD_TO_PATH_FLAG),ut=I.patternFill&&!P.missingFile;let Et;(P.disableFontFace||ct||ut)&&(Et=P.getPathGenerator(this.commonObjs,h)),P.disableFontFace||ut?(A.save(),A.translate(g,s),A.beginPath(),Et(A,tt),p&&A.setTransform(...p),(q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&A.fill(),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&A.stroke(),A.restore()):((q===e.TextRenderingMode.FILL||q===e.TextRenderingMode.FILL_STROKE)&&A.fillText(h,g,s),(q===e.TextRenderingMode.STROKE||q===e.TextRenderingMode.FILL_STROKE)&&A.strokeText(h,g,s)),ct&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,n.getCurrentTransform)(A),x:g,y:s,fontSize:tt,addToPath:Et})}get isFontSubpixelAAEnabled(){const{context:h}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);h.scale(1.5,1),h.fillText("I",0,10);const g=h.getImageData(0,0,10,10).data;let s=!1;for(let p=3;p<g.length;p+=4)if(g[p]>0&&g[p]<255){s=!0;break}return(0,e.shadow)(this,"isFontSubpixelAAEnabled",s)}showText(h){const g=this.current,s=g.font;if(s.isType3Font)return this.showType3Text(h);const p=g.fontSize;if(p===0)return;const A=this.ctx,I=g.fontSizeScale,P=g.charSpacing,H=g.wordSpacing,tt=g.fontDirection,q=g.textHScale*tt,ct=h.length,ut=s.vertical,Et=ut?1:-1,mt=s.defaultVMetrics,Ot=p*g.fontMatrix[0],Wt=g.textRenderingMode===e.TextRenderingMode.FILL&&!s.disableFontFace&&!g.patternFill;A.save(),A.transform(...g.textMatrix),A.translate(g.x,g.y+g.textRise),tt>0?A.scale(q,-1):A.scale(q,1);let kt;if(g.patternFill){A.save();const ft=g.fillColor.getPattern(A,this,(0,n.getCurrentTransformInverse)(A),c.PathType.FILL);kt=(0,n.getCurrentTransform)(A),A.restore(),A.fillStyle=ft}let Nt=g.lineWidth;const bt=g.textMatrixScale;if(bt===0||Nt===0){const ft=g.textRenderingMode&e.TextRenderingMode.FILL_STROKE_MASK;(ft===e.TextRenderingMode.STROKE||ft===e.TextRenderingMode.FILL_STROKE)&&(Nt=this.getSinglePixelWidth())}else Nt/=bt;if(I!==1&&(A.scale(I,I),Nt/=I),A.lineWidth=Nt,s.isInvalidPDFjsFont){const ft=[];let Rt=0;for(const Ft of h)ft.push(Ft.unicode),Rt+=Ft.width;A.fillText(ft.join(""),0,0),g.x+=Rt*Ot*q,A.restore(),this.compose();return}let ht=0,it;for(it=0;it<ct;++it){const ft=h[it];if(typeof ft=="number"){ht+=Et*ft*p/1e3;continue}let Rt=!1;const Ft=(ft.isSpace?H:0)+P,zt=ft.fontChar,Vt=ft.accent;let $t,Gt,Kt=ft.width;if(ut){const Zt=ft.vmetric||mt,_t=-(ft.vmetric?Zt[1]:Kt*.5)*Ot,yt=Zt[2]*Ot;Kt=Zt?-Zt[0]:Kt,$t=_t/I,Gt=(ht+yt)/I}else $t=ht/I,Gt=0;if(s.remeasure&&Kt>0){const Zt=A.measureText(zt).width*1e3/p*I;if(Kt<Zt&&this.isFontSubpixelAAEnabled){const _t=Kt/Zt;Rt=!0,A.save(),A.scale(_t,1),$t/=_t}else Kt!==Zt&&($t+=(Kt-Zt)/2e3*p/I)}if(this.contentVisible&&(ft.isInFont||s.missingFile)){if(Wt&&!Vt)A.fillText(zt,$t,Gt);else if(this.paintChar(zt,$t,Gt,kt),Vt){const Zt=$t+p*Vt.offset.x/I,_t=Gt-p*Vt.offset.y/I;this.paintChar(Vt.fontChar,Zt,_t,kt)}}const Yt=ut?Kt*Ot-Ft*tt:Kt*Ot+Ft*tt;ht+=Yt,Rt&&A.restore()}ut?g.y-=ht:g.x+=ht*q,A.restore(),this.compose()}showType3Text(h){const g=this.ctx,s=this.current,p=s.font,A=s.fontSize,I=s.fontDirection,P=p.vertical?1:-1,H=s.charSpacing,tt=s.wordSpacing,q=s.textHScale*I,ct=s.fontMatrix||e.FONT_IDENTITY_MATRIX,ut=h.length,Et=s.textRenderingMode===e.TextRenderingMode.INVISIBLE;let mt,Ot,Wt,kt;if(!(Et||A===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,g.save(),g.transform(...s.textMatrix),g.translate(s.x,s.y),g.scale(q,I),mt=0;mt<ut;++mt){if(Ot=h[mt],typeof Ot=="number"){kt=P*Ot*A/1e3,this.ctx.translate(kt,0),s.x+=kt*q;continue}const Nt=(Ot.isSpace?tt:0)+H,bt=p.charProcOperatorList[Ot.operatorListId];if(!bt){(0,e.warn)(`Type3 character "${Ot.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=Ot,this.save(),g.scale(A,A),g.transform(...ct),this.executeOperatorList(bt),this.restore()),Wt=e.Util.applyTransform([Ot.width,0],ct)[0]*A+Nt,g.translate(Wt,0),s.x+=Wt*q}g.restore(),this.processingType3=null}}setCharWidth(h,g){}setCharWidthAndBounds(h,g,s,p,A,I){this.ctx.rect(s,p,A-s,I-p),this.ctx.clip(),this.endPath()}getColorN_Pattern(h){let g;if(h[0]==="TilingPattern"){const s=h[1],p=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),A={createCanvasGraphics:I=>new wt(I,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};g=new c.TilingPattern(h,s,this.ctx,A,p)}else g=this._getPattern(h[1],h[2]);return g}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(h,g,s){const p=e.Util.makeHexColor(h,g,s);this.ctx.strokeStyle=p,this.current.strokeColor=p}setFillRGBColor(h,g,s){const p=e.Util.makeHexColor(h,g,s);this.ctx.fillStyle=p,this.current.fillColor=p,this.current.patternFill=!1}_getPattern(h){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s;return this.cachedPatterns.has(h)?s=this.cachedPatterns.get(h):(s=(0,c.getShadingPattern)(this.getObject(h)),this.cachedPatterns.set(h,s)),g&&(s.matrix=g),s}shadingFill(h){if(!this.contentVisible)return;const g=this.ctx;this.save();const s=this._getPattern(h);g.fillStyle=s.getPattern(g,this,(0,n.getCurrentTransformInverse)(g),c.PathType.SHADING);const p=(0,n.getCurrentTransformInverse)(g);if(p){const{width:A,height:I}=g.canvas,[P,H,tt,q]=e.Util.getAxialAlignedBoundingBox([0,0,A,I],p);this.ctx.fillRect(P,H,tt-P,q-H)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,e.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,e.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(h,g){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(h)&&h.length===6&&this.transform(...h),this.baseTransform=(0,n.getCurrentTransform)(this.ctx),g)){const s=g[2]-g[0],p=g[3]-g[1];this.ctx.rect(g[0],g[1],s,p),this.current.updateRectMinMax((0,n.getCurrentTransform)(this.ctx),g),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(h){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const g=this.ctx;h.isolated||(0,e.info)("TODO: Support non-isolated groups."),h.knockout&&(0,e.warn)("Knockout groups not supported.");const s=(0,n.getCurrentTransform)(g);if(h.matrix&&g.transform(...h.matrix),!h.bbox)throw new Error("Bounding box is required.");let p=e.Util.getAxialAlignedBoundingBox(h.bbox,(0,n.getCurrentTransform)(g));const A=[0,0,g.canvas.width,g.canvas.height];p=e.Util.intersect(p,A)||[0,0,0,0];const I=Math.floor(p[0]),P=Math.floor(p[1]);let H=Math.max(Math.ceil(p[2])-I,1),tt=Math.max(Math.ceil(p[3])-P,1),q=1,ct=1;H>S&&(q=H/S,H=S),tt>S&&(ct=tt/S,tt=S),this.current.startNewPathAndClipBox([0,0,H,tt]);let ut="groupAt"+this.groupLevel;h.smask&&(ut+="_smask_"+this.smaskCounter++%2);const Et=this.cachedCanvases.getCanvas(ut,H,tt),mt=Et.context;mt.scale(1/q,1/ct),mt.translate(-I,-P),mt.transform(...s),h.smask?this.smaskStack.push({canvas:Et.canvas,context:mt,offsetX:I,offsetY:P,scaleX:q,scaleY:ct,subtype:h.smask.subtype,backdrop:h.smask.backdrop,transferMap:h.smask.transferMap||null,startTransformInverse:null}):(g.setTransform(1,0,0,1,0,0),g.translate(I,P),g.scale(q,ct),g.save()),u(g,mt),this.ctx=mt,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(g),this.groupLevel++}endGroup(h){if(!this.contentVisible)return;this.groupLevel--;const g=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,h.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const p=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...p);const A=e.Util.getAxialAlignedBoundingBox([0,0,g.canvas.width,g.canvas.height],p);this.ctx.drawImage(g.canvas,0,0),this.ctx.restore(),this.compose(A)}}beginAnnotation(h,g,s,p,A){if(j(this,Y,je).call(this),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(g)&&g.length===4){const I=g[2]-g[0],P=g[3]-g[1];if(A&&this.annotationCanvasMap){s=s.slice(),s[4]-=g[0],s[5]-=g[1],g=g.slice(),g[0]=g[1]=0,g[2]=I,g[3]=P;const[H,tt]=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:q}=this,ct=Math.ceil(I*this.outputScaleX*q),ut=Math.ceil(P*this.outputScaleY*q);this.annotationCanvas=this.canvasFactory.create(ct,ut);const{canvas:Et,context:mt}=this.annotationCanvas;this.annotationCanvasMap.set(h,Et),this.annotationCanvas.savedCtx=this.ctx,this.ctx=mt,this.ctx.save(),this.ctx.setTransform(H,0,0,-tt,0,P*tt),m(this.ctx)}else m(this.ctx),this.ctx.rect(g[0],g[1],I,P),this.ctx.clip(),this.endPath()}this.current=new E(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...s),this.transform(...p)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),j(this,gt,qe).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(h){if(!this.contentVisible)return;const g=h.count;h=this.getObject(h.data,h),h.count=g;const s=this.ctx,p=this.processingType3;if(p&&(p.compiled===void 0&&(p.compiled=f(h)),p.compiled)){p.compiled(s);return}const A=this._createMaskCanvas(h),I=A.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(I,A.offsetX,A.offsetY),s.restore(),this.compose()}paintImageMaskXObjectRepeat(h,g){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,A=arguments.length>4?arguments[4]:void 0,I=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;h=this.getObject(h.data,h);const P=this.ctx;P.save();const H=(0,n.getCurrentTransform)(P);P.transform(g,s,p,A,0,0);const tt=this._createMaskCanvas(h);P.setTransform(1,0,0,1,tt.offsetX-H[4],tt.offsetY-H[5]);for(let q=0,ct=I.length;q<ct;q+=2){const ut=e.Util.transform(H,[g,s,p,A,I[q],I[q+1]]),[Et,mt]=e.Util.applyTransform([0,0],ut);P.drawImage(tt.canvas,Et,mt)}P.restore(),this.compose()}paintImageMaskXObjectGroup(h){if(!this.contentVisible)return;const g=this.ctx,s=this.current.fillColor,p=this.current.patternFill;for(const A of h){const{data:I,width:P,height:H,transform:tt}=A,q=this.cachedCanvases.getCanvas("maskCanvas",P,H),ct=q.context;ct.save();const ut=this.getObject(I,A);R(ct,ut),ct.globalCompositeOperation="source-in",ct.fillStyle=p?s.getPattern(ct,this,(0,n.getCurrentTransformInverse)(g),c.PathType.FILL):s,ct.fillRect(0,0,P,H),ct.restore(),g.save(),g.transform(...tt),g.scale(1,-1),i(g,q.canvas,0,0,P,H,0,-1,1,1),g.restore()}this.compose()}paintImageXObject(h){if(!this.contentVisible)return;const g=this.getObject(h);if(!g){(0,e.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(g)}paintImageXObjectRepeat(h,g,s,p){if(!this.contentVisible)return;const A=this.getObject(h);if(!A){(0,e.warn)("Dependent image isn't ready yet");return}const I=A.width,P=A.height,H=[];for(let tt=0,q=p.length;tt<q;tt+=2)H.push({transform:[g,0,0,s,p[tt],p[tt+1]],x:0,y:0,w:I,h:P});this.paintInlineImageXObjectGroup(A,H)}applyTransferMapsToCanvas(h){return this.current.transferMaps!=="none"&&(h.filter=this.current.transferMaps,h.drawImage(h.canvas,0,0),h.filter="none"),h.canvas}applyTransferMapsToBitmap(h){if(this.current.transferMaps==="none")return h.bitmap;const{bitmap:g,width:s,height:p}=h,A=this.cachedCanvases.getCanvas("inlineImage",s,p),I=A.context;return I.filter=this.current.transferMaps,I.drawImage(g,0,0),I.filter="none",A.canvas}paintInlineImageXObject(h){if(!this.contentVisible)return;const g=h.width,s=h.height,p=this.ctx;if(this.save(),!e.isNodeJS){const{filter:P}=p;P!=="none"&&P!==""&&(p.filter="none")}p.scale(1/g,-1/s);let A;if(h.bitmap)A=this.applyTransferMapsToBitmap(h);else if(typeof HTMLElement=="function"&&h instanceof HTMLElement||!h.data)A=h;else{const H=this.cachedCanvases.getCanvas("inlineImage",g,s).context;O(H,h),A=this.applyTransferMapsToCanvas(H)}const I=this._scaleImage(A,(0,n.getCurrentTransformInverse)(p));p.imageSmoothingEnabled=V((0,n.getCurrentTransform)(p),h.interpolate),i(p,I.img,0,0,I.paintWidth,I.paintHeight,0,-s,g,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(h,g){if(!this.contentVisible)return;const s=this.ctx;let p;if(h.bitmap)p=h.bitmap;else{const A=h.width,I=h.height,H=this.cachedCanvases.getCanvas("inlineImage",A,I).context;O(H,h),p=this.applyTransferMapsToCanvas(H)}for(const A of g)s.save(),s.transform(...A.transform),s.scale(1,-1),i(s,p,A.x,A.y,A.w,A.h,0,-1,1,1),s.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(h){}markPointProps(h,g){}beginMarkedContent(h){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(h,g){h==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(g)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(h){const g=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(h);const s=this.ctx;this.pendingClip&&(g||(this.pendingClip===nt?s.clip("evenodd"):s.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),s.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const h=(0,n.getCurrentTransform)(this.ctx);if(h[1]===0&&h[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(h[0]),Math.abs(h[3]));else{const g=Math.abs(h[0]*h[3]-h[2]*h[1]),s=Math.hypot(h[0],h[2]),p=Math.hypot(h[1],h[3]);this._cachedGetSinglePixelWidth=Math.max(s,p)/g}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:h}=this.current,{a:g,b:s,c:p,d:A}=this.ctx.getTransform();let I,P;if(s===0&&p===0){const H=Math.abs(g),tt=Math.abs(A);if(H===tt)if(h===0)I=P=1/H;else{const q=H*h;I=P=q<1?1/q:1}else if(h===0)I=1/H,P=1/tt;else{const q=H*h,ct=tt*h;I=q<1?1/q:1,P=ct<1?1/ct:1}}else{const H=Math.abs(g*A-s*p),tt=Math.hypot(g,s),q=Math.hypot(p,A);if(h===0)I=q/H,P=tt/H;else{const ct=h*H;I=q>ct?q/ct:1,P=tt>ct?tt/ct:1}}this._cachedScaleForStroking[0]=I,this._cachedScaleForStroking[1]=P}return this._cachedScaleForStroking}rescaleAndStroke(h){const{ctx:g}=this,{lineWidth:s}=this.current,[p,A]=this.getScaleForStroking();if(g.lineWidth=s||1,p===1&&A===1){g.stroke();return}const I=g.getLineDash();if(h&&g.save(),g.scale(p,A),I.length>0){const P=Math.max(p,A);g.setLineDash(I.map(H=>H/P)),g.lineDashOffset/=P}g.stroke(),h&&g.restore()}isContentVisible(){for(let h=this.markedContentStack.length-1;h>=0;h--)if(!this.markedContentStack[h].visible)return!1;return!0}};Y=new WeakSet,je=function(){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)},gt=new WeakSet,qe=function(){if(this.pageColors){const h=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(h!=="none"){const g=this.ctx.filter;this.ctx.filter=h,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=g}}};let rt=wt;l.CanvasGraphics=rt;for(const W in e.OPS)rt.prototype[W]!==void 0&&(rt.prototype[e.OPS[W]]=rt.prototype[W])},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TilingPattern=l.PathType=void 0,l.getShadingPattern=T,t(2);var e=t(1),n=t(168);const c={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};l.PathType=c;function b(f,E){if(!E)return;const O=E[2]-E[0],R=E[3]-E[1],u=new Path2D;u.rect(E[0],E[1],O,R),f.clip(u)}class F{constructor(){this.constructor===F&&(0,e.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,e.unreachable)("Abstract method `getPattern` called.")}}class C extends F{constructor(E){super(),this._type=E[1],this._bbox=E[2],this._colorStops=E[3],this._p0=E[4],this._p1=E[5],this._r0=E[6],this._r1=E[7],this.matrix=null}_createGradient(E){let O;this._type==="axial"?O=E.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(O=E.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const R of this._colorStops)O.addColorStop(R[0],R[1]);return O}getPattern(E,O,R,u){let m;if(u===c.STROKE||u===c.FILL){const L=O.current.getClippedPathBoundingBox(u,(0,n.getCurrentTransform)(E))||[0,0,0,0],w=Math.ceil(L[2]-L[0])||1,y=Math.ceil(L[3]-L[1])||1,N=O.cachedCanvases.getCanvas("pattern",w,y,!0),D=N.context;D.clearRect(0,0,D.canvas.width,D.canvas.height),D.beginPath(),D.rect(0,0,D.canvas.width,D.canvas.height),D.translate(-L[0],-L[1]),R=e.Util.transform(R,[1,0,0,1,L[0],L[1]]),D.transform(...O.baseTransform),this.matrix&&D.transform(...this.matrix),b(D,this._bbox),D.fillStyle=this._createGradient(D),D.fill(),m=E.createPattern(N.canvas,"no-repeat");const V=new DOMMatrix(R);m.setTransform(V)}else b(E,this._bbox),m=this._createGradient(E);return m}}function S(f,E,O,R,u,m,L,w){const y=E.coords,N=E.colors,D=f.data,V=f.width*4;let K;y[O+1]>y[R+1]&&(K=O,O=R,R=K,K=m,m=L,L=K),y[R+1]>y[u+1]&&(K=R,R=u,u=K,K=L,L=w,w=K),y[O+1]>y[R+1]&&(K=O,O=R,R=K,K=m,m=L,L=K);const U=(y[O]+E.offsetX)*E.scaleX,_=(y[O+1]+E.offsetY)*E.scaleY,nt=(y[R]+E.offsetX)*E.scaleX,rt=(y[R+1]+E.offsetY)*E.scaleY,Y=(y[u]+E.offsetX)*E.scaleX,st=(y[u+1]+E.offsetY)*E.scaleY;if(_>=st)return;const gt=N[m],At=N[m+1],wt=N[m+2],W=N[L],h=N[L+1],g=N[L+2],s=N[w],p=N[w+1],A=N[w+2],I=Math.round(_),P=Math.round(st);let H,tt,q,ct,ut,Et,mt,Ot;for(let Wt=I;Wt<=P;Wt++){if(Wt<rt){const it=Wt<_?0:(_-Wt)/(_-rt);H=U-(U-nt)*it,tt=gt-(gt-W)*it,q=At-(At-h)*it,ct=wt-(wt-g)*it}else{let it;Wt>st?it=1:rt===st?it=0:it=(rt-Wt)/(rt-st),H=nt-(nt-Y)*it,tt=W-(W-s)*it,q=h-(h-p)*it,ct=g-(g-A)*it}let kt;Wt<_?kt=0:Wt>st?kt=1:kt=(_-Wt)/(_-st),ut=U-(U-Y)*kt,Et=gt-(gt-s)*kt,mt=At-(At-p)*kt,Ot=wt-(wt-A)*kt;const Nt=Math.round(Math.min(H,ut)),bt=Math.round(Math.max(H,ut));let ht=V*Wt+Nt*4;for(let it=Nt;it<=bt;it++)kt=(H-it)/(H-ut),kt<0?kt=0:kt>1&&(kt=1),D[ht++]=tt-(tt-Et)*kt|0,D[ht++]=q-(q-mt)*kt|0,D[ht++]=ct-(ct-Ot)*kt|0,D[ht++]=255}}function v(f,E,O){const R=E.coords,u=E.colors;let m,L;switch(E.type){case"lattice":const w=E.verticesPerRow,y=Math.floor(R.length/w)-1,N=w-1;for(m=0;m<y;m++){let D=m*w;for(let V=0;V<N;V++,D++)S(f,O,R[D],R[D+1],R[D+w],u[D],u[D+1],u[D+w]),S(f,O,R[D+w+1],R[D+1],R[D+w],u[D+w+1],u[D+1],u[D+w])}break;case"triangles":for(m=0,L=R.length;m<L;m+=3)S(f,O,R[m],R[m+1],R[m+2],u[m],u[m+1],u[m+2]);break;default:throw new Error("illegal figure")}}class M extends F{constructor(E){super(),this._coords=E[2],this._colors=E[3],this._figures=E[4],this._bounds=E[5],this._bbox=E[7],this._background=E[8],this.matrix=null}_createMeshCanvas(E,O,R){const w=Math.floor(this._bounds[0]),y=Math.floor(this._bounds[1]),N=Math.ceil(this._bounds[2])-w,D=Math.ceil(this._bounds[3])-y,V=Math.min(Math.ceil(Math.abs(N*E[0]*1.1)),3e3),K=Math.min(Math.ceil(Math.abs(D*E[1]*1.1)),3e3),U=N/V,_=D/K,nt={coords:this._coords,colors:this._colors,offsetX:-w,offsetY:-y,scaleX:1/U,scaleY:1/_},rt=V+2*2,Y=K+2*2,st=R.getCanvas("mesh",rt,Y,!1),gt=st.context,At=gt.createImageData(V,K);if(O){const W=At.data;for(let h=0,g=W.length;h<g;h+=4)W[h]=O[0],W[h+1]=O[1],W[h+2]=O[2],W[h+3]=255}for(const W of this._figures)v(At,W,nt);return gt.putImageData(At,2,2),{canvas:st.canvas,offsetX:w-2*U,offsetY:y-2*_,scaleX:U,scaleY:_}}getPattern(E,O,R,u){b(E,this._bbox);let m;if(u===c.SHADING)m=e.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(E));else if(m=e.Util.singularValueDecompose2dScale(O.baseTransform),this.matrix){const w=e.Util.singularValueDecompose2dScale(this.matrix);m=[m[0]*w[0],m[1]*w[1]]}const L=this._createMeshCanvas(m,u===c.SHADING?null:this._background,O.cachedCanvases);return u!==c.SHADING&&(E.setTransform(...O.baseTransform),this.matrix&&E.transform(...this.matrix)),E.translate(L.offsetX,L.offsetY),E.scale(L.scaleX,L.scaleY),E.createPattern(L.canvas,"no-repeat")}}class x extends F{getPattern(){return"hotpink"}}function T(f){switch(f[0]){case"RadialAxial":return new C(f);case"Mesh":return new M(f);case"Dummy":return new x}throw new Error(`Unknown IR type: ${f[0]}`)}const d={COLORED:1,UNCOLORED:2},i=class i{constructor(E,O,R,u,m){this.operatorList=E[2],this.matrix=E[3]||[1,0,0,1,0,0],this.bbox=E[4],this.xstep=E[5],this.ystep=E[6],this.paintType=E[7],this.tilingType=E[8],this.color=O,this.ctx=R,this.canvasGraphicsFactory=u,this.baseTransform=m}createPatternCanvas(E){const O=this.operatorList,R=this.bbox,u=this.xstep,m=this.ystep,L=this.paintType,w=this.tilingType,y=this.color,N=this.canvasGraphicsFactory;(0,e.info)("TilingType: "+w);const D=R[0],V=R[1],K=R[2],U=R[3],_=e.Util.singularValueDecompose2dScale(this.matrix),nt=e.Util.singularValueDecompose2dScale(this.baseTransform),rt=[_[0]*nt[0],_[1]*nt[1]],Y=this.getSizeAndScale(u,this.ctx.canvas.width,rt[0]),st=this.getSizeAndScale(m,this.ctx.canvas.height,rt[1]),gt=E.cachedCanvases.getCanvas("pattern",Y.size,st.size,!0),At=gt.context,wt=N.createCanvasGraphics(At);wt.groupLevel=E.groupLevel,this.setFillAndStrokeStyleToContext(wt,L,y);let W=D,h=V,g=K,s=U;return D<0&&(W=0,g+=Math.abs(D)),V<0&&(h=0,s+=Math.abs(V)),At.translate(-(Y.scale*W),-(st.scale*h)),wt.transform(Y.scale,0,0,st.scale,0,0),At.save(),this.clipBbox(wt,W,h,g,s),wt.baseTransform=(0,n.getCurrentTransform)(wt.ctx),wt.executeOperatorList(O),wt.endDrawing(),{canvas:gt.canvas,scaleX:Y.scale,scaleY:st.scale,offsetX:W,offsetY:h}}getSizeAndScale(E,O,R){E=Math.abs(E);const u=Math.max(i.MAX_PATTERN_SIZE,O);let m=Math.ceil(E*R);return m>=u?m=u:R=m/E,{scale:R,size:m}}clipBbox(E,O,R,u,m){const L=u-O,w=m-R;E.ctx.rect(O,R,L,w),E.current.updateRectMinMax((0,n.getCurrentTransform)(E.ctx),[O,R,u,m]),E.clip(),E.endPath()}setFillAndStrokeStyleToContext(E,O,R){const u=E.ctx,m=E.current;switch(O){case d.COLORED:const L=this.ctx;u.fillStyle=L.fillStyle,u.strokeStyle=L.strokeStyle,m.fillColor=L.fillStyle,m.strokeColor=L.strokeStyle;break;case d.UNCOLORED:const w=e.Util.makeHexColor(R[0],R[1],R[2]);u.fillStyle=w,u.strokeStyle=w,m.fillColor=w,m.strokeColor=w;break;default:throw new e.FormatError(`Unsupported paint type: ${O}`)}}getPattern(E,O,R,u){let m=R;u!==c.SHADING&&(m=e.Util.transform(m,O.baseTransform),this.matrix&&(m=e.Util.transform(m,this.matrix)));const L=this.createPatternCanvas(O);let w=new DOMMatrix(m);w=w.translate(L.offsetX,L.offsetY),w=w.scale(1/L.scaleX,1/L.scaleY);const y=E.createPattern(L.canvas,"repeat");return y.setTransform(w),y}};ee(i,"MAX_PATTERN_SIZE",3e3);let a=i;l.TilingPattern=a},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.convertBlackAndWhiteToRGBA=c,l.convertToRGBA=n,l.grayToRGBA=F,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(1);function n(C){switch(C.kind){case e.ImageKind.GRAYSCALE_1BPP:return c(C);case e.ImageKind.RGB_24BPP:return b(C)}return null}function c(C){let{src:S,srcPos:v=0,dest:M,width:x,height:T,nonBlackColor:d=4294967295,inverseDecode:a=!1}=C;const i=e.FeatureTest.isLittleEndian?4278190080:255,[f,E]=a?[d,i]:[i,d],O=x>>3,R=x&7,u=S.length;M=new Uint32Array(M.buffer);let m=0;for(let L=0;L<T;L++){for(const y=v+O;v<y;v++){const N=v<u?S[v]:255;M[m++]=N&128?E:f,M[m++]=N&64?E:f,M[m++]=N&32?E:f,M[m++]=N&16?E:f,M[m++]=N&8?E:f,M[m++]=N&4?E:f,M[m++]=N&2?E:f,M[m++]=N&1?E:f}if(R===0)continue;const w=v<u?S[v++]:255;for(let y=0;y<R;y++)M[m++]=w&1<<7-y?E:f}return{srcPos:v,destPos:m}}function b(C){let{src:S,srcPos:v=0,dest:M,destPos:x=0,width:T,height:d}=C,a=0;const i=S.length>>2,f=new Uint32Array(S.buffer,v,i);if(e.FeatureTest.isLittleEndian){for(;a<i-2;a+=3,x+=4){const E=f[a],O=f[a+1],R=f[a+2];M[x]=E|4278190080,M[x+1]=E>>>24|O<<8|4278190080,M[x+2]=O>>>16|R<<16|4278190080,M[x+3]=R>>>8|4278190080}for(let E=a*4,O=S.length;E<O;E+=3)M[x++]=S[E]|S[E+1]<<8|S[E+2]<<16|4278190080}else{for(;a<i-2;a+=3,x+=4){const E=f[a],O=f[a+1],R=f[a+2];M[x]=E|255,M[x+1]=E<<24|O>>>8|255,M[x+2]=O<<16|R>>>16|255,M[x+3]=R<<8|255}for(let E=a*4,O=S.length;E<O;E+=3)M[x++]=S[E]<<24|S[E+1]<<16|S[E+2]<<8|255}return{srcPos:v,destPos:x}}function F(C,S){if(e.FeatureTest.isLittleEndian)for(let v=0,M=C.length;v<M;v++)S[v]=C[v]*65793|4278190080;else for(let v=0,M=C.length;v<M;v++)S[v]=C[v]*16843008|255}},(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.GlobalWorkerOptions=void 0;const t=Object.create(null);l.GlobalWorkerOptions=t,t.workerPort=null,t.workerSrc=""},(k,l,t)=>{var C,wn,v,Mn,x,Re;Object.defineProperty(l,"__esModule",{value:!0}),l.MessageHandler=void 0,t(2);var e=t(1);const n={UNKNOWN:0,DATA:1,ERROR:2},c={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function b(d){switch(d instanceof Error||typeof d=="object"&&d!==null||(0,e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),d.name){case"AbortException":return new e.AbortException(d.message);case"MissingPDFException":return new e.MissingPDFException(d.message);case"PasswordException":return new e.PasswordException(d.message,d.code);case"UnexpectedResponseException":return new e.UnexpectedResponseException(d.message,d.status);case"UnknownErrorException":return new e.UnknownErrorException(d.message,d.details);default:return new e.UnknownErrorException(d.message,d.toString())}}class F{constructor(a,i,f){X(this,C);X(this,v);X(this,x);this.sourceName=a,this.targetName=i,this.comObj=f,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=E=>{const O=E.data;if(O.targetName!==this.sourceName)return;if(O.stream){j(this,v,Mn).call(this,O);return}if(O.callback){const u=O.callbackId,m=this.callbackCapabilities[u];if(!m)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],O.callback===n.DATA)m.resolve(O.data);else if(O.callback===n.ERROR)m.reject(b(O.reason));else throw new Error("Unexpected callback case");return}const R=this.actionHandler[O.action];if(!R)throw new Error(`Unknown action from worker: ${O.action}`);if(O.callbackId){const u=this.sourceName,m=O.sourceName;new Promise(function(L){L(R(O.data))}).then(function(L){f.postMessage({sourceName:u,targetName:m,callback:n.DATA,callbackId:O.callbackId,data:L})},function(L){f.postMessage({sourceName:u,targetName:m,callback:n.ERROR,callbackId:O.callbackId,reason:b(L)})});return}if(O.streamId){j(this,C,wn).call(this,O);return}R(O.data)},f.addEventListener("message",this._onComObjOnMessage)}on(a,i){const f=this.actionHandler;if(f[a])throw new Error(`There is already an actionName called "${a}"`);f[a]=i}send(a,i,f){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:a,data:i},f)}sendWithPromise(a,i,f){const E=this.callbackId++,O=new e.PromiseCapability;this.callbackCapabilities[E]=O;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:a,callbackId:E,data:i},f)}catch(R){O.reject(R)}return O.promise}sendWithStream(a,i,f,E){const O=this.streamId++,R=this.sourceName,u=this.targetName,m=this.comObj;return new ReadableStream({start:L=>{const w=new e.PromiseCapability;return this.streamControllers[O]={controller:L,startCall:w,pullCall:null,cancelCall:null,isClosed:!1},m.postMessage({sourceName:R,targetName:u,action:a,streamId:O,data:i,desiredSize:L.desiredSize},E),w.promise},pull:L=>{const w=new e.PromiseCapability;return this.streamControllers[O].pullCall=w,m.postMessage({sourceName:R,targetName:u,stream:c.PULL,streamId:O,desiredSize:L.desiredSize}),w.promise},cancel:L=>{(0,e.assert)(L instanceof Error,"cancel must have a valid reason");const w=new e.PromiseCapability;return this.streamControllers[O].cancelCall=w,this.streamControllers[O].isClosed=!0,m.postMessage({sourceName:R,targetName:u,stream:c.CANCEL,streamId:O,reason:b(L)}),w.promise}},f)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}C=new WeakSet,wn=function(a){const i=a.streamId,f=this.sourceName,E=a.sourceName,O=this.comObj,R=this,u=this.actionHandler[a.action],m={enqueue(L){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,y=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const N=this.desiredSize;this.desiredSize-=w,N>0&&this.desiredSize<=0&&(this.sinkCapability=new e.PromiseCapability,this.ready=this.sinkCapability.promise),O.postMessage({sourceName:f,targetName:E,stream:c.ENQUEUE,streamId:i,chunk:L},y)},close(){this.isCancelled||(this.isCancelled=!0,O.postMessage({sourceName:f,targetName:E,stream:c.CLOSE,streamId:i}),delete R.streamSinks[i])},error(L){(0,e.assert)(L instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,O.postMessage({sourceName:f,targetName:E,stream:c.ERROR,streamId:i,reason:b(L)}))},sinkCapability:new e.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:a.desiredSize,ready:null};m.sinkCapability.resolve(),m.ready=m.sinkCapability.promise,this.streamSinks[i]=m,new Promise(function(L){L(u(a.data,m))}).then(function(){O.postMessage({sourceName:f,targetName:E,stream:c.START_COMPLETE,streamId:i,success:!0})},function(L){O.postMessage({sourceName:f,targetName:E,stream:c.START_COMPLETE,streamId:i,reason:b(L)})})},v=new WeakSet,Mn=function(a){const i=a.streamId,f=this.sourceName,E=a.sourceName,O=this.comObj,R=this.streamControllers[i],u=this.streamSinks[i];switch(a.stream){case c.START_COMPLETE:a.success?R.startCall.resolve():R.startCall.reject(b(a.reason));break;case c.PULL_COMPLETE:a.success?R.pullCall.resolve():R.pullCall.reject(b(a.reason));break;case c.PULL:if(!u){O.postMessage({sourceName:f,targetName:E,stream:c.PULL_COMPLETE,streamId:i,success:!0});break}u.desiredSize<=0&&a.desiredSize>0&&u.sinkCapability.resolve(),u.desiredSize=a.desiredSize,new Promise(function(m){var L;m((L=u.onPull)==null?void 0:L.call(u))}).then(function(){O.postMessage({sourceName:f,targetName:E,stream:c.PULL_COMPLETE,streamId:i,success:!0})},function(m){O.postMessage({sourceName:f,targetName:E,stream:c.PULL_COMPLETE,streamId:i,reason:b(m)})});break;case c.ENQUEUE:if((0,e.assert)(R,"enqueue should have stream controller"),R.isClosed)break;R.controller.enqueue(a.chunk);break;case c.CLOSE:if((0,e.assert)(R,"close should have stream controller"),R.isClosed)break;R.isClosed=!0,R.controller.close(),j(this,x,Re).call(this,R,i);break;case c.ERROR:(0,e.assert)(R,"error should have stream controller"),R.controller.error(b(a.reason)),j(this,x,Re).call(this,R,i);break;case c.CANCEL_COMPLETE:a.success?R.cancelCall.resolve():R.cancelCall.reject(b(a.reason)),j(this,x,Re).call(this,R,i);break;case c.CANCEL:if(!u)break;new Promise(function(m){var L;m((L=u.onCancel)==null?void 0:L.call(u,b(a.reason)))}).then(function(){O.postMessage({sourceName:f,targetName:E,stream:c.CANCEL_COMPLETE,streamId:i,success:!0})},function(m){O.postMessage({sourceName:f,targetName:E,stream:c.CANCEL_COMPLETE,streamId:i,reason:b(m)})}),u.sinkCapability.reject(b(a.reason)),u.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}},x=new WeakSet,Re=async function(a,i){var f,E,O;await Promise.allSettled([(f=a.startCall)==null?void 0:f.promise,(E=a.pullCall)==null?void 0:E.promise,(O=a.cancelCall)==null?void 0:O.promise]),delete this.streamControllers[i]},l.MessageHandler=F},(k,l,t)=>{var c,b;Object.defineProperty(l,"__esModule",{value:!0}),l.Metadata=void 0;var e=t(1);class n{constructor(C){X(this,c,void 0);X(this,b,void 0);let{parsedData:S,rawData:v}=C;at(this,c,S),at(this,b,v)}getRaw(){return r(this,b)}get(C){return r(this,c).get(C)??null}getAll(){return(0,e.objectFromMap)(r(this,c))}has(C){return r(this,c).has(C)}}c=new WeakMap,b=new WeakMap,l.Metadata=n},(k,l,t)=>{var C,S,v,M,x,T,tn;Object.defineProperty(l,"__esModule",{value:!0}),l.OptionalContentConfig=void 0;var e=t(1),n=t(170);const c=Symbol("INTERNAL");class b{constructor(i,f){X(this,C,!0);this.name=i,this.intent=f}get visible(){return r(this,C)}_setVisible(i,f){i!==c&&(0,e.unreachable)("Internal method `_setVisible` called."),at(this,C,f)}}C=new WeakMap;class F{constructor(i){X(this,T);X(this,S,null);X(this,v,new Map);X(this,M,null);X(this,x,null);if(this.name=null,this.creator=null,i!==null){this.name=i.name,this.creator=i.creator,at(this,x,i.order);for(const f of i.groups)r(this,v).set(f.id,new b(f.name,f.intent));if(i.baseState==="OFF")for(const f of r(this,v).values())f._setVisible(c,!1);for(const f of i.on)r(this,v).get(f)._setVisible(c,!0);for(const f of i.off)r(this,v).get(f)._setVisible(c,!1);at(this,M,this.getHash())}}isVisible(i){if(r(this,v).size===0)return!0;if(!i)return(0,e.warn)("Optional content group not defined."),!0;if(i.type==="OCG")return r(this,v).has(i.id)?r(this,v).get(i.id).visible:((0,e.warn)(`Optional content group not found: ${i.id}`),!0);if(i.type==="OCMD"){if(i.expression)return j(this,T,tn).call(this,i.expression);if(!i.policy||i.policy==="AnyOn"){for(const f of i.ids){if(!r(this,v).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(r(this,v).get(f).visible)return!0}return!1}else if(i.policy==="AllOn"){for(const f of i.ids){if(!r(this,v).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(!r(this,v).get(f).visible)return!1}return!0}else if(i.policy==="AnyOff"){for(const f of i.ids){if(!r(this,v).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(!r(this,v).get(f).visible)return!0}return!1}else if(i.policy==="AllOff"){for(const f of i.ids){if(!r(this,v).has(f))return(0,e.warn)(`Optional content group not found: ${f}`),!0;if(r(this,v).get(f).visible)return!1}return!0}return(0,e.warn)(`Unknown optional content policy ${i.policy}.`),!0}return(0,e.warn)(`Unknown group type ${i.type}.`),!0}setVisibility(i){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!r(this,v).has(i)){(0,e.warn)(`Optional content group not found: ${i}`);return}r(this,v).get(i)._setVisible(c,!!f),at(this,S,null)}get hasInitialVisibility(){return r(this,M)===null||this.getHash()===r(this,M)}getOrder(){return r(this,v).size?r(this,x)?r(this,x).slice():[...r(this,v).keys()]:null}getGroups(){return r(this,v).size>0?(0,e.objectFromMap)(r(this,v)):null}getGroup(i){return r(this,v).get(i)||null}getHash(){if(r(this,S)!==null)return r(this,S);const i=new n.MurmurHash3_64;for(const[f,E]of r(this,v))i.update(`${f}:${E.visible}`);return at(this,S,i.hexdigest())}}S=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakSet,tn=function(i){const f=i.length;if(f<2)return!0;const E=i[0];for(let O=1;O<f;O++){const R=i[O];let u;if(Array.isArray(R))u=j(this,T,tn).call(this,R);else if(r(this,v).has(R))u=r(this,v).get(R).visible;else return(0,e.warn)(`Optional content group not found: ${R}`),!0;switch(E){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return E==="And"},l.OptionalContentConfig=F},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PDFDataTransportStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(168);class c{constructor(S,v){let{length:M,initialData:x,progressiveDone:T=!1,contentDispositionFilename:d=null,disableRange:a=!1,disableStream:i=!1}=S;if((0,e.assert)(v,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=T,this._contentDispositionFilename=d,(x==null?void 0:x.length)>0){const f=x instanceof Uint8Array&&x.byteLength===x.buffer.byteLength?x.buffer:new Uint8Array(x).buffer;this._queuedChunks.push(f)}this._pdfDataRangeTransport=v,this._isStreamingSupported=!i,this._isRangeSupported=!a,this._contentLength=M,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((f,E)=>{this._onReceiveData({begin:f,chunk:E})}),this._pdfDataRangeTransport.addProgressListener((f,E)=>{this._onProgress({loaded:f,total:E})}),this._pdfDataRangeTransport.addProgressiveReadListener(f=>{this._onReceiveData({chunk:f})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(S){let{begin:v,chunk:M}=S;const x=M instanceof Uint8Array&&M.byteLength===M.buffer.byteLength?M.buffer:new Uint8Array(M).buffer;if(v===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(x):this._queuedChunks.push(x);else{const T=this._rangeReaders.some(function(d){return d._begin!==v?!1:(d._enqueue(x),!0)});(0,e.assert)(T,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var S;return((S=this._fullRequestReader)==null?void 0:S._loaded)??0}_onProgress(S){var v,M,x,T;S.total===void 0?(M=(v=this._rangeReaders[0])==null?void 0:v.onProgress)==null||M.call(v,{loaded:S.loaded}):(T=(x=this._fullRequestReader)==null?void 0:x.onProgress)==null||T.call(x,{loaded:S.loaded,total:S.total})}_onProgressiveDone(){var S;(S=this._fullRequestReader)==null||S.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(S){const v=this._rangeReaders.indexOf(S);v>=0&&this._rangeReaders.splice(v,1)}getFullReader(){(0,e.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const S=this._queuedChunks;return this._queuedChunks=null,new b(this,S,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(S,v){if(v<=this._progressiveDataLength)return null;const M=new F(this,S,v);return this._pdfDataRangeTransport.requestDataRange(S,v),this._rangeReaders.push(M),M}cancelAllRequests(S){var v;(v=this._fullRequestReader)==null||v.cancel(S);for(const M of this._rangeReaders.slice(0))M.cancel(S);this._pdfDataRangeTransport.abort()}}l.PDFDataTransportStream=c;class b{constructor(S,v){let M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=S,this._done=M||!1,this._filename=(0,n.isPdfFile)(x)?x:null,this._queuedChunks=v||[],this._loaded=0;for(const T of this._queuedChunks)this._loaded+=T.byteLength;this._requests=[],this._headersReady=Promise.resolve(),S._fullRequestReader=this,this.onProgress=null}_enqueue(S){this._done||(this._requests.length>0?this._requests.shift().resolve({value:S,done:!1}):this._queuedChunks.push(S),this._loaded+=S.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const S=new e.PromiseCapability;return this._requests.push(S),S.promise}cancel(S){this._done=!0;for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class F{constructor(S,v,M){this._stream=S,this._begin=v,this._end=M,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(S){if(!this._done){if(this._requests.length===0)this._queuedChunk=S;else{this._requests.shift().resolve({value:S,done:!1});for(const M of this._requests)M.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const v=this._queuedChunk;return this._queuedChunk=null,{value:v,done:!1}}if(this._done)return{value:void 0,done:!0};const S=new e.PromiseCapability;return this._requests.push(S),S.promise}cancel(S){this._done=!0;for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PDFFetchStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var e=t(1),n=t(182);function c(M,x,T){return{method:"GET",headers:M,signal:T.signal,mode:"cors",credentials:x?"include":"same-origin",redirect:"follow"}}function b(M){const x=new Headers;for(const T in M){const d=M[T];d!==void 0&&x.append(T,d)}return x}function F(M){return M instanceof Uint8Array?M.buffer:M instanceof ArrayBuffer?M:((0,e.warn)(`getArrayBuffer - unexpected data format: ${M}`),new Uint8Array(M).buffer)}class C{constructor(x){this.source=x,this.isHttp=/^https?:/i.test(x.url),this.httpHeaders=this.isHttp&&x.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var x;return((x=this._fullRequestReader)==null?void 0:x._loaded)??0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new S(this),this._fullRequestReader}getRangeReader(x,T){if(T<=this._progressiveDataLength)return null;const d=new v(this,x,T);return this._rangeRequestReaders.push(d),d}cancelAllRequests(x){var T;(T=this._fullRequestReader)==null||T.cancel(x);for(const d of this._rangeRequestReaders.slice(0))d.cancel(x)}}l.PDFFetchStream=C;class S{constructor(x){this._stream=x,this._reader=null,this._loaded=0,this._filename=null;const T=x.source;this._withCredentials=T.withCredentials||!1,this._contentLength=T.length,this._headersCapability=new e.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=b(this._stream.httpHeaders);const d=T.url;fetch(d,c(this._headers,this._withCredentials,this._abortController)).then(a=>{if(!(0,n.validateResponseStatus)(a.status))throw(0,n.createResponseStatusError)(a.status,d);this._reader=a.body.getReader(),this._headersCapability.resolve();const i=O=>a.headers.get(O),{allowRangeRequests:f,suggestedLength:E}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=f,this._contentLength=E||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new e.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var d;await this._headersCapability.promise;const{value:x,done:T}=await this._reader.read();return T?{value:x,done:T}:(this._loaded+=x.byteLength,(d=this.onProgress)==null||d.call(this,{loaded:this._loaded,total:this._contentLength}),{value:F(x),done:!1})}cancel(x){var T;(T=this._reader)==null||T.cancel(x),this._abortController.abort()}}class v{constructor(x,T,d){this._stream=x,this._reader=null,this._loaded=0;const a=x.source;this._withCredentials=a.withCredentials||!1,this._readCapability=new e.PromiseCapability,this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController,this._headers=b(this._stream.httpHeaders),this._headers.append("Range",`bytes=${T}-${d-1}`);const i=a.url;fetch(i,c(this._headers,this._withCredentials,this._abortController)).then(f=>{if(!(0,n.validateResponseStatus)(f.status))throw(0,n.createResponseStatusError)(f.status,i);this._readCapability.resolve(),this._reader=f.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var d;await this._readCapability.promise;const{value:x,done:T}=await this._reader.read();return T?{value:x,done:T}:(this._loaded+=x.byteLength,(d=this.onProgress)==null||d.call(this,{loaded:this._loaded}),{value:F(x),done:!1})}cancel(x){var T;(T=this._reader)==null||T.cancel(x),this._abortController.abort()}}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createResponseStatusError=C,l.extractFilenameFromHeader=F,l.validateRangeRequestCapabilities=b,l.validateResponseStatus=S;var e=t(1),n=t(183),c=t(168);function b(v){let{getResponseHeader:M,isHttp:x,rangeChunkSize:T,disableRange:d}=v;const a={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(M("Content-Length"),10);return!Number.isInteger(i)||(a.suggestedLength=i,i<=2*T)||d||!x||M("Accept-Ranges")!=="bytes"||(M("Content-Encoding")||"identity")!=="identity"||(a.allowRangeRequests=!0),a}function F(v){const M=v("Content-Disposition");if(M){let x=(0,n.getFilenameFromContentDispositionHeader)(M);if(x.includes("%"))try{x=decodeURIComponent(x)}catch{}if((0,c.isPdfFile)(x))return x}return null}function C(v,M){return v===404||v===0&&M.startsWith("file:")?new e.MissingPDFException('Missing PDF "'+M+'".'):new e.UnexpectedResponseException(`Unexpected server response (${v}) while retrieving PDF "${M}".`,v)}function S(v){return v===200||v===206}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getFilenameFromContentDispositionHeader=n,t(89),t(149);var e=t(1);function n(c){let b=!0,F=C("filename\\*","i").exec(c);if(F){F=F[1];let a=x(F);return a=unescape(a),a=T(a),a=d(a),v(a)}if(F=M(c),F){const a=d(F);return v(a)}if(F=C("filename","i").exec(c),F){F=F[1];let a=x(F);return a=d(a),v(a)}function C(a,i){return new RegExp("(?:^|;)\\s*"+a+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',i)}function S(a,i){if(a){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const f=new TextDecoder(a,{fatal:!0}),E=(0,e.stringToBytes)(i);i=f.decode(E),b=!1}catch{}}return i}function v(a){return b&&/[\x80-\xff]/.test(a)&&(a=S("utf-8",a),b&&(a=S("iso-8859-1",a))),a}function M(a){const i=[];let f;const E=C("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=E.exec(a))!==null;){let[,R,u,m]=f;if(R=parseInt(R,10),R in i){if(R===0)break;continue}i[R]=[u,m]}const O=[];for(let R=0;R<i.length&&R in i;++R){let[u,m]=i[R];m=x(m),u&&(m=unescape(m),R===0&&(m=T(m))),O.push(m)}return O.join("")}function x(a){if(a.startsWith('"')){const i=a.slice(1).split('\\"');for(let f=0;f<i.length;++f){const E=i[f].indexOf('"');E!==-1&&(i[f]=i[f].slice(0,E),i.length=f+1),i[f]=i[f].replaceAll(/\\(.)/g,"$1")}a=i.join('"')}return a}function T(a){const i=a.indexOf("'");if(i===-1)return a;const f=a.slice(0,i),O=a.slice(i+1).replace(/^[^']*'/,"");return S(f,O)}function d(a){return!a.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(a)?a:a.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(i,f,E,O){if(E==="q"||E==="Q")return O=O.replaceAll("_"," "),O=O.replaceAll(/=([0-9a-fA-F]{2})/g,function(R,u){return String.fromCharCode(parseInt(u,16))}),S(f,O);try{O=atob(O)}catch{}return S(f,O)})}return""}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PDFNetworkStream=void 0,t(89);var e=t(1),n=t(182);const c=200,b=206;function F(x){const T=x.response;return typeof T!="string"?T:(0,e.stringToBytes)(T).buffer}class C{constructor(T){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=T,this.isHttp=/^https?:/i.test(T),this.httpHeaders=this.isHttp&&d.httpHeaders||Object.create(null),this.withCredentials=d.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(T,d,a){const i={begin:T,end:d};for(const f in a)i[f]=a[f];return this.request(i)}requestFull(T){return this.request(T)}request(T){const d=new XMLHttpRequest,a=this.currXhrId++,i=this.pendingRequests[a]={xhr:d};d.open("GET",this.url),d.withCredentials=this.withCredentials;for(const f in this.httpHeaders){const E=this.httpHeaders[f];E!==void 0&&d.setRequestHeader(f,E)}return this.isHttp&&"begin"in T&&"end"in T?(d.setRequestHeader("Range",`bytes=${T.begin}-${T.end-1}`),i.expectedStatus=b):i.expectedStatus=c,d.responseType="arraybuffer",T.onError&&(d.onerror=function(f){T.onError(d.status)}),d.onreadystatechange=this.onStateChange.bind(this,a),d.onprogress=this.onProgress.bind(this,a),i.onHeadersReceived=T.onHeadersReceived,i.onDone=T.onDone,i.onError=T.onError,i.onProgress=T.onProgress,d.send(null),a}onProgress(T,d){var i;const a=this.pendingRequests[T];a&&((i=a.onProgress)==null||i.call(a,d))}onStateChange(T,d){var R,u,m;const a=this.pendingRequests[T];if(!a)return;const i=a.xhr;if(i.readyState>=2&&a.onHeadersReceived&&(a.onHeadersReceived(),delete a.onHeadersReceived),i.readyState!==4||!(T in this.pendingRequests))return;if(delete this.pendingRequests[T],i.status===0&&this.isHttp){(R=a.onError)==null||R.call(a,i.status);return}const f=i.status||c;if(!(f===c&&a.expectedStatus===b)&&f!==a.expectedStatus){(u=a.onError)==null||u.call(a,i.status);return}const O=F(i);if(f===b){const L=i.getResponseHeader("Content-Range"),w=/bytes (\d+)-(\d+)\/(\d+)/.exec(L);a.onDone({begin:parseInt(w[1],10),chunk:O})}else O?a.onDone({begin:0,chunk:O}):(m=a.onError)==null||m.call(a,i.status)}getRequestXhr(T){return this.pendingRequests[T].xhr}isPendingRequest(T){return T in this.pendingRequests}abortRequest(T){const d=this.pendingRequests[T].xhr;delete this.pendingRequests[T],d.abort()}}class S{constructor(T){this._source=T,this._manager=new C(T.url,{httpHeaders:T.httpHeaders,withCredentials:T.withCredentials}),this._rangeChunkSize=T.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(T){const d=this._rangeRequestReaders.indexOf(T);d>=0&&this._rangeRequestReaders.splice(d,1)}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new v(this._manager,this._source),this._fullRequestReader}getRangeReader(T,d){const a=new M(this._manager,T,d);return a.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(a),a}cancelAllRequests(T){var d;(d=this._fullRequestReader)==null||d.cancel(T);for(const a of this._rangeRequestReaders.slice(0))a.cancel(T)}}l.PDFNetworkStream=S;class v{constructor(T,d){this._manager=T;const a={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=d.url,this._fullRequestId=T.requestFull(a),this._headersReceivedCapability=new e.PromiseCapability,this._disableRange=d.disableRange||!1,this._contentLength=d.length,this._rangeChunkSize=d.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const T=this._fullRequestId,d=this._manager.getRequestXhr(T),a=E=>d.getResponseHeader(E),{allowRangeRequests:i,suggestedLength:f}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=f||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(a),this._isRangeSupported&&this._manager.abortRequest(T),this._headersReceivedCapability.resolve()}_onDone(T){if(T&&(this._requests.length>0?this._requests.shift().resolve({value:T.chunk,done:!1}):this._cachedChunks.push(T.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(T){this._storedError=(0,n.createResponseStatusError)(T,this._url),this._headersReceivedCapability.reject(this._storedError);for(const d of this._requests)d.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(T){var d;(d=this.onProgress)==null||d.call(this,{loaded:T.loaded,total:T.lengthComputable?T.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const T=new e.PromiseCapability;return this._requests.push(T),T.promise}cancel(T){this._done=!0,this._headersReceivedCapability.reject(T);for(const d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class M{constructor(T,d,a){this._manager=T;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=T.url,this._requestId=T.requestRange(d,a,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var T;(T=this.onClosed)==null||T.call(this,this)}_onDone(T){const d=T.chunk;this._requests.length>0?this._requests.shift().resolve({value:d,done:!1}):this._queuedChunk=d,this._done=!0;for(const a of this._requests)a.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(T){this._storedError=(0,n.createResponseStatusError)(T,this._url);for(const d of this._requests)d.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(T){var d;this.isStreamingSupported||(d=this.onProgress)==null||d.call(this,{loaded:T.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const d=this._queuedChunk;return this._queuedChunk=null,{value:d,done:!1}}if(this._done)return{value:void 0,done:!0};const T=new e.PromiseCapability;return this._requests.push(T),T.promise}cancel(T){this._done=!0;for(const d of this._requests)d.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PDFNodeStream=void 0,t(89),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var e=t(1),n=t(182);const c=/^file:\/\/\/[a-zA-Z]:\//;function b(a){const i=require$$6,f=i.parse(a);return f.protocol==="file:"||f.host?f:/^[a-z]:[/\\]/i.test(a)?i.parse(`file:///${a}`):(f.host||(f.protocol="file:"),f)}class F{constructor(i){this.source=i,this.url=b(i.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&i.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var i;return((i=this._fullRequestReader)==null?void 0:i._loaded)??0}getFullReader(){return(0,e.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new T(this):new M(this),this._fullRequestReader}getRangeReader(i,f){if(f<=this._progressiveDataLength)return null;const E=this.isFsUrl?new d(this,i,f):new x(this,i,f);return this._rangeRequestReaders.push(E),E}cancelAllRequests(i){var f;(f=this._fullRequestReader)==null||f.cancel(i);for(const E of this._rangeRequestReaders.slice(0))E.cancel(i)}}l.PDFNodeStream=F;class C{constructor(i){this._url=i.url,this._done=!1,this._storedError=null,this.onProgress=null;const f=i.source;this._contentLength=f.length,this._loaded=0,this._filename=null,this._disableRange=f.disableRange||!1,this._rangeChunkSize=f.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!f.disableStream,this._isRangeSupported=!f.disableRange,this._readableStream=null,this._readCapability=new e.PromiseCapability,this._headersCapability=new e.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(){var E;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=i.length,(E=this.onProgress)==null||E.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(i).buffer,done:!1})}cancel(i){if(!this._readableStream){this._error(i);return}this._readableStream.destroy(i)}_error(i){this._storedError=i,this._readCapability.resolve()}_setReadableStream(i){this._readableStream=i,i.on("readable",()=>{this._readCapability.resolve()}),i.on("end",()=>{i.destroy(),this._done=!0,this._readCapability.resolve()}),i.on("error",f=>{this._error(f)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new e.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class S{constructor(i){this._url=i.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new e.PromiseCapability;const f=i.source;this._isStreamingSupported=!f.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var E;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=new e.PromiseCapability,this.read()):(this._loaded+=i.length,(E=this.onProgress)==null||E.call(this,{loaded:this._loaded}),{value:new Uint8Array(i).buffer,done:!1})}cancel(i){if(!this._readableStream){this._error(i);return}this._readableStream.destroy(i)}_error(i){this._storedError=i,this._readCapability.resolve()}_setReadableStream(i){this._readableStream=i,i.on("readable",()=>{this._readCapability.resolve()}),i.on("end",()=>{i.destroy(),this._done=!0,this._readCapability.resolve()}),i.on("error",f=>{this._error(f)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function v(a,i){return{protocol:a.protocol,auth:a.auth,host:a.hostname,port:a.port,path:a.path,method:"GET",headers:i}}class M extends C{constructor(i){super(i);const f=E=>{if(E.statusCode===404){const m=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=m,this._headersCapability.reject(m);return}this._headersCapability.resolve(),this._setReadableStream(E);const O=m=>this._readableStream.headers[m.toLowerCase()],{allowRangeRequests:R,suggestedLength:u}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:O,isHttp:i.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=R,this._contentLength=u||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(O)};if(this._request=null,this._url.protocol==="http:"){const E=require$$6;this._request=E.request(v(this._url,i.httpHeaders),f)}else{const E=require$$6;this._request=E.request(v(this._url,i.httpHeaders),f)}this._request.on("error",E=>{this._storedError=E,this._headersCapability.reject(E)}),this._request.end()}}class x extends S{constructor(i,f,E){super(i),this._httpHeaders={};for(const R in i.httpHeaders){const u=i.httpHeaders[R];u!==void 0&&(this._httpHeaders[R]=u)}this._httpHeaders.Range=`bytes=${f}-${E-1}`;const O=R=>{if(R.statusCode===404){const u=new e.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=u;return}this._setReadableStream(R)};if(this._request=null,this._url.protocol==="http:"){const R=require$$6;this._request=R.request(v(this._url,this._httpHeaders),O)}else{const R=require$$6;this._request=R.request(v(this._url,this._httpHeaders),O)}this._request.on("error",R=>{this._storedError=R}),this._request.end()}}class T extends C{constructor(i){super(i);let f=decodeURIComponent(this._url.path);c.test(this._url.href)&&(f=f.replace(/^\//,""));const E=require$$6;E.lstat(f,(O,R)=>{if(O){O.code==="ENOENT"&&(O=new e.MissingPDFException(`Missing PDF "${f}".`)),this._storedError=O,this._headersCapability.reject(O);return}this._contentLength=R.size,this._setReadableStream(E.createReadStream(f)),this._headersCapability.resolve()})}}class d extends S{constructor(i,f,E){super(i);let O=decodeURIComponent(this._url.path);c.test(this._url.href)&&(O=O.replace(/^\//,""));const R=require$$6;this._setReadableStream(R.createReadStream(O,{start:f,end:E-1}))}}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SVGGraphics=void 0,t(84),t(86),t(87),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(2),t(89),t(187);var e=t(168),n=t(1);const c={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},b="http://www.w3.org/XML/1998/namespace",F="http://www.w3.org/1999/xlink",C=["butt","round","square"],S=["miter","round","bevel"],v=function(R){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!m)return URL.createObjectURL(new Blob([R],{type:u}));const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let w=`data:${u};base64,`;for(let y=0,N=R.length;y<N;y+=3){const D=R[y]&255,V=R[y+1]&255,K=R[y+2]&255,U=D>>2,_=(D&3)<<4|V>>4,nt=y+1<N?(V&15)<<2|K>>6:64,rt=y+2<N?K&63:64;w+=L[U]+L[_]+L[nt]+L[rt]}return w},M=function(){const R=new Uint8Array([137,80,78,71,13,10,26,10]),u=12,m=new Int32Array(256);for(let K=0;K<256;K++){let U=K;for(let _=0;_<8;_++)U=U&1?3988292384^U>>1&2147483647:U>>1&2147483647;m[K]=U}function L(K,U,_){let nt=-1;for(let rt=U;rt<_;rt++){const Y=(nt^K[rt])&255,st=m[Y];nt=nt>>>8^st}return nt^-1}function w(K,U,_,nt){let rt=nt;const Y=U.length;_[rt]=Y>>24&255,_[rt+1]=Y>>16&255,_[rt+2]=Y>>8&255,_[rt+3]=Y&255,rt+=4,_[rt]=K.charCodeAt(0)&255,_[rt+1]=K.charCodeAt(1)&255,_[rt+2]=K.charCodeAt(2)&255,_[rt+3]=K.charCodeAt(3)&255,rt+=4,_.set(U,rt),rt+=U.length;const st=L(_,nt+4,rt);_[rt]=st>>24&255,_[rt+1]=st>>16&255,_[rt+2]=st>>8&255,_[rt+3]=st&255}function y(K,U,_){let nt=1,rt=0;for(let Y=U;Y<_;++Y)nt=(nt+(K[Y]&255))%65521,rt=(rt+nt)%65521;return rt<<16|nt}function N(K){if(!n.isNodeJS)return D(K);try{const U=parseInt(process.versions.node)>=8?K:Buffer.from(K),_=require$$6.deflateSync(U,{level:9});return _ instanceof Uint8Array?_:new Uint8Array(_)}catch(U){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+U)}return D(K)}function D(K){let U=K.length;const _=65535,nt=Math.ceil(U/_),rt=new Uint8Array(2+U+nt*5+4);let Y=0;rt[Y++]=120,rt[Y++]=156;let st=0;for(;U>_;)rt[Y++]=0,rt[Y++]=255,rt[Y++]=255,rt[Y++]=0,rt[Y++]=0,rt.set(K.subarray(st,st+_),Y),Y+=_,st+=_,U-=_;rt[Y++]=1,rt[Y++]=U&255,rt[Y++]=U>>8&255,rt[Y++]=~U&65535&255,rt[Y++]=(~U&65535)>>8&255,rt.set(K.subarray(st),Y),Y+=K.length-st;const gt=y(K,0,K.length);return rt[Y++]=gt>>24&255,rt[Y++]=gt>>16&255,rt[Y++]=gt>>8&255,rt[Y++]=gt&255,rt}function V(K,U,_,nt){const rt=K.width,Y=K.height;let st,gt,At;const wt=K.data;switch(U){case n.ImageKind.GRAYSCALE_1BPP:gt=0,st=1,At=rt+7>>3;break;case n.ImageKind.RGB_24BPP:gt=2,st=8,At=rt*3;break;case n.ImageKind.RGBA_32BPP:gt=6,st=8,At=rt*4;break;default:throw new Error("invalid format")}const W=new Uint8Array((1+At)*Y);let h=0,g=0;for(let H=0;H<Y;++H)W[h++]=0,W.set(wt.subarray(g,g+At),h),g+=At,h+=At;if(U===n.ImageKind.GRAYSCALE_1BPP&&nt){h=0;for(let H=0;H<Y;H++){h++;for(let tt=0;tt<At;tt++)W[h++]^=255}}const s=new Uint8Array([rt>>24&255,rt>>16&255,rt>>8&255,rt&255,Y>>24&255,Y>>16&255,Y>>8&255,Y&255,st,gt,0,0,0]),p=N(W),A=R.length+u*3+s.length+p.length,I=new Uint8Array(A);let P=0;return I.set(R,P),P+=R.length,w("IHDR",s,I,P),P+=u+s.length,w("IDATA",p,I,P),P+=u+p.length,w("IEND",new Uint8Array(0),I,P),v(I,"image/png",_)}return function(U,_,nt){const rt=U.kind===void 0?n.ImageKind.GRAYSCALE_1BPP:U.kind;return V(U,rt,_,nt)}}();class x{constructor(){this.fontSizeScale=1,this.fontWeight=c.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=c.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(u,m){this.x=u,this.y=m}}function T(R){let u=[];const m=[];for(const L of R){if(L.fn==="save"){u.push({fnId:92,fn:"group",items:[]}),m.push(u),u=u.at(-1).items;continue}L.fn==="restore"?u=m.pop():u.push(L)}return u}function d(R){if(Number.isInteger(R))return R.toString();const u=R.toFixed(10);let m=u.length-1;if(u[m]!=="0")return u;do m--;while(u[m]==="0");return u.substring(0,u[m]==="."?m:m+1)}function a(R){if(R[4]===0&&R[5]===0){if(R[1]===0&&R[2]===0)return R[0]===1&&R[3]===1?"":`scale(${d(R[0])} ${d(R[3])})`;if(R[0]===R[3]&&R[1]===-R[2]){const u=Math.acos(R[0])*180/Math.PI;return`rotate(${d(u)})`}}else if(R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1)return`translate(${d(R[4])} ${d(R[5])})`;return`matrix(${d(R[0])} ${d(R[1])} ${d(R[2])} ${d(R[3])} ${d(R[4])} ${d(R[5])})`}let i=0,f=0,E=0;class O{constructor(u,m){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,e.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new e.DOMSVGFactory,this.current=new x,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=u,this.objs=m,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!L,this._operatorIdMapping=[];for(const w in n.OPS)this._operatorIdMapping[n.OPS[w]]=w}getObject(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof u=="string"?u.startsWith("g_")?this.commonObjs.get(u):this.objs.get(u):m}save(){this.transformStack.push(this.transformMatrix);const u=this.current;this.extraStack.push(u),this.current=u.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(u){this.save(),this.executeOpTree(u),this.restore()}loadDependencies(u){const m=u.fnArray,L=u.argsArray;for(let w=0,y=m.length;w<y;w++)if(m[w]===n.OPS.dependency)for(const N of L[w]){const D=N.startsWith("g_")?this.commonObjs:this.objs,V=new Promise(K=>{D.get(N,K)});this.current.dependencies.push(V)}return Promise.all(this.current.dependencies)}transform(u,m,L,w,y,N){const D=[u,m,L,w,y,N];this.transformMatrix=n.Util.transform(this.transformMatrix,D),this.tgrp=null}getSVG(u,m){this.viewport=m;const L=this._initialize(m);return this.loadDependencies(u).then(()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(u)),L))}convertOpList(u){const m=this._operatorIdMapping,L=u.argsArray,w=u.fnArray,y=[];for(let N=0,D=w.length;N<D;N++){const V=w[N];y.push({fnId:V,fn:m[V],args:L[N]})}return T(y)}executeOpTree(u){for(const m of u){const L=m.fn,w=m.fnId,y=m.args;switch(w|0){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(y);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(y[0],y[1]);break;case n.OPS.setFont:this.setFont(y);break;case n.OPS.showText:this.showText(y[0]);break;case n.OPS.showSpacedText:this.showText(y[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(y[0],y[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(y[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(y[0]);break;case n.OPS.setHScale:this.setHScale(y[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(y[0],y[1],y[2],y[3],y[4],y[5]);break;case n.OPS.setTextRise:this.setTextRise(y[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(y[0]);break;case n.OPS.setLineWidth:this.setLineWidth(y[0]);break;case n.OPS.setLineJoin:this.setLineJoin(y[0]);break;case n.OPS.setLineCap:this.setLineCap(y[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(y[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(y[0],y[1],y[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(y[0],y[1],y[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(y);break;case n.OPS.setFillColorN:this.setFillColorN(y);break;case n.OPS.shadingFill:this.shadingFill(y[0]);break;case n.OPS.setDash:this.setDash(y[0],y[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(y[0]);break;case n.OPS.setFlatness:this.setFlatness(y[0]);break;case n.OPS.setGState:this.setGState(y[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(y[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(y[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(y[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(y[0],y[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(y[0],y[1],y[2],y[3],y[4],y[5]);break;case n.OPS.constructPath:this.constructPath(y[0],y[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(m.items);break;default:(0,n.warn)(`Unimplemented operator ${L}`);break}}}setWordSpacing(u){this.current.wordSpacing=u}setCharSpacing(u){this.current.charSpacing=u}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(u,m,L,w,y,N){const D=this.current;D.textMatrix=D.lineMatrix=[u,m,L,w,y,N],D.textMatrixScale=Math.hypot(u,m),D.x=D.lineX=0,D.y=D.lineY=0,D.xcoords=[],D.ycoords=[],D.tspan=this.svgFactory.createElement("svg:tspan"),D.tspan.setAttributeNS(null,"font-family",D.fontFamily),D.tspan.setAttributeNS(null,"font-size",`${d(D.fontSize)}px`),D.tspan.setAttributeNS(null,"y",d(-D.y)),D.txtElement=this.svgFactory.createElement("svg:text"),D.txtElement.append(D.tspan)}beginText(){const u=this.current;u.x=u.lineX=0,u.y=u.lineY=0,u.textMatrix=n.IDENTITY_MATRIX,u.lineMatrix=n.IDENTITY_MATRIX,u.textMatrixScale=1,u.tspan=this.svgFactory.createElement("svg:tspan"),u.txtElement=this.svgFactory.createElement("svg:text"),u.txtgrp=this.svgFactory.createElement("svg:g"),u.xcoords=[],u.ycoords=[]}moveText(u,m){const L=this.current;L.x=L.lineX+=u,L.y=L.lineY+=m,L.xcoords=[],L.ycoords=[],L.tspan=this.svgFactory.createElement("svg:tspan"),L.tspan.setAttributeNS(null,"font-family",L.fontFamily),L.tspan.setAttributeNS(null,"font-size",`${d(L.fontSize)}px`),L.tspan.setAttributeNS(null,"y",d(-L.y))}showText(u){const m=this.current,L=m.font,w=m.fontSize;if(w===0)return;const y=m.fontSizeScale,N=m.charSpacing,D=m.wordSpacing,V=m.fontDirection,K=m.textHScale*V,U=L.vertical,_=U?1:-1,nt=L.defaultVMetrics,rt=w*m.fontMatrix[0];let Y=0;for(const At of u){if(At===null){Y+=V*D;continue}else if(typeof At=="number"){Y+=_*At*w/1e3;continue}const wt=(At.isSpace?D:0)+N,W=At.fontChar;let h,g,s=At.width;if(U){let A;const I=At.vmetric||nt;A=At.vmetric?I[1]:s*.5,A=-A*rt;const P=I[2]*rt;s=I?-I[0]:s,h=A/y,g=(Y+P)/y}else h=Y/y,g=0;(At.isInFont||L.missingFile)&&(m.xcoords.push(m.x+h),U&&m.ycoords.push(-m.y+g),m.tspan.textContent+=W);const p=U?s*rt-wt*V:s*rt+wt*V;Y+=p}m.tspan.setAttributeNS(null,"x",m.xcoords.map(d).join(" ")),U?m.tspan.setAttributeNS(null,"y",m.ycoords.map(d).join(" ")):m.tspan.setAttributeNS(null,"y",d(-m.y)),U?m.y-=Y:m.x+=Y*K,m.tspan.setAttributeNS(null,"font-family",m.fontFamily),m.tspan.setAttributeNS(null,"font-size",`${d(m.fontSize)}px`),m.fontStyle!==c.fontStyle&&m.tspan.setAttributeNS(null,"font-style",m.fontStyle),m.fontWeight!==c.fontWeight&&m.tspan.setAttributeNS(null,"font-weight",m.fontWeight);const st=m.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(st===n.TextRenderingMode.FILL||st===n.TextRenderingMode.FILL_STROKE?(m.fillColor!==c.fillColor&&m.tspan.setAttributeNS(null,"fill",m.fillColor),m.fillAlpha<1&&m.tspan.setAttributeNS(null,"fill-opacity",m.fillAlpha)):m.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?m.tspan.setAttributeNS(null,"fill","transparent"):m.tspan.setAttributeNS(null,"fill","none"),st===n.TextRenderingMode.STROKE||st===n.TextRenderingMode.FILL_STROKE){const At=1/(m.textMatrixScale||1);this._setStrokeAttributes(m.tspan,At)}let gt=m.textMatrix;m.textRise!==0&&(gt=gt.slice(),gt[5]+=m.textRise),m.txtElement.setAttributeNS(null,"transform",`${a(gt)} scale(${d(K)}, -1)`),m.txtElement.setAttributeNS(b,"xml:space","preserve"),m.txtElement.append(m.tspan),m.txtgrp.append(m.txtElement),this._ensureTransformGroup().append(m.txtElement)}setLeadingMoveText(u,m){this.setLeading(-m),this.moveText(u,m)}addFontStyle(u){if(!u.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));const m=v(u.data,u.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${u.loadedName}"; src: url(${m}); }
  5. `}setFont(u){const m=this.current,L=this.commonObjs.get(u[0]);let w=u[1];m.font=L,this.embedFonts&&!L.missingFile&&!this.embeddedFonts[L.loadedName]&&(this.addFontStyle(L),this.embeddedFonts[L.loadedName]=L),m.fontMatrix=L.fontMatrix||n.FONT_IDENTITY_MATRIX;let y="normal";L.black?y="900":L.bold&&(y="bold");const N=L.italic?"italic":"normal";w<0?(w=-w,m.fontDirection=-1):m.fontDirection=1,m.fontSize=w,m.fontFamily=L.loadedName,m.fontWeight=y,m.fontStyle=N,m.tspan=this.svgFactory.createElement("svg:tspan"),m.tspan.setAttributeNS(null,"y",d(-m.y)),m.xcoords=[],m.ycoords=[]}endText(){var m;const u=this.current;u.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&((m=u.txtElement)!=null&&m.hasChildNodes())&&(u.element=u.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(u){u>0&&(this.current.lineWidth=u)}setLineCap(u){this.current.lineCap=C[u]}setLineJoin(u){this.current.lineJoin=S[u]}setMiterLimit(u){this.current.miterLimit=u}setStrokeAlpha(u){this.current.strokeAlpha=u}setStrokeRGBColor(u,m,L){this.current.strokeColor=n.Util.makeHexColor(u,m,L)}setFillAlpha(u){this.current.fillAlpha=u}setFillRGBColor(u,m,L){this.current.fillColor=n.Util.makeHexColor(u,m,L),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(u){this.current.strokeColor=this._makeColorN_Pattern(u)}setFillColorN(u){this.current.fillColor=this._makeColorN_Pattern(u)}shadingFill(u){const{width:m,height:L}=this.viewport,w=n.Util.inverseTransform(this.transformMatrix),[y,N,D,V]=n.Util.getAxialAlignedBoundingBox([0,0,m,L],w),K=this.svgFactory.createElement("svg:rect");K.setAttributeNS(null,"x",y),K.setAttributeNS(null,"y",N),K.setAttributeNS(null,"width",D-y),K.setAttributeNS(null,"height",V-N),K.setAttributeNS(null,"fill",this._makeShadingPattern(u)),this.current.fillAlpha<1&&K.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(K)}_makeColorN_Pattern(u){return u[0]==="TilingPattern"?this._makeTilingPattern(u):this._makeShadingPattern(u)}_makeTilingPattern(u){const m=u[1],L=u[2],w=u[3]||n.IDENTITY_MATRIX,[y,N,D,V]=u[4],K=u[5],U=u[6],_=u[7],nt=`shading${E++}`,[rt,Y,st,gt]=n.Util.normalizeRect([...n.Util.applyTransform([y,N],w),...n.Util.applyTransform([D,V],w)]),[At,wt]=n.Util.singularValueDecompose2dScale(w),W=K*At,h=U*wt,g=this.svgFactory.createElement("svg:pattern");g.setAttributeNS(null,"id",nt),g.setAttributeNS(null,"patternUnits","userSpaceOnUse"),g.setAttributeNS(null,"width",W),g.setAttributeNS(null,"height",h),g.setAttributeNS(null,"x",`${rt}`),g.setAttributeNS(null,"y",`${Y}`);const s=this.svg,p=this.transformMatrix,A=this.current.fillColor,I=this.current.strokeColor,P=this.svgFactory.create(st-rt,gt-Y);if(this.svg=P,this.transformMatrix=w,_===2){const H=n.Util.makeHexColor(...m);this.current.fillColor=H,this.current.strokeColor=H}return this.executeOpTree(this.convertOpList(L)),this.svg=s,this.transformMatrix=p,this.current.fillColor=A,this.current.strokeColor=I,g.append(P.childNodes[0]),this.defs.append(g),`url(#${nt})`}_makeShadingPattern(u){switch(typeof u=="string"&&(u=this.objs.get(u)),u[0]){case"RadialAxial":const m=`shading${E++}`,L=u[3];let w;switch(u[1]){case"axial":const y=u[4],N=u[5];w=this.svgFactory.createElement("svg:linearGradient"),w.setAttributeNS(null,"id",m),w.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),w.setAttributeNS(null,"x1",y[0]),w.setAttributeNS(null,"y1",y[1]),w.setAttributeNS(null,"x2",N[0]),w.setAttributeNS(null,"y2",N[1]);break;case"radial":const D=u[4],V=u[5],K=u[6],U=u[7];w=this.svgFactory.createElement("svg:radialGradient"),w.setAttributeNS(null,"id",m),w.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),w.setAttributeNS(null,"cx",V[0]),w.setAttributeNS(null,"cy",V[1]),w.setAttributeNS(null,"r",U),w.setAttributeNS(null,"fx",D[0]),w.setAttributeNS(null,"fy",D[1]),w.setAttributeNS(null,"fr",K);break;default:throw new Error(`Unknown RadialAxial type: ${u[1]}`)}for(const y of L){const N=this.svgFactory.createElement("svg:stop");N.setAttributeNS(null,"offset",y[0]),N.setAttributeNS(null,"stop-color",y[1]),w.append(N)}return this.defs.append(w),`url(#${m})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${u[0]}`)}}setDash(u,m){this.current.dashArray=u,this.current.dashPhase=m}constructPath(u,m){const L=this.current;let w=L.x,y=L.y,N=[],D=0;for(const V of u)switch(V|0){case n.OPS.rectangle:w=m[D++],y=m[D++];const K=m[D++],U=m[D++],_=w+K,nt=y+U;N.push("M",d(w),d(y),"L",d(_),d(y),"L",d(_),d(nt),"L",d(w),d(nt),"Z");break;case n.OPS.moveTo:w=m[D++],y=m[D++],N.push("M",d(w),d(y));break;case n.OPS.lineTo:w=m[D++],y=m[D++],N.push("L",d(w),d(y));break;case n.OPS.curveTo:w=m[D+4],y=m[D+5],N.push("C",d(m[D]),d(m[D+1]),d(m[D+2]),d(m[D+3]),d(w),d(y)),D+=6;break;case n.OPS.curveTo2:N.push("C",d(w),d(y),d(m[D]),d(m[D+1]),d(m[D+2]),d(m[D+3])),w=m[D+2],y=m[D+3],D+=4;break;case n.OPS.curveTo3:w=m[D+2],y=m[D+3],N.push("C",d(m[D]),d(m[D+1]),d(w),d(y),d(w),d(y)),D+=4;break;case n.OPS.closePath:N.push("Z");break}N=N.join(" "),L.path&&u.length>0&&u[0]!==n.OPS.rectangle&&u[0]!==n.OPS.moveTo?N=L.path.getAttributeNS(null,"d")+N:(L.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(L.path)),L.path.setAttributeNS(null,"d",N),L.path.setAttributeNS(null,"fill","none"),L.element=L.path,L.setCurrentPoint(w,y)}endPath(){const u=this.current;if(u.path=null,!this.pendingClip)return;if(!u.element){this.pendingClip=null;return}const m=`clippath${i++}`,L=this.svgFactory.createElement("svg:clipPath");L.setAttributeNS(null,"id",m),L.setAttributeNS(null,"transform",a(this.transformMatrix));const w=u.element.cloneNode(!0);if(this.pendingClip==="evenodd"?w.setAttributeNS(null,"clip-rule","evenodd"):w.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,L.append(w),this.defs.append(L),u.activeClipUrl){u.clipGroup=null;for(const y of this.extraStack)y.clipGroup=null;L.setAttributeNS(null,"clip-path",u.activeClipUrl)}u.activeClipUrl=`url(#${m})`,this.tgrp=null}clip(u){this.pendingClip=u}closePath(){const u=this.current;if(u.path){const m=`${u.path.getAttributeNS(null,"d")}Z`;u.path.setAttributeNS(null,"d",m)}}setLeading(u){this.current.leading=-u}setTextRise(u){this.current.textRise=u}setTextRenderingMode(u){this.current.textRenderingMode=u}setHScale(u){this.current.textHScale=u/100}setRenderingIntent(u){}setFlatness(u){}setGState(u){for(const[m,L]of u)switch(m){case"LW":this.setLineWidth(L);break;case"LC":this.setLineCap(L);break;case"LJ":this.setLineJoin(L);break;case"ML":this.setMiterLimit(L);break;case"D":this.setDash(L[0],L[1]);break;case"RI":this.setRenderingIntent(L);break;case"FL":this.setFlatness(L);break;case"Font":this.setFont(L);break;case"CA":this.setStrokeAlpha(L);break;case"ca":this.setFillAlpha(L);break;default:(0,n.warn)(`Unimplemented graphic state operator ${m}`);break}}fill(){const u=this.current;u.element&&(u.element.setAttributeNS(null,"fill",u.fillColor),u.element.setAttributeNS(null,"fill-opacity",u.fillAlpha),this.endPath())}stroke(){const u=this.current;u.element&&(this._setStrokeAttributes(u.element),u.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(u){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const L=this.current;let w=L.dashArray;m!==1&&w.length>0&&(w=w.map(function(y){return m*y})),u.setAttributeNS(null,"stroke",L.strokeColor),u.setAttributeNS(null,"stroke-opacity",L.strokeAlpha),u.setAttributeNS(null,"stroke-miterlimit",d(L.miterLimit)),u.setAttributeNS(null,"stroke-linecap",L.lineCap),u.setAttributeNS(null,"stroke-linejoin",L.lineJoin),u.setAttributeNS(null,"stroke-width",d(m*L.lineWidth)+"px"),u.setAttributeNS(null,"stroke-dasharray",w.map(d).join(" ")),u.setAttributeNS(null,"stroke-dashoffset",d(m*L.dashPhase)+"px")}eoFill(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var u;(u=this.current.element)==null||u.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const u=this.svgFactory.createElement("svg:rect");u.setAttributeNS(null,"x","0"),u.setAttributeNS(null,"y","0"),u.setAttributeNS(null,"width","1px"),u.setAttributeNS(null,"height","1px"),u.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(u)}paintImageXObject(u){const m=this.getObject(u);if(!m){(0,n.warn)(`Dependent image with object ID ${u} is not ready yet`);return}this.paintInlineImageXObject(m)}paintInlineImageXObject(u,m){const L=u.width,w=u.height,y=M(u,this.forceDataSchema,!!m),N=this.svgFactory.createElement("svg:rect");N.setAttributeNS(null,"x","0"),N.setAttributeNS(null,"y","0"),N.setAttributeNS(null,"width",d(L)),N.setAttributeNS(null,"height",d(w)),this.current.element=N,this.clip("nonzero");const D=this.svgFactory.createElement("svg:image");D.setAttributeNS(F,"xlink:href",y),D.setAttributeNS(null,"x","0"),D.setAttributeNS(null,"y",d(-w)),D.setAttributeNS(null,"width",d(L)+"px"),D.setAttributeNS(null,"height",d(w)+"px"),D.setAttributeNS(null,"transform",`scale(${d(1/L)} ${d(-1/w)})`),m?m.append(D):this._ensureTransformGroup().append(D)}paintImageMaskXObject(u){const m=this.getObject(u.data,u);if(m.bitmap){(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const L=this.current,w=m.width,y=m.height,N=L.fillColor;L.maskId=`mask${f++}`;const D=this.svgFactory.createElement("svg:mask");D.setAttributeNS(null,"id",L.maskId);const V=this.svgFactory.createElement("svg:rect");V.setAttributeNS(null,"x","0"),V.setAttributeNS(null,"y","0"),V.setAttributeNS(null,"width",d(w)),V.setAttributeNS(null,"height",d(y)),V.setAttributeNS(null,"fill",N),V.setAttributeNS(null,"mask",`url(#${L.maskId})`),this.defs.append(D),this._ensureTransformGroup().append(V),this.paintInlineImageXObject(m,D)}paintFormXObjectBegin(u,m){if(Array.isArray(u)&&u.length===6&&this.transform(u[0],u[1],u[2],u[3],u[4],u[5]),m){const L=m[2]-m[0],w=m[3]-m[1],y=this.svgFactory.createElement("svg:rect");y.setAttributeNS(null,"x",m[0]),y.setAttributeNS(null,"y",m[1]),y.setAttributeNS(null,"width",d(L)),y.setAttributeNS(null,"height",d(w)),this.current.element=y,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(u){const m=this.svgFactory.create(u.width,u.height),L=this.svgFactory.createElement("svg:defs");m.append(L),this.defs=L;const w=this.svgFactory.createElement("svg:g");return w.setAttributeNS(null,"transform",a(u.transform)),m.append(w),this.svg=w,m}_ensureClipGroup(){if(!this.current.clipGroup){const u=this.svgFactory.createElement("svg:g");u.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(u),this.current.clipGroup=u}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",a(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}l.SVGGraphics=O},(k,l,t)=>{var e=t(3),n=t(188),c=t(193);e({target:"Array",proto:!0},{group:function(F){var C=arguments.length>1?arguments[1]:void 0;return n(this,F,C)}}),c("group")},(k,l,t)=>{var e=t(99),n=t(14),c=t(13),b=t(40),F=t(18),C=t(64),S=t(189),v=t(108),M=Array,x=n([].push);k.exports=function(T,d,a,i){for(var f=b(T),E=c(f),O=e(d,a),R=S(null),u=C(E),m=0,L,w,y;u>m;m++)y=E[m],w=F(O(y,m,f)),w in R?x(R[w],y):R[w]=[y];if(i&&(L=i(f),L!==M))for(w in R)R[w]=v(L,R[w]);return R}},(k,l,t)=>{var e=t(47),n=t(190),c=t(66),b=t(55),F=t(192),C=t(43),S=t(54),v=">",M="<",x="prototype",T="script",d=S("IE_PROTO"),a=function(){},i=function(u){return M+T+v+u+M+"/"+T+v},f=function(u){u.write(i("")),u.close();var m=u.parentWindow.Object;return u=null,m},E=function(){var u=C("iframe"),m="java"+T+":",L;return u.style.display="none",F.appendChild(u),u.src=String(m),L=u.contentWindow.document,L.open(),L.write(i("document.F=Object")),L.close(),L.F},O,R=function(){try{O=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&O?f(O):E():f(O);for(var u=c.length;u--;)delete R[x][c[u]];return R()};b[d]=!0,k.exports=Object.create||function(m,L){var w;return m!==null?(a[x]=e(m),w=new a,a[x]=null,w[d]=m):w=R(),L===void 0?w:n.f(w,L)}},(k,l,t)=>{var e=t(6),n=t(46),c=t(45),b=t(47),F=t(12),C=t(191);l.f=e&&!n?Object.defineProperties:function(v,M){b(v);for(var x=F(M),T=C(M),d=T.length,a=0,i;d>a;)c.f(v,i=T[a++],x[i]);return v}},(k,l,t)=>{var e=t(59),n=t(66);k.exports=Object.keys||function(b){return e(b,n)}},(k,l,t)=>{var e=t(24);k.exports=e("document","documentElement")},(k,l,t)=>{var e=t(34),n=t(189),c=t(45).f,b=e("unscopables"),F=Array.prototype;F[b]===void 0&&c(F,b,{configurable:!0,value:n(null)}),k.exports=function(C){F[b][C]=!0}},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.XfaText=void 0,t(89);class e{static textContent(c){const b=[],F={items:b,styles:Object.create(null)};function C(S){var x;if(!S)return;let v=null;const M=S.name;if(M==="#text")v=S.value;else if(e.shouldBuildText(M))(x=S==null?void 0:S.attributes)!=null&&x.textContent?v=S.attributes.textContent:S.value&&(v=S.value);else return;if(v!==null&&b.push({str:v}),!!S.children)for(const T of S.children)C(T)}return C(c),F}static shouldBuildText(c){return!(c==="textarea"||c==="input"||c==="option"||c==="select")}}l.XfaText=e},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TextLayerRenderTask=void 0,l.renderTextLayer=a,l.updateTextLayer=i,t(89),t(2);var e=t(1),n=t(168);const c=1e5,b=30,F=.8,C=new Map;function S(f,E){let O;if(E&&e.FeatureTest.isOffscreenCanvasSupported)O=new OffscreenCanvas(f,f).getContext("2d",{alpha:!1});else{const R=document.createElement("canvas");R.width=R.height=f,O=R.getContext("2d",{alpha:!1})}return O}function v(f,E){const O=C.get(f);if(O)return O;const R=S(b,E);R.font=`${b}px ${f}`;const u=R.measureText("");let m=u.fontBoundingBoxAscent,L=Math.abs(u.fontBoundingBoxDescent);if(m){const y=m/(m+L);return C.set(f,y),R.canvas.width=R.canvas.height=0,y}R.strokeStyle="red",R.clearRect(0,0,b,b),R.strokeText("g",0,0);let w=R.getImageData(0,0,b,b).data;L=0;for(let y=w.length-1-3;y>=0;y-=4)if(w[y]>0){L=Math.ceil(y/4/b);break}R.clearRect(0,0,b,b),R.strokeText("A",0,b),w=R.getImageData(0,0,b,b).data,m=0;for(let y=0,N=w.length;y<N;y+=4)if(w[y]>0){m=b-Math.floor(y/4/b);break}if(R.canvas.width=R.canvas.height=0,m){const y=m/(m+L);return C.set(f,y),y}return C.set(f,F),F}function M(f,E,O){const R=document.createElement("span"),u={angle:0,canvasWidth:0,hasText:E.str!=="",hasEOL:E.hasEOL,fontSize:0};f._textDivs.push(R);const m=e.Util.transform(f._transform,E.transform);let L=Math.atan2(m[1],m[0]);const w=O[E.fontName];w.vertical&&(L+=Math.PI/2);const y=Math.hypot(m[2],m[3]),N=y*v(w.fontFamily,f._isOffscreenCanvasSupported);let D,V;L===0?(D=m[4],V=m[5]-N):(D=m[4]+N*Math.sin(L),V=m[5]-N*Math.cos(L));const K="calc(var(--scale-factor)*",U=R.style;f._container===f._rootContainer?(U.left=`${(100*D/f._pageWidth).toFixed(2)}%`,U.top=`${(100*V/f._pageHeight).toFixed(2)}%`):(U.left=`${K}${D.toFixed(2)}px)`,U.top=`${K}${V.toFixed(2)}px)`),U.fontSize=`${K}${y.toFixed(2)}px)`,U.fontFamily=w.fontFamily,u.fontSize=y,R.setAttribute("role","presentation"),R.textContent=E.str,R.dir=E.dir,f._fontInspectorEnabled&&(R.dataset.fontName=E.fontName),L!==0&&(u.angle=L*(180/Math.PI));let _=!1;if(E.str.length>1)_=!0;else if(E.str!==" "&&E.transform[0]!==E.transform[3]){const nt=Math.abs(E.transform[0]),rt=Math.abs(E.transform[3]);nt!==rt&&Math.max(nt,rt)/Math.min(nt,rt)>1.5&&(_=!0)}_&&(u.canvasWidth=w.vertical?E.height:E.width),f._textDivProperties.set(R,u),f._isReadableStream&&f._layoutText(R)}function x(f){const{div:E,scale:O,properties:R,ctx:u,prevFontSize:m,prevFontFamily:L}=f,{style:w}=E;let y="";if(R.canvasWidth!==0&&R.hasText){const{fontFamily:N}=w,{canvasWidth:D,fontSize:V}=R;(m!==V||L!==N)&&(u.font=`${V*O}px ${N}`,f.prevFontSize=V,f.prevFontFamily=N);const{width:K}=u.measureText(E.textContent);K>0&&(y=`scaleX(${D*O/K})`)}R.angle!==0&&(y=`rotate(${R.angle}deg) ${y}`),y.length>0&&(w.transform=y)}function T(f){if(f._canceled)return;const E=f._textDivs,O=f._capability;if(E.length>c){O.resolve();return}if(!f._isReadableStream)for(const u of E)f._layoutText(u);O.resolve()}class d{constructor(E){var U;let{textContentSource:O,container:R,viewport:u,textDivs:m,textDivProperties:L,textContentItemsStr:w,isOffscreenCanvasSupported:y}=E;this._textContentSource=O,this._isReadableStream=O instanceof ReadableStream,this._container=this._rootContainer=R,this._textDivs=m||[],this._textContentItemsStr=w||[],this._isOffscreenCanvasSupported=y,this._fontInspectorEnabled=!!((U=globalThis.FontInspector)!=null&&U.enabled),this._reader=null,this._textDivProperties=L||new WeakMap,this._canceled=!1,this._capability=new e.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:u.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:S(0,y)};const{pageWidth:N,pageHeight:D,pageX:V,pageY:K}=u.rawDims;this._transform=[1,0,0,-1,-V,K+D],this._pageWidth=N,this._pageHeight=D,(0,n.setLayerDimensions)(R,u),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new e.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new e.AbortException("TextLayer task cancelled."))}_processItems(E,O){for(const R of E){if(R.str===void 0){if(R.type==="beginMarkedContentProps"||R.type==="beginMarkedContent"){const u=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),R.id!==null&&this._container.setAttribute("id",`${R.id}`),u.append(this._container)}else R.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(R.str),M(this,R,O)}}_layoutText(E){const O=this._layoutTextParams.properties=this._textDivProperties.get(E);if(this._layoutTextParams.div=E,x(this._layoutTextParams),O.hasText&&this._container.append(E),O.hasEOL){const R=document.createElement("br");R.setAttribute("role","presentation"),this._container.append(R)}}_render(){const E=new e.PromiseCapability;let O=Object.create(null);if(this._isReadableStream){const R=()=>{this._reader.read().then(u=>{let{value:m,done:L}=u;if(L){E.resolve();return}Object.assign(O,m.styles),this._processItems(m.items,O),R()},E.reject)};this._reader=this._textContentSource.getReader(),R()}else if(this._textContentSource){const{items:R,styles:u}=this._textContentSource;this._processItems(R,u),E.resolve()}else throw new Error('No "textContentSource" parameter specified.');E.promise.then(()=>{O=null,T(this)},this._capability.reject)}}l.TextLayerRenderTask=d;function a(f){!f.textContentSource&&(f.textContent||f.textContentStream)&&((0,n.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),f.textContentSource=f.textContent||f.textContentStream);const{container:E,viewport:O}=f,R=getComputedStyle(E),u=R.getPropertyValue("visibility"),m=parseFloat(R.getPropertyValue("--scale-factor"));u==="visible"&&(!m||Math.abs(m-O.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const L=new d(f);return L._render(),L}function i(f){let{container:E,viewport:O,textDivs:R,textDivProperties:u,isOffscreenCanvasSupported:m,mustRotate:L=!0,mustRescale:w=!0}=f;if(L&&(0,n.setLayerDimensions)(E,{rotation:O.rotation}),w){const y=S(0,m),D={prevFontSize:null,prevFontFamily:null,div:null,scale:O.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:y};for(const V of R)D.properties=u.get(V),D.div=V,x(D)}}},(k,l,t)=>{var v,M,x,T,d,a,i,f,E,O,R,en,m,we,w,nn,N,rn;Object.defineProperty(l,"__esModule",{value:!0}),l.AnnotationEditorLayer=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147);var e=t(1),n=t(164),c=t(197),b=t(202),F=t(168),C=t(203);const V=class V{constructor(U){X(this,R);X(this,m);X(this,w);X(this,N);X(this,v,void 0);X(this,M,!1);X(this,x,null);X(this,T,this.pointerup.bind(this));X(this,d,this.pointerdown.bind(this));X(this,a,new Map);X(this,i,!1);X(this,f,!1);X(this,E,!1);X(this,O,void 0);let{uiManager:_,pageIndex:nt,div:rt,accessibilityManager:Y,annotationLayer:st,viewport:gt,l10n:At}=U;const wt=[c.FreeTextEditor,b.InkEditor,C.StampEditor];if(!V._initialized){V._initialized=!0;for(const W of wt)W.initialize(At)}_.registerEditorTypes(wt),at(this,O,_),this.pageIndex=nt,this.div=rt,at(this,v,Y),at(this,x,st),this.viewport=gt,r(this,O).addLayer(this)}get isEmpty(){return r(this,a).size===0}updateToolbar(U){r(this,O).updateToolbar(U)}updateMode(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r(this,O).getMode();j(this,N,rn).call(this),U===e.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),U!==e.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",U===e.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",U===e.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",U===e.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(U){if(!U&&r(this,O).getMode()!==e.AnnotationEditorType.INK)return;if(!U){for(const nt of r(this,a).values())if(nt.isEmpty()){nt.setInBackground();return}}j(this,m,we).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(U){r(this,O).setEditingState(U)}addCommands(U){r(this,O).addCommands(U)}enable(){this.div.style.pointerEvents="auto";const U=new Set;for(const nt of r(this,a).values())nt.enableEditing(),nt.annotationElementId&&U.add(nt.annotationElementId);if(!r(this,x))return;const _=r(this,x).getEditableAnnotations();for(const nt of _){if(nt.hide(),r(this,O).isDeletedAnnotationElement(nt.data.id)||U.has(nt.data.id))continue;const rt=this.deserialize(nt);rt&&(this.addOrRebuild(rt),rt.enableEditing())}}disable(){var _;at(this,E,!0),this.div.style.pointerEvents="none";const U=new Set;for(const nt of r(this,a).values()){if(nt.disableEditing(),!nt.annotationElementId||nt.serialize()!==null){U.add(nt.annotationElementId);continue}(_=this.getEditableAnnotation(nt.annotationElementId))==null||_.show(),nt.remove()}if(r(this,x)){const nt=r(this,x).getEditableAnnotations();for(const rt of nt){const{id:Y}=rt.data;U.has(Y)||r(this,O).isDeletedAnnotationElement(Y)||rt.show()}}j(this,N,rn).call(this),this.isEmpty&&(this.div.hidden=!0),at(this,E,!1)}getEditableAnnotation(U){var _;return((_=r(this,x))==null?void 0:_.getEditableAnnotation(U))||null}setActiveEditor(U){r(this,O).getActive()!==U&&r(this,O).setActiveEditor(U)}enableClick(){this.div.addEventListener("pointerdown",r(this,d)),this.div.addEventListener("pointerup",r(this,T))}disableClick(){this.div.removeEventListener("pointerdown",r(this,d)),this.div.removeEventListener("pointerup",r(this,T))}attach(U){r(this,a).set(U.id,U);const{annotationElementId:_}=U;_&&r(this,O).isDeletedAnnotationElement(_)&&r(this,O).removeDeletedAnnotationElement(U)}detach(U){var _;r(this,a).delete(U.id),(_=r(this,v))==null||_.removePointerInTextLayer(U.contentDiv),!r(this,E)&&U.annotationElementId&&r(this,O).addDeletedAnnotationElement(U)}remove(U){this.detach(U),r(this,O).removeEditor(U),U.div.contains(document.activeElement)&&setTimeout(()=>{r(this,O).focusMainContainer()},0),U.div.remove(),U.isAttachedToDOM=!1,r(this,f)||this.addInkEditorIfNeeded(!1)}changeParent(U){var _;U.parent!==this&&(U.annotationElementId&&(r(this,O).addDeletedAnnotationElement(U.annotationElementId),n.AnnotationEditor.deleteAnnotationElement(U),U.annotationElementId=null),this.attach(U),(_=U.parent)==null||_.detach(U),U.setParent(this),U.div&&U.isAttachedToDOM&&(U.div.remove(),this.div.append(U.div)))}add(U){if(this.changeParent(U),r(this,O).addEditor(U),this.attach(U),!U.isAttachedToDOM){const _=U.render();this.div.append(_),U.isAttachedToDOM=!0}U.fixAndSetPosition(),U.onceAdded(),r(this,O).addToAnnotationStorage(U)}moveEditorInDOM(U){var nt;if(!U.isAttachedToDOM)return;const{activeElement:_}=document;U.div.contains(_)&&(U._focusEventsAllowed=!1,setTimeout(()=>{U.div.contains(document.activeElement)?U._focusEventsAllowed=!0:(U.div.addEventListener("focusin",()=>{U._focusEventsAllowed=!0},{once:!0}),_.focus())},0)),U._structTreeParentId=(nt=r(this,v))==null?void 0:nt.moveElementInDOM(this.div,U.div,U.contentDiv,!0)}addOrRebuild(U){U.needsToBeRebuilt()?U.rebuild():this.add(U)}addUndoableEditor(U){const _=()=>U._uiManager.rebuild(U),nt=()=>{U.remove()};this.addCommands({cmd:_,undo:nt,mustExec:!1})}getNextId(){return r(this,O).getId()}pasteEditor(U,_){r(this,O).updateToolbar(U),r(this,O).updateMode(U);const{offsetX:nt,offsetY:rt}=j(this,w,nn).call(this),Y=this.getNextId(),st=j(this,R,en).call(this,{parent:this,id:Y,x:nt,y:rt,uiManager:r(this,O),isCentered:!0,..._});st&&this.add(st)}deserialize(U){switch(U.annotationType??U.annotationEditorType){case e.AnnotationEditorType.FREETEXT:return c.FreeTextEditor.deserialize(U,this,r(this,O));case e.AnnotationEditorType.INK:return b.InkEditor.deserialize(U,this,r(this,O));case e.AnnotationEditorType.STAMP:return C.StampEditor.deserialize(U,this,r(this,O))}return null}addNewEditor(){j(this,m,we).call(this,j(this,w,nn).call(this),!0)}setSelected(U){r(this,O).setSelected(U)}toggleSelected(U){r(this,O).toggleSelected(U)}isSelected(U){return r(this,O).isSelected(U)}unselect(U){r(this,O).unselect(U)}pointerup(U){const{isMac:_}=e.FeatureTest.platform;if(!(U.button!==0||U.ctrlKey&&_)&&U.target===this.div&&r(this,i)){if(at(this,i,!1),!r(this,M)){at(this,M,!0);return}if(r(this,O).getMode()===e.AnnotationEditorType.STAMP){r(this,O).unselectAll();return}j(this,m,we).call(this,U,!1)}}pointerdown(U){if(r(this,i)){at(this,i,!1);return}const{isMac:_}=e.FeatureTest.platform;if(U.button!==0||U.ctrlKey&&_||U.target!==this.div)return;at(this,i,!0);const nt=r(this,O).getActive();at(this,M,!nt||nt.isEmpty())}findNewParent(U,_,nt){const rt=r(this,O).findParent(_,nt);return rt===null||rt===this?!1:(rt.changeParent(U),!0)}destroy(){var U,_;((U=r(this,O).getActive())==null?void 0:U.parent)===this&&(r(this,O).commitOrRemove(),r(this,O).setActiveEditor(null));for(const nt of r(this,a).values())(_=r(this,v))==null||_.removePointerInTextLayer(nt.contentDiv),nt.setParent(null),nt.isAttachedToDOM=!1,nt.div.remove();this.div=null,r(this,a).clear(),r(this,O).removeLayer(this)}render(U){let{viewport:_}=U;this.viewport=_,(0,F.setLayerDimensions)(this.div,_);for(const nt of r(this,O).getEditors(this.pageIndex))this.add(nt);this.updateMode()}update(U){let{viewport:_}=U;r(this,O).commitOrRemove(),this.viewport=_,(0,F.setLayerDimensions)(this.div,{rotation:_.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:U,pageHeight:_}=this.viewport.rawDims;return[U,_]}};v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakMap,E=new WeakMap,O=new WeakMap,R=new WeakSet,en=function(U){switch(r(this,O).getMode()){case e.AnnotationEditorType.FREETEXT:return new c.FreeTextEditor(U);case e.AnnotationEditorType.INK:return new b.InkEditor(U);case e.AnnotationEditorType.STAMP:return new C.StampEditor(U)}return null},m=new WeakSet,we=function(U,_){const nt=this.getNextId(),rt=j(this,R,en).call(this,{parent:this,id:nt,x:U.offsetX,y:U.offsetY,uiManager:r(this,O),isCentered:_});return rt&&this.add(rt),rt},w=new WeakSet,nn=function(){const{x:U,y:_,width:nt,height:rt}=this.div.getBoundingClientRect(),Y=Math.max(0,U),st=Math.max(0,_),gt=Math.min(window.innerWidth,U+nt),At=Math.min(window.innerHeight,_+rt),wt=(Y+gt)/2-U,W=(st+At)/2-_,[h,g]=this.viewport.rotation%180===0?[wt,W]:[W,wt];return{offsetX:h,offsetY:g}},N=new WeakSet,rn=function(){at(this,f,!0);for(const U of r(this,a).values())U.isEmpty()&&U.remove();at(this,f,!1)},ee(V,"_initialized",!1);let S=V;l.AnnotationEditorLayer=S},(k,l,t)=>{var C,S,v,M,x,T,d,a,i,f,Fn,O,In,u,On,L,Ae,y,sn,D,Dn,K,an;Object.defineProperty(l,"__esModule",{value:!0}),l.FreeTextEditor=void 0,t(89);var e=t(1),n=t(165),c=t(164),b=t(198);const _=class _ extends c.AnnotationEditor{constructor(Y){super({...Y,name:"freeTextEditor"});X(this,f);X(this,O);X(this,u);X(this,L);X(this,y);X(this,D);X(this,K);X(this,C,this.editorDivBlur.bind(this));X(this,S,this.editorDivFocus.bind(this));X(this,v,this.editorDivInput.bind(this));X(this,M,this.editorDivKeydown.bind(this));X(this,x,void 0);X(this,T,"");X(this,d,`${this.id}-editor`);X(this,a,void 0);X(this,i,null);at(this,x,Y.color||_._defaultColor||c.AnnotationEditor._defaultLineColor),at(this,a,Y.fontSize||_._defaultFontSize)}static get _keyboardManager(){const Y=_.prototype,st=wt=>wt.isEmpty(),gt=n.AnnotationEditorUIManager.TRANSLATE_SMALL,At=n.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,e.shadow)(this,"_keyboardManager",new n.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Y.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Y.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Y._translateEmpty,{args:[-gt,0],checker:st}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Y._translateEmpty,{args:[-At,0],checker:st}],[["ArrowRight","mac+ArrowRight"],Y._translateEmpty,{args:[gt,0],checker:st}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Y._translateEmpty,{args:[At,0],checker:st}],[["ArrowUp","mac+ArrowUp"],Y._translateEmpty,{args:[0,-gt],checker:st}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Y._translateEmpty,{args:[0,-At],checker:st}],[["ArrowDown","mac+ArrowDown"],Y._translateEmpty,{args:[0,gt],checker:st}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Y._translateEmpty,{args:[0,At],checker:st}]]))}static initialize(Y){c.AnnotationEditor.initialize(Y,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const st=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(st.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Y,st){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:_._defaultFontSize=st;break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:_._defaultColor=st;break}}updateParams(Y,st){switch(Y){case e.AnnotationEditorParamsType.FREETEXT_SIZE:j(this,f,Fn).call(this,st);break;case e.AnnotationEditorParamsType.FREETEXT_COLOR:j(this,O,In).call(this,st);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,_._defaultFontSize],[e.AnnotationEditorParamsType.FREETEXT_COLOR,_._defaultColor||c.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.FREETEXT_SIZE,r(this,a)],[e.AnnotationEditorParamsType.FREETEXT_COLOR,r(this,x)]]}_translateEmpty(Y,st){this._uiManager.translateSelectedEditors(Y,st,!0)}getInitialTranslation(){const Y=this.parentScale;return[-_._internalPadding*Y,-(_._internalPadding+r(this,a))*Y]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(e.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",r(this,M)),this.editorDiv.addEventListener("focus",r(this,S)),this.editorDiv.addEventListener("blur",r(this,C)),this.editorDiv.addEventListener("input",r(this,v)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",r(this,d)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",r(this,M)),this.editorDiv.removeEventListener("focus",r(this,S)),this.editorDiv.removeEventListener("blur",r(this,C)),this.editorDiv.removeEventListener("input",r(this,v)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Y){this._focusEventsAllowed&&(super.focusin(Y),Y.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Y;if(this.width){j(this,K,an).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Y=this._initialOptions)!=null&&Y.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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Y=r(this,T),st=at(this,T,j(this,u,On).call(this).trimEnd());if(Y===st)return;const gt=At=>{if(at(this,T,At),!At){this.remove();return}j(this,y,sn).call(this),this._uiManager.rebuild(this),j(this,L,Ae).call(this)};this.addCommands({cmd:()=>{gt(st)},undo:()=>{gt(Y)},mustExec:!1}),j(this,L,Ae).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Y){this.enterInEditMode()}keydown(Y){Y.target===this.div&&Y.key==="Enter"&&(this.enterInEditMode(),Y.preventDefault())}editorDivKeydown(Y){_._keyboardManager.exec(this,Y)}editorDivFocus(Y){this.isEditing=!0}editorDivBlur(Y){this.isEditing=!1}editorDivInput(Y){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Y,st;this.width&&(Y=this.x,st=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",r(this,d)),this.enableEditing(),c.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(At=>{var wt;return(wt=this.editorDiv)==null?void 0:wt.setAttribute("aria-label",At)}),c.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(At=>{var wt;return(wt=this.editorDiv)==null?void 0:wt.setAttribute("default-content",At)}),this.editorDiv.contentEditable=!0;const{style:gt}=this.editorDiv;if(gt.fontSize=`calc(${r(this,a)}px * var(--scale-factor))`,gt.color=r(this,x),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,n.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[At,wt]=this.parentDimensions;if(this.annotationElementId){const{position:W}=r(this,i);let[h,g]=this.getInitialTranslation();[h,g]=this.pageTranslationToScreen(h,g);const[s,p]=this.pageDimensions,[A,I]=this.pageTranslation;let P,H;switch(this.rotation){case 0:P=Y+(W[0]-A)/s,H=st+this.height-(W[1]-I)/p;break;case 90:P=Y+(W[0]-A)/s,H=st-(W[1]-I)/p,[h,g]=[g,-h];break;case 180:P=Y-this.width+(W[0]-A)/s,H=st-(W[1]-I)/p,[h,g]=[-h,-g];break;case 270:P=Y+(W[0]-A-this.height*p)/s,H=st+(W[1]-I-this.width*s)/p,[h,g]=[-g,h];break}this.setAt(P*At,H*wt,h,g)}else this.setAt(Y*At,st*wt,this.width*At,this.height*wt);j(this,y,sn).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Y,st,gt){let At=null;if(Y instanceof b.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:W,fontColor:h},rect:g,rotation:s,id:p},textContent:A,textPosition:I,parent:{page:{pageNumber:P}}}=Y;if(!A||A.length===0)return null;At=Y={annotationType:e.AnnotationEditorType.FREETEXT,color:Array.from(h),fontSize:W,value:A.join(`
  6. `),position:I,pageIndex:P-1,rect:g,rotation:s,id:p,deleted:!1}}const wt=super.deserialize(Y,st,gt);return at(wt,a,Y.fontSize),at(wt,x,e.Util.makeHexColor(...Y.color)),at(wt,T,Y.value),wt.annotationElementId=Y.id||null,at(wt,i,At),wt}serialize(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const st=_._internalPadding*this.parentScale,gt=this.getRect(st,st),At=c.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:r(this,x)),wt={annotationType:e.AnnotationEditorType.FREETEXT,color:At,fontSize:r(this,a),value:r(this,T),pageIndex:this.pageIndex,rect:gt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Y?wt:this.annotationElementId&&!j(this,D,Dn).call(this,wt)?null:(wt.id=this.annotationElementId,wt)}};C=new WeakMap,S=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakSet,Fn=function(Y){const st=At=>{this.editorDiv.style.fontSize=`calc(${At}px * var(--scale-factor))`,this.translate(0,-(At-r(this,a))*this.parentScale),at(this,a,At),j(this,L,Ae).call(this)},gt=r(this,a);this.addCommands({cmd:()=>{st(Y)},undo:()=>{st(gt)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},O=new WeakSet,In=function(Y){const st=r(this,x);this.addCommands({cmd:()=>{at(this,x,this.editorDiv.style.color=Y)},undo:()=>{at(this,x,this.editorDiv.style.color=st)},mustExec:!0,type:e.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},u=new WeakSet,On=function(){const Y=this.editorDiv.getElementsByTagName("div");if(Y.length===0)return this.editorDiv.innerText;const st=[];for(const gt of Y)st.push(gt.innerText.replace(/\r\n?|\n/,""));return st.join(`
  7. `)},L=new WeakSet,Ae=function(){const[Y,st]=this.parentDimensions;let gt;if(this.isAttachedToDOM)gt=this.div.getBoundingClientRect();else{const{currentLayer:At,div:wt}=this,W=wt.style.display;wt.style.display="hidden",At.div.append(this.div),gt=wt.getBoundingClientRect(),wt.remove(),wt.style.display=W}this.rotation%180===this.parentRotation%180?(this.width=gt.width/Y,this.height=gt.height/st):(this.width=gt.height/Y,this.height=gt.width/st),this.fixAndSetPosition()},y=new WeakSet,sn=function(){if(this.editorDiv.replaceChildren(),!!r(this,T))for(const Y of r(this,T).split(`
  8. `)){const st=document.createElement("div");st.append(Y?document.createTextNode(Y):document.createElement("br")),this.editorDiv.append(st)}},D=new WeakSet,Dn=function(Y){const{value:st,fontSize:gt,color:At,rect:wt,pageIndex:W}=r(this,i);return Y.value!==st||Y.fontSize!==gt||Y.rect.some((h,g)=>Math.abs(h-wt[g])>=1)||Y.color.some((h,g)=>h!==At[g])||Y.pageIndex!==W},K=new WeakSet,an=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.annotationElementId)return;if(j(this,L,Ae).call(this),!Y&&(this.width===0||this.height===0)){setTimeout(()=>j(this,K,an).call(this,!0),0);return}const st=_._internalPadding*this.parentScale;r(this,i).rect=this.getRect(st,st)},ee(_,"_freeTextDefaultContent",""),ee(_,"_internalPadding",0),ee(_,"_defaultColor",null),ee(_,"_defaultFontSize",10),ee(_,"_type","freetext");let F=_;l.FreeTextEditor=F},(k,l,t)=>{var g,p,ce,I,Ln,H,tt,q,ct,ut,Et,mt,Ot,Wt,kt,Nt,bt,ht,it,ft,Rt,Ft,zt,Nn,$t,Me,Kt,on,Zt,ln,yt,Z,J,dt,jt,ot,G,cn,xt,St,Pt,vt,Bn,Tt,hn;Object.defineProperty(l,"__esModule",{value:!0}),l.StampAnnotationElement=l.InkAnnotationElement=l.FreeTextAnnotationElement=l.AnnotationLayer=void 0,t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147);var e=t(1),n=t(168),c=t(163),b=t(199),F=t(200),C=t(201);const S=1e3,v=9,M=new WeakSet;function x(Dt){return{width:Dt[2]-Dt[0],height:Dt[3]-Dt[1]}}class T{static create(z){switch(z.data.annotationType){case e.AnnotationType.LINK:return new a(z);case e.AnnotationType.TEXT:return new i(z);case e.AnnotationType.WIDGET:switch(z.data.fieldType){case"Tx":return new E(z);case"Btn":return z.data.radioButton?new u(z):z.data.checkBox?new R(z):new m(z);case"Ch":return new L(z);case"Sig":return new O(z)}return new f(z);case e.AnnotationType.POPUP:return new w(z);case e.AnnotationType.FREETEXT:return new N(z);case e.AnnotationType.LINE:return new D(z);case e.AnnotationType.SQUARE:return new V(z);case e.AnnotationType.CIRCLE:return new K(z);case e.AnnotationType.POLYLINE:return new U(z);case e.AnnotationType.CARET:return new nt(z);case e.AnnotationType.INK:return new rt(z);case e.AnnotationType.POLYGON:return new _(z);case e.AnnotationType.HIGHLIGHT:return new Y(z);case e.AnnotationType.UNDERLINE:return new st(z);case e.AnnotationType.SQUIGGLY:return new gt(z);case e.AnnotationType.STRIKEOUT:return new At(z);case e.AnnotationType.STAMP:return new wt(z);case e.AnnotationType.FILEATTACHMENT:return new W(z);default:return new d(z)}}}const s=class s{constructor(z){X(this,g,!1);let{isRenderable:o=!1,ignoreBorder:B=!1,createQuadrilaterals:$=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=o,this.data=z.data,this.layer=z.layer,this.linkService=z.linkService,this.downloadManager=z.downloadManager,this.imageResourcesPath=z.imageResourcesPath,this.renderForms=z.renderForms,this.svgFactory=z.svgFactory,this.annotationStorage=z.annotationStorage,this.enableScripting=z.enableScripting,this.hasJSActions=z.hasJSActions,this._fieldObjects=z.fieldObjects,this.parent=z.parent,o&&(this.container=this._createContainer(B)),$&&this._createQuadrilaterals()}static _hasPopupData(z){let{titleObj:o,contentsObj:B,richText:$}=z;return!!(o!=null&&o.str||B!=null&&B.str||$!=null&&$.str)}get hasPopupData(){return s._hasPopupData(this.data)}_createContainer(z){const{data:o,parent:{page:B,viewport:$}}=this,Q=document.createElement("section");Q.setAttribute("data-annotation-id",o.id),this instanceof f||(Q.tabIndex=S),Q.style.zIndex=this.parent.zIndex++,this.data.popupRef&&Q.setAttribute("aria-haspopup","dialog"),o.noRotate&&Q.classList.add("norotate");const{pageWidth:et,pageHeight:lt,pageX:Ct,pageY:It}=$.rawDims;if(!o.rect||this instanceof w){const{rotation:Qt}=o;return!o.hasOwnCanvas&&Qt!==0&&this.setRotation(Qt,Q),Q}const{width:Mt,height:Jt}=x(o.rect),Ut=e.Util.normalizeRect([o.rect[0],B.view[3]-o.rect[1]+B.view[1],o.rect[2],B.view[3]-o.rect[3]+B.view[1]]);if(!z&&o.borderStyle.width>0){Q.style.borderWidth=`${o.borderStyle.width}px`;const Qt=o.borderStyle.horizontalCornerRadius,Xt=o.borderStyle.verticalCornerRadius;if(Qt>0||Xt>0){const te=`calc(${Qt}px * var(--scale-factor)) / calc(${Xt}px * var(--scale-factor))`;Q.style.borderRadius=te}else if(this instanceof u){const te=`calc(${Mt}px * var(--scale-factor)) / calc(${Jt}px * var(--scale-factor))`;Q.style.borderRadius=te}switch(o.borderStyle.style){case e.AnnotationBorderStyleType.SOLID:Q.style.borderStyle="solid";break;case e.AnnotationBorderStyleType.DASHED:Q.style.borderStyle="dashed";break;case e.AnnotationBorderStyleType.BEVELED:(0,e.warn)("Unimplemented border style: beveled");break;case e.AnnotationBorderStyleType.INSET:(0,e.warn)("Unimplemented border style: inset");break;case e.AnnotationBorderStyleType.UNDERLINE:Q.style.borderBottomStyle="solid";break}const qt=o.borderColor||null;qt?(at(this,g,!0),Q.style.borderColor=e.Util.makeHexColor(qt[0]|0,qt[1]|0,qt[2]|0)):Q.style.borderWidth=0}Q.style.left=`${100*(Ut[0]-Ct)/et}%`,Q.style.top=`${100*(Ut[1]-It)/lt}%`;const{rotation:Bt}=o;return o.hasOwnCanvas||Bt===0?(Q.style.width=`${100*Mt/et}%`,Q.style.height=`${100*Jt/lt}%`):this.setRotation(Bt,Q),Q}setRotation(z){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:B,pageHeight:$}=this.parent.viewport.rawDims,{width:Q,height:et}=x(this.data.rect);let lt,Ct;z%180===0?(lt=100*Q/B,Ct=100*et/$):(lt=100*et/B,Ct=100*Q/$),o.style.width=`${lt}%`,o.style.height=`${Ct}%`,o.setAttribute("data-main-rotation",(360-z)%360)}get _commonActions(){const z=(o,B,$)=>{const Q=$.detail[o],et=Q[0],lt=Q.slice(1);$.target.style[B]=b.ColorConverters[`${et}_HTML`](lt),this.annotationStorage.setValue(this.data.id,{[B]:b.ColorConverters[`${et}_rgb`](lt)})};return(0,e.shadow)(this,"_commonActions",{display:o=>{const{display:B}=o.detail,$=B%2===1;this.container.style.visibility=$?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:$,noPrint:B===1||B===2})},print:o=>{this.annotationStorage.setValue(this.data.id,{noPrint:!o.detail.print})},hidden:o=>{const{hidden:B}=o.detail;this.container.style.visibility=B?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:B,noView:B})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.target.disabled=o.detail.readonly},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:o=>{z("bgColor","backgroundColor",o)},fillColor:o=>{z("fillColor","backgroundColor",o)},fgColor:o=>{z("fgColor","color",o)},textColor:o=>{z("textColor","color",o)},borderColor:o=>{z("borderColor","borderColor",o)},strokeColor:o=>{z("strokeColor","borderColor",o)},rotation:o=>{const B=o.detail.rotation;this.setRotation(B),this.annotationStorage.setValue(this.data.id,{rotation:B})}})}_dispatchEventFromSandbox(z,o){const B=this._commonActions;for(const $ of Object.keys(o.detail)){const Q=z[$]||B[$];Q==null||Q(o)}}_setDefaultPropertiesFromJS(z){if(!this.enableScripting)return;const o=this.annotationStorage.getRawValue(this.data.id);if(!o)return;const B=this._commonActions;for(const[$,Q]of Object.entries(o)){const et=B[$];if(et){const lt={detail:{[$]:Q},target:z};et(lt),delete o[$]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:z}=this.data;if(!z)return;const[o,B,$,Q]=this.data.rect;if(z.length===1){const[,{x:Xt,y:qt},{x:te,y:re}]=z[0];if($===Xt&&Q===qt&&o===te&&B===re)return}const{style:et}=this.container;let lt;if(r(this,g)){const{borderColor:Xt,borderWidth:qt}=et;et.borderWidth=0,lt=["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="${Xt}" stroke-width="${qt}">`],this.container.classList.add("hasBorder")}const Ct=$-o,It=Q-B,{svgFactory:Mt}=this,Jt=Mt.createElement("svg");Jt.classList.add("quadrilateralsContainer"),Jt.setAttribute("width",0),Jt.setAttribute("height",0);const Ut=Mt.createElement("defs");Jt.append(Ut);const Bt=Mt.createElement("clipPath"),Qt=`clippath_${this.data.id}`;Bt.setAttribute("id",Qt),Bt.setAttribute("clipPathUnits","objectBoundingBox"),Ut.append(Bt);for(const[,{x:Xt,y:qt},{x:te,y:re}]of z){const ne=Mt.createElement("rect"),se=(te-o)/Ct,oe=(Q-qt)/It,le=(Xt-te)/Ct,yn=(qt-re)/It;ne.setAttribute("x",se),ne.setAttribute("y",oe),ne.setAttribute("width",le),ne.setAttribute("height",yn),Bt.append(ne),lt==null||lt.push(`<rect vector-effect="non-scaling-stroke" x="${se}" y="${oe}" width="${le}" height="${yn}"/>`)}r(this,g)&&(lt.push("</g></svg>')"),et.backgroundImage=lt.join("")),this.container.append(Jt),this.container.style.clipPath=`url(#${Qt})`}_createPopup(){const{container:z,data:o}=this;z.setAttribute("aria-haspopup","dialog");const B=new w({data:{color:o.color,titleObj:o.titleObj,modificationDate:o.modificationDate,contentsObj:o.contentsObj,richText:o.richText,parentRect:o.rect,borderStyle:0,id:`popup_${o.id}`,rotation:o.rotation},parent:this.parent,elements:[this]});this.parent.div.append(B.render())}render(){(0,e.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(z){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const B=[];if(this._fieldObjects){const $=this._fieldObjects[z];if($)for(const{page:Q,id:et,exportValues:lt}of $){if(Q===-1||et===o)continue;const Ct=typeof lt=="string"?lt:null,It=document.querySelector(`[data-element-id="${et}"]`);if(It&&!M.has(It)){(0,e.warn)(`_getElementsByName - element not allowed: ${et}`);continue}B.push({id:et,exportValue:Ct,domElement:It})}return B}for(const $ of document.getElementsByName(z)){const{exportValue:Q}=$,et=$.getAttribute("data-element-id");et!==o&&M.has($)&&B.push({id:et,exportValue:Q,domElement:$})}return B}show(){var z;this.container&&(this.container.hidden=!1),(z=this.popup)==null||z.maybeShow()}hide(){var z;this.container&&(this.container.hidden=!0),(z=this.popup)==null||z.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const z=this.getElementsToTriggerPopup();if(Array.isArray(z))for(const o of z)o.classList.add("highlightArea");else z.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:z,data:{id:o}}=this;this.container.addEventListener("dblclick",()=>{var B;(B=this.linkService.eventBus)==null||B.dispatch("switchannotationeditormode",{source:this,mode:z,editId:o})})}};g=new WeakMap;let d=s;class a extends d{constructor(o){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(o,{isRenderable:!0,ignoreBorder:!!(B!=null&&B.ignoreBorder),createQuadrilaterals:!0});X(this,p);X(this,I);this.isTooltipOnly=o.data.isTooltipOnly}render(){const{data:o,linkService:B}=this,$=document.createElement("a");$.setAttribute("data-element-id",o.id);let Q=!1;return o.url?(B.addLinkAttributes($,o.url,o.newWindow),Q=!0):o.action?(this._bindNamedAction($,o.action),Q=!0):o.attachment?(this._bindAttachment($,o.attachment),Q=!0):o.setOCGState?(j(this,I,Ln).call(this,$,o.setOCGState),Q=!0):o.dest?(this._bindLink($,o.dest),Q=!0):(o.actions&&(o.actions.Action||o.actions["Mouse Up"]||o.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction($,o),Q=!0),o.resetForm?(this._bindResetFormAction($,o.resetForm),Q=!0):this.isTooltipOnly&&!Q&&(this._bindLink($,""),Q=!0)),this.container.classList.add("linkAnnotation"),Q&&this.container.append($),this.container}_bindLink(o,B){o.href=this.linkService.getDestinationHash(B),o.onclick=()=>(B&&this.linkService.goToDestination(B),!1),(B||B==="")&&j(this,p,ce).call(this)}_bindNamedAction(o,B){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>(this.linkService.executeNamedAction(B),!1),j(this,p,ce).call(this)}_bindAttachment(o,B){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>{var $;return($=this.downloadManager)==null||$.openOrDownloadData(this.container,B.content,B.filename),!1},j(this,p,ce).call(this)}_bindJSAction(o,B){o.href=this.linkService.getAnchorUrl("");const $=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Q of Object.keys(B.actions)){const et=$.get(Q);et&&(o[et]=()=>{var lt;return(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:B.id,name:Q}}),!1})}o.onclick||(o.onclick=()=>!1),j(this,p,ce).call(this)}_bindResetFormAction(o,B){const $=o.onclick;if($||(o.href=this.linkService.getAnchorUrl("")),j(this,p,ce).call(this),!this._fieldObjects){(0,e.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),$||(o.onclick=()=>!1);return}o.onclick=()=>{var Jt;$==null||$();const{fields:Q,refs:et,include:lt}=B,Ct=[];if(Q.length!==0||et.length!==0){const Ut=new Set(et);for(const Bt of Q){const Qt=this._fieldObjects[Bt]||[];for(const{id:Xt}of Qt)Ut.add(Xt)}for(const Bt of Object.values(this._fieldObjects))for(const Qt of Bt)Ut.has(Qt.id)===lt&&Ct.push(Qt)}else for(const Ut of Object.values(this._fieldObjects))Ct.push(...Ut);const It=this.annotationStorage,Mt=[];for(const Ut of Ct){const{id:Bt}=Ut;switch(Mt.push(Bt),Ut.type){case"text":{const Xt=Ut.defaultValue||"";It.setValue(Bt,{value:Xt});break}case"checkbox":case"radiobutton":{const Xt=Ut.defaultValue===Ut.exportValues;It.setValue(Bt,{value:Xt});break}case"combobox":case"listbox":{const Xt=Ut.defaultValue||"";It.setValue(Bt,{value:Xt});break}default:continue}const Qt=document.querySelector(`[data-element-id="${Bt}"]`);if(Qt){if(!M.has(Qt)){(0,e.warn)(`_bindResetFormAction - element not allowed: ${Bt}`);continue}}else continue;Qt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((Jt=this.linkService.eventBus)==null||Jt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Mt,name:"ResetForm"}})),!1}}}p=new WeakSet,ce=function(){this.container.setAttribute("data-internal-link","")},I=new WeakSet,Ln=function(o,B){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>(this.linkService.executeSetOCGState(B),!1),j(this,p,ce).call(this)};class i extends d{constructor(z){super(z,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const z=document.createElement("img");return z.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",z.alt="[{{type}} Annotation]",z.dataset.l10nId="text_annotation_type",z.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(z),this.container}}class f extends d{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(z){var o;this.data.hasOwnCanvas&&(((o=z.previousSibling)==null?void 0:o.nodeName)==="CANVAS"&&(z.previousSibling.hidden=!0),z.hidden=!1)}_getKeyModifier(z){const{isWin:o,isMac:B}=e.FeatureTest.platform;return o&&z.ctrlKey||B&&z.metaKey}_setEventListener(z,o,B,$,Q){B.includes("mouse")?z.addEventListener(B,et=>{var lt;(lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:$,value:Q(et),shift:et.shiftKey,modifier:this._getKeyModifier(et)}})}):z.addEventListener(B,et=>{var lt;if(B==="blur"){if(!o.focused||!et.relatedTarget)return;o.focused=!1}else if(B==="focus"){if(o.focused)return;o.focused=!0}Q&&((lt=this.linkService.eventBus)==null||lt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:$,value:Q(et)}}))})}_setEventListeners(z,o,B,$){var Q,et,lt;for(const[Ct,It]of B)(It==="Action"||(Q=this.data.actions)!=null&&Q[It])&&((It==="Focus"||It==="Blur")&&(o||(o={focused:!1})),this._setEventListener(z,o,Ct,It,$),It==="Focus"&&!((et=this.data.actions)!=null&&et.Blur)?this._setEventListener(z,o,"blur","Blur",null):It==="Blur"&&!((lt=this.data.actions)!=null&&lt.Focus)&&this._setEventListener(z,o,"focus","Focus",null))}_setBackgroundColor(z){const o=this.data.backgroundColor||null;z.style.backgroundColor=o===null?"transparent":e.Util.makeHexColor(o[0],o[1],o[2])}_setTextStyle(z){const o=["left","center","right"],{fontColor:B}=this.data.defaultAppearanceData,$=this.data.defaultAppearanceData.fontSize||v,Q=z.style;let et;const lt=2,Ct=It=>Math.round(10*It)/10;if(this.data.multiLine){const It=Math.abs(this.data.rect[3]-this.data.rect[1]-lt),Mt=Math.round(It/(e.LINE_FACTOR*$))||1,Jt=It/Mt;et=Math.min($,Ct(Jt/e.LINE_FACTOR))}else{const It=Math.abs(this.data.rect[3]-this.data.rect[1]-lt);et=Math.min($,Ct(It/e.LINE_FACTOR))}Q.fontSize=`calc(${et}px * var(--scale-factor))`,Q.color=e.Util.makeHexColor(B[0],B[1],B[2]),this.data.textAlignment!==null&&(Q.textAlign=o[this.data.textAlignment])}_setRequired(z,o){o?z.setAttribute("required",!0):z.removeAttribute("required"),z.setAttribute("aria-required",o)}}class E extends f{constructor(z){const o=z.renderForms||!z.data.hasAppearance&&!!z.data.fieldValue;super(z,{isRenderable:o})}setPropertyOnSiblings(z,o,B,$){const Q=this.annotationStorage;for(const et of this._getElementsByName(z.name,z.id))et.domElement&&(et.domElement[o]=B),Q.setValue(et.id,{[$]:B})}render(){var $,Q;const z=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let B=null;if(this.renderForms){const et=z.getValue(o,{value:this.data.fieldValue});let lt=et.value||"";const Ct=z.getValue(o,{charLimit:this.data.maxLen}).charLimit;Ct&&lt.length>Ct&&(lt=lt.slice(0,Ct));let It=et.formattedValue||(($=this.data.textContent)==null?void 0:$.join(`
  9. `))||null;It&&this.data.comb&&(It=It.replaceAll(/\s+/g,""));const Mt={userValue:lt,formattedValue:It,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(B=document.createElement("textarea"),B.textContent=It??lt,this.data.doNotScroll&&(B.style.overflowY="hidden")):(B=document.createElement("input"),B.type="text",B.setAttribute("value",It??lt),this.data.doNotScroll&&(B.style.overflowX="hidden")),this.data.hasOwnCanvas&&(B.hidden=!0),M.add(B),B.setAttribute("data-element-id",o),B.disabled=this.data.readOnly,B.name=this.data.fieldName,B.tabIndex=S,this._setRequired(B,this.data.required),Ct&&(B.maxLength=Ct),B.addEventListener("input",Ut=>{z.setValue(o,{value:Ut.target.value}),this.setPropertyOnSiblings(B,"value",Ut.target.value,"value"),Mt.formattedValue=null}),B.addEventListener("resetform",Ut=>{const Bt=this.data.defaultFieldValue??"";B.value=Mt.userValue=Bt,Mt.formattedValue=null});let Jt=Ut=>{const{formattedValue:Bt}=Mt;Bt!=null&&(Ut.target.value=Bt),Ut.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){B.addEventListener("focus",Bt=>{if(Mt.focused)return;const{target:Qt}=Bt;Mt.userValue&&(Qt.value=Mt.userValue),Mt.lastCommittedValue=Qt.value,Mt.commitKey=1,Mt.focused=!0}),B.addEventListener("updatefromsandbox",Bt=>{this.showElementAndHideCanvas(Bt.target);const Qt={value(Xt){Mt.userValue=Xt.detail.value??"",z.setValue(o,{value:Mt.userValue.toString()}),Xt.target.value=Mt.userValue},formattedValue(Xt){const{formattedValue:qt}=Xt.detail;Mt.formattedValue=qt,qt!=null&&Xt.target!==document.activeElement&&(Xt.target.value=qt),z.setValue(o,{formattedValue:qt})},selRange(Xt){Xt.target.setSelectionRange(...Xt.detail.selRange)},charLimit:Xt=>{var ne;const{charLimit:qt}=Xt.detail,{target:te}=Xt;if(qt===0){te.removeAttribute("maxLength");return}te.setAttribute("maxLength",qt);let re=Mt.userValue;!re||re.length<=qt||(re=re.slice(0,qt),te.value=Mt.userValue=re,z.setValue(o,{value:re}),(ne=this.linkService.eventBus)==null||ne.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:re,willCommit:!0,commitKey:1,selStart:te.selectionStart,selEnd:te.selectionEnd}}))}};this._dispatchEventFromSandbox(Qt,Bt)}),B.addEventListener("keydown",Bt=>{var qt;Mt.commitKey=1;let Qt=-1;if(Bt.key==="Escape"?Qt=0:Bt.key==="Enter"&&!this.data.multiLine?Qt=2:Bt.key==="Tab"&&(Mt.commitKey=3),Qt===-1)return;const{value:Xt}=Bt.target;Mt.lastCommittedValue!==Xt&&(Mt.lastCommittedValue=Xt,Mt.userValue=Xt,(qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:Xt,willCommit:!0,commitKey:Qt,selStart:Bt.target.selectionStart,selEnd:Bt.target.selectionEnd}}))});const Ut=Jt;Jt=null,B.addEventListener("blur",Bt=>{var Xt;if(!Mt.focused||!Bt.relatedTarget)return;Mt.focused=!1;const{value:Qt}=Bt.target;Mt.userValue=Qt,Mt.lastCommittedValue!==Qt&&((Xt=this.linkService.eventBus)==null||Xt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:Qt,willCommit:!0,commitKey:Mt.commitKey,selStart:Bt.target.selectionStart,selEnd:Bt.target.selectionEnd}})),Ut(Bt)}),(Q=this.data.actions)!=null&&Q.Keystroke&&B.addEventListener("beforeinput",Bt=>{var oe;Mt.lastCommittedValue=null;const{data:Qt,target:Xt}=Bt,{value:qt,selectionStart:te,selectionEnd:re}=Xt;let ne=te,se=re;switch(Bt.inputType){case"deleteWordBackward":{const le=qt.substring(0,te).match(/\w*[^\w]*$/);le&&(ne-=le[0].length);break}case"deleteWordForward":{const le=qt.substring(te).match(/^[^\w]*\w*/);le&&(se+=le[0].length);break}case"deleteContentBackward":te===re&&(ne-=1);break;case"deleteContentForward":te===re&&(se+=1);break}Bt.preventDefault(),(oe=this.linkService.eventBus)==null||oe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:qt,change:Qt||"",willCommit:!1,selStart:ne,selEnd:se}})}),this._setEventListeners(B,Mt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Bt=>Bt.target.value)}if(Jt&&B.addEventListener("blur",Jt),this.data.comb){const Bt=(this.data.rect[2]-this.data.rect[0])/Ct;B.classList.add("comb"),B.style.letterSpacing=`calc(${Bt}px * var(--scale-factor) - 1ch)`}}else B=document.createElement("div"),B.textContent=this.data.fieldValue,B.style.verticalAlign="middle",B.style.display="table-cell";return this._setTextStyle(B),this._setBackgroundColor(B),this._setDefaultPropertiesFromJS(B),this.container.append(B),this.container}}class O extends f{constructor(z){super(z,{isRenderable:!!z.data.hasOwnCanvas})}}class R extends f{constructor(z){super(z,{isRenderable:z.renderForms})}render(){const z=this.annotationStorage,o=this.data,B=o.id;let $=z.getValue(B,{value:o.exportValue===o.fieldValue}).value;typeof $=="string"&&($=$!=="Off",z.setValue(B,{value:$})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Q=document.createElement("input");return M.add(Q),Q.setAttribute("data-element-id",B),Q.disabled=o.readOnly,this._setRequired(Q,this.data.required),Q.type="checkbox",Q.name=o.fieldName,$&&Q.setAttribute("checked",!0),Q.setAttribute("exportValue",o.exportValue),Q.tabIndex=S,Q.addEventListener("change",et=>{const{name:lt,checked:Ct}=et.target;for(const It of this._getElementsByName(lt,B)){const Mt=Ct&&It.exportValue===o.exportValue;It.domElement&&(It.domElement.checked=Mt),z.setValue(It.id,{value:Mt})}z.setValue(B,{value:Ct})}),Q.addEventListener("resetform",et=>{const lt=o.defaultFieldValue||"Off";et.target.checked=lt===o.exportValue}),this.enableScripting&&this.hasJSActions&&(Q.addEventListener("updatefromsandbox",et=>{const lt={value(Ct){Ct.target.checked=Ct.detail.value!=="Off",z.setValue(B,{value:Ct.target.checked})}};this._dispatchEventFromSandbox(lt,et)}),this._setEventListeners(Q,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],et=>et.target.checked)),this._setBackgroundColor(Q),this._setDefaultPropertiesFromJS(Q),this.container.append(Q),this.container}}class u extends f{constructor(z){super(z,{isRenderable:z.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const z=this.annotationStorage,o=this.data,B=o.id;let $=z.getValue(B,{value:o.fieldValue===o.buttonValue}).value;typeof $=="string"&&($=$!==o.buttonValue,z.setValue(B,{value:$}));const Q=document.createElement("input");if(M.add(Q),Q.setAttribute("data-element-id",B),Q.disabled=o.readOnly,this._setRequired(Q,this.data.required),Q.type="radio",Q.name=o.fieldName,$&&Q.setAttribute("checked",!0),Q.tabIndex=S,Q.addEventListener("change",et=>{const{name:lt,checked:Ct}=et.target;for(const It of this._getElementsByName(lt,B))z.setValue(It.id,{value:!1});z.setValue(B,{value:Ct})}),Q.addEventListener("resetform",et=>{const lt=o.defaultFieldValue;et.target.checked=lt!=null&&lt===o.buttonValue}),this.enableScripting&&this.hasJSActions){const et=o.buttonValue;Q.addEventListener("updatefromsandbox",lt=>{const Ct={value:It=>{const Mt=et===It.detail.value;for(const Jt of this._getElementsByName(It.target.name)){const Ut=Mt&&Jt.id===B;Jt.domElement&&(Jt.domElement.checked=Ut),z.setValue(Jt.id,{value:Ut})}}};this._dispatchEventFromSandbox(Ct,lt)}),this._setEventListeners(Q,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],lt=>lt.target.checked)}return this._setBackgroundColor(Q),this._setDefaultPropertiesFromJS(Q),this.container.append(Q),this.container}}class m extends a{constructor(z){super(z,{ignoreBorder:z.data.hasAppearance})}render(){const z=super.render();z.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(z.title=this.data.alternativeText);const o=z.lastChild;return this.enableScripting&&this.hasJSActions&&o&&(this._setDefaultPropertiesFromJS(o),o.addEventListener("updatefromsandbox",B=>{this._dispatchEventFromSandbox({},B)})),z}}class L extends f{constructor(z){super(z,{isRenderable:z.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const z=this.annotationStorage,o=this.data.id,B=z.getValue(o,{value:this.data.fieldValue}),$=document.createElement("select");M.add($),$.setAttribute("data-element-id",o),$.disabled=this.data.readOnly,this._setRequired($,this.data.required),$.name=this.data.fieldName,$.tabIndex=S;let Q=this.data.combo&&this.data.options.length>0;this.data.combo||($.size=this.data.options.length,this.data.multiSelect&&($.multiple=!0)),$.addEventListener("resetform",Mt=>{const Jt=this.data.defaultFieldValue;for(const Ut of $.options)Ut.selected=Ut.value===Jt});for(const Mt of this.data.options){const Jt=document.createElement("option");Jt.textContent=Mt.displayValue,Jt.value=Mt.exportValue,B.value.includes(Mt.exportValue)&&(Jt.setAttribute("selected",!0),Q=!1),$.append(Jt)}let et=null;if(Q){const Mt=document.createElement("option");Mt.value=" ",Mt.setAttribute("hidden",!0),Mt.setAttribute("selected",!0),$.prepend(Mt),et=()=>{Mt.remove(),$.removeEventListener("input",et),et=null},$.addEventListener("input",et)}const lt=Mt=>{const Jt=Mt?"value":"textContent",{options:Ut,multiple:Bt}=$;return Bt?Array.prototype.filter.call(Ut,Qt=>Qt.selected).map(Qt=>Qt[Jt]):Ut.selectedIndex===-1?null:Ut[Ut.selectedIndex][Jt]};let Ct=lt(!1);const It=Mt=>{const Jt=Mt.target.options;return Array.prototype.map.call(Jt,Ut=>({displayValue:Ut.textContent,exportValue:Ut.value}))};return this.enableScripting&&this.hasJSActions?($.addEventListener("updatefromsandbox",Mt=>{const Jt={value(Ut){et==null||et();const Bt=Ut.detail.value,Qt=new Set(Array.isArray(Bt)?Bt:[Bt]);for(const Xt of $.options)Xt.selected=Qt.has(Xt.value);z.setValue(o,{value:lt(!0)}),Ct=lt(!1)},multipleSelection(Ut){$.multiple=!0},remove(Ut){const Bt=$.options,Qt=Ut.detail.remove;Bt[Qt].selected=!1,$.remove(Qt),Bt.length>0&&Array.prototype.findIndex.call(Bt,qt=>qt.selected)===-1&&(Bt[0].selected=!0),z.setValue(o,{value:lt(!0),items:It(Ut)}),Ct=lt(!1)},clear(Ut){for(;$.length!==0;)$.remove(0);z.setValue(o,{value:null,items:[]}),Ct=lt(!1)},insert(Ut){const{index:Bt,displayValue:Qt,exportValue:Xt}=Ut.detail.insert,qt=$.children[Bt],te=document.createElement("option");te.textContent=Qt,te.value=Xt,qt?qt.before(te):$.append(te),z.setValue(o,{value:lt(!0),items:It(Ut)}),Ct=lt(!1)},items(Ut){const{items:Bt}=Ut.detail;for(;$.length!==0;)$.remove(0);for(const Qt of Bt){const{displayValue:Xt,exportValue:qt}=Qt,te=document.createElement("option");te.textContent=Xt,te.value=qt,$.append(te)}$.options.length>0&&($.options[0].selected=!0),z.setValue(o,{value:lt(!0),items:It(Ut)}),Ct=lt(!1)},indices(Ut){const Bt=new Set(Ut.detail.indices);for(const Qt of Ut.target.options)Qt.selected=Bt.has(Qt.index);z.setValue(o,{value:lt(!0)}),Ct=lt(!1)},editable(Ut){Ut.target.disabled=!Ut.detail.editable}};this._dispatchEventFromSandbox(Jt,Mt)}),$.addEventListener("input",Mt=>{var Ut;const Jt=lt(!0);z.setValue(o,{value:Jt}),Mt.preventDefault(),(Ut=this.linkService.eventBus)==null||Ut.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:Ct,changeEx:Jt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners($,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Mt=>Mt.target.value)):$.addEventListener("input",function(Mt){z.setValue(o,{value:lt(!0)})}),this.data.combo&&this._setTextStyle($),this._setBackgroundColor($),this._setDefaultPropertiesFromJS($),this.container.append($),this.container}}class w extends d{constructor(z){const{data:o,elements:B}=z;super(z,{isRenderable:d._hasPopupData(o)}),this.elements=B}render(){this.container.classList.add("popupAnnotation");const z=new y({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}),o=[];for(const B of this.elements)B.popup=z,o.push(B.data.id),B.addHighlightArea();return this.container.setAttribute("aria-controls",o.map(B=>`${e.AnnotationPrefix}${B}`).join(",")),this.container}}class y{constructor(z){X(this,zt);X(this,$t);X(this,Kt);X(this,Zt);X(this,H,null);X(this,tt,j(this,zt,Nn).bind(this));X(this,q,j(this,Zt,ln).bind(this));X(this,ct,j(this,Kt,on).bind(this));X(this,ut,j(this,$t,Me).bind(this));X(this,Et,null);X(this,mt,null);X(this,Ot,null);X(this,Wt,null);X(this,kt,null);X(this,Nt,null);X(this,bt,!1);X(this,ht,null);X(this,it,null);X(this,ft,null);X(this,Rt,null);X(this,Ft,!1);var Qt;let{container:o,color:B,elements:$,titleObj:Q,modificationDate:et,contentsObj:lt,richText:Ct,parent:It,rect:Mt,parentRect:Jt,open:Ut}=z;at(this,mt,o),at(this,Rt,Q),at(this,Ot,lt),at(this,ft,Ct),at(this,kt,It),at(this,Et,B),at(this,it,Mt),at(this,Nt,Jt),at(this,Wt,$);const Bt=n.PDFDateString.toDateObject(et);Bt&&at(this,H,It.l10n.get("annotation_date_string",{date:Bt.toLocaleDateString(),time:Bt.toLocaleTimeString()})),this.trigger=$.flatMap(Xt=>Xt.getElementsToTriggerPopup());for(const Xt of this.trigger)Xt.addEventListener("click",r(this,ut)),Xt.addEventListener("mouseenter",r(this,ct)),Xt.addEventListener("mouseleave",r(this,q)),Xt.classList.add("popupTriggerArea");for(const Xt of $)(Qt=Xt.container)==null||Qt.addEventListener("keydown",r(this,tt));r(this,mt).hidden=!0,Ut&&j(this,$t,Me).call(this)}render(){if(r(this,ht))return;const{page:{view:z},viewport:{rawDims:{pageWidth:o,pageHeight:B,pageX:$,pageY:Q}}}=r(this,kt),et=at(this,ht,document.createElement("div"));if(et.className="popup",r(this,Et)){const ne=et.style.outlineColor=e.Util.makeHexColor(...r(this,Et));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?et.style.backgroundColor=`color-mix(in srgb, ${ne} 30%, white)`:et.style.backgroundColor=e.Util.makeHexColor(...r(this,Et).map(oe=>Math.floor(.7*(255-oe)+oe)))}const lt=document.createElement("span");lt.className="header";const Ct=document.createElement("h1");if(lt.append(Ct),{dir:Ct.dir,str:Ct.textContent}=r(this,Rt),et.append(lt),r(this,H)){const ne=document.createElement("span");ne.classList.add("popupDate"),r(this,H).then(se=>{ne.textContent=se}),lt.append(ne)}const It=r(this,Ot),Mt=r(this,ft);if(Mt!=null&&Mt.str&&(!(It!=null&&It.str)||It.str===Mt.str))C.XfaLayer.render({xfaHtml:Mt.html,intent:"richText",div:et}),et.lastChild.classList.add("richText","popupContent");else{const ne=this._formatContents(It);et.append(ne)}let Jt=!!r(this,Nt),Ut=Jt?r(this,Nt):r(this,it);for(const ne of r(this,Wt))if(!Ut||e.Util.intersect(ne.data.rect,Ut)!==null){Ut=ne.data.rect,Jt=!0;break}const Bt=e.Util.normalizeRect([Ut[0],z[3]-Ut[1]+z[1],Ut[2],z[3]-Ut[3]+z[1]]),Qt=5,Xt=Jt?Ut[2]-Ut[0]+Qt:0,qt=Bt[0]+Xt,te=Bt[1],{style:re}=r(this,mt);re.left=`${100*(qt-$)/o}%`,re.top=`${100*(te-Q)/B}%`,r(this,mt).append(et)}_formatContents(z){let{str:o,dir:B}=z;const $=document.createElement("p");$.classList.add("popupContent"),$.dir=B;const Q=o.split(/(?:\r\n?|\n)/);for(let et=0,lt=Q.length;et<lt;++et){const Ct=Q[et];$.append(document.createTextNode(Ct)),et<lt-1&&$.append(document.createElement("br"))}return $}forceHide(){at(this,Ft,this.isVisible),r(this,Ft)&&(r(this,mt).hidden=!0)}maybeShow(){r(this,Ft)&&(at(this,Ft,!1),r(this,mt).hidden=!1)}get isVisible(){return r(this,mt).hidden===!1}}H=new WeakMap,tt=new WeakMap,q=new WeakMap,ct=new WeakMap,ut=new WeakMap,Et=new WeakMap,mt=new WeakMap,Ot=new WeakMap,Wt=new WeakMap,kt=new WeakMap,Nt=new WeakMap,bt=new WeakMap,ht=new WeakMap,it=new WeakMap,ft=new WeakMap,Rt=new WeakMap,Ft=new WeakMap,zt=new WeakSet,Nn=function(z){z.altKey||z.shiftKey||z.ctrlKey||z.metaKey||(z.key==="Enter"||z.key==="Escape"&&r(this,bt))&&j(this,$t,Me).call(this)},$t=new WeakSet,Me=function(){at(this,bt,!r(this,bt)),r(this,bt)?(j(this,Kt,on).call(this),r(this,mt).addEventListener("click",r(this,ut)),r(this,mt).addEventListener("keydown",r(this,tt))):(j(this,Zt,ln).call(this),r(this,mt).removeEventListener("click",r(this,ut)),r(this,mt).removeEventListener("keydown",r(this,tt)))},Kt=new WeakSet,on=function(){r(this,ht)||this.render(),this.isVisible?r(this,bt)&&r(this,mt).classList.add("focused"):(r(this,mt).hidden=!1,r(this,mt).style.zIndex=parseInt(r(this,mt).style.zIndex)+1e3)},Zt=new WeakSet,ln=function(){r(this,mt).classList.remove("focused"),!(r(this,bt)||!this.isVisible)&&(r(this,mt).hidden=!0,r(this,mt).style.zIndex=parseInt(r(this,mt).style.zIndex)-1e3)};class N extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0}),this.textContent=z.data.textContent,this.textPosition=z.data.textPosition,this.annotationEditorType=e.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const z=document.createElement("div");z.classList.add("annotationTextContent"),z.setAttribute("role","comment");for(const o of this.textContent){const B=document.createElement("span");B.textContent=o,z.append(B)}this.container.append(z)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}l.FreeTextAnnotationElement=N;class D extends d{constructor(o){super(o,{isRenderable:!0,ignoreBorder:!0});X(this,yt,null)}render(){this.container.classList.add("lineAnnotation");const o=this.data,{width:B,height:$}=x(o.rect),Q=this.svgFactory.create(B,$,!0),et=at(this,yt,this.svgFactory.createElement("svg:line"));return et.setAttribute("x1",o.rect[2]-o.lineCoordinates[0]),et.setAttribute("y1",o.rect[3]-o.lineCoordinates[1]),et.setAttribute("x2",o.rect[2]-o.lineCoordinates[2]),et.setAttribute("y2",o.rect[3]-o.lineCoordinates[3]),et.setAttribute("stroke-width",o.borderStyle.width||1),et.setAttribute("stroke","transparent"),et.setAttribute("fill","transparent"),Q.append(et),this.container.append(Q),!o.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,yt)}addHighlightArea(){this.container.classList.add("highlightArea")}}yt=new WeakMap;class V extends d{constructor(o){super(o,{isRenderable:!0,ignoreBorder:!0});X(this,Z,null)}render(){this.container.classList.add("squareAnnotation");const o=this.data,{width:B,height:$}=x(o.rect),Q=this.svgFactory.create(B,$,!0),et=o.borderStyle.width,lt=at(this,Z,this.svgFactory.createElement("svg:rect"));return lt.setAttribute("x",et/2),lt.setAttribute("y",et/2),lt.setAttribute("width",B-et),lt.setAttribute("height",$-et),lt.setAttribute("stroke-width",et||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),this.container.append(Q),!o.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,Z)}addHighlightArea(){this.container.classList.add("highlightArea")}}Z=new WeakMap;class K extends d{constructor(o){super(o,{isRenderable:!0,ignoreBorder:!0});X(this,J,null)}render(){this.container.classList.add("circleAnnotation");const o=this.data,{width:B,height:$}=x(o.rect),Q=this.svgFactory.create(B,$,!0),et=o.borderStyle.width,lt=at(this,J,this.svgFactory.createElement("svg:ellipse"));return lt.setAttribute("cx",B/2),lt.setAttribute("cy",$/2),lt.setAttribute("rx",B/2-et/2),lt.setAttribute("ry",$/2-et/2),lt.setAttribute("stroke-width",et||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),this.container.append(Q),!o.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,J)}addHighlightArea(){this.container.classList.add("highlightArea")}}J=new WeakMap;class U extends d{constructor(o){super(o,{isRenderable:!0,ignoreBorder:!0});X(this,dt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const o=this.data,{width:B,height:$}=x(o.rect),Q=this.svgFactory.create(B,$,!0);let et=[];for(const Ct of o.vertices){const It=Ct.x-o.rect[0],Mt=o.rect[3]-Ct.y;et.push(It+","+Mt)}et=et.join(" ");const lt=at(this,dt,this.svgFactory.createElement(this.svgElementName));return lt.setAttribute("points",et),lt.setAttribute("stroke-width",o.borderStyle.width||1),lt.setAttribute("stroke","transparent"),lt.setAttribute("fill","transparent"),Q.append(lt),this.container.append(Q),!o.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return r(this,dt)}addHighlightArea(){this.container.classList.add("highlightArea")}}dt=new WeakMap;class _ extends U{constructor(z){super(z),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class nt extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class rt extends d{constructor(o){super(o,{isRenderable:!0,ignoreBorder:!0});X(this,jt,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=e.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const o=this.data,{width:B,height:$}=x(o.rect),Q=this.svgFactory.create(B,$,!0);for(const et of o.inkLists){let lt=[];for(const It of et){const Mt=It.x-o.rect[0],Jt=o.rect[3]-It.y;lt.push(`${Mt},${Jt}`)}lt=lt.join(" ");const Ct=this.svgFactory.createElement(this.svgElementName);r(this,jt).push(Ct),Ct.setAttribute("points",lt),Ct.setAttribute("stroke-width",o.borderStyle.width||1),Ct.setAttribute("stroke","transparent"),Ct.setAttribute("fill","transparent"),!o.popupRef&&this.hasPopupData&&this._createPopup(),Q.append(Ct)}return this.container.append(Q),this.container}getElementsToTriggerPopup(){return r(this,jt)}addHighlightArea(){this.container.classList.add("highlightArea")}}jt=new WeakMap,l.InkAnnotationElement=rt;class Y extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class st extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class gt extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class At extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class wt extends d{constructor(z){super(z,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}l.StampAnnotationElement=wt;class W extends d{constructor(o){var Q;super(o,{isRenderable:!0});X(this,G);X(this,ot,null);const{filename:B,content:$}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(B,!0),this.content=$,(Q=this.linkService.eventBus)==null||Q.dispatch("fileattachmentannotation",{source:this,filename:B,content:$})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:o,data:B}=this;let $;B.hasAppearance||B.fillAlpha===0?$=document.createElement("div"):($=document.createElement("img"),$.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(B.name)?"paperclip":"pushpin"}.svg`,B.fillAlpha&&B.fillAlpha<1&&($.style=`filter: opacity(${Math.round(B.fillAlpha*100)}%);`)),$.addEventListener("dblclick",j(this,G,cn).bind(this)),at(this,ot,$);const{isMac:Q}=e.FeatureTest.platform;return o.addEventListener("keydown",et=>{et.key==="Enter"&&(Q?et.metaKey:et.ctrlKey)&&j(this,G,cn).call(this)}),!B.popupRef&&this.hasPopupData?this._createPopup():$.classList.add("popupTriggerArea"),o.append($),o}getElementsToTriggerPopup(){return r(this,ot)}addHighlightArea(){this.container.classList.add("highlightArea")}}ot=new WeakMap,G=new WeakSet,cn=function(){var o;(o=this.downloadManager)==null||o.openOrDownloadData(this.container,this.content,this.filename)};class h{constructor(z){X(this,vt);X(this,Tt);X(this,xt,null);X(this,St,null);X(this,Pt,new Map);let{div:o,accessibilityManager:B,annotationCanvasMap:$,l10n:Q,page:et,viewport:lt}=z;this.div=o,at(this,xt,B),at(this,St,$),this.l10n=Q,this.page=et,this.viewport=lt,this.zIndex=0,this.l10n||(this.l10n=F.NullL10n)}async render(z){const{annotations:o}=z,B=this.div;(0,n.setLayerDimensions)(B,this.viewport);const $=new Map,Q={data:null,layer:B,linkService:z.linkService,downloadManager:z.downloadManager,imageResourcesPath:z.imageResourcesPath||"",renderForms:z.renderForms!==!1,svgFactory:new n.DOMSVGFactory,annotationStorage:z.annotationStorage||new c.AnnotationStorage,enableScripting:z.enableScripting===!0,hasJSActions:z.hasJSActions,fieldObjects:z.fieldObjects,parent:this,elements:null};for(const et of o){if(et.noHTML)continue;const lt=et.annotationType===e.AnnotationType.POPUP;if(lt){const Mt=$.get(et.id);if(!Mt)continue;Q.elements=Mt}else{const{width:Mt,height:Jt}=x(et.rect);if(Mt<=0||Jt<=0)continue}Q.data=et;const Ct=T.create(Q);if(!Ct.isRenderable)continue;if(!lt&&et.popupRef){const Mt=$.get(et.popupRef);Mt?Mt.push(Ct):$.set(et.popupRef,[Ct])}Ct.annotationEditorType>0&&r(this,Pt).set(Ct.data.id,Ct);const It=Ct.render();et.hidden&&(It.style.visibility="hidden"),j(this,vt,Bn).call(this,It,et.id)}j(this,Tt,hn).call(this),await this.l10n.translate(B)}update(z){let{viewport:o}=z;const B=this.div;this.viewport=o,(0,n.setLayerDimensions)(B,{rotation:o.rotation}),j(this,Tt,hn).call(this),B.hidden=!1}getEditableAnnotations(){return Array.from(r(this,Pt).values())}getEditableAnnotation(z){return r(this,Pt).get(z)}}xt=new WeakMap,St=new WeakMap,Pt=new WeakMap,vt=new WeakSet,Bn=function(z,o){var $;const B=z.firstChild||z;B.id=`${e.AnnotationPrefix}${o}`,this.div.append(z),($=r(this,xt))==null||$.moveElementInDOM(this.div,z,B,!1)},Tt=new WeakSet,hn=function(){if(!r(this,St))return;const z=this.div;for(const[o,B]of r(this,St)){const $=z.querySelector(`[data-annotation-id="${o}"]`);if(!$)continue;const{firstChild:Q}=$;Q?Q.nodeName==="CANVAS"?Q.replaceWith(B):Q.before(B):$.append(B)}r(this,St).clear()},l.AnnotationLayer=h},(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorConverters=void 0;function t(c){return Math.floor(Math.max(0,Math.min(1,c))*255).toString(16).padStart(2,"0")}function e(c){return Math.max(0,Math.min(255,255*c))}class n{static CMYK_G(b){let[F,C,S,v]=b;return["G",1-Math.min(1,.3*F+.59*S+.11*C+v)]}static G_CMYK(b){let[F]=b;return["CMYK",0,0,0,1-F]}static G_RGB(b){let[F]=b;return["RGB",F,F,F]}static G_rgb(b){let[F]=b;return F=e(F),[F,F,F]}static G_HTML(b){let[F]=b;const C=t(F);return`#${C}${C}${C}`}static RGB_G(b){let[F,C,S]=b;return["G",.3*F+.59*C+.11*S]}static RGB_rgb(b){return b.map(e)}static RGB_HTML(b){return`#${b.map(t).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(b){let[F,C,S,v]=b;return["RGB",1-Math.min(1,F+v),1-Math.min(1,S+v),1-Math.min(1,C+v)]}static CMYK_rgb(b){let[F,C,S,v]=b;return[e(1-Math.min(1,F+v)),e(1-Math.min(1,S+v)),e(1-Math.min(1,C+v))]}static CMYK_HTML(b){const F=this.CMYK_RGB(b).slice(1);return this.RGB_HTML(F)}static RGB_CMYK(b){let[F,C,S]=b;const v=1-F,M=1-C,x=1-S,T=Math.min(v,M,x);return["CMYK",v,M,x,T]}}l.ColorConverters=n},(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.NullL10n=void 0,l.getL10nFallback=e;const t={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"};t.print_progress_percent="{{progress}}%";function e(b,F){switch(b){case"find_match_count":b=`find_match_count[${F.total===1?"one":"other"}]`;break;case"find_match_count_limit":b=`find_match_count_limit[${F.limit===1?"one":"other"}]`;break}return t[b]||""}function n(b,F){return F?b.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(C,S)=>S in F?F[S]:"{{"+S+"}}"):b}const c={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(b){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e(b,F);return n(C,F)},async translate(b){}};l.NullL10n=c},(k,l,t)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.XfaLayer=void 0,t(89);var e=t(194);class n{static setupStorage(b,F,C,S,v){const M=S.getValue(F,{value:null});switch(C.name){case"textarea":if(M.value!==null&&(b.textContent=M.value),v==="print")break;b.addEventListener("input",x=>{S.setValue(F,{value:x.target.value})});break;case"input":if(C.attributes.type==="radio"||C.attributes.type==="checkbox"){if(M.value===C.attributes.xfaOn?b.setAttribute("checked",!0):M.value===C.attributes.xfaOff&&b.removeAttribute("checked"),v==="print")break;b.addEventListener("change",x=>{S.setValue(F,{value:x.target.checked?x.target.getAttribute("xfaOn"):x.target.getAttribute("xfaOff")})})}else{if(M.value!==null&&b.setAttribute("value",M.value),v==="print")break;b.addEventListener("input",x=>{S.setValue(F,{value:x.target.value})})}break;case"select":if(M.value!==null){b.setAttribute("value",M.value);for(const x of C.children)x.attributes.value===M.value?x.attributes.selected=!0:x.attributes.hasOwnProperty("selected")&&delete x.attributes.selected}b.addEventListener("input",x=>{const T=x.target.options,d=T.selectedIndex===-1?"":T[T.selectedIndex].value;S.setValue(F,{value:d})});break}}static setAttributes(b){let{html:F,element:C,storage:S=null,intent:v,linkService:M}=b;const{attributes:x}=C,T=F instanceof HTMLAnchorElement;x.type==="radio"&&(x.name=`${x.name}-${v}`);for(const[d,a]of Object.entries(x))if(a!=null)switch(d){case"class":a.length&&F.setAttribute(d,a.join(" "));break;case"dataId":break;case"id":F.setAttribute("data-element-id",a);break;case"style":Object.assign(F.style,a);break;case"textContent":F.textContent=a;break;default:(!T||d!=="href"&&d!=="newWindow")&&F.setAttribute(d,a)}T&&M.addLinkAttributes(F,x.href,x.newWindow),S&&x.dataId&&this.setupStorage(F,x.dataId,C,S)}static render(b){var a;const F=b.annotationStorage,C=b.linkService,S=b.xfaHtml,v=b.intent||"display",M=document.createElement(S.name);S.attributes&&this.setAttributes({html:M,element:S,intent:v,linkService:C});const x=[[S,-1,M]],T=b.div;if(T.append(M),b.viewport){const i=`matrix(${b.viewport.transform.join(",")})`;T.style.transform=i}v!=="richText"&&T.setAttribute("class","xfaLayer xfaFont");const d=[];for(;x.length>0;){const[i,f,E]=x.at(-1);if(f+1===i.children.length){x.pop();continue}const O=i.children[++x.at(-1)[1]];if(O===null)continue;const{name:R}=O;if(R==="#text"){const m=document.createTextNode(O.value);d.push(m),E.append(m);continue}const u=(a=O==null?void 0:O.attributes)!=null&&a.xmlns?document.createElementNS(O.attributes.xmlns,R):document.createElement(R);if(E.append(u),O.attributes&&this.setAttributes({html:u,element:O,storage:F,intent:v,linkService:C}),O.children&&O.children.length>0)x.push([O,-1,u]);else if(O.value){const m=document.createTextNode(O.value);e.XfaText.shouldBuildText(R)&&d.push(m),u.append(m)}}for(const i of T.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))i.setAttribute("readOnly",!0);return{textDivs:d}}static update(b){const F=`matrix(${b.viewport.transform.join(",")})`;b.div.style.transform=F,b.div.hidden=!1}}l.XfaLayer=n},(k,l,t)=>{var S,v,M,x,T,d,a,i,f,E,O,R,u,m,L,Un,y,Wn,D,Hn,K,zn,_,un,rt,Gn,st,dn,At,$n,W,Vn,g,Xn,p,Yn,I,_n,H,ae,q,fn,ut,Fe,mt,Ie,Wt,fe,Nt,pn,ht,Oe,ft,Kn,Ft,gn,Vt,Jn,Gt,Qn,Yt,mn,_t,De,Z,pe;Object.defineProperty(l,"__esModule",{value:!0}),l.InkEditor=void 0,t(89),t(2);var e=t(1),n=t(164),c=t(198),b=t(168),F=t(165);const dt=class dt extends n.AnnotationEditor{constructor(G){super({...G,name:"inkEditor"});X(this,L);X(this,y);X(this,D);X(this,K);X(this,_);X(this,rt);X(this,st);X(this,At);X(this,W);X(this,g);X(this,p);X(this,I);X(this,H);X(this,q);X(this,ut);X(this,mt);X(this,Wt);X(this,Nt);X(this,ht);X(this,Gt);X(this,Yt);X(this,_t);X(this,Z);X(this,S,0);X(this,v,0);X(this,M,this.canvasPointermove.bind(this));X(this,x,this.canvasPointerleave.bind(this));X(this,T,this.canvasPointerup.bind(this));X(this,d,this.canvasPointerdown.bind(this));X(this,a,new Path2D);X(this,i,!1);X(this,f,!1);X(this,E,!1);X(this,O,null);X(this,R,0);X(this,u,0);X(this,m,null);this.color=G.color||null,this.thickness=G.thickness||null,this.opacity=G.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(G){n.AnnotationEditor.initialize(G,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(G,pt){switch(G){case e.AnnotationEditorParamsType.INK_THICKNESS:dt._defaultThickness=pt;break;case e.AnnotationEditorParamsType.INK_COLOR:dt._defaultColor=pt;break;case e.AnnotationEditorParamsType.INK_OPACITY:dt._defaultOpacity=pt/100;break}}updateParams(G,pt){switch(G){case e.AnnotationEditorParamsType.INK_THICKNESS:j(this,L,Un).call(this,pt);break;case e.AnnotationEditorParamsType.INK_COLOR:j(this,y,Wn).call(this,pt);break;case e.AnnotationEditorParamsType.INK_OPACITY:j(this,D,Hn).call(this,pt);break}}static get defaultPropertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,dt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,dt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(dt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[e.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||dt._defaultThickness],[e.AnnotationEditorParamsType.INK_COLOR,this.color||dt._defaultColor||n.AnnotationEditor._defaultLineColor],[e.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??dt._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(j(this,ut,Fe).call(this),j(this,mt,Ie).call(this)),this.isAttachedToDOM||(this.parent.add(this),j(this,Wt,fe).call(this)),j(this,Z,pe).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,r(this,O).disconnect(),at(this,O,null),super.remove())}setParent(G){!this.parent&&G?this._uiManager.removeShouldRescale(this):this.parent&&G===null&&this._uiManager.addShouldRescale(this),super.setParent(G)}onScaleChanging(){const[G,pt]=this.parentDimensions,xt=this.width*G,St=this.height*pt;this.setDimensions(xt,St)}enableEditMode(){r(this,i)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",r(this,d)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",r(this,d)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){r(this,i)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),at(this,i,!0),this.div.classList.add("disabled"),j(this,Z,pe).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(G){this._focusEventsAllowed&&(super.focusin(G),this.enableEditMode())}canvasPointerdown(G){G.button!==0||!this.isInEditMode()||r(this,i)||(this.setInForeground(),G.preventDefault(),G.type!=="mouse"&&this.div.focus(),j(this,rt,Gn).call(this,G.offsetX,G.offsetY))}canvasPointermove(G){G.preventDefault(),j(this,st,dn).call(this,G.offsetX,G.offsetY)}canvasPointerup(G){G.preventDefault(),j(this,q,fn).call(this,G)}canvasPointerleave(G){j(this,q,fn).call(this,G)}get isResizable(){return!this.isEmpty()&&r(this,i)}render(){if(this.div)return this.div;let G,pt;this.width&&(G=this.x,pt=this.y),super.render(),n.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Ht=>{var Tt;return(Tt=this.div)==null?void 0:Tt.setAttribute("aria-label",Ht)});const[xt,St,Pt,vt]=j(this,K,zn).call(this);if(this.setAt(xt,St,0,0),this.setDims(Pt,vt),j(this,ut,Fe).call(this),this.width){const[Ht,Tt]=this.parentDimensions;this.setAspectRatio(this.width*Ht,this.height*Tt),this.setAt(G*Ht,pt*Tt,this.width*Ht,this.height*Tt),at(this,E,!0),j(this,Wt,fe).call(this),this.setDims(this.width*Ht,this.height*Tt),j(this,H,ae).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return j(this,mt,Ie).call(this),this.div}setDimensions(G,pt){const xt=Math.round(G),St=Math.round(pt);if(r(this,R)===xt&&r(this,u)===St)return;at(this,R,xt),at(this,u,St),this.canvas.style.visibility="hidden";const[Pt,vt]=this.parentDimensions;this.width=G/Pt,this.height=pt/vt,this.fixAndSetPosition(),r(this,i)&&j(this,Nt,pn).call(this,G,pt),j(this,Wt,fe).call(this),j(this,H,ae).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(G,pt,xt){var Q,et,lt;if(G instanceof c.InkAnnotationElement)return null;const St=super.deserialize(G,pt,xt);St.thickness=G.thickness,St.color=e.Util.makeHexColor(...G.color),St.opacity=G.opacity;const[Pt,vt]=St.pageDimensions,Ht=St.width*Pt,Tt=St.height*vt,Lt=St.parentScale,Dt=G.thickness/2;at(St,i,!0),at(St,R,Math.round(Ht)),at(St,u,Math.round(Tt));const{paths:z,rect:o,rotation:B}=G;for(let{bezier:Ct}of z){Ct=j(Q=dt,Vt,Jn).call(Q,Ct,o,B);const It=[];St.paths.push(It);let Mt=Lt*(Ct[0]-Dt),Jt=Lt*(Ct[1]-Dt);for(let Bt=2,Qt=Ct.length;Bt<Qt;Bt+=6){const Xt=Lt*(Ct[Bt]-Dt),qt=Lt*(Ct[Bt+1]-Dt),te=Lt*(Ct[Bt+2]-Dt),re=Lt*(Ct[Bt+3]-Dt),ne=Lt*(Ct[Bt+4]-Dt),se=Lt*(Ct[Bt+5]-Dt);It.push([[Mt,Jt],[Xt,qt],[te,re],[ne,se]]),Mt=ne,Jt=se}const Ut=j(this,ft,Kn).call(this,It);St.bezierPath2D.push(Ut)}const $=j(et=St,Yt,mn).call(et);return at(St,v,Math.max(n.AnnotationEditor.MIN_SIZE,$[2]-$[0])),at(St,S,Math.max(n.AnnotationEditor.MIN_SIZE,$[3]-$[1])),j(lt=St,Nt,pn).call(lt,Ht,Tt),St}serialize(){if(this.isEmpty())return null;const G=this.getRect(0,0),pt=n.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:e.AnnotationEditorType.INK,color:pt,thickness:this.thickness,opacity:this.opacity,paths:j(this,Gt,Qn).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,G),pageIndex:this.pageIndex,rect:G,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};S=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakMap,E=new WeakMap,O=new WeakMap,R=new WeakMap,u=new WeakMap,m=new WeakMap,L=new WeakSet,Un=function(G){const pt=this.thickness;this.addCommands({cmd:()=>{this.thickness=G,j(this,Z,pe).call(this)},undo:()=>{this.thickness=pt,j(this,Z,pe).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},y=new WeakSet,Wn=function(G){const pt=this.color;this.addCommands({cmd:()=>{this.color=G,j(this,H,ae).call(this)},undo:()=>{this.color=pt,j(this,H,ae).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},D=new WeakSet,Hn=function(G){G/=100;const pt=this.opacity;this.addCommands({cmd:()=>{this.opacity=G,j(this,H,ae).call(this)},undo:()=>{this.opacity=pt,j(this,H,ae).call(this)},mustExec:!0,type:e.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},K=new WeakSet,zn=function(){const{parentRotation:G,parentDimensions:[pt,xt]}=this;switch(G){case 90:return[0,xt,xt,pt];case 180:return[pt,xt,pt,xt];case 270:return[pt,0,xt,pt];default:return[0,0,pt,xt]}},_=new WeakSet,un=function(){const{ctx:G,color:pt,opacity:xt,thickness:St,parentScale:Pt,scaleFactor:vt}=this;G.lineWidth=St*Pt/vt,G.lineCap="round",G.lineJoin="round",G.miterLimit=10,G.strokeStyle=`${pt}${(0,F.opacityToHex)(xt)}`},rt=new WeakSet,Gn=function(G,pt){this.canvas.addEventListener("contextmenu",b.noContextMenu),this.canvas.addEventListener("pointerleave",r(this,x)),this.canvas.addEventListener("pointermove",r(this,M)),this.canvas.addEventListener("pointerup",r(this,T)),this.canvas.removeEventListener("pointerdown",r(this,d)),this.isEditing=!0,r(this,E)||(at(this,E,!0),j(this,Wt,fe).call(this),this.thickness||(this.thickness=dt._defaultThickness),this.color||(this.color=dt._defaultColor||n.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=dt._defaultOpacity)),this.currentPath.push([G,pt]),at(this,f,!1),j(this,_,un).call(this),at(this,m,()=>{j(this,g,Xn).call(this),r(this,m)&&window.requestAnimationFrame(r(this,m))}),window.requestAnimationFrame(r(this,m))},st=new WeakSet,dn=function(G,pt){const[xt,St]=this.currentPath.at(-1);if(this.currentPath.length>1&&G===xt&&pt===St)return;const Pt=this.currentPath;let vt=r(this,a);if(Pt.push([G,pt]),at(this,f,!0),Pt.length<=2){vt.moveTo(...Pt[0]),vt.lineTo(G,pt);return}Pt.length===3&&(at(this,a,vt=new Path2D),vt.moveTo(...Pt[0])),j(this,p,Yn).call(this,vt,...Pt.at(-3),...Pt.at(-2),G,pt)},At=new WeakSet,$n=function(){if(this.currentPath.length===0)return;const G=this.currentPath.at(-1);r(this,a).lineTo(...G)},W=new WeakSet,Vn=function(G,pt){at(this,m,null),G=Math.min(Math.max(G,0),this.canvas.width),pt=Math.min(Math.max(pt,0),this.canvas.height),j(this,st,dn).call(this,G,pt),j(this,At,$n).call(this);let xt;if(this.currentPath.length!==1)xt=j(this,I,_n).call(this);else{const Tt=[G,pt];xt=[[Tt,Tt.slice(),Tt.slice(),Tt]]}const St=r(this,a),Pt=this.currentPath;this.currentPath=[],at(this,a,new Path2D);const vt=()=>{this.allRawPaths.push(Pt),this.paths.push(xt),this.bezierPath2D.push(St),this.rebuild()},Ht=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(j(this,ut,Fe).call(this),j(this,mt,Ie).call(this)),j(this,Z,pe).call(this))};this.addCommands({cmd:vt,undo:Ht,mustExec:!0})},g=new WeakSet,Xn=function(){if(!r(this,f))return;at(this,f,!1);const G=Math.ceil(this.thickness*this.parentScale),pt=this.currentPath.slice(-3),xt=pt.map(vt=>vt[0]),St=pt.map(vt=>vt[1]);Math.min(...xt)-G,Math.max(...xt)+G,Math.min(...St)-G,Math.max(...St)+G;const{ctx:Pt}=this;Pt.save(),Pt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const vt of this.bezierPath2D)Pt.stroke(vt);Pt.stroke(r(this,a)),Pt.restore()},p=new WeakSet,Yn=function(G,pt,xt,St,Pt,vt,Ht){const Tt=(pt+St)/2,Lt=(xt+Pt)/2,Dt=(St+vt)/2,z=(Pt+Ht)/2;G.bezierCurveTo(Tt+2*(St-Tt)/3,Lt+2*(Pt-Lt)/3,Dt+2*(St-Dt)/3,z+2*(Pt-z)/3,Dt,z)},I=new WeakSet,_n=function(){const G=this.currentPath;if(G.length<=2)return[[G[0],G[0],G.at(-1),G.at(-1)]];const pt=[];let xt,[St,Pt]=G[0];for(xt=1;xt<G.length-2;xt++){const[o,B]=G[xt],[$,Q]=G[xt+1],et=(o+$)/2,lt=(B+Q)/2,Ct=[St+2*(o-St)/3,Pt+2*(B-Pt)/3],It=[et+2*(o-et)/3,lt+2*(B-lt)/3];pt.push([[St,Pt],Ct,It,[et,lt]]),[St,Pt]=[et,lt]}const[vt,Ht]=G[xt],[Tt,Lt]=G[xt+1],Dt=[St+2*(vt-St)/3,Pt+2*(Ht-Pt)/3],z=[Tt+2*(vt-Tt)/3,Lt+2*(Ht-Lt)/3];return pt.push([[St,Pt],Dt,z,[Tt,Lt]]),pt},H=new WeakSet,ae=function(){if(this.isEmpty()){j(this,ht,Oe).call(this);return}j(this,_,un).call(this);const{canvas:G,ctx:pt}=this;pt.setTransform(1,0,0,1,0,0),pt.clearRect(0,0,G.width,G.height),j(this,ht,Oe).call(this);for(const xt of this.bezierPath2D)pt.stroke(xt)},q=new WeakSet,fn=function(G){this.canvas.removeEventListener("pointerleave",r(this,x)),this.canvas.removeEventListener("pointermove",r(this,M)),this.canvas.removeEventListener("pointerup",r(this,T)),this.canvas.addEventListener("pointerdown",r(this,d)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",b.noContextMenu)},10),j(this,W,Vn).call(this,G.offsetX,G.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ut=new WeakSet,Fe=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",n.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(G=>{var pt;return(pt=this.canvas)==null?void 0:pt.setAttribute("aria-label",G)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},mt=new WeakSet,Ie=function(){at(this,O,new ResizeObserver(G=>{const pt=G[0].contentRect;pt.width&&pt.height&&this.setDimensions(pt.width,pt.height)})),r(this,O).observe(this.div)},Wt=new WeakSet,fe=function(){if(!r(this,E))return;const[G,pt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*G),this.canvas.height=Math.ceil(this.height*pt),j(this,ht,Oe).call(this)},Nt=new WeakSet,pn=function(G,pt){const xt=j(this,_t,De).call(this),St=(G-xt)/r(this,v),Pt=(pt-xt)/r(this,S);this.scaleFactor=Math.min(St,Pt)},ht=new WeakSet,Oe=function(){const G=j(this,_t,De).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+G,this.translationY*this.scaleFactor+G)},ft=new WeakSet,Kn=function(G){const pt=new Path2D;for(let xt=0,St=G.length;xt<St;xt++){const[Pt,vt,Ht,Tt]=G[xt];xt===0&&pt.moveTo(...Pt),pt.bezierCurveTo(vt[0],vt[1],Ht[0],Ht[1],Tt[0],Tt[1])}return pt},Ft=new WeakSet,gn=function(G,pt,xt){const[St,Pt,vt,Ht]=pt;switch(xt){case 0:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2)G[Tt]+=St,G[Tt+1]=Ht-G[Tt+1];break;case 90:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2){const Dt=G[Tt];G[Tt]=G[Tt+1]+St,G[Tt+1]=Dt+Pt}break;case 180:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2)G[Tt]=vt-G[Tt],G[Tt+1]+=Pt;break;case 270:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2){const Dt=G[Tt];G[Tt]=vt-G[Tt+1],G[Tt+1]=Ht-Dt}break;default:throw new Error("Invalid rotation")}return G},Vt=new WeakSet,Jn=function(G,pt,xt){const[St,Pt,vt,Ht]=pt;switch(xt){case 0:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2)G[Tt]-=St,G[Tt+1]=Ht-G[Tt+1];break;case 90:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2){const Dt=G[Tt];G[Tt]=G[Tt+1]-Pt,G[Tt+1]=Dt-St}break;case 180:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2)G[Tt]=vt-G[Tt],G[Tt+1]-=Pt;break;case 270:for(let Tt=0,Lt=G.length;Tt<Lt;Tt+=2){const Dt=G[Tt];G[Tt]=Ht-G[Tt+1],G[Tt+1]=vt-Dt}break;default:throw new Error("Invalid rotation")}return G},Gt=new WeakSet,Qn=function(G,pt,xt,St){var Lt,Dt;const Pt=[],vt=this.thickness/2,Ht=G*pt+vt,Tt=G*xt+vt;for(const z of this.paths){const o=[],B=[];for(let $=0,Q=z.length;$<Q;$++){const[et,lt,Ct,It]=z[$],Mt=G*et[0]+Ht,Jt=G*et[1]+Tt,Ut=G*lt[0]+Ht,Bt=G*lt[1]+Tt,Qt=G*Ct[0]+Ht,Xt=G*Ct[1]+Tt,qt=G*It[0]+Ht,te=G*It[1]+Tt;$===0&&(o.push(Mt,Jt),B.push(Mt,Jt)),o.push(Ut,Bt,Qt,Xt,qt,te),B.push(Ut,Bt),$===Q-1&&B.push(qt,te)}Pt.push({bezier:j(Lt=dt,Ft,gn).call(Lt,o,St,this.rotation),points:j(Dt=dt,Ft,gn).call(Dt,B,St,this.rotation)})}return Pt},Yt=new WeakSet,mn=function(){let G=1/0,pt=-1/0,xt=1/0,St=-1/0;for(const Pt of this.paths)for(const[vt,Ht,Tt,Lt]of Pt){const Dt=e.Util.bezierBoundingBox(...vt,...Ht,...Tt,...Lt);G=Math.min(G,Dt[0]),xt=Math.min(xt,Dt[1]),pt=Math.max(pt,Dt[2]),St=Math.max(St,Dt[3])}return[G,xt,pt,St]},_t=new WeakSet,De=function(){return r(this,i)?Math.ceil(this.thickness*this.parentScale):0},Z=new WeakSet,pe=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!r(this,i)){j(this,H,ae).call(this);return}const pt=j(this,Yt,mn).call(this),xt=j(this,_t,De).call(this);at(this,v,Math.max(n.AnnotationEditor.MIN_SIZE,pt[2]-pt[0])),at(this,S,Math.max(n.AnnotationEditor.MIN_SIZE,pt[3]-pt[1]));const St=Math.ceil(xt+r(this,v)*this.scaleFactor),Pt=Math.ceil(xt+r(this,S)*this.scaleFactor),[vt,Ht]=this.parentDimensions;this.width=St/vt,this.height=Pt/Ht,this.setAspectRatio(St,Pt);const Tt=this.translationX,Lt=this.translationY;this.translationX=-pt[0],this.translationY=-pt[1],j(this,Wt,fe).call(this),j(this,H,ae).call(this),at(this,R,St),at(this,u,Pt),this.setDims(St,Pt);const Dt=G?xt/this.scaleFactor/2:0;this.translate(Tt-this.translationX-Dt,Lt-this.translationY-Dt)},X(dt,ft),X(dt,Ft),X(dt,Vt),ee(dt,"_defaultColor",null),ee(dt,"_defaultOpacity",1),ee(dt,"_defaultThickness",1),ee(dt,"_type","ink");let C=dt;l.InkEditor=C},(k,l,t)=>{var C,S,v,M,x,T,d,a,i,f,E,Se,R,Ee,m,Le,w,vn,N,Zn,V,jn,U,bn,nt,Ne,Y,qn;Object.defineProperty(l,"__esModule",{value:!0}),l.StampEditor=void 0,t(149),t(152);var e=t(1),n=t(164),c=t(168),b=t(198);const gt=class gt extends n.AnnotationEditor{constructor(W){super({...W,name:"stampEditor"});X(this,E);X(this,R);X(this,m);X(this,w);X(this,N);X(this,V);X(this,U);X(this,nt);X(this,Y);X(this,C,null);X(this,S,null);X(this,v,null);X(this,M,null);X(this,x,null);X(this,T,null);X(this,d,null);X(this,a,null);X(this,i,!1);X(this,f,!1);at(this,M,W.bitmapUrl),at(this,x,W.bitmapFile)}static initialize(W){n.AnnotationEditor.initialize(W)}static get supportedTypes(){const W=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,e.shadow)(this,"supportedTypes",W.map(h=>`image/${h}`))}static get supportedTypesStr(){return(0,e.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(W){return this.supportedTypes.includes(W)}static paste(W,h){h.pasteEditor(e.AnnotationEditorType.STAMP,{bitmapFile:W.getAsFile()})}remove(){var W,h;r(this,S)&&(at(this,C,null),this._uiManager.imageManager.deleteId(r(this,S)),(W=r(this,T))==null||W.remove(),at(this,T,null),(h=r(this,d))==null||h.disconnect(),at(this,d,null)),super.remove()}rebuild(){if(!this.parent){r(this,S)&&j(this,m,Le).call(this);return}super.rebuild(),this.div!==null&&(r(this,S)&&j(this,m,Le).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(r(this,v)||r(this,C)||r(this,M)||r(this,x))}get isResizable(){return!0}render(){if(this.div)return this.div;let W,h;if(this.width&&(W=this.x,h=this.y),super.render(),this.div.hidden=!0,r(this,C)?j(this,w,vn).call(this):j(this,m,Le).call(this),this.width){const[g,s]=this.parentDimensions;this.setAt(W*g,h*s,this.width*g,this.height*s)}return this.div}static deserialize(W,h,g){if(W instanceof b.StampAnnotationElement)return null;const s=super.deserialize(W,h,g),{rect:p,bitmapUrl:A,bitmapId:I,isSvg:P,accessibilityData:H}=W;I&&g.imageManager.isValidId(I)?at(s,S,I):at(s,M,A),at(s,i,P);const[tt,q]=s.pageDimensions;return s.width=(p[2]-p[0])/tt,s.height=(p[3]-p[1])/q,H&&(s.altTextData=H),s}serialize(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.isEmpty())return null;const g={annotationType:e.AnnotationEditorType.STAMP,bitmapId:r(this,S),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:r(this,i),structTreeParentId:this._structTreeParentId};if(W)return g.bitmapUrl=j(this,nt,Ne).call(this,!0),g.accessibilityData=this.altTextData,g;const{decorative:s,altText:p}=this.altTextData;if(!s&&p&&(g.accessibilityData={type:"Figure",alt:p}),h===null)return g;h.stamps||(h.stamps=new Map);const A=r(this,i)?(g.rect[2]-g.rect[0])*(g.rect[3]-g.rect[1]):null;if(!h.stamps.has(r(this,S)))h.stamps.set(r(this,S),{area:A,serialized:g}),g.bitmap=j(this,nt,Ne).call(this,!1);else if(r(this,i)){const I=h.stamps.get(r(this,S));A>I.area&&(I.area=A,I.serialized.bitmap.close(),I.serialized.bitmap=j(this,nt,Ne).call(this,!1))}return g}};C=new WeakMap,S=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,T=new WeakMap,d=new WeakMap,a=new WeakMap,i=new WeakMap,f=new WeakMap,E=new WeakSet,Se=function(W){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!W){this.remove();return}at(this,C,W.bitmap),h||(at(this,S,W.id),at(this,i,W.isSvg)),j(this,w,vn).call(this)},R=new WeakSet,Ee=function(){at(this,v,null),this._uiManager.enableWaiting(!1),r(this,T)&&this.div.focus()},m=new WeakSet,Le=function(){if(r(this,S)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(r(this,S)).then(h=>j(this,E,Se).call(this,h,!0)).finally(()=>j(this,R,Ee).call(this));return}if(r(this,M)){const h=r(this,M);at(this,M,null),this._uiManager.enableWaiting(!0),at(this,v,this._uiManager.imageManager.getFromUrl(h).then(g=>j(this,E,Se).call(this,g)).finally(()=>j(this,R,Ee).call(this)));return}if(r(this,x)){const h=r(this,x);at(this,x,null),this._uiManager.enableWaiting(!0),at(this,v,this._uiManager.imageManager.getFromFile(h).then(g=>j(this,E,Se).call(this,g)).finally(()=>j(this,R,Ee).call(this)));return}const W=document.createElement("input");W.type="file",W.accept=gt.supportedTypesStr,at(this,v,new Promise(h=>{W.addEventListener("change",async()=>{if(!W.files||W.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const g=await this._uiManager.imageManager.getFromFile(W.files[0]);j(this,E,Se).call(this,g)}h()}),W.addEventListener("cancel",()=>{this.remove(),h()})}).finally(()=>j(this,R,Ee).call(this))),W.click()},w=new WeakSet,vn=function(){const{div:W}=this;let{width:h,height:g}=r(this,C);const[s,p]=this.pageDimensions,A=.75;if(this.width)h=this.width*s,g=this.height*p;else if(h>A*s||g>A*p){const tt=Math.min(A*s/h,A*p/g);h*=tt,g*=tt}const[I,P]=this.parentDimensions;this.setDims(h*I/s,g*P/p),this._uiManager.enableWaiting(!1);const H=at(this,T,document.createElement("canvas"));W.append(H),W.hidden=!1,j(this,U,bn).call(this,h,g),j(this,Y,qn).call(this),r(this,f)||(this.parent.addUndoableEditor(this),at(this,f,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},N=new WeakSet,Zn=function(W,h){var A;const[g,s]=this.parentDimensions;this.width=W/g,this.height=h/s,this.setDims(W,h),(A=this._initialOptions)!=null&&A.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,r(this,a)!==null&&clearTimeout(r(this,a)),at(this,a,setTimeout(()=>{at(this,a,null),j(this,U,bn).call(this,W,h)},200))},V=new WeakSet,jn=function(W,h){const{width:g,height:s}=r(this,C);let p=g,A=s,I=r(this,C);for(;p>2*W||A>2*h;){const P=p,H=A;p>2*W&&(p=p>=16384?Math.floor(p/2)-1:Math.ceil(p/2)),A>2*h&&(A=A>=16384?Math.floor(A/2)-1:Math.ceil(A/2));const tt=new OffscreenCanvas(p,A);tt.getContext("2d").drawImage(I,0,0,P,H,0,0,p,A),I=tt.transferToImageBitmap()}return I},U=new WeakSet,bn=function(W,h){W=Math.ceil(W),h=Math.ceil(h);const g=r(this,T);if(!g||g.width===W&&g.height===h)return;g.width=W,g.height=h;const s=r(this,i)?r(this,C):j(this,V,jn).call(this,W,h),p=g.getContext("2d");p.filter=this._uiManager.hcmFilter,p.drawImage(s,0,0,s.width,s.height,0,0,W,h)},nt=new WeakSet,Ne=function(W){if(W){if(r(this,i)){const s=this._uiManager.imageManager.getSvgUrl(r(this,S));if(s)return s}const h=document.createElement("canvas");return{width:h.width,height:h.height}=r(this,C),h.getContext("2d").drawImage(r(this,C),0,0),h.toDataURL()}if(r(this,i)){const[h,g]=this.pageDimensions,s=Math.round(this.width*h*c.PixelsPerInch.PDF_TO_CSS_UNITS),p=Math.round(this.height*g*c.PixelsPerInch.PDF_TO_CSS_UNITS),A=new OffscreenCanvas(s,p);return A.getContext("2d").drawImage(r(this,C),0,0,r(this,C).width,r(this,C).height,0,0,s,p),A.transferToImageBitmap()}return structuredClone(r(this,C))},Y=new WeakSet,qn=function(){at(this,d,new ResizeObserver(W=>{const h=W[0].contentRect;h.width&&h.height&&j(this,N,Zn).call(this,h.width,h.height)})),r(this,d).observe(this.div)},ee(gt,"_type","stamp");let F=gt;l.StampEditor=F}],__webpack_module_cache__={};function __w_pdfjs_require__(k){var l=__webpack_module_cache__[k];if(l!==void 0)return l.exports;var t=__webpack_module_cache__[k]={exports:{}};return __webpack_modules__[k].call(t.exports,t,t.exports,__w_pdfjs_require__),t.exports}var __webpack_exports__={};return(()=>{var k=__webpack_exports__;Object.defineProperty(k,"__esModule",{value:!0}),Object.defineProperty(k,"AbortException",{enumerable:!0,get:function(){return l.AbortException}}),Object.defineProperty(k,"AnnotationEditorLayer",{enumerable:!0,get:function(){return c.AnnotationEditorLayer}}),Object.defineProperty(k,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return l.AnnotationEditorParamsType}}),Object.defineProperty(k,"AnnotationEditorType",{enumerable:!0,get:function(){return l.AnnotationEditorType}}),Object.defineProperty(k,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return b.AnnotationEditorUIManager}}),Object.defineProperty(k,"AnnotationLayer",{enumerable:!0,get:function(){return F.AnnotationLayer}}),Object.defineProperty(k,"AnnotationMode",{enumerable:!0,get:function(){return l.AnnotationMode}}),Object.defineProperty(k,"CMapCompressionType",{enumerable:!0,get:function(){return l.CMapCompressionType}}),Object.defineProperty(k,"DOMSVGFactory",{enumerable:!0,get:function(){return e.DOMSVGFactory}}),Object.defineProperty(k,"FeatureTest",{enumerable:!0,get:function(){return l.FeatureTest}}),Object.defineProperty(k,"GlobalWorkerOptions",{enumerable:!0,get:function(){return C.GlobalWorkerOptions}}),Object.defineProperty(k,"ImageKind",{enumerable:!0,get:function(){return l.ImageKind}}),Object.defineProperty(k,"InvalidPDFException",{enumerable:!0,get:function(){return l.InvalidPDFException}}),Object.defineProperty(k,"MissingPDFException",{enumerable:!0,get:function(){return l.MissingPDFException}}),Object.defineProperty(k,"OPS",{enumerable:!0,get:function(){return l.OPS}}),Object.defineProperty(k,"PDFDataRangeTransport",{enumerable:!0,get:function(){return t.PDFDataRangeTransport}}),Object.defineProperty(k,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(k,"PDFWorker",{enumerable:!0,get:function(){return t.PDFWorker}}),Object.defineProperty(k,"PasswordResponses",{enumerable:!0,get:function(){return l.PasswordResponses}}),Object.defineProperty(k,"PermissionFlag",{enumerable:!0,get:function(){return l.PermissionFlag}}),Object.defineProperty(k,"PixelsPerInch",{enumerable:!0,get:function(){return e.PixelsPerInch}}),Object.defineProperty(k,"PromiseCapability",{enumerable:!0,get:function(){return l.PromiseCapability}}),Object.defineProperty(k,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(k,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(k,"UnexpectedResponseException",{enumerable:!0,get:function(){return l.UnexpectedResponseException}}),Object.defineProperty(k,"Util",{enumerable:!0,get:function(){return l.Util}}),Object.defineProperty(k,"VerbosityLevel",{enumerable:!0,get:function(){return l.VerbosityLevel}}),Object.defineProperty(k,"XfaLayer",{enumerable:!0,get:function(){return S.XfaLayer}}),Object.defineProperty(k,"build",{enumerable:!0,get:function(){return t.build}}),Object.defineProperty(k,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return l.createValidAbsoluteUrl}}),Object.defineProperty(k,"getDocument",{enumerable:!0,get:function(){return t.getDocument}}),Object.defineProperty(k,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(k,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return e.getPdfFilenameFromUrl}}),Object.defineProperty(k,"getXfaPageViewport",{enumerable:!0,get:function(){return e.getXfaPageViewport}}),Object.defineProperty(k,"isDataScheme",{enumerable:!0,get:function(){return e.isDataScheme}}),Object.defineProperty(k,"isPdfFile",{enumerable:!0,get:function(){return e.isPdfFile}}),Object.defineProperty(k,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(k,"noContextMenu",{enumerable:!0,get:function(){return e.noContextMenu}}),Object.defineProperty(k,"normalizeUnicode",{enumerable:!0,get:function(){return l.normalizeUnicode}}),Object.defineProperty(k,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(k,"setLayerDimensions",{enumerable:!0,get:function(){return e.setLayerDimensions}}),Object.defineProperty(k,"shadow",{enumerable:!0,get:function(){return l.shadow}}),Object.defineProperty(k,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(k,"version",{enumerable:!0,get:function(){return t.version}});var l=__w_pdfjs_require__(1),t=__w_pdfjs_require__(124),e=__w_pdfjs_require__(168),n=__w_pdfjs_require__(195),c=__w_pdfjs_require__(196),b=__w_pdfjs_require__(165),F=__w_pdfjs_require__(198),C=__w_pdfjs_require__(176),S=__w_pdfjs_require__(201)})(),__webpack_exports__})())})(pdf);var pdfExports=pdf.exports;const SEAL="/assets/seal-2b0b8e60.png";export{SEAL as S,pdfExports as p};