1import{b as commonjsGlobal,g as getDefaultExportFromCjs}from"./B2Vl8tsC.js";import{r as require$$6}from"./Ca2eK70z.js";function _mergeNamespaces(v,o){for(var t=0;t<o.length;t++){const r=o[t];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in v)){const f=Object.getOwnPropertyDescriptor(r,a);f&&Object.defineProperty(v,a,f.get?f:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}function commonjsRequire(v){throw new Error('Could not dynamically require "'+v+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$2={exports:{}},path2dPolyfill_esm={},hasRequiredPath2dPolyfill_esm;function requirePath2dPolyfill_esm(){if(hasRequiredPath2dPolyfill_esm)return path2dPolyfill_esm;hasRequiredPath2dPolyfill_esm=1;function v(n,l,d){for(var c=0,A=l.length,F;c<A;c++)(F||!(c in l))&&(F||(F=Array.prototype.slice.call(l,0,c)),F[c]=l[c]);return n.concat(F||Array.prototype.slice.call(l))}var o={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/gi,r=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function a(n){var l=n.match(r);return l?l.map(Number):[]}function f(n){var l=[],d=String(n).trim();return d[0]!=="M"&&d[0]!=="m"||d.replace(t,function(c,A,F){var R=a(F),m=A.toLowerCase(),x=A;if(m==="m"&&R.length>2&&(l.push(v([x],R.splice(0,2))),m="l",x=x==="m"?"l":"L"),R.length<o[m])return"";for(l.push(v([x],R.splice(0,o[m])));R.length>=o[m]&&R.length&&o[m];)l.push(v([x],R.splice(0,o[m])));return""}),l}function g(n,l){var d=n.x*Math.cos(l)-n.y*Math.sin(l),c=n.y*Math.cos(l)+n.x*Math.sin(l);n.x=d,n.y=c}function y(n,l,d){n.x+=l,n.y+=d}function P(n,l){n.x*=l,n.y*=l}var s=(function(){function n(l){var d;this.commands=[],l&&l instanceof n?(d=this.commands).push.apply(d,l.commands):l&&(this.commands=f(l))}return n.prototype.addPath=function(l){var d;l&&l instanceof n&&(d=this.commands).push.apply(d,l.commands)},n.prototype.moveTo=function(l,d){this.commands.push(["M",l,d])},n.prototype.lineTo=function(l,d){this.commands.push(["L",l,d])},n.prototype.arc=function(l,d,c,A,F,R){this.commands.push(["AC",l,d,c,A,F,!!R])},n.prototype.arcTo=function(l,d,c,A,F){this.commands.push(["AT",l,d,c,A,F])},n.prototype.ellipse=function(l,d,c,A,F,R,m,x){this.commands.push(["E",l,d,c,A,F,R,m,!!x])},n.prototype.closePath=function(){this.commands.push(["Z"])},n.prototype.bezierCurveTo=function(l,d,c,A,F,R){this.commands.push(["C",l,d,c,A,F,R])},n.prototype.quadraticCurveTo=function(l,d,c,A){this.commands.push(["Q",l,d,c,A])},n.prototype.rect=function(l,d,c,A){this.commands.push(["R",l,d,c,A])},n.prototype.roundRect=function(l,d,c,A,F){typeof F>"u"?this.commands.push(["RR",l,d,c,A,0]):this.commands.push(["RR",l,d,c,A,F])},n})();function e(n,l){var d=0,c=0,A,F,R,m,x,O,U,D,G,V,tt,Z,q,nt,J,H,k,b,S,w,N,L=null,W=null,I=null,p=null,E=null,T=null;n.beginPath();for(var M=0;M<l.length;++M){b=l[M][0],b!=="S"&&b!=="s"&&b!=="C"&&b!=="c"&&(L=null,W=null),b!=="T"&&b!=="t"&&b!=="Q"&&b!=="q"&&(I=null,p=null);var C=void 0;switch(b){case"m":case"M":C=l[M],b==="m"?(d+=C[1],c+=C[2]):(d=C[1],c=C[2]),(b==="M"||!E)&&(E={x:d,y:c}),n.moveTo(d,c);break;case"l":C=l[M],d+=C[1],c+=C[2],n.lineTo(d,c);break;case"L":C=l[M],d=C[1],c=C[2],n.lineTo(d,c);break;case"H":C=l[M],d=C[1],n.lineTo(d,c);break;case"h":C=l[M],d+=C[1],n.lineTo(d,c);break;case"V":C=l[M],c=C[1],n.lineTo(d,c);break;case"v":C=l[M],c+=C[1],n.lineTo(d,c);break;case"a":case"A":if(C=l[M],T===null)throw new Error("This should never happen");b==="a"?(d+=C[6],c+=C[7]):(d=C[6],c=C[7]),nt=C[1],J=C[2],U=C[3]*Math.PI/180,R=!!C[4],m=!!C[5],x={x:d,y:c},O={x:(T.x-x.x)/2,y:(T.y-x.y)/2},g(O,-U),D=O.x*O.x/(nt*nt)+O.y*O.y/(J*J),D>1&&(D=Math.sqrt(D),nt*=D,J*=D),S={x:nt*O.y/J,y:-(J*O.x)/nt},G=nt*nt*J*J,V=nt*nt*O.y*O.y+J*J*O.x*O.x,m!==R?P(S,Math.sqrt((G-V)/V)||0):P(S,-Math.sqrt((G-V)/V)||0),F=Math.atan2((O.y-S.y)/J,(O.x-S.x)/nt),A=Math.atan2(-(O.y+S.y)/J,-(O.x+S.x)/nt),g(S,U),y(S,(x.x+T.x)/2,(x.y+T.y)/2),n.save(),n.translate(S.x,S.y),n.rotate(U),n.scale(nt,J),n.arc(0,0,1,F,A,!m),n.restore(
1);break;case"C":C=l[M],L=C[3],W=C[4],d=C[5],c=C[6],n.bezierCurveTo(C[1],C[2],L,W,d,c);break;case"c":C=l[M],n.bezierCurveTo(C[1]+d,C[2]+c,C[3]+d,C[4]+c,C[5]+d,C[6]+c),L=C[3]+d,W=C[4]+c,d+=C[5],c+=C[6];break;case"S":C=l[M],(L===null||W===null)&&(L=d,W=c),n.bezierCurveTo(2*d-L,2*c-W,C[1],C[2],C[3],C[4]),L=C[1],W=C[2],d=C[3],c=C[4];break;case"s":C=l[M],(L===null||W===null)&&(L=d,W=c),n.bezierCurveTo(2*d-L,2*c-W,C[1]+d,C[2]+c,C[3]+d,C[4]+c),L=C[1]+d,W=C[2]+c,d+=C[3],c+=C[4];break;case"Q":C=l[M],I=C[1],p=C[2],d=C[3],c=C[4],n.quadraticCurveTo(I,p,d,c);break;case"q":C=l[M],I=C[1]+d,p=C[2]+c,d+=C[3],c+=C[4],n.quadraticCurveTo(I,p,d,c);break;case"T":C=l[M],(I===null||p===null)&&(I=d,p=c),I=2*d-I,p=2*c-p,d=C[1],c=C[2],n.quadraticCurveTo(I,p,d,c);break;case"t":C=l[M],(I===null||p===null)&&(I=d,p=c),I=2*d-I,p=2*c-p,d+=C[1],c+=C[2],n.quadraticCurveTo(I,p,d,c);break;case"z":case"Z":E&&(d=E.x,c=E.y),E=null,n.closePath();break;case"AC":C=l[M],d=C[1],c=C[2],q=C[3],F=C[4],A=C[5],w=C[6],n.arc(d,c,q,F,A,w);break;case"AT":C=l[M],tt=C[1],Z=C[2],d=C[3],c=C[4],q=C[5],n.arcTo(tt,Z,d,c,q);break;case"E":C=l[M],d=C[1],c=C[2],nt=C[3],J=C[4],U=C[5],F=C[6],A=C[7],w=C[8],n.save(),n.translate(d,c),n.rotate(U),n.scale(nt,J),n.arc(0,0,1,F,A,w),n.restore();break;case"R":C=l[M],d=C[1],c=C[2],H=C[3],k=C[4],E={x:d,y:c},n.rect(d,c,H,k);break;case"RR":C=l[M],d=C[1],c=C[2],H=C[3],k=C[4],N=C[5],E={x:d,y:c},n.roundRect(d,c,H,k,N);break}T?(T.x=d,T.y=c):T={x:d,y:c}}}function i(n){if(!(!n||!n.CanvasRenderingContext2D||n.Path2D)){var l=n.CanvasRenderingContext2D,d=l.prototype.fill,c=l.prototype.stroke,A=l.prototype.isPointInPath;l.prototype.fill=function(){for(var R=[],m=0;m<arguments.length;m++)R[m]=arguments[m];if(R[0]instanceof s){var x=R[0],O=R[1]||"nonzero";e(this,x.commands),d.apply(this,[O])}else{var O=R[0]||"nonzero";return d.apply(this,[O])}},l.prototype.stroke=function(R){R&&e(this,R.commands),c.apply(this)},l.prototype.isPointInPath=function(){for(var R=[],m=0;m<arguments.length;m++)R[m]=arguments[m];if(R[0]instanceof s){var x=R[0],O=R[1],U=R[2],D=R[3]||"nonzero";return e(this,x.commands),A.apply(this,[O,U,D])}else return A.apply(this,R)},n.Path2D=s}}function h(n,l,d,c,A){var F=this;if(A===void 0&&(A=0),typeof A=="number"&&(A=[A]),Array.isArray(A)){if(A.length===0||A.length>4)throw new RangeError("Failed to execute 'roundRect' on '".concat(this.constructor.name,"': ").concat(A.length," radii provided. Between one and four radii are necessary."));A.forEach(function(D){if(D<0)throw new RangeError("Failed to execute 'roundRect' on '".concat(F.constructor.name,"': Radius value ").concat(D," is negative."))})}else return;if(A.length===1&&A[0]===0)return this.rect(n,l,d,c);var R=Math.min(d,c)/2,m,x,O,U=m=x=O=Math.min(R,A[0]);A.length===2&&(m=O=Math.min(R,A[1])),A.length===3&&(m=O=Math.min(R,A[1]),x=Math.min(R,A[2])),A.length===4&&(m=Math.min(R,A[1]),x=Math.min(R,A[2]),O=Math.min(R,A[3])),this.moveTo(n,l+c-O),this.arcTo(n,l,n+U,l,U),this.arcTo(n+d,l,n+d,l+m,m),this.arcTo(n+d,l+c,n+d-x,l+c,x),this.arcTo(n,l+c,n,l+c-O,O),this.moveTo(n,l)}function u(n){if(!(!n||!n.CanvasRenderingContext2D)){var l=n.CanvasRenderingContext2D,d=n.Path2D;l&&!l.prototype.roundRect&&(l.prototype.roundRect=h),d&&!d.prototype.roundRect&&(d.prototype.roundRect=h)}}return i(window),u(window),path2dPolyfill_esm}var hasRequiredPdf;function requirePdf(){return hasRequiredPdf||(hasRequiredPdf=1,(function(module,exports$1){(function(o,t){module.exports=o.pdfjsLib=t()})(globalThis,()=>(()=>{var __webpack_modules__=[,((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.VerbosityLevel=o.Util=o.UnknownErrorException=o.UnexpectedResponseException=o.TextRenderingMode=o.RenderingIntentFlag=o.PromiseCapability=o.PermissionFlag=o.PasswordResponses=o.PasswordException=o.PageActionEventType=o.OPS=o.MissingPDFException=o.MAX_IMAGE_SIZE_TO_CACHE=o.LINE_FACTOR=o.LINE_DESCENT_FACTOR=o.InvalidPDFException=o.ImageKind=o.IDENTITY_MATRIX=o.FormatError=o.FeatureTest=o.FONT_IDENTITY_MATRIX=o.DocumentActionEventType=o.CMapCompressionType=o.BaseException=o.BASELINE_FACTOR=o.AnnotationType=o.AnnotationReplyType=o.AnnotationPrefix=o.AnnotationMode=o.AnnotationFlag=o.AnnotationFieldFlag=o.AnnotationEditorType=o.AnnotationEditorPrefix=o.AnnotationEditorParamsType=o.AnnotationBorderStyleType=o.AnnotationActionEventType=
1o.AbortException=void 0,o.assert=S,o.bytesToString=z,o.createValidAbsoluteUrl=N,o.getModificationDate=Ot,o.getUuid=Ut,o.getVerbosityLevel=J,o.info=H,o.isArrayBuffer=Tt,o.isArrayEqual=wt,o.isNodeJS=void 0,o.normalizeUnicode=Lt,o.objectFromMap=Q,o.objectSize=K,o.setVerbosityLevel=nt,o.shadow=L,o.string32=it,o.stringToBytes=_,o.stringToPDFString=gt,o.stringToUTF8String=mt,o.unreachable=b,o.utf8StringToString=St,o.warn=k,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 r=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");o.isNodeJS=r;const a=[1,0,0,1,0,0];o.IDENTITY_MATRIX=a;const f=[.001,0,0,.001,0,0];o.FONT_IDENTITY_MATRIX=f;const g=1e7;o.MAX_IMAGE_SIZE_TO_CACHE=g;const y=1.35;o.LINE_FACTOR=y;const P=.35;o.LINE_DESCENT_FACTOR=P;const s=P/y;o.BASELINE_FACTOR=s;const e={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};o.RenderingIntentFlag=e;const i={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};o.AnnotationMode=i;const h="pdfjs_internal_editor_";o.AnnotationEditorPrefix=h;const u={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};o.AnnotationEditorType=u;const n={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};o.AnnotationEditorParamsType=n;const l={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};o.PermissionFlag=l;const d={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};o.TextRenderingMode=d;const c={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};o.ImageKind=c;const A={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};o.AnnotationType=A;const F={GROUP:"Group",REPLY:"R"};o.AnnotationReplyType=F;const R={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};o.AnnotationFlag=R;const m={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};o.AnnotationFieldFlag=m;const x={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};o.AnnotationBorderStyleType=x;const O={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"};o.AnnotationActionEventType=O;const U={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};o.DocumentActionEventType=U;const D={O:"PageOpen",C:"PageClose"};o.PageActionEventType=D;const G={ERRORS:0,WARNINGS:1,INFOS:5};o.VerbosityLevel=G;const V={NONE:0,BINARY:1};o.CMapCompressionType=V;const tt={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};o.OPS=tt;const Z={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};o.PasswordResponses=Z;let q=G.WARNINGS;function nt(st){Number.isInteger(st)&&(q=st)}function J(){return q}function H(st){q>=G.INFOS}function k(st){q>=G.WARNINGS}function b(st){throw new Error(st)}function S(st,$){st||b($)}function w(st){switch(st?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function N(st){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!st)return null;try{if(X&&typeof st=="string"&&(X.addDefaultProtocol&&st.startsWith("www.")&&st.match(/\./g)?.length>=2&&(st=`http://${st}`),X.tryConvertEncoding))try{st=mt(st)}catch{}const ot=$?new URL(st,$):new URL(st);if(w(ot))return ot}catch{}return null}function L(st,$,X){let ot=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(st,$,{value:X,enumerable:!ot,configurable:!0,writable:!1}),X}const W=(function(){function $(X,ot){this.constructor===$&&b("Cannot initialize BaseException."),this.message=X,this.name=ot}return $.prototype=new Error,$.constructor=$,$})();o.BaseException=W;class I extends W{constructor($,X){super($,"PasswordException"),this.code=X}}o.PasswordException=I;class p extends W{constructor($,X){super($,"UnknownErrorException"),this.details=X}}o.UnknownErrorException=p;class E extends W{constructor($){super($,"InvalidPDFException")}}o.InvalidPDFException=E;class T extends W{constructor($){super($,"MissingPDFException")}}o.MissingPDFException=T;class M extends W{constructor($,X){super($,"UnexpectedResponseException"),this.status=X}}o.UnexpectedResponseException=M;class C extends W{constructor($){super($,"FormatError")}}o.FormatError=C;class B extends W{constructor($){super($,"AbortException")}}o.AbortException=B;function z(st){(typeof st!="object"||st?.length===void 0)&&b("Invalid argument for bytesToString");const $=st.length,X=8192;if($<X)return String.fromCharCode.apply(null,st);const ot=[];for(let At=0;At<$;At+=X){const Rt=Math.min(At+X,$),Y=st.subarray(At,Rt);ot.push(String.fromCharCode.apply(null,Y))}return ot.join("")}function _(st){typeof st!="string"&&b("Invalid argument for stringToBytes");const $=st.length,X=new Uint8Array($);for(let ot=0;ot<$;++ot)X[ot]=st.charCodeAt(ot)&255;return X}function it(st){return String.fromCharCode(st>>24&255,st>>16&255,st>>8&255,st&255)}function K(st){return Object.keys(st).length}function Q(st){const $=Object.create(null);for(const[X,ot]of st)$[X]=ot;return $}function j(){const st=new Uint8Array(4);return st[0]=1,new Uint32Array(st.buffer,0,1)[0]===1}function et(){try{return new Function(""),!0}catch{return!1}}class rt{static get isLittleEndian(){return L(this,"isLittleEndian",j())}static get isEvalSupported(){return L(this,"isEvalSupported",et())}static get isOffscreenCanvasSupported(){return L(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?L(this,"platform",{isWin:!1,isMac:!1}):L(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return L(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}o.FeatureTest=rt;const lt=[...Array(256).keys()].map(st=>st.toString(16).padStart(2,"0"));class ht{static makeHexColor($,X,ot){return`#${lt[$]}
1${lt[X]}${lt[ot]}`}static scaleMinMax($,X){let ot;$[0]?($[0]<0&&(ot=X[0],X[0]=X[1],X[1]=ot),X[0]*=$[0],X[1]*=$[0],$[3]<0&&(ot=X[2],X[2]=X[3],X[3]=ot),X[2]*=$[3],X[3]*=$[3]):(ot=X[0],X[0]=X[2],X[2]=ot,ot=X[1],X[1]=X[3],X[3]=ot,$[1]<0&&(ot=X[2],X[2]=X[3],X[3]=ot),X[2]*=$[1],X[3]*=$[1],$[2]<0&&(ot=X[0],X[0]=X[1],X[1]=ot),X[0]*=$[2],X[1]*=$[2]),X[0]+=$[4],X[1]+=$[4],X[2]+=$[5],X[3]+=$[5]}static transform($,X){return[$[0]*X[0]+$[2]*X[1],$[1]*X[0]+$[3]*X[1],$[0]*X[2]+$[2]*X[3],$[1]*X[2]+$[3]*X[3],$[0]*X[4]+$[2]*X[5]+$[4],$[1]*X[4]+$[3]*X[5]+$[5]]}static applyTransform($,X){const ot=$[0]*X[0]+$[1]*X[2]+X[4],At=$[0]*X[1]+$[1]*X[3]+X[5];return[ot,At]}static applyInverseTransform($,X){const ot=X[0]*X[3]-X[1]*X[2],At=($[0]*X[3]-$[1]*X[2]+X[2]*X[5]-X[4]*X[3])/ot,Rt=(-$[0]*X[1]+$[1]*X[0]+X[4]*X[1]-X[5]*X[0])/ot;return[At,Rt]}static getAxialAlignedBoundingBox($,X){const ot=this.applyTransform($,X),At=this.applyTransform($.slice(2,4),X),Rt=this.applyTransform([$[0],$[3]],X),Y=this.applyTransform([$[2],$[1]],X);return[Math.min(ot[0],At[0],Rt[0],Y[0]),Math.min(ot[1],At[1],Rt[1],Y[1]),Math.max(ot[0],At[0],Rt[0],Y[0]),Math.max(ot[1],At[1],Rt[1],Y[1])]}static inverseTransform($){const X=$[0]*$[3]-$[1]*$[2];return[$[3]/X,-$[1]/X,-$[2]/X,$[0]/X,($[2]*$[5]-$[4]*$[3])/X,($[4]*$[1]-$[5]*$[0])/X]}static singularValueDecompose2dScale($){const X=[$[0],$[2],$[1],$[3]],ot=$[0]*X[0]+$[1]*X[2],At=$[0]*X[1]+$[1]*X[3],Rt=$[2]*X[0]+$[3]*X[2],Y=$[2]*X[1]+$[3]*X[3],ct=(ot+Y)/2,pt=Math.sqrt((ot+Y)**2-4*(ot*Y-Rt*At))/2,ut=ct+pt||1,ft=ct-pt||1;return[Math.sqrt(ut),Math.sqrt(ft)]}static normalizeRect($){const X=$.slice(0);return $[0]>$[2]&&(X[0]=$[2],X[2]=$[0]),$[1]>$[3]&&(X[1]=$[3],X[3]=$[1]),X}static intersect($,X){const ot=Math.max(Math.min($[0],$[2]),Math.min(X[0],X[2])),At=Math.min(Math.max($[0],$[2]),Math.max(X[0],X[2]));if(ot>At)return null;const Rt=Math.max(Math.min($[1],$[3]),Math.min(X[1],X[3])),Y=Math.min(Math.max($[1],$[3]),Math.max(X[1],X[3]));return Rt>Y?null:[ot,Rt,At,Y]}static bezierBoundingBox($,X,ot,At,Rt,Y,ct,pt){const ut=[],ft=[[],[]];let bt,at,Et,vt,yt,Ct,Ft,Pt;for(let Wt=0;Wt<2;++Wt){if(Wt===0?(at=6*$-12*ot+6*Rt,bt=-3*$+9*ot-9*Rt+3*ct,Et=3*ot-3*$):(at=6*X-12*At+6*Y,bt=-3*X+9*At-9*Y+3*pt,Et=3*At-3*X),Math.abs(bt)<1e-12){if(Math.abs(at)<1e-12)continue;vt=-Et/at,0<vt&&vt<1&&ut.push(vt);continue}Ft=at*at-4*Et*bt,Pt=Math.sqrt(Ft),!(Ft<0)&&(yt=(-at+Pt)/(2*bt),0<yt&&yt<1&&ut.push(yt),Ct=(-at-Pt)/(2*bt),0<Ct&&Ct<1&&ut.push(Ct))}let Dt=ut.length,It;const Bt=Dt;for(;Dt--;)vt=ut[Dt],It=1-vt,ft[0][Dt]=It*It*It*$+3*It*It*vt*ot+3*It*vt*vt*Rt+vt*vt*vt*ct,ft[1][Dt]=It*It*It*X+3*It*It*vt*At+3*It*vt*vt*Y+vt*vt*vt*pt;return ft[0][Bt]=$,ft[1][Bt]=X,ft[0][Bt+1]=ct,ft[1][Bt+1]=pt,ft[0].length=ft[1].length=Bt+2,[Math.min(...ft[0]),Math.min(...ft[1]),Math.max(...ft[0]),Math.max(...ft[1])]}}o.Util=ht;const dt=[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 gt(st){if(st[0]>="ï"){let X;if(st[0]==="þ"&&st[1]==="ÿ"?X="utf-16be":st[0]==="ÿ"&&st[1]==="þ"?X="utf-16le":st[0]==="ï"&&st[1]==="»"&&st[2]==="¿"&&(X="utf-8"),X)try{const ot=new TextDecoder(X,{fatal:!0}),At=_(st);return ot.decode(At)}catch(ot){k(`stringToPDFString: "${ot}".`)}}const $=[];for(let X=0,ot=st.length;X<ot;X++){const At=dt[st.charCodeAt(X)];$.push(At?String.fromCharCode(At):st.charAt(X))}return $.join("")}function mt(st){return decodeURIComponent(escape(st))}function St(st){return unescape(encodeURIComponent(st))}function Tt(st){return typeof st=="object"&&st?.byteLength!==void 0}function wt(st,$){if(st.length!==$.length)return!1;for(let X=0,ot=st.length;X<ot;X++)if(st[X]!==$[X])return!1;return!0}function Ot(){let st=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[st.getUTCFullYear().toString(),(st.getUTCMonth()+1).toString().padStart(2,"0"),st.getUTCDate().toString().padStart(2,"0"),st.getUTCHours().toString().padStart(2,"0"),st.getUTCMinutes().toString().padStart(2,"0"),st.getUTCSeconds().toString().padStart(2,"0")].join("")}class xt{#t=!1;constructor(){this.promise=new Promise(($,X)=>{this.resolve=ot=>{this.#t=!0,$(ot)},this.reject=ot=>{this.#t=!0,X(ot)}})}get settled(){return this.#t}}o.PromiseCapability=xt;let Mt=null,kt=null;function Lt(st){return Mt||(Mt=/([\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,kt=new Map([["ï¬
","ſt"]])),st.replaceAll(Mt,($,X,ot)=>X?X.normalize("NFKC"):kt.get(ot))}function Ut(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();const st=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(st);else for(let $=0;$<32;$++)st[$]=Math.floor(Math.random()*255);return z(st)}const Nt="pdfjs_internal_id_";o.AnnotationPrefix=Nt}),((v,o,t)=>{var r=t(3),a=t(4),f=t(69),g=t(70),y="WebAssembly",P=a[y],s=Error("e",{cause:7}).cause!==7,e=function(h,u){var n={};n[h]=g(h,u,s),r({global:!0,constructor:!0,arity:1,forced:s},n)},i=function(h,u){if(P&&P[h]){var n={};
1n[h]=g(y+"."+h,u,s),r({target:y,stat:!0,constructor:!0,arity:1,forced:s},n)}};e("Error",function(h){return function(n){return f(h,this,arguments)}}),e("EvalError",function(h){return function(n){return f(h,this,arguments)}}),e("RangeError",function(h){return function(n){return f(h,this,arguments)}}),e("ReferenceError",function(h){return function(n){return f(h,this,arguments)}}),e("SyntaxError",function(h){return function(n){return f(h,this,arguments)}}),e("TypeError",function(h){return function(n){return f(h,this,arguments)}}),e("URIError",function(h){return function(n){return f(h,this,arguments)}}),i("CompileError",function(h){return function(n){return f(h,this,arguments)}}),i("LinkError",function(h){return function(n){return f(h,this,arguments)}}),i("RuntimeError",function(h){return function(n){return f(h,this,arguments)}})}),((v,o,t)=>{var r=t(4),a=t(5).f,f=t(44),g=t(48),y=t(38),P=t(56),s=t(68);v.exports=function(e,i){var h=e.target,u=e.global,n=e.stat,l,d,c,A,F,R;if(u?d=r:n?d=r[h]||y(h,{}):d=(r[h]||{}).prototype,d)for(c in i){if(F=i[c],e.dontCallGetSet?(R=a(d,c),A=R&&R.value):A=d[c],l=s(u?c:h+(n?".":"#")+c,e.forced),!l&&A!==void 0){if(typeof F==typeof A)continue;P(F,A)}(e.sham||A&&A.sham)&&f(F,"sham",!0),g(d,c,F,e)}}}),(function(v){var o=function(t){return t&&t.Math===Math&&t};v.exports=o(typeof globalThis=="object"&&globalThis)||o(typeof window=="object"&&window)||o(typeof self=="object"&&self)||o(typeof commonjsGlobal=="object"&&commonjsGlobal)||(function(){return this})()||this||Function("return this")()}),((v,o,t)=>{var r=t(6),a=t(8),f=t(10),g=t(11),y=t(12),P=t(18),s=t(39),e=t(42),i=Object.getOwnPropertyDescriptor;o.f=r?i:function(u,n){if(u=y(u),n=P(n),e)try{return i(u,n)}catch{}if(s(u,n))return g(!a(f.f,u,n),u[n])}}),((v,o,t)=>{var r=t(7);v.exports=!r(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})}),(v=>{v.exports=function(o){try{return!!o()}catch{return!0}}}),((v,o,t)=>{var r=t(9),a=Function.prototype.call;v.exports=r?a.bind(a):function(){return a.apply(a,arguments)}}),((v,o,t)=>{var r=t(7);v.exports=!r(function(){var a=(function(){}).bind();return typeof a!="function"||a.hasOwnProperty("prototype")})}),((v,o)=>{var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,a=r&&!t.call({1:2},1);o.f=a?function(g){var y=r(this,g);return!!y&&y.enumerable}:t}),(v=>{v.exports=function(o,t){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:t}}}),((v,o,t)=>{var r=t(13),a=t(16);v.exports=function(f){return r(a(f))}}),((v,o,t)=>{var r=t(14),a=t(7),f=t(15),g=Object,y=r("".split);v.exports=a(function(){return!g("z").propertyIsEnumerable(0)})?function(P){return f(P)==="String"?y(P,""):g(P)}:g}),((v,o,t)=>{var r=t(9),a=Function.prototype,f=a.call,g=r&&a.bind.bind(f,f);v.exports=r?g:function(y){return function(){return f.apply(y,arguments)}}}),((v,o,t)=>{var r=t(14),a=r({}.toString),f=r("".slice);v.exports=function(g){return f(a(g),8,-1)}}),((v,o,t)=>{var r=t(17),a=TypeError;v.exports=function(f){if(r(f))throw a("Can't call method on "+f);return f}}),(v=>{v.exports=function(o){return o==null}}),((v,o,t)=>{var r=t(19),a=t(23);v.exports=function(f){var g=r(f,"string");return a(g)?g:g+""}}),((v,o,t)=>{var r=t(8),a=t(20),f=t(23),g=t(30),y=t(33),P=t(34),s=TypeError,e=P("toPrimitive");v.exports=function(i,h){if(!a(i)||f(i))return i;var u=g(i,e),n;if(u){if(h===void 0&&(h="default"),n=r(u,i,h),!a(n)||f(n))return n;throw s("Can't convert object to primitive value")}return h===void 0&&(h="number"),y(i,h)}}),((v,o,t)=>{var r=t(21),a=t(22),f=a.all;v.exports=a.IS_HTMLDDA?function(g){return typeof g=="object"?g!==null:r(g)||g===f}:function(g){return typeof g=="object"?g!==null:r(g)}}),((v,o,t)=>{var r=t(22),a=r.all;v.exports=r.IS_HTMLDDA?function(f){return typeof f=="function"||f===a}:function(f){return typeof f=="function"}}),(v=>{var o=typeof document=="object"&&document.all,t=typeof o>"u"&&o!==void 0;v.exports={all:o,IS_HTMLDDA:t}}),((v,o,t)=>{var r=t(24),a=t(21),f=t(25),g=t(26),y=Object;v.exports=g?function(P){return typeof P=="symbol"}:function(P){var s=r("Symbol");return a(s)&&f(s.prototype,y(P))}}),((v,o,t)=>{var r=t(4),a=t(21),f=function(g){return a(g)?g:void 0};v.exports=function(g,y){return arguments.length<2?f(r[g]):r[g]&&r[g][y]}}),((v,o,t)=>{var r=t(14);v.exports=r({}.isPrototypeOf)}),((v,o,t)=>{var r=t(27);v.exports=r&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),((v,o,t)=>{var r=t(28),a=t(7),f=t(4),g=f.String;v.exports=!!Object.getOwnPropertySymbols&&!a(function(){var y=Symbol("symbol detection");return!g(y)||!(Object(y)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),((v,o,t)=>{var r=t(4),a=t(29),f=r.process,g=r.Deno,y=f&&f.versions||g&&g.version,P=y&&y.v8,s,e;P&&(s=P.split("."),e=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!e&&a&&(s=a.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=a.match(/Chrome\/(\d+)/),s&&(e=+s[1]))),v.exports=e}),(v=>{v.exports=typeof navigator<"u"&&String(navigator.userAgent)||""}),((v,o,t)=>
1{var r=t(31),a=t(17);v.exports=function(f,g){var y=f[g];return a(y)?void 0:r(y)}}),((v,o,t)=>{var r=t(21),a=t(32),f=TypeError;v.exports=function(g){if(r(g))return g;throw f(a(g)+" is not a function")}}),(v=>{var o=String;v.exports=function(t){try{return o(t)}catch{return"Object"}}}),((v,o,t)=>{var r=t(8),a=t(21),f=t(20),g=TypeError;v.exports=function(y,P){var s,e;if(P==="string"&&a(s=y.toString)&&!f(e=r(s,y))||a(s=y.valueOf)&&!f(e=r(s,y))||P!=="string"&&a(s=y.toString)&&!f(e=r(s,y)))return e;throw g("Can't convert object to primitive value")}}),((v,o,t)=>{var r=t(4),a=t(35),f=t(39),g=t(41),y=t(27),P=t(26),s=r.Symbol,e=a("wks"),i=P?s.for||s:s&&s.withoutSetter||g;v.exports=function(h){return f(e,h)||(e[h]=y&&f(s,h)?s[h]:i("Symbol."+h)),e[h]}}),((v,o,t)=>{var r=t(36),a=t(37);(v.exports=function(f,g){return a[f]||(a[f]=g!==void 0?g:{})})("versions",[]).push({version:"3.32.2",mode:r?"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"})}),(v=>{v.exports=!1}),((v,o,t)=>{var r=t(4),a=t(38),f="__core-js_shared__",g=r[f]||a(f,{});v.exports=g}),((v,o,t)=>{var r=t(4),a=Object.defineProperty;v.exports=function(f,g){try{a(r,f,{value:g,configurable:!0,writable:!0})}catch{r[f]=g}return g}}),((v,o,t)=>{var r=t(14),a=t(40),f=r({}.hasOwnProperty);v.exports=Object.hasOwn||function(y,P){return f(a(y),P)}}),((v,o,t)=>{var r=t(16),a=Object;v.exports=function(f){return a(r(f))}}),((v,o,t)=>{var r=t(14),a=0,f=Math.random(),g=r(1 .toString);v.exports=function(y){return"Symbol("+(y===void 0?"":y)+")_"+g(++a+f,36)}}),((v,o,t)=>{var r=t(6),a=t(7),f=t(43);v.exports=!r&&!a(function(){return Object.defineProperty(f("div"),"a",{get:function(){return 7}}).a!==7})}),((v,o,t)=>{var r=t(4),a=t(20),f=r.document,g=a(f)&&a(f.createElement);v.exports=function(y){return g?f.createElement(y):{}}}),((v,o,t)=>{var r=t(6),a=t(45),f=t(11);v.exports=r?function(g,y,P){return a.f(g,y,f(1,P))}:function(g,y,P){return g[y]=P,g}}),((v,o,t)=>{var r=t(6),a=t(42),f=t(46),g=t(47),y=t(18),P=TypeError,s=Object.defineProperty,e=Object.getOwnPropertyDescriptor,i="enumerable",h="configurable",u="writable";o.f=r?f?function(l,d,c){if(g(l),d=y(d),g(c),typeof l=="function"&&d==="prototype"&&"value"in c&&u in c&&!c[u]){var A=e(l,d);A&&A[u]&&(l[d]=c.value,c={configurable:h in c?c[h]:A[h],enumerable:i in c?c[i]:A[i],writable:!1})}return s(l,d,c)}:s:function(l,d,c){if(g(l),d=y(d),g(c),a)try{return s(l,d,c)}catch{}if("get"in c||"set"in c)throw P("Accessors not supported");return"value"in c&&(l[d]=c.value),l}}),((v,o,t)=>{var r=t(6),a=t(7);v.exports=r&&a(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})}),((v,o,t)=>{var r=t(20),a=String,f=TypeError;v.exports=function(g){if(r(g))return g;throw f(a(g)+" is not an object")}}),((v,o,t)=>{var r=t(21),a=t(45),f=t(49),g=t(38);v.exports=function(y,P,s,e){e||(e={});var i=e.enumerable,h=e.name!==void 0?e.name:P;if(r(s)&&f(s,h,e),e.global)i?y[P]=s:g(P,s);else{try{e.unsafe?y[P]&&(i=!0):delete y[P]}catch{}i?y[P]=s:a.f(y,P,{value:s,enumerable:!1,configurable:!e.nonConfigurable,writable:!e.nonWritable})}return y}}),((v,o,t)=>
vendor: 4,925 bytes, line 1
1{var r=t(14),a=t(7),f=t(21),g=t(39),y=t(6),P=t(50).CONFIGURABLE,s=t(51),e=t(52),i=e.enforce,h=e.get,u=String,n=Object.defineProperty,l=r("".slice),d=r("".replace),c=r([].join),A=y&&!a(function(){return n(function(){},"length",{value:8}).length!==8}),F=String(String).split("String"),R=v.exports=function(m,x,O){l(u(x),0,7)==="Symbol("&&(x="["+d(u(x),/^Symbol\(([^)]*)\)/,"$1")+"]"),O&&O.getter&&(x="get "+x),O&&O.setter&&(x="set "+x),(!g(m,"name")||P&&m.name!==x)&&(y?n(m,"name",{value:x,configurable:!0}):m.name=x),A&&O&&g(O,"arity")&&m.length!==O.arity&&n(m,"length",{value:O.arity});try{O&&g(O,"constructor")&&O.constructor?y&&n(m,"prototype",{writable:!1}):m.prototype&&(m.prototype=void 0)}catch{}var U=i(m);return g(U,"source")||(U.source=c(F,typeof x=="string"?x:"")),m};Function.prototype.toString=R(function(){return f(this)&&h(this).source||s(this)},"toString")}),((v,o,t)=>{var r=t(6),a=t(39),f=Function.prototype,g=r&&Object.getOwnPropertyDescriptor,y=a(f,"name"),P=y&&(function(){}).name==="something",s=y&&(!r||r&&g(f,"name").configurable);v.exports={EXISTS:y,PROPER:P,CONFIGURABLE:s}}),((v,o,t)=>{var r=t(14),a=t(21),f=t(37),g=r(Function.toString);a(f.inspectSource)||(f.inspectSource=function(y){return g(y)}),v.exports=f.inspectSource}),((v,o,t)=>{var r=t(53),a=t(4),f=t(20),g=t(44),y=t(39),P=t(37),s=t(54),e=t(55),i="Object already initialized",h=a.TypeError,u=a.WeakMap,n,l,d,c=function(m){return d(m)?l(m):n(m,{})},A=function(m){return function(x){var O;if(!f(x)||(O=l(x)).type!==m)throw h("Incompatible receiver, "+m+" required");return O}};if(r||P.state){var F=P.state||(P.state=new u);F.get=F.get,F.has=F.has,F.set=F.set,n=function(m,x){if(F.has(m))throw h(i);return x.facade=m,F.set(m,x),x},l=function(m){return F.get(m)||{}},d=function(m){return F.has(m)}}else{var R=s("state");e[R]=!0,n=function(m,x){if(y(m,R))throw h(i);return x.facade=m,g(m,R,x),x},l=function(m){return y(m,R)?m[R]:{}},d=function(m){return y(m,R)}}v.exports={set:n,get:l,has:d,enforce:c,getterFor:A}}),((v,o,t)=>{var r=t(4),a=t(21),f=r.WeakMap;v.exports=a(f)&&/native code/.test(String(f))}),((v,o,t)=>{var r=t(35),a=t(41),f=r("keys");v.exports=function(g){return f[g]||(f[g]=a(g))}}),(v=>{v.exports={}}),((v,o,t)=>{var r=t(39),a=t(57),f=t(5),g=t(45);v.exports=function(y,P,s){for(var e=a(P),i=g.f,h=f.f,u=0;u<e.length;u++){var n=e[u];!r(y,n)&&!(s&&r(s,n))&&i(y,n,h(P,n))}}}),((v,o,t)=>{var r=t(24),a=t(14),f=t(58),g=t(67),y=t(47),P=a([].concat);v.exports=r("Reflect","ownKeys")||function(e){var i=f.f(y(e)),h=g.f;return h?P(i,h(e)):i}}),((v,o,t)=>{var r=t(59),a=t(66),f=a.concat("length","prototype");o.f=Object.getOwnPropertyNames||function(y){return r(y,f)}}),((v,o,t)=>{var r=t(14),a=t(39),f=t(12),g=t(60).indexOf,y=t(55),P=r([].push);v.exports=function(s,e){var i=f(s),h=0,u=[],n;for(n in i)!a(y,n)&&a(i,n)&&P(u,n);for(;e.length>h;)a(i,n=e[h++])&&(~g(u,n)||P(u,n));return u}}),((v,o,t)=>{var r=t(12),a=t(61),f=t(64),g=function(y){return function(P,s,e){var i=r(P),h=f(i),u=a(e,h),n;if(y&&s!==s){for(;h>u;)if(n=i[u++],n!==n)return!0}else for(;h>u;u++)if((y||u in i)&&i[u]===s)return y||u||0;return!y&&-1}};v.exports={includes:g(!0),indexOf:g(!1)}}),((v,o,t)=>{var r=t(62),a=Math.max,f=Math.min;v.exports=function(g,y){var P=r(g);return P<0?a(P+y,0):f(P,y)}}),((v,o,t)=>{var r=t(63);v.exports=function(a){var f=+a;return f!==f||f===0?0:r(f)}}),(v=>{var o=Math.ceil,t=Math.floor;v.exports=Math.trunc||function(a){var f=+a;return(f>0?t:o)(f)}}),((v,o,t)=>{var r=t(65);v.exports=function(a){return r(a.length)}}),((v,o,t)=>{var r=t(62),a=Math.min;v.exports=function(f){return f>0?a(r(f),9007199254740991):0}}),(v=>{v.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),((v,o)=>{o.f=Object.getOwnPropertySymbols}),((v,o,t)=>{var r=t(7),a=t(21),f=/#|\.prototype\./,g=function(i,h){var u=P[y(i)];return u===e?!0:u===s?!1:a(h)?r(h):!!h},y=g.normalize=function(i){return String(i).replace(f,".").toLowerCase()},P=g.data={},s=g.NATIVE="N",e=g.POLYFILL="P";v.exports=g}),((v,o,t)=>{var r=t(9),a=Function.prototype,f=a.apply,g=a.call;v.exports=typeof Reflect=="object"&&Reflect.apply||(r?g.bind(f):function(){return g.apply(f,arguments)})}),((v,o,t)=>{var r=t(24),a=t(39),f=t(44),g=t(25),y=t(71),P=t(56),s=t(74),e=t(75),i=t(76),h=t(80),u=t(81),n=t(6),l=t(36);v.exports=function(d,c,A,F){var R="stackTraceLimit",m=F?2:1,x=d.split("."),O=x[x.length-1],U=r.apply(null,x);if(U){var D=U.prototype;if(!l&&a(D,"cause")&&delete D.cause,!A)return U;var G=r("Error"),V=c(function(tt,Z){var q=i(F?Z:tt,void 0),nt=F?new U(tt):new U;return q!==void 0&&f(nt,"message",q),u(nt,V,nt.stack,2),this&&g(D,this)&&e(nt,this,V),arguments.length>m&&h(nt,arguments[m]),nt});if(V.prototype=D,O!=="Error"?y?y(V,G):P(V,G,{name:!0}):n&&R in U&&(s(V,U,R),s(V,U,"prepareStackTrace")),P(V,U),!l)try{D.name!==O&&f(D,"name",O),D.constructor=V}catch{}return V}}}),((v,o,t)=>{var r=t(72),a=t(47),f=t(73);
1v.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var g=!1,y={},P;try{P=r(Object.prototype,"__proto__","set"),P(y,[]),g=y instanceof Array}catch{}return function(e,i){return a(e),f(i),g?P(e,i):e.__proto__=i,e}})():void 0)}),((v,o,t)=>{var r=t(14),a=t(31);v.exports=function(f,g,y){try{return r(a(Object.getOwnPropertyDescriptor(f,g)[y]))}catch{}}}),((v,o,t)=>{var r=t(21),a=String,f=TypeError;v.exports=function(g){if(typeof g=="object"||r(g))return g;throw f("Can't set "+a(g)+" as a prototype")}}),((v,o,t)=>{var r=t(45).f;v.exports=function(a,f,g){g in a||r(a,g,{configurable:!0,get:function(){return f[g]},set:function(y){f[g]=y}})}}),((v,o,t)=>{var r=t(21),a=t(20),f=t(71);v.exports=function(g,y,P){var s,e;return f&&r(s=y.constructor)&&s!==P&&a(e=s.prototype)&&e!==P.prototype&&f(g,e),g}}),((v,o,t)=>{var r=t(77);v.exports=function(a,f){return a===void 0?arguments.length<2?"":f:r(a)}}),((v,o,t)=>{var r=t(78),a=String;v.exports=function(f){if(r(f)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return a(f)}}),((v,o,t)=>{var r=t(79),a=t(21),f=t(15),g=t(34),y=g("toStringTag"),P=Object,s=f((function(){return arguments})())==="Arguments",e=function(i,h){try{return i[h]}catch{}};v.exports=r?f:function(i){var h,u,n;return i===void 0?"Undefined":i===null?"Null":typeof(u=e(h=P(i),y))=="string"?u:s?f(h):(n=f(h))==="Object"&&a(h.callee)?"Arguments":n}}),((v,o,t)=>{var r=t(34),a=r("toStringTag"),f={};f[a]="z",v.exports=String(f)==="[object z]"}),((v,o,t)=>{var r=t(20),a=t(44);v.exports=function(f,g){r(g)&&"cause"in g&&a(f,"cause",g.cause)}}),((v,o,t)=>{var r=t(44),a=t(82),f=t(83),g=Error.captureStackTrace;v.exports=function(y,P,s,e){f&&(g?g(y,P):r(y,"stack",a(s,e)))}}),((v,o,t)=>{var r=t(14),a=Error,f=r("".replace),g=(function(s){return String(a(s).stack)})("zxcasd"),y=/\n\s*at [^:]*:[^\n]*/,P=y.test(g);v.exports=function(s,e){if(P&&typeof s=="string"&&!a.prepareStackTrace)for(;e--;)s=f(s,y,"");return s}}),((v,o,t)=>{var r=t(7),a=t(11);v.exports=!r(function(){var f=Error("a");return"stack"in f?(Object.defineProperty(f,"stack",a(1,7)),f.stack!==7):!0})}),((v,o,t)=>{var r=t(48),a=t(14),f=t(77),g=t(85),y=URLSearchParams,P=y.prototype,s=a(P.append),e=a(P.delete),i=a(P.forEach),h=a([].push),u=new y("a=1&a=2&b=3");u.delete("a",1),u.delete("b",void 0),u+""!="a=2"&&r(P,"delete",function(n){var l=arguments.length,d=l<2?void 0:arguments[1];if(l&&d===void 0)return e(this,n);var c=[];i(this,function(D,G){h(c,{key:G,value:D})}),g(l,1);for(var A=f(n),F=f(d),R=0,m=0,x=!1,O=c.length,U;R<O;)U=c[R++],x||U.key===A?(x=!0,e(this,U.key)):m++;for(;m<O;)U=c[m++],U.key===A&&U.value===F||s(this,U.key,U.value)},{enumerable:!0,unsafe:!0})}),(v=>{var o=TypeError;v.exports=function(t,r){if(t<r)throw o("Not enough arguments");return t}}),((v,o,t)=>{var r=t(48),a=t(14),f=t(77),g=t(85),y=URLSearchParams,P=y.prototype,s=a(P.getAll),e=a(P.has),i=new y("a=1");(i.has("a",2)||!i.has("a",void 0))&&r(P,"has",function(u){var n=arguments.length,l=n<2?void 0:arguments[1];if(n&&l===void 0)return e(this,u);var d=s(this,u);g(n,1);for(var c=f(l),A=0;A<d.length;)if(d[A++]===c)return!0;return!1},{enumerable:!0,unsafe:!0})}),((v,o,t)=>{var r=t(6),a=t(14),f=t(88),g=URLSearchParams.prototype,y=a(g.forEach);r&&!("size"in g)&&f(g,"size",{get:function(){var s=0;return y(this,function(){s++}),s},configurable:!0,enumerable:!0})}),((v,o,t)=>{var r=t(49),a=t(45);v.exports=function(f,g,y){return y.get&&r(y.get,g,{getter:!0}),y.set&&r(y.set,g,{setter:!0}),a.f(f,g,y)}}),((v,o,t)=>{var r=t(3),a=t(40),f=t(64),g=t(90),y=t(92),P=t(7),s=P(function(){return[].push.call({length:4294967296},1)!==4294967297}),e=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(h){return h instanceof TypeError}},i=s||!e();r({target:"Array",proto:!0,arity:1,forced:i},{push:function(u){var n=a(this),l=f(n),d=arguments.length;y(l+d);for(var c=0;c<d;c++)n[l]=arguments[c],l++;return g(n,l),l}})}),((v,o,t)=>{var r=t(6),a=t(91),f=TypeError,g=Object.getOwnPropertyDescriptor,y=r&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(P){return P instanceof TypeError}})();v.exports=y?function(P,s){if(a(P)&&!g(P,"length").writable)throw f("Cannot set read only .length");return P.length=s}:function(P,s){return P.length=s}}),((v,o,t)=>{var r=t(15);v.exports=Array.isArray||function(f){return r(f)==="Array"}}
1),(v=>{var o=TypeError,t=9007199254740991;v.exports=function(r){if(r>t)throw o("Maximum allowed index exceeded");return r}}),((v,o,t)=>{var r=t(94),a=t(98).findLast,f=r.aTypedArray,g=r.exportTypedArrayMethod;g("findLast",function(P){return a(f(this),P,arguments.length>1?arguments[1]:void 0)})}),((v,o,t)=>{var r=t(95),a=t(6),f=t(4),g=t(21),y=t(20),P=t(39),s=t(78),e=t(32),i=t(44),h=t(48),u=t(88),n=t(25),l=t(96),d=t(71),c=t(34),A=t(41),F=t(52),R=F.enforce,m=F.get,x=f.Int8Array,O=x&&x.prototype,U=f.Uint8ClampedArray,D=U&&U.prototype,G=x&&l(x),V=O&&l(O),tt=Object.prototype,Z=f.TypeError,q=c("toStringTag"),nt=A("TYPED_ARRAY_TAG"),J="TypedArrayConstructor",H=r&&!!d&&s(f.opera)!=="Opera",k=!1,b,S,w,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},W=function(z){if(!y(z))return!1;var _=s(z);return _==="DataView"||P(N,_)||P(L,_)},I=function(B){var z=l(B);if(y(z)){var _=m(z);return _&&P(_,J)?_[J]:I(z)}},p=function(B){if(!y(B))return!1;var z=s(B);return P(N,z)||P(L,z)},E=function(B){if(p(B))return B;throw Z("Target is not a typed array")},T=function(B){if(g(B)&&(!d||n(G,B)))return B;throw Z(e(B)+" is not a typed array constructor")},M=function(B,z,_,it){if(a){if(_)for(var K in N){var Q=f[K];if(Q&&P(Q.prototype,B))try{delete Q.prototype[B]}catch{try{Q.prototype[B]=z}catch{}}}(!V[B]||_)&&h(V,B,_?z:H&&O[B]||z,it)}},C=function(B,z,_){var it,K;if(a){if(d){if(_){for(it in N)if(K=f[it],K&&P(K,B))try{delete K[B]}catch{}}if(!G[B]||_)try{return h(G,B,_?z:H&&G[B]||z)}catch{}else return}for(it in N)K=f[it],K&&(!K[B]||_)&&h(K,B,z)}};for(b in N)S=f[b],w=S&&S.prototype,w?R(w)[J]=S:H=!1;for(b in L)S=f[b],w=S&&S.prototype,w&&(R(w)[J]=S);if((!H||!g(G)||G===Function.prototype)&&(G=function(){throw Z("Incorrect invocation")},H))for(b in N)f[b]&&d(f[b],G);if((!H||!V||V===tt)&&(V=G.prototype,H))for(b in N)f[b]&&d(f[b].prototype,V);if(H&&l(D)!==V&&d(D,V),a&&!P(V,q)){k=!0,u(V,q,{configurable:!0,get:function(){return y(this)?this[nt]:void 0}});for(b in N)f[b]&&i(f[b],nt,b)}v.exports={NATIVE_ARRAY_BUFFER_VIEWS:H,TYPED_ARRAY_TAG:k&&nt,aTypedArray:E,aTypedArrayConstructor:T,exportTypedArrayMethod:M,exportTypedArrayStaticMethod:C,getTypedArrayConstructor:I,isView:W,isTypedArray:p,TypedArray:G,TypedArrayPrototype:V}}),(v=>{v.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"}),((v,o,t)=>{var r=t(39),a=t(21),f=t(40),g=t(54),y=t(97),P=g("IE_PROTO"),s=Object,e=s.prototype;v.exports=y?s.getPrototypeOf:function(i){var h=f(i);if(r(h,P))return h[P];var u=h.constructor;return a(u)&&h instanceof u?u.prototype:h instanceof s?e:null}}),((v,o,t)=>{var r=t(7);v.exports=!r(function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype})}),((v,o,t)=>{var r=t(99),a=t(13),f=t(40),g=t(64),y=function(P){var s=P===1;return function(e,i,h){for(var u=f(e),n=a(u),l=r(i,h),d=g(n),c,A;d-- >0;)if(c=n[d],A=l(c,d,u),A)switch(P){case 0:return c;case 1:return d}return s?-1:void 0}};v.exports={findLast:y(0),findLastIndex:y(1)}}),((v,o,t)=>{var r=t(100),a=t(31),f=t(9),g=r(r.bind);v.exports=function(y,P){return a(y),P===void 0?y:f?g(y,P):function(){return y.apply(P,arguments)}}}),((v,o,t)=>{var r=t(15),a=t(14);v.exports=function(f){if(r(f)==="Function")return a(f)}}),((v,o,t)=>{var r=t(94),a=t(98).findLastIndex,f=r.aTypedArray,g=r.exportTypedArrayMethod;g("findLastIndex",function(P){return a(f(this),P,arguments.length>1?arguments[1]:void 0)})}),((v,o,t)=>{var r=t(4),a=t(8),f=t(94),g=t(64),y=t(103),P=t(40),s=t(7),e=r.RangeError,i=r.Int8Array,h=i&&i.prototype,u=h&&h.set,n=f.aTypedArray,l=f.exportTypedArrayMethod,d=!s(function(){var A=new Uint8ClampedArray(2);return a(u,A,{length:1,0:3},1),A[1]!==3}),c=d&&f.NATIVE_ARRAY_BUFFER_VIEWS&&s(function(){var A=new i(2);return A.set(1),A.set("2",1),A[0]!==0||A[1]!==2});l("set",function(F){n(this);var R=y(arguments.length>1?arguments[1]:void 0,1),m=P(F);if(d)return a(u,this,m,R);var x=this.length,O=g(m),U=0;if(O+R>x)throw e("Wrong length");for(;U<O;)this[R+U]=m[U++]},!d||c)}),((v,o,t)=>{var r=t(104),a=RangeError;v.exports=function(f,g){var y=r(f);if(y%g)throw a("Wrong offset");return y}}),((v,o,t)=>{var r=t(62),a=RangeError;v.exports=function(f){var g=r(f);if(g<0)throw a("The argument can't be less than 0");return g}}),((v,o,t)=>{var r=t(106),a=t(94),f=a.aTypedArray,g=a.exportTypedArrayMethod,y=a.getTypedArrayConstructor;g("toReversed",function(){return r(f(this),y(this))})}),((v,o,t)=>{var r=t(64);v.exports=function(a,f){for(var g=r(a),y=new f(g),P=0;P<g;P++)y[P]=a[g-P-1];return y}}),((v,o,t)=>{var r=t(94),a=t(14),f=t(31),g=t(108),y=r.aTypedArray,P=r.getTypedArrayConstructor,s=r.exportTypedArrayMethod,e=a(r.TypedArrayPrototype.sort);s("toSorted",function(h){h!==void 0&&f(h);var u=y(this),n=g(P(u),u);return e(n,h)})}),((v,o,t)=>{var r=t(64);v.exports=function(a,f){for(var g=0,y=r(f),P=new a(y);y>g;)P[g]=f[g++];return P}}),((v,o,t)=>{var r=t(110),a=t(94),f=t(111),g=t(62),y=t(112),P=a.aTypedArray,s=a.getTypedArrayConstructor,e=a.exportTypedArrayMethod,i=!!(function(){try{new Int8Array(1).with(2,{valueOf
1:function(){throw 8}})}catch(h){return h===8}})();e("with",function(h,u){var n=P(this),l=g(h),d=f(n)?y(u):+u;return r(n,s(n),l,d)},!i)}),((v,o,t)=>{var r=t(64),a=t(62),f=RangeError;v.exports=function(g,y,P,s){var e=r(g),i=a(P),h=i<0?e+i:i;if(h>=e||h<0)throw f("Incorrect index");for(var u=new y(e),n=0;n<e;n++)u[n]=n===h?s:g[n];return u}}),((v,o,t)=>{var r=t(78);v.exports=function(a){var f=r(a);return f==="BigInt64Array"||f==="BigUint64Array"}}),((v,o,t)=>{var r=t(19),a=TypeError;v.exports=function(f){var g=r(f,"number");if(typeof g=="number")throw a("Can't convert number to bigint");return BigInt(g)}}),((v,o,t)=>{var r=t(6),a=t(88),f=t(114),g=ArrayBuffer.prototype;r&&!("detached"in g)&&a(g,"detached",{configurable:!0,get:function(){return f(this)}})}),((v,o,t)=>{var r=t(14),a=t(115),f=r(ArrayBuffer.prototype.slice);v.exports=function(g){if(a(g)!==0)return!1;try{return f(g,0,0),!1}catch{return!0}}}),((v,o,t)=>{var r=t(72),a=t(15),f=TypeError;v.exports=r(ArrayBuffer.prototype,"byteLength","get")||function(g){if(a(g)!=="ArrayBuffer")throw f("ArrayBuffer expected");return g.byteLength}}),((v,o,t)=>{var r=t(3),a=t(117);a&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:void 0,!0)}})}),((v,o,t)=>{var r=t(4),a=t(14),f=t(72),g=t(118),y=t(114),P=t(115),s=t(119),e=r.TypeError,i=r.structuredClone,h=r.ArrayBuffer,u=r.DataView,n=Math.min,l=h.prototype,d=u.prototype,c=a(l.slice),A=f(l,"resizable","get"),F=f(l,"maxByteLength","get"),R=a(d.getInt8),m=a(d.setInt8);v.exports=s&&function(x,O,U){var D=P(x),G=O===void 0?D:g(O),V=!A||!A(x);if(y(x))throw e("ArrayBuffer is detached");var tt=i(x,{transfer:[x]});if(D===G&&(U||V))return tt;if(D>=G&&(!U||V))return c(tt,0,G);for(var Z=U&&!V&&F?{maxByteLength:F(tt)}:void 0,q=new h(G,Z),nt=new u(tt),J=new u(q),H=n(G,D),k=0;k<H;k++)m(J,k,R(nt,k));return q}}),((v,o,t)=>{var r=t(62),a=t(65),f=RangeError;v.exports=function(g){if(g===void 0)return 0;var y=r(g),P=a(y);if(y!==P)throw f("Wrong length or index");return P}}),((v,o,t)=>{var r=t(4),a=t(7),f=t(28),g=t(120),y=t(121),P=t(122),s=r.structuredClone;v.exports=!!s&&!a(function(){if(y&&f>92||P&&f>94||g&&f>97)return!1;var e=new ArrayBuffer(8),i=s(e,{transfer:[e]});return e.byteLength!==0||i.byteLength!==8})}),((v,o,t)=>{var r=t(121),a=t(122);v.exports=!r&&!a&&typeof window=="object"&&typeof document=="object"}),(v=>{v.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"}),((v,o,t)=>{var r=t(4),a=t(15);v.exports=a(r.process)==="process"}),((v,o,t)=>{var r=t(3),a=t(117);a&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:void 0,!1)}})}),((__unused_webpack_module,exports$1,__w_pdfjs_require__)=>{Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.RenderTask=exports$1.PDFWorkerUtil=exports$1.PDFWorker=exports$1.PDFPageProxy=exports$1.PDFDocumentProxy=exports$1.PDFDocumentLoadingTask=exports$1.PDFDataRangeTransport=exports$1.LoopbackPort=exports$1.DefaultStandardFontDataFactory=exports$1.DefaultFilterFactory=exports$1.DefaultCanvasFactory=exports$1.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports$1,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports$1.build=void 0,exports$1.getDocument=getDocument,exports$1.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$1.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports$1.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports$1.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports$1.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(v){if(typeof v=="string"||v instanceof URL?v={url:v}:(0,_util.isArrayBuffer)(v)&&(v={data:v}),typeof v!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!v.url&&!v.data&&!v.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const o=new PDFDocumentLoadingTask,{docId:t}=o,r=v.url?getUrlProp(v.url):null,a=v.data?getDataProp(v.data):null,f=v.httpHeaders||null,g=v.withCredentials===!0,y=v.password??null,P=v.range instanceof PDFDataRangeTransport?v.range:null,s=Number.isInteger(v.rangeChunkSize)&&v.rangeChunkSize>0?v.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let e=v.worker instanceof PDFWorker?v.worker:null;const i=v.verbosity,h=typeof v.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(v.docBaseUrl)?v.docBaseUrl:null,u=typeof v.cMapUrl=="string"?v.cMapUrl:null,n=v.cMapPacked!==!1,l=v.CMapReaderFactory||DefaultCMapReaderFactory,d=typeof v.standardFontDataUrl=="string"?v.standardFontDataUrl:null,c=v.StandardFontDataFactory||DefaultStandardFontDataFactory,A=v.stopAtErrors!==!0,F=Number.isInteger(v.maxImageSize)&&v.maxImageSize>-1?v.maxImageSize:-1,R=v.isEvalSupported!==!1,m=typeof v.isOffscreenCanvasSupported=="boolean"?v.isOffscreenCanvasSupported:!_util.isNodeJS,x=Number.isInteger(v.canvasMaxAreaInBytes)?v.canvasMaxAreaInBytes:-1,O=typeof v.disableFontFace=="boolean"?v.disableFontFace:_util.isNodeJS,U=v.fontExtraProperties===!0,D=v.enableXfa===!0,G=v.ownerDocument||globalThis.document,V=v.disableRange===!0,tt
1=v.disableStream===!0,Z=v.disableAutoFetch===!0,q=v.pdfBug===!0,nt=P?P.length:v.length??NaN,J=typeof v.useSystemFonts=="boolean"?v.useSystemFonts:!_util.isNodeJS&&!O,H=typeof v.useWorkerFetch=="boolean"?v.useWorkerFetch:l===_display_utils.DOMCMapReaderFactory&&c===_display_utils.DOMStandardFontDataFactory&&u&&d&&(0,_display_utils.isValidFetchUrl)(u,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(d,document.baseURI),k=v.canvasFactory||new DefaultCanvasFactory({ownerDocument:G}),b=v.filterFactory||new DefaultFilterFactory({docId:t,ownerDocument:G}),S=null;(0,_util.setVerbosityLevel)(i);const w={canvasFactory:k,filterFactory:b};if(H||(w.cMapReaderFactory=new l({baseUrl:u,isCompressed:n}),w.standardFontDataFactory=new c({baseUrl:d})),!e){const W={verbosity:i,port:_worker_options.GlobalWorkerOptions.workerPort};e=W.port?PDFWorker.fromPort(W):new PDFWorker(W),o._worker=e}const N={docId:t,apiVersion:"3.11.174",data:a,password:y,disableAutoFetch:Z,rangeChunkSize:s,length:nt,docBaseUrl:h,enableXfa:D,evaluatorOptions:{maxImageSize:F,disableFontFace:O,ignoreErrors:A,isEvalSupported:R,isOffscreenCanvasSupported:m,canvasMaxAreaInBytes:x,fontExtraProperties:U,useSystemFonts:J,cMapUrl:H?u:null,standardFontDataUrl:H?d:null}},L={ignoreErrors:A,isEvalSupported:R,disableFontFace:O,fontExtraProperties:U,enableXfa:D,ownerDocument:G,disableAutoFetch:Z,pdfBug:q,styleElement:S};return e.promise.then(function(){if(o.destroyed)throw new Error("Loading aborted");const W=_fetchDocument(e,N),I=new Promise(function(p){let E;P?E=new _transport_stream.PDFDataTransportStream({length:nt,initialData:P.initialData,progressiveDone:P.progressiveDone,contentDispositionFilename:P.contentDispositionFilename,disableRange:V,disableStream:tt},P):a||(E=(M=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(M):(0,_display_utils.isValidFetchUrl)(M.url)?new _displayFetch_stream.PDFFetchStream(M):new _displayNetwork.PDFNetworkStream(M))({url:r,length:nt,httpHeaders:f,withCredentials:g,rangeChunkSize:s,disableRange:V,disableStream:tt})),p(E)});return Promise.all([W,I]).then(function(p){let[E,T]=p;if(o.destroyed)throw new Error("Loading aborted");const M=new _message_handler.MessageHandler(t,E,e.port),C=new WorkerTransport(M,o,T,L,w);o._transport=C,M.send("Ready",null)})}).catch(o._capability.reject),o}async function _fetchDocument(v,o){if(v.destroyed)throw new Error("Worker was destroyed");const t=await v.messageHandler.sendWithPromise("GetDocRequest",o,o.data?[o.data.buffer]:null);if(v.destroyed)throw new Error("Worker was destroyed");return t}function getUrlProp(v){if(v instanceof URL)return v.href;try{return new URL(v,window.location).href}catch{if(_util.isNodeJS&&typeof v=="string")return v}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(v){if(_util.isNodeJS&&typeof Buffer<"u"&&v instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(v instanceof Uint8Array&&v.byteLength===v.buffer.byteLength)return v;if(typeof v=="string")return(0,_util.stringToBytes)(v);if(typeof v=="object"&&!isNaN(v?.length)||(0,_util.isArrayBuffer)(v))return new Uint8Array(v);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#t=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${PDFDocumentLoadingTask.#t++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(o){throw this._worker?.port&&delete this._worker._pendingDestroy,o}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports$1.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(o,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this.length=o,this.initialData=t,this.progressiveDone=r,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(o){this._rangeListeners.push(o)}addProgressListener(o){this._progressListeners.push(o)}addProgressiveReadListener(o){this._progressiveReadListeners.push(o)}addProgressiveDoneListener(o){this._progressiveDoneListeners.push(o)}onDataRange(o,t){for(const r of this._rangeListeners)r(o,t)}onDataProgress(o,t){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(o,t)})}onDataProgressiveRead(o){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(o)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const o of this._progressiveDoneListeners)o()})}transportReady(){this._readyCapability.resolve()}requestDataRange(o,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports$1.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(o,t){this._pdfInfo=o,this._transport=t,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(r=>{if(!r)return r;const a=[];for(const f in r)a.push(...r[f]);return a}))})}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(o){return this._transport.getPage(o)}getPageIndex(o){return this._transport.getPageIndex(o)}getDestinations(){return this._transport.getDestinations()}getDestination(o){return this._transport.getDestination(o)}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 o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._transport.startCleanup(o||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$1.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#t=null;#e=!1;constructor(o,t,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;this._pageIndex=o,this._pageInfo=t,this._transport=r,this._stats=a?new _display_utils.StatTimer:null,this._pdfBug=a,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:o,rotation:t=this.rotate,offsetX:r=0,offsetY:a=0,dontFlip:f=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:o,rotation:t,offsetX:r,offsetY:a,dontFlip:f})}getAnnotations(){let{intent:o="display"}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};
1const t=this._transport.getRenderingIntent(o);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(o){let{canvasContext:t,viewport:r,intent:a="display",annotationMode:f=_util.AnnotationMode.ENABLE,transform:g=null,background:y=null,optionalContentConfigPromise:P=null,annotationCanvasMap:s=null,pageColors:e=null,printAnnotationStorage:i=null}=o;this._stats?.time("Overall");const h=this._transport.getRenderingIntent(a,f,i);this.#e=!1,this.#r(),P||(P=this._transport.getOptionalContentConfig());let u=this._intentStates.get(h.cacheKey);u||(u=Object.create(null),this._intentStates.set(h.cacheKey,u)),u.streamReaderCancelTimeout&&(clearTimeout(u.streamReaderCancelTimeout),u.streamReaderCancelTimeout=null);const n=!!(h.renderingIntent&_util.RenderingIntentFlag.PRINT);u.displayReadyCapability||(u.displayReadyCapability=new _util.PromiseCapability,u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(h));const l=A=>{u.renderTasks.delete(d),(this._maybeCleanupAfterRender||n)&&(this.#e=!0),this.#n(!n),A?(d.capability.reject(A),this._abortOperatorList({intentState:u,reason:A instanceof Error?A:new Error(A)})):d.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},d=new InternalRenderTask({callback:l,params:{canvasContext:t,viewport:r,transform:g,background:y},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:s,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!n,pdfBug:this._pdfBug,pageColors:e});(u.renderTasks||=new Set).add(d);const c=d.task;return Promise.all([u.displayReadyCapability.promise,P]).then(A=>{let[F,R]=A;if(this.destroyed){l();return}this._stats?.time("Rendering"),d.initializeGraphics({transparency:F,optionalContentConfig:R}),d.operatorListChanged()}).catch(l),c}getOperatorList(){let{intent:o="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};function a(){g.operatorList.lastChunk&&(g.opListReadCapability.resolve(g.operatorList),g.renderTasks.delete(y))}const f=this._transport.getRenderingIntent(o,t,r,!0);let g=this._intentStates.get(f.cacheKey);g||(g=Object.create(null),this._intentStates.set(f.cacheKey,g));let y;return g.opListReadCapability||(y=Object.create(null),y.operatorListChanged=a,g.opListReadCapability=new _util.PromiseCapability,(g.renderTasks||=new Set).add(y),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f)),g.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:o=!1,disableNormalization:t=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:o===!0,disableNormalization:t===!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(r=>_xfa_text.XfaText.textContent(r));const t=this.streamTextContent(o);return new Promise(function(r,a){function f(){g.read().then(function(P){let{value:s,done:e}=P;if(e){r(y);return}Object.assign(y.styles,s.styles),y.items.push(...s.items),f()},a)}const g=t.getReader(),y={items:[],styles:Object.create(null)};f()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const o=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const r of t.renderTasks)o.push(r.completed),r.cancel();return this.objs.clear(),this.#e=!1,this.#r(),Promise.all(o)}cleanup(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.#e=!0;const t=this.#n(!1);
1return o&&t&&(this._stats&&=new _display_utils.StatTimer),t}#n(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.#r(),!this.#e||this.destroyed)return!1;if(o)return this.#t=setTimeout(()=>{this.#t=null,this.#n(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:t,operatorList:r}of this._intentStates.values())if(t.size>0||!r.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}#r(){this.#t&&(clearTimeout(this.#t),this.#t=null)}_startRenderPage(o,t){const r=this._intentStates.get(t);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(o))}_renderPageChunk(o,t){for(let r=0,a=o.length;r<a;r++)t.operatorList.fnArray.push(o.fnArray[r]),t.operatorList.argsArray.push(o.argsArray[r]);t.operatorList.lastChunk=o.lastChunk,t.operatorList.separateAnnots=o.separateAnnots;for(const r of t.renderTasks)r.operatorListChanged();o.lastChunk&&this.#n(!0)}_pumpOperatorList(o){let{renderingIntent:t,cacheKey:r,annotationStorageSerializable:a}=o;const{map:f,transfers:g}=a,P=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:r,annotationStorage:f},g).getReader(),s=this._intentStates.get(r);s.streamReader=P;const e=()=>{P.read().then(i=>{let{value:h,done:u}=i;if(u){s.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,s),e())},i=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(const h of s.renderTasks)h.operatorListChanged();this.#n(!0)}if(s.displayReadyCapability)s.displayReadyCapability.reject(i);else if(s.opListReadCapability)s.opListReadCapability.reject(i);else throw i}})};e()}_abortOperatorList(o){let{intentState:t,reason:r,force:a=!1}=o;if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!a){if(t.renderTasks.size>0)return;if(r instanceof _display_utils.RenderingCancelledException){let f=RENDERING_CANCELLED_TIMEOUT;r.extraDelay>0&&r.extraDelay<1e3&&(f+=r.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:r,force:!0})},f);return}}if(t.streamReader.cancel(new _util.AbortException(r.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[f,g]of this._intentStates)if(g===t){this._intentStates.delete(f);break}this.cleanup()}}}get stats(){return this._stats}}exports$1.PDFPageProxy=PDFPageProxy;class LoopbackPort{#t=new Set;#e=Promise.resolve();postMessage(o,t){const r={data:structuredClone(o,null)};this.#e.then(()=>{for(const a of this.#t)a.call(this,r)})}addEventListener(o,t){this.#t.add(t)}removeEventListener(o,t){this.#t.delete(t)}terminate(){this.#t.clear()}}exports$1.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports$1.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const v=document?.currentScript?.src;v&&(PDFWorkerUtil.fallbackWorkerSrc=v.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(v,o){let t;try{if(t=new URL(v),!t.origin||t.origin==="null")return!1}catch{return!1}const r=new URL(o,t);return t.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(v){const o=`importScripts("${v}");`;return URL.createObjectURL(new Blob([o]))}}class PDFWorker{static#workerPorts;constructor(){let{name:v=null,port:o=null,verbosity:t=(0,_util.getVerbosityLevel)()}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.name=v,this.destroyed=!1,this.verbosity=t,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,o){if(PDFWorker.#workerPorts?.has(o))throw new Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#workerPorts||=new WeakMap).set(o,this),this._initializeFromPort(o);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(v){this._port=v,this._messageHandler=new _message_handler.MessageHandler("main","worker",v),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:v}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,v)||(v=PDFWorkerUtil.createCDNWrapper(new URL(v,window.location).href));const o=new Worker(v),t=new _message_handler.MessageHandler("main","worker",o),r=()=>{o.removeEventListener("error",a),t.destroy(),o.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=()=>{this._webWorker||r()};o.addEventListener("error",a),t.on("test",g=>{if(o.removeEventListener("error",a),this.destroyed){r();return}g?(this._messageHandler=t,this._port=o,this._webWorker=o,this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),t.destroy(),o.terminate())}),t.on("ready",g=>{if(o.removeEventListener("error",a),this.destroyed){r();return}try{f()}catch{this._setupFakeWorker()}});const f=()=>{const g=new Uint8Array;t.send("test",g,[g.buffer])};f();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(v=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const o=new LoopbackPort;this._port=o;const t=`fake${PDFWorkerUtil.fakeWorkerId++}`,r=new _message_handler.MessageHandler(t+"_worker",t,o);v.setup(r,o);const a=new _message_handler.MessageHandler(t,t+"_worker",o);this._messageHandler=a,this._readyCapability.resolve(),a.send("configure",{verbosity:this.verbosity})}).catch(v=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${v.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#workerPorts?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(v){if(!v?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const o=this.#workerPorts?.get(v.port);
1if(o){if(o._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return o}return new PDFWorker(v)}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(){try{return globalThis.pdfjsWorker?.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())}}exports$1.PDFWorker=PDFWorker;class WorkerTransport{#t=new Map;#e=new Map;#n=new Map;#r=null;constructor(o,t,r,a,f){this.messageHandler=o,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this._params=a,this.canvasFactory=f.canvasFactory,this.filterFactory=f.filterFactory,this.cMapReaderFactory=f.cMapReaderFactory,this.standardFontDataFactory=f.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#o(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const r=this.#t.get(o);if(r)return r;const a=this.messageHandler.sendWithPromise(o,t);return this.#t.set(o,a),a}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_util.AnnotationMode.ENABLE,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,f=_util.RenderingIntentFlag.DISPLAY,g=_annotation_storage.SerializableEmpty;switch(o){case"any":f=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":f=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${o}`)}switch(t){case _util.AnnotationMode.DISABLE:f+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:f+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:f+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,g=(f&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return a&&(f+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:f,cacheKey:`${f}_${g.hash}`,annotationStorageSerializable:g}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#r?.reject(new Error("Worker was destroyed during onPassword callback"));const o=[];for(const r of this.#e.values())o.push(r._destroy());this.#e.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return o.push(t),Promise.all(o).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:o,loadingTask:t}=this;o.on("GetReader",(r,a)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=f=>{this._lastProgress={loaded:f.loaded,total:f.total}},a.onPull=()=>{this._fullReader.read().then(function(f){let{value:g,done:y}=f;if(y){a.close();return}(0,_util.assert)(g instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(g),1,[g])}).catch(f=>{a.error(f)})},a.onCancel=f=>{this._fullReader.cancel(f),a.ready.catch(g=>{if(!this.destroyed)throw g})}}),o.on("ReaderHeadersReady",r=>{const a=new _util.PromiseCapability,f=this._fullReader;return f.headersReady.then(()=>{(!f.isStreamingSupported||!f.isRangeSupported)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),f.onProgress=g=>{t.onProgress?.({loaded:g.loaded,total:g.total})}),a.resolve({isStreamingSupported:f.isStreamingSupported,isRangeSupported:f.isRangeSupported,contentLength:f.contentLength})},a.reject),a.promise}),o.on("GetRangeReader",(r,a)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const f=this._networkStream.getRangeReader(r.begin,r.end);if(!f){a.close();return}a.onPull=()=>{f.read().then(function(g){let{value:y,done:P}=g;if(P){a.close();return}(0,_util.assert)(y instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(y),1,[y])}).catch(g=>{a.error(g)})},a.onCancel=g=>{f.cancel(g),a.ready.catch(y=>{if(!this.destroyed)throw y})}}),o.on("GetDoc",r=>{let{pdfInfo:a}=r;this._numPages=a.numPages,this._htmlForXfa=a.htmlForXfa,delete a.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(a,this))}),o.on("DocException",function(r){let a;switch(r.name){case"PasswordException":a=new _util.PasswordException(r.message,r.code);break;case"InvalidPDFException":a=new _util.InvalidPDFException(r.message);break;case"MissingPDFException":a=new _util.MissingPDFException(r.message);break;case"UnexpectedResponseException":a=new _util.UnexpectedResponseException(r.message,r.status);break;case"UnknownErrorException":a=new _util.UnknownErrorException(r.message,r.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(a)}),o.on("PasswordRequest",r=>{if(this.#r=new _util.PromiseCapability,t.onPassword){const a=f=>{f instanceof Error?this.#r.reject(f):this.#r.resolve({password:f})};try{t.onPassword(a,r.code)}catch(f){this.#r.reject(f)}}else this.#r.reject(new _util.PasswordException(r.message,r.code));return this.#r.promise}),o.on("DataLoaded",r=>{t.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),o.on("StartRenderPage",r=>{if(this.destroyed)return;this.#e.get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),o.on("commonobj",r=>{let[a,f,g]=r;if(!this.destroyed&&!this.commonObjs.has(a))switch(f){case"Font":const y=this._params;if("error"in g){const e=g.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(a,e);break}const P=y.pdfBug&&globalThis.FontInspector?.enabled?(e,i)=>
1globalThis.FontInspector.fontAdded(e,i):null,s=new _font_loader.FontFaceObject(g,{isEvalSupported:y.isEvalSupported,disableFontFace:y.disableFontFace,ignoreErrors:y.ignoreErrors,inspectFont:P});this.fontLoader.bind(s).catch(e=>o.sendWithPromise("FontFallback",{id:a})).finally(()=>{!y.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(a,s)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(a,g);break;default:throw new Error(`Got unknown common object type ${f}`)}}),o.on("obj",r=>{let[a,f,g,y]=r;if(this.destroyed)return;const P=this.#e.get(f);if(!P.objs.has(a))switch(g){case"Image":if(P.objs.resolve(a,y),y){let s;if(y.bitmap){const{width:e,height:i}=y;s=e*i*4}else s=y.data?.length||0;s>_util.MAX_IMAGE_SIZE_TO_CACHE&&(P._maybeCleanupAfterRender=!0)}break;case"Pattern":P.objs.resolve(a,y);break;default:throw new Error(`Got unknown object type ${g}`)}}),o.on("DocProgress",r=>{this.destroyed||t.onProgress?.({loaded:r.loaded,total:r.total})}),o.on("FetchBuiltInCMap",r=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(r):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),o.on("FetchStandardFontData",r=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(r):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:o,transfers:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:o,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(o){if(!Number.isInteger(o)||o<=0||o>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=o-1,r=this.#n.get(t);if(r)return r;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(f=>{if(this.destroyed)throw new Error("Transport destroyed");const g=new PDFPageProxy(t,f,this,this._params.pdfBug);return this.#e.set(t,g),g});return this.#n.set(t,a),a}getPageIndex(o){return typeof o!="object"||o===null||!Number.isInteger(o.num)||o.num<0||!Number.isInteger(o.gen)||o.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:o.num,gen:o.gen})}getAnnotations(o,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:o,intent:t})}getFieldObjects(){return this.#o("GetFieldObjects")}hasJSActions(){return this.#o("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(o){return typeof o!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:o})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#o("GetDocJSActions")}getPageJSActions(o){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:o})}getStructTree(o){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:o})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithProm
1ise("GetOptionalContentConfig",null).then(o=>new _optional_content_config.OptionalContentConfig(o))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const o="GetMetadata",t=this.#t.get(o);if(t)return t;const r=this.messageHandler.sendWithPromise(o,null).then(a=>({info:a[0],metadata:a[1]?new _metadata.Metadata(a[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(o,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#e.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),o||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:o,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:o,enableXfa:t})}}class PDFObjects{#t=Object.create(null);#e(o){return this.#t[o]||={capability:new _util.PromiseCapability,data:null}}get(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(t){const a=this.#e(o);return a.capability.promise.then(()=>t(a.data)),null}const r=this.#t[o];if(!r?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${o}.`);return r.data}has(o){return this.#t[o]?.capability.settled||!1}resolve(o){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const r=this.#e(o);r.data=t,r.capability.resolve()}clear(){for(const o in this.#t){const{data:t}=this.#t[o];t?.bitmap?.close()}this.#t=Object.create(null)}}class RenderTask{#t=null;constructor(o){this.#t=o,this.onContinue=null}get promise(){return this.#t.capability.promise}cancel(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.#t.cancel(null,o)}get separateAnnots(){const{separateAnnots:o}=this.#t.operatorList;if(!o)return!1;const{annotationCanvasMap:t}=this.#t;return o.form||o.canvas&&t?.size>0}}exports$1.RenderTask=RenderTask;class InternalRenderTask{static#t=new WeakSet;constructor(o){let{callback:t,params:r,objs:a,commonObjs:f,annotationCanvasMap:g,operatorList:y,pageIndex:P,canvasFactory:s,filterFactory:e,useRequestAnimationFrame:i=!1,pdfBug:h=!1,pageColors:u=null}=o;this.callback=t,this.params=r,this.objs=a,this.commonObjs=f,this.annotationCanvasMap=g,this.operatorListIdx=null,this.operatorList=y,this._pageIndex=P,this.canvasFactory=s,this.filterFactory=e,this._pdfBug=h,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=i===!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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(o){let{transparency:t=!1,optionalContentConfig:r}=o;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:f,transform:g,background:y}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:r},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:g,viewport:f,transparency:t,background:y}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#t.delete(this._canvas),this.callback(o||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}
1):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),InternalRenderTask.#t.delete(this._canvas),this.callback())))}}const version="3.11.174";exports$1.version=version;const build="ce8716743";exports$1.build=build}),((v,o,t)=>{var r=t(3),a=t(126),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("difference")},{difference:a})}),((v,o,t)=>{var r=t(127),a=t(128),f=t(129),g=t(132),y=t(133),P=t(130),s=t(131),e=a.has,i=a.remove;v.exports=function(u){var n=r(this),l=y(u),d=f(n);return g(n)<=l.size?P(n,function(c){l.includes(c)&&i(d,c)}):s(l.getIterator(),function(c){e(n,c)&&i(d,c)}),d}}),((v,o,t)=>{var r=t(128).has;v.exports=function(a){return r(a),a}}),((v,o,t)=>{var r=t(14),a=Set.prototype;v.exports={Set,add:r(a.add),has:r(a.has),remove:r(a.delete),proto:a}}),((v,o,t)=>{var r=t(128),a=t(130),f=r.Set,g=r.add;v.exports=function(y){var P=new f;return a(y,function(s){g(P,s)}),P}}),((v,o,t)=>{var r=t(14),a=t(131),f=t(128),g=f.Set,y=f.proto,P=r(y.forEach),s=r(y.keys),e=s(new g).next;v.exports=function(i,h,u){return u?a({iterator:s(i),next:e},h):P(i,h)}}),((v,o,t)=>{var r=t(8);v.exports=function(a,f,g){for(var y=g?a:a.iterator,P=a.next,s,e;!(s=r(P,y)).done;)if(e=f(s.value),e!==void 0)return e}}),((v,o,t)=>{var r=t(72),a=t(128);v.exports=r(a.proto,"size","get")||function(f){return f.size}}),((v,o,t)=>{var r=t(31),a=t(47),f=t(8),g=t(62),y=t(134),P="Invalid size",s=RangeError,e=TypeError,i=Math.max,h=function(u,n,l,d){this.set=u,this.size=n,this.has=l,this.keys=d};h.prototype={getIterator:function(){return y(a(f(this.keys,this.set)))},includes:function(u){return f(this.has,this.set,u)}},v.exports=function(u){a(u);var n=+u.size;if(n!==n)throw e(P);var l=g(n);if(l<0)throw s(P);return new h(u,i(l,0),r(u.has),r(u.keys))}}),(v=>{v.exports=function(o){return{iterator:o,next:o.next,done:!1}}}),((v,o,t)=>{var r=t(24),a=function(f){return{size:f,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};v.exports=function(f){var g=r("Set");try{new g()[f](a(0));try{return new g()[f](a(-1)),!1}catch{return!0}}catch{return!1}}}),((v,o,t)=>{var r=t(3),a=t(7),f=t(137),g=t(135),y=!g("intersection")||a(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});r({target:"Set",proto:!0,real:!0,forced:y},{intersection:f})}),((v,o,t)=>{var r=t(127),a=t(128),f=t(132),g=t(133),y=t(130),P=t(131),s=a.Set,e=a.add,i=a.has;v.exports=function(u){var n=r(this),l=g(u),d=new s;return f(n)>l.size?P(l.getIterator(),function(c){i(n,c)&&e(d,c)}):y(n,function(c){l.includes(c)&&e(d,c)}),d}}),((v,o,t)=>{var r=t(3),a=t(139),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("isDisjointFrom")},{isDisjointFrom:a})}),((v,o,t)=>{var r=t(127),a=t(128).has,f=t(132),g=t(133),y=t(130),P=t(131),s=t(140);v.exports=function(i){var h=r(this),u=g(i);if(f(h)<=u.size)return y(h,function(l){if(u.includes(l))return!1},!0)!==!1;var n=u.getIterator();return P(n,function(l){if(a(h,l))return s(n,"normal",!1)})!==!1}}),((v,o,t)=>{var r=t(8),a=t(47),f=t(30);v.exports=function(g,y,P){var s,e;a(g);try{if(s=f(g,"return"),!s){if(y==="throw")throw P;return P}s=r(s,g)}catch(i){e=!0,s=i}if(y==="throw")throw P;if(e)throw s;return a(s),P}}),((v,o,t)=>{var r=t(3),a=t(142),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("isSubsetOf")},{isSubsetOf:a})}),((v,o,t)=>{var r=t(127),a=t(132),f=t(130),g=t(133);v.exports=function(P){var s=r(this),e=g(P);return a(s)>e.size?!1:f(s,function(i){if(!e.includes(i))return!1},!0)!==!1}}),((v,o,t)=>{var r=t(3),a=t(144),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("isSupersetOf")},{isSupersetOf:a})}),((v,o,t)=>{var r=t(127),a=t(128).has,f=t(132),g=t(133),y=t(131),P=t(140);v.exports=function(e){var i=r(this),h=g(e);if(f(i)<h.size)return!1;var u=h.getIterator();return y(u,function(n){if(!a(i,n))return P(u,"normal",!1)})!==!1}
1}),((v,o,t)=>{var r=t(3),a=t(146),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("symmetricDifference")},{symmetricDifference:a})}),((v,o,t)=>{var r=t(127),a=t(128),f=t(129),g=t(133),y=t(131),P=a.add,s=a.has,e=a.remove;v.exports=function(h){var u=r(this),n=g(h).getIterator(),l=f(u);return y(n,function(d){s(u,d)?e(l,d):P(l,d)}),l}}),((v,o,t)=>{var r=t(3),a=t(148),f=t(135);r({target:"Set",proto:!0,real:!0,forced:!f("union")},{union:a})}),((v,o,t)=>{var r=t(127),a=t(128).add,f=t(129),g=t(133),y=t(131);v.exports=function(s){var e=r(this),i=g(s).getIterator(),h=f(e);return y(i,function(u){a(h,u)}),h}}),((v,o,t)=>{var r=t(3),a=t(4),f=t(24),g=t(11),y=t(45).f,P=t(39),s=t(150),e=t(75),i=t(76),h=t(151),u=t(82),n=t(6),l=t(36),d="DOMException",c=f("Error"),A=f(d),F=function(){s(this,R);var J=arguments.length,H=i(J<1?void 0:arguments[0]),k=i(J<2?void 0:arguments[1],"Error"),b=new A(H,k),S=c(H);return S.name=d,y(b,"stack",g(1,u(S.stack,1))),e(b,this,F),b},R=F.prototype=A.prototype,m="stack"in c(d),x="stack"in new A(1,2),O=A&&n&&Object.getOwnPropertyDescriptor(a,d),U=!!O&&!(O.writable&&O.configurable),D=m&&!U&&!x;r({global:!0,constructor:!0,forced:l||D},{DOMException:D?F:A});var G=f(d),V=G.prototype;if(V.constructor!==G){l||y(V,"constructor",g(1,G));for(var tt in h)if(P(h,tt)){var Z=h[tt],q=Z.s;P(G,q)||y(G,q,g(6,Z.c))}}}),((v,o,t)=>{var r=t(25),a=TypeError;v.exports=function(f,g){if(r(g,f))return f;throw a("Incorrect invocation")}}),(v=>{v.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}
1,InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}}),((v,o,t)=>{var r=t(36),a=t(3),f=t(4),g=t(24),y=t(14),P=t(7),s=t(41),e=t(21),i=t(153),h=t(17),u=t(20),n=t(23),l=t(154),d=t(47),c=t(78),A=t(39),F=t(159),R=t(44),m=t(64),x=t(85),O=t(160),U=t(162),D=t(128),G=t(83),V=t(119),tt=f.Object,Z=f.Array,q=f.Date,nt=f.Error,J=f.EvalError,H=f.RangeError,k=f.ReferenceError,b=f.SyntaxError,S=f.TypeError,w=f.URIError,N=f.PerformanceMark,L=f.WebAssembly,W=L&&L.CompileError||nt,I=L&&L.LinkError||nt,p=L&&L.RuntimeError||nt,E=g("DOMException"),T=U.Map,M=U.has,C=U.get,B=U.set,z=D.Set,_=D.add,it=g("Object","keys"),K=y([].push),Q=y((!0).valueOf),j=y(1 .valueOf),et=y("".valueOf),rt=y(q.prototype.getTime),lt=s("structuredClone"),ht="DataCloneError",dt="Transferring",gt=function(Y){return!P(function(){var ct=new f.Set([7]),pt=Y(ct),ut=Y(tt(7));return pt===ct||!pt.has(7)||typeof ut!="object"||+ut!=7})&&Y},mt=function(Y,ct){return!P(function(){var pt=new ct,ut=Y({a:pt,b:pt});return!(ut&&ut.a===ut.b&&ut.a instanceof ct&&ut.a.stack===pt.stack)})},St=function(Y){return!P(function(){var ct=Y(new f.AggregateError([1],lt,{cause:3}));return ct.name!=="AggregateError"||ct.errors[0]!==1||ct.message!==lt||ct.cause!==3})},Tt=f.structuredClone,wt=r||!mt(Tt,nt)||!mt(Tt,E)||!St(Tt),Ot=!Tt&>(function(Y){return new N(lt,{detail:Y}).detail}),xt=gt(Tt)||Ot,Mt=function(Y){throw new E("Uncloneable type: "+Y,ht)},kt=function(Y,ct){throw new E((ct||"Cloning")+" of "+Y+" cannot be properly polyfilled in this engine",ht)},Lt=function(Y,ct){return xt||kt(ct),xt(Y)},Ut=function(){var Y;try{Y=new f.DataTransfer}catch{try{Y=new f.ClipboardEvent("").clipboardData}catch{}}return Y&&Y.items&&Y.files?Y:null},Nt=function(Y,ct,pt){if(M(ct,Y))return C(ct,Y);var ut=pt||c(Y),ft,bt,at,Et,vt,yt;if(ut==="SharedArrayBuffer")xt?ft=xt(Y):ft=Y;else{var Ct=f.DataView;!Ct&&typeof Y.slice!="function"&&kt("ArrayBuffer");try{if(typeof Y.slice=="function"&&!Y.resizable)ft=Y.slice(0);else for(bt=Y.byteLength,at=("maxByteLength"in Y)?{maxByteLength:Y.maxByteLength}:void 0,ft=new ArrayBuffer(bt,at),Et=new Ct(Y),vt=new Ct(ft),yt=0;yt<bt;yt++)vt.setUint8(yt,Et.getUint8(yt))}catch{throw new E("ArrayBuffer is detached",ht)}}return B(ct,Y,ft),ft},st=function(Y,ct,pt,ut,ft){var bt=f[ct];return u(bt)||kt(ct),new bt(Nt(Y.buffer,ft),pt,ut)},$=function(Y,ct,pt){this.object=Y,this.type=ct,this.metadata=pt},X=function(Y,ct,pt){if(n(Y)&&Mt("Symbol"),!u(Y))return Y;if(ct){if(M(ct,Y))return C(ct,Y)}else ct=new T;var ut=c(Y),ft,bt,at,Et,vt,yt,Ct,Ft;switch(ut){case"Array":at=Z(m(Y));break;case"Object":at={};break;case"Map":at=new T;break;case"Set":at=new z;break;case"RegExp":at=new RegExp(Y.source,O(Y));break;case"Error":switch(bt=Y.name,bt){case"AggregateError":at=g("AggregateError")([]);break;case"EvalError":at=J();break;case"RangeError":at=H();break;case"ReferenceError":at=k();break;case"SyntaxError":at=b();break;case"TypeError":at=S();break;case"URIError":at=w();break;case"CompileError":at=W();break;case"LinkError":at=I();break;case"RuntimeError":at=p();break;default:at=nt()}break;case"DOMException":at=new E(Y.message,Y.name);break;case"ArrayBuffer":case"SharedArrayBuffer":at=pt?new $(Y,ut):Nt(Y,ct,ut);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":yt=ut==="DataView"?Y.byteLength:Y.length,at=pt?new $(Y,ut,{offset:Y.byteOffset,length:yt}):st(Y,ut,Y.byteOffset,yt,ct);break;case"DOMQuad":try{at=new DOMQuad(X(Y.p1,ct,pt),X(Y.p2,ct,pt),X(Y.p3,ct,pt),X(Y.p4,ct,pt))}catch{at=Lt(Y,ut)}break;case"File":if(xt)try{at=xt(Y),c(at)!==ut&&(at=void 0)}catch{}if(!at)try{at=new File([Y],Y.name,Y)}catch{}at||kt(ut);break;case"FileList":if(Et=Ut(),Et){for(vt=0,yt=m(Y);vt<yt;vt++)Et.items.add(X(Y[vt],ct,pt));at=Et.files}else at=Lt(Y,ut);break;case"ImageData":try{at=new ImageData(X(Y.data,ct,pt),Y.width,Y.height,{colorSpace:Y.colorSpace})}catch{at=Lt(Y,ut)}break;default:if(xt)at=xt(Y);else switch(ut){case"BigInt":at=tt(Y.valueOf());break;case"Boolean":at=tt(Q(Y));break;case"Number":at=tt(j(Y));break;case"String":at=tt(et(Y));break;case"Date":at=new q(rt(Y));break;case"Blob":try{at=Y.slice(0,Y.size,Y.type)}catch{kt(ut)}break;case"DOMPoint":case"DOMPointReadOnly":ft=f[ut];try{at=ft.fromPoint?ft.fromPoint(Y):new ft(Y.x,Y.y,Y.z,Y.w)}catch{kt(ut)}break;case"DOMRect":case"DOMRectReadOnly":ft=f[ut];try{at=ft.fromRect?ft.fromRect(Y):new ft(Y.x,Y.y,Y.width,Y.height)}catch{kt(ut)}break;case"DOMMatrix":case"DOMMatrixReadOnly":ft=f[ut];try{at=ft.fromMatrix?ft.fromMatrix(Y):new ft(Y)}catch{kt(ut)}break;case"AudioData":case"VideoFrame":e(Y.clone)||kt(ut);try{at=Y.clone()}catch{Mt(ut)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":kt(ut);default:Mt(ut)}}switch(B(ct,Y,at),ut){case"Array":case"Object":for(Ct=it(Y),vt=0,yt=m(Ct);vt<yt;vt++)Ft=Ct[vt],F(at,Ft,X(Y[Ft],ct,pt));break;case"Map":Y.forEach(function(Pt,Dt){B(at,X(Dt,ct,pt),X(Pt,ct,pt))});break;case"Set":Y.forEach(function(Pt){_(at,X(Pt,ct,pt))});break;case"Error":R(at,"message",X(Y.message,ct,pt)),A(Y,"cause")&&R(at,"cause",X(Y.cause,ct,pt)),bt==="AggregateError"&&(at.errors=X(Y.errors,ct,pt));case"DOMException":G&&R(at,"stack",X(Y.stack,ct,pt))}return at},ot=function(Y,ct){if(!u(Y))return Y;if(M(ct,Y))return C(ct,Y);var pt,ut,ft,bt,at,Et,vt,yt;if(Y instanceof $)switch(pt=Y.type,ut=Y.object,pt){case"ArrayBuffer":case"SharedArrayBuffer":yt=Nt(ut,ct,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":ft=Y.metadata,yt=st(ut,pt,ft.offset,ft.length,ct)}else switch(c(Y)){case"Array":case"Object":for(Et=it(Y),bt=0,at=m(Et);bt<at;bt++)vt=Et[bt],Y[vt]=ot(Y[vt],ct);break;case"Map":yt=new T,Y.forEach(function(Ct,Ft){B(yt,ot(Ft,ct),ot(Ct,ct))});break;case"Set":yt=new z,Y.forEach(function(Ct){_(yt,ot(Ct,ct))});break;case"Error":Y.message=ot(Y.message,ct),A(Y,"cause")&&(Y.cause=ot(Y.cause,ct)),Y.name==="AggregateError"&&(Y.errors=ot(Y.errors,ct));case"DOMException":G&&(Y.stack=ot(Y.stack,ct))}return B(ct,Y,yt||Y),yt||Y},At=function(Y,ct){if(!u(Y))throw S("Transfer option cannot be converted to a sequence");var pt=[];
1l(Y,function(Pt){K(pt,d(Pt))});for(var ut=0,ft=m(pt),bt=[],at,Et,vt,yt,Ct,Ft;ut<ft;){if(at=pt[ut++],Et=c(at),Et==="ArrayBuffer"){K(bt,at);continue}if(M(ct,at))throw new E("Duplicate transferable",ht);if(V)yt=Tt(at,{transfer:[at]});else switch(Et){case"ImageBitmap":vt=f.OffscreenCanvas,i(vt)||kt(Et,dt);try{Ct=new vt(at.width,at.height),Ft=Ct.getContext("bitmaprenderer"),Ft.transferFromImageBitmap(at),yt=Ct.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!e(at.clone)||!e(at.close))&&kt(Et,dt);try{yt=at.clone(),at.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":kt(Et,dt)}if(yt===void 0)throw new E("This object cannot be transferred: "+Et,ht);B(ct,at,yt)}return bt},Rt=function(Y,ct){for(var pt=0,ut=m(Y),ft,bt;pt<ut;){if(ft=Y[pt++],M(ct,ft))throw new E("Duplicate transferable",ht);V?bt=Tt(ft,{transfer:[ft]}):(e(ft.transfer)||kt("ArrayBuffer",dt),bt=ft.transfer()),B(ct,ft,bt)}};a({global:!0,enumerable:!0,sham:!V,forced:wt},{structuredClone:function(ct){var pt=x(arguments.length,1)>1&&!h(arguments[1])?d(arguments[1]):void 0,ut=pt?pt.transfer:void 0,ft=!1,bt,at;ut!==void 0&&(bt=new T,at=At(ut,bt),ft=!!m(at));var Et=X(ct,bt,ft);return ft&&(bt=new T,Rt(ut,bt),Et=ot(Et,bt)),Et}})}),((v,o,t)=>{var r=t(14),a=t(7),f=t(21),g=t(78),y=t(24),P=t(51),s=function(){},e=[],i=y("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=r(h.exec),n=!h.exec(s),l=function(A){if(!f(A))return!1;try{return i(s,e,A),!0}catch{return!1}},d=function(A){if(!f(A))return!1;switch(g(A)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return n||!!u(h,P(A))}catch{return!0}};d.sham=!0,v.exports=!i||a(function(){var c;return l(l.call)||!l(Object)||!l(function(){c=!0})||c})?d:l}),((v,o,t)=>{var r=t(99),a=t(8),f=t(47),g=t(32),y=t(155),P=t(64),s=t(25),e=t(157),i=t(158),h=t(140),u=TypeError,n=function(d,c){this.stopped=d,this.result=c},l=n.prototype;v.exports=function(d,c,A){var F=A&&A.that,R=!!(A&&A.AS_ENTRIES),m=!!(A&&A.IS_RECORD),x=!!(A&&A.IS_ITERATOR),O=!!(A&&A.INTERRUPTED),U=r(c,F),D,G,V,tt,Z,q,nt,J=function(k){return D&&h(D,"normal",k),new n(!0,k)},H=function(k){return R?(f(k),O?U(k[0],k[1],J):U(k[0],k[1])):O?U(k,J):U(k)};if(m)D=d.iterator;else if(x)D=d;else{if(G=i(d),!G)throw u(g(d)+" is not iterable");if(y(G)){for(V=0,tt=P(d);tt>V;V++)if(Z=H(d[V]),Z&&s(l,Z))return Z;return new n(!1)}D=e(d,G)}for(q=m?d.next:D.next;!(nt=a(q,D)).done;){try{Z=H(nt.value)}catch(k){h(D,"throw",k)}if(typeof Z=="object"&&Z&&s(l,Z))return Z}return new n(!1)}}),((v,o,t)=>{var r=t(34),a=t(156),f=r("iterator"),g=Array.prototype;v.exports=function(y){return y!==void 0&&(a.Array===y||g[f]===y)}}),(v=>{v.exports={}}),((v,o,t)=>{var r=t(8),a=t(31),f=t(47),g=t(32),y=t(158),P=TypeError;v.exports=function(s,e){var i=arguments.length<2?y(s):e;if(a(i))return f(r(i,s));throw P(g(s)+" is not iterable")}}),((v,o,t)=>{var r=t(78),a=t(30),f=t(17),g=t(156),y=t(34),P=y("iterator");v.exports=function(s){if(!f(s))return a(s,P)||a(s,"@@iterator")||g[r(s)]}}),((v,o,t)=>{var r=t(18),a=t(45),f=t(11);v.exports=function(g,y,P){var s=r(y);s in g?a.f(g,s,f(0,P)):g[s]=P}}),((v,o,t)=>{var r=t(8),a=t(39),f=t(25),g=t(161),y=RegExp.prototype;v.exports=function(P){var s=P.flags;return s===void 0&&!("flags"in y)&&!a(P,"flags")&&f(y,P)?r(g,P):s}}),((v,o,t)=>{var r=t(47);v.exports=function(){var a=r(this),f="";return a.hasIndices&&(f+="d"),a.global&&(f+="g"),a.ignoreCase&&(f+="i"),a.multiline&&(f+="m"),a.dotAll&&(f+="s"),a.unicode&&(f+="u"),a.unicodeSets&&(f+="v"),a.sticky&&(f+="y"),f}}),((v,o,t)=>{var r=t(14),a=Map.prototype;v.exports={Map,set:r(a.set),get:r(a.get),has:r(a.has),remove:r(a.delete),proto:a}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SerializableEmpty=o.PrintAnnotationStorage=o.AnnotationStorage=void 0,t(89),t(149),t(152);var r=t(1),a=t(164),f=t(170);const g=Object.freeze({map:null,hash:"",transfers:void 0});o.SerializableEmpty=g;class y{#t=!1;#e=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const h=this.#e.get(e);return h===void 0?i:Object.assign(i,h)}getRawValue(e){return this.#e.get(e)}remove(e){if(this.#e.delete(e),this.#e.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of this.#e.values())if(i instanceof a.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,i){const h=this.#e.get(e);let u=!1;if(h!==void 0)for(const[n,l]of Object.entries(i))h[n]!==l&&(u=!0,h[n]=l);else u=!0,this.#e.set(e,i);u&&this.#n(),i instanceof a.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(e){return this.#e.has(e)}getAll(){return this.#e.size>0?(0,r.objectFromMap)(this.#e):null}setAll(e){for(const[i,h]of Object.entries(e))this.setValue(i,h)}get size(){return this.#e.size}#n(){this.#t||(this.#t=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new P(this)}get serializable(){if(this.#e.size===0)return g;const e=new Map,i=new f.MurmurHash3_64,h=[],u=Object.create(null);let n=!1;for(const[l,d]of this.#e){const c=d instanceof a.AnnotationEditor?d.serialize(!1,u):d;c&&(e.set(l,c),i.update(`${l}:${JSON.stringify(c)}`),n||=!!c.bitmap)}if(n)for(const l of e.values())l.bitmap&&h.push(l.bitmap);return e.size>0?{map:e,hash:i.hexdigest(),transfers:h}:g}}o.AnnotationStorage=y;class P extends y{#t;constructor(e){super();const{map:i,hash:h,transfers:u}=e.serializable,n=structuredClone(i,null);this.#t={map:n,hash:h,transfers:u}}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}}o.PrintAnnotationStorage=P}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AnnotationEditor=void 0,t(89),t(2);var r=t(165),a=t(1),f=t(168);class g{#t="";#e=!1;#n=null;#r=null;#o=null;#a=!1;#i=null;#l=this.focusin.bind(this);#c=this.focusout.bind(this);#s=!1;#f=!1;#u=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#d=!1;#p=g._zIndex++;static _borderLineWidth=-1;static _colorManager=new r.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(s){this.constructor===g&&(0,a.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:e,rawDims:{pageWidth:i,pageHeight:h,pageX:u,pageY:n}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,h],this.pageTranslation=[u,n];const[l,d]=this.parentDimensions;this.x=s.x/l,this.y=s.y/d,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,a.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(s){const e=new y({id:s.parent.getNextId(),parent:s.parent,uiManager:s._uiManager});e.annotationElementId=s.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(g._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(h=>[h,s.get(h)])),e?.strings)for(const h of e.strings)g._l10nPromise.set(h,s.get(h));if(g._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);g._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(s,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(s){return!1}static paste(s,e){(0,a.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#d}set _isDraggable(s){this.#d=s,this.div?.classList.toggle("draggable",s)}center(){const[s,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(s*2),this.y+=this.width*s/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(s*2),this.y-=this.width*s/(e*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}
1setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#p}setParent(s){s!==null&&(this.pageIndex=s.pageIndex,this.pageDimensions=s.pageDimensions),this.parent=s}focusin(s){this._focusEventsAllowed&&(this.#s?this.#s=!1:this.parent.setSelected(this))}focusout(s){!this._focusEventsAllowed||!this.isAttachedToDOM||s.relatedTarget?.closest(`#${this.id}`)||(s.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(s,e,i,h){const[u,n]=this.parentDimensions;[i,h]=this.screenToPageTranslation(i,h),this.x=(s+i)/u,this.y=(e+h)/n,this.fixAndSetPosition()}#v(s,e,i){let[h,u]=s;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/h,this.y+=i/u,this.fixAndSetPosition()}translate(s,e){this.#v(this.parentDimensions,s,e)}translateInPage(s,e){this.#v(this.pageDimensions,s,e),this.div.scrollIntoView({block:"nearest"})}drag(s,e){const[i,h]=this.parentDimensions;if(this.x+=s/i,this.y+=e/h,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:c,y:A}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,A)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:u,y:n}=this;const[l,d]=this.#m();u+=l,n+=d,this.div.style.left=`${(100*u).toFixed(2)}%`,this.div.style.top=`${(100*n).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}#m(){const[s,e]=this.parentDimensions,{_borderLineWidth:i}=g,h=i/s,u=i/e;switch(this.rotation){case 90:return[-h,u];case 180:return[h,u];case 270:return[h,-u];default:return[-h,-u]}}fixAndSetPosition(){const[s,e]=this.pageDimensions;let{x:i,y:h,width:u,height:n}=this;switch(u*=s,n*=e,i*=s,h*=e,this.rotation){case 0:i=Math.max(0,Math.min(s-u,i)),h=Math.max(0,Math.min(e-n,h));break;case 90:i=Math.max(0,Math.min(s-n,i)),h=Math.min(e,Math.max(u,h));break;case 180:i=Math.min(s,Math.max(u,i)),h=Math.min(e,Math.max(n,h));break;case 270:i=Math.min(s,Math.max(n,i)),h=Math.max(0,Math.min(e-u,h));break}this.x=i/=s,this.y=h/=e;const[l,d]=this.#m();i+=l,h+=d;const{style:c}=this.div;c.left=`${(100*i).toFixed(2)}%`,c.top=`${(100*h).toFixed(2)}%`,this.moveInDOM()}static#g(s,e,i){switch(i){case 90:return[e,-s];case 180:return[-s,-e];case 270:return[-e,s];default:return[s,e]}}screenToPageTranslation(s,e){return g.#g(s,e,this.parentRotation)}pageTranslationToScreen(s,e){return g.#g(s,e,360-this.parentRotation)}#h(s){switch(s){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:s,pageDimensions:[e,i]}=this,h=e*s,u=i*s;return a.FeatureTest.isCSSRoundSupported?[Math.round(h),Math.round(u)]:[h,u]}setDims(s,e){const[i,h]=this.parentDimensions;this.div.style.width=`${(100*s/i).toFixed(2)}%`,this.#a||(this.div.style.height=`${(100*e/h).toFixed(2)}%`),this.#n?.classList.toggle("small",s<g.SMALL_EDITOR_SIZE||e<g.SMALL_EDITOR_SIZE)}fixDims(){const{style:s}=this.div,{height:e,width:i}=s,h=i.endsWith("%"),u=!this.#a&&e.endsWith("%");if(h&&u)return;const[n,l]=this.parentDimensions;h||(s.width=`${(100*parseFloat(i)/n).toFixed(2)}%`),!this.#a&&!u&&(s.height=`${(100*parseFloat(e)/l).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#b(){if(this.#i)return;this.#i=document.createElement("div"),this.#i.classList.add("resizers");const s=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||s.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const e of s){const i=document.createElement("div");this.#i.append(i),i.classList.add("resizer",e),i.addEventListener("pointerdown",this.#x.bind(this,e)),i.addEventListener("contextmenu",f.noContextMenu)}this.div.prepend(this.#i)}#x(s,e){e.preventDefault();const{isMac:i}=a.FeatureTest.platform;if(e.button!==0||e.ctrlKey&&i)return;const h=this.#E.bind(this,s),u=this._isDraggable;this._isDraggable=!1;const n={passive:!0,capture:!0};window.addEventListener("pointermove",h,n);const l=this.x,d=this.y,c=this.width,A=this.height,F=this.parent.div.style.cursor,R=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const m=()=>{this._isDraggable=u,window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),window.removeEventListener("pointermove",h,n),this.parent.div.style.cursor=F,this.div.style.cursor=R;const x=this.x,O=this.y,U=this.width,D=this.height;x===l&&O===d&&U===c&&D===A||this.addCommands({cmd:()=>{this.width=U,this.height=D,this.x=x,this.y=O;const[G,V]=this.parentDimensions;this.setDims(G*U,V*D),this.fixAndSetPosition()},undo:()=>{this.width=c,this.height=A,this.x=l,this.y=d;const[G,V]=this.parentDimensions;this.setDims(G*c,V*A),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",m),window.addEventListener("blur",m)}#E(s,e){const[i,h]=this.parentDimensions,u=this.x,n=this.y,l=this.width,d=this.height,c=g.MIN_SIZE/i,A=g.MIN_SIZE/h,F=I=>Math.round(I*1e4)/1e4,R=this.#h(this.rotation),m=(I,p)=>[R[0]*I+R[2]*p,R[1]*I+R[3]*p],x=this.#h(360-this.rotation),O=(I,p)=>[x[0]*I+x[2]*p,x[1]*I+x[3]*p];let U,D,G=!1,V=!1;switch(s){case"topLeft":G=!0,U=(I,p)=>[0,0],D=(I,p)=>[I,p];break;case"topMiddle":U=(I,p)=>[I/2,0],D=(I,p)=>[I/2,p];break;case"topRight":G=!0,U=(I,p)=>[I,0],D=(I,p)=>[0,p];break;case"middleRight":V=!0,U=(I,p)=>[I,p/2],D=(I,p)=>[0,p/2];break;case"bottomRight":G=!0,U=(I,p)=>[I,p],D=(I,p)=>[0,0];break;case"bottomMiddle":U=(I,p)=>[I/2,p],D=(I,p)=>[I/2,0];break;case"bottomLeft":G=!0,U=(I,p)=>[0,p],D=(I,p)=>[I,0];break;case"middleLeft":V=!0,U=(I,p)=>[0,p/2],D=(I,p)=>[I,p/2];break}const tt=U(l,d),Z=D(l,d);let q=m(...Z);const nt=F(u+q[0]),J=F(n+q[1]);let H=1,k=1,[b,S]=this.screenToPageTranslation(e.movementX,e.movementY);if([b,S]=O(b/i,S/h),G){const I=Math.hypot(l,d);H=k=Math.max(Math.min(Math.hypot(Z[0]-tt[0]-b,Z[1]-tt[1]-S)/I,1/l,1/d),c/l,A/d)}else V?H=Math.max(c,Math.min(1,Math.abs(Z[0]-tt[0]-b)))/l:k=Math.max(A,Math.min(1,Math.abs(Z[1]-tt[1]-S)))
1/d;const w=F(l*H),N=F(d*k);q=m(...D(w,N));const L=nt-q[0],W=J-q[1];this.width=w,this.height=N,this.x=L,this.y=W,this.setDims(i*w,h*N),this.fixAndSetPosition()}async addAltTextButton(){if(this.#n)return;const s=this.#n=document.createElement("button");s.className="altText";const e=await g._l10nPromise.get("editor_alt_text_button_label");s.textContent=e,s.setAttribute("aria-label",e),s.tabIndex="0",s.addEventListener("contextmenu",f.noContextMenu),s.addEventListener("pointerdown",i=>i.stopPropagation()),s.addEventListener("click",i=>{i.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),s.addEventListener("keydown",i=>{i.target===s&&i.key==="Enter"&&(i.preventDefault(),this._uiManager.editAltText(this))}),this.#P(),this.div.append(s),g.SMALL_EDITOR_SIZE||(g.SMALL_EDITOR_SIZE=Math.min(128,Math.round(s.getBoundingClientRect().width*1.4)))}async#P(){const s=this.#n;if(!s)return;if(!this.#t&&!this.#e){s.classList.remove("done"),this.#r?.remove();return}g._l10nPromise.get("editor_alt_text_edit_button_label").then(i=>{s.setAttribute("aria-label",i)});let e=this.#r;if(!e){this.#r=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");const i=e.id=`alt-text-tooltip-${this.id}`;s.setAttribute("aria-describedby",i);const h=100;s.addEventListener("mouseenter",()=>{this.#o=setTimeout(()=>{this.#o=null,this.#r.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},h)}),s.addEventListener("mouseleave",()=>{clearTimeout(this.#o),this.#o=null,this.#r?.classList.remove("show")})}s.classList.add("done"),e.innerText=this.#e?await g._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#t,e.parentNode||s.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#t,decorative:this.#e}}set altTextData(s){let{altText:e,decorative:i}=s;this.#t===e&&this.#e===i||(this.#t=e,this.#e=i,this.#P())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#l),this.div.addEventListener("focusout",this.#c);const[s,e]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*e/s).toFixed(2)}%`,this.div.style.maxHeight=`${(100*s/e).toFixed(2)}%`);const[i,h]=this.getInitialTranslation();return this.translate(i,h),(0,r.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(s){const{isMac:e}=a.FeatureTest.platform;if(s.button!==0||s.ctrlKey&&e){s.preventDefault();return}this.#s=!0,this.#R(s)}#R(s){if(!this._isDraggable)return;const e=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,h;e&&(i={passive:!0,capture:!0},h=n=>{const[l,d]=this.screenToPageTranslation(n.movementX,n.movementY);this._uiManager.dragSelectedEditors(l,d)},window.addEventListener("pointermove",h,i));const u=()=>{if(window.removeEventListener("pointerup",u),window.removeEventListener("blur",u),e&&window.removeEventListener("pointermove",h,i),this.#s=!1,!this._uiManager.endDragSession()){const{isMac:n}=a.FeatureTest.platform;s.ctrlKey&&!n||s.shiftKey||s.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",u),window.addEventListener("blur",u)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(s,e,i){s.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(s,e){const i=this.parentScale,[h,u]=this.pageDimensions,[n,l]=this.pageTranslation,d=s/i,c=e/i,A=this.x*h,F=this.y*u,R=this.width*h,m=this.height*u;switch(this.rotation){case 0:return[A+d+n,u-F-c-m+l,A+d+R+n,u-F-c+l];case 90:return[A+c+n,u-F+d+l,A+c+m+n,u-F+d+R+l];case 180:return[A-d-R+n,u-F+c+l,A-d+n,u-F+c+m+l];case 270:return[A-c-m+n,u-F-d-R+l,A-c+n,u-F-d+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(s,e){const[i,h,u,n]=s,l=u-i,d=n-h;switch(this.rotation){case 0:return[i,e-n,l,d];case 90:return[i,e-h,d,l];case 180:return[u,e-h,l,d];case 270:return[u,e-n,d,l];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#u=!0}disableEditMode(){this.#u=!1}isInEditMode(){return this.#u}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#l),this.div?.addEventListener("focusout",this.#c)}serialize(){(0,a.unreachable)("An editor must be serializable")}static deserialize(s,e,i){const h=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});h.rotation=s.rotation;const[u,n]=h.pageDimensions,[l,d,c,A]=h.getRectInCurrentCoords(s.rect,n);return h.x=l/u,h.y=d/n,h.width=c/u,h.height=A/n,h}remove(){this.div.removeEventListener("focusin",this.#l),this.div.removeEventListener("focusout",this.#c),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#n?.remove(),this.#n=null,this.#r=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b(),this.#i.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#i?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(s,e){}disableEditing(){this.#n&&(this.#n.hidden=!0)}enableEditing(){this.#n&&(this.#n.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#f}set isEditing(s){this.#f=s,this.parent&&(s?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(s,e){this.#a=!0;const i=s/e,{style:h}=this.div;h.aspectRatio=i,h.height="auto"}static get MIN_SIZE(){return 16}}o.AnnotationEditor=g;class y extends g{constructor(s){super(s),this.annotationElementId=s.annotationElementId,this.deleted=!0}
1serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.KeyboardManager=o.CommandManager=o.ColorManager=o.AnnotationEditorUIManager=void 0,o.bindEvents=f,o.opacityToHex=g,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 r=t(1),a=t(168);function f(u,n,l){for(const d of l)n.addEventListener(d,u[d].bind(u))}function g(u){return Math.round(Math.min(255,Math.max(1,255*u))).toString(16).padStart(2,"0")}class y{#t=0;getId(){return`${r.AnnotationEditorPrefix}${this.#t++}`}}class P{#t=(0,r.getUuid)();#e=0;#n=null;static get _isSVGFittingCanvas(){const n='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>',d=new OffscreenCanvas(1,3).getContext("2d"),c=new Image;c.src=n;const A=c.decode().then(()=>(d.drawImage(c,0,0,1,1,0,0,1,3),new Uint32Array(d.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,r.shadow)(this,"_isSVGFittingCanvas",A)}async#r(n,l){this.#n||=new Map;let d=this.#n.get(n);if(d===null)return null;if(d?.bitmap)return d.refCounter+=1,d;try{d||={bitmap:null,id:`image_${this.#t}_${this.#e++}`,refCounter:0,isSvg:!1};let c;if(typeof l=="string"){d.url=l;const A=await fetch(l);if(!A.ok)throw new Error(A.statusText);c=await A.blob()}else c=d.file=l;if(c.type==="image/svg+xml"){const A=P._isSVGFittingCanvas,F=new FileReader,R=new Image,m=new Promise((x,O)=>{R.onload=()=>{d.bitmap=R,d.isSvg=!0,x()},F.onload=async()=>{const U=d.svgUrl=F.result;R.src=await A?`${U}#svgView(preserveAspectRatio(none))`:U},R.onerror=F.onerror=O});F.readAsDataURL(c),await m}else d.bitmap=await createImageBitmap(c);d.refCounter=1}catch{d=null}return this.#n.set(n,d),d&&this.#n.set(d.id,d),d}async getFromFile(n){const{lastModified:l,name:d,size:c,type:A}=n;return this.#r(`${l}_${d}_${c}_${A}`,n)}async getFromUrl(n){return this.#r(n,n)}async getFromId(n){this.#n||=new Map;const l=this.#n.get(n);return l?l.bitmap?(l.refCounter+=1,l):l.file?this.getFromFile(l.file):this.getFromUrl(l.url):null}getSvgUrl(n){const l=this.#n.get(n);return l?.isSvg?l.svgUrl:null}deleteId(n){this.#n||=new Map;const l=this.#n.get(n);l&&(l.refCounter-=1,l.refCounter===0&&(l.bitmap=null))}isValidId(n){return n.startsWith(`image_${this.#t}_`)}}class s{#t=[];#e=!1;#n;#r=-1;constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:128;this.#n=n}add(n){let{cmd:l,undo:d,mustExec:c,type:A=NaN,overwriteIfSameType:F=!1,keepUndo:R=!1}=n;if(c&&l(),this.#e)return;const m={cmd:l,undo:d,type:A};if(this.#r===-1){this.#t.length>0&&(this.#t.length=0),this.#r=0,this.#t.push(m);return}if(F&&this.#t[this.#r].type===A){R&&(m.undo=this.#t[this.#r].undo),this.#t[this.#r]=m;return}const x=this.#r+1;x===this.#n?this.#t.splice(0,1):(this.#r=x,x<this.#t.length&&this.#t.splice(x)),this.#t.push(m)}undo(){this.#r!==-1&&(this.#e=!0,this.#t[this.#r].undo(),this.#e=!1,this.#r-=1)}redo(){this.#r<this.#t.length-1&&(this.#r+=1,this.#e=!0,this.#t[this.#r].cmd(),this.#e=!1)}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#t.length-1}destroy(){this.#t=null}}o.CommandManager=s;class e{constructor(n){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:l}=r.FeatureTest.platform;for(const[d,c,A={}]of n)for(const F of d){const R=F.startsWith("mac+");l&&R?(this.callbacks.set(F.slice(4),{callback:c,options:A}),this.allKeys.add(F.split("+").at(-1))):!l&&!R&&(this.callbacks.set(F,{callback:c,options:A}),this.allKeys.add(F.split("+").at(-1)))}}#t(n){n.altKey&&this.buffer.push("alt"),n.ctrlKey&&this.buffer.push("ctrl"),n.metaKey&&this.buffer.push("meta"),n.shiftKey&&this.buffer.push("shift"),this.buffer.push(n.key);const l=this.buffer.join("+");return this.buffer.length=0,l}exec(n,l){if(!this.allKeys.has(l.key))return;const d=this.callbacks.get(this.#t(l));if(!d)return;const{callback:c,options:{bubbles:A=!1,args:F=[],checker:R=null}}=d;R&&!R(n,l)||(c.bind(n,...F)(),A||(l.stopPropagation(),l.preventDefault()))}}o.KeyboardManager=e;
1class i{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const n=new Map([["CanvasText",null],["Canvas",null]]);return(0,a.getColorValues)(n),(0,r.shadow)(this,"_colors",n)}convert(n){const l=(0,a.getRGB)(n);if(!window.matchMedia("(forced-colors: active)").matches)return l;for(const[d,c]of this._colors)if(c.every((A,F)=>A===l[F]))return i._colorsMapping.get(d);return l}getHexCode(n){const l=this._colors.get(n);return l?r.Util.makeHexColor(...l):n}}o.ColorManager=i;class h{#t=null;#e=new Map;#n=new Map;#r=null;#o=null;#a=new s;#i=0;#l=new Set;#c=null;#s=null;#f=new Set;#u=null;#d=new y;#p=!1;#v=!1;#m=null;#g=r.AnnotationEditorType.NONE;#h=new Set;#b=null;#x=this.blur.bind(this);#E=this.focus.bind(this);#P=this.copy.bind(this);#R=this.cut.bind(this);#D=this.paste.bind(this);#L=this.keydown.bind(this);#N=this.onEditingAction.bind(this);#y=this.onPageChanging.bind(this);#O=this.onScaleChanging.bind(this);#w=this.onRotationChanging.bind(this);#M={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#A=[0,0];#k=null;#T=null;#B=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const n=h.prototype,l=A=>{const{activeElement:F}=document;return F&&A.#T.contains(F)&&A.hasSomethingToControl()},d=this.TRANSLATE_SMALL,c=this.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new e([[["ctrl+a","mac+meta+a"],n.selectAll],[["ctrl+z","mac+meta+z"],n.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],n.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],n.delete],[["Escape","mac+Escape"],n.unselectAll],[["ArrowLeft","mac+ArrowLeft"],n.translateSelectedEditors,{args:[-d,0],checker:l}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],n.translateSelectedEditors,{args:[-c,0],checker:l}],[["ArrowRight","mac+ArrowRight"],n.translateSelectedEditors,{args:[d,0],checker:l}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],n.translateSelectedEditors,{args:[c,0],checker:l}],[["ArrowUp","mac+ArrowUp"],n.translateSelectedEditors,{args:[0,-d],checker:l}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],n.translateSelectedEditors,{args:[0,-c],checker:l}],[["ArrowDown","mac+ArrowDown"],n.translateSelectedEditors,{args:[0,d],checker:l}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],n.translateSelectedEditors,{args:[0,c],checker:l}]]))}constructor(n,l,d,c,A,F){this.#T=n,this.#B=l,this.#r=d,this._eventBus=c,this._eventBus._on("editingaction",this.#N),this._eventBus._on("pagechanging",this.#y),this._eventBus._on("scalechanging",this.#O),this._eventBus._on("rotationchanging",this.#w),this.#o=A.annotationStorage,this.#u=A.filterFactory,this.#b=F,this.viewParameters={realScale:a.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#F(),this.#W(),this._eventBus._off("editingaction",this.#N),this._eventBus._off("pagechanging",this.#y),this._eventBus._off("scalechanging",this.#O),this._eventBus._off("rotationchanging",this.#w);for(const n of this.#n.values())n.destroy();this.#n.clear(),this.#e.clear(),this.#f.clear(),this.#t=null,this.#h.clear(),this.#a.destroy(),this.#r.destroy()}get hcmFilter(){return(0,r.shadow)(this,"hcmFilter",this.#b?this.#u.addHCMFilter(this.#b.foreground,this.#b.background):"none")}get direction(){return(0,r.shadow)(this,"direction",getComputedStyle(this.#T).direction)}editAltText(n){this.#r?.editAltText(this,n)}onPageChanging(n){let{pageNumber:l}=n;this.#i=l-1}focusMainContainer(){this.#T.focus()}findParent(n,l){for(const d of this.#n.values()){const{x:c,y:A,width:F,height:R}=d.div.getBoundingClientRect();if(n>=c&&n<=c+F&&l>=A&&l<=A+R)return d}return null}disableUserSelect(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.#B.classList.toggle("noUserSelect",n)}addShouldRescale(n){this.#f.add(n)}removeShouldRescale(n){this.#f.delete(n)}onScaleChanging(n){let{scale:l}=n;this.commitOrRemove(),this.viewParameters.realScale=l*a.PixelsPerInch.PDF_TO_CSS_UNITS;for(const d of this.#f)d.onScaleChanging()}onRotationChanging(n){let{pagesRotation:l}=n;this.commitOrRemove(),this.viewParameters.rotation=l}addToAnnotationStorage(n){!n.isEmpty()&&this.#o&&!this.#o.has(n.id)&&this.#o.setValue(n.id,n)}
1#U(){window.addEventListener("focus",this.#E),window.addEventListener("blur",this.#x)}#W(){window.removeEventListener("focus",this.#E),window.removeEventListener("blur",this.#x)}blur(){if(!this.hasSelection)return;const{activeElement:n}=document;for(const l of this.#h)if(l.div.contains(n)){this.#m=[l,n],l._focusEventsAllowed=!1;break}}focus(){if(!this.#m)return;const[n,l]=this.#m;this.#m=null,l.addEventListener("focusin",()=>{n._focusEventsAllowed=!0},{once:!0}),l.focus()}#H(){window.addEventListener("keydown",this.#L,{capture:!0})}#F(){window.removeEventListener("keydown",this.#L,{capture:!0})}#I(){document.addEventListener("copy",this.#P),document.addEventListener("cut",this.#R),document.addEventListener("paste",this.#D)}#C(){document.removeEventListener("copy",this.#P),document.removeEventListener("cut",this.#R),document.removeEventListener("paste",this.#D)}addEditListeners(){this.#H(),this.#I()}removeEditListeners(){this.#F(),this.#C()}copy(n){if(n.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const l=[];for(const d of this.#h){const c=d.serialize(!0);c&&l.push(c)}l.length!==0&&n.clipboardData.setData("application/pdfjs",JSON.stringify(l))}cut(n){this.copy(n),this.delete()}paste(n){n.preventDefault();const{clipboardData:l}=n;for(const A of l.items)for(const F of this.#s)if(F.isHandlingMimeForPasting(A.type)){F.paste(A,this.currentLayer);return}let d=l.getData("application/pdfjs");if(!d)return;try{d=JSON.parse(d)}catch(A){(0,r.warn)(`paste: "${A.message}".`);return}if(!Array.isArray(d))return;this.unselectAll();const c=this.currentLayer;try{const A=[];for(const m of d){const x=c.deserialize(m);if(!x)return;A.push(x)}const F=()=>{for(const m of A)this.#V(m);this.#X(A)},R=()=>{for(const m of A)m.remove()};this.addCommands({cmd:F,undo:R,mustExec:!0})}catch(A){(0,r.warn)(`paste: "${A.message}".`)}}keydown(n){this.getActive()?.shouldGetKeyboardEvents()||h._keyboardManager.exec(this,n)}onEditingAction(n){["undo","redo","delete","selectAll"].includes(n.name)&&this[n.name]()}#S(n){Object.entries(n).some(d=>{let[c,A]=d;return this.#M[c]!==A})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#M,n)})}#z(n){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:n})}setEditingState(n){n?(this.#U(),this.#H(),this.#I(),this.#S({isEditing:this.#g!==r.AnnotationEditorType.NONE,isEmpty:this.#G(),hasSomethingToUndo:this.#a.hasSomethingToUndo(),hasSomethingToRedo:this.#a.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#W(),this.#F(),this.#C(),this.#S({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(n){if(!this.#s){this.#s=n;for(const l of this.#s)this.#z(l.defaultPropertiesToUpdate)}}getId(){return this.#d.getId()}get currentLayer(){return this.#n.get(this.#i)}getLayer(n){return this.#n.get(n)}get currentPageIndex(){return this.#i}addLayer(n){this.#n.set(n.pageIndex,n),this.#p?n.enable():n.disable()}removeLayer(n){this.#n.delete(n.pageIndex)}updateMode(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.#g!==n){if(this.#g=n,n===r.AnnotationEditorType.NONE){this.setEditingState(!1),this.#Y();return}this.setEditingState(!0),this.#_(),this.unselectAll();for(const d of this.#n.values())d.updateMode(n);if(l){for(const d of this.#e.values())if(d.annotationElementId===l){this.setSelected(d),d.enterInEditMode();break}}}}updateToolbar(n){n!==this.#g&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:n})}updateParams(n,l){if(this.#s){if(n===r.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(n);return}for(const d of this.#h)d.updateParams(n,l);for(const d of this.#s)d.updateDefaultParams(n,l)}}enableWaiting(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.#v!==n){this.#v=n;for(const l of this.#n.values())n?l.disableClick():l.enableClick(),l.div.classList.toggle("waiting",n)}}#_(){if(!this.#p){this.#p=!0;for(const n of this.#n.values())n.enable()}}#Y(){if(this.unselectAll(),this.#p){this.#p=!1;for(const n of this.#n.values())n.disable()}}getEditors(n){const l=[];for(const d of this.#e.values())d.pageIndex===n&&l.push(d);return l}getEditor(n){return this.#e.get(n)}
1addEditor(n){this.#e.set(n.id,n)}removeEditor(n){this.#e.delete(n.id),this.unselect(n),(!n.annotationElementId||!this.#l.has(n.annotationElementId))&&this.#o?.remove(n.id)}addDeletedAnnotationElement(n){this.#l.add(n.annotationElementId),n.deleted=!0}isDeletedAnnotationElement(n){return this.#l.has(n)}removeDeletedAnnotationElement(n){this.#l.delete(n.annotationElementId),n.deleted=!1}#V(n){const l=this.#n.get(n.pageIndex);l?l.addOrRebuild(n):this.addEditor(n)}setActiveEditor(n){this.#t!==n&&(this.#t=n,n&&this.#z(n.propertiesToUpdate))}toggleSelected(n){if(this.#h.has(n)){this.#h.delete(n),n.unselect(),this.#S({hasSelectedEditor:this.hasSelection});return}this.#h.add(n),n.select(),this.#z(n.propertiesToUpdate),this.#S({hasSelectedEditor:!0})}setSelected(n){for(const l of this.#h)l!==n&&l.unselect();this.#h.clear(),this.#h.add(n),n.select(),this.#z(n.propertiesToUpdate),this.#S({hasSelectedEditor:!0})}isSelected(n){return this.#h.has(n)}unselect(n){n.unselect(),this.#h.delete(n),this.#S({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#h.size!==0}undo(){this.#a.undo(),this.#S({hasSomethingToUndo:this.#a.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#G()})}redo(){this.#a.redo(),this.#S({hasSomethingToUndo:!0,hasSomethingToRedo:this.#a.hasSomethingToRedo(),isEmpty:this.#G()})}addCommands(n){this.#a.add(n),this.#S({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#G()})}#G(){if(this.#e.size===0)return!0;if(this.#e.size===1)for(const n of this.#e.values())return n.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const n=[...this.#h],l=()=>{for(const c of n)c.remove()},d=()=>{for(const c of n)this.#V(c)};this.addCommands({cmd:l,undo:d,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#X(n){this.#h.clear();for(const l of n)l.isEmpty()||(this.#h.add(l),l.select());this.#S({hasSelectedEditor:!0})}selectAll(){for(const n of this.#h)n.commit();this.#X(this.#e.values())}unselectAll(){if(this.#t){this.#t.commitOrRemove();return}if(this.hasSelection){for(const n of this.#h)n.unselect();this.#h.clear(),this.#S({hasSelectedEditor:!1})}}translateSelectedEditors(n,l){if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;this.#A[0]+=n,this.#A[1]+=l;const[c,A]=this.#A,F=[...this.#h],R=1e3;this.#k&&clearTimeout(this.#k),this.#k=setTimeout(()=>{this.#k=null,this.#A[0]=this.#A[1]=0,this.addCommands({cmd:()=>{for(const m of F)this.#e.has(m.id)&&m.translateInPage(c,A)},undo:()=>{for(const m of F)this.#e.has(m.id)&&m.translateInPage(-c,-A)},mustExec:!1})},R);for(const m of F)m.translateInPage(n,l)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#c=new Map;for(const n of this.#h)this.#c.set(n,{savedX:n.x,savedY:n.y,savedPageIndex:n.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#c)return!1;this.disableUserSelect(!1);const n=this.#c;this.#c=null;let l=!1;for(const[{x:c,y:A,pageIndex:F},R]of n)R.newX=c,R.newY=A,R.newPageIndex=F,l||=c!==R.savedX||A!==R.savedY||F!==R.savedPageIndex;if(!l)return!1;const d=(c,A,F,R)=>{if(this.#e.has(c.id)){const m=this.#n.get(R);m?c._setParentAndPosition(m,A,F):(c.pageIndex=R,c.x=A,c.y=F)}};return this.addCommands({cmd:()=>{for(const[c,{newX:A,newY:F,newPageIndex:R}]of n)d(c,A,F,R)},undo:()=>{for(const[c,{savedX:A,savedY:F,savedPageIndex:R}]of n)d(c,A,F,R)},mustExec:!0}),!0}dragSelectedEditors(n,l){if(this.#c)for(const d of this.#c.keys())d.drag(n,l)}rebuild(n){if(n.parent===null){const l=this.getLayer(n.pageIndex);l?(l.changeParent(n),l.addOrRebuild(n)):(this.addEditor(n),this.addToAnnotationStorage(n),n.rebuild())}else n.parent.addOrRebuild(n)}isActive(n){return this.#t===n}getActive(){return this.#t}getMode(){return this.#g}get imageManager(){return(0,r.shadow)(this,"imageManager",new P)}}o.AnnotationEditorUIManager=h}),((v,o,t)=>{var r=t(3),a=t(6),f=t(4),g=t(24),y=t(14),P=t(8),s=t(21),e=t(20),i=t(91),h=t(39),u=t(77),n=t(64),l=t(159),d=t(7),c=t(167),A=t(27),F=f.JSON,R=f.Number,m=f.SyntaxError,x=F&&F.parse,O=g("Object","keys"),U=Object.getOwnPropertyDescriptor,D=y("".charAt),G=y("".slice),V=y(/./.exec),tt=y([].push),Z=/^\d$/,q=/^[1-9]$/,nt=/^(?:-|\d)$/,J=/^[\t\n\r ]$/,H=0,k=1,b=function(p,E){p=u(p);
1var T=new L(p,0),M=T.parse(),C=M.value,B=T.skip(J,M.end);if(B<p.length)throw m('Unexpected extra character: "'+D(p,B)+'" after the parsed data at: '+B);return s(E)?S({"":C},"",E,M):C},S=function(p,E,T,M){var C=p[E],B=M&&C===M.value,z=B&&typeof M.source=="string"?{source:M.source}:{},_,it,K,Q,j;if(e(C)){var et=i(C),rt=B?M.nodes:et?[]:{};if(et)for(_=rt.length,K=n(C),Q=0;Q<K;Q++)w(C,Q,S(C,""+Q,T,Q<_?rt[Q]:void 0));else for(it=O(C),K=n(it),Q=0;Q<K;Q++)j=it[Q],w(C,j,S(C,j,T,h(rt,j)?rt[j]:void 0))}return P(T,p,E,C,z)},w=function(p,E,T){if(a){var M=U(p,E);if(M&&!M.configurable)return}T===void 0?delete p[E]:l(p,E,T)},N=function(p,E,T,M){this.value=p,this.end=E,this.source=T,this.nodes=M},L=function(p,E){this.source=p,this.index=E};L.prototype={fork:function(p){return new L(this.source,p)},parse:function(){var p=this.source,E=this.skip(J,this.index),T=this.fork(E),M=D(p,E);if(V(nt,M))return T.number();switch(M){case"{":return T.object();case"[":return T.array();case'"':return T.string();case"t":return T.keyword(!0);case"f":return T.keyword(!1);case"n":return T.keyword(null)}throw m('Unexpected character: "'+M+'" at: '+E)},node:function(p,E,T,M,C){return new N(E,M,p?null:G(this.source,T,M),C)},object:function(){for(var p=this.source,E=this.index+1,T=!1,M={},C={};E<p.length;){if(E=this.until(['"',"}"],E),D(p,E)==="}"&&!T){E++;break}var B=this.fork(E).string(),z=B.value;E=B.end,E=this.until([":"],E)+1,E=this.skip(J,E),B=this.fork(E).parse(),l(C,z,B),l(M,z,B.value),E=this.until([",","}"],B.end);var _=D(p,E);if(_===",")T=!0,E++;else if(_==="}"){E++;break}}return this.node(k,M,this.index,E,C)},array:function(){for(var p=this.source,E=this.index+1,T=!1,M=[],C=[];E<p.length;){if(E=this.skip(J,E),D(p,E)==="]"&&!T){E++;break}var B=this.fork(E).parse();if(tt(C,B),tt(M,B.value),E=this.until([",","]"],B.end),D(p,E)===",")T=!0,E++;else if(D(p,E)==="]"){E++;break}}return this.node(k,M,this.index,E,C)},string:function(){var p=this.index,E=c(this.source,this.index+1);return this.node(H,E.value,p,E.end)},number:function(){var p=this.source,E=this.index,T=E;if(D(p,T)==="-"&&T++,D(p,T)==="0")T++;else if(V(q,D(p,T)))T=this.skip(Z,++T);else throw m("Failed to parse number at: "+T);if(D(p,T)==="."&&(T=this.skip(Z,++T)),D(p,T)==="e"||D(p,T)==="E"){T++,(D(p,T)==="+"||D(p,T)==="-")&&T++;var M=T;if(T=this.skip(Z,T),M===T)throw m("Failed to parse number's exponent value at: "+T)}return this.node(H,R(G(p,E,T)),E,T)},keyword:function(p){var E=""+p,T=this.index,M=T+E.length;if(G(this.source,T,M)!==E)throw m("Failed to parse value at: "+T);return this.node(H,p,T,M)},skip:function(p,E){for(var T=this.source;E<T.length&&V(p,D(T,E));E++);return E},until:function(p,E){E=this.skip(J,E);for(var T=D(this.source,E),M=0;M<p.length;M++)if(p[M]===T)return E;throw m('Unexpected character: "'+T+'" at: '+E)}};var W=d(function(){var p="9007199254740993",E;return x(p,function(T,M,C){E=C.source}),E!==p}),I=A&&!d(function(){return 1/x("-0 ")!==-1/0});r({target:"JSON",stat:!0,forced:W},{parse:function(E,T){return I&&!s(T)?x(E):b(E,T)}})}),((v,o,t)=>{var r=t(14),a=t(39),f=SyntaxError,g=parseInt,y=String.fromCharCode,P=r("".charAt),s=r("".slice),e=r(/./.exec),i={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":` 2`,"\\r":"\r","\\t":" "},h=/^[\da-f]{4}$/i,u=/^[\u0000-\u001F]$/;v.exports=function(n,l){for(var d=!0,c="";l<n.length;){var A=P(n,l);if(A==="\\"){var F=s(n,l,l+2);if(a(i,F))c+=i[F],l+=2;else if(F==="\\u"){l+=2;var R=s(n,l,l+4);if(!e(h,R))throw f("Bad Unicode escape at: "+l);c+=y(g(R,16)),l+=4}else throw f('Unknown escape sequence: "'+F+'"')}else if(A==='"'){d=!1,l++;break}else{if(e(u,A))throw f("Bad control character in string literal at: "+l);c+=A,l++}}if(d)throw f("Unterminated string at: "+l);return{value:c,end:l}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StatTimer=o.RenderingCancelledException=o.PixelsPerInch=o.PageViewport=o.PDFDateString=o.DOMStandardFontDataFactory=o.DOMSVGFactory=o.DOMFilterFactory=o.DOMCanvasFactory=o.DOMCMapReaderFactory=void 0,o.deprecated=O,o.getColorValues=tt,o.getCurrentTransform=Z,o.getCurrentTransformInverse=q,o.getFilenameFromUrl=c,o.getPdfFilenameFromUrl=A,o.getRGB=V,o.getXfaPageViewport=G,o.isDataScheme=l,o.isPdfFile=d,o.isValidFetchUrl=R,o.loadScript=x,o.noContextMenu=m,o.setLayerDimensions=nt,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 r=t(169),a=t(1);const f="http://www.w3.org/2000/svg";class g{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}o.PixelsPerInch=g;class y extends r.BaseFilterFactory{#t;#e;#n;#r;#o;#a;#i;#l;#c;#s;#f=0;constructor(){let{docId:H,ownerDocument:k=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.#n=H,this.#r=k}get#u(){return this.#t||=new Map}get#d(){if(!this.#e){const H=this.#r.createElement("div"),{style:k}=H;k.visibility="hidden",k.contain="strict",k.width=k.height=0,k.position="absolute",k.top=k.left=0,k.zIndex=-1;const b=this.#r.createElementNS(f,"svg");b.setAttribute("width",0),b.setAttribute("height",0),this.#e=this.#r.createElementNS(f,"defs"),H.append(b),b.append(this.#e),this.#r.body.append(H)}return this.#e}addFilter(H){if(!H)return"none";let k=this.#u.get(H);if(k)return k;let b,S,w,N;if(H.length===1){const p=H[0],E=new Array(256);for(let T=0;T<256;T++)E[T]=p[T]/255;N=b=S=w=E.join(",")}else{const[p,E,T]=H,M=new Array(256),C=new Array(256),B=new Array(256);for(let z=0;z<256;z++)M[z]=p[z]/255,C[z]=E[z]/255,B[z]=T[z]/255;b=M.join(","),S=C.join(","),w=B.join(","),N=`${b}${S}${w}`}if(k=this.#u.get(N),k)return this.#u.set(H,k),k;const L=`g_${this.#n}_transfer_map_${this.#f++}`,W=`url(#${L})`;this.#u.set(H,W),this.#u.set(N,W);const I=this.#v(L);return this.#g(b,S,w,I),W}addHCMFilter(H,k){const b=`${H}-${k}`;if(this.#a===b)return this.#i;if(this.#a=b,this.#i="none",this.#o?.remove(),!H||!k)return this.#i;const S=this.#h(H);H=a.Util.makeHexColor(...S);const w=this.#h(k);if(k=a.Util.makeHexColor(...w),this.#d.style.color="",H==="#000000"&&k==="#ffffff"||H===k)return this.#i;const N=new Array(256);for(let E=0;E<=255;E++){const T=E/255;N[E]=T<=.03928?T/12.92:((T+.055)/1.055)**2.4}const L=N.join(","),W=`g_${this.#n}_hcm_filter`,I=this.#l=this.#v(W);this.#g(L,L,L,I),this.#p(I);const p=(E,T)=>{const M=S[E]/255,C=w[E]/255,B=new Array(T+1);for(let z=0;z<=T;z++)B[z]=M+z/T*(C-M);return B.join(",")};return this.#g(p(0,5),p(1,5),p(2,5),I),this.#i=`url(#${W})`,this.#i}addHighlightHCMFilter(H,k,b,S){const w=`${H}-${k}-${b}-${S}`;if(this.#c===w)return this.#s;if(this.#c=w,this.#s="none",this.#l?.remove(),!H||!k)return this.#s;const[N,L]=[H,k].map(this.#h.bind(this));let W=Math.round(.2126*N[0]+.7152*N[1]+.0722*N[2]),I=Math.round(.2126*L[0]+.7152*L[1]+.0722*L[2]),[p,E]=[b,S].map(this.#h.bind(this));I<W&&([W,I,p,E]=[I,W,E,p]),this.#d.style.color="";const T=(B,z,_)=>{const it=new Array(256),K=(I-W)/_,Q=B/255,j=(z-B)/(255*_);let et=0;for(let rt=0;rt<=_;rt++){const lt=Math.round(W+rt*K),ht=Q+rt*j;for(let dt=et;dt<=lt;dt++)it[dt]=ht;et=lt+1}for(let rt=et;rt<256;rt++)it[rt]=it[et-1];return it.join(",")},M=`g_${this.#n}_hcm_highlight_filter`,C=this.#l=this.#v(M);return this.#p(C),this.#g(T(p[0],E[0],5),T(p[1],E[1],5),T(p[2],E[2],5),C),this.#s=`url(#${M})`,this.#s}destroy(){arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&(this.#i||this.#s)||(this.#e&&(this.#e.parentNode.parentNode.remove(),this.#e=null),this.#t&&(this.#t.clear(),this.#t=null),this.#f=0)}#p(H){const k=this.#r.createElementNS(f,"feColorMatrix");k.setAttribute("type","matrix"),k.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"),H.append(k)}#v(H){const k=this.#r.createElementNS(f,"filter");return k.setAttribute("color-interpolation-filters","sRGB"),k.setAttribute("id",H),this.#d.append(k),k}#m(H,k,b){const S=this.#r.createElementNS(f,k);S.setAttribute("type","discrete"),S.setAttribute("tableValues",b),H.append(S)}#g(H,k,b,S){const w=this.#r.createElementNS(f,"feComponentTransfer");S.append(w),this.#m(w,"feFuncR",H),this.#m(w,"feFuncG",k),this.#m(w,"feFuncB",b)}#h(H){return this.#d.style.color=H,V(getComputedStyle(this.#d).getPropertyValue("color"))}}o.DOMFilterFactory=y;class P extends r.BaseCanvasFactory{constructor(){let{ownerDocument:H=globalThis.document}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this._document=H}_createCanvas(H,k){const b=this._document.createElement("canvas");return b.width=H,b.height=k,b}}o.DOMCanvasFactory=P;async function s(J){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(R(J,document.baseURI)){const k=await fetch(J);if(!k.ok)throw new Error(k.statusText);return H?new Uint8Array(await k.arrayBuffer()):(0,a.stringToBytes)(await k.text())}return new Promise((k,b)=>{const S=new XMLHttpRequest;S.open("GET",J,!0),H&&(S.responseType="arraybuffer"),S.onreadystatechange=()=>{if(S.readyState===XMLHttpRequest.DONE){if(S.status===200||S.status===0){let w;if(H&&S.response?w=new Uint8Array(S.response):!H&&S.responseText&&(w=(0,a.stringToBytes)(S.responseText)),w){k(w);return}}b(new Error(S.statusText))}},S.send(null)})}class e extends r.BaseCMapReaderFactory{_fetchData(H,k){return s(H,this.isCompressed).then(b=>({cMapData:b,compressionType:k}))}}o.DOMCMapReaderFactory=e;class i extends r.BaseStandardFontDataFactory{_fetchData(H){return s(H,!0)}}o.DOMStandardFontDataFactory=i;class h extends r.BaseSVGFactory{_createSVG(H){return document.createElementNS(f,H)}}o.DOMSVGFactory=h;class u{constructor(H){let{viewBox:k,scale:b,rotation:S,offsetX:w=0,offsetY:N=0,dontFlip:L=!1}=H;this.viewBox=k,this.scale=b,this.rotation=S,this.offsetX=w,this.offsetY=N;const W=(k[2]+k[0])/2,I=(k[3]+k[1])/2;let p,E,T,M;switch(S%=360,S<0&&(S+=360),S){case 180:p=-1,E=0,T=0,M=1;break;case 90:p=0,E=1,T=1,M=0;break;case 270:p=0,E=-1,T=-1,M=0;break;case 0:p=1,E=0,T=0,M=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}L&&(T=-T,M=-M);let C,B,z,_;p===0?(C=Math.abs(I-k[1])*b+w,B=Math.abs(W-k[0])*b+N,z=(k[3]-k[1])*b,_=(k[2]-k[0])*b):(C=Math.abs(W-k[0])*b+w,B=Math.abs(I-k[1])*b+N,z=(k[2]-k[0])*b,_=(k[3]-k[1])*b),this.transform=[p*b,E*b,T*b,M*b,C-p*b*W-T*b*I,B-E*b*W-M*b*I],this.width=z,this.height=_}get rawDims(){const{viewBox:H}=this;
2return(0,a.shadow)(this,"rawDims",{pageWidth:H[2]-H[0],pageHeight:H[3]-H[1],pageX:H[0],pageY:H[1]})}clone(){let{scale:H=this.scale,rotation:k=this.rotation,offsetX:b=this.offsetX,offsetY:S=this.offsetY,dontFlip:w=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new u({viewBox:this.viewBox.slice(),scale:H,rotation:k,offsetX:b,offsetY:S,dontFlip:w})}convertToViewportPoint(H,k){return a.Util.applyTransform([H,k],this.transform)}convertToViewportRectangle(H){const k=a.Util.applyTransform([H[0],H[1]],this.transform),b=a.Util.applyTransform([H[2],H[3]],this.transform);return[k[0],k[1],b[0],b[1]]}convertToPdfPoint(H,k){return a.Util.applyInverseTransform([H,k],this.transform)}}o.PageViewport=u;class n extends a.BaseException{constructor(H){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;super(H,"RenderingCancelledException"),this.extraDelay=k}}o.RenderingCancelledException=n;function l(J){const H=J.length;let k=0;for(;k<H&&J[k].trim()==="";)k++;return J.substring(k,k+5).toLowerCase()==="data:"}function d(J){return typeof J=="string"&&/\.pdf$/i.test(J)}function c(J){return arguments.length>1&&arguments[1]!==void 0&&arguments[1]||([J]=J.split(/[#?]/,1)),J.substring(J.lastIndexOf("/")+1)}function A(J){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"document.pdf";if(typeof J!="string")return H;if(l(J))return(0,a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),H;const k=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,b=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,S=k.exec(J);let w=b.exec(S[1])||b.exec(S[2])||b.exec(S[3]);if(w&&(w=w[0],w.includes("%")))try{w=b.exec(decodeURIComponent(w))[0]}catch{}return w||H}class F{started=Object.create(null);times=[];time(H){H in this.started&&(0,a.warn)(`Timer is already running for ${H}`),this.started[H]=Date.now()}timeEnd(H){H in this.started||(0,a.warn)(`Timer has not been started for ${H}`),this.times.push({name:H,start:this.started[H],end:Date.now()}),delete this.started[H]}toString(){const H=[];let k=0;for(const{name:b}of this.times)k=Math.max(b.length,k);for(const{name:b,start:S,end:w}of this.times)H.push(`${b.padEnd(k)} ${w-S}ms 3`);return H.join("")}}o.StatTimer=F;function R(J,H){try{const{protocol:k}=H?new URL(J,H):new URL(J);return k==="http:"||k==="https:"}catch{return!1}}function m(J){J.preventDefault()}function x(J){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise((k,b)=>{const S=document.createElement("script");S.src=J,S.onload=function(w){H&&S.remove(),k(w)},S.onerror=function(){b(new Error(`Cannot load script at: ${S.src}`))},(document.head||document.documentElement).append(S)})}function O(J){}let U;class D{static toDateObject(H){if(!H||typeof H!="string")return null;U||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const k=U.exec(H);if(!k)return null;const b=parseInt(k[1],10);let S=parseInt(k[2],10);S=S>=1&&S<=12?S-1:0;let w=parseInt(k[3],10);w=w>=1&&w<=31?w:1;let N=parseInt(k[4],10);N=N>=0&&N<=23?N:0;let L=parseInt(k[5],10);L=L>=0&&L<=59?L:0;let W=parseInt(k[6],10);W=W>=0&&W<=59?W:0;const I=k[7]||"Z";let p=parseInt(k[8],10);p=p>=0&&p<=23?p:0;let E=parseInt(k[9],10)||0;return E=E>=0&&E<=59?E:0,I==="-"?(N+=p,L+=E):I==="+"&&(N-=p,L-=E),new Date(Date.UTC(b,S,w,N,L,W))}}o.PDFDateString=D;function G(J,H){let{scale:k=1,rotation:b=0}=H;const{width:S,height:w}=J.attributes.style,N=[0,0,parseInt(S),parseInt(w)];return new u({viewBox:N,scale:k,rotation:b})}function V(J){if(J.startsWith("#")){const H=parseInt(J.slice(1),16);return[(H&16711680)>>16,(H&65280)>>8,H&255]}return J.startsWith("rgb(")?J.slice(4,-1).split(",").map(H=>parseInt(H)):J.startsWith("rgba(")?J.slice(5,-1).split(",").map(H=>parseInt(H)).slice(0,3):((0,a.warn)(`Not a valid color format: "${J}"`),[0,0,0])}function tt(J){const H=document.createElement("span");H.style.visibility="hidden",document.body.append(H);for(const k of J.keys()){H.style.color=k;const b=window.getComputedStyle(H).color;J.set(k,V(b))}H.remove()}function Z(J){const{a:H,b:k,c:b,d:S,e:w,f:N}=J.getTransform();return[H,k,b,S,w,N]}function q(J){const{a:H,b:k,c:b,d:S,e:w,f:N}=J.getTransform().invertSelf();return[H,k,b,S,w,N]}function nt(J,H){let k=arguments.length>
32&&arguments[2]!==void 0?arguments[2]:!1,b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(H instanceof u){const{pageWidth:S,pageHeight:w}=H.rawDims,{style:N}=J,L=a.FeatureTest.isCSSRoundSupported,W=`var(--scale-factor) * ${S}px`,I=`var(--scale-factor) * ${w}px`,p=L?`round(${W}, 1px)`:`calc(${W})`,E=L?`round(${I}, 1px)`:`calc(${I})`;!k||H.rotation%180===0?(N.width=p,N.height=E):(N.width=E,N.height=p)}b&&J.setAttribute("data-main-rotation",H.rotation)}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseStandardFontDataFactory=o.BaseSVGFactory=o.BaseFilterFactory=o.BaseCanvasFactory=o.BaseCMapReaderFactory=void 0,t(2);var r=t(1);class a{constructor(){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,i){return"none"}addHighlightHCMFilter(e,i,h,u){return"none"}destroy(){}}o.BaseFilterFactory=a;class f{constructor(){this.constructor===f&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,i){if(e<=0||i<=0)throw new Error("Invalid canvas size");const h=this._createCanvas(e,i);return{canvas:h,context:h.getContext("2d")}}reset(e,i,h){if(!e.canvas)throw new Error("Canvas is not specified");if(i<=0||h<=0)throw new Error("Invalid canvas size");e.canvas.width=i,e.canvas.height=h}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,i){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}o.BaseCanvasFactory=f;class g{constructor(e){let{baseUrl:i=null,isCompressed:h=!0}=e;this.constructor===g&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=i,this.isCompressed=h}async fetch(e){let{name:i}=e;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!i)throw new Error("CMap name must be specified.");const h=this.baseUrl+i+(this.isCompressed?".bcmap":""),u=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(h,u).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${h}`)})}_fetchData(e,i){(0,r.unreachable)("Abstract method `_fetchData` called.")}}o.BaseCMapReaderFactory=g;class y{constructor(e){let{baseUrl:i=null}=e;this.constructor===y&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=i}async fetch(e){let{filename:i}=e;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!i)throw new Error("Font filename must be specified.");const h=`${this.baseUrl}${i}`;return this._fetchData(h).catch(u=>{throw new Error(`Unable to load font data at: ${h}`)})}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}o.BaseStandardFontDataFactory=y;class P{constructor(){this.constructor===P&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,i){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(e<=0||i<=0)throw new Error("Invalid SVG dimensions");const u=this._createSVG("svg:svg");return u.setAttribute("version","1.1"),h||(u.setAttribute("width",`${e}px`),u.setAttribute("height",`${i}px`)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("viewBox",`0 0 ${e} ${i}`),u}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}o.BaseSVGFactory=P}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 r=t(1);const a=3285377520,f=4294901760,g=65535;class y{constructor(s){this.h1=s?s&4294967295:a,this.h2=s?s&4294967295:a}update(s){let e,i;if(typeof s=="string"){e=new Uint8Array(s.length*2),i=0;for(let O=0,U=s.length;O<U;O++){const D=s.charCodeAt(O);D<=255?e[i++]=D:(e[i++]=D>>>8,e[i++]=D&255)}}else if((0,r.isArrayBuffer)(s))e=s.slice(),i=e.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const h=i>>2,u=i-h*4,n=new Uint32Array(e.buffer,0,h);let l=0,d=0,c=this.h1,A=this.h2;const F=3432918353,R=461845907,m=F&g,x=R&g;for(let O=0;O<h;O++)O&1?(l=n[O],l=l*F&f|l*m&g,l=l<<15|l>>>17,l=l*R&f|l*x&g,c^=l,c=c<<13|c>>>19,c=c*5+3864292196):(d=n[O],d=d*F&f|d*m&g,d=d<<15|d>>>17,d=d*R&f|d*x&g,A^=d,A=A<<13|A>>>19,A=A*5+3864292196);switch(l=0,u){case 3:l^=e[h*4+2]<<16;case 2:l^=e[h*4+1]<<8;case 1:l^=e[h*4],l=l*F&f|l*m&g,l=l<<15|l>>>17,l=l*R&f|l*x&g,h&1?c^=l:A^=l}this.h1=c,this.h2=A}hexdigest(){let s=this.h1,e=this.h2;return s^=e>>>1,s=s*3981806797&f|s*36045&g,e=e*4283543511&f|((e<<16|s>>>16)*2950163797&f)>>>16,s^=e>>>1,s=s*444984403&f|s*60499&g,e=e*3301882366&f|((e<<16|s>>>16)*3120437893&f)>>>16,s^=e>>>1,(s>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}o.MurmurHash3_64=y}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FontLoader=o.FontFaceObject=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147),t(89),t(149);var r=t(1);class a{#t=new Set;constructor(y){let{ownerDocument:P=globalThis.document,styleElement:s=null}=y;this._document=P,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(y){this.nativeFontFaces.add(y),this._document.fonts.add(y)}removeNativeFontFace(y){this.nativeFontFaces.delete(y),this._document.fonts.delete(y)}insertRule(y){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const P=this.styleElement.sheet;P.insertRule(y,P.cssRules.length)}clear(){for(const y of this.nativeFontFaces)this._document.fonts.delete(y);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}
3async loadSystemFont(y){if(!(!y||this.#t.has(y.loadedName))){if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:P,src:s,style:e}=y,i=new FontFace(P,s,e);this.addNativeFontFace(i);try{await i.load(),this.#t.add(P)}catch{(0,r.warn)(`Cannot load system font: ${y.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(i)}return}(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(y){if(y.attached||y.missingFile&&!y.systemFontInfo)return;if(y.attached=!0,y.systemFontInfo){await this.loadSystemFont(y.systemFontInfo);return}if(this.isFontLoadingAPISupported){const s=y.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(e){throw(0,r.warn)(`Failed to load font '${s.family}': '${e}'.`),y.disableFontFace=!0,e}}return}const P=y.createFontFaceRule();if(P){if(this.insertRule(P),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const e=this._queueLoadingCallback(s);this._prepareFontLoadEvent(y,e)})}}get isFontLoadingAPISupported(){const y=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",y)}get isSyncFontLoadingSupported(){let y=!1;return(r.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(y=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",y)}_queueLoadingCallback(y){function P(){for((0,r.assert)(!e.done,"completeRequest() cannot be called twice."),e.done=!0;s.length>0&&s[0].done;){const i=s.shift();setTimeout(i.callback,0)}}const{loadingRequests:s}=this,e={done:!1,complete:P,callback:y};return s.push(e),e}get _loadTestFont(){const y=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",y)}_prepareFontLoadEvent(y,P){function s(G,V){return G.charCodeAt(V)<<24|G.charCodeAt(V+1)<<16|G.charCodeAt(V+2)<<8|G.charCodeAt(V+3)&255}function e(G,V,tt,Z){const q=G.substring(0,V),nt=G.substring(V+tt);return q+Z+nt}let i,h;const u=this._document.createElement("canvas");u.width=1,u.height=1;const n=u.getContext("2d");let l=0;function d(G,V){if(++l>30){(0,r.warn)("Load test font never loaded."),V();return}if(n.font="30px "+G,n.fillText(".",0,20),n.getImageData(0,0,1,1).data[3]>0){V();return}setTimeout(d.bind(null,G,V))}const c=`lt${Date.now()}${this.loadTestFontId++}`;let A=this._loadTestFont;A=e(A,976,c.length,c);const R=16,m=1482184792;let x=s(A,R);for(i=0,h=c.length-3;i<h;i+=4)x=x-m+s(c,i)|0;i<c.length&&(x=x-m+s(c+"XXX",i)|0),A=e(A,R,4,(0,r.string32)(x));const O=`url(data:font/opentype;base64,${btoa(A)});`,U=`@font-face {font-family:"${c}";src:${O}}`;this.insertRule(U);const D=this._document.createElement("div");D.style.visibility="hidden",D.style.width=D.style.height="10px",D.style.position="absolute",D.style.top=D.style.left="0px";for(const G of[y.loadedName,c]){const V=this._document.createElement("span");V.textContent="Hi",V.style.fontFamily=G,D.append(V)}this._document.body.append(D),d(c,()=>{D.remove(),P.complete()})}}o.FontLoader=a;class f{constructor(y,P){let{isEvalSupported:s=!0,disableFontFace:e=!1,ignoreErrors:i=!1,inspectFont:h=null}=P;this.compiledGlyphs=Object.create(null);for(const u in y)this[u]=y[u];this.isEvalSupported=s!==!1,this.disableFontFace=e===!0,this.ignoreErrors=i===!0,this._inspectFont=h}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let y;if(!this.cssFontInfo)y=new FontFace(this.loadedName,this.data,{});else{const P={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(P.style=`oblique ${this.cssFontInfo.italicAngle}deg`),y=new FontFace(this.cssFontInfo.fontFamily,this.data,P)}return this._inspectFont?.(this),y}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const y=(0,r.bytesToString)(this.data),P=`url(data:${this.mimetype};base64,${btoa(y)});`;let s;if(!this.cssFontInfo)s=`@font-face {font-family:"${this.loadedName}";src:${P}}`;else{let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${P}}`}return this._inspectFont?.(this,P),s}getPathGenerator(y,P){if(this.compiledGlyphs[P]!==void 0)return this.compiledGlyphs[P];let s;try{s=y.get(this.loadedName+"_path_"+P)}catch(e){if(!this.ignoreErrors)throw e;
3return(0,r.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[P]=function(i,h){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const e=[];for(const i of s){const h=i.args!==void 0?i.args.join(","):"";e.push("c.",i.cmd,"(",h,`); 4`)}return this.compiledGlyphs[P]=new Function("c","size",e.join(""))}return this.compiledGlyphs[P]=function(e,i){for(const h of s)h.cmd==="scale"&&(h.args=[i,-i]),e[h.cmd].apply(e,h.args)}}}o.FontFaceObject=f}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.NodeStandardFontDataFactory=o.NodeFilterFactory=o.NodeCanvasFactory=o.NodeCMapReaderFactory=void 0,t(2),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var r=t(169),a=t(1);(function(){if(!(globalThis.DOMMatrix||!a.isNodeJS))try{globalThis.DOMMatrix=require$$6.DOMMatrix}catch(i){(0,a.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${i}".`)}})(),(function(){if(!(globalThis.Path2D||!a.isNodeJS))try{const{CanvasRenderingContext2D:i}=require$$6,{polyfillPath2D:h}=requirePath2dPolyfill_esm();globalThis.CanvasRenderingContext2D=i,h(globalThis)}catch(i){(0,a.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${i}".`)}})();const f=function(e){return new Promise((i,h)=>{require$$6.readFile(e,(n,l)=>{if(n||!l){h(new Error(n));return}i(new Uint8Array(l))})})};class g extends r.BaseFilterFactory{}o.NodeFilterFactory=g;class y extends r.BaseCanvasFactory{_createCanvas(i,h){return require$$6.createCanvas(i,h)}}o.NodeCanvasFactory=y;class P extends r.BaseCMapReaderFactory{_fetchData(i,h){return f(i).then(u=>({cMapData:u,compressionType:h}))}}o.NodeCMapReaderFactory=P;class s extends r.BaseStandardFontDataFactory{_fetchData(i){return f(i)}}o.NodeStandardFontDataFactory=s}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 r=t(1),a=t(168),f=t(174),g=t(175);const y=16,P=100,s=4096,e=15,i=10,h=1e3,u=16;function n(k,b){if(k._removeMirroring)throw new Error("Context is already forwarding operations.");k.__originalSave=k.save,k.__originalRestore=k.restore,k.__originalRotate=k.rotate,k.__originalScale=k.scale,k.__originalTranslate=k.translate,k.__originalTransform=k.transform,k.__originalSetTransform=k.setTransform,k.__originalResetTransform=k.resetTransform,k.__originalClip=k.clip,k.__originalMoveTo=k.moveTo,k.__originalLineTo=k.lineTo,k.__originalBezierCurveTo=k.bezierCurveTo,k.__originalRect=k.rect,k.__originalClosePath=k.closePath,k.__originalBeginPath=k.beginPath,k._removeMirroring=()=>{k.save=k.__originalSave,k.restore=k.__originalRestore,k.rotate=k.__originalRotate,k.scale=k.__originalScale,k.translate=k.__originalTranslate,k.transform=k.__originalTransform,k.setTransform=k.__originalSetTransform,k.resetTransform=k.__originalResetTransform,k.clip=k.__originalClip,k.moveTo=k.__originalMoveTo,k.lineTo=k.__originalLineTo,k.bezierCurveTo=k.__originalBezierCurveTo,k.rect=k.__originalRect,k.closePath=k.__originalClosePath,k.beginPath=k.__originalBeginPath,delete k._removeMirroring},k.save=function(){b.save(),this.__originalSave()},k.restore=function(){b.restore(),this.__originalRestore()},k.translate=function(w,N){b.translate(w,N),this.__originalTranslate(w,N)},k.scale=function(w,N){b.scale(w,N),this.__originalScale(w,N)},k.transform=function(w,N,L,W,I,p){b.transform(w,N,L,W,I,p),this.__originalTransform(w,N,L,W,I,p)},k.setTransform=function(w,N,L,W,I,p){b.setTransform(w,N,L,W,I,p),this.__originalSetTransform(w,N,L,W,I,p)},k.resetTransform=function(){b.resetTransform(),this.__originalResetTransform()},k.rotate=function(w){b.rotate(w),this.__originalRotate(w)},k.clip=function(w){b.clip(w),this.__originalClip(w)},k.moveTo=function(S,w){b.moveTo(S,w),this.__originalMoveTo(S,w)},k.lineTo=function(S,w){b.lineTo(S,w),this.__originalLineTo(S,w)},k.bezierCurveTo=function(S,w,N,L,W,I){b.bezierCurveTo(S,w,N,L,W,I),this.__originalBezierCurveTo(S,w,N,L,W,I)},k.rect=function(S,w,N,L){b.rect(S,w,N,L),this.__originalRect(S,w,N,L)},k.closePath=function(){b.closePath(),this.__originalClosePath()},k.beginPath=function(){b.beginPath(),this.__originalBeginPath()}}class l{constructor(b){this.canvasFactory=b,this.cache=Object.create(null)}getCanvas(b,S,w){let N;return this.cache[b]!==void 0?(N=this.cache[b],this.canvasFactory.reset(N,S,w)):(N=this.canvasFactory.create(S,w),this.cache[b]=N),N}delete(b){delete this.cache[b]}clear(){for(const b in this.cache){const S=this.cache[b];this.canvasFactory.destroy(S),delete this.cache[b]}}}function d(k,b,S,w,N,L,W,I,p,E){const[T,M,C,B,z,_]=(0,a.getCurrentTransform)(k);if(M===0&&C===0){const Q=W*T+z,j=Math.round(Q),et=I*B+_,rt=Math.round(et),lt=(W+p)*T+z,ht=Math.abs(Math.round(lt)-j)||1,dt=(I+E)*B+_,gt=Math.abs(Math.round(dt)-rt)||1;return k.setTransform(Math.sign(T),0,0,Math.sign(B),j,rt),k.drawImage(b,S,w,N,L,0,0,ht,gt),k.setTransform(T,M,C,B,z,_),[ht,gt]}if(T===0&&B===0){const Q=I*C+z,j=Math.round(Q),et=W*M+_,rt=Math.round(et),lt=(I+E)*C+z,ht=Math.abs(Math.round(lt)-j)||1,dt=(W+p)*M+_,gt=Math.abs(Math.round(dt)-rt)||1;return k.setTransform(0,Math.sign(M),Math.sign(C),0,j,rt),k.drawImage(b,S,w,N,L,0,0,gt,ht),k.setTransform(T,M,C,B,z,_),[gt,ht]}k.drawImage(b,S,w,N,L,W,I,p,E);const it=Math.hypot(T,M),K=Math.hypot(C,B);return[it*p,K*E]}function c(k){const{width:b,height:S}=k;if(b>h||S>h)return null;const w=1e3,N=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),L=b+1;let W=new Uint8Array(L*(S+1)),I,p,E;
4const T=b+7&-8;let M=new Uint8Array(T*S),C=0;for(const K of k.data){let Q=128;for(;Q>0;)M[C++]=K&Q?0:255,Q>>=1}let B=0;for(C=0,M[C]!==0&&(W[0]=1,++B),p=1;p<b;p++)M[C]!==M[C+1]&&(W[p]=M[C]?2:1,++B),C++;for(M[C]!==0&&(W[p]=2,++B),I=1;I<S;I++){C=I*T,E=I*L,M[C-T]!==M[C]&&(W[E]=M[C]?1:8,++B);let K=(M[C]?4:0)+(M[C-T]?8:0);for(p=1;p<b;p++)K=(K>>2)+(M[C+1]?4:0)+(M[C-T+1]?8:0),N[K]&&(W[E+p]=N[K],++B),C++;if(M[C-T]!==M[C]&&(W[E+p]=M[C]?2:4,++B),B>w)return null}for(C=T*(S-1),E=I*L,M[C]!==0&&(W[E]=8,++B),p=1;p<b;p++)M[C]!==M[C+1]&&(W[E+p]=M[C]?4:8,++B),C++;if(M[C]!==0&&(W[E+p]=4,++B),B>w)return null;const z=new Int32Array([0,L,-1,0,-L,0,0,0,1]),_=new Path2D;for(I=0;B&&I<=S;I++){let K=I*L;const Q=K+b;for(;K<Q&&!W[K];)K++;if(K===Q)continue;_.moveTo(K%L,I);const j=K;let et=W[K];do{const rt=z[et];do K+=rt;while(!W[K]);const lt=W[K];lt!==5&<!==10?(et=lt,W[K]=0):(et=lt&51*et>>4,W[K]&=et>>2|et<<2),_.lineTo(K%L,K/L|0),W[K]||--B}while(j!==K);--I}return M=null,W=null,function(K){K.save(),K.scale(1/b,-1/S),K.translate(0,-S),K.fill(_),K.beginPath(),K.restore()}}class A{constructor(b,S){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.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=r.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,b,S])}clone(){const b=Object.create(this);return b.clipBox=this.clipBox.slice(),b}setCurrentPoint(b,S){this.x=b,this.y=S}updatePathMinMax(b,S,w){[S,w]=r.Util.applyTransform([S,w],b),this.minX=Math.min(this.minX,S),this.minY=Math.min(this.minY,w),this.maxX=Math.max(this.maxX,S),this.maxY=Math.max(this.maxY,w)}updateRectMinMax(b,S){const w=r.Util.applyTransform(S,b),N=r.Util.applyTransform(S.slice(2),b);this.minX=Math.min(this.minX,w[0],N[0]),this.minY=Math.min(this.minY,w[1],N[1]),this.maxX=Math.max(this.maxX,w[0],N[0]),this.maxY=Math.max(this.maxY,w[1],N[1])}updateScalingPathMinMax(b,S){r.Util.scaleMinMax(b,S),this.minX=Math.min(this.minX,S[0]),this.maxX=Math.max(this.maxX,S[1]),this.minY=Math.min(this.minY,S[2]),this.maxY=Math.max(this.maxY,S[3])}updateCurvePathMinMax(b,S,w,N,L,W,I,p,E,T){const M=r.Util.bezierBoundingBox(S,w,N,L,W,I,p,E);if(T){T[0]=Math.min(T[0],M[0],M[2]),T[1]=Math.max(T[1],M[0],M[2]),T[2]=Math.min(T[2],M[1],M[3]),T[3]=Math.max(T[3],M[1],M[3]);return}this.updateRectMinMax(b,M)}getPathBoundingBox(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.PathType.FILL,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const w=[this.minX,this.minY,this.maxX,this.maxY];if(b===f.PathType.STROKE){S||(0,r.unreachable)("Stroke bounding box must include transform.");const N=r.Util.singularValueDecompose2dScale(S),L=N[0]*this.lineWidth/2,W=N[1]*this.lineWidth/2;w[0]-=L,w[1]-=W,w[2]+=L,w[3]+=W}return w}updateClipFromPath(){const b=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(b||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(b){this.clipBox=b,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.PathType.FILL,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(b,S))}}function F(k,b){if(typeof ImageData<"u"&&b instanceof ImageData){k.putImageData(b,0,0);return}const S=b.height,w=b.width,N=S%u,L=(S-N)/u,W=N===0?L:L+1,I=k.createImageData(w,u);let p=0,E;const T=b.data,M=I.data;let C,B,z,_;if(b.kind===r.ImageKind.GRAYSCALE_1BPP){const it=T.byteLength,K=new Uint32Array(M.buffer,0,M.byteLength>>2),Q=K.length,j=w+7>>3,et=4294967295,rt=r.FeatureTest.isLittleEndian?4278190080:255;for(C=0;C<W;C++){for(z=C<L?u:N,E=0,B=0;B<z;B++){const lt=it-p;let ht=0;const dt=lt>j?w:lt*8-7,gt=dt&-8;let mt=0,St=0;for(;ht<gt;ht+=8)St=T[p++],K[E++]=St&128?et:rt,K[E++]=St&64?et:rt,K[E++]=St&32?et:rt,K[E++]=St&16?et:rt,K[E++]=St&8?et:rt,K[E++]=St&4?et:rt,K[E++]=St&2?et:rt,K[E++]=St&1?et:rt;for(;ht<dt;ht++)mt===0&&(St=T[p++],mt=128),K[E++]=St&mt?et:rt,mt>>=1}for(;E<Q;)K[E++]=0;k.putImageData(I,0,C*u)}}else if(b.kind===r.ImageKind.RGBA_32BPP){for(B=0,_=w*u*4,C=0;C<L;C++)M.set(T.subarray(p,p+_)),p+=_,k.putImageData(I,0,B),B+=u;
4C<W&&(_=w*N*4,M.set(T.subarray(p,p+_)),k.putImageData(I,0,B))}else if(b.kind===r.ImageKind.RGB_24BPP)for(z=u,_=w*z,C=0;C<W;C++){for(C>=L&&(z=N,_=w*z),E=0,B=_;B--;)M[E++]=T[p++],M[E++]=T[p++],M[E++]=T[p++],M[E++]=255;k.putImageData(I,0,C*u)}else throw new Error(`bad image kind: ${b.kind}`)}function R(k,b){if(b.bitmap){k.drawImage(b.bitmap,0,0);return}const S=b.height,w=b.width,N=S%u,L=(S-N)/u,W=N===0?L:L+1,I=k.createImageData(w,u);let p=0;const E=b.data,T=I.data;for(let M=0;M<W;M++){const C=M<L?u:N;({srcPos:p}=(0,g.convertBlackAndWhiteToRGBA)({src:E,srcPos:p,dest:T,width:w,height:C,nonBlackColor:0})),k.putImageData(I,0,M*u)}}function m(k,b){const S=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const w of S)k[w]!==void 0&&(b[w]=k[w]);k.setLineDash!==void 0&&(b.setLineDash(k.getLineDash()),b.lineDashOffset=k.lineDashOffset)}function x(k){if(k.strokeStyle=k.fillStyle="#000000",k.fillRule="nonzero",k.globalAlpha=1,k.lineWidth=1,k.lineCap="butt",k.lineJoin="miter",k.miterLimit=10,k.globalCompositeOperation="source-over",k.font="10px sans-serif",k.setLineDash!==void 0&&(k.setLineDash([]),k.lineDashOffset=0),!r.isNodeJS){const{filter:b}=k;b!=="none"&&b!==""&&(k.filter="none")}}function O(k,b,S,w){const N=k.length;for(let L=3;L<N;L+=4){const W=k[L];if(W===0)k[L-3]=b,k[L-2]=S,k[L-1]=w;else if(W<255){const I=255-W;k[L-3]=k[L-3]*W+b*I>>8,k[L-2]=k[L-2]*W+S*I>>8,k[L-1]=k[L-1]*W+w*I>>8}}}function U(k,b,S){const w=k.length,N=1/255;for(let L=3;L<w;L+=4){const W=S?S[k[L]]:k[L];b[L]=b[L]*W*N|0}}function D(k,b,S){const w=k.length;for(let N=3;N<w;N+=4){const L=k[N-3]*77+k[N-2]*152+k[N-1]*28;b[N]=S?b[N]*S[L>>8]>>8:b[N]*L>>16}}function G(k,b,S,w,N,L,W,I,p,E,T){const M=!!L,C=M?L[0]:0,B=M?L[1]:0,z=M?L[2]:0,_=N==="Luminosity"?D:U,K=Math.min(w,Math.ceil(1048576/S));for(let Q=0;Q<w;Q+=K){const j=Math.min(K,w-Q),et=k.getImageData(I-E,Q+(p-T),S,j),rt=b.getImageData(I,Q+p,S,j);M&&O(et.data,C,B,z),_(et.data,rt.data,W),b.putImageData(rt,I,Q+p)}}function V(k,b,S,w){const N=w[0],L=w[1],W=w[2]-N,I=w[3]-L;W===0||I===0||(G(b.context,S,W,I,b.subtype,b.backdrop,b.transferMap,N,L,b.offsetX,b.offsetY),k.save(),k.globalAlpha=1,k.globalCompositeOperation="source-over",k.setTransform(1,0,0,1,0,0),k.drawImage(S.canvas,0,0),k.restore())}function tt(k,b){const S=r.Util.singularValueDecompose2dScale(k);S[0]=Math.fround(S[0]),S[1]=Math.fround(S[1]);const w=Math.fround((globalThis.devicePixelRatio||1)*a.PixelsPerInch.PDF_TO_CSS_UNITS);return b!==void 0?b:S[0]<=w||S[1]<=w}const Z=["butt","round","square"],q=["miter","round","bevel"],nt={},J={};class H{constructor(b,S,w,N,L,W,I,p){let{optionalContentConfig:E,markedContentStack:T=null}=W;this.ctx=b,this.current=new A(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=S,this.objs=w,this.canvasFactory=N,this.filterFactory=L,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=T||[],this.optionalContentConfig=E,this.cachedCanvases=new l(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=I,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=p,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(b){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof b=="string"?b.startsWith("g_")?this.commonObjs.get(b):this.objs.get(b):S}beginDrawing(b){let{transform:S,viewport:w,transparency:N=!1,background:L=null}=b;const W=this.ctx.canvas.width,I=this.ctx.canvas.height,p=this.ctx.fillStyle;if(this.ctx.fillStyle=L||"#ffffff",this.ctx.fillRect(0,0,W,I),this.ctx.fillStyle=p,N){const E=this.cachedCanvases.getCanvas("transparent",W,I);this.compositeCtx=this.ctx,this.transparentCanvas=E.canvas,this.ctx=E.context,this.ctx.save(),this.ctx.transform(...(0,a.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),x(this.ctx),S&&(this.ctx.transform(...S),this.outputScaleX=S[0],this.outputScaleY=S[0]),this.ctx.transform(...w.transform),this.viewportScale=w.scale,this.baseTransform=(0,a.getCurrentTransform)(this.ctx)}executeOperatorList(b,S,w,N){const L=b.argsArray,W=b.fnArray;let I=S||0;const p=L.length;if(p===I)return I;const E=p-I>i&&typeof w=="function",T=E?Date.now()+e:0;let M=0;const C=this.commonObjs,B=this.objs;let z;for(;;){if(N!==void 0&&I===N.nextBreakPoint)return N.breakIt(I,w),I;if(z=W[I],z!==r.OPS.dependency)this[z].apply(this,L[I]);else for(const _ of L[I]){const it=_.startsWith("g_")?C:B;if(!it.has(_))return it.get(_,w),I}if(I++,I===p)return I;if(E&&++M>i){if(Date.now()>T)return w(),I;M=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;
4)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const b of this._cachedBitmapsMap.values()){for(const S of b.values())typeof HTMLCanvasElement<"u"&&S instanceof HTMLCanvasElement&&(S.width=S.height=0);b.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const b=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(b!=="none"){const S=this.ctx.filter;this.ctx.filter=b,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=S}}}_scaleImage(b,S){const w=b.width,N=b.height;let L=Math.max(Math.hypot(S[0],S[1]),1),W=Math.max(Math.hypot(S[2],S[3]),1),I=w,p=N,E="prescale1",T,M;for(;L>2&&I>1||W>2&&p>1;){let C=I,B=p;L>2&&I>1&&(C=I>=16384?Math.floor(I/2)-1||1:Math.ceil(I/2),L/=I/C),W>2&&p>1&&(B=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p)/2,W/=p/B),T=this.cachedCanvases.getCanvas(E,C,B),M=T.context,M.clearRect(0,0,C,B),M.drawImage(b,0,0,I,p,0,0,C,B),b=T.canvas,I=C,p=B,E=E==="prescale1"?"prescale2":"prescale1"}return{img:b,paintWidth:I,paintHeight:p}}_createMaskCanvas(b){const S=this.ctx,{width:w,height:N}=b,L=this.current.fillColor,W=this.current.patternFill,I=(0,a.getCurrentTransform)(S);let p,E,T,M;if((b.bitmap||b.data)&&b.count>1){const ht=b.bitmap||b.data.buffer;E=JSON.stringify(W?I:[I.slice(0,4),L]),p=this._cachedBitmapsMap.get(ht),p||(p=new Map,this._cachedBitmapsMap.set(ht,p));const dt=p.get(E);if(dt&&!W){const gt=Math.round(Math.min(I[0],I[2])+I[4]),mt=Math.round(Math.min(I[1],I[3])+I[5]);return{canvas:dt,offsetX:gt,offsetY:mt}}T=dt}T||(M=this.cachedCanvases.getCanvas("maskCanvas",w,N),R(M.context,b));let C=r.Util.transform(I,[1/w,0,0,-1/N,0,0]);C=r.Util.transform(C,[1,0,0,1,0,-N]);const B=r.Util.applyTransform([0,0],C),z=r.Util.applyTransform([w,N],C),_=r.Util.normalizeRect([B[0],B[1],z[0],z[1]]),it=Math.round(_[2]-_[0])||1,K=Math.round(_[3]-_[1])||1,Q=this.cachedCanvases.getCanvas("fillCanvas",it,K),j=Q.context,et=Math.min(B[0],z[0]),rt=Math.min(B[1],z[1]);j.translate(-et,-rt),j.transform(...C),T||(T=this._scaleImage(M.canvas,(0,a.getCurrentTransformInverse)(j)),T=T.img,p&&W&&p.set(E,T)),j.imageSmoothingEnabled=tt((0,a.getCurrentTransform)(j),b.interpolate),d(j,T,0,0,T.width,T.height,0,0,w,N),j.globalCompositeOperation="source-in";const lt=r.Util.transform((0,a.getCurrentTransformInverse)(j),[1,0,0,1,-et,-rt]);return j.fillStyle=W?L.getPattern(S,this,lt,f.PathType.FILL):L,j.fillRect(0,0,w,N),p&&!W&&(this.cachedCanvases.delete("fillCanvas"),p.set(E,Q.canvas)),{canvas:Q.canvas,offsetX:Math.round(et),offsetY:Math.round(rt)}}setLineWidth(b){b!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=b,this.ctx.lineWidth=b}setLineCap(b){this.ctx.lineCap=Z[b]}setLineJoin(b){this.ctx.lineJoin=q[b]}setMiterLimit(b){this.ctx.miterLimit=b}setDash(b,S){const w=this.ctx;w.setLineDash!==void 0&&(w.setLineDash(b),w.lineDashOffset=S)}setRenderingIntent(b){}setFlatness(b){}setGState(b){for(const[S,w]of b)switch(S){case"LW":this.setLineWidth(w);break;case"LC":this.setLineCap(w);break;case"LJ":this.setLineJoin(w);break;case"ML":this.setMiterLimit(w);break;case"D":this.setDash(w[0],w[1]);break;case"RI":this.setRenderingIntent(w);break;case"FL":this.setFlatness(w);break;case"Font":this.setFont(w[0],w[1]);break;case"CA":this.current.strokeAlpha=w;break;case"ca":this.current.fillAlpha=w,this.ctx.globalAlpha=w;break;case"BM":this.ctx.globalCompositeOperation=w;break;case"SMask":this.current.activeSMask=w?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(w);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const b=this.inSMaskMode;this.current.activeSMask&&!b?this.beginSMaskMode():!this.current.activeSMask&&b&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const b=this.ctx.canvas.width,S=this.ctx.canvas.height,w="smaskGroupAt"+this.groupLevel,N=this.cachedCanvases.getCanvas(w,b,S);this.suspendedCtx=this.ctx,this.ctx=N.context;const L=this.ctx;L.setTransform(...(0,a.getCurrentTransform)(this.suspendedCtx)),m(this.suspendedCtx,L),n(L,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(),m(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(b){if(!this.current.activeSMask)return;b?(b[0]=Math.floor(b[0]),b[1]=Math.floor(b[1]),b[2]=Math.ceil(b[2]),b[3]=Math.ceil(b[3])):b=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const S=this.current.activeSMask,w=this.suspendedCtx;V(w,S,this.ctx,b),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(
4)}save(){this.inSMaskMode?(m(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const b=this.current;this.stateStack.push(b),this.current=b.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),m(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(b,S,w,N,L,W){this.ctx.transform(b,S,w,N,L,W),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(b,S,w){const N=this.ctx,L=this.current;let W=L.x,I=L.y,p,E;const T=(0,a.getCurrentTransform)(N),M=T[0]===0&&T[3]===0||T[1]===0&&T[2]===0,C=M?w.slice(0):null;for(let B=0,z=0,_=b.length;B<_;B++)switch(b[B]|0){case r.OPS.rectangle:W=S[z++],I=S[z++];const it=S[z++],K=S[z++],Q=W+it,j=I+K;N.moveTo(W,I),it===0||K===0?N.lineTo(Q,j):(N.lineTo(Q,I),N.lineTo(Q,j),N.lineTo(W,j)),M||L.updateRectMinMax(T,[W,I,Q,j]),N.closePath();break;case r.OPS.moveTo:W=S[z++],I=S[z++],N.moveTo(W,I),M||L.updatePathMinMax(T,W,I);break;case r.OPS.lineTo:W=S[z++],I=S[z++],N.lineTo(W,I),M||L.updatePathMinMax(T,W,I);break;case r.OPS.curveTo:p=W,E=I,W=S[z+4],I=S[z+5],N.bezierCurveTo(S[z],S[z+1],S[z+2],S[z+3],W,I),L.updateCurvePathMinMax(T,p,E,S[z],S[z+1],S[z+2],S[z+3],W,I,C),z+=6;break;case r.OPS.curveTo2:p=W,E=I,N.bezierCurveTo(W,I,S[z],S[z+1],S[z+2],S[z+3]),L.updateCurvePathMinMax(T,p,E,W,I,S[z],S[z+1],S[z+2],S[z+3],C),W=S[z+2],I=S[z+3],z+=4;break;case r.OPS.curveTo3:p=W,E=I,W=S[z+2],I=S[z+3],N.bezierCurveTo(S[z],S[z+1],W,I,W,I),L.updateCurvePathMinMax(T,p,E,S[z],S[z+1],W,I,W,I,C),z+=4;break;case r.OPS.closePath:N.closePath();break}M&&L.updateScalingPathMinMax(T,C),L.setCurrentPoint(W,I)}closePath(){this.ctx.closePath()}stroke(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const S=this.ctx,w=this.current.strokeColor;S.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof w=="object"&&w?.getPattern?(S.save(),S.strokeStyle=w.getPattern(S,this,(0,a.getCurrentTransformInverse)(S),f.PathType.STROKE),this.rescaleAndStroke(!1),S.restore()):this.rescaleAndStroke(!0)),b&&this.consumePath(this.current.getClippedPathBoundingBox()),S.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const S=this.ctx,w=this.current.fillColor,N=this.current.patternFill;let L=!1;N&&(S.save(),S.fillStyle=w.getPattern(S,this,(0,a.getCurrentTransformInverse)(S),f.PathType.FILL),L=!0);const W=this.current.getClippedPathBoundingBox();this.contentVisible&&W!==null&&(this.pendingEOFill?(S.fill("evenodd"),this.pendingEOFill=!1):S.fill()),L&&S.restore(),b&&this.consumePath(W)}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=nt}eoClip(){this.pendingClip=J}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const b=this.pendingTextPaths,S=this.ctx;if(b===void 0){S.beginPath();return}S.save(),S.beginPath();for(const w of b)S.setTransform(...w.transform),S.translate(w.x,w.y),w.addToPath(S,w.fontSize);S.restore(),S.clip(),S.beginPath(),delete this.pendingTextPaths}setCharSpacing(b){this.current.charSpacing=b}setWordSpacing(b){this.current.wordSpacing=b}setHScale(b){this.current.textHScale=b/100}setLeading(b){this.current.leading=-b}setFont(b,S){const w=this.commonObjs.get(b),N=this.current;if(!w)throw new Error(`Can't find font for ${b}`);if(N.fontMatrix=w.fontMatrix||r.FONT_IDENTITY_MATRIX,(N.fontMatrix[0]===0||N.fontMatrix[3]===0)&&(0,r.warn)("Invalid font matrix for font "+b),S<0?(S=-S,N.fontDirection=-1):N.fontDirection=1,this.current.font=w,this.current.fontSize=S,w.isType3Font)return;const L=w.loadedName||"sans-serif",W=w.systemFontInfo?.css||`"${L}", ${w.fallbackName}`;let I="normal";w.black?I="900":w.bold&&(I="bold");const p=w.italic?"italic":"normal";let E=S;S<y?E=y:S>P&&(E=P),this.current.fontSizeScale=S/E,this.ctx.font=`${p} ${I} ${E}px ${W}`}setTextRenderingMode(b){this.current.textRenderingMode=b}setTextRise(b){this.current.textRise=b}moveText(b,S){this.current.x=this.current.lineX+=b,this.current.y=this.current.lineY+=S}setLeadingMoveText(b,S){this.setLeading(-S),this.moveText(b,S)}setTextMatrix(b,S,w,N,L,W){this.current.textMatrix=[b,S,w,N,L,W],this.current.textMatrixScale=Math.hypot(b,S),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(b,S,w,N){const L=this.ctx,W=this.current,I=W.font,p=W.textRenderingMode,E=W.fontSize/W.fontSizeScale,T=p&r.TextRenderingMode.FILL_STROKE_MASK,M=!!(p&r.TextRenderingMode.ADD_TO_PATH_FLAG),C=W.patternFill&&!I.missingFile;let B;(I.disableFontFace||M||C)&&(B=I.getPathGenerator(this.commonObjs,b)),I.disableFontFace||C?(L.save(),L.translate(S,w),L.beginPath(),B(L,E),N&&L.setTransform(...N),(T===r.TextRenderingMode.FILL||T===r.TextRenderingMode.FILL_STROKE)&&L.fill(),(T===r.TextRenderingMode.STROKE||T===r.TextRenderingMode.FILL_STROKE)&&L.stroke(),L.restore(
4)):((T===r.TextRenderingMode.FILL||T===r.TextRenderingMode.FILL_STROKE)&&L.fillText(b,S,w),(T===r.TextRenderingMode.STROKE||T===r.TextRenderingMode.FILL_STROKE)&&L.strokeText(b,S,w)),M&&(this.pendingTextPaths||=[]).push({transform:(0,a.getCurrentTransform)(L),x:S,y:w,fontSize:E,addToPath:B})}get isFontSubpixelAAEnabled(){const{context:b}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);b.scale(1.5,1),b.fillText("I",0,10);const S=b.getImageData(0,0,10,10).data;let w=!1;for(let N=3;N<S.length;N+=4)if(S[N]>0&&S[N]<255){w=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",w)}showText(b){const S=this.current,w=S.font;if(w.isType3Font)return this.showType3Text(b);const N=S.fontSize;if(N===0)return;const L=this.ctx,W=S.fontSizeScale,I=S.charSpacing,p=S.wordSpacing,E=S.fontDirection,T=S.textHScale*E,M=b.length,C=w.vertical,B=C?1:-1,z=w.defaultVMetrics,_=N*S.fontMatrix[0],it=S.textRenderingMode===r.TextRenderingMode.FILL&&!w.disableFontFace&&!S.patternFill;L.save(),L.transform(...S.textMatrix),L.translate(S.x,S.y+S.textRise),E>0?L.scale(T,-1):L.scale(T,1);let K;if(S.patternFill){L.save();const lt=S.fillColor.getPattern(L,this,(0,a.getCurrentTransformInverse)(L),f.PathType.FILL);K=(0,a.getCurrentTransform)(L),L.restore(),L.fillStyle=lt}let Q=S.lineWidth;const j=S.textMatrixScale;if(j===0||Q===0){const lt=S.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;(lt===r.TextRenderingMode.STROKE||lt===r.TextRenderingMode.FILL_STROKE)&&(Q=this.getSinglePixelWidth())}else Q/=j;if(W!==1&&(L.scale(W,W),Q/=W),L.lineWidth=Q,w.isInvalidPDFjsFont){const lt=[];let ht=0;for(const dt of b)lt.push(dt.unicode),ht+=dt.width;L.fillText(lt.join(""),0,0),S.x+=ht*_*T,L.restore(),this.compose();return}let et=0,rt;for(rt=0;rt<M;++rt){const lt=b[rt];if(typeof lt=="number"){et+=B*lt*N/1e3;continue}let ht=!1;const dt=(lt.isSpace?p:0)+I,gt=lt.fontChar,mt=lt.accent;let St,Tt,wt=lt.width;if(C){const xt=lt.vmetric||z,Mt=-(lt.vmetric?xt[1]:wt*.5)*_,kt=xt[2]*_;wt=xt?-xt[0]:wt,St=Mt/W,Tt=(et+kt)/W}else St=et/W,Tt=0;if(w.remeasure&&wt>0){const xt=L.measureText(gt).width*1e3/N*W;if(wt<xt&&this.isFontSubpixelAAEnabled){const Mt=wt/xt;ht=!0,L.save(),L.scale(Mt,1),St/=Mt}else wt!==xt&&(St+=(wt-xt)/2e3*N/W)}if(this.contentVisible&&(lt.isInFont||w.missingFile)){if(it&&!mt)L.fillText(gt,St,Tt);else if(this.paintChar(gt,St,Tt,K),mt){const xt=St+N*mt.offset.x/W,Mt=Tt-N*mt.offset.y/W;this.paintChar(mt.fontChar,xt,Mt,K)}}const Ot=C?wt*_-dt*E:wt*_+dt*E;et+=Ot,ht&&L.restore()}C?S.y-=et:S.x+=et*T,L.restore(),this.compose()}showType3Text(b){const S=this.ctx,w=this.current,N=w.font,L=w.fontSize,W=w.fontDirection,I=N.vertical?1:-1,p=w.charSpacing,E=w.wordSpacing,T=w.textHScale*W,M=w.fontMatrix||r.FONT_IDENTITY_MATRIX,C=b.length,B=w.textRenderingMode===r.TextRenderingMode.INVISIBLE;let z,_,it,K;if(!(B||L===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,S.save(),S.transform(...w.textMatrix),S.translate(w.x,w.y),S.scale(T,W),z=0;z<C;++z){if(_=b[z],typeof _=="number"){K=I*_*L/1e3,this.ctx.translate(K,0),w.x+=K*T;continue}const Q=(_.isSpace?E:0)+p,j=N.charProcOperatorList[_.operatorListId];if(!j){(0,r.warn)(`Type3 character "${_.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=_,this.save(),S.scale(L,L),S.transform(...M),this.executeOperatorList(j),this.restore()),it=r.Util.applyTransform([_.width,0],M)[0]*L+Q,S.translate(it,0),w.x+=it*T}S.restore(),this.processingType3=null}}setCharWidth(b,S){}setCharWidthAndBounds(b,S,w,N,L,W){this.ctx.rect(w,N,L-w,W-N),this.ctx.clip(),this.endPath()}getColorN_Pattern(b){let S;if(b[0]==="TilingPattern"){const w=b[1],N=this.baseTransform||(0,a.getCurrentTransform)(this.ctx),L={createCanvasGraphics:W=>new H(W,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};S=new f.TilingPattern(b,w,this.ctx,L,N)}else S=this._getPattern(b[1],b[2]);return S}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(b,S,w){const N=r.Util.makeHexColor(b,S,w);this.ctx.strokeStyle=N,this.current.strokeColor=N}setFillRGBColor(b,S,w){const N=r.Util.makeHexColor(b,S,w);this.ctx.fillStyle=N,this.current.fillColor=N,this.current.patternFill=!1}_getPattern(b){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,w;return this.cachedPatterns.has(b)?w=this.cachedPatterns.get(b):(w=(0,f.getShadingPattern)(this.getObject(b)),this.cachedPatterns.set(b,w)),S&&(w.matrix=S),w}shadingFill(b){if(!this.contentVisible)return;const S=this.ctx;this.save();const w=this._getPattern(b);S.fillStyle=w.getPattern(S,this,(0,a.getCurrentTransformInverse)(S),f.PathType.SHADING);const N=(0,a.getCurrentTransformInverse)(S);if(N){const{width:L,height:W}
4=S.canvas,[I,p,E,T]=r.Util.getAxialAlignedBoundingBox([0,0,L,W],N);this.ctx.fillRect(I,p,E-I,T-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(b,S){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(b)&&b.length===6&&this.transform(...b),this.baseTransform=(0,a.getCurrentTransform)(this.ctx),S)){const w=S[2]-S[0],N=S[3]-S[1];this.ctx.rect(S[0],S[1],w,N),this.current.updateRectMinMax((0,a.getCurrentTransform)(this.ctx),S),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(b){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const S=this.ctx;b.isolated||(0,r.info)("TODO: Support non-isolated groups."),b.knockout&&(0,r.warn)("Knockout groups not supported.");const w=(0,a.getCurrentTransform)(S);if(b.matrix&&S.transform(...b.matrix),!b.bbox)throw new Error("Bounding box is required.");let N=r.Util.getAxialAlignedBoundingBox(b.bbox,(0,a.getCurrentTransform)(S));const L=[0,0,S.canvas.width,S.canvas.height];N=r.Util.intersect(N,L)||[0,0,0,0];const W=Math.floor(N[0]),I=Math.floor(N[1]);let p=Math.max(Math.ceil(N[2])-W,1),E=Math.max(Math.ceil(N[3])-I,1),T=1,M=1;p>s&&(T=p/s,p=s),E>s&&(M=E/s,E=s),this.current.startNewPathAndClipBox([0,0,p,E]);let C="groupAt"+this.groupLevel;b.smask&&(C+="_smask_"+this.smaskCounter++%2);const B=this.cachedCanvases.getCanvas(C,p,E),z=B.context;z.scale(1/T,1/M),z.translate(-W,-I),z.transform(...w),b.smask?this.smaskStack.push({canvas:B.canvas,context:z,offsetX:W,offsetY:I,scaleX:T,scaleY:M,subtype:b.smask.subtype,backdrop:b.smask.backdrop,transferMap:b.smask.transferMap||null,startTransformInverse:null}):(S.setTransform(1,0,0,1,0,0),S.translate(W,I),S.scale(T,M),S.save()),m(S,z),this.ctx=z,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(S),this.groupLevel++}endGroup(b){if(!this.contentVisible)return;this.groupLevel--;const S=this.ctx,w=this.groupStack.pop();if(this.ctx=w,this.ctx.imageSmoothingEnabled=!1,b.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const N=(0,a.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...N);const L=r.Util.getAxialAlignedBoundingBox([0,0,S.canvas.width,S.canvas.height],N);this.ctx.drawImage(S.canvas,0,0),this.ctx.restore(),this.compose(L)}}beginAnnotation(b,S,w,N,L){if(this.#t(),x(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(S)&&S.length===4){const W=S[2]-S[0],I=S[3]-S[1];if(L&&this.annotationCanvasMap){w=w.slice(),w[4]-=S[0],w[5]-=S[1],S=S.slice(),S[0]=S[1]=0,S[2]=W,S[3]=I;const[p,E]=r.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(this.ctx)),{viewportScale:T}=this,M=Math.ceil(W*this.outputScaleX*T),C=Math.ceil(I*this.outputScaleY*T);this.annotationCanvas=this.canvasFactory.create(M,C);const{canvas:B,context:z}=this.annotationCanvas;this.annotationCanvasMap.set(b,B),this.annotationCanvas.savedCtx=this.ctx,this.ctx=z,this.ctx.save(),this.ctx.setTransform(p,0,0,-E,0,I*E),x(this.ctx)}else x(this.ctx),this.ctx.rect(S[0],S[1],W,I),this.ctx.clip(),this.endPath()}this.current=new A(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...w),this.transform(...N)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(b){if(!this.contentVisible)return;const S=b.count;b=this.getObject(b.data,b),b.count=S;const w=this.ctx,N=this.processingType3;if(N&&(N.compiled===void 0&&(N.compiled=c(b)),N.compiled)){N.compiled(w);return}const L=this._createMaskCanvas(b),W=L.canvas;w.save(),w.setTransform(1,0,0,1,0,0),w.drawImage(W,L.offsetX,L.offsetY),w.restore(
4),this.compose()}paintImageMaskXObjectRepeat(b,S){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,L=arguments.length>4?arguments[4]:void 0,W=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;b=this.getObject(b.data,b);const I=this.ctx;I.save();const p=(0,a.getCurrentTransform)(I);I.transform(S,w,N,L,0,0);const E=this._createMaskCanvas(b);I.setTransform(1,0,0,1,E.offsetX-p[4],E.offsetY-p[5]);for(let T=0,M=W.length;T<M;T+=2){const C=r.Util.transform(p,[S,w,N,L,W[T],W[T+1]]),[B,z]=r.Util.applyTransform([0,0],C);I.drawImage(E.canvas,B,z)}I.restore(),this.compose()}paintImageMaskXObjectGroup(b){if(!this.contentVisible)return;const S=this.ctx,w=this.current.fillColor,N=this.current.patternFill;for(const L of b){const{data:W,width:I,height:p,transform:E}=L,T=this.cachedCanvases.getCanvas("maskCanvas",I,p),M=T.context;M.save();const C=this.getObject(W,L);R(M,C),M.globalCompositeOperation="source-in",M.fillStyle=N?w.getPattern(M,this,(0,a.getCurrentTransformInverse)(S),f.PathType.FILL):w,M.fillRect(0,0,I,p),M.restore(),S.save(),S.transform(...E),S.scale(1,-1),d(S,T.canvas,0,0,I,p,0,-1,1,1),S.restore()}this.compose()}paintImageXObject(b){if(!this.contentVisible)return;const S=this.getObject(b);if(!S){(0,r.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(S)}paintImageXObjectRepeat(b,S,w,N){if(!this.contentVisible)return;const L=this.getObject(b);if(!L){(0,r.warn)("Dependent image isn't ready yet");return}const W=L.width,I=L.height,p=[];for(let E=0,T=N.length;E<T;E+=2)p.push({transform:[S,0,0,w,N[E],N[E+1]],x:0,y:0,w:W,h:I});this.paintInlineImageXObjectGroup(L,p)}applyTransferMapsToCanvas(b){return this.current.transferMaps!=="none"&&(b.filter=this.current.transferMaps,b.drawImage(b.canvas,0,0),b.filter="none"),b.canvas}applyTransferMapsToBitmap(b){if(this.current.transferMaps==="none")return b.bitmap;const{bitmap:S,width:w,height:N}=b,L=this.cachedCanvases.getCanvas("inlineImage",w,N),W=L.context;return W.filter=this.current.transferMaps,W.drawImage(S,0,0),W.filter="none",L.canvas}paintInlineImageXObject(b){if(!this.contentVisible)return;const S=b.width,w=b.height,N=this.ctx;if(this.save(),!r.isNodeJS){const{filter:I}=N;I!=="none"&&I!==""&&(N.filter="none")}N.scale(1/S,-1/w);let L;if(b.bitmap)L=this.applyTransferMapsToBitmap(b);else if(typeof HTMLElement=="function"&&b instanceof HTMLElement||!b.data)L=b;else{const p=this.cachedCanvases.getCanvas("inlineImage",S,w).context;F(p,b),L=this.applyTransferMapsToCanvas(p)}const W=this._scaleImage(L,(0,a.getCurrentTransformInverse)(N));N.imageSmoothingEnabled=tt((0,a.getCurrentTransform)(N),b.interpolate),d(N,W.img,0,0,W.paintWidth,W.paintHeight,0,-w,S,w),this.compose(),this.restore()}paintInlineImageXObjectGroup(b,S){if(!this.contentVisible)return;const w=this.ctx;let N;if(b.bitmap)N=b.bitmap;else{const L=b.width,W=b.height,p=this.cachedCanvases.getCanvas("inlineImage",L,W).context;F(p,b),N=this.applyTransferMapsToCanvas(p)}for(const L of S)w.save(),w.transform(...L.transform),w.scale(1,-1),d(w,N,L.x,L.y,L.w,L.h,0,-1,1,1),w.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(b){}markPointProps(b,S){}beginMarkedContent(b){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(b,S){b==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(S)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(b){const S=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(b);const w=this.ctx;this.pendingClip&&(S||(this.pendingClip===J?w.clip("evenodd"):w.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),w.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const b=(0,a.getCurrentTransform)(this.ctx);if(b[1]===0&&b[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(b[0]),Math.abs(b[3]));else{const S=Math.abs(b[0]*b[3]-b[2]*b[1]),w=Math.hypot(b[0],b[2]),N=Math.hypot(b[1],b[3]);this._cachedGetSinglePixelWidth=Math.max(w,N)/S}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:b}=this.current,{a:S,b:w,c:N,d:L}=this.ctx.getTransform();let W,I;if(w===0&&N===0){const p=Math.abs(S),E=Math.abs(L);if(p===E)if(b===0)W=I=1/p;else{const T=p*b;W=I=T<1?1/T:1}else if(b===0)W=1/p,I=1/E;else{const T=p*b,M=E*b;W=T<1?1/T:1,I=M<1?1/M:1}}else{const p=Math.abs(S*L-w*N),E=Math.hypot(S,w),T=Math.hypot(N,L);if(b===0)W=T/p,I=E/p;else{const M=b*p;W=T>M?T/M:1,I=E>M?E/M:1}}this._cachedScaleForStroking[0]=W,this._cachedScaleForStroking[1]=I}return this._cachedScaleForStroking}rescaleAndStroke(b){const{ctx:S}=this,{lineWidth:w}=this.current,[N,L]=this.getScaleForStroking();if(S.lineWidth=w||1,N===1&&L===1){S.stroke();return}const W=S.getLineDash();if(b&&S.save(),S.scale(N,L),W.length>0){const I=Math.max(N,L);S.setLineDash(W.map(p=>p/I)),S.lineDashOffset/=I}
4S.stroke(),b&&S.restore()}isContentVisible(){for(let b=this.markedContentStack.length-1;b>=0;b--)if(!this.markedContentStack[b].visible)return!1;return!0}}o.CanvasGraphics=H;for(const k in r.OPS)H.prototype[k]!==void 0&&(H.prototype[r.OPS[k]]=H.prototype[k])}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TilingPattern=o.PathType=void 0,o.getShadingPattern=u,t(2);var r=t(1),a=t(168);const f={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};o.PathType=f;function g(d,c){if(!c)return;const A=c[2]-c[0],F=c[3]-c[1],R=new Path2D;R.rect(c[0],c[1],A,F),d.clip(R)}class y{constructor(){this.constructor===y&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class P extends y{constructor(c){super(),this._type=c[1],this._bbox=c[2],this._colorStops=c[3],this._p0=c[4],this._p1=c[5],this._r0=c[6],this._r1=c[7],this.matrix=null}_createGradient(c){let A;this._type==="axial"?A=c.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(A=c.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const F of this._colorStops)A.addColorStop(F[0],F[1]);return A}getPattern(c,A,F,R){let m;if(R===f.STROKE||R===f.FILL){const x=A.current.getClippedPathBoundingBox(R,(0,a.getCurrentTransform)(c))||[0,0,0,0],O=Math.ceil(x[2]-x[0])||1,U=Math.ceil(x[3]-x[1])||1,D=A.cachedCanvases.getCanvas("pattern",O,U,!0),G=D.context;G.clearRect(0,0,G.canvas.width,G.canvas.height),G.beginPath(),G.rect(0,0,G.canvas.width,G.canvas.height),G.translate(-x[0],-x[1]),F=r.Util.transform(F,[1,0,0,1,x[0],x[1]]),G.transform(...A.baseTransform),this.matrix&&G.transform(...this.matrix),g(G,this._bbox),G.fillStyle=this._createGradient(G),G.fill(),m=c.createPattern(D.canvas,"no-repeat");const V=new DOMMatrix(F);m.setTransform(V)}else g(c,this._bbox),m=this._createGradient(c);return m}}function s(d,c,A,F,R,m,x,O){const U=c.coords,D=c.colors,G=d.data,V=d.width*4;let tt;U[A+1]>U[F+1]&&(tt=A,A=F,F=tt,tt=m,m=x,x=tt),U[F+1]>U[R+1]&&(tt=F,F=R,R=tt,tt=x,x=O,O=tt),U[A+1]>U[F+1]&&(tt=A,A=F,F=tt,tt=m,m=x,x=tt);const Z=(U[A]+c.offsetX)*c.scaleX,q=(U[A+1]+c.offsetY)*c.scaleY,nt=(U[F]+c.offsetX)*c.scaleX,J=(U[F+1]+c.offsetY)*c.scaleY,H=(U[R]+c.offsetX)*c.scaleX,k=(U[R+1]+c.offsetY)*c.scaleY;if(q>=k)return;const b=D[m],S=D[m+1],w=D[m+2],N=D[x],L=D[x+1],W=D[x+2],I=D[O],p=D[O+1],E=D[O+2],T=Math.round(q),M=Math.round(k);let C,B,z,_,it,K,Q,j;for(let et=T;et<=M;et++){if(et<J){const gt=et<q?0:(q-et)/(q-J);C=Z-(Z-nt)*gt,B=b-(b-N)*gt,z=S-(S-L)*gt,_=w-(w-W)*gt}else{let gt;et>k?gt=1:J===k?gt=0:gt=(J-et)/(J-k),C=nt-(nt-H)*gt,B=N-(N-I)*gt,z=L-(L-p)*gt,_=W-(W-E)*gt}let rt;et<q?rt=0:et>k?rt=1:rt=(q-et)/(q-k),it=Z-(Z-H)*rt,K=b-(b-I)*rt,Q=S-(S-p)*rt,j=w-(w-E)*rt;const lt=Math.round(Math.min(C,it)),ht=Math.round(Math.max(C,it));let dt=V*et+lt*4;for(let gt=lt;gt<=ht;gt++)rt=(C-gt)/(C-it),rt<0?rt=0:rt>1&&(rt=1),G[dt++]=B-(B-K)*rt|0,G[dt++]=z-(z-Q)*rt|0,G[dt++]=_-(_-j)*rt|0,G[dt++]=255}}function e(d,c,A){const F=c.coords,R=c.colors;let m,x;switch(c.type){case"lattice":const O=c.verticesPerRow,U=Math.floor(F.length/O)-1,D=O-1;for(m=0;m<U;m++){let G=m*O;for(let V=0;V<D;V++,G++)s(d,A,F[G],F[G+1],F[G+O],R[G],R[G+1],R[G+O]),s(d,A,F[G+O+1],F[G+1],F[G+O],R[G+O+1],R[G+1],R[G+O])}break;case"triangles":for(m=0,x=F.length;m<x;m+=3)s(d,A,F[m],F[m+1],F[m+2],R[m],R[m+1],R[m+2]);break;default:throw new Error("illegal figure")}}class i extends y{constructor(c){super(),this._coords=c[2],this._colors=c[3],this._figures=c[4],this._bounds=c[5],this._bbox=c[7],this._background=c[8],this.matrix=null}_createMeshCanvas(c,A,F){const O=Math.floor(this._bounds[0]),U=Math.floor(this._bounds[1]),D=Math.ceil(this._bounds[2])-O,G=Math.ceil(this._bounds[3])-U,V=Math.min(Math.ceil(Math.abs(D*c[0]*1.1)),3e3),tt=Math.min(Math.ceil(Math.abs(G*c[1]*1.1)),3e3),Z=D/V,q=G/tt,nt={coords:this._coords,colors:this._colors,offsetX:-O,offsetY:-U,scaleX:1/Z,scaleY:1/q},J=V+4,H=tt+4,k=F.getCanvas("mesh",J,H,!1),b=k.context,S=b.createImageData(V,tt);if(A){const N=S.data;for(let L=0,W=N.length;L<W;L+=4)N[L]=A[0],N[L+1]=A[1],N[L+2]=A[2],N[L+3]=255}for(const N of this._figures)e(S,N,nt);return b.putImageData(S,2,2),{canvas:k.canvas,offsetX:O-2*Z,offsetY:U-2*q,scaleX:Z,scaleY:q}}getPattern(c,A,F,R){g(c,this._bbox);let m;if(R===f.SHADING)m=r.Util.singularValueDecompose2dScale((0,a.getCurrentTransform)(c));else if(m=r.Util.singularValueDecompose2dScale(A.baseTransform),this.matrix
4){const O=r.Util.singularValueDecompose2dScale(this.matrix);m=[m[0]*O[0],m[1]*O[1]]}const x=this._createMeshCanvas(m,R===f.SHADING?null:this._background,A.cachedCanvases);return R!==f.SHADING&&(c.setTransform(...A.baseTransform),this.matrix&&c.transform(...this.matrix)),c.translate(x.offsetX,x.offsetY),c.scale(x.scaleX,x.scaleY),c.createPattern(x.canvas,"no-repeat")}}class h extends y{getPattern(){return"hotpink"}}function u(d){switch(d[0]){case"RadialAxial":return new P(d);case"Mesh":return new i(d);case"Dummy":return new h}throw new Error(`Unknown IR type: ${d[0]}`)}const n={COLORED:1,UNCOLORED:2};class l{static MAX_PATTERN_SIZE=3e3;constructor(c,A,F,R,m){this.operatorList=c[2],this.matrix=c[3]||[1,0,0,1,0,0],this.bbox=c[4],this.xstep=c[5],this.ystep=c[6],this.paintType=c[7],this.tilingType=c[8],this.color=A,this.ctx=F,this.canvasGraphicsFactory=R,this.baseTransform=m}createPatternCanvas(c){const A=this.operatorList,F=this.bbox,R=this.xstep,m=this.ystep,x=this.paintType,O=this.tilingType,U=this.color,D=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+O);const G=F[0],V=F[1],tt=F[2],Z=F[3],q=r.Util.singularValueDecompose2dScale(this.matrix),nt=r.Util.singularValueDecompose2dScale(this.baseTransform),J=[q[0]*nt[0],q[1]*nt[1]],H=this.getSizeAndScale(R,this.ctx.canvas.width,J[0]),k=this.getSizeAndScale(m,this.ctx.canvas.height,J[1]),b=c.cachedCanvases.getCanvas("pattern",H.size,k.size,!0),S=b.context,w=D.createCanvasGraphics(S);w.groupLevel=c.groupLevel,this.setFillAndStrokeStyleToContext(w,x,U);let N=G,L=V,W=tt,I=Z;return G<0&&(N=0,W+=Math.abs(G)),V<0&&(L=0,I+=Math.abs(V)),S.translate(-(H.scale*N),-(k.scale*L)),w.transform(H.scale,0,0,k.scale,0,0),S.save(),this.clipBbox(w,N,L,W,I),w.baseTransform=(0,a.getCurrentTransform)(w.ctx),w.executeOperatorList(A),w.endDrawing(),{canvas:b.canvas,scaleX:H.scale,scaleY:k.scale,offsetX:N,offsetY:L}}getSizeAndScale(c,A,F){c=Math.abs(c);const R=Math.max(l.MAX_PATTERN_SIZE,A);let m=Math.ceil(c*F);return m>=R?m=R:F=m/c,{scale:F,size:m}}clipBbox(c,A,F,R,m){const x=R-A,O=m-F;c.ctx.rect(A,F,x,O),c.current.updateRectMinMax((0,a.getCurrentTransform)(c.ctx),[A,F,R,m]),c.clip(),c.endPath()}setFillAndStrokeStyleToContext(c,A,F){const R=c.ctx,m=c.current;switch(A){case n.COLORED:const x=this.ctx;R.fillStyle=x.fillStyle,R.strokeStyle=x.strokeStyle,m.fillColor=x.fillStyle,m.strokeColor=x.strokeStyle;break;case n.UNCOLORED:const O=r.Util.makeHexColor(F[0],F[1],F[2]);R.fillStyle=O,R.strokeStyle=O,m.fillColor=O,m.strokeColor=O;break;default:throw new r.FormatError(`Unsupported paint type: ${A}`)}}getPattern(c,A,F,R){let m=F;R!==f.SHADING&&(m=r.Util.transform(m,A.baseTransform),this.matrix&&(m=r.Util.transform(m,this.matrix)));const x=this.createPatternCanvas(A);let O=new DOMMatrix(m);O=O.translate(x.offsetX,x.offsetY),O=O.scale(1/x.scaleX,1/x.scaleY);const U=c.createPattern(x.canvas,"repeat");return U.setTransform(O),U}}o.TilingPattern=l}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.convertBlackAndWhiteToRGBA=f,o.convertToRGBA=a,o.grayToRGBA=y,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var r=t(1);function a(P){switch(P.kind){case r.ImageKind.GRAYSCALE_1BPP:return f(P);case r.ImageKind.RGB_24BPP:return g(P)}return null}function f(P){let{src:s,srcPos:e=0,dest:i,width:h,height:u,nonBlackColor:n=4294967295,inverseDecode:l=!1}=P;const d=r.FeatureTest.isLittleEndian?4278190080:255,[c,A]=l?[n,d]:[d,n],F=h>>3,R=h&7,m=s.length;i=new Uint32Array(i.buffer);let x=0;for(let O=0;O<u;O++){for(const D=e+F;e<D;e++){const G=e<m?s[e]:255;i[x++]=G&128?A:c,i[x++]=G&64?A:c,i[x++]=G&32?A:c,i[x++]=G&16?A:c,i[x++]=G&8?A:c,i[x++]=G&4?A:c,i[x++]=G&2?A:c,i[x++]=G&1?A:c}if(R===0)continue;const U=e<m?s[e++]:255;for(let D=0;D<R;D++)i[x++]=U&1<<7-D?A:c}return{srcPos:e,destPos:x}}function g(P){let{src:s,srcPos:e=0,dest:i,destPos:h=0,width:u,height:n}=P,l=0;const d=s.length>>2,c=new Uint32Array(s.buffer,e,d);if(r.FeatureTest.isLittleEndian){for(;l<d-2;l+=3,h+=4){const A=c[l],F=c[l+1],R=c[l+2];i[h]=A|4278190080,i[h+1]=A>>>24|F<<8|4278190080,i[h+2]=F>>>16|R<<16|4278190080,i[h+3]=R>>>8|4278190080}for(let A=l*4,F=s.length;A<F;A+=3)i[h++]=s[A]|s[A+1]<<8|s[A+2]<<16|4278190080}else{for(;
4l<d-2;l+=3,h+=4){const A=c[l],F=c[l+1],R=c[l+2];i[h]=A|255,i[h+1]=A<<24|F>>>8|255,i[h+2]=F<<16|R>>>16|255,i[h+3]=R<<8|255}for(let A=l*4,F=s.length;A<F;A+=3)i[h++]=s[A]<<24|s[A+1]<<16|s[A+2]<<8|255}return{srcPos:e,destPos:h}}function y(P,s){if(r.FeatureTest.isLittleEndian)for(let e=0,i=P.length;e<i;e++)s[e]=P[e]*65793|4278190080;else for(let e=0,i=P.length;e<i;e++)s[e]=P[e]*16843008|255}}),((v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GlobalWorkerOptions=void 0;const t=Object.create(null);o.GlobalWorkerOptions=t,t.workerPort=null,t.workerSrc=""}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.MessageHandler=void 0,t(2);var r=t(1);const a={DATA:1,ERROR:2},f={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function g(P){switch(P instanceof Error||typeof P=="object"&&P!==null||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),P.name){case"AbortException":return new r.AbortException(P.message);case"MissingPDFException":return new r.MissingPDFException(P.message);case"PasswordException":return new r.PasswordException(P.message,P.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(P.message,P.status);case"UnknownErrorException":return new r.UnknownErrorException(P.message,P.details);default:return new r.UnknownErrorException(P.message,P.toString())}}class y{constructor(s,e,i){this.sourceName=s,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=h=>{const u=h.data;if(u.targetName!==this.sourceName)return;if(u.stream){this.#e(u);return}if(u.callback){const l=u.callbackId,d=this.callbackCapabilities[l];if(!d)throw new Error(`Cannot resolve callback ${l}`);if(delete this.callbackCapabilities[l],u.callback===a.DATA)d.resolve(u.data);else if(u.callback===a.ERROR)d.reject(g(u.reason));else throw new Error("Unexpected callback case");return}const n=this.actionHandler[u.action];if(!n)throw new Error(`Unknown action from worker: ${u.action}`);if(u.callbackId){const l=this.sourceName,d=u.sourceName;new Promise(function(c){c(n(u.data))}).then(function(c){i.postMessage({sourceName:l,targetName:d,callback:a.DATA,callbackId:u.callbackId,data:c})},function(c){i.postMessage({sourceName:l,targetName:d,callback:a.ERROR,callbackId:u.callbackId,reason:g(c)})});return}if(u.streamId){this.#t(u);return}n(u.data)},i.addEventListener("message",this._onComObjOnMessage)}on(s,e){const i=this.actionHandler;if(i[s])throw new Error(`There is already an actionName called "${s}"`);i[s]=e}send(s,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:s,data:e},i)}sendWithPromise(s,e,i){const h=this.callbackId++,u=new r.PromiseCapability;this.callbackCapabilities[h]=u;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:s,callbackId:h,data:e},i)}catch(n){u.reject(n)}return u.promise}sendWithStream(s,e,i,h){const u=this.streamId++,n=this.sourceName,l=this.targetName,d=this.comObj;return new ReadableStream({start:c=>{const A=new r.PromiseCapability;return this.streamControllers[u]={controller:c,startCall:A,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:n,targetName:l,action:s,streamId:u,data:e,desiredSize:c.desiredSize},h),A.promise},pull:c=>{const A=new r.PromiseCapability;return this.streamControllers[u].pullCall=A,d.postMessage({sourceName:n,targetName:l,stream:f.PULL,streamId:u,desiredSize:c.desiredSize}),A.promise},cancel:c=>{(0,r.assert)(c instanceof Error,"cancel must have a valid reason");const A=new r.PromiseCapability;return this.streamControllers[u].cancelCall=A,this.streamControllers[u].isClosed=!0,d.postMessage({sourceName:n,targetName:l,stream:f.CANCEL,streamId:u,reason:g(c)}),A.promise}},i)}#t(s){const e=s.streamId,i=this.sourceName,h=s.sourceName,u=this.comObj,n=this,l=this.actionHandler[s.action],d={enqueue(c){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const R=this.desiredSize;this.desiredSize-=A,R>0&&this.desiredSize<=0&&(this.sinkCapability=new r.PromiseCapability,this.ready=this.sinkCapability.promise),u.postMessage({sourceName:i,targetName:h,stream:f.ENQUEUE,streamId:e,chunk:c},F)},close(){this.isCancelled||(this.isCancelled=!0,u.postMessage({sourceName:i,targetName:h,stream:f.CLOSE,streamId:e}),delete n.streamSinks[e])},error(c){(0,r.assert)(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,u.postMessage({sourceName:i,targetName:h,stream:f.ERROR,streamId:e,reason:g(c)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:s.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[e]=d,new Promise(function(c){c(l(s.data,d))}).then(function(){u.postMessage({sourceName:i,targetName:h,stream:f.START_COMPLETE,streamId:e,success:!0})},function(c){u.postMessage({sourceName:i,targetName:h,stream:f.START_COMPLETE,streamId:e,reason:g(c)})})}#e(s){const e=s.streamId,i=this.sourceName,h=s.sourceName,u=this.comObj,n=this.streamControllers[e],l=this.streamSinks[e];switch(s.stream){case f.START_COMPLETE:s.success?n.startCall.resolve():n.startCall.reject(g(s.reason));break;case f.PULL_COMPLETE:s.success?n.pullCall.resolve():n.pullCall.reject(g(s.reason));break;case f.PULL:if(!l){u.postMessage({sourceName:i,targetName:h,stream:f.PULL_COMPLETE,streamId:e,success:!0});break}l.desiredSize<=0&&s.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=s.desiredSize,new Promise(function(d){d(l.onPull?.())}).then(function(){u.postMessage({sourceName:i,targetName:h,stream:f.PULL_COMPLETE,streamId:e,success:!0})},function(d){u.postMessage({sourceName:i,targetName:h,stream:f.PULL_COMPLETE,streamId:e,reason:g(d)})});break;case f.ENQUEUE:if((0,r.assert)(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(s.chunk);break;case f.CLOSE:if((0,r.assert)(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#n(n,e);break;case f.ERROR:(0,r.assert)(n,"error should have stream controller"),n.controller.error(g
4(s.reason)),this.#n(n,e);break;case f.CANCEL_COMPLETE:s.success?n.cancelCall.resolve():n.cancelCall.reject(g(s.reason)),this.#n(n,e);break;case f.CANCEL:if(!l)break;new Promise(function(d){d(l.onCancel?.(g(s.reason)))}).then(function(){u.postMessage({sourceName:i,targetName:h,stream:f.CANCEL_COMPLETE,streamId:e,success:!0})},function(d){u.postMessage({sourceName:i,targetName:h,stream:f.CANCEL_COMPLETE,streamId:e,reason:g(d)})}),l.sinkCapability.reject(g(s.reason)),l.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#n(s,e){await Promise.allSettled([s.startCall?.promise,s.pullCall?.promise,s.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}o.MessageHandler=y}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Metadata=void 0;var r=t(1);class a{#t;#e;constructor(g){let{parsedData:y,rawData:P}=g;this.#t=y,this.#e=P}getRaw(){return this.#e}get(g){return this.#t.get(g)??null}getAll(){return(0,r.objectFromMap)(this.#t)}has(g){return this.#t.has(g)}}o.Metadata=a}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionalContentConfig=void 0;var r=t(1),a=t(170);const f=Symbol("INTERNAL");class g{#t=!0;constructor(s,e){this.name=s,this.intent=e}get visible(){return this.#t}_setVisible(s,e){s!==f&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#t=e}}class y{#t=null;#e=new Map;#n=null;#r=null;constructor(s){if(this.name=null,this.creator=null,s!==null){this.name=s.name,this.creator=s.creator,this.#r=s.order;for(const e of s.groups)this.#e.set(e.id,new g(e.name,e.intent));if(s.baseState==="OFF")for(const e of this.#e.values())e._setVisible(f,!1);for(const e of s.on)this.#e.get(e)._setVisible(f,!0);for(const e of s.off)this.#e.get(e)._setVisible(f,!1);this.#n=this.getHash()}}#o(s){const e=s.length;if(e<2)return!0;const i=s[0];for(let h=1;h<e;h++){const u=s[h];let n;if(Array.isArray(u))n=this.#o(u);else if(this.#e.has(u))n=this.#e.get(u).visible;else return(0,r.warn)(`Optional content group not found: ${u}`),!0;switch(i){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return i==="And"}isVisible(s){if(this.#e.size===0)return!0;if(!s)return(0,r.warn)("Optional content group not defined."),!0;if(s.type==="OCG")return this.#e.has(s.id)?this.#e.get(s.id).visible:((0,r.warn)(`Optional content group not found: ${s.id}`),!0);if(s.type==="OCMD"){if(s.expression)return this.#o(s.expression);if(!s.policy||s.policy==="AnyOn"){for(const e of s.ids){if(!this.#e.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!0}return!1}else if(s.policy==="AllOn"){for(const e of s.ids){if(!this.#e.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!1}return!0}else if(s.policy==="AnyOff"){for(const e of s.ids){if(!this.#e.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!0}return!1}else if(s.policy==="AllOff"){for(const e of s.ids){if(!this.#e.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!1}return!0}return(0,r.warn)(`Unknown optional content policy ${s.policy}.`),!0}return(0,r.warn)(`Unknown group type ${s.type}.`),!0}setVisibility(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!this.#e.has(s)){(0,r.warn)(`Optional content group not found: ${s}`);return}this.#e.get(s)._setVisible(f,!!e),this.#t=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#e.size?this.#r?this.#r.slice():[...this.#e.keys()]:null}getGroups(){return this.#e.size>0?(0,r.objectFromMap)(this.#e):null}getGroup(s){return this.#e.get(s)||null}getHash(){if(this.#t!==null)return this.#t;const s=new a.MurmurHash3_64;for(const[e,i]of this.#e)s.update(`${e}:${i.visible}`);return this.#t=s.hexdigest()}}o.OptionalContentConfig=y}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFDataTransportStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var r=t(1),a=t(168);class f{constructor(s,e){let{length:i,initialData:h,progressiveDone:u=!1,contentDispositionFilename:n=null,disableRange:l=!1,disableStream:d=!1}=s;if((0,r.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=u,this._contentDispositionFilename=n,h?.length>0){const c=h instanceof Uint8Array&&h.byteLength===h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer;this._queuedChunks.push(c)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!d,this._isRangeSupported=!l,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((c,A)=>{this._onReceiveData({begin:c,chunk:A})}),this._pdfDataRangeTransport.addProgressListener((c,A)=>{this._onProgress({loaded:c,total:A})}),this._pdfDataRangeTransport.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(s){let{begin:e,chunk:i}=s;const h=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(h):this._queuedChunks.push(h);else{const u=this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(h),!0)});(0,r.assert)(u,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(s){s.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:s.loaded}):this._fullRequestReader?.onProgress?.({loaded:s.loaded,total:s.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(s){const e=this._rangeReaders.indexOf(s);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const s=this._queuedChunks;return this._queuedChunks=null,new g(this,s,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(s,e){if(e<=this._progressiveDataLength)return null;const i=new y(this,s,e);return this._pdfDataRangeTransport.requestDataRange(s,e),this._rangeReaders.push(i),i}cancelAllRequests(s){this._fullRequestReader?.cancel(s);for(const e of this._rangeReaders.slice(0))e.cancel(s);this._pdfDataRangeTransport.abort()}}o.PDFDataTransportStream=f;class g{constructor(s,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;this._stream=s,this._done=i||!1,this._filename=(0,a.isPdfFile)(h)?h:null,this._queuedChunks=e||[],this._loaded=0;for(const u of this._queuedChunks)this._loaded+=u.byteLength;
4this._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 r.PromiseCapability;return this._requests.push(s),s.promise}cancel(s){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class y{constructor(s,e,i){this._stream=s,this._begin=e,this._end=i,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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const s=new r.PromiseCapability;return this._requests.push(s),s.promise}cancel(s){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFFetchStream=void 0,t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123),t(89);var r=t(1),a=t(182);function f(i,h,u){return{method:"GET",headers:i,signal:u.signal,mode:"cors",credentials:h?"include":"same-origin",redirect:"follow"}}function g(i){const h=new Headers;for(const u in i){const n=i[u];n!==void 0&&h.append(u,n)}return h}function y(i){return i instanceof Uint8Array?i.buffer:i instanceof ArrayBuffer?i:((0,r.warn)(`getArrayBuffer - unexpected data format: ${i}`),new Uint8Array(i).buffer)}class P{constructor(h){this.source=h,this.isHttp=/^https?:/i.test(h.url),this.httpHeaders=this.isHttp&&h.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new s(this),this._fullRequestReader}getRangeReader(h,u){if(u<=this._progressiveDataLength)return null;const n=new e(this,h,u);return this._rangeRequestReaders.push(n),n}cancelAllRequests(h){this._fullRequestReader?.cancel(h);for(const u of this._rangeRequestReaders.slice(0))u.cancel(h)}}o.PDFFetchStream=P;class s{constructor(h){this._stream=h,this._reader=null,this._loaded=0,this._filename=null;const u=h.source;this._withCredentials=u.withCredentials||!1,this._contentLength=u.length,this._headersCapability=new r.PromiseCapability,this._disableRange=u.disableRange||!1,this._rangeChunkSize=u.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!u.disableStream,this._isRangeSupported=!u.disableRange,this._headers=g(this._stream.httpHeaders);const n=u.url;fetch(n,f(this._headers,this._withCredentials,this._abortController)).then(l=>{if(!(0,a.validateResponseStatus)(l.status))throw(0,a.createResponseStatusError)(l.status,n);this._reader=l.body.getReader(),this._headersCapability.resolve();const d=F=>l.headers.get(F),{allowRangeRequests:c,suggestedLength:A}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:d,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=c,this._contentLength=A||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(d),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:h,done:u}=await this._reader.read();return u?{value:h,done:u}:(this._loaded+=h.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:y(h),done:!1})}cancel(h){this._reader?.cancel(h),this._abortController.abort()}}class e{constructor(h,u,n){this._stream=h,this._reader=null,this._loaded=0;const l=h.source;this._withCredentials=l.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!l.disableStream,this._abortController=new AbortController,this._headers=g(this._stream.httpHeaders),this._headers.append("Range",`bytes=${u}-${n-1}`);const d=l.url;fetch(d,f(this._headers,this._withCredentials,this._abortController)).then(c=>{if(!(0,a.validateResponseStatus)(c.status))throw(0,a.createResponseStatusError)(c.status,d);this._readCapability.resolve(),this._reader=c.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:h,done:u}=await this._reader.read();return u?{value:h,done:u}:(this._loaded+=h.byteLength,this.onProgress?.({loaded:this._loaded}),{value:y(h),done:!1})}cancel(h){this._reader?.cancel(h),this._abortController.abort()}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createResponseStatusError=P,o.extractFilenameFromHeader=y,o.validateRangeRequestCapabilities=g,o.validateResponseStatus=s;var r=t(1),a=t(183),f=t(168);function g(e){let{getResponseHeader:i,isHttp:h,rangeChunkSize:u,disableRange:n}=e;const l={allowRangeRequests:!1,suggestedLength:void 0},d=parseInt(i("Content-Length"),10);return!Number.isInteger(d)||(l.suggestedLength=d,d<=2*u)||n||!h||i("Accept-Ranges")!=="bytes"||(i("Content-Encoding")||"identity")!=="identity"||(l.allowRangeRequests=!0),l}function y(e){const i=e("Content-Disposition");if(i){let h=(0,a.getFilenameFromContentDispositionHeader)(i);if(h.includes("%"))try{h=decodeURIComponent(h)}catch{}if((0,f.isPdfFile)(h))return h}return null}
4function P(e,i){return e===404||e===0&&i.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+i+'".'):new r.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${i}".`,e)}function s(e){return e===200||e===206}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getFilenameFromContentDispositionHeader=a,t(89),t(149);var r=t(1);function a(f){let g=!0,y=P("filename\\*","i").exec(f);if(y){y=y[1];let l=h(y);return l=unescape(l),l=u(l),l=n(l),e(l)}if(y=i(f),y){const l=n(y);return e(l)}if(y=P("filename","i").exec(f),y){y=y[1];let l=h(y);return l=n(l),e(l)}function P(l,d){return new RegExp("(?:^|;)\\s*"+l+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function s(l,d){if(l){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const c=new TextDecoder(l,{fatal:!0}),A=(0,r.stringToBytes)(d);d=c.decode(A),g=!1}catch{}}return d}function e(l){return g&&/[\x80-\xff]/.test(l)&&(l=s("utf-8",l),g&&(l=s("iso-8859-1",l))),l}function i(l){const d=[];let c;const A=P("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(c=A.exec(l))!==null;){let[,R,m,x]=c;if(R=parseInt(R,10),R in d){if(R===0)break;continue}d[R]=[m,x]}const F=[];for(let R=0;R<d.length&&R in d;++R){let[m,x]=d[R];x=h(x),m&&(x=unescape(x),R===0&&(x=u(x))),F.push(x)}return F.join("")}function h(l){if(l.startsWith('"')){const d=l.slice(1).split('\\"');for(let c=0;c<d.length;++c){const A=d[c].indexOf('"');A!==-1&&(d[c]=d[c].slice(0,A),d.length=c+1),d[c]=d[c].replaceAll(/\\(.)/g,"$1")}l=d.join('"')}return l}function u(l){const d=l.indexOf("'");if(d===-1)return l;const c=l.slice(0,d),F=l.slice(d+1).replace(/^[^']*'/,"");return s(c,F)}function n(l){return!l.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(l)?l:l.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,c,A,F){if(A==="q"||A==="Q")return F=F.replaceAll("_"," "),F=F.replaceAll(/=([0-9a-fA-F]{2})/g,function(R,m){return String.fromCharCode(parseInt(m,16))}),s(c,F);try{F=atob(F)}catch{}return s(c,F)})}return""}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFNetworkStream=void 0,t(89);var r=t(1),a=t(182);const f=200,g=206;function y(h){const u=h.response;return typeof u!="string"?u:(0,r.stringToBytes)(u).buffer}class P{constructor(u){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.url=u,this.isHttp=/^https?:/i.test(u),this.httpHeaders=this.isHttp&&n.httpHeaders||Object.create(null),this.withCredentials=n.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(u,n,l){const d={begin:u,end:n};for(const c in l)d[c]=l[c];return this.request(d)}requestFull(u){return this.request(u)}request(u){const n=new XMLHttpRequest,l=this.currXhrId++,d=this.pendingRequests[l]={xhr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const c in this.httpHeaders){const A=this.httpHeaders[c];A!==void 0&&n.setRequestHeader(c,A)}return this.isHttp&&"begin"in u&&"end"in u?(n.setRequestHeader("Range",`bytes=${u.begin}-${u.end-1}`),d.expectedStatus=g):d.expectedStatus=f,n.responseType="arraybuffer",u.onError&&(n.onerror=function(c){u.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,l),n.onprogress=this.onProgress.bind(this,l),d.on
4HeadersReceived=u.onHeadersReceived,d.onDone=u.onDone,d.onError=u.onError,d.onProgress=u.onProgress,n.send(null),l}onProgress(u,n){const l=this.pendingRequests[u];l&&l.onProgress?.(n)}onStateChange(u,n){const l=this.pendingRequests[u];if(!l)return;const d=l.xhr;if(d.readyState>=2&&l.onHeadersReceived&&(l.onHeadersReceived(),delete l.onHeadersReceived),d.readyState!==4||!(u in this.pendingRequests))return;if(delete this.pendingRequests[u],d.status===0&&this.isHttp){l.onError?.(d.status);return}const c=d.status||f;if(!(c===f&&l.expectedStatus===g)&&c!==l.expectedStatus){l.onError?.(d.status);return}const F=y(d);if(c===g){const R=d.getResponseHeader("Content-Range"),m=/bytes (\d+)-(\d+)\/(\d+)/.exec(R);l.onDone({begin:parseInt(m[1],10),chunk:F})}else F?l.onDone({begin:0,chunk:F}):l.onError?.(d.status)}getRequestXhr(u){return this.pendingRequests[u].xhr}isPendingRequest(u){return u in this.pendingRequests}abortRequest(u){const n=this.pendingRequests[u].xhr;delete this.pendingRequests[u],n.abort()}}class s{constructor(u){this._source=u,this._manager=new P(u.url,{httpHeaders:u.httpHeaders,withCredentials:u.withCredentials}),this._rangeChunkSize=u.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(u){const n=this._rangeRequestReaders.indexOf(u);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new e(this._manager,this._source),this._fullRequestReader}getRangeReader(u,n){const l=new i(this._manager,u,n);return l.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(l),l}cancelAllRequests(u){this._fullRequestReader?.cancel(u);for(const n of this._rangeRequestReaders.slice(0))n.cancel(u)}}o.PDFNetworkStream=s;class e{constructor(u,n){this._manager=u;const l={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=u.requestFull(l),this._headersReceivedCapability=new r.PromiseCapability,this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.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 u=this._fullRequestId,n=this._manager.getRequestXhr(u),l=A=>n.getResponseHeader(A),{allowRangeRequests:d,suggestedLength:c}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:l,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});d&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(l),this._isRangeSupported&&this._manager.abortRequest(u),this._headersReceivedCapability.resolve()}_onDone(u){if(u&&(this._requests.length>0?this._requests.shift().resolve({value:u.chunk,done:!1}):this._cachedChunks.push(u.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(u){this._storedError=(0,a.createResponseStatusError)(u,this._url),this._headersReceivedCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(u){this.onProgress?.({loaded:u.loaded,total:u.lengthComputable?u.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 u=new r.PromiseCapability;return this._requests.push(u),u.promise}cancel(u){this._done=!0,this._headersReceivedCapability.reject(u);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest
4(this._fullRequestId),this._fullRequestReader=null}}class i{constructor(u,n,l){this._manager=u;const d={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=u.url,this._requestId=u.requestRange(n,l,d),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(u){const n=u.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const l of this._requests)l.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(u){this._storedError=(0,a.createResponseStatusError)(u,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(u){this.isStreamingSupported||this.onProgress?.({loaded:u.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const u=new r.PromiseCapability;return this._requests.push(u),u.promise}cancel(u){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PDFNodeStream=void 0,t(89),t(93),t(101),t(102),t(105),t(107),t(109),t(113),t(116),t(123);var r=t(1),a=t(182);const f=/^file:\/\/\/[a-zA-Z]:\//;function g(l){const d=require$$6,c=d.parse(l);return c.protocol==="file:"||c.host?c:/^[a-z]:[/\\]/i.test(l)?d.parse(`file:///${l}`):(c.host||(c.protocol="file:"),c)}class y{constructor(d){this.source=d,this.url=g(d.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&d.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new u(this):new i(this),this._fullRequestReader}getRangeReader(d,c){if(c<=this._progressiveDataLength)return null;const A=this.isFsUrl?new n(this,d,c):new h(this,d,c);return this._rangeRequestReaders.push(A),A}cancelAllRequests(d){this._fullRequestReader?.cancel(d);for(const c of this._rangeRequestReaders.slice(0))c.cancel(d)}}o.PDFNodeStream=y;class P{constructor(d){this._url=d.url,this._done=!1,this._storedError=null,this.onProgress=null;const c=d.source;this._contentLength=c.length,this._loaded=0,this._filename=null,this._disableRange=c.disableRange||!1,this._rangeChunkSize=c.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!c.disableStream,this._isRangeSupported=!c.disableRange,this._readableStream=null,this._readCapability=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const d=this._readableStream.read();return d===null?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=d.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(d).buffer,done:!1})}cancel(d){if(!this._readableStream){this._error(d);return}this._readableStream.destroy(d)}_error(d){this._storedError=d,this._readCapability.resolve()}_setReadableStream(d){this._readableStream=d,d.on("readable",()=>{this._readCapability.resolve()}),d.on("end",()=>{d.destroy(),this._done=!0,this._readCapability.resolve()}),d.on("error",c=>{this._error(c)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class s{constructor(d){this._url=d.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;const c=d.source;this._isStreamingSupported=!c.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const d=this._readableStream.read();return d===null?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=d.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(d).buffer,done:!1})}cancel(d){if(!this._readableStream){this._error(d);return}this._readableStream.destroy(d)}_error(d){this._storedError=d,this._readCapability.resolve()}_setReadableStream(d){this._readableStream=d,d.on("readable",()=>{this._readCapability.resolve()}),d.on("end",()=>{d.destroy(),this._done=!0,this._readCapability.resolve()}),d.on("error",c=>{this._error(c)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function e(l,d){return{protocol:l.protocol,auth:l.auth,host:l.hostname,port:l.port,path:l.path,method:"GET",headers:d}}
4class i extends P{constructor(d){super(d);const c=A=>{if(A.statusCode===404){const x=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=x,this._headersCapability.reject(x);return}this._headersCapability.resolve(),this._setReadableStream(A);const F=x=>this._readableStream.headers[x.toLowerCase()],{allowRangeRequests:R,suggestedLength:m}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:F,isHttp:d.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=R,this._contentLength=m||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(F)};if(this._request=null,this._url.protocol==="http:"){const A=require$$6;this._request=A.request(e(this._url,d.httpHeaders),c)}else{const A=require$$6;this._request=A.request(e(this._url,d.httpHeaders),c)}this._request.on("error",A=>{this._storedError=A,this._headersCapability.reject(A)}),this._request.end()}}class h extends s{constructor(d,c,A){super(d),this._httpHeaders={};for(const R in d.httpHeaders){const m=d.httpHeaders[R];m!==void 0&&(this._httpHeaders[R]=m)}this._httpHeaders.Range=`bytes=${c}-${A-1}`;const F=R=>{if(R.statusCode===404){const m=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=m;return}this._setReadableStream(R)};if(this._request=null,this._url.protocol==="http:"){const R=require$$6;this._request=R.request(e(this._url,this._httpHeaders),F)}else{const R=require$$6;this._request=R.request(e(this._url,this._httpHeaders),F)}this._request.on("error",R=>{this._storedError=R}),this._request.end()}}class u extends P{constructor(d){super(d);let c=decodeURIComponent(this._url.path);f.test(this._url.href)&&(c=c.replace(/^\//,""));const A=require$$6;A.lstat(c,(F,R)=>{if(F){F.code==="ENOENT"&&(F=new r.MissingPDFException(`Missing PDF "${c}".`)),this._storedError=F,this._headersCapability.reject(F);return}this._contentLength=R.size,this._setReadableStream(A.createReadStream(c)),this._headersCapability.resolve()})}}class n extends s{constructor(d,c,A){super(d);let F=decodeURIComponent(this._url.path);f.test(this._url.href)&&(F=F.replace(/^\//,""));const R=require$$6;this._setReadableStream(R.createReadStream(F,{start:c,end:A-1}))}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 r=t(168),a=t(1);const f={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},g="http://www.w3.org/XML/1998/namespace",y="http://www.w3.org/1999/xlink",P=["butt","round","square"],s=["miter","round","bevel"],e=function(R){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(URL.createObjectURL&&typeof Blob<"u"&&!x)return URL.createObjectURL(new Blob([R],{type:m}));const O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let U=`data:${m};base64,`;for(let D=0,G=R.length;D<G;D+=3){const V=R[D]&255,tt=R[D+1]&255,Z=R[D+2]&255,q=V>>2,nt=(V&3)<<4|tt>>4,J=D+1<G?(tt&15)<<2|Z>>6:64,H=D+2<G?Z&63:64;U+=O[q]+O[nt]+O[J]+O[H]}return U},i=(function(){const R=new Uint8Array([137,80,78,71,13,10,26,10]),m=12,x=new Int32Array(256);for(let Z=0;Z<256;Z++){let q=Z;for(let nt=0;nt<8;nt++)q=q&1?3988292384^q>>1&2147483647:q>>1&2147483647;x[Z]=q}function O(Z,q,nt){let J=-1;for(let H=q;H<nt;H++){const k=(J^Z[H])&255,b=x[k];J=J>>>8^b}return J^-1}function U(Z,q,nt,J){let H=J;const k=q.length;nt[H]=k>>24&255,nt[H+1]=k>>16&255,nt[H+2]=k>>8&255,nt[H+3]=k&255,H+=4,nt[H]=Z.charCodeAt(0)&255,nt[H+1]=Z.charCodeAt(1)&255,nt[H+2]=Z.charCodeAt(2)&255,nt[H+3]=Z.charCo
4deAt(3)&255,H+=4,nt.set(q,H),H+=q.length;const b=O(nt,J+4,H);nt[H]=b>>24&255,nt[H+1]=b>>16&255,nt[H+2]=b>>8&255,nt[H+3]=b&255}function D(Z,q,nt){let J=1,H=0;for(let k=q;k<nt;++k)J=(J+(Z[k]&255))%65521,H=(H+J)%65521;return H<<16|J}function G(Z){if(!a.isNodeJS)return V(Z);try{const q=parseInt(process.versions.node)>=8?Z:Buffer.from(Z),nt=require$$6.deflateSync(q,{level:9});return nt instanceof Uint8Array?nt:new Uint8Array(nt)}catch(q){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+q)}return V(Z)}function V(Z){let q=Z.length;const nt=65535,J=Math.ceil(q/nt),H=new Uint8Array(2+q+J*5+4);let k=0;H[k++]=120,H[k++]=156;let b=0;for(;q>nt;)H[k++]=0,H[k++]=255,H[k++]=255,H[k++]=0,H[k++]=0,H.set(Z.subarray(b,b+nt),k),k+=nt,b+=nt,q-=nt;H[k++]=1,H[k++]=q&255,H[k++]=q>>8&255,H[k++]=~q&65535&255,H[k++]=(~q&65535)>>8&255,H.set(Z.subarray(b),k),k+=Z.length-b;const S=D(Z,0,Z.length);return H[k++]=S>>24&255,H[k++]=S>>16&255,H[k++]=S>>8&255,H[k++]=S&255,H}function tt(Z,q,nt,J){const H=Z.width,k=Z.height;let b,S,w;const N=Z.data;switch(q){case a.ImageKind.GRAYSCALE_1BPP:S=0,b=1,w=H+7>>3;break;case a.ImageKind.RGB_24BPP:S=2,b=8,w=H*3;break;case a.ImageKind.RGBA_32BPP:S=6,b=8,w=H*4;break;default:throw new Error("invalid format")}const L=new Uint8Array((1+w)*k);let W=0,I=0;for(let B=0;B<k;++B)L[W++]=0,L.set(N.subarray(I,I+w),W),I+=w,W+=w;if(q===a.ImageKind.GRAYSCALE_1BPP&&J){W=0;for(let B=0;B<k;B++){W++;for(let z=0;z<w;z++)L[W++]^=255}}const p=new Uint8Array([H>>24&255,H>>16&255,H>>8&255,H&255,k>>24&255,k>>16&255,k>>8&255,k&255,b,S,0,0,0]),E=G(L),T=R.length+m*3+p.length+E.length,M=new Uint8Array(T);let C=0;return M.set(R,C),C+=R.length,U("IHDR",p,M,C),C+=m+p.length,U("IDATA",E,M,C),C+=m+E.length,U("IEND",new Uint8Array(0),M,C),e(M,"image/png",nt)}return function(q,nt,J){const H=q.kind===void 0?a.ImageKind.GRAYSCALE_1BPP:q.kind;return tt(q,H,nt,J)}})();class h{constructor(){this.fontSizeScale=1,this.fontWeight=f.fontWeight,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.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=f.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(m,x){this.x=m,this.y=x}}function u(R){let m=[];const x=[];for(const O of R){if(O.fn==="save"){m.push({fnId:92,fn:"group",items:[]}),x.push(m),m=m.at(-1).items;continue}O.fn==="restore"?m=x.pop():m.push(O)}return m}function n(R){if(Number.isInteger(R))return R.toString();const m=R.toFixed(10);let x=m.length-1;if(m[x]!=="0")return m;do x--;while(m[x]==="0");return m.substring(0,m[x]==="."?x:x+1)}function l(R){if(R[4]===0&&R[5]===0){if(R[1]===0&&R[2]===0)return R[0]===1&&R[3]===1?"":`scale(${n(R[0])} ${n(R[3])})`;if(R[0]===R[3]&&R[1]===-R[2]){const m=Math.acos(R[0])*180/Math.PI;return`rotate(${n(m)})`}}else if(R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1)return`translate(${n(R[4])} ${n(R[5])})`;return`matrix(${n(R[0])} ${n(R[1])} ${n(R[2])} ${n(R[3])} ${n(R[4])} ${n(R[5])})`}let d=0,c=0,A=0;class F{constructor(m,x){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new h,this.transformMatrix=a.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=m,this.objs=x,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!O,this._operatorIdMapping=[];for(const U in a.OPS)this._operatorIdMapping[a.OPS[U]]=U}getObject(m){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return typeof m=="string"?m.startsWith("g_")?this.commonObjs.get(m):this.objs.get(m):x}save(){this.transformStack.push(this.transformMatrix);const m=this.current;this.extraStack.push(m),this.current=m.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}
4group(m){this.save(),this.executeOpTree(m),this.restore()}loadDependencies(m){const x=m.fnArray,O=m.argsArray;for(let U=0,D=x.length;U<D;U++)if(x[U]===a.OPS.dependency)for(const G of O[U]){const V=G.startsWith("g_")?this.commonObjs:this.objs,tt=new Promise(Z=>{V.get(G,Z)});this.current.dependencies.push(tt)}return Promise.all(this.current.dependencies)}transform(m,x,O,U,D,G){const V=[m,x,O,U,D,G];this.transformMatrix=a.Util.transform(this.transformMatrix,V),this.tgrp=null}getSVG(m,x){this.viewport=x;const O=this._initialize(x);return this.loadDependencies(m).then(()=>(this.transformMatrix=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(m)),O))}convertOpList(m){const x=this._operatorIdMapping,O=m.argsArray,U=m.fnArray,D=[];for(let G=0,V=U.length;G<V;G++){const tt=U[G];D.push({fnId:tt,fn:x[tt],args:O[G]})}return u(D)}executeOpTree(m){for(const x of m){const O=x.fn,U=x.fnId,D=x.args;switch(U|0){case a.OPS.beginText:this.beginText();break;case a.OPS.dependency:break;case a.OPS.setLeading:this.setLeading(D);break;case a.OPS.setLeadingMoveText:this.setLeadingMoveText(D[0],D[1]);break;case a.OPS.setFont:this.setFont(D);break;case a.OPS.showText:this.showText(D[0]);break;case a.OPS.showSpacedText:this.showText(D[0]);break;case a.OPS.endText:this.endText();break;case a.OPS.moveText:this.moveText(D[0],D[1]);break;case a.OPS.setCharSpacing:this.setCharSpacing(D[0]);break;case a.OPS.setWordSpacing:this.setWordSpacing(D[0]);break;case a.OPS.setHScale:this.setHScale(D[0]);break;case a.OPS.setTextMatrix:this.setTextMatrix(D[0],D[1],D[2],D[3],D[4],D[5]);break;case a.OPS.setTextRise:this.setTextRise(D[0]);break;case a.OPS.setTextRenderingMode:this.setTextRenderingMode(D[0]);break;case a.OPS.setLineWidth:this.setLineWidth(D[0]);break;case a.OPS.setLineJoin:this.setLineJoin(D[0]);break;case a.OPS.setLineCap:this.setLineCap(D[0]);break;case a.OPS.setMiterLimit:this.setMiterLimit(D[0]);break;case a.OPS.setFillRGBColor:this.setFillRGBColor(D[0],D[1],D[2]);break;case a.OPS.setStrokeRGBColor:this.setStrokeRGBColor(D[0],D[1],D[2]);break;case a.OPS.setStrokeColorN:this.setStrokeColorN(D);break;case a.OPS.setFillColorN:this.setFillColorN(D);break;case a.OPS.shadingFill:this.shadingFill(D[0]);break;case a.OPS.setDash:this.setDash(D[0],D[1]);break;case a.OPS.setRenderingIntent:this.setRenderingIntent(D[0]);break;case a.OPS.setFlatness:this.setFlatness(D[0]);break;case a.OPS.setGState:this.setGState(D[0]);break;case a.OPS.fill:this.fill();break;case a.OPS.eoFill:this.eoFill();break;case a.OPS.stroke:this.stroke();break;case a.OPS.fillStroke:this.fillStroke();break;case a.OPS.eoFillStroke:this.eoFillStroke();break;case a.OPS.clip:this.clip("nonzero");break;case a.OPS.eoClip:this.clip("evenodd");break;case a.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case a.OPS.paintImageXObject:this.paintImageXObject(D[0]);break;case a.OPS.paintInlineImageXObject:this.paintInlineImageXObject(D[0]);break;case a.OPS.paintImageMaskXObject:this.paintImageMaskXObject(D[0]);break;case a.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(D[0],D[1]);break;case a.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case a.OPS.closePath:this.closePath();break;case a.OPS.closeStroke:this.closeStroke();break;case a.OPS.closeFillStroke:this.closeFillStroke();break;case a.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case a.OPS.nextLine:this.nextLine();break;case a.OPS.transform:this.transform(D[0],D[1],D[2],D[3],D[4],D[5]);break;case a.OPS.constructPath:this.constructPath(D[0],D[1]);break;case a.OPS.endPath:this.endPath();break;case 92:this.group(x.items);break;default:(0,a.warn)(`Unimplemented operator ${O}`);break}}}setWordSpacing(m){this.current.wordSpacing=m}setCharSpacing(m){this.current.charSpacing=m}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(m,x,O,U,D,G){const V=this.current;V.textMatrix=V.lineMatrix=[m,x,O,U,D,G],V.textMatrixScale=Math.hypot(m,x),V.x=V.lineX=0,V.y=V.lineY=0,V.xcoords=[],V.ycoords=[],V.tspan=this.svgFactory.createElement("svg:tspan"),V.tspan.setAttributeNS(null,"font-family",V.fontFamily),V.tspan.setAttributeNS(null,"font-size",`${n(V.fontSize)}px`),V.tspan.setAttributeNS(null,"y",n(-V.y)),V.txtElement=this.svgFactory.createElement("svg:text"),V.txtElement.append(V.tspan)}beginText(){const m=this.current;m.x=m.lineX=0,m.y=m.lineY=0,m.textMatrix=a.IDENTITY_MATRIX,m.lineMatrix=a.IDENTITY_MATRIX,m.textMatrixScale=1,m.tspan=this.svgFactory.createElement("svg:tspan"),m.txtElement=this.svgFactory.createElement("svg:text"),m.txtgrp=this.svgFactory.createElement("svg:g"),m.xcoords=[],m.ycoords=[]}moveText(m,x){const O=this.current;O.x=O.lineX+=m,O.y=O.lineY+=x,O.xcoords=[],O.ycoords=[],O.tspan=this.svgFactory.createElement("svg:tspan"),O.tspan.setAttributeNS(null,"font-family",O.fontFamily),O.tspan.setAttributeNS(null,"font-size",`${n(O.fontSize)}px`),O.tspan.setAttributeNS(null,"y",n(-O.y))}showText(m){const x=this.current,O=x.font,U=x.fontSize;if(U===0)return;const D=x.fontSizeScale,G=x.charSpacing,V=x.wordSpacing,tt=x.fontDirection,Z=x.textHScale*tt,q=O.vertical,nt=q?1:-1,J=O.defaultVMetrics,H=U*x.fontMatrix[0];let k=0;for(const w of m){if(w===null){k+=tt*V;continue}else if(typeof w=="number"){k+=nt*w*U/1e3;continue}const N=(w.isSpace?V:0)+G,L=w.fontChar;let W,I,p=w.width;if(q){let T;const M=w.vmetric||J;T=w.vmetric?M[1]:p*.5,T=-T*H;const C=M[2]*H;p=M?-M[0]:p,W=T/D,I=(k+C)/D}else W=k/D,I=0;(w.isInFont||O.missingFile)&&(x.xcoords.push(x.x+W),q&&x.ycoords.push(-x.y+I),x.tspan.textContent+=L);const E=q?p*H-N*tt:p*H+N*tt;k+=E}x.tspan.setAttributeNS(null,"x",x.xcoords.map(n).join(" ")),q?x.tspan.setAttributeNS(null,"y",x.ycoords.map(n).join(" ")):x.tspan.setAttributeNS(null,"y",n(-x.y)),q?x.y-=k:x.x+=k*Z,x.tspan.setAttributeNS(null,"font-family",x.fontFamily),x.tspan.setAttributeNS(null,"font-size",`${n(x.fontSize)}px`),x.fontStyle!==f.fontStyle&&x.tspan.setAttributeNS(null,"font-style",x.fontStyle),x.fontWeight!==f.fontWeight&&x.tspan.setAttributeNS(null,"font-weight",x.fontWeight);const b=x.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;if(b===a.TextRenderingMode.FILL||b===a.TextRenderingMode.FILL_STROKE?(x.fillColor!==f.fillColor&&x.tspan.setAttributeNS(null,"fill",x.fillColor),x.fillAlpha<1&&x.tspan.setAttributeNS(null,"fill-opacity",x.fillAlpha)):x.textRenderingMode===a.TextRenderingMode.ADD_TO_PATH?x.tspan.setAttributeNS(null,"fill","transparent"):x.tspan.setAttributeNS(null,"fill","none"),b===a.TextRenderingMode.STROKE||b===a.TextRenderingMode.FILL_STROKE){const w=1/(x.textMatrixScale||1);this._setStrokeAttributes(x.tspan,w)}let S=x.textMatrix;x.textRise!==0&&(S=S.slice(),S[5]+=x.textRise),x.txtElement.setAttributeNS(null,"transform",`${l(S)} scale(${n(Z)}, -1)`),x.txtElement.setAttributeNS(g,"xml:space","preserve"),x.txtElement.append(x.tspan),x.txtgrp.append(x.txtElement),this._ensureTransformGroup().append(x.txtElement)}setLeadingMoveText(m,x){this.setLeading(-x),this.moveText(m,x)}addFontStyle(m){if(!m.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 x=e(m.data,m.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${m.loadedName}"; src: url(${x}); } 5`}setFont(m){const x=this.current,O=this.commonObjs.get(m[0]);let U=m[1];x.font=O,this.embedFonts&&!O.missingFile&&!this.embeddedFonts[O.loadedName]&&(this.addFontStyle(O),this.embeddedFonts[O.loadedName]=O),x.fontMatrix=O.fontMatrix||a.FONT_IDENTITY_MATRIX;let D="normal";O.black?D="900":O.bold&&(D="bold");const G=O.italic?"italic":"normal";U<0?(U=-U,x.fontDirection=-1):x.fontDirection=1,x.fontSize=U,x.fontFamily=O.loadedName,x.fontWeight=D,x.fontStyle=G,x.tspan=this.svgFactory.createElement("svg:tspan"),x.tspan.setAttributeNS(null,"y",n(-x.y)),x.xcoords=[],x.ycoords=[]}endText(){const m=this.current;m.textRenderingMode&a.TextRenderingMode.ADD_TO_PATH_FLAG&&m.txtElement?.hasChildNodes()&&(m.element=m.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(m){m>0&&(this.current.lineWidth=m)}setLineCap(m){this.current.lineCap=P[m]}setLineJoin(m){this.current.lineJoin=s[m]}setMiterLimit(m){this.current.miterLimit=m}setStrokeAlpha(m){this.current.strokeAlpha=m}setStrokeRGBColor(m,x,O){this.current.strokeColor=a.Util.makeHexColor(m,x,O)}setFillAlpha(m){this.current.fillAlpha=m}setFillRGBColor(m,x,O){this.current.fillColor=a.Util.makeHexColor(m,x,O),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(m){this.current.strokeColor=this._makeColorN_Pattern(m)}setFillColorN(m){this.current.fillColor=this._makeColorN_Pattern(m)}
5shadingFill(m){const{width:x,height:O}=this.viewport,U=a.Util.inverseTransform(this.transformMatrix),[D,G,V,tt]=a.Util.getAxialAlignedBoundingBox([0,0,x,O],U),Z=this.svgFactory.createElement("svg:rect");Z.setAttributeNS(null,"x",D),Z.setAttributeNS(null,"y",G),Z.setAttributeNS(null,"width",V-D),Z.setAttributeNS(null,"height",tt-G),Z.setAttributeNS(null,"fill",this._makeShadingPattern(m)),this.current.fillAlpha<1&&Z.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(Z)}_makeColorN_Pattern(m){return m[0]==="TilingPattern"?this._makeTilingPattern(m):this._makeShadingPattern(m)}_makeTilingPattern(m){const x=m[1],O=m[2],U=m[3]||a.IDENTITY_MATRIX,[D,G,V,tt]=m[4],Z=m[5],q=m[6],nt=m[7],J=`shading${A++}`,[H,k,b,S]=a.Util.normalizeRect([...a.Util.applyTransform([D,G],U),...a.Util.applyTransform([V,tt],U)]),[w,N]=a.Util.singularValueDecompose2dScale(U),L=Z*w,W=q*N,I=this.svgFactory.createElement("svg:pattern");I.setAttributeNS(null,"id",J),I.setAttributeNS(null,"patternUnits","userSpaceOnUse"),I.setAttributeNS(null,"width",L),I.setAttributeNS(null,"height",W),I.setAttributeNS(null,"x",`${H}`),I.setAttributeNS(null,"y",`${k}`);const p=this.svg,E=this.transformMatrix,T=this.current.fillColor,M=this.current.strokeColor,C=this.svgFactory.create(b-H,S-k);if(this.svg=C,this.transformMatrix=U,nt===2){const B=a.Util.makeHexColor(...x);this.current.fillColor=B,this.current.strokeColor=B}return this.executeOpTree(this.convertOpList(O)),this.svg=p,this.transformMatrix=E,this.current.fillColor=T,this.current.strokeColor=M,I.append(C.childNodes[0]),this.defs.append(I),`url(#${J})`}_makeShadingPattern(m){switch(typeof m=="string"&&(m=this.objs.get(m)),m[0]){case"RadialAxial":const x=`shading${A++}`,O=m[3];let U;switch(m[1]){case"axial":const D=m[4],G=m[5];U=this.svgFactory.createElement("svg:linearGradient"),U.setAttributeNS(null,"id",x),U.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),U.setAttributeNS(null,"x1",D[0]),U.setAttributeNS(null,"y1",D[1]),U.setAttributeNS(null,"x2",G[0]),U.setAttributeNS(null,"y2",G[1]);break;case"radial":const V=m[4],tt=m[5],Z=m[6],q=m[7];U=this.svgFactory.createElement("svg:radialGradient"),U.setAttributeNS(null,"id",x),U.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),U.setAttributeNS(null,"cx",tt[0]),U.setAttributeNS(null,"cy",tt[1]),U.setAttributeNS(null,"r",q),U.setAttributeNS(null,"fx",V[0]),U.setAttributeNS(null,"fy",V[1]),U.setAttributeNS(null,"fr",Z);break;default:throw new Error(`Unknown RadialAxial type: ${m[1]}`)}for(const D of O){const G=this.svgFactory.createElement("svg:stop");G.setAttributeNS(null,"offset",D[0]),G.setAttributeNS(null,"stop-color",D[1]),U.append(G)}return this.defs.append(U),`url(#${x})`;case"Mesh":return(0,a.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${m[0]}`)}}setDash(m,x){this.current.dashArray=m,this.current.dashPhase=x}constructPath(m,x){const O=this.current;let U=O.x,D=O.y,G=[],V=0;for(const tt of m)switch(tt|0){case a.OPS.rectangle:U=x[V++],D=x[V++];const Z=x[V++],q=x[V++],nt=U+Z,J=D+q;G.push("M",n(U),n(D),"L",n(nt),n(D),"L",n(nt),n(J),"L",n(U),n(J),"Z");break;case a.OPS.moveTo:U=x[V++],D=x[V++],G.push("M",n(U),n(D));break;case a.OPS.lineTo:U=x[V++],D=x[V++],G.push("L",n(U),n(D));break;case a.OPS.curveTo:U=x[V+4],D=x[V+5],G.push("C",n(x[V]),n(x[V+1]),n(x[V+2]),n(x[V+3]),n(U),n(D)),V+=6;break;case a.OPS.curveTo2:G.push("C",n(U),n(D),n(x[V]),n(x[V+1]),n(x[V+2]),n(x[V+3])),U=x[V+2],D=x[V+3],V+=4;break;case a.OPS.curveTo3:U=x[V+2],D=x[V+3],G.push("C",n(x[V]),n(x[V+1]),n(U),n(D),n(U),n(D)),V+=4;break;case a.OPS.closePath:G.push("Z");break}G=G.join(" "),O.path&&m.length>0&&m[0]!==a.OPS.rectangle&&m[0]!==a.OPS.moveTo?G=O.path.getAttributeNS(null,"d")+G:(O.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(O.path)),O.path.setAttributeNS(null,"d",G),O.path.setAttributeNS(null,"fill","none"),O.element=O.path,O.setCurrentPoint(U,D)}endPath(){const m=this.current;if(m.path=null,!this.pendingClip)return;if(!m.element){this.pendingClip=null;return}const x=`clippath${d++}`,O=this.svgFactory.createElement("svg:clipPath");O.setAttributeNS(null,"id",x),O.setAttributeNS(null,"transform",l(this.transformMatrix));const U=m.element.cloneNode(!0);if(this.pendingClip==="evenodd"?U.setAttributeNS(null,"clip-rule","evenodd"):U.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,O.append(U),this.defs.append(O),m.activeClipUrl){m.clipGroup=null;for(const D of this.extraStack)D.clipGroup=null;O.setAttributeNS(null,"clip-path",m.activeClipUrl)}m.activeClipUrl=`url(#${x})`,this.tgrp=null}clip(m){this.pendingClip=m}closePath(){const m=this.current;if(m.path){const x=`${m.path.getAttributeNS(null,"d")}Z`;m.path.setAttributeNS(null,"d",x)}}setLeading(m){this.current.leading=-m}setTextRise(m){this.current.textRise=m}setTextRenderingMode(m){this.current.textRenderingMode=m}setHScale(m){this.current.textHScale=m/100}
5setRenderingIntent(m){}setFlatness(m){}setGState(m){for(const[x,O]of m)switch(x){case"LW":this.setLineWidth(O);break;case"LC":this.setLineCap(O);break;case"LJ":this.setLineJoin(O);break;case"ML":this.setMiterLimit(O);break;case"D":this.setDash(O[0],O[1]);break;case"RI":this.setRenderingIntent(O);break;case"FL":this.setFlatness(O);break;case"Font":this.setFont(O);break;case"CA":this.setStrokeAlpha(O);break;case"ca":this.setFillAlpha(O);break;default:(0,a.warn)(`Unimplemented graphic state operator ${x}`);break}}fill(){const m=this.current;m.element&&(m.element.setAttributeNS(null,"fill",m.fillColor),m.element.setAttributeNS(null,"fill-opacity",m.fillAlpha),this.endPath())}stroke(){const m=this.current;m.element&&(this._setStrokeAttributes(m.element),m.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(m){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const O=this.current;let U=O.dashArray;x!==1&&U.length>0&&(U=U.map(function(D){return x*D})),m.setAttributeNS(null,"stroke",O.strokeColor),m.setAttributeNS(null,"stroke-opacity",O.strokeAlpha),m.setAttributeNS(null,"stroke-miterlimit",n(O.miterLimit)),m.setAttributeNS(null,"stroke-linecap",O.lineCap),m.setAttributeNS(null,"stroke-linejoin",O.lineJoin),m.setAttributeNS(null,"stroke-width",n(x*O.lineWidth)+"px"),m.setAttributeNS(null,"stroke-dasharray",U.map(n).join(" ")),m.setAttributeNS(null,"stroke-dashoffset",n(x*O.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const m=this.svgFactory.createElement("svg:rect");m.setAttributeNS(null,"x","0"),m.setAttributeNS(null,"y","0"),m.setAttributeNS(null,"width","1px"),m.setAttributeNS(null,"height","1px"),m.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(m)}paintImageXObject(m){const x=this.getObject(m);if(!x){(0,a.warn)(`Dependent image with object ID ${m} is not ready yet`);return}this.paintInlineImageXObject(x)}paintInlineImageXObject(m,x){const O=m.width,U=m.height,D=i(m,this.forceDataSchema,!!x),G=this.svgFactory.createElement("svg:rect");G.setAttributeNS(null,"x","0"),G.setAttributeNS(null,"y","0"),G.setAttributeNS(null,"width",n(O)),G.setAttributeNS(null,"height",n(U)),this.current.element=G,this.clip("nonzero");const V=this.svgFactory.createElement("svg:image");V.setAttributeNS(y,"xlink:href",D),V.setAttributeNS(null,"x","0"),V.setAttributeNS(null,"y",n(-U)),V.setAttributeNS(null,"width",n(O)+"px"),V.setAttributeNS(null,"height",n(U)+"px"),V.setAttributeNS(null,"transform",`scale(${n(1/O)} ${n(-1/U)})`),x?x.append(V):this._ensureTransformGroup().append(V)}paintImageMaskXObject(m){const x=this.getObject(m.data,m);if(x.bitmap){(0,a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const O=this.current,U=x.width,D=x.height,G=O.fillColor;O.maskId=`mask${c++}`;const V=this.svgFactory.createElement("svg:mask");V.setAttributeNS(null,"id",O.maskId);const tt=this.svgFactory.createElement("svg:rect");tt.setAttributeNS(null,"x","0"),tt.setAttributeNS(null,"y","0"),tt.setAttributeNS(null,"width",n(U)),tt.setAttributeNS(null,"height",n(D)),tt.setAttributeNS(null,"fill",G),tt.setAttributeNS(null,"mask",`url(#${O.maskId})`),this.defs.append(V),this._ensureTransformGroup().append(tt),this.paintInlineImageXObject(x,V)}paintFormXObjectBegin(m,x){if(Array.isArray(m)&&m.length===6&&this.transform(m[0],m[1],m[2],m[3],m[4],m[5]),x){const O=x[2]-x[0],U=x[3]-x[1],D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x",x[0]),D.setAttributeNS(null,"y",x[1]),D.setAttributeNS(null,"width",n(O)),D.setAttributeNS(null,"height",n(U)),this.current.element=D,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(m){const x=this.svgFactory.create(m.width,m.height),O=this.svgFactory.createElement("svg:defs");x.append(O),this.defs=O;const U=this.svgFactory.createElement("svg:g");return U.setAttributeNS(null,"transform",l(m.transform)),x.append(U),this.svg=U,x}_ensureClipGroup(){if(!this.current.clipGroup){const m=this.svgFactory.createElement("svg:g");m.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(m),this.current.clipGroup=m}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",l(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}o.SVGGraphics=F}),((v,o,t)=>{var r=t(3),a=t(188),f=t(193);r({target:"Array",proto:!0},{group:function(y){var P=arguments.length>1?arguments[1]:void 0;return a(this,y,P)}}),f("group")}),((v,o,t)=>{var r=t(99),a=t(14),f=t(13),g=t(40),y=t(18),P=t(64),s=t(189),e=t(108),i=Array,h=a([].push);v.exports=function(u,n,l,d){for(var c=g(u),A=f(c),F=r(n,l),R=s(null),m=P(A),x=0,O,U,D;m>x;x++)D=A[x],U=y(F(D,x,c)),U in R?h(R[U],D):R[U]=[D];if(d&&(O=d(c),O!==i))for(U in R)R[U]=e(O,R[U]);return R}}),((v,o,t)=>{var r=t(47),a=t(190),f=t(66),g=t(55),y=t(192),P=t(43),s=t(54),e=">",i="<",h="prototype",u="script",n=s("IE_PROTO"),l=function(){},d=function(m){return i+u+e+m+i+"/"+u+e},c=function(m){m.write(d("")),m.close();var x=m.parentWindow.Object;return m=null,x},A=function(){var m=P("iframe"),x="java"+u+":",O;return m.style.display="none",y.appendChild(m),m.src=String(x),O=m.contentWindow.document,O.open(),O.write(d("document.F=Object")),O.close(),O.F},F,R=function(){try{F=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&F?c(F):A():c(F);for(var m=f.length;m--;)delete R[h][f[m]];return R()};g[n]=!0,v.exports=Object.create||function(x,O){var U;return x!==null?(l[h]=r(x),U=new l,l[h]=null,U[n]=x):U=R(),O===void 0?U:a.f(U,O)}}),((v,o,t)=>{var r=t(6),a=t(46),f=t(45),g=t(47),y=t(12),P=t(191);o.f=r&&!a?Object.defineProperties:function(e,i){g(e);for(var h=y(i),u=P(i),n=u.length,l=0,d;n>l;)f.f(e,d=u[l++],h[d]);return e}}),((v,o,t)=>{var r=t(59),a=t(66);v.exports=Object.keys||function(g){return r(g,a)}}),((v,o,t)=>{var r=t(24);v.exports=r("document","documentElement")}),((v,o,t)=>{var r=t(34),a=t(189),f=t(45).f,g=r("unscopables"),y=Array.prototype;y[g]===void 0&&f(y,g,{configurable:!0,value:a(null)}),v.exports=function(P){y[g][P]=!0}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.XfaText=void 0,t(89);class r{static textContent(f){const g=[],y={items:g,styles:Object.create(null)};function P(s){if(!s)return;let e=null;const i=s.name;if(i==="#text")e=s.value;else if(r.shouldBuildText(i))s?.attributes?.textContent?e=s.attributes.textContent:s.value&&(e=s.value);else return;if(e!==null&&g.push({str:e}),!!s.children)for(const h of s.children)P(h)}return P(f),y}static shouldBuildText(f){return!(f==="textarea"||f==="input"||f==="option"||f==="select")}}o.XfaText=r}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextLayerRenderTask=void 0,o.renderTextLayer=l,o.updateTextLayer=d,t(89),t(2);var r=t(1),a=t(168);const f=1e5,g=30,y=.8,P=new Map;function s(c,A){let F;if(A&&r.FeatureTest.isOffscreenCanvasSupported)F=new OffscreenCanvas(c,c).getContext("2d",{alpha:!1});else{const R=document.createElement("canvas");R.width=R.height=c,F=R.getContext("2d",{alpha:!1})}return F}function e(c,A){const F=P.get(c);if(F)return F;const R=s(g,A);R.font=`${g}px ${c}`;const m=R.measureText("");let x=m.fontBoundingBoxAscent,O=Math.abs(m.fontBoundingBoxDescent);if(x){const D=x/(x+O);return P.set(c,D),R.canvas.width=R.canvas.height=0,D}R.strokeStyle="red",R.clearRect(0,0,g,g),R.strokeText("g",0,0);let U=R.getImageData(0,0,g,g).data;O=0;for(let D=U.length-1-3;D>=0;D-=4)if(U[D]>0){O=Math.ceil(D/4/g);break}R.clearRect(0,0,g,g),R.strokeText("A",0,g),U=R.getImageData(0,0,g,g).data,x=0;for(let D=0,G=U.length;D<G;D+=4)if(U[D]>0){x=g-Math.floor(D/4/g);break}if(R.canvas.width=R.canvas.height=0,x){const D=x/(x+O);return P.set(c,D),D}return P.set(c,y),y}function i(c,A,F){const R=document.createElement("span"),m={angle:0,canvasWidth:0,hasText:A.str!=="",hasEOL:A.hasEOL,fontSize:0};c._textDivs.push(R);const x=r.Util.transform(c._transform,A.transform);let O=Math.atan2(x[1],x[0]);const U=F[A.fontName];U.vertical&&(O+=Math.PI/2);const D=Math.hypot(x[2],x[3]),G=D*e(U.fontFamily,c._isOffscreenCanvasSupported);let V,tt;
5O===0?(V=x[4],tt=x[5]-G):(V=x[4]+G*Math.sin(O),tt=x[5]-G*Math.cos(O));const Z="calc(var(--scale-factor)*",q=R.style;c._container===c._rootContainer?(q.left=`${(100*V/c._pageWidth).toFixed(2)}%`,q.top=`${(100*tt/c._pageHeight).toFixed(2)}%`):(q.left=`${Z}${V.toFixed(2)}px)`,q.top=`${Z}${tt.toFixed(2)}px)`),q.fontSize=`${Z}${D.toFixed(2)}px)`,q.fontFamily=U.fontFamily,m.fontSize=D,R.setAttribute("role","presentation"),R.textContent=A.str,R.dir=A.dir,c._fontInspectorEnabled&&(R.dataset.fontName=A.fontName),O!==0&&(m.angle=O*(180/Math.PI));let nt=!1;if(A.str.length>1)nt=!0;else if(A.str!==" "&&A.transform[0]!==A.transform[3]){const J=Math.abs(A.transform[0]),H=Math.abs(A.transform[3]);J!==H&&Math.max(J,H)/Math.min(J,H)>1.5&&(nt=!0)}nt&&(m.canvasWidth=U.vertical?A.height:A.width),c._textDivProperties.set(R,m),c._isReadableStream&&c._layoutText(R)}function h(c){const{div:A,scale:F,properties:R,ctx:m,prevFontSize:x,prevFontFamily:O}=c,{style:U}=A;let D="";if(R.canvasWidth!==0&&R.hasText){const{fontFamily:G}=U,{canvasWidth:V,fontSize:tt}=R;(x!==tt||O!==G)&&(m.font=`${tt*F}px ${G}`,c.prevFontSize=tt,c.prevFontFamily=G);const{width:Z}=m.measureText(A.textContent);Z>0&&(D=`scaleX(${V*F/Z})`)}R.angle!==0&&(D=`rotate(${R.angle}deg) ${D}`),D.length>0&&(U.transform=D)}function u(c){if(c._canceled)return;const A=c._textDivs,F=c._capability;if(A.length>f){F.resolve();return}if(!c._isReadableStream)for(const m of A)c._layoutText(m);F.resolve()}class n{constructor(A){let{textContentSource:F,container:R,viewport:m,textDivs:x,textDivProperties:O,textContentItemsStr:U,isOffscreenCanvasSupported:D}=A;this._textContentSource=F,this._isReadableStream=F instanceof ReadableStream,this._container=this._rootContainer=R,this._textDivs=x||[],this._textContentItemsStr=U||[],this._isOffscreenCanvasSupported=D,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=O||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:m.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:s(0,D)};const{pageWidth:G,pageHeight:V,pageX:tt,pageY:Z}=m.rawDims;this._transform=[1,0,0,-1,-tt,Z+V],this._pageWidth=G,this._pageHeight=V,(0,a.setLayerDimensions)(R,m),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(A,F){for(const R of A){if(R.str===void 0){if(R.type==="beginMarkedContentProps"||R.type==="beginMarkedContent"){const m=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),R.id!==null&&this._container.setAttribute("id",`${R.id}`),m.append(this._container)}else R.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(R.str),i(this,R,F)}}_layoutText(A){const F=this._layoutTextParams.properties=this._textDivProperties.get(A);if(this._layoutTextParams.div=A,h(this._layoutTextParams),F.hasText&&this._container.append(A),F.hasEOL){const R=document.createElement("br");R.setAttribute("role","presentation"),this._container.append(R)}}_render(){const A=new r.PromiseCapability;let F=Object.create(null);if(this._isReadableStream){const R=()=>{this._reader.read().then(m=>{let{value:x,done:O}=m;if(O){A.resolve();return}Object.assign(F,x.styles),this._processItems(x.items,F),R()},A.reject)};this._reader=this._textContentSource.getReader(),R()}else if(this._textContentSource){const{items:R,styles:m}=this._textContentSource;this._processItems(R,m),A.resolve()}else throw new Error('No "textContentSource" parameter specified.');A.promise.then(()=>{F=null,u(this)},this._capability.reject)}}o.TextLayerRenderTask=n;function l(c){!c.textContentSource&&(c.textContent||c.textContentStream)&&((0,a.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),c.textContentSource=c.textContent||c.textContentStream);const{container:A,viewport:F}=c,R=getComputedStyle(A),m=R.getPropertyValue("visibility"),x=parseFloat(R.getPropertyValue("--scale-factor"));m==="visible"&&(!x||Math.abs(x-F.scale)>1e-5);const O=new n(c);return O._render(),O}function d(c){let{container:A,viewport:F,textDivs:R,textDivProperties:m,isOffscreenCanvasSupported:x,mustRotate:O=!0,mustRescale:U=!0}=c;if(O&&(0,a.setLayerDimensions)(A,{rotation:F.rotation}),U){const D=s(0,x),V={prevFontSize:null,prevFontFamily:null,div:null,scale:F.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:D};for(const tt of R)V.properties=m.get(tt),V.div=tt,h(V)}}}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AnnotationEditorLayer=void 0,t(125),t(136),t(138),t(141),t(143),t(145),t(147);var r=t(1),a=t(164),f=t(197),g=t(202),y=t(168),P=t(203);class s{#t;#e=!1;#n=null;#r=this.pointerup.bind(this);#o=this.pointerdown.bind(this);#a=new Map;#i=!1;#l=!1;#c=!1;#s;static _initialized=!1;constructor(i){let{uiManager:h,pageIndex:u,div:n,accessibilityManager:l,annotationLayer:d,viewport:c,l10n:A}=i;const F=[f.FreeTextEditor,g.InkEditor,P.StampEditor];if(!s._initialized){s._initialized=!0;for(const R of F)R.initialize(A)}
5h.registerEditorTypes(F),this.#s=h,this.pageIndex=u,this.div=n,this.#t=l,this.#n=d,this.viewport=c,this.#s.addLayer(this)}get isEmpty(){return this.#a.size===0}updateToolbar(i){this.#s.updateToolbar(i)}updateMode(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.#s.getMode();this.#p(),i===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),i!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",i===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",i===r.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",i===r.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(i){if(!i&&this.#s.getMode()!==r.AnnotationEditorType.INK)return;if(!i){for(const u of this.#a.values())if(u.isEmpty()){u.setInBackground();return}}this.#u({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(i){this.#s.setEditingState(i)}addCommands(i){this.#s.addCommands(i)}enable(){this.div.style.pointerEvents="auto";const i=new Set;for(const u of this.#a.values())u.enableEditing(),u.annotationElementId&&i.add(u.annotationElementId);if(!this.#n)return;const h=this.#n.getEditableAnnotations();for(const u of h){if(u.hide(),this.#s.isDeletedAnnotationElement(u.data.id)||i.has(u.data.id))continue;const n=this.deserialize(u);n&&(this.addOrRebuild(n),n.enableEditing())}}disable(){this.#c=!0,this.div.style.pointerEvents="none";const i=new Set;for(const h of this.#a.values()){if(h.disableEditing(),!h.annotationElementId||h.serialize()!==null){i.add(h.annotationElementId);continue}this.getEditableAnnotation(h.annotationElementId)?.show(),h.remove()}if(this.#n){const h=this.#n.getEditableAnnotations();for(const u of h){const{id:n}=u.data;i.has(n)||this.#s.isDeletedAnnotationElement(n)||u.show()}}this.#p(),this.isEmpty&&(this.div.hidden=!0),this.#c=!1}getEditableAnnotation(i){return this.#n?.getEditableAnnotation(i)||null}setActiveEditor(i){this.#s.getActive()!==i&&this.#s.setActiveEditor(i)}enableClick(){this.div.addEventListener("pointerdown",this.#o),this.div.addEventListener("pointerup",this.#r)}disableClick(){this.div.removeEventListener("pointerdown",this.#o),this.div.removeEventListener("pointerup",this.#r)}attach(i){this.#a.set(i.id,i);const{annotationElementId:h}=i;h&&this.#s.isDeletedAnnotationElement(h)&&this.#s.removeDeletedAnnotationElement(i)}detach(i){this.#a.delete(i.id),this.#t?.removePointerInTextLayer(i.contentDiv),!this.#c&&i.annotationElementId&&this.#s.addDeletedAnnotationElement(i)}remove(i){this.detach(i),this.#s.removeEditor(i),i.div.contains(document.activeElement)&&setTimeout(()=>{this.#s.focusMainContainer()},0),i.div.remove(),i.isAttachedToDOM=!1,this.#l||this.addInkEditorIfNeeded(!1)}changeParent(i){i.parent!==this&&(i.annotationElementId&&(this.#s.addDeletedAnnotationElement(i.annotationElementId),a.AnnotationEditor.deleteAnnotationElement(i),i.annotationElementId=null),this.attach(i),i.parent?.detach(i),i.setParent(this),i.div&&i.isAttachedToDOM&&(i.div.remove(),this.div.append(i.div)))}add(i){if(this.changeParent(i),this.#s.addEditor(i),this.attach(i),!i.isAttachedToDOM){const h=i.render();this.div.append(h),i.isAttachedToDOM=!0}i.fixAndSetPosition(),i.onceAdded(),this.#s.addToAnnotationStorage(i)}moveEditorInDOM(i){if(!i.isAttachedToDOM)return;const{activeElement:h}=document;i.div.contains(h)&&(i._focusEventsAllowed=!1,setTimeout(()=>{i.div.contains(document.activeElement)?i._focusEventsAllowed=!0:(i.div.addEventListener("focusin",()=>{i._focusEventsAllowed=!0},{once:!0}),h.focus())},0)),i._structTreeParentId=this.#t?.moveElementInDOM(this.div,i.div,i.contentDiv,!0)}addOrRebuild(i){i.needsToBeRebuilt()?i.rebuild():this.add(i)}addUndoableEditor(i){const h=()=>i._uiManager.rebuild(i),u=()=>{i.remove()};this.addCommands({cmd:h,undo:u,mustExec:!1})}getNextId(){return this.#s.getId()}#f(i){switch(this.#s.getMode()){case r.AnnotationEditorType.FREETEXT:return new f.FreeTextEditor(i);case r.AnnotationEditorType.INK:return new g.InkEditor(i);case r.AnnotationEditorType.STAMP:return new P.StampEditor(i)}return null}pasteEditor(i,h){this.#s.updateToolbar(i),this.#s.updateMode(i);const{offsetX:u,offsetY:n}=this.#d(),l=this.getNextId(),d=this.#f({parent:this,id:l,x:u,y:n,uiManager:this.#s,isCentered:!0,...h});d&&this.add(d)}deserialize(i){switch(i.annotationType??i.annotationEditorType){case r.AnnotationEditorType.FREETEXT:return f.FreeTextEditor.deserialize(i,this,this.#s);case r.AnnotationEditorType.INK:return g.InkEditor.deserialize(i,this,this.#s);
5case r.AnnotationEditorType.STAMP:return P.StampEditor.deserialize(i,this,this.#s)}return null}#u(i,h){const u=this.getNextId(),n=this.#f({parent:this,id:u,x:i.offsetX,y:i.offsetY,uiManager:this.#s,isCentered:h});return n&&this.add(n),n}#d(){const{x:i,y:h,width:u,height:n}=this.div.getBoundingClientRect(),l=Math.max(0,i),d=Math.max(0,h),c=Math.min(window.innerWidth,i+u),A=Math.min(window.innerHeight,h+n),F=(l+c)/2-i,R=(d+A)/2-h,[m,x]=this.viewport.rotation%180===0?[F,R]:[R,F];return{offsetX:m,offsetY:x}}addNewEditor(){this.#u(this.#d(),!0)}setSelected(i){this.#s.setSelected(i)}toggleSelected(i){this.#s.toggleSelected(i)}isSelected(i){return this.#s.isSelected(i)}unselect(i){this.#s.unselect(i)}pointerup(i){const{isMac:h}=r.FeatureTest.platform;if(!(i.button!==0||i.ctrlKey&&h)&&i.target===this.div&&this.#i){if(this.#i=!1,!this.#e){this.#e=!0;return}if(this.#s.getMode()===r.AnnotationEditorType.STAMP){this.#s.unselectAll();return}this.#u(i,!1)}}pointerdown(i){if(this.#i){this.#i=!1;return}const{isMac:h}=r.FeatureTest.platform;if(i.button!==0||i.ctrlKey&&h||i.target!==this.div)return;this.#i=!0;const u=this.#s.getActive();this.#e=!u||u.isEmpty()}findNewParent(i,h,u){const n=this.#s.findParent(h,u);return n===null||n===this?!1:(n.changeParent(i),!0)}destroy(){this.#s.getActive()?.parent===this&&(this.#s.commitOrRemove(),this.#s.setActiveEditor(null));for(const i of this.#a.values())this.#t?.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,this.#a.clear(),this.#s.removeLayer(this)}#p(){this.#l=!0;for(const i of this.#a.values())i.isEmpty()&&i.remove();this.#l=!1}render(i){let{viewport:h}=i;this.viewport=h,(0,y.setLayerDimensions)(this.div,h);for(const u of this.#s.getEditors(this.pageIndex))this.add(u);this.updateMode()}update(i){let{viewport:h}=i;this.#s.commitOrRemove(),this.viewport=h,(0,y.setLayerDimensions)(this.div,{rotation:h.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:i,pageHeight:h}=this.viewport.rawDims;return[i,h]}}o.AnnotationEditorLayer=s}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FreeTextEditor=void 0,t(89);var r=t(1),a=t(165),f=t(164),g=t(198);class y extends f.AnnotationEditor{#t=this.editorDivBlur.bind(this);#e=this.editorDivFocus.bind(this);#n=this.editorDivInput.bind(this);#r=this.editorDivKeydown.bind(this);#o;#a="";#i=`${this.id}-editor`;#l;#c=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const s=y.prototype,e=u=>u.isEmpty(),i=a.AnnotationEditorUIManager.TRANSLATE_SMALL,h=a.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new a.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],s.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],s.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],s._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],s._translateEmpty,{args:[-h,0],checker:e}],[["ArrowRight","mac+ArrowRight"],s._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],s._translateEmpty,{args:[h,0],checker:e}],[["ArrowUp","mac+ArrowUp"],s._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],s._translateEmpty,{args:[0,-h],checker:e}],[["ArrowDown","mac+ArrowDown"],s._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],s._translateEmpty,{args:[0,h],checker:e}]]))}static _type="freetext";constructor(s){super({...s,name:"freeTextEditor"}),this.#o=s.color||y._defaultColor||f.AnnotationEditor._defaultLineColor,this.#l=s.fontSize||y._defaultFontSize}static initialize(s){f.AnnotationEditor.initialize(s,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(s,e){switch(s){case r.AnnotationEditorParamsType.FREETEXT_SIZE:y._defaultFontSize=e;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:y._defaultColor=e;break}}updateParams(s,e){switch(s){case r.AnnotationEditorParamsType.FREETEXT_S
5IZE:this.#s(e);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#f(e);break}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,y._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,y._defaultColor||f.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#l],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#o]]}#s(s){const e=h=>{this.editorDiv.style.fontSize=`calc(${h}px * var(--scale-factor))`,this.translate(0,-(h-this.#l)*this.parentScale),this.#l=h,this.#d()},i=this.#l;this.addCommands({cmd:()=>{e(s)},undo:()=>{e(i)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#f(s){const e=this.#o;this.addCommands({cmd:()=>{this.#o=this.editorDiv.style.color=s},undo:()=>{this.#o=this.editorDiv.style.color=e},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(s,e){this._uiManager.translateSelectedEditors(s,e,!0)}getInitialTranslation(){const s=this.parentScale;return[-y._internalPadding*s,-(y._internalPadding+this.#l)*s]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#r),this.editorDiv.addEventListener("focus",this.#e),this.editorDiv.addEventListener("blur",this.#t),this.editorDiv.addEventListener("input",this.#n))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#i),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#r),this.editorDiv.removeEventListener("focus",this.#e),this.editorDiv.removeEventListener("blur",this.#t),this.editorDiv.removeEventListener("input",this.#n),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(s){this._focusEventsAllowed&&(super.focusin(s),s.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){if(this.width){this.#m();return}this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#u(){const s=this.editorDiv.getElementsByTagName("div");if(s.length===0)return this.editorDiv.innerText;const e=[];for(const i of s)e.push(i.innerText.replace(/\r\n?|\n/,""));return e.join(` 6`)}#d(){const[s,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:h,div:u}=this,n=u.style.display;u.style.display="hidden",h.div.append(this.div),i=u.getBoundingClientRect(),u.remove(),u.style.display=n}this.rotation%180===this.parentRotation%180?(this.width=i.width/s,this.height=i.height/e):(this.width=i.height/s,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const s=this.#a,e=this.#a=this.#u().trimEnd();if(s===e)return;const i=h=>{if(this.#a=h,!h){this.remove();return}this.#p(),this._uiManager.rebuild(this),this.#d()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(s)},mustExec:!1}),this.#d()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(s){this.enterInEditMode()}keydown(s){s.target===this.div&&s.key==="Enter"&&(this.enterInEditMode(),s.preventDefault())}editorDivKeydown(s){y._keyboardManager.exec(this,s)}editorDivFocus(s){this.isEditing=!0}editorDivBlur(s){this.isEditing=!1}editorDivInput(s){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)}
6render(){if(this.div)return this.div;let s,e;this.width&&(s=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#i),this.enableEditing(),f.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(h=>this.editorDiv?.setAttribute("aria-label",h)),f.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(h=>this.editorDiv?.setAttribute("default-content",h)),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#l}px * var(--scale-factor))`,i.color=this.#o,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,a.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[h,u]=this.parentDimensions;if(this.annotationElementId){const{position:n}=this.#c;let[l,d]=this.getInitialTranslation();[l,d]=this.pageTranslationToScreen(l,d);const[c,A]=this.pageDimensions,[F,R]=this.pageTranslation;let m,x;switch(this.rotation){case 0:m=s+(n[0]-F)/c,x=e+this.height-(n[1]-R)/A;break;case 90:m=s+(n[0]-F)/c,x=e-(n[1]-R)/A,[l,d]=[d,-l];break;case 180:m=s-this.width+(n[0]-F)/c,x=e-(n[1]-R)/A,[l,d]=[-l,-d];break;case 270:m=s+(n[0]-F-this.height*A)/c,x=e+(n[1]-R-this.width*c)/A,[l,d]=[-d,l];break}this.setAt(m*h,x*u,l,d)}else this.setAt(s*h,e*u,this.width*h,this.height*u);this.#p(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}#p(){if(this.editorDiv.replaceChildren(),!!this.#a)for(const s of this.#a.split(` 7`)){const e=document.createElement("div");e.append(s?document.createTextNode(s):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(s,e,i){let h=null;if(s instanceof g.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:n,fontColor:l},rect:d,rotation:c,id:A},textContent:F,textPosition:R,parent:{page:{pageNumber:m}}}=s;if(!F||F.length===0)return null;h=s={annotationType:r.AnnotationEditorType.FREETEXT,color:Array.from(l),fontSize:n,value:F.join(` 8`),position:R,pageIndex:m-1,rect:d,rotation:c,id:A,deleted:!1}}const u=super.deserialize(s,e,i);return u.#l=s.fontSize,u.#o=r.Util.makeHexColor(...s.color),u.#a=s.value,u.annotationElementId=s.id||null,u.#c=h,u}serialize(){let s=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 e=y._internalPadding*this.parentScale,i=this.getRect(e,e),h=f.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#o),u={annotationType:r.AnnotationEditorType.FREETEXT,color:h,fontSize:this.#l,value:this.#a,pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return s?u:this.annotationElementId&&!this.#v(u)?null:(u.id=this.annotationElementId,u)}#v(s){const{value:e,fontSize:i,color:h,rect:u,pageIndex:n}=this.#c;return s.value!==e||s.fontSize!==i||s.rect.some((l,d)=>Math.abs(l-u[d])>=1)||s.color.some((l,d)=>l!==h[d])||s.pageIndex!==n}#m(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.annotationElementId)return;if(this.#d(),!s&&(this.width===0||this.height===0)){setTimeout(()=>this.#m(!0),0);return}const e=y._internalPadding*this.parentScale;this.#c.rect=this.getRect(e,e)}}o.FreeTextEditor=y}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StampAnnotationElement=o.InkAnnotationElement=o.FreeTextAnnotationElement=o.AnnotationLayer=void 0,t(89),t(125),t(136),t(138),t(141),t(143),t(145),t(147);var r=t(1),a=t(168),f=t(163),g=t(199),y=t(200),P=t(201);const s=1e3,e=9,i=new WeakSet;function h(I){return{width:I[2]-I[0],height:I[3]-I[1]}}class u{static create(p){switch(p.data.annotationType){case r.AnnotationType.LINK:return new l(p);case r.AnnotationType.TEXT:return new d(p);case r.AnnotationType.WIDGET:switch(p.data.fieldType){case"Tx":return new A(p);
8case"Btn":return p.data.radioButton?new m(p):p.data.checkBox?new R(p):new x(p);case"Ch":return new O(p);case"Sig":return new F(p)}return new c(p);case r.AnnotationType.POPUP:return new U(p);case r.AnnotationType.FREETEXT:return new G(p);case r.AnnotationType.LINE:return new V(p);case r.AnnotationType.SQUARE:return new tt(p);case r.AnnotationType.CIRCLE:return new Z(p);case r.AnnotationType.POLYLINE:return new q(p);case r.AnnotationType.CARET:return new J(p);case r.AnnotationType.INK:return new H(p);case r.AnnotationType.POLYGON:return new nt(p);case r.AnnotationType.HIGHLIGHT:return new k(p);case r.AnnotationType.UNDERLINE:return new b(p);case r.AnnotationType.SQUIGGLY:return new S(p);case r.AnnotationType.STRIKEOUT:return new w(p);case r.AnnotationType.STAMP:return new N(p);case r.AnnotationType.FILEATTACHMENT:return new L(p);default:return new n(p)}}}class n{#t=!1;constructor(p){let{isRenderable:E=!1,ignoreBorder:T=!1,createQuadrilaterals:M=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.isRenderable=E,this.data=p.data,this.layer=p.layer,this.linkService=p.linkService,this.downloadManager=p.downloadManager,this.imageResourcesPath=p.imageResourcesPath,this.renderForms=p.renderForms,this.svgFactory=p.svgFactory,this.annotationStorage=p.annotationStorage,this.enableScripting=p.enableScripting,this.hasJSActions=p.hasJSActions,this._fieldObjects=p.fieldObjects,this.parent=p.parent,E&&(this.container=this._createContainer(T)),M&&this._createQuadrilaterals()}static _hasPopupData(p){let{titleObj:E,contentsObj:T,richText:M}=p;return!!(E?.str||T?.str||M?.str)}get hasPopupData(){return n._hasPopupData(this.data)}_createContainer(p){const{data:E,parent:{page:T,viewport:M}}=this,C=document.createElement("section");C.setAttribute("data-annotation-id",E.id),this instanceof c||(C.tabIndex=s),C.style.zIndex=this.parent.zIndex++,this.data.popupRef&&C.setAttribute("aria-haspopup","dialog"),E.noRotate&&C.classList.add("norotate");const{pageWidth:B,pageHeight:z,pageX:_,pageY:it}=M.rawDims;if(!E.rect||this instanceof U){const{rotation:rt}=E;return!E.hasOwnCanvas&&rt!==0&&this.setRotation(rt,C),C}const{width:K,height:Q}=h(E.rect),j=r.Util.normalizeRect([E.rect[0],T.view[3]-E.rect[1]+T.view[1],E.rect[2],T.view[3]-E.rect[3]+T.view[1]]);if(!p&&E.borderStyle.width>0){C.style.borderWidth=`${E.borderStyle.width}px`;const rt=E.borderStyle.horizontalCornerRadius,lt=E.borderStyle.verticalCornerRadius;if(rt>0||lt>0){const dt=`calc(${rt}px * var(--scale-factor)) / calc(${lt}px * var(--scale-factor))`;C.style.borderRadius=dt}else if(this instanceof m){const dt=`calc(${K}px * var(--scale-factor)) / calc(${Q}px * var(--scale-factor))`;C.style.borderRadius=dt}switch(E.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:C.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:C.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:C.style.borderBottomStyle="solid";break}const ht=E.borderColor||null;ht?(this.#t=!0,C.style.borderColor=r.Util.makeHexColor(ht[0]|0,ht[1]|0,ht[2]|0)):C.style.borderWidth=0}C.style.left=`${100*(j[0]-_)/B}%`,C.style.top=`${100*(j[1]-it)/z}%`;const{rotation:et}=E;return E.hasOwnCanvas||et===0?(C.style.width=`${100*K/B}%`,C.style.height=`${100*Q/z}%`):this.setRotation(et,C),C}setRotation(p){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:T,pageHeight:M}=this.parent.viewport.rawDims,{width:C,height:B}=h(this.data.rect);let z,_;p%180===0?(z=100*C/T,_=100*B/M):(z=100*B/T,_=100*C/M),E.style.width=`${z}%`,E.style.height=`${_}%`,E.setAttribute("data-main-rotation",(360-p)%360)}get _commonActions(){const p=(E,T,M)=>{const C=M.detail[E],B=C[0],z=C.slice(1);M.target.style[T]=g.ColorConverters[`${B}_HTML`](z),this.annotationStorage.setValue(this.data.id,{[T]:g.ColorConverters[`${B}_rgb`](z)})};return(0,r.shadow)(this,"_commonActions",{display:E=>{const{display:T}=E.detail,M=T%2===1;this.container.style.visibility=M?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:M,noPrint:T===1||T===2})},print:E=>{this.annotationStorage.setValue(this.data.id,{noPrint:!E.detail.print})},hidden:E=>{const{hidden:T}=E.detail;this.container.style.visibility=T?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:T,noView:T})},focus:E=>{setTimeout(()=>
8E.target.focus({preventScroll:!1}),0)},userName:E=>{E.target.title=E.detail.userName},readonly:E=>{E.target.disabled=E.detail.readonly},required:E=>{this._setRequired(E.target,E.detail.required)},bgColor:E=>{p("bgColor","backgroundColor",E)},fillColor:E=>{p("fillColor","backgroundColor",E)},fgColor:E=>{p("fgColor","color",E)},textColor:E=>{p("textColor","color",E)},borderColor:E=>{p("borderColor","borderColor",E)},strokeColor:E=>{p("strokeColor","borderColor",E)},rotation:E=>{const T=E.detail.rotation;this.setRotation(T),this.annotationStorage.setValue(this.data.id,{rotation:T})}})}_dispatchEventFromSandbox(p,E){const T=this._commonActions;for(const M of Object.keys(E.detail))(p[M]||T[M])?.(E)}_setDefaultPropertiesFromJS(p){if(!this.enableScripting)return;const E=this.annotationStorage.getRawValue(this.data.id);if(!E)return;const T=this._commonActions;for(const[M,C]of Object.entries(E)){const B=T[M];if(B){const z={detail:{[M]:C},target:p};B(z),delete E[M]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:p}=this.data;if(!p)return;const[E,T,M,C]=this.data.rect;if(p.length===1){const[,{x:lt,y:ht},{x:dt,y:gt}]=p[0];if(M===lt&&C===ht&&E===dt&&T===gt)return}const{style:B}=this.container;let z;if(this.#t){const{borderColor:lt,borderWidth:ht}=B;B.borderWidth=0,z=["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="${lt}" stroke-width="${ht}">`],this.container.classList.add("hasBorder")}const _=M-E,it=C-T,{svgFactory:K}=this,Q=K.createElement("svg");Q.classList.add("quadrilateralsContainer"),Q.setAttribute("width",0),Q.setAttribute("height",0);const j=K.createElement("defs");Q.append(j);const et=K.createElement("clipPath"),rt=`clippath_${this.data.id}`;et.setAttribute("id",rt),et.setAttribute("clipPathUnits","objectBoundingBox"),j.append(et);for(const[,{x:lt,y:ht},{x:dt,y:gt}]of p){const mt=K.createElement("rect"),St=(dt-E)/_,Tt=(C-ht)/it,wt=(lt-dt)/_,Ot=(ht-gt)/it;mt.setAttribute("x",St),mt.setAttribute("y",Tt),mt.setAttribute("width",wt),mt.setAttribute("height",Ot),et.append(mt),z?.push(`<rect vector-effect="non-scaling-stroke" x="${St}" y="${Tt}" width="${wt}" height="${Ot}"/>`)}this.#t&&(z.push("</g></svg>')"),B.backgroundImage=z.join("")),this.container.append(Q),this.container.style.clipPath=`url(#${rt})`}_createPopup(){const{container:p,data:E}=this;p.setAttribute("aria-haspopup","dialog");const T=new U({data:{color:E.color,titleObj:E.titleObj,modificationDate:E.modificationDate,contentsObj:E.contentsObj,richText:E.richText,parentRect:E.rect,borderStyle:0,id:`popup_${E.id}`,rotation:E.rotation},parent:this.parent,elements:[this]});this.parent.div.append(T.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(p){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const T=[];if(this._fieldObjects){const M=this._fieldObjects[p];if(M)for(const{page:C,id:B,exportValues:z}of M){if(C===-1||B===E)continue;const _=typeof z=="string"?z:null,it=document.querySelector(`[data-element-id="${B}"]`);if(it&&!i.has(it)){(0,r.warn)(`_getElementsByName - element not allowed: ${B}`);continue}T.push({id:B,exportValue:_,domElement:it})}return T}for(const M of document.getElementsByName(p)){const{exportValue:C}=M,B=M.getAttribute("data-element-id");B!==E&&i.has(M)&&T.push({id:B,exportValue:C,domElement:M})}return T}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const p=this.getElementsToTriggerPopup();if(Array.isArray(p))for(const E of p)E.classList.add("highlightArea");else p.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:p,data:{id:E}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:p,editId:E})})}}class l extends n{constructor(p){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;super(p,{isRenderable:!0,ignoreBorder:!!E?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=p.data.isTooltipOnly}render(){const{data:p,linkService:E}=this,T=document.createElement("a");T.setAttribute("data-element-id",p.id);let M=!1;return p.url?(E.addLinkAttributes(T,p.url,p.newWindow),M=!0):p.action?(this._bindNamedAction(T,p.action),M=!0):p.attachment?(this._bindAttachment(T,p.attachment),M=!0):p.setOCGState?(this.#e(T,p.setOCGState),M=!0):p.dest?(this._bindLink(T,p.dest),M=!0):(p.actions&&(p.actions.Action||p.actions["Mouse Up"]||p.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(T,p),M=!0),p.resetForm?(this._bindResetFormAction(T,p.resetForm),M=!0):this.isTooltipOnly&&!M&&(this._bindLink(T,""),M=!0)),this.container.classList.add("linkA
8nnotation"),M&&this.container.append(T),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(p,E){p.href=this.linkService.getDestinationHash(E),p.onclick=()=>(E&&this.linkService.goToDestination(E),!1),(E||E==="")&&this.#t()}_bindNamedAction(p,E){p.href=this.linkService.getAnchorUrl(""),p.onclick=()=>(this.linkService.executeNamedAction(E),!1),this.#t()}_bindAttachment(p,E){p.href=this.linkService.getAnchorUrl(""),p.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,E.content,E.filename),!1),this.#t()}#e(p,E){p.href=this.linkService.getAnchorUrl(""),p.onclick=()=>(this.linkService.executeSetOCGState(E),!1),this.#t()}_bindJSAction(p,E){p.href=this.linkService.getAnchorUrl("");const T=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const M of Object.keys(E.actions)){const C=T.get(M);C&&(p[C]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E.id,name:M}}),!1))}p.onclick||(p.onclick=()=>!1),this.#t()}_bindResetFormAction(p,E){const T=p.onclick;if(T||(p.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),T||(p.onclick=()=>!1);return}p.onclick=()=>{T?.();const{fields:M,refs:C,include:B}=E,z=[];if(M.length!==0||C.length!==0){const K=new Set(C);for(const Q of M){const j=this._fieldObjects[Q]||[];for(const{id:et}of j)K.add(et)}for(const Q of Object.values(this._fieldObjects))for(const j of Q)K.has(j.id)===B&&z.push(j)}else for(const K of Object.values(this._fieldObjects))z.push(...K);const _=this.annotationStorage,it=[];for(const K of z){const{id:Q}=K;switch(it.push(Q),K.type){case"text":{const et=K.defaultValue||"";_.setValue(Q,{value:et});break}case"checkbox":case"radiobutton":{const et=K.defaultValue===K.exportValues;_.setValue(Q,{value:et});break}case"combobox":case"listbox":{const et=K.defaultValue||"";_.setValue(Q,{value:et});break}default:continue}const j=document.querySelector(`[data-element-id="${Q}"]`);if(j){if(!i.has(j)){(0,r.warn)(`_bindResetFormAction - element not allowed: ${Q}`);continue}}else continue;j.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:it,name:"ResetForm"}}),!1}}}class d extends n{constructor(p){super(p,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const p=document.createElement("img");return p.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",p.alt="[{{type}} Annotation]",p.dataset.l10nId="text_annotation_type",p.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(p),this.container}}class c extends n{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(p){this.data.hasOwnCanvas&&(p.previousSibling?.nodeName==="CANVAS"&&(p.previousSibling.hidden=!0),p.hidden=!1)}_getKeyModifier(p){const{isWin:E,isMac:T}=r.FeatureTest.platform;return E&&p.ctrlKey||T&&p.metaKey}_setEventListener(p,E,T,M,C){T.includes("mouse")?p.addEventListener(T,B=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:C(B),shift:B.shiftKey,modifier:this._getKeyModifier(B)}})}):p.addEventListener(T,B=>{if(T==="blur"){if(!E.focused||!B.relatedTarget)return;E.focused=!1}else if(T==="focus"){if(E.focused)return;E.focused=!0}C&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:M,value:C(B)}})})}_setEventListeners(p,E,T,M){for(const[C,B]of T)(B==="Action"||this.data.actions?.[B])&&((B==="Focus"||B==="Blur")&&(E||={focused:!1}),this._setEventListener(p,E,C,B,M),B==="Focus"&&!this.data.actions?.Blur?this._setEventListener(p,E,"blur","Blur",null):B==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(p,E,"focus","Focus",null))}
8_setBackgroundColor(p){const E=this.data.backgroundColor||null;p.style.backgroundColor=E===null?"transparent":r.Util.makeHexColor(E[0],E[1],E[2])}_setTextStyle(p){const E=["left","center","right"],{fontColor:T}=this.data.defaultAppearanceData,M=this.data.defaultAppearanceData.fontSize||e,C=p.style;let B;const z=2,_=it=>Math.round(10*it)/10;if(this.data.multiLine){const it=Math.abs(this.data.rect[3]-this.data.rect[1]-z),K=Math.round(it/(r.LINE_FACTOR*M))||1,Q=it/K;B=Math.min(M,_(Q/r.LINE_FACTOR))}else{const it=Math.abs(this.data.rect[3]-this.data.rect[1]-z);B=Math.min(M,_(it/r.LINE_FACTOR))}C.fontSize=`calc(${B}px * var(--scale-factor))`,C.color=r.Util.makeHexColor(T[0],T[1],T[2]),this.data.textAlignment!==null&&(C.textAlign=E[this.data.textAlignment])}_setRequired(p,E){E?p.setAttribute("required",!0):p.removeAttribute("required"),p.setAttribute("aria-required",E)}}class A extends c{constructor(p){const E=p.renderForms||!p.data.hasAppearance&&!!p.data.fieldValue;super(p,{isRenderable:E})}setPropertyOnSiblings(p,E,T,M){const C=this.annotationStorage;
vendor: 12,527 bytes, lines 8-9
8for(const B of this._getElementsByName(p.name,p.id))B.domElement&&(B.domElement[E]=T),C.setValue(B.id,{[M]:T})}render(){const p=this.annotationStorage,E=this.data.id;this.container.classList.add("textWidgetAnnotation");let T=null;if(this.renderForms){const M=p.getValue(E,{value:this.data.fieldValue});let C=M.value||"";const B=p.getValue(E,{charLimit:this.data.maxLen}).charLimit;B&&C.length>B&&(C=C.slice(0,B));let z=M.formattedValue||this.data.textContent?.join(` 9`)||null;z&&this.data.comb&&(z=z.replaceAll(/\s+/g,""));const _={userValue:C,formattedValue:z,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(T=document.createElement("textarea"),T.textContent=z??C,this.data.doNotScroll&&(T.style.overflowY="hidden")):(T=document.createElement("input"),T.type="text",T.setAttribute("value",z??C),this.data.doNotScroll&&(T.style.overflowX="hidden")),this.data.hasOwnCanvas&&(T.hidden=!0),i.add(T),T.setAttribute("data-element-id",E),T.disabled=this.data.readOnly,T.name=this.data.fieldName,T.tabIndex=s,this._setRequired(T,this.data.required),B&&(T.maxLength=B),T.addEventListener("input",K=>{p.setValue(E,{value:K.target.value}),this.setPropertyOnSiblings(T,"value",K.target.value,"value"),_.formattedValue=null}),T.addEventListener("resetform",K=>{const Q=this.data.defaultFieldValue??"";T.value=_.userValue=Q,_.formattedValue=null});let it=K=>{const{formattedValue:Q}=_;Q!=null&&(K.target.value=Q),K.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){T.addEventListener("focus",Q=>{if(_.focused)return;const{target:j}=Q;_.userValue&&(j.value=_.userValue),_.lastCommittedValue=j.value,_.commitKey=1,_.focused=!0}),T.addEventListener("updatefromsandbox",Q=>{this.showElementAndHideCanvas(Q.target);const j={value(et){_.userValue=et.detail.value??"",p.setValue(E,{value:_.userValue.toString()}),et.target.value=_.userValue},formattedValue(et){const{formattedValue:rt}=et.detail;_.formattedValue=rt,rt!=null&&et.target!==document.activeElement&&(et.target.value=rt),p.setValue(E,{formattedValue:rt})},selRange(et){et.target.setSelectionRange(...et.detail.selRange)},charLimit:et=>{const{charLimit:rt}=et.detail,{target:lt}=et;if(rt===0){lt.removeAttribute("maxLength");return}lt.setAttribute("maxLength",rt);let ht=_.userValue;!ht||ht.length<=rt||(ht=ht.slice(0,rt),lt.value=_.userValue=ht,p.setValue(E,{value:ht}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E,name:"Keystroke",value:ht,willCommit:!0,commitKey:1,selStart:lt.selectionStart,selEnd:lt.selectionEnd}}))}};this._dispatchEventFromSandbox(j,Q)}),T.addEventListener("keydown",Q=>{_.commitKey=1;let j=-1;if(Q.key==="Escape"?j=0:Q.key==="Enter"&&!this.data.multiLine?j=2:Q.key==="Tab"&&(_.commitKey=3),j===-1)return;const{value:et}=Q.target;_.lastCommittedValue!==et&&(_.lastCommittedValue=et,_.userValue=et,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E,name:"Keystroke",value:et,willCommit:!0,commitKey:j,selStart:Q.target.selectionStart,selEnd:Q.target.selectionEnd}}))});const K=it;it=null,T.addEventListener("blur",Q=>{if(!_.focused||!Q.relatedTarget)return;_.focused=!1;const{value:j}=Q.target;_.userValue=j,_.lastCommittedValue!==j&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E,name:"Keystroke",value:j,willCommit:!0,commitKey:_.commitKey,selStart:Q.target.selectionStart,selEnd:Q.target.selectionEnd}}),K(Q)}),this.data.actions?.Keystroke&&T.addEventListener("beforeinput",Q=>{_.lastCommittedValue=null;const{data:j,target:et}=Q,{value:rt,selectionStart:lt,selectionEnd:ht}=et;let dt=lt,gt=ht;switch(Q.inputType){case"deleteWordBackward":{const mt=rt.substring(0,lt).match(/\w*[^\w]*$/);mt&&(dt-=mt[0].length);break}case"deleteWordForward":{const mt=rt.substring(lt).match(/^[^\w]*\w*/);mt&&(gt+=mt[0].length);break}case"deleteContentBackward":lt===ht&&(dt-=1);break;case"deleteContentForward":lt===ht&&(gt+=1);break}Q.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E,name:"Keystroke",value:rt,change:j||"",willCommit:!1,selStart:dt,selEnd:gt}})}),this._setEventListeners(T,_,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Q=>Q.target.value)}if(it&&T.addEventListener("blur",it),this.data.comb){const Q=(this.data.rect[2]-this.data.rect[0])/B;T.classList.add("comb"),T.style.letterSpacing=`calc(${Q}px * var(--scale-factor) - 1ch)`}}else T=document.createElement("div"),T.textContent=this.data.fieldValue,T.style.verticalAlign="middle",T.style.display="table-cell";return this._setTextStyle(T),this._setBackgroundColor(T),this._setDefaultPropertiesFromJS(T),this.container.append(T),this.container}}class F extends c{constructor(p){super(p,{isRenderable:!!p.data.hasOwnCanvas})}}class R extends c{constructor(p){super(p,{isRenderable:p.renderForms})}render(){const p=this.annotationStorage,E=this.data,T=E.id;let M=p.getValue(T,{value:E.exportValue===E.fieldValue}).value;typeof M=="string"&&(M=M!=="Off",p.setValue(T,{value:M})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const C=document.createElement("input");return i.add(C),C.setAttribute("data-element-id",T),C.disabled=E.readOnly,this._setRequired(C,this.data.required),C.type="checkbox",C.name=E.fieldName,M&&C.setAttribute("checked",!0),C.setAttribute("exportValue",E.exportValue),C.tabIndex=s,C.addEventListener("change",B=>{const{name:z,checked:_}=B.target;for(const it of this._getElementsByName(z,T)){const K=_&&it.exportValue===E.exportValue;it.domElement&&(it.domElement.checked=K),p.setValue(it.id,{value:K})}p.setValue(T,{value:_})}),C.addEventListener("resetform",B=>{const z=E.defaultFieldValue||"Off";B.target.checked=z===E.exportValue}),this.enableScripting&&this.hasJSActions&&(C.addEventListener("updatefromsandbox",B=>{const z={value(_){_.target.checked=_.detail.value!=="Off",p.setValue(T,{value:_.target.checked})}};this._dispatchEventFromSandbox(z,B)}),this._setEventListeners(C,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],B=>B.target.checked)),this._setBackgroundColor(C),this._setDefaultPropertiesFromJS(C),this.container.append(C),this.container}}class m extends c{constructor(p){super(p,{isRenderable:p.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const p=this.annotationStorage,E=this.data,T=E.id;let M=p.getValue(T,{value:E.fieldValue===E.buttonValue}).value;typeof M=="string"&&(M=M!==E.buttonValue,p.setValue(T,{value:M}));const C=document.createElement("input");if(i.add(C),C.setAttribute("data-element-id",T),C.disabled=E.readOnly,this._setRequired(C,this.data.required),C.type="radio",C.name=E.fieldName,M&&C.setAttribute("checked",!0),C.tabIndex=s,C.addEventListener("change",B=>{const{name:z,checked:_}=B.target;for(const it of this._getElementsByName(z,T))p.setValue(it.id,{value:!1});p.setValue(T,{value:_})}),C.addEventListener("resetform",B=>{const z=E.defaultFieldValue;B.target.checked=z!=null&&z===E.buttonValue}),this.enableScripting&&this.hasJSActions){const B=E.buttonValue;C.addEventListener("updatefromsandbox",z=>{const _={value:it=>{const K=B===it.detail.value;for(const Q of this._getElementsByName(it.target.name)){const j=K&&Q.id===T;Q.domElement&&(Q.domElement.checked=j),p.setValue(Q.id,{value:j})}}};this._dispatchEventFromSandbox(_,z)}),this._setEventListeners(C,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],z=>z.target.checked)}return this._setBackgroundColor(C),this._setDefaultPropertiesFromJS(C),this.container.append(C),this.container}}class x extends l{constructor(p){super(p,{ignoreBorder:p.data.hasAppearance})}render(){const p=super.render();p.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(p.title=this.data.alternativeText);const E=p.lastChild;return this.enableScripting&&this.hasJSActions&&E&&(this._setDefaultPropertiesFromJS(E),E.addEventListener("updatefromsandbox",T=>{this._dispatchEventFromSandbox({},T)})),p}}class O extends c{constructor(p){super(p,{isRenderable:p.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const p=this.annotationStorage,E=this.data.id,T=p.getValue(E,{value:this.data.fieldValue}),M=document.createElement("select");i.add(M),M.setAttribute("data-element-id",E),M.disabled=this.data.readOnly,this._setRequired(M,this.data.required),M.name=this.data.fieldName,M.tabIndex=s;let C=this.data.combo&&this.data.options.length>0;this.data.combo||(M.size=this.data.options.length,this.data.multiSelect&&(M.multiple=!0)),M.addEventListener("resetform",K=>{const Q=this.data.defaultFieldValue;for(const j of M.options)j.selected=j.value===Q});for(const K of this.data.options){const Q=document.createElement("option");Q.textContent=K.displayValue,Q.value=K.exportValue,T.value.includes(K.exportValue)&&(Q.setAttribute("selected",!0),C=!1),M.append(Q)}let B=null;if(C){const K=document.createElement("option");K.value=" ",K.setAttribute("hidden",!0),K.setAttribute("selected",!0),M.prepend(K),B=()=>{K.remove(),M.removeEventListener("input",B),B=null},M.addEventListener("input",B)}const z=K=>{const Q=K?"value":"textContent",{options:j,multiple:et}=M;return et?Array.prototype.filter.call(j,rt=>rt.selected).map(rt=>rt[Q]):j.selectedIndex===-1?null:j[j.selectedIndex][Q]};let _=z(!1);const it=K=>{const Q=K.target.options;return Array.prototype.map.call(Q,j=>({displayValue:j.textContent,exportValue:j.value}))};return this.enableScripting&&this.hasJSActions?(M.addEventListener("updatefromsandbox",K=>{const Q={value(j){B?.();const et=j.detail.value,rt=new Set(Array.isArray(et)?et:[et]);for(const lt of M.options)lt.selected=rt.has(lt.value);p.setValue(E,{value:z(!0)}),_=z(!1)},multipleSelection(j){M.multiple=!0},remove(j){const et=M.options,rt=j.detail.remove;et[rt].selected=!1,M.remove(rt),et.length>0&&Array.prototype.findIndex.call(et,ht=>ht.selected)===-1&&(et[0].selected=!0),p.setValue(E,{value:z(!0),items:it(j)}),_=z(!1)},clear(j){for(;M.length!==0;)M.remove(0);p.setValue(E,{value:null,items:[]}),_=z(!1)},insert(j){const{index:et,displayValue:rt,exportValue:lt}=j.detail.insert,ht=M.children[et],dt=document.createElement("option");dt.textContent=rt,dt.value=lt,ht?ht.before(dt):M.append(dt),p.setValue(E,{value:z(!0),items:it(j)}),_=z(!1)},items(j){const{items:et}=j.detail;for(;M.length!==0;)M.remove(0);for(const rt of et){const{displayValue:lt,exportValue:ht}=rt,dt=document.createElement("option");dt.textContent=lt,dt.value=ht,M.append(dt)}M.options.length>0&&(M.options[0].selected=!0),p.setValue(E,{value:z(!0),items:it(j)}),_=z(!1)},indices(j){const et=new Set(j.detail.indices);for(const rt of j.target.options)rt.selected=et.has(rt.index);p.setValue(E,{value:z(!0)}),_=z(!1)},editable(j){j.target.disabled=!j.detail.editable}};this._dispatchEventFromSandbox(Q,K)}),M.addEventListener("input",K=>{const Q=z(!0);p.setValue(E,{value:Q}),K.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:E,name:"Keystroke",value:_,changeEx:Q,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(M,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],K=>K.target.value)):M.addEventListener("input",function(K){p.setValue(E,{value:z(!0)})}),this.data.combo&&this._setTextStyle(M),this._setBackgroundColor(M),this._setDefaultPropertiesFromJS(M),this.container.append(M),this.container}}class U extends n{constructor(p){const{data:E,elements:T}=p;super(p,{isRenderable:n._hasPopupData(E)}),this.elements=T}render(){this.container.classList.add("popupAnnotation");const p=new D({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}),E=[];for(const T of this.elements)T.popup=p,E.push(T.data.id),T.addHighlightArea();return this.container.setAttribute("aria-controls",E.map(T=>`${r.AnnotationPrefix}${T}`).join(",")),this.container}}
9class D{#t=null;#e=this.#h.bind(this);#n=this.#E.bind(this);#r=this.#x.bind(this);#o=this.#b.bind(this);#a=null;#i=null;#l=null;#c=null;#s=null;#f=null;#u=!1;#d=null;#p=null;#v=null;#m=null;#g=!1;constructor(p){let{container:E,color:T,elements:M,titleObj:C,modificationDate:B,contentsObj:z,richText:_,parent:it,rect:K,parentRect:Q,open:j}=p;this.#i=E,this.#m=C,this.#l=z,this.#v=_,this.#s=it,this.#a=T,this.#p=K,this.#f=Q,this.#c=M;const et=a.PDFDateString.toDateObject(B);et&&(this.#t=it.l10n.get("annotation_date_string",{date:et.toLocaleDateString(),time:et.toLocaleTimeString()})),this.trigger=M.flatMap(rt=>rt.getElementsToTriggerPopup());for(const rt of this.trigger)rt.addEventListener("click",this.#o),rt.addEventListener("mouseenter",this.#r),rt.addEventListener("mouseleave",this.#n),rt.classList.add("popupTriggerArea");for(const rt of M)rt.container?.addEventListener("keydown",this.#e);this.#i.hidden=!0,j&&this.#b()}render(){if(this.#d)return;const{page:{view:p},viewport:{rawDims:{pageWidth:E,pageHeight:T,pageX:M,pageY:C}}}=this.#s,B=this.#d=document.createElement("div");if(B.className="popup",this.#a){const mt=B.style.outlineColor=r.Util.makeHexColor(...this.#a);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?B.style.backgroundColor=`color-mix(in srgb, ${mt} 30%, white)`:B.style.backgroundColor=r.Util.makeHexColor(...this.#a.map(Tt=>Math.floor(.7*(255-Tt)+Tt)))}const z=document.createElement("span");z.className="header";const _=document.createElement("h1");if(z.append(_),{dir:_.dir,str:_.textContent}=this.#m,B.append(z),this.#t){const mt=document.createElement("span");mt.classList.add("popupDate"),this.#t.then(St=>{mt.textContent=St}),z.append(mt)}const it=this.#l,K=this.#v;if(K?.str&&(!it?.str||it.str===K.str))P.XfaLayer.render({xfaHtml:K.html,intent:"richText",div:B}),B.lastChild.classList.add("richText","popupContent");else{const mt=this._formatContents(it);B.append(mt)}let Q=!!this.#f,j=Q?this.#f:this.#p;for(const mt of this.#c)if(!j||r.Util.intersect(mt.data.rect,j)!==null){j=mt.data.rect,Q=!0;break}const et=r.Util.normalizeRect([j[0],p[3]-j[1]+p[1],j[2],p[3]-j[3]+p[1]]),lt=Q?j[2]-j[0]+5:0,ht=et[0]+lt,dt=et[1],{style:gt}=this.#i;gt.left=`${100*(ht-M)/E}%`,gt.top=`${100*(dt-C)/T}%`,this.#i.append(B)}_formatContents(p){let{str:E,dir:T}=p;const M=document.createElement("p");M.classList.add("popupContent"),M.dir=T;const C=E.split(/(?:\r\n?|\n)/);for(let B=0,z=C.length;B<z;++B){const _=C[B];M.append(document.createTextNode(_)),B<z-1&&M.append(document.createElement("br"))}return M}#h(p){p.altKey||p.shiftKey||p.ctrlKey||p.metaKey||(p.key==="Enter"||p.key==="Escape"&&this.#u)&&this.#b()}#b(){this.#u=!this.#u,this.#u?(this.#x(),this.#i.addEventListener("click",this.#o),this.#i.addEventListener("keydown",this.#e)):(this.#E(),this.#i.removeEventListener("click",this.#o),this.#i.removeEventListener("keydown",this.#e))}#x(){this.#d||this.render(),this.isVisible?this.#u&&this.#i.classList.add("focused"):(this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#E(){this.#i.classList.remove("focused"),!(this.#u||!this.isVisible)&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#g=this.isVisible,this.#g&&(this.#i.hidden=!0)}maybeShow(){this.#g&&(this.#g=!1,this.#i.hidden=!1)}get isVisible(){return this.#i.hidden===!1}}class G extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0}),this.textContent=p.data.textContent,this.textPosition=p.data.textPosition,this.annotationEditorType=r.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const p=document.createElement("div");p.classList.add("annotationTextContent"),p.setAttribute("role","comment");for(const E of this.textContent){const T=document.createElement("span");T.textContent=E,p.append(T)}this.container.append(p)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}o.FreeTextAnnotationElement=G;class V extends n{#t=null;constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const p=this.data,{width:E,height:T}=h(p.rect),M=this.svgFactory.create(E,T,!0),C=this.#t=this.svgFactory.createElement("svg:line");
9return C.setAttribute("x1",p.rect[2]-p.lineCoordinates[0]),C.setAttribute("y1",p.rect[3]-p.lineCoordinates[1]),C.setAttribute("x2",p.rect[2]-p.lineCoordinates[2]),C.setAttribute("y2",p.rect[3]-p.lineCoordinates[3]),C.setAttribute("stroke-width",p.borderStyle.width||1),C.setAttribute("stroke","transparent"),C.setAttribute("fill","transparent"),M.append(C),this.container.append(M),!p.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class tt extends n{#t=null;constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const p=this.data,{width:E,height:T}=h(p.rect),M=this.svgFactory.create(E,T,!0),C=p.borderStyle.width,B=this.#t=this.svgFactory.createElement("svg:rect");return B.setAttribute("x",C/2),B.setAttribute("y",C/2),B.setAttribute("width",E-C),B.setAttribute("height",T-C),B.setAttribute("stroke-width",C||1),B.setAttribute("stroke","transparent"),B.setAttribute("fill","transparent"),M.append(B),this.container.append(M),!p.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Z extends n{#t=null;constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const p=this.data,{width:E,height:T}=h(p.rect),M=this.svgFactory.create(E,T,!0),C=p.borderStyle.width,B=this.#t=this.svgFactory.createElement("svg:ellipse");return B.setAttribute("cx",E/2),B.setAttribute("cy",T/2),B.setAttribute("rx",E/2-C/2),B.setAttribute("ry",T/2-C/2),B.setAttribute("stroke-width",C||1),B.setAttribute("stroke","transparent"),B.setAttribute("fill","transparent"),M.append(B),this.container.append(M),!p.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class q extends n{#t=null;constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const p=this.data,{width:E,height:T}=h(p.rect),M=this.svgFactory.create(E,T,!0);let C=[];for(const z of p.vertices){const _=z.x-p.rect[0],it=p.rect[3]-z.y;C.push(_+","+it)}C=C.join(" ");const B=this.#t=this.svgFactory.createElement(this.svgElementName);return B.setAttribute("points",C),B.setAttribute("stroke-width",p.borderStyle.width||1),B.setAttribute("stroke","transparent"),B.setAttribute("fill","transparent"),M.append(B),this.container.append(M),!p.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class nt extends q{constructor(p){super(p),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class J extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class H extends n{#t=[];constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=r.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const p=this.data,{width:E,height:T}=h(p.rect),M=this.svgFactory.create(E,T,!0);for(const C of p.inkLists){let B=[];for(const _ of C){const it=_.x-p.rect[0],K=p.rect[3]-_.y;B.push(`${it},${K}`)}B=B.join(" ");const z=this.svgFactory.createElement(this.svgElementName);this.#t.push(z),z.setAttribute("points",B),z.setAttribute("stroke-width",p.borderStyle.width||1),z.setAttribute("stroke","transparent"),z.setAttribute("fill","transparent"),!p.popupRef&&this.hasPopupData&&this._createPopup(),M.append(z)}return this.container.append(M),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}o.InkAnnotationElement=H;class k extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}
9class b extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class S extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class w extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class N extends n{constructor(p){super(p,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}o.StampAnnotationElement=N;class L extends n{#t=null;constructor(p){super(p,{isRenderable:!0});const{filename:E,content:T}=this.data.file;this.filename=(0,a.getFilenameFromUrl)(E,!0),this.content=T,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:E,content:T})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:p,data:E}=this;let T;E.hasAppearance||E.fillAlpha===0?T=document.createElement("div"):(T=document.createElement("img"),T.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(E.name)?"paperclip":"pushpin"}.svg`,E.fillAlpha&&E.fillAlpha<1&&(T.style=`filter: opacity(${Math.round(E.fillAlpha*100)}%);`)),T.addEventListener("dblclick",this.#e.bind(this)),this.#t=T;const{isMac:M}=r.FeatureTest.platform;return p.addEventListener("keydown",C=>{C.key==="Enter"&&(M?C.metaKey:C.ctrlKey)&&this.#e()}),!E.popupRef&&this.hasPopupData?this._createPopup():T.classList.add("popupTriggerArea"),p.append(T),p}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class W{#t=null;#e=null;#n=new Map;constructor(p){let{div:E,accessibilityManager:T,annotationCanvasMap:M,l10n:C,page:B,viewport:z}=p;this.div=E,this.#t=T,this.#e=M,this.l10n=C,this.page=B,this.viewport=z,this.zIndex=0,this.l10n||=y.NullL10n}#r(p,E){const T=p.firstChild||p;T.id=`${r.AnnotationPrefix}${E}`,this.div.append(p),this.#t?.moveElementInDOM(this.div,p,T,!1)}async render(p){const{annotations:E}=p,T=this.div;(0,a.setLayerDimensions)(T,this.viewport);const M=new Map,C={data:null,layer:T,linkService:p.linkService,downloadManager:p.downloadManager,imageResourcesPath:p.imageResourcesPath||"",renderForms:p.renderForms!==!1,svgFactory:new a.DOMSVGFactory,annotationStorage:p.annotationStorage||new f.AnnotationStorage,enableScripting:p.enableScripting===!0,hasJSActions:p.hasJSActions,fieldObjects:p.fieldObjects,parent:this,elements:null};for(const B of E){if(B.noHTML)continue;const z=B.annotationType===r.AnnotationType.POPUP;if(z){const K=M.get(B.id);if(!K)continue;C.elements=K}else{const{width:K,height:Q}=h(B.rect);if(K<=0||Q<=0)continue}C.data=B;const _=u.create(C);if(!_.isRenderable)continue;if(!z&&B.popupRef){const K=M.get(B.popupRef);K?K.push(_):M.set(B.popupRef,[_])}_.annotationEditorType>0&&this.#n.set(_.data.id,_);const it=_.render();B.hidden&&(it.style.visibility="hidden"),this.#r(it,B.id)}this.#o(),await this.l10n.translate(T)}update(p){let{viewport:E}=p;const T=this.div;this.viewport=E,(0,a.setLayerDimensions)(T,{rotation:E.rotation}),this.#o(),T.hidden=!1}#o(){if(!this.#e)return;const p=this.div;for(const[E,T]of this.#e){const M=p.querySelector(`[data-annotation-id="${E}"]`);if(!M)continue;const{firstChild:C}=M;C?C.nodeName==="CANVAS"?C.replaceWith(T):C.before(T):M.append(T)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(p){return this.#n.get(p)}}o.AnnotationLayer=W}),((v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorConverters=void 0;function t(f){return Math.floor(Math.max(0,Math.min(1,f))*255).toString(16).padStart(2,"0")}function r(f){return Math.max(0,Math.min(255,255*f))}class a{static CMYK_G(g){let[y,P,s,e]=g;return["G",1-Math.min(1,.3*y+.59*s+.11*P+e)]}static G_CMYK(g){let[y]=g;return["CMYK",0,0,0,1-y]}static G_RGB(g){let[y]=g;return["RGB",y,y,y]}static G_rgb(g){let[y]=g;return y=r(y),[y,y,y]}static G_HTML(g){let[y]=g;const P=t(y);return`#${P}${P}${P}`}static RGB_G(g){let[y,P,s]=g;return["G",.3*y+.59*P+.11*s]}static RGB_rgb(g){return g.map(r)}static RGB_HTML(g){return`#${g.map(t).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(g){let[y,P,s,e]=g;return["RGB",1-Math.min(1,y+e),1-Math.min(1,s+e),1-Math.min(1,P+e)]}static CMYK_rgb(g){let[y,P,s,e]=g;return[r(1-Math.min(1,y+e)),r(1-Math.min(1,s+e)),r(1-Math.min(1,P+e))]}static CMYK_HTML(g){const y=this.CMYK_RGB(g).slice(1);return this.RGB_HTML(y)}static RGB_CMYK(g){let[y,P,s]=g;const e=1-y,i=1-P,h=1-s,u=Math.min(e,i,h);return["CMYK",e,i,h,u]}}o.ColorConverters=a}),((v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.NullL10n=void 0,o.getL10nFallback=r;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 r(g,y){switch(g){case"find_match_count":g=`find_match_count[${y.total===1?"one":"other"}]`;break;case"find_match_count_limit":g=`find_match_count_limit[${y.limit===1?"one":"other"}]`;break}return t[g]||""}function a(g,y){return y?g.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(P,s)=>s in y?y[s]:"{{"+s+"}}"):g}const f={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(g){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r(g,y);return a(P,y)},async translate(g){}};o.NullL10n=f}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.XfaLayer=void 0,t(89);var r=t(194);class a{static setupStorage(g,y,P,s,e){const i=s.getValue(y,{value:null});switch(P.name){case"textarea":if(i.value!==null&&(g.textContent=i.value),e==="print")break;g.addEventListener("input",h=>{s.setValue(y,{value:h.target.value})});break;case"input":if(P.attributes.type==="radio"||P.attributes.type==="checkbox"){if(i.value===P.attributes.xfaOn?g.setAttribute("checked",!0):i.value===P.attributes.xfaOff&&g.removeAttribute("checked"),e==="print")break;g.addEventListener("change",h=>{s.setValue(y,{value:h.target.checked?h.target.getAttribute("xfaOn"):h.target.getAttribute("xfaOff")})})}else{if(i.value!==null&&g.setAttribute("value",i.value),e==="print")break;g.addEventListener("input",h=>{s.setValue(y,{value:h.target.value})})}break;case"select":if(i.value!==null){g.setAttribute("value",i.value);for(const h of P.children)h.attributes.value===i.value?h.attributes.selected=!0:h.attributes.hasOwnProperty("selected")&&delete h.attributes.selected}g.addEventListener("input",h=>{const u=h.target.options,n=u.selectedIndex===-1?"":u[u.selectedIndex].value;s.setValue(y,{value:n})});break}}static setAttributes(g){let{html:y,element:P,storage:s=null,intent:e,linkService:i}=g;const{attributes:h}=P,u=y instanceof HTMLAnchorElement;h.type==="radio"&&(h.name=`${h.name}-${e}`);for(const[n,l]of Object.entries(h))if(l!=null)switch(n){case"class":l.length&&y.setAttribute(n,l.join(" "));break;case"dataId":break;case"id":y.setAttribute("data-element-id",l);break;case"style":Object.assign(y.style,l);break;case"textContent":y.textContent=l;break;default:(!u||n!=="href"&&n!=="newWindow")&&y.setAttribute(n,l)}u&&i.addLinkAttributes(y,h.href,h.newWindow),s&&h.dataId&&this.setupStorage(y,h.dataId,P,s)}static render(g){const y=g.annotationStorage,P=g.linkService,s=g.xfaHtml,e=g.intent||"display",i=document.createElement(s.name);s.attributes&&this.setAttributes({html:i,element:s,intent:e,linkService:P});const h=[[s,-1,i]],u=g.div;if(u.append(i),g.viewport){const l=`matrix(${g.viewport.transform.join(",")})`;u.style.transform=l}e!=="richText"&&u.setAttribute("class","xfaLayer xfaFont");const n=[];for(;h.length>0;){const[l,d,c]=h.at(-1);if(d+1===l.children.length){h.pop();continue}const A=l.children[++h.at(-1)[1]];if(A===null)continue;const{name:F}=A;
9if(F==="#text"){const m=document.createTextNode(A.value);n.push(m),c.append(m);continue}const R=A?.attributes?.xmlns?document.createElementNS(A.attributes.xmlns,F):document.createElement(F);if(c.append(R),A.attributes&&this.setAttributes({html:R,element:A,storage:y,intent:e,linkService:P}),A.children&&A.children.length>0)h.push([A,-1,R]);else if(A.value){const m=document.createTextNode(A.value);r.XfaText.shouldBuildText(F)&&n.push(m),R.append(m)}}for(const l of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))l.setAttribute("readOnly",!0);return{textDivs:n}}static update(g){const y=`matrix(${g.viewport.transform.join(",")})`;g.div.style.transform=y,g.div.hidden=!1}}o.XfaLayer=a}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InkEditor=void 0,t(89),t(2);var r=t(1),a=t(164),f=t(198),g=t(168),y=t(165);class P extends a.AnnotationEditor{#t=0;#e=0;#n=this.canvasPointermove.bind(this);#r=this.canvasPointerleave.bind(this);#o=this.canvasPointerup.bind(this);#a=this.canvasPointerdown.bind(this);#i=new Path2D;#l=!1;#c=!1;#s=!1;#f=null;#u=0;#d=0;#p=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.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(e){a.AnnotationEditor.initialize(e,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(e,i){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:P._defaultThickness=i;break;case r.AnnotationEditorParamsType.INK_COLOR:P._defaultColor=i;break;case r.AnnotationEditorParamsType.INK_OPACITY:P._defaultOpacity=i/100;break}}updateParams(e,i){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#v(i);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#m(i);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#g(i);break}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,P._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,P._defaultColor||a.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(P._defaultOpacity*100)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||P._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||P._defaultColor||a.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??P._defaultOpacity))]]}#v(e){const i=this.thickness;this.addCommands({cmd:()=>{this.thickness=e,this.#C()},undo:()=>{this.thickness=i,this.#C()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#m(e){const i=this.color;this.addCommands({cmd:()=>{this.color=e,this.#y()},undo:()=>{this.color=i,this.#y()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#g(e){e/=100;const i=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,this.#y()},undo:()=>{this.opacity=i,this.#y()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(this.#w(),this.#M()),this.isAttachedToDOM||(this.parent.add(this),this.#A()),this.#C()))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#f.disconnect(),this.#f=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&e===null&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,i]=this.parentDimensions,h=this.width*e,u=this.height*i;this.setDimensions(h,u)}enableEditMode(){this.#l||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#a))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#a))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}#h(){const{parentRotation:e,parentDimensions:[i,h]}=this;switch(e){case 90:return[0,h,h,i];case 180:return[i,h,i,h];case 270:return[i,0,h,i];default:return[0,0,i,h]}}#b(){const{ctx:e,color:i,opacity:h,thickness:u,parentScale:n,scaleFactor:l}=this;e.lineWidth=u*n/l,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${i}${(0,y.opacityToHex)(h)}`}#x(e,i){this.canvas.addEventListener("contextmenu",g.noContextMenu),this.canvas.addEventListener("pointerleave",this.#r),this.canvas.addEventListener("pointermove",this.#n),this.canvas.addEventListener("pointerup",this.#o),this.canvas.removeEventListener("pointerdown",this.#a),this.isEditing=!0,this.#s||(this.#s=!0,this.#A(),this.thickness||=P._defaultThickness,this.color||=P._defaultColor||a.AnnotationEditor._defaultLineColor,this.opacity??=P._defaultOpacity),this.currentPath.push([e,i]),this.#c=!1,this.#b(),this.#p=()=>{this.#D(),this.#p&&window.requestAnimationFrame(this.#p)},window.requestAnimationFrame(this.#p)}#E(e,i){const[h,u]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===h&&i===u)return;const n=this.currentPath;let l=this.#i;if(n.push([e,i]),this.#c=!0,n.length<=2){l.moveTo(...n[0]),l.lineTo(e,i);return}n.length===3&&(this.#i=l=new Path2D,l.moveTo(...n[0])),this.#L(l,...n.at(-3),...n.at(-2),e,i)}#P(){if(this.currentPath.length===0)return;const e=this.currentPath.at(-1);this.#i.lineTo(...e)}#R(e,i){this.#p=null,e=Math.min(Math.max(e,0),this.canvas.width),i=Math.min(Math.max(i,0),this.canvas.height),this.#E(e,i),this.#P();let h;if(this.currentPath.length!==1)h=this.#N();else{const c=[e,i];h=[[c,c.slice(),c.slice(),c]]}const u=this.#i,n=this.currentPath;this.currentPath=[],this.#i=new Path2D;const l=()=>{this.allRawPaths.push(n),this.paths.push(h),this.bezierPath2D.push(u),this.rebuild()},d=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(this.#w(),this.#M()),this.#C())};this.addCommands({cmd:l,undo:d,mustExec:!0})}#D(){if(!this.#c)return;this.#c=!1;const e=Math.ceil(this.thickness*this.parentScale),i=this.currentPath.slice(-3),h=i.map(l=>l[0]),u=i.map(l=>l[1]);Math.min(...h)-e,Math.max(...h)+e,Math.min(...u)-e,Math.max(...u)+e;const{ctx:n}=this;n.save(),n.clearRect(0,0,this.canvas.width,this.canvas.height);for(const l of this.bezierPath2D)n.stroke(l);
9n.stroke(this.#i),n.restore()}#L(e,i,h,u,n,l,d){const c=(i+u)/2,A=(h+n)/2,F=(u+l)/2,R=(n+d)/2;e.bezierCurveTo(c+2*(u-c)/3,A+2*(n-A)/3,F+2*(u-F)/3,R+2*(n-R)/3,F,R)}#N(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const i=[];let h,[u,n]=e[0];for(h=1;h<e.length-2;h++){const[m,x]=e[h],[O,U]=e[h+1],D=(m+O)/2,G=(x+U)/2,V=[u+2*(m-u)/3,n+2*(x-n)/3],tt=[D+2*(m-D)/3,G+2*(x-G)/3];i.push([[u,n],V,tt,[D,G]]),[u,n]=[D,G]}const[l,d]=e[h],[c,A]=e[h+1],F=[u+2*(l-u)/3,n+2*(d-n)/3],R=[c+2*(l-c)/3,A+2*(d-A)/3];return i.push([[u,n],F,R,[c,A]]),i}#y(){if(this.isEmpty()){this.#T();return}this.#b();const{canvas:e,ctx:i}=this;i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,e.width,e.height),this.#T();for(const h of this.bezierPath2D)i.stroke(h)}commit(){this.#l||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#l=!0,this.div.classList.add("disabled"),this.#C(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){e.button!==0||!this.isInEditMode()||this.#l||(this.setInForeground(),e.preventDefault(),e.type!=="mouse"&&this.div.focus(),this.#x(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#E(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#O(e)}canvasPointerleave(e){this.#O(e)}#O(e){this.canvas.removeEventListener("pointerleave",this.#r),this.canvas.removeEventListener("pointermove",this.#n),this.canvas.removeEventListener("pointerup",this.#o),this.canvas.addEventListener("pointerdown",this.#a),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",g.noContextMenu)},10),this.#R(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#w(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",a.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(e=>this.canvas?.setAttribute("aria-label",e)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#M(){this.#f=new ResizeObserver(e=>{const i=e[0].contentRect;i.width&&i.height&&this.setDimensions(i.width,i.height)}),this.#f.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#l}render(){if(this.div)return this.div;let e,i;this.width&&(e=this.x,i=this.y),super.render(),a.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(d=>this.div?.setAttribute("aria-label",d));const[h,u,n,l]=this.#h();if(this.setAt(h,u,0,0),this.setDims(n,l),this.#w(),this.width){const[d,c]=this.parentDimensions;this.setAspectRatio(this.width*d,this.height*c),this.setAt(e*d,i*c,this.width*d,this.height*c),this.#s=!0,this.#A(),this.setDims(this.width*d,this.height*c),this.#y(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#M(),this.div}#A(){if(!this.#s)return;const[e,i]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*i),this.#T()}setDimensions(e,i){const h=Math.round(e),u=Math.round(i);if(this.#u===h&&this.#d===u)return;this.#u=h,this.#d=u,this.canvas.style.visibility="hidden";const[n,l]=this.parentDimensions;this.width=e/n,this.height=i/l,this.fixAndSetPosition(),this.#l&&this.#k(e,i),this.#A(),this.#y(),this.canvas.style.visibility="visible",this.fixDims()}#k(e,i){const h=this.#I(),u=(e-h)/this.#e,n=(i-h)/this.#t;this.scaleFactor=Math.min(u,n)}#T(){const e=this.#I()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#B(e){const i=new Path2D;for(let h=0,u=e.length;h<u;h++){const[n,l,d,c]=e[h];h===0&&i.moveTo(...n),i.bezierCurveTo(l[0],l[1],d[0],d[1],c[0],c[
91])}return i}static#U(e,i,h){const[u,n,l,d]=i;switch(h){case 0:for(let c=0,A=e.length;c<A;c+=2)e[c]+=u,e[c+1]=d-e[c+1];break;case 90:for(let c=0,A=e.length;c<A;c+=2){const F=e[c];e[c]=e[c+1]+u,e[c+1]=F+n}break;case 180:for(let c=0,A=e.length;c<A;c+=2)e[c]=l-e[c],e[c+1]+=n;break;case 270:for(let c=0,A=e.length;c<A;c+=2){const F=e[c];e[c]=l-e[c+1],e[c+1]=d-F}break;default:throw new Error("Invalid rotation")}return e}static#W(e,i,h){const[u,n,l,d]=i;switch(h){case 0:for(let c=0,A=e.length;c<A;c+=2)e[c]-=u,e[c+1]=d-e[c+1];break;case 90:for(let c=0,A=e.length;c<A;c+=2){const F=e[c];e[c]=e[c+1]-n,e[c+1]=F-u}break;case 180:for(let c=0,A=e.length;c<A;c+=2)e[c]=l-e[c],e[c+1]-=n;break;case 270:for(let c=0,A=e.length;c<A;c+=2){const F=e[c];e[c]=d-e[c+1],e[c+1]=l-F}break;default:throw new Error("Invalid rotation")}return e}#H(e,i,h,u){const n=[],l=this.thickness/2,d=e*i+l,c=e*h+l;for(const A of this.paths){const F=[],R=[];for(let m=0,x=A.length;m<x;m++){const[O,U,D,G]=A[m],V=e*O[0]+d,tt=e*O[1]+c,Z=e*U[0]+d,q=e*U[1]+c,nt=e*D[0]+d,J=e*D[1]+c,H=e*G[0]+d,k=e*G[1]+c;m===0&&(F.push(V,tt),R.push(V,tt)),F.push(Z,q,nt,J,H,k),R.push(Z,q),m===x-1&&R.push(H,k)}n.push({bezier:P.#U(F,u,this.rotation),points:P.#U(R,u,this.rotation)})}return n}#F(){let e=1/0,i=-1/0,h=1/0,u=-1/0;for(const n of this.paths)for(const[l,d,c,A]of n){const F=r.Util.bezierBoundingBox(...l,...d,...c,...A);e=Math.min(e,F[0]),h=Math.min(h,F[1]),i=Math.max(i,F[2]),u=Math.max(u,F[3])}return[e,h,i,u]}#I(){return this.#l?Math.ceil(this.thickness*this.parentScale):0}#C(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isEmpty())return;if(!this.#l){this.#y();return}const i=this.#F(),h=this.#I();this.#e=Math.max(a.AnnotationEditor.MIN_SIZE,i[2]-i[0]),this.#t=Math.max(a.AnnotationEditor.MIN_SIZE,i[3]-i[1]);const u=Math.ceil(h+this.#e*this.scaleFactor),n=Math.ceil(h+this.#t*this.scaleFactor),[l,d]=this.parentDimensions;this.width=u/l,this.height=n/d,this.setAspectRatio(u,n);const c=this.translationX,A=this.translationY;this.translationX=-i[0],this.translationY=-i[1],this.#A(),this.#y(),this.#u=u,this.#d=n,this.setDims(u,n);const F=e?h/this.scaleFactor/2:0;this.translate(c-this.translationX-F,A-this.translationY-F)}static deserialize(e,i,h){if(e instanceof f.InkAnnotationElement)return null;const u=super.deserialize(e,i,h);u.thickness=e.thickness,u.color=r.Util.makeHexColor(...e.color),u.opacity=e.opacity;const[n,l]=u.pageDimensions,d=u.width*n,c=u.height*l,A=u.parentScale,F=e.thickness/2;u.#l=!0,u.#u=Math.round(d),u.#d=Math.round(c);const{paths:R,rect:m,rotation:x}=e;for(let{bezier:U}of R){U=P.#W(U,m,x);const D=[];u.paths.push(D);let G=A*(U[0]-F),V=A*(U[1]-F);for(let Z=2,q=U.length;Z<q;Z+=6){const nt=A*(U[Z]-F),J=A*(U[Z+1]-F),H=A*(U[Z+2]-F),k=A*(U[Z+3]-F),b=A*(U[Z+4]-F),S=A*(U[Z+5]-F);D.push([[G,V],[nt,J],[H,k],[b,S]]),G=b,V=S}const tt=this.#B(D);u.bezierPath2D.push(tt)}const O=u.#F();return u.#e=Math.max(a.AnnotationEditor.MIN_SIZE,O[2]-O[0]),u.#t=Math.max(a.AnnotationEditor.MIN_SIZE,O[3]-O[1]),u.#k(d,c),u}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),i=a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:i,thickness:this.thickness,opacity:this.opacity,paths:this.#H(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}o.InkEditor=P}),((v,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.StampEditor=void 0,t(149),t(152);var r=t(1),a=t(164),f=t(168),g=t(198);class y extends a.AnnotationEditor{#t=null;#e=null;#n=null;#r=null;#o=null;#a=null;#i=null;#l=null;#c=!1;#s=!1;static _type="stamp";constructor(s){super({...s,name:"stampEditor"}),this.#r=s.bitmapUrl,this.#o=s.bitmapFile}static initialize(s){a.AnnotationEditor.initialize(s)}static get supportedTypes(){const s=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,r.shadow)(this,"supportedTypes",s.map(e=>`image/${e}`))}static get supportedTypesStr(){return(0,r.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(s){return this.supportedTypes.includes(s)}static paste(s,e){e.pasteEditor(r.AnnotationEditorType.STAMP,{bitmapFile:s.getAsFile()})}#f(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!s){this.remove();return}this.#t=s.bitmap,e||(this.#e=s.id,this.#c=s.isSvg),this.#p()}#u(){this.#n=null,this._uiManager.enableWaiting(!1),this.#a&&this.div.focus()}#d(){if(this.#e){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#e).then(e=>this.#f(e,!0)).finally(()=>this.#u());return}if(this.#r){const e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(i=>this.#f(i)).finally(()=>this.#u());return}if(this.#o){const e=this.#o;this.#o=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(i=>this.#f(i)).finally(()=>this.#u());return}const s=document.createElement("input");s.type="file",s.accept=y.supportedTypesStr,this.#n=new Promise(e=>{s.addEventListener("change",async()=>
9{if(!s.files||s.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(s.files[0]);this.#f(i)}e()}),s.addEventListener("cancel",()=>{this.remove(),e()})}).finally(()=>this.#u()),s.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#a?.remove(),this.#a=null,this.#i?.disconnect(),this.#i=null),super.remove()}rebuild(){if(!this.parent){this.#e&&this.#d();return}super.rebuild(),this.div!==null&&(this.#e&&this.#d(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#n||this.#t||this.#r||this.#o)}get isResizable(){return!0}render(){if(this.div)return this.div;let s,e;if(this.width&&(s=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#t?this.#p():this.#d(),this.width){const[i,h]=this.parentDimensions;this.setAt(s*i,e*h,this.width*i,this.height*h)}return this.div}#p(){const{div:s}=this;let{width:e,height:i}=this.#t;const[h,u]=this.pageDimensions,n=.75;if(this.width)e=this.width*h,i=this.height*u;else if(e>n*h||i>n*u){const A=Math.min(n*h/e,n*u/i);e*=A,i*=A}const[l,d]=this.parentDimensions;this.setDims(e*l/h,i*d/u),this._uiManager.enableWaiting(!1);const c=this.#a=document.createElement("canvas");s.append(c),s.hidden=!1,this.#g(e,i),this.#b(),this.#s||(this.parent.addUndoableEditor(this),this.#s=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#v(s,e){const[i,h]=this.parentDimensions;this.width=s/i,this.height=e/h,this.setDims(s,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this.#l!==null&&clearTimeout(this.#l);const u=200;this.#l=setTimeout(()=>{this.#l=null,this.#g(s,e)},u)}#m(s,e){const{width:i,height:h}=this.#t;let u=i,n=h,l=this.#t;for(;u>2*s||n>2*e;){const d=u,c=n;u>2*s&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2)),n>2*e&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2));const A=new OffscreenCanvas(u,n);A.getContext("2d").drawImage(l,0,0,d,c,0,0,u,n),l=A.transferToImageBitmap()}return l}#g(s,e){s=Math.ceil(s),e=Math.ceil(e);const i=this.#a;if(!i||i.width===s&&i.height===e)return;i.width=s,i.height=e;const h=this.#c?this.#t:this.#m(s,e),u=i.getContext("2d");u.filter=this._uiManager.hcmFilter,u.drawImage(h,0,0,h.width,h.height,0,0,s,e)}#h(s){if(s){if(this.#c){const h=this._uiManager.imageManager.getSvgUrl(this.#e);if(h)return h}const e=document.createElement("canvas");return{width:e.width,height:e.height}=this.#t,e.getContext("2d").drawImage(this.#t,0,0),e.toDataURL()}if(this.#c){const[e,i]=this.pageDimensions,h=Math.round(this.width*e*f.PixelsPerInch.PDF_TO_CSS_UNITS),u=Math.round(this.height*i*f.PixelsPerInch.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(h,u);return n.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,h,u),n.transferToImageBitmap()}return structuredClone(this.#t)}#b(){this.#i=new ResizeObserver(s=>{const e=s[0].contentRect;e.width&&e.height&&this.#v(e.width,e.height)}),this.#i.observe(this.div)}static deserialize(s,e,i){if(s instanceof g.StampAnnotationElement)return null;const h=super.deserialize(s,e,i),{rect:u,bitmapUrl:n,bitmapId:l,isSvg:d,accessibilityData:c}=s;l&&i.imageManager.isValidId(l)?h.#e=l:h.#r=n,h.#c=d;const[A,F]=h.pageDimensions;return h.width=(u[2]-u[0])/A,h.height=(u[3]-u[1])/F,c&&(h.altTextData=c),h}serialize(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.isEmpty())return null;const i={annotationType:r.AnnotationEditorType.STAMP,bitmapId:this.#e,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(s)return i.bitmapUrl=this.#h(!0),i.accessibilityData=this.altTextData,i;const{decorative:h,altText:u}=this.altTextData;if(!h&&u&&(i.accessibilityData={type:"Figure",alt:u}),e===null)return i;e.stamps||=new Map;const n=this.#c?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!e.stamps.has(this.#e))e.stamps.set(this.#e,{area:n,serialized:i}),i.bitmap=this.#h(!1);else if(this.#c){const l=e.stamps.get(this.#e);n>l.area&&(l.area=n,l.serialized.bitmap.close(),l.serialized.bitmap=this.#h(!1))}return i}}o.StampEditor=y})],__webpack_module_cache__={};function __w_pdfjs_require__(v){var o=__webpack_module_cache__[v];if(o!==void 0)return o.exports;var t=__webpack_module_cache__[v]={exports:{}};return __webpack_modules__[v].call(t.exports,t,t.exports,__w_pdfjs_require__),t.exp
9orts}var __webpack_exports__={};return(()=>{var v=__webpack_exports__;Object.defineProperty(v,"__esModule",{value:!0}),Object.defineProperty(v,"AbortException",{enumerable:!0,get:function(){return o.AbortException}}),Object.defineProperty(v,"AnnotationEditorLayer",{enumerable:!0,get:function(){return f.AnnotationEditorLayer}}),Object.defineProperty(v,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return o.AnnotationEditorParamsType}}),Object.defineProperty(v,"AnnotationEditorType",{enumerable:!0,get:function(){return o.AnnotationEditorType}}),Object.defineProperty(v,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return g.AnnotationEditorUIManager}}),Object.defineProperty(v,"AnnotationLayer",{enumerable:!0,get:function(){return y.AnnotationLayer}}),Object.defineProperty(v,"AnnotationMode",{enumerable:!0,get:function(){return o.AnnotationMode}}),Object.defineProperty(v,"CMapCompressionType",{enumerable:!0,get:function(){return o.CMapCompressionType}}),Object.defineProperty(v,"DOMSVGFactory",{enumerable:!0,get:function(){return r.DOMSVGFactory}}),Object.defineProperty(v,"FeatureTest",{enumerable:!0,get:function(){return o.FeatureTest}}),Object.defineProperty(v,"GlobalWorkerOptions",{enumerable:!0,get:function(){return P.GlobalWorkerOptions}}),Object.defineProperty(v,"ImageKind",{enumerable:!0,get:function(){return o.ImageKind}}),Object.defineProperty(v,"InvalidPDFException",{enumerable:!0,get:function(){return o.InvalidPDFException}}),Object.defineProperty(v,"MissingPDFException",{enumerable:!0,get:function(){return o.MissingPDFException}}),Object.defineProperty(v,"OPS",{enumerable:!0,get:function(){return o.OPS}}),Object.defineProperty(v,"PDFDataRangeTransport",{enumerable:!0,get:function(){return t.PDFDataRangeTransport}}),Object.defineProperty(v,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(v,"PDFWorker",{enumerable:!0,get:function(){return t.PDFWorker}}),Object.defineProperty(v,"PasswordResponses",{enumerable:!0,get:function(){return o.PasswordResponses}}),Object.defineProperty(v,"PermissionFlag",{enumerable:!0,get:function(){return o.PermissionFlag}}),Object.defineProperty(v,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(v,"PromiseCapability",{enumerable:!0,get:function(){return o.PromiseCapability}}),Object.defineProperty(v,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(v,"SVGGraphics",{enumerable:!0,get:function(){return t.SVGGraphics}}),Object.defineProperty(v,"UnexpectedResponseException",{enumerable:!0,get:function(){return o.UnexpectedResponseException}}),Object.defineProperty(v,"Util",{enumerable:!0,get:function(){return o.Util}}),Object.defineProperty(v,"VerbosityLevel",{enumerable:!0,get:function(){return o.VerbosityLevel}}),Object.defineProperty(v,"XfaLayer",{enumerable:!0,get:function(){return s.XfaLayer}}),Object.defineProperty(v,"build",{enumerable:!0,get:function(){return t.build}}),Object.defineProperty(v,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return o.createValidAbsoluteUrl}}),Object.defineProperty(v,"getDocument",{enumerable:!0,get:function(){return t.getDocument}}),Object.defineProperty(v,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(v,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(v,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(v,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(v,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(v,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(v,"noContextMenu",{enumerable:!0,get:function(){return r.noContextMenu}}),Object.defineProperty(v,"normalizeUnicode",{enumerable:!0,get:function(){return o.normalizeUnicode}}),Object.defineProperty(v,"renderTextLayer",{enumerable:!0,get:function(){return a.renderTextLayer}}),Object.defineProperty(v,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(v,"shadow",{enumerable:!0,get:function(){return o.shadow}}),Object.defineProperty(v,"updateTextLayer",{enumerable:!0,get:function(){return a.updateTextLayer}}),Object.defineProperty(v,"version",{enumerable:!0,get:function(){return t.version}});var o=__w_pdfjs_require__(1),t=__w_pdfjs_require__(124),r=__w_pdfjs_require__(168),a=__w_pdfjs_require__(195),f=__w_pdfjs_require__(196),g=__w_pdfjs_require__(165),y=__w_pdfjs_require__(198),P=__w_pdfjs_require__(176),s=__w_pdfjs_require__(201)})(),__webpack_exports__})())})(pdf$2)),pdf$2.exports}var pdfExports=requirePdf();const pdf=getDefaultExportFromCjs(pdfExports),pdf$1=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]);
9export{pdf$1 as p};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.