PageSourceSearch

https://nectagas.com.br/_next/static/chunks/906a09f8.3e24791722cdc700.js

js nectagas.com.br collected 2026-10-05 18:24:23 UTC 318,995 bytes, 3 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fa49d9c7-9065-4f59-a3ec-cefcadcc42b6",e._sentryDebugIdIdentifier="sentry-dbid-fa49d9c7-9065-4f59-a3ec-cefcadcc42b6")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[824],{78783:function(module,__unused_webpack_exports,__webpack_require__){var process=__webpack_require__(83454),Buffer=__webpack_require__(48764).Buffer;!function(o,l){module.exports=l()}(globalThis,()=>(()=>{var __webpack_modules__=[,(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.VerbosityLevel=l.Util=l.UnknownErrorException=l.UnexpectedResponseException=l.TextRenderingMode=l.RenderingIntentFlag=l.PromiseCapability=l.PermissionFlag=l.PasswordResponses=l.PasswordException=l.PageActionEventType=l.OPS=l.MissingPDFException=l.MAX_IMAGE_SIZE_TO_CACHE=l.LINE_FACTOR=l.LINE_DESCENT_FACTOR=l.InvalidPDFException=l.ImageKind=l.IDENTITY_MATRIX=l.FormatError=l.FeatureTest=l.FONT_IDENTITY_MATRIX=l.DocumentActionEventType=l.CMapCompressionType=l.BaseException=l.BASELINE_FACTOR=l.AnnotationType=l.AnnotationReplyType=l.AnnotationMode=l.AnnotationFlag=l.AnnotationFieldFlag=l.AnnotationEditorType=l.AnnotationEditorPrefix=l.AnnotationEditorParamsType=l.AnnotationBorderStyleType=l.AnnotationActionEventType=l.AbortException=void 0,l.assert=tp,l.bytesToString=tw,l.createValidAbsoluteUrl=tg,l.getModificationDate=tG,l.getVerbosityLevel=th,l.info=td,l.isArrayBuffer=tH,l.isArrayEqual=tz,l.normalizeUnicode=t$,l.objectFromMap=tR,l.objectSize=tM,l.setVerbosityLevel=tl,l.shadow=tm,l.string32=tk,l.stringToBytes=tP,l.stringToPDFString=tj,l.stringToUTF8String=tB,l.unreachable=tu,l.utf8StringToString=tU,l.warn=tc,globalThis._pdfjsCompatibilityChecked||(globalThis._pdfjsCompatibilityChecked=!0,u(2));let A=[1,0,0,1,0,0];l.IDENTITY_MATRIX=A;let S=[.001,0,0,.001,0,0];l.FONT_IDENTITY_MATRIX=S;let E=1e7;l.MAX_IMAGE_SIZE_TO_CACHE=E;let T=1.35;l.LINE_FACTOR=T;let M=.35;l.LINE_DESCENT_FACTOR=M;let I=M/T;l.BASELINE_FACTOR=I;let D={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};l.RenderingIntentFlag=D;let L={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};l.AnnotationMode=L;let N="pdfjs_internal_editor_";l.AnnotationEditorPrefix=N;let U={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};l.AnnotationEditorType=U;let H={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};l.AnnotationEditorParamsType=H;let z={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};l.PermissionFlag=z;let W={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};l.TextRenderingMode=W;let X={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};l.ImageKind=X;let K={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};l.AnnotationType=K;let Y={GROUP:"Group",REPLY:"R"};l.AnnotationReplyType=Y;let J={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};l.AnnotationFlag=J;let Q={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};l.AnnotationFieldFlag=Q;let Z={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};l.AnnotationBorderStyleType=Z;let tt={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};l.AnnotationActionEventType=tt;let te={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};l.DocumentActionEventType=te;let ti={O:"PageOpen",C:"PageClose"};l.PageActionEventType=ti;let tr={ERRORS:0,WARNINGS:1,INFOS:5};l.VerbosityLevel=tr;let ts={NONE:0,BINARY:1};l.CMapCompressionType=ts;
1let tn={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};l.OPS=tn;let ta={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};l.PasswordResponses=ta;let to=tr.WARNINGS;function tl(o){Number.isInteger(o)&&(to=o)}function th(){return to}function td(o){to>=tr.INFOS&&console.log(`Info: ${o}`)}function tc(o){to>=tr.WARNINGS&&console.log(`Warning: ${o}`)}function tu(o){throw Error(o)}function tp(o,l){o||tu(l)}function tf(o){switch(o?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function tg(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!o)return null;try{if(u&&"string"==typeof o){if(u.addDefaultProtocol&&o.startsWith("www.")){let l=o.match(/\./g);l?.length>=2&&(o=`http://${o}`)}if(u.tryConvertEncoding)try{o=tB(o)}catch{}}let A=l?new URL(o,l):new URL(o);if(tf(A))return A}catch{}return null}function tm(o,l,u){let A=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(o,l,{value:u,enumerable:!A,configurable:!0,writable:!1}),u}let tb=function(){function o(l,u){this.constructor===o&&tu("Cannot initialize BaseException."),this.message=l,this.name=u}return o.prototype=Error(),o.constructor=o,o}();l.BaseException=tb;class tv extends tb{constructor(o,l){super(o,"PasswordException"),this.code=l}}l.PasswordException=tv;class tA extends tb{constructor(o,l){super(o,"UnknownErrorException"),this.details=l}}l.UnknownErrorException=tA;class t_ extends tb{constructor(o){super(o,"InvalidPDFException")}}l.InvalidPDFException=t_;class tS extends tb{constructor(o){super(o,"MissingPDFException")}}l.MissingPDFException=tS;class tE extends tb{constructor(o,l){super(o,"UnexpectedResponseException"),this.status=l}}l.UnexpectedResponseException=tE;class tC extends tb{constructor(o){super(o,"FormatError")}}l.FormatError=tC;class tT extends tb{constructor(o){super(o,"AbortException")}}function tw(o){("object"!=typeof o||o?.length===void 0)&&tu("Invalid argument for bytesToString");let l=o.length,u=8192;if(l<u)return String.fromCharCode.apply(null,o);let A=[];for(let S=0;S<l;S+=u){let E=Math.min(S+u,l),T=o.subarray(S,E);A.push(String.fromCharCode.apply(null,T))}return A.join("")}function tP(o){"string"!=typeof o&&tu("Invalid argument for stringToBytes");let l=o.length,u=new Uint8Array(l);for(let A=0;A<l;++A)u[A]=255&o.charCodeAt(A);return u}function tk(o){return String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o)}function tM(o){return Object.keys(o).length}function tR(o){let l=Object.create(null);for(let[u,A]of o)l[u]=A;return l}function tF(){let o=new Uint8Array(4);o[0]=1;let l=new Uint32Array(o.buffer,0,1);return 1===l[0]}function tO(){try{return Function(""),!0}catch{return!1}}l.AbortException=tT;class tI{static get isLittleEndian(){return tm(this,"isLittleEndian",tF())}static get isEvalSupported(){return tm(this,"isEvalSupported",tO())}static get isOffscreenCanvasSupported(){return tm(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?tm(this,"platform",{isWin:!1,isMac:!1}):tm(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}}l.FeatureTest=tI;let tD=[...Array(256).keys()].map(o=>o.toString(16).padStart(2,"0"));class tL{static makeHexColor(o,l,u){return`#${tD[o]}${tD[l]}${tD[u]}`}static scaleMinMax(o,l){let u;o[0]?(o[0]<0&&(u=l[0],l[0]=l[1],l[1]=u),l[0]*=o[0],l[1]*=o[0],o[3]<0&&(u=l[2],l[2]=l[3],l[3]=u),l[2]*=o[3],l[3]*=o[3]):(u=l[0],l[0]=l[2],l[2]=u,u=l[1],l[1]=l[3],l[3]=u,o[1]<0&&(u=l[2],l[2]=l[3],l[3]=u),l[2]*=o[1],l[3]*=o[1],o[2]<0&&(u=l[0],l[0]=l[1],l[1]=u),l[0]*=o[2],l[1]*=o[2]),l[0]+=o[4],l[1]+=o[4],l[2]+=o[5],l[3]+=o[5]}static transform(o,l){return[o[0]*l[0]+o[2]*l[1],o[1]*l[0]+o[3]*l[1],o[0]*l[2]+o[2]*l[3],o[1]*l[2]+o[3]*l[3],o[0]*l[4]+o[2]*l[5]+o[4],o[1]*l[4]+o[3]*l[5]+o[5]]}static applyTransform(o,l){let u=o[0]*l[0]+o[1]*l[2]+l[4],A=o[0]*l[1]+o[1]*l[3]+l[5];return[u,A]}static applyInverseTransform(o,l){let u=l[0]*l[3]-l[1]*l[2],A=(o[0]
1*l[3]-o[1]*l[2]+l[2]*l[5]-l[4]*l[3])/u,S=(-o[0]*l[1]+o[1]*l[0]+l[4]*l[1]-l[5]*l[0])/u;return[A,S]}static getAxialAlignedBoundingBox(o,l){let u=this.applyTransform(o,l),A=this.applyTransform(o.slice(2,4),l),S=this.applyTransform([o[0],o[3]],l),E=this.applyTransform([o[2],o[1]],l);return[Math.min(u[0],A[0],S[0],E[0]),Math.min(u[1],A[1],S[1],E[1]),Math.max(u[0],A[0],S[0],E[0]),Math.max(u[1],A[1],S[1],E[1])]}static inverseTransform(o){let l=o[0]*o[3]-o[1]*o[2];return[o[3]/l,-o[1]/l,-o[2]/l,o[0]/l,(o[2]*o[5]-o[4]*o[3])/l,(o[4]*o[1]-o[5]*o[0])/l]}static singularValueDecompose2dScale(o){let l=[o[0],o[2],o[1],o[3]],u=o[0]*l[0]+o[1]*l[2],A=o[0]*l[1]+o[1]*l[3],S=o[2]*l[0]+o[3]*l[2],E=o[2]*l[1]+o[3]*l[3],T=(u+E)/2,M=Math.sqrt((u+E)**2-4*(u*E-S*A))/2,I=T+M||1,D=T-M||1;return[Math.sqrt(I),Math.sqrt(D)]}static normalizeRect(o){let l=o.slice(0);return o[0]>o[2]&&(l[0]=o[2],l[2]=o[0]),o[1]>o[3]&&(l[1]=o[3],l[3]=o[1]),l}static intersect(o,l){let u=Math.max(Math.min(o[0],o[2]),Math.min(l[0],l[2])),A=Math.min(Math.max(o[0],o[2]),Math.max(l[0],l[2]));if(u>A)return null;let S=Math.max(Math.min(o[1],o[3]),Math.min(l[1],l[3])),E=Math.min(Math.max(o[1],o[3]),Math.max(l[1],l[3]));return S>E?null:[u,S,A,E]}static bezierBoundingBox(o,l,u,A,S,E,T,M){let I,D,L,N,U,H,z,W;let X=[],K=[[],[]];for(let K=0;K<2;++K){if(0===K?(D=6*o-12*u+6*S,I=-3*o+9*u-9*S+3*T,L=3*u-3*o):(D=6*l-12*A+6*E,I=-3*l+9*A-9*E+3*M,L=3*A-3*l),1e-12>Math.abs(I)){if(1e-12>Math.abs(D))continue;0<(N=-L/D)&&N<1&&X.push(N);continue}W=Math.sqrt(z=D*D-4*L*I),!(z<0)&&(0<(U=(-D+W)/(2*I))&&U<1&&X.push(U),0<(H=(-D-W)/(2*I))&&H<1&&X.push(H))}let Y=X.length,J,Q=Y;for(;Y--;)J=1-(N=X[Y]),K[0][Y]=J*J*J*o+3*J*J*N*u+3*J*N*N*S+N*N*N*T,K[1][Y]=J*J*J*l+3*J*J*N*A+3*J*N*N*E+N*N*N*M;return K[0][Q]=o,K[1][Q]=l,K[0][Q+1]=T,K[1][Q+1]=M,K[0].length=K[1].length=Q+2,[Math.min(...K[0]),Math.min(...K[1]),Math.max(...K[0]),Math.max(...K[1])]}}l.Util=tL;let tN=[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 tj(o){if(o[0]>="\xef"){let l;if("\xfe"===o[0]&&"\xff"===o[1]?l="utf-16be":"\xff"===o[0]&&"\xfe"===o[1]?l="utf-16le":"\xef"===o[0]&&"\xbb"===o[1]&&"\xbf"===o[2]&&(l="utf-8"),l)try{let u=new TextDecoder(l,{fatal:!0}),A=tP(o);return u.decode(A)}catch(o){tc(`stringToPDFString: "${o}".`)}}let l=[];for(let u=0,A=o.length;u<A;u++){let A=tN[o.charCodeAt(u)];l.push(A?String.fromCharCode(A):o.charAt(u))}return l.join("")}function tB(o){return decodeURIComponent(escape(o))}function tU(o){return unescape(encodeURIComponent(o))}function tH(o){return"object"==typeof o&&o?.byteLength!==void 0}function tz(o,l){if(o.length!==l.length)return!1;for(let u=0,A=o.length;u<A;u++)if(o[u]!==l[u])return!1;return!0}function tG(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,l=[o.getUTCFullYear().toString(),(o.getUTCMonth()+1).toString().padStart(2,"0"),o.getUTCDate().toString().padStart(2,"0"),o.getUTCHours().toString().padStart(2,"0"),o.getUTCMinutes().toString().padStart(2,"0"),o.getUTCSeconds().toString().padStart(2,"0")];return l.join("")}class tW{#t=!1;constructor(){this.promise=new Promise((o,l)=>{this.resolve=l=>{this.#t=!0,o(l)},this.reject=o=>{this.#t=!0,l(o)}})}get settled(){return this.#t}}l.PromiseCapability=tW;let tq=null,tV=null;function t$(o){return tq||(tq=/([\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,tV=new Map([["ſt","ſt"]])),o.replaceAll(tq,(o,l,u)=>l?l.normalize("NFKC"):tV.get(u))}},(o,l,u)=>{"use strict";var A=u(3);!function(){!globalThis.DOMMatrix&&A.isNodeJS&&(globalThis.DOMMatrix=__webpack_require__(14601).DOMMatrix)}(),function(){if(globalThis.Path2D||!A.isNodeJS)return;let{CanvasRenderingContext2D:o}=__webpack_require__(14601),{polyfillPath2D:l}=__webpack_require__(70409);globalThis.CanvasRenderingContext2D=o,l(globalThis)}(),function(){globalThis.structuredClone||u(4)}()},(o,l)=>{"use strict";
1Object.defineProperty(l,"__esModule",{value:!0}),l.isNodeJS=void 0;let u="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);l.isNodeJS=u},(o,l,u)=>{u(5),u(88),u(92),u(116),u(118);var A=u(130);o.exports=A.structuredClone},(o,l,u)=>{"use strict";var A=u(6),S=u(14),E=u(61),T=u(62),M=u(36).f,I=u(66),D=u(87),L=u(18),N=u(34),U="Array Iterator",H=T.set,z=T.getterFor(U);o.exports=I(Array,"Array",function(o,l){H(this,{type:U,target:A(o),index:0,kind:l})},function(){var o=z(this),l=o.target,u=o.kind,A=o.index++;return!l||A>=l.length?(o.target=void 0,D(void 0,!0)):"keys"==u?D(A,!1):"values"==u?D(l[A],!1):D([A,l[A]],!1)},"values");var W=E.Arguments=E.Array;if(S("keys"),S("values"),S("entries"),!L&&N&&"values"!==W.name)try{M(W,"name",{value:"values"})}catch(o){}},(o,l,u)=>{var A=u(7),S=u(12);o.exports=function(o){return A(S(o))}},(o,l,u)=>{var A=u(8),S=u(10),E=u(11),T=Object,M=A("".split);o.exports=S(function(){return!T("z").propertyIsEnumerable(0)})?function(o){return"String"==E(o)?M(o,""):T(o)}:T},(o,l,u)=>{var A=u(9),S=Function.prototype,E=S.call,T=A&&S.bind.bind(E,E);o.exports=A?T:function(o){return function(){return E.apply(o,arguments)}}},(o,l,u)=>{var A=u(10);o.exports=!A(function(){var o=(function(){}).bind();return"function"!=typeof o||o.hasOwnProperty("prototype")})},o=>{o.exports=function(o){try{return!!o()}catch(o){return!0}}},(o,l,u)=>{var A=u(8),S=A({}.toString),E=A("".slice);o.exports=function(o){return E(S(o),8,-1)}},(o,l,u)=>{var A=u(13),S=TypeError;o.exports=function(o){if(A(o))throw S("Can't call method on "+o);return o}},o=>{o.exports=function(o){return null==o}},(o,l,u)=>{var A=u(15),S=u(28),E=u(36).f,T=A("unscopables"),M=Array.prototype;void 0==M[T]&&E(M,T,{configurable:!0,value:S(null)}),o.exports=function(o){M[T][o]=!0}},(o,l,u)=>{var A=u(16),S=u(17),E=u(21),T=u(23),M=u(24),I=u(27),D=A.Symbol,L=S("wks"),N=I?D.for||D:D&&D.withoutSetter||T;o.exports=function(o){return E(L,o)||(L[o]=M&&E(D,o)?D[o]:N("Symbol."+o)),L[o]}},function(o){var l=function(o){return o&&o.Math==Math&&o};o.exports=l("object"==typeof globalThis&&globalThis)||l("object"==typeof window&&window)||l("object"==typeof self&&self)||l("object"==typeof __webpack_require__.g&&__webpack_require__.g)||function(){return this}()||this||Function("return this")()},(o,l,u)=>{var A=u(18),S=u(19);(o.exports=function(o,l){return S[o]||(S[o]=void 0!==l?l:{})})("versions",[]).push({version:"3.31.0",mode:A?"pure":"global",copyright:"\xa9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"})},o=>{o.exports=!1},(o,l,u)=>{var A=u(16),S=u(20),E="__core-js_shared__",T=A[E]||S(E,{});o.exports=T},(o,l,u)=>{var A=u(16),S=Object.defineProperty;o.exports=function(o,l){try{S(A,o,{value:l,configurable:!0,writable:!0})}catch(u){A[o]=l}return l}},(o,l,u)=>{var A=u(8),S=u(22),E=A({}.hasOwnProperty);o.exports=Object.hasOwn||function(o,l){return E(S(o),l)}},(o,l,u)=>{var A=u(12),S=Object;o.exports=function(o){return S(A(o))}},(o,l,u)=>{var A=u(8),S=0,E=Math.random(),T=A(1..toString);o.exports=function(o){return"Symbol("+(void 0===o?"":o)+")_"+T(++S+E,36)}},(o,l,u)=>{var A=u(25),S=u(10),E=u(16).String;o.exports=!!Object.getOwnPropertySymbols&&!S(function(){var o=Symbol();return!E(o)||!(Object(o) instanceof Symbol)||!Symbol.sham&&A&&A<41})},(o,l,u)=>{var A,S,E=u(16),T=u(26),M=E.process,I=E.Deno,D=M&&M.versions||I&&I.version,L=D&&D.v8;L&&(S=(A=L.split("."))[0]>0&&A[0]<4?1:+(A[0]+A[1])),!S&&T&&(!(A=T.match(/Edge\/(\d+)/))||A[1]>=74)&&(A=T.match(/Chrome\/(\d+)/))&&(S=+A[1]),o.exports=S},o=>{o.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(o,l,u)=>{var A=u(24);o.exports=A&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(o,l,u)=>{var A,S=u(29),E=u(33),T=u(58),M=u(57),I=u(59),D=u(38),L=u(60),N=">",U="<",H="prototype",z="script",W=L("IE_PROTO"),X=function(){},K=function(o){return U+z+N+o+U+"/"+z+N},Y=function(o){o.write(K("")),o.close();var l=o.parentWindow.Object;return o=null,l},J=function(){var o,l=D("iframe"),u="java"+z+":";return l.style.display="none",I.appendChild(l),l.src=String(u),(o=l.contentWindow.document).open(),o.write(K("document.F=Object")),o.close(),o.F},Q=function(){try{A=new ActiveXObject("htmlfile")}catch(o){}Q="undefined"!=typeof document?document.domain&&A?Y(A):J():Y(A);for(var o=T.length;o--;)delete Q[H][T[o]];return Q()};M[W]=!0,o.exports=Object.create||function(o,l){var u;return null!==o?(X[H]=S(o),u=new X,X[H]=null,u[W]=o):u=Q(),void 0===l?u:E.f(u,l)}},(o,l,u)=>{var A=u(30),S=String,E=TypeError;
1o.exports=function(o){if(A(o))return o;throw E(S(o)+" is not an object")}},(o,l,u)=>{var A=u(31),S=u(32),E=S.all;o.exports=S.IS_HTMLDDA?function(o){return"object"==typeof o?null!==o:A(o)||o===E}:function(o){return"object"==typeof o?null!==o:A(o)}},(o,l,u)=>{var A=u(32),S=A.all;o.exports=A.IS_HTMLDDA?function(o){return"function"==typeof o||o===S}:function(o){return"function"==typeof o}},o=>{var l="object"==typeof document&&document.all,u=void 0===l&&void 0!==l;o.exports={all:l,IS_HTMLDDA:u}},(o,l,u)=>{var A=u(34),S=u(35),E=u(36),T=u(29),M=u(6),I=u(49);l.f=A&&!S?Object.defineProperties:function(o,l){T(o);for(var u,A=M(l),S=I(l),D=S.length,L=0;D>L;)E.f(o,u=S[L++],A[u]);return o}},(o,l,u)=>{var A=u(10);o.exports=!A(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},(o,l,u)=>{var A=u(34),S=u(10);o.exports=A&&S(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(o,l,u)=>{var A=u(34),S=u(37),E=u(35),T=u(29),M=u(39),I=TypeError,D=Object.defineProperty,L=Object.getOwnPropertyDescriptor,N="enumerable",U="configurable",H="writable";l.f=A?E?function(o,l,u){if(T(o),l=M(l),T(u),"function"==typeof o&&"prototype"===l&&"value"in u&&H in u&&!u[H]){var A=L(o,l);A&&A[H]&&(o[l]=u.value,u={configurable:U in u?u[U]:A[U],enumerable:N in u?u[N]:A[N],writable:!1})}return D(o,l,u)}:D:function(o,l,u){if(T(o),l=M(l),T(u),S)try{return D(o,l,u)}catch(o){}if("get"in u||"set"in u)throw I("Accessors not supported");return"value"in u&&(o[l]=u.value),o}},(o,l,u)=>{var A=u(34),S=u(10),E=u(38);o.exports=!A&&!S(function(){return 7!=Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a})},(o,l,u)=>{var A=u(16),S=u(30),E=A.document,T=S(E)&&S(E.createElement);o.exports=function(o){return T?E.createElement(o):{}}},(o,l,u)=>{var A=u(40),S=u(42);o.exports=function(o){var l=A(o,"string");return S(l)?l:l+""}},(o,l,u)=>{var A=u(41),S=u(30),E=u(42),T=u(45),M=u(48),I=u(15),D=TypeError,L=I("toPrimitive");o.exports=function(o,l){if(!S(o)||E(o))return o;var u,I=T(o,L);if(I){if(void 0===l&&(l="default"),!S(u=A(I,o,l))||E(u))return u;throw D("Can't convert object to primitive value")}return void 0===l&&(l="number"),M(o,l)}},(o,l,u)=>{var A=u(9),S=Function.prototype.call;o.exports=A?S.bind(S):function(){return S.apply(S,arguments)}},(o,l,u)=>{var A=u(43),S=u(31),E=u(44),T=u(27),M=Object;o.exports=T?function(o){return"symbol"==typeof o}:function(o){var l=A("Symbol");return S(l)&&E(l.prototype,M(o))}},(o,l,u)=>{var A=u(16),S=u(31),E=function(o){return S(o)?o:void 0};o.exports=function(o,l){return arguments.length<2?E(A[o]):A[o]&&A[o][l]}},(o,l,u)=>{var A=u(8);o.exports=A({}.isPrototypeOf)},(o,l,u)=>{var A=u(46),S=u(13);o.exports=function(o,l){var u=o[l];return S(u)?void 0:A(u)}},(o,l,u)=>{var A=u(31),S=u(47),E=TypeError;o.exports=function(o){if(A(o))return o;throw E(S(o)+" is not a function")}},o=>{var l=String;o.exports=function(o){try{return l(o)}catch(o){return"Object"}}},(o,l,u)=>{var A=u(41),S=u(31),E=u(30),T=TypeError;o.exports=function(o,l){var u,M;if("string"===l&&S(u=o.toString)&&!E(M=A(u,o))||S(u=o.valueOf)&&!E(M=A(u,o))||"string"!==l&&S(u=o.toString)&&!E(M=A(u,o)))return M;throw T("Can't convert object to primitive value")}},(o,l,u)=>{var A=u(50),S=u(58);o.exports=Object.keys||function(o){return A(o,S)}},(o,l,u)=>{var A=u(8),S=u(21),E=u(6),T=u(51).indexOf,M=u(57),I=A([].push);o.exports=function(o,l){var u,A=E(o),D=0,L=[];for(u in A)!S(M,u)&&S(A,u)&&I(L,u);for(;l.length>D;)S(A,u=l[D++])&&(~T(L,u)||I(L,u));return L}},(o,l,u)=>{var A=u(6),S=u(52),E=u(55),T=function(o){return function(l,u,T){var M,I=A(l),D=E(I),L=S(T,D);if(o&&u!=u){for(;D>L;)if((M=I[L++])!=M)return!0}else for(;D>L;L++)if((o||L in I)&&I[L]===u)return o||L||0;return!o&&-1}};o.exports={includes:T(!0),indexOf:T(!1)}},(o,l,u)=>{var A=u(53),S=Math.max,E=Math.min;o.exports=function(o,l){var u=A(o);return u<0?S(u+l,0):E(u,l)}},(o,l,u)=>{var A=u(54);o.exports=function(o){var l=+o;return l!=l||0===l?0:A(l)}},o=>{var l=Math.ceil,u=Math.floor;o.exports=Math.trunc||function(o){var A=+o;return(A>0?u:l)(A)}},(o,l,u)=>{var A=u(56);o.exports=function(o){return A(o.length)}},(o,l,u)=>{var A=u(53),S=Math.min;o.exports=function(o){return o>0?S(A(o),9007199254740991):0}},o=>{o.exports={}},o=>{o.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
1ing","toString","valueOf"]},(o,l,u)=>{var A=u(43);o.exports=A("document","documentElement")},(o,l,u)=>{var A=u(17),S=u(23),E=A("keys");o.exports=function(o){return E[o]||(E[o]=S(o))}},o=>{o.exports={}},(o,l,u)=>{var A,S,E,T=u(63),M=u(16),I=u(30),D=u(64),L=u(21),N=u(19),U=u(60),H=u(57),z="Object already initialized",W=M.TypeError,X=M.WeakMap,K=function(o){return E(o)?S(o):A(o,{})},Y=function(o){return function(l){var u;if(!I(l)||(u=S(l)).type!==o)throw W("Incompatible receiver, "+o+" required");return u}};if(T||N.state){var J=N.state||(N.state=new X);J.get=J.get,J.has=J.has,J.set=J.set,A=function(o,l){if(J.has(o))throw W(z);return l.facade=o,J.set(o,l),l},S=function(o){return J.get(o)||{}},E=function(o){return J.has(o)}}else{var Q=U("state");H[Q]=!0,A=function(o,l){if(L(o,Q))throw W(z);return l.facade=o,D(o,Q,l),l},S=function(o){return L(o,Q)?o[Q]:{}},E=function(o){return L(o,Q)}}o.exports={set:A,get:S,has:E,enforce:K,getterFor:Y}},(o,l,u)=>{var A=u(16),S=u(31),E=A.WeakMap;o.exports=S(E)&&/native code/.test(String(E))},(o,l,u)=>{var A=u(34),S=u(36),E=u(65);o.exports=A?function(o,l,u){return S.f(o,l,E(1,u))}:function(o,l,u){return o[l]=u,o}},o=>{o.exports=function(o,l){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:l}}},(o,l,u)=>{"use strict";var A=u(67),S=u(41),E=u(18),T=u(72),M=u(31),I=u(79),D=u(81),L=u(84),N=u(83),U=u(64),H=u(70),z=u(15),W=u(61),X=u(80),K=T.PROPER,Y=T.CONFIGURABLE,J=X.IteratorPrototype,Q=X.BUGGY_SAFARI_ITERATORS,Z=z("iterator"),tt="keys",te="values",ti="entries",tr=function(){return this};o.exports=function(o,l,u,T,z,X,ts){I(u,l,T);var tn,ta,to,tl=function(o){if(o===z&&tp)return tp;if(!Q&&o in tc)return tc[o];switch(o){case tt:case te:case ti:return function(){return new u(this,o)}}return function(){return new u(this)}},th=l+" Iterator",td=!1,tc=o.prototype,tu=tc[Z]||tc["@@iterator"]||z&&tc[z],tp=!Q&&tu||tl(z),tf="Array"==l&&tc.entries||tu;if(tf&&(tn=D(tf.call(new o)))!==Object.prototype&&tn.next&&(E||D(tn)===J||(L?L(tn,J):M(tn[Z])||H(tn,Z,tr)),N(tn,th,!0,!0),E&&(W[th]=tr)),K&&z==te&&tu&&tu.name!==te&&(!E&&Y?U(tc,"name",te):(td=!0,tp=function(){return S(tu,this)})),z){if(ta={values:tl(te),keys:X?tp:tl(tt),entries:tl(ti)},ts)for(to in ta)!Q&&!td&&to in tc||H(tc,to,ta[to]);else A({target:l,proto:!0,forced:Q||td},ta)}return(!E||ts)&&tc[Z]!==tp&&H(tc,Z,tp,{name:z}),W[l]=tp,ta}},(o,l,u)=>{var A=u(16),S=u(68).f,E=u(64),T=u(70),M=u(20),I=u(74),D=u(78);o.exports=function(o,l){var u,L,N,U,H,z=o.target,W=o.global,X=o.stat;if(u=W?A:X?A[z]||M(z,{}):(A[z]||{}).prototype)for(L in l){if(U=l[L],N=o.dontCallGetSet?(H=S(u,L))&&H.value:u[L],!D(W?L:z+(X?".":"#")+L,o.forced)&&void 0!==N){if(typeof U==typeof N)continue;I(U,N)}(o.sham||N&&N.sham)&&E(U,"sham",!0),T(u,L,U,o)}}},(o,l,u)=>{var A=u(34),S=u(41),E=u(69),T=u(65),M=u(6),I=u(39),D=u(21),L=u(37),N=Object.getOwnPropertyDescriptor;l.f=A?N:function(o,l){if(o=M(o),l=I(l),L)try{return N(o,l)}catch(o){}if(D(o,l))return T(!S(E.f,o,l),o[l])}},(o,l)=>{"use strict";var u={}.propertyIsEnumerable,A=Object.getOwnPropertyDescriptor,S=A&&!u.call({1:2},1);l.f=S?function(o){var l=A(this,o);return!!l&&l.enumerable}:u},(o,l,u)=>{var A=u(31),S=u(36),E=u(71),T=u(20);o.exports=function(o,l,u,M){M||(M={});var I=M.enumerable,D=void 0!==M.name?M.name:l;if(A(u)&&E(u,D,M),M.global)I?o[l]=u:T(l,u);else{try{M.unsafe?o[l]&&(I=!0):delete o[l]}catch(o){}I?o[l]=u:S.f(o,l,{value:u,enumerable:!1,configurable:!M.nonConfigurable,writable:!M.nonWritable})}return o}},(o,l,u)=>{var A=u(8),S=u(10),E=u(31),T=u(21),M=u(34),I=u(72).CONFIGURABLE,D=u(73),L=u(62),N=L.enforce,U=L.get,H=String,z=Object.defineProperty,W=A("".slice),X=A("".replace),K=A([].join),Y=M&&!S(function(){return 8!==z(function(){},"length",{value:8}).length}),J=String(String).split("String"),Q=o.exports=function(o,l,u){"Symbol("===W(H(l),0,7)&&(l="["+X(H(l),/^Symbol\(([^)]*)\)/,"$1")+"]"),u&&u.getter&&(l="get "+l),u&&u.setter&&(l="set "+l),(!T(o,"name")||I&&o.name!==l)&&(M?z(o,"name",{value:l,configurable:!0}):o.name=l),Y&&u&&T(u,"arity")&&o.length!==u.arity&&z(o,"length",{value:u.arity});try{u&&T(u,"constructor")&&u.constructor?M&&z(o,"prototype",{writable:!1}):o.prototype&&(o.prototype=void 0)}catch(o){}var A=N(o);return T(A,"source")||(A.source=K(J,"string"==typeof l?l:"")),o};Function.prototype.toString=Q(function(){return E(this)&&U(this).source||D(this)},"toString")},(o,l,u)=>
vendor: 2,268 bytes, line 1
1{var A=u(34),S=u(21),E=Function.prototype,T=A&&Object.getOwnPropertyDescriptor,M=S(E,"name"),I=M&&"something"===(function(){}).name,D=M&&(!A||A&&T(E,"name").configurable);o.exports={EXISTS:M,PROPER:I,CONFIGURABLE:D}},(o,l,u)=>{var A=u(8),S=u(31),E=u(19),T=A(Function.toString);S(E.inspectSource)||(E.inspectSource=function(o){return T(o)}),o.exports=E.inspectSource},(o,l,u)=>{var A=u(21),S=u(75),E=u(68),T=u(36);o.exports=function(o,l,u){for(var M=S(l),I=T.f,D=E.f,L=0;L<M.length;L++){var N=M[L];A(o,N)||u&&A(u,N)||I(o,N,D(l,N))}}},(o,l,u)=>{var A=u(43),S=u(8),E=u(76),T=u(77),M=u(29),I=S([].concat);o.exports=A("Reflect","ownKeys")||function(o){var l=E.f(M(o)),u=T.f;return u?I(l,u(o)):l}},(o,l,u)=>{var A=u(50),S=u(58).concat("length","prototype");l.f=Object.getOwnPropertyNames||function(o){return A(o,S)}},(o,l)=>{l.f=Object.getOwnPropertySymbols},(o,l,u)=>{var A=u(10),S=u(31),E=/#|\.prototype\./,T=function(o,l){var u=I[M(o)];return u==L||u!=D&&(S(l)?A(l):!!l)},M=T.normalize=function(o){return String(o).replace(E,".").toLowerCase()},I=T.data={},D=T.NATIVE="N",L=T.POLYFILL="P";o.exports=T},(o,l,u)=>{"use strict";var A=u(80).IteratorPrototype,S=u(28),E=u(65),T=u(83),M=u(61),I=function(){return this};o.exports=function(o,l,u,D){var L=l+" Iterator";return o.prototype=S(A,{next:E(+!D,u)}),T(o,L,!1,!0),M[L]=I,o}},(o,l,u)=>{"use strict";var A,S,E,T=u(10),M=u(31),I=u(30),D=u(28),L=u(81),N=u(70),U=u(15),H=u(18),z=U("iterator"),W=!1;[].keys&&("next"in(E=[].keys())?(S=L(L(E)))!==Object.prototype&&(A=S):W=!0),!I(A)||T(function(){var o={};return A[z].call(o)!==o})?A={}:H&&(A=D(A)),M(A[z])||N(A,z,function(){return this}),o.exports={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:W}},(o,l,u)=>{var A=u(21),S=u(31),E=u(22),T=u(60),M=u(82),I=T("IE_PROTO"),D=Object,L=D.prototype;o.exports=M?D.getPrototypeOf:function(o){var l=E(o);if(A(l,I))return l[I];var u=l.constructor;return S(u)&&l instanceof u?u.prototype:l instanceof D?L:null}},(o,l,u)=>{var A=u(10);o.exports=!A(function(){function o(){}return o.prototype.constructor=null,Object.getPrototypeOf(new o)!==o.prototype})},(o,l,u)=>{var A=u(36).f,S=u(21),E=u(15)("toStringTag");o.exports=function(o,l,u){o&&!u&&(o=o.prototype),o&&!S(o,E)&&A(o,E,{configurable:!0,value:l})}},(o,l,u)=>{var A=u(85),S=u(29),E=u(86);
1o.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var o,l=!1,u={};try{(o=A(Object.prototype,"__proto__","set"))(u,[]),l=u instanceof Array}catch(o){}return function(u,A){return S(u),E(A),l?o(u,A):u.__proto__=A,u}}():void 0)},(o,l,u)=>{var A=u(8),S=u(46);o.exports=function(o,l,u){try{return A(S(Object.getOwnPropertyDescriptor(o,l)[u]))}catch(o){}}},(o,l,u)=>{var A=u(31),S=String,E=TypeError;o.exports=function(o){if("object"==typeof o||A(o))return o;throw E("Can't set "+S(o)+" as a prototype")}},o=>{o.exports=function(o,l){return{value:o,done:l}}},(o,l,u)=>{var A=u(89),S=u(70),E=u(90);A||S(Object.prototype,"toString",E,{unsafe:!0})},(o,l,u)=>{var A=u(15)("toStringTag"),S={};S[A]="z",o.exports="[object z]"===String(S)},(o,l,u)=>{"use strict";var A=u(89),S=u(91);o.exports=A?({}).toString:function(){return"[object "+S(this)+"]"}},(o,l,u)=>{var A=u(89),S=u(31),E=u(11),T=u(15)("toStringTag"),M=Object,I="Arguments"==E(function(){return arguments}()),D=function(o,l){try{return o[l]}catch(o){}};o.exports=A?E:function(o){var l,u,A;return void 0===o?"Undefined":null===o?"Null":"string"==typeof(u=D(l=M(o),T))?u:I?E(l):"Object"==(A=E(l))&&S(l.callee)?"Arguments":A}},(o,l,u)=>{u(93)},(o,l,u)=>{"use strict";u(94)("Map",function(o){return function(){return o(this,arguments.length?arguments[0]:void 0)}},u(112))},(o,l,u)=>{"use strict";var A=u(67),S=u(16),E=u(8),T=u(78),M=u(70),I=u(95),D=u(102),L=u(109),N=u(31),U=u(13),H=u(30),z=u(10),W=u(110),X=u(83),K=u(111);o.exports=function(o,l,u){var Y=-1!==o.indexOf("Map"),J=-1!==o.indexOf("Weak"),Q=Y?"set":"add",Z=S[o],tt=Z&&Z.prototype,te=Z,ti={},tr=function(o){var l=E(tt[o]);M(tt,o,"add"==o?function(o){return l(this,0===o?0:o),this}:"delete"==o?function(o){return(!J||!!H(o))&&l(this,0===o?0:o)}:"get"==o?function(o){return J&&!H(o)?void 0:l(this,0===o?0:o)}:"has"==o?function(o){return(!J||!!H(o))&&l(this,0===o?0:o)}:function(o,u){return l(this,0===o?0:o,u),this})};if(T(o,!N(Z)||!(J||tt.forEach&&!z(function(){new Z().entries().next()}))))te=u.getConstructor(l,o,Y,Q),I.enable();else if(T(o,!0)){var ts=new te,tn=ts[Q](J?{}:-0,1)!=ts,ta=z(function(){ts.has(1)}),to=W(function(o){new Z(o)}),tl=!J&&z(function(){for(var o=new Z,l=5;l--;)o[Q](l,l);return!o.has(-0)});to||((te=l(function(o,l){L(o,tt);var u=K(new Z,o,te);return U(l)||D(l,u[Q],{that:u,AS_ENTRIES:Y}),u})).prototype=tt,tt.constructor=te),(ta||tl)&&(tr("delete"),tr("has"),Y&&tr("get")),(tl||tn)&&tr(Q),J&&tt.clear&&delete tt.clear}return ti[o]=te,A({global:!0,constructor:!0,forced:te!=Z},ti),X(te,o),J||u.setStrong(te,o,Y),te}},(o,l,u)=>{var A=u(67),S=u(8),E=u(57),T=u(30),M=u(21),I=u(36).f,D=u(76),L=u(96),N=u(99),U=u(23),H=u(101),z=!1,W=U("meta"),X=0,K=function(o){I(o,W,{value:{objectID:"O"+X++,weakData:{}}})},Y=function(o,l){if(!T(o))return"symbol"==typeof o?o:("string"==typeof o?"S":"P")+o;if(!M(o,W)){if(!N(o))return"F";if(!l)return"E";K(o)}return o[W].objectID},J=function(o,l){if(!M(o,W)){if(!N(o))return!0;if(!l)return!1;K(o)}return o[W].weakData},Q=function(o){return H&&z&&N(o)&&!M(o,W)&&K(o),o},Z=function(){tt.enable=function(){},z=!0;var o=D.f,l=S([].splice),u={};u[W]=1,o(u).length&&(D.f=function(u){for(var A=o(u),S=0,E=A.length;S<E;S++)if(A[S]===W){l(A,S,1);break}return A},A({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:L.f}))},tt=o.exports={enable:Z,fastKey:Y,getWeakData:J,onFreeze:Q};E[W]=!0},(o,l,u)=>{var A=u(11),S=u(6),E=u(76).f,T=u(97),M="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],I=function(o){try{return E(o)}catch(o){return T(M)}};o.exports.f=function(o){return M&&"Window"==A(o)?I(o):E(S(o))}},(o,l,u)=>{var A=u(52),S=u(55),E=u(98),T=Array,M=Math.max;o.exports=function(o,l,u){for(var I=S(o),D=A(l,I),L=A(void 0===u?I:u,I),N=T(M(L-D,0)),U=0;D<L;D++,U++)E(N,U,o[D]);return N.length=U,N}},(o,l,u)=>{"use strict";var A=u(39),S=u(36),E=u(65);o.exports=function(o,l,u){var T=A(l);T in o?S.f(o,T,E(0,u)):o[T]=u}},(o,l,u)=>{var A=u(10),S=u(30),E=u(11),T=u(100),M=Object.isExtensible,I=A(function(){M(1)});o.exports=I||T?function(o){return!!S(o)&&(!T||"ArrayBuffer"!=E(o))&&(!M||M(o))}:M},(o,l,u)=>{var A=u(10);o.exports=A(function(){if("function"==typeof ArrayBuffer){var o=new ArrayBuffer(8);Object.isExtensible(o)&&Object.defineProperty(o,"a",{value:8})}})},(o,l,u)=>{var A=u(10);o.exports=!A(function(){return Object.isExtensible(Object.preventExtensions({}))})},(o,l,u)=>{var A=u(103),S=u(41),E=u(29),T=u(47),M=u(105),I=u(55),D=u(44),L=u(106),N=u(107),U=u(108),H=TypeError,z=function(o,l){this.stopped=o,this.result=l},W=z.prototype;
1o.exports=function(o,l,u){var X,K,Y,J,Q,Z,tt,te=u&&u.that,ti=!!(u&&u.AS_ENTRIES),tr=!!(u&&u.IS_RECORD),ts=!!(u&&u.IS_ITERATOR),tn=!!(u&&u.INTERRUPTED),ta=A(l,te),to=function(o){return X&&U(X,"normal",o),new z(!0,o)},tl=function(o){return ti?(E(o),tn?ta(o[0],o[1],to):ta(o[0],o[1])):tn?ta(o,to):ta(o)};if(tr)X=o.iterator;else if(ts)X=o;else{if(!(K=N(o)))throw H(T(o)+" is not iterable");if(M(K)){for(Y=0,J=I(o);J>Y;Y++)if((Q=tl(o[Y]))&&D(W,Q))return Q;return new z(!1)}X=L(o,K)}for(Z=tr?o.next:X.next;!(tt=S(Z,X)).done;){try{Q=tl(tt.value)}catch(o){U(X,"throw",o)}if("object"==typeof Q&&Q&&D(W,Q))return Q}return new z(!1)}},(o,l,u)=>{var A=u(104),S=u(46),E=u(9),T=A(A.bind);o.exports=function(o,l){return S(o),void 0===l?o:E?T(o,l):function(){return o.apply(l,arguments)}}},(o,l,u)=>{var A=u(11),S=u(8);o.exports=function(o){if("Function"===A(o))return S(o)}},(o,l,u)=>{var A=u(15),S=u(61),E=A("iterator"),T=Array.prototype;o.exports=function(o){return void 0!==o&&(S.Array===o||T[E]===o)}},(o,l,u)=>{var A=u(41),S=u(46),E=u(29),T=u(47),M=u(107),I=TypeError;o.exports=function(o,l){var u=arguments.length<2?M(o):l;if(S(u))return E(A(u,o));throw I(T(o)+" is not iterable")}},(o,l,u)=>{var A=u(91),S=u(45),E=u(13),T=u(61),M=u(15)("iterator");o.exports=function(o){if(!E(o))return S(o,M)||S(o,"@@iterator")||T[A(o)]}},(o,l,u)=>{var A=u(41),S=u(29),E=u(45);o.exports=function(o,l,u){var T,M;S(o);try{if(!(T=E(o,"return"))){if("throw"===l)throw u;return u}T=A(T,o)}catch(o){M=!0,T=o}if("throw"===l)throw u;if(M)throw T;return S(T),u}},(o,l,u)=>{var A=u(44),S=TypeError;o.exports=function(o,l){if(A(l,o))return o;throw S("Incorrect invocation")}},(o,l,u)=>{var A=u(15)("iterator"),S=!1;try{var E=0,T={next:function(){return{done:!!E++}},return:function(){S=!0}};T[A]=function(){return this},Array.from(T,function(){throw 2})}catch(o){}o.exports=function(o,l){if(!l&&!S)return!1;var u=!1;try{var E={};E[A]=function(){return{next:function(){return{done:u=!0}}}},o(E)}catch(o){}return u}},(o,l,u)=>{var A=u(31),S=u(30),E=u(84);o.exports=function(o,l,u){var T,M;return E&&A(T=l.constructor)&&T!==u&&S(M=T.prototype)&&M!==u.prototype&&E(o,M),o}},(o,l,u)=>{"use strict";var A=u(28),S=u(113),E=u(114),T=u(103),M=u(109),I=u(13),D=u(102),L=u(66),N=u(87),U=u(115),H=u(34),z=u(95).fastKey,W=u(62),X=W.set,K=W.getterFor;o.exports={getConstructor:function(o,l,u,L){var N=o(function(o,S){M(o,U),X(o,{type:l,index:A(null),first:void 0,last:void 0,size:0}),H||(o.size=0),I(S)||D(S,o[L],{that:o,AS_ENTRIES:u})}),U=N.prototype,W=K(l),Y=function(o,l,u){var A,S,E=W(o),T=J(o,l);return T?T.value=u:(E.last=T={index:S=z(l,!0),key:l,value:u,previous:A=E.last,next:void 0,removed:!1},E.first||(E.first=T),A&&(A.next=T),H?E.size++:o.size++,"F"!==S&&(E.index[S]=T)),o},J=function(o,l){var u,A=W(o),S=z(l);if("F"!==S)return A.index[S];for(u=A.first;u;u=u.next)if(u.key==l)return u};return E(U,{clear:function(){for(var o=this,l=W(o),u=l.index,A=l.first;A;)A.removed=!0,A.previous&&(A.previous=A.previous.next=void 0),delete u[A.index],A=A.next;l.first=l.last=void 0,H?l.size=0:o.size=0},delete:function(o){var l=this,u=W(l),A=J(l,o);if(A){var S=A.next,E=A.previous;delete u.index[A.index],A.removed=!0,E&&(E.next=S),S&&(S.previous=E),u.first==A&&(u.first=S),u.last==A&&(u.last=E),H?u.size--:l.size--}return!!A},forEach:function(o){for(var l,u=W(this),A=T(o,arguments.length>1?arguments[1]:void 0);l=l?l.next:u.first;)for(A(l.value,l.key,this);l&&l.removed;)l=l.previous},has:function(o){return!!J(this,o)}}),E(U,u?{get:function(o){var l=J(this,o);return l&&l.value},set:function(o,l){return Y(this,0===o?0:o,l)}}:{add:function(o){return Y(this,o=0===o?0:o,o)}}),H&&S(U,"size",{configurable:!0,get:function(){return W(this).size}}),N},setStrong:function(o,l,u){var A=l+" Iterator",S=K(l),E=K(A);L(o,l,function(o,l){X(this,{type:A,target:o,state:S(o),kind:l,last:void 0})},function(){for(var o=E(this),l=o.kind,u=o.last;u&&u.removed;)u=u.previous;return o.target&&(o.last=u=u?u.next:o.state.first)?"keys"==l?N(u.key,!1):"values"==l?N(u.value,!1):N([u.key,u.value],!1):(o.target=void 0,N(void 0,!0))},u?"entries":"values",!u,!0),U(l)}}},(o,l,u)=>{var A=u(71),S=u(36);o.exports=function(o,l,u){return u.get&&A(u.get,l,{getter:!0}),u.set&&A(u.set,l,{setter:!0}),S.f(o,l,u)}},(o,l,u)=>{var A=u(70);o.exports=function(o,l,u){for(var S in l)A(o,S,l[S],u);return o}},(o,l,u)=>{"use strict";var A=u(43),S=u(113),E=u(15),T=u(34),M=E("species");o.exports=function(o){var l=A(o);T&&l&&!l[M]&&S(l,M,{configurable:!0,get:function(){return this}})}},(o,l,u)=>{u(117)},(o,l,u)=>{"use strict";u(94)("Set",function(o){return function(){return o(this,arguments.length?arguments[0]:void 0)}},u(112))},(o,l,u)=>{var A=u(18),S=u(67),E=u(16),T=u(43),M=u(8),I=u(10),D=u(23),L=u(31),N=u(119),U=u(13),H=u(30),z=u(42),W=u(102),X=u(29),K=u(91),Y=u(21),J=u(98),Q=u(64),Z=u(55),tt=u(120),te=u(121),ti=u(123),tr=u(124),ts=u(125),tn=u(126),ta=E.Object,to=E.Array,tl=E.Date,th=E.Error,td=E.EvalError,tc=E.RangeError,tu=E.ReferenceError,tp=E.SyntaxError,tf=E.TypeError,tg=E.URIError,tm=E.PerformanceMark,tb=E.WebAssembly,tv=tb&&tb.CompileError||th,tA=tb&&tb.LinkError||th,t_=tb&&tb.RuntimeError||th,tS=T("DOMException"),tE=ti.Map,tC=ti.has,tT=ti.get,tw=ti.set,tP=tr.Set,tk=tr.add,tM=T("Object","keys"),tR=M([].push),tF=M((!0).valueOf),tO=M(1..valueOf),tI=M("".valueOf),tD=M(tl.prototype.getTime),tL=D("structuredClone"),tN="DataCloneError",tj="Transferring",tB=function(o){return!I(function(){var l=new E.Set([7]),u=o(l),A=o(ta(7));return u==l||!u.has(7)||"object"!=typeof A||7!=A})&&o},tU=function(o,l){return!I(function(){var u=new l,A=o({a:u,b:u});return!(A&&A.a===A.b&&A.a instanceof l&&A.a.stack===u.stack)})},tH=function(o){return!I(function(){var l=o(new E.AggregateError([1],tL,{cause:3}));return"AggregateError"!=l.name||1!=l.errors[0]||l.message!=tL||3!=l.cause})},tz=E.structuredClone,tG=A||!tU(tz,th)||!tU(tz,tS)||!tH(tz),tW=!tz&&tB(function(o){return new tm(tL,{detail:o}).detail}),tq=tB(tz)||tW,tV=function(o){throw new tS("Uncloneable type: "+o,tN)},t$=function(o,l){throw new tS((l||"Cloning")+" of "+o+" cannot be properly polyfilled in this engine",tN)},tX=function(o,l){return tq||t$(l),tq(o)},tK=function(){var o;try{o=new E.DataTransfer}catch(l){try{o=new E.ClipboardEvent("").clipboardData}catch(o){}}return o&&o.items&&o.files?o:null},tY=function(o,l){if(z(o)&&tV("Symbol"),!H(o))return o;if(l){if(tC(l,o))return tT(l,o)}else l=new tE;var u,A,S,M,I,D,N,U,W,X,tt,ti=K(o),tr=!1;switch(ti){case"Array":S=to(Z(o)),tr=!0;break;case"Object":S={},tr=!0;break;case"Map":S=new tE,tr=!0;break;case"Set":S=new tP,tr=!0;break;case"RegExp":S=new RegExp(o.source,te(o));break;case"Error":switch(A=o.name){case"AggregateError":S=T("AggregateError")([]);break;case"EvalError":S=td();break;case"RangeError":S=tc();break;case"ReferenceError":S=tu();break;case"SyntaxError":S=tp();break;case"TypeError":S=tf();break;case"URIError":S=tg();break;case"CompileError":S=tv();break;case"LinkError":S=tA();break;case"RuntimeError":S=t_();break;default:S=th()}tr=!0;break;case"DOMException":S=new tS(o.message,o.name),tr=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":H(u=E[ti])||t$(ti),S=new u(tY(o.buffer,l),o.byteOffset,"DataView"===ti?o.byteLength:o.length);break;case"DOMQuad":try{S=new DOMQuad(tY(o.p1,l),tY(o.p2,l),tY(o.p3,l),tY(o.p4,l))}catch(l){S=tX(o,ti)}break;case"File":if(tq)try{S=tq(o),K(S)!==ti&&(S=void 0)}catch(o){}if(!S)try{S=new File([o],o.name,o)}catch(o){}S||t$(ti);break;case"FileList":if(M=tK()){for(I=0,D=Z(o);I<D;I++)M.items.add(tY(o[I],l));S=M.files}else S=tX(o,ti);break;case"ImageData":try{S=new ImageData(tY(o.data,l),o.width,o.height,{colorSpace:o.colorSpace})}catch(l){S=tX(o,ti)}break;default:if(tq)S=tq(o);else switch(ti){case"BigInt":S=ta(o.valueOf());break;case"Boolean":S=ta(tF(o));break;case"Number":S=ta(tO(o));break;case"String":S=ta(tI(o));break;
1case"Date":S=new tl(tD(o));break;case"ArrayBuffer":(u=E.DataView)||"function"==typeof o.slice||t$(ti);try{if("function"!=typeof o.slice||o.resizable)for(I=0,D=o.byteLength,tt=("maxByteLength"in o)?{maxByteLength:o.maxByteLength}:void 0,S=new ArrayBuffer(D,tt),W=new u(o),X=new u(S);I<D;I++)X.setUint8(I,W.getUint8(I));else S=o.slice(0)}catch(o){throw new tS("ArrayBuffer is detached",tN)}break;case"SharedArrayBuffer":S=o;break;case"Blob":try{S=o.slice(0,o.size,o.type)}catch(o){t$(ti)}break;case"DOMPoint":case"DOMPointReadOnly":u=E[ti];try{S=u.fromPoint?u.fromPoint(o):new u(o.x,o.y,o.z,o.w)}catch(o){t$(ti)}break;case"DOMRect":case"DOMRectReadOnly":u=E[ti];try{S=u.fromRect?u.fromRect(o):new u(o.x,o.y,o.width,o.height)}catch(o){t$(ti)}break;case"DOMMatrix":case"DOMMatrixReadOnly":u=E[ti];try{S=u.fromMatrix?u.fromMatrix(o):new u(o)}catch(o){t$(ti)}break;case"AudioData":case"VideoFrame":L(o.clone)||t$(ti);try{S=o.clone()}catch(o){tV(ti)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":t$(ti);default:tV(ti)}}if(tw(l,o,S),tr)switch(ti){case"Array":case"Object":for(I=0,D=Z(N=tM(o));I<D;I++)J(S,U=N[I],tY(o[U],l));break;case"Map":o.forEach(function(o,u){tw(S,tY(u,l),tY(o,l))});break;case"Set":o.forEach(function(o){tk(S,tY(o,l))});break;case"Error":Q(S,"message",tY(o.message,l)),Y(o,"cause")&&Q(S,"cause",tY(o.cause,l)),"AggregateError"==A&&(S.errors=tY(o.errors,l));case"DOMException":ts&&Q(S,"stack",tY(o.stack,l))}return S},tJ=function(o,l){if(!H(o))throw tf("Transfer option cannot be converted to a sequence");var u,A,S,T,M,I,D=[];W(o,function(o){tR(D,X(o))});var U=0,z=Z(D);if(tn)for(T=tz(D,{transfer:D});U<z;)tw(l,D[U],T[U++]);else for(;U<z;){if(tC(l,u=D[U++]))throw new tS("Duplicate transferable",tN);switch(A=K(u)){case"ImageBitmap":N(S=E.OffscreenCanvas)||t$(A,tj);try{(I=new S(u.width,u.height)).getContext("bitmaprenderer").transferFromImageBitmap(u),M=I.transferToImageBitmap()}catch(o){}break;case"AudioData":case"VideoFrame":L(u.clone)&&L(u.close)||t$(A,tj);try{M=u.clone(),u.close()}catch(o){}break;case"ArrayBuffer":L(u.transfer)||t$(A,tj),M=u.transfer();break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":t$(A,tj)}if(void 0===M)throw new tS("This object cannot be transferred: "+A,tN);tw(l,u,M)}};S({global:!0,enumerable:!0,sham:!tn,forced:tG},{structuredClone:function(o){var l,u=tt(arguments.length,1)>1&&!U(arguments[1])?X(arguments[1]):void 0,A=u?u.transfer:void 0;return void 0!==A&&tJ(A,l=new tE),tY(o,l)}})},(o,l,u)=>{var A=u(8),S=u(10),E=u(31),T=u(91),M=u(43),I=u(73),D=function(){},L=[],N=M("Reflect","construct"),U=/^\s*(?:class|function)\b/,H=A(U.exec),z=!U.exec(D),W=function(o){if(!E(o))return!1;try{return N(D,L,o),!0}catch(o){return!1}},X=function(o){if(!E(o))return!1;switch(T(o)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return z||!!H(U,I(o))}catch(o){return!0}};X.sham=!0,o.exports=!N||S(function(){var o;return W(W.call)||!W(Object)||!W(function(){o=!0})||o})?X:W},o=>{var l=TypeError;o.exports=function(o,u){if(o<u)throw l("Not enough arguments");return o}},(o,l,u)=>{var A=u(41),S=u(21),E=u(44),T=u(122),M=RegExp.prototype;o.exports=function(o){var l=o.flags;return!(void 0===l&&!("flags"in M)&&!S(o,"flags")&&E(M,o))?l:A(T,o)}},(o,l,u)=>{"use strict";var A=u(29);o.exports=function(){var o=A(this),l="";return o.hasIndices&&(l+="d"),o.global&&(l+="g"),o.ignoreCase&&(l+="i"),o.multiline&&(l+="m"),o.dotAll&&(l+="s"),o.unicode&&(l+="u"),o.unicodeSets&&(l+="v"),o.sticky&&(l+="y"),l}},(o,l,u)=>{var A=u(8),S=Map.prototype;o.exports={Map:Map,set:A(S.set),get:A(S.get),has:A(S.has),remove:A(S.delete),proto:S}},(o,l,u)=>{var A=u(8),S=Set.prototype;o.exports={Set:Set,add:A(S.add),has:A(S.has),remove:A(S.delete),proto:S}},(o,l,u)=>{var A=u(10),S=u(65);o.exports=!A(function(){var o=Error("a");return!("stack"in o)||(Object.defineProperty(o,"stack",S(1,7)),7!==o.stack)})},(o,l,u)=>{var A=u(16),S=u(10),E=u(25),T=u(127),M=u(128),I=u(129),D=A.structuredClone;o.exports=!!D&&!S(function(){if(M&&E>92||I&&E>94||T&&E>97)return!1;var o=new ArrayBuffer(8),l=D(o,{transfer:[o]});return 0!=o.byteLength||8!=l.byteLength})},(o,l,u)=>{var A=u(128),S=u(129);o.exports=!A&&!S&&"object"==typeof window&&"object"==typeof document},o=>{o.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(o,l,u)=>{var A=u(11);o.exports=void 0!==process&&"process"==A(process)},(o,l,u)=>{var A=u(16);o.exports=A},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";let createPDFNetworkStream;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(132),_display_utils=__w_pdfjs_require__(135),_font_loader=__w_pdfjs_require__(138),_canvas=__w_pdfjs_require__(139),_worker_options=__w_pdfjs_require__(142),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(143),_metadata=__w_pdfjs_require__(144),_optional_content_config=__w_pdfjs_require__(145),_transport_stream=__w_pdfjs_require__(146),_xfa_text=__w_pdfjs_require__(147);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_is_node.isNodeJS?__w_pdfjs_require__(148).NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){let{PDFNodeStream}=__w_pdfjs_require__(149);createPDFNetworkStream=o=>new PDFNodeStream(o)}else{let{PDFNetworkStream}=__w_pdfjs_require__(152),{PDFFetchStream}=__w_pdfjs_require__(153);createPDFNetworkStream=o=>(0,_display_utils.isValidFetchUrl)(o.url)?new PDFFetchStream(o):new PDFNetworkStream(o)}function getDocument(o){if("string"==typeof o||o instanceof URL?o={url:o}:(0,_util.isArrayBuffer)(o)&&(o={data:o}),"object"!=typeof o)throw Error("Invalid parameter in getDocument, need parameter object.");if(!o.url&&!o.data&&!o.range)throw Error("Invalid parameter object: need either .data, .range or .url");let l=new PDFDocumentLoadingTask,{docId:u}=l,A=o.url?getUrlProp(o.url):null,S=o.data?getDataProp(o.data):null,E=o.httpHeaders||null,T=!0===o.withCredentials,M=o.password??null,I=o.range instanceof PDFDataRangeTransport?o.range:null,D=Number.isInteger(o.rangeChunkSize)&&o.rangeChunkSize>0?o.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,L=o.worker instanceof PDFWorker?o.worker:null,N=o.verbosity,U="string"!=typeof o.docBaseUrl||(0,_display_utils.isDataScheme)(o.docBaseUrl)?null:o.docBaseUrl,H="string"==typeof o.cMapUrl?o.cMapUrl:null,z=!1!==o.cMapPacked,W=o.CMapReaderFactory||DefaultCMapReaderFactory,X="string"==typeof o.standardFontDataUrl?o.standardFontDataUrl:null,K=o.StandardFontDataFactory||DefaultStandardFontDataFactory,Y=!0!==o.stopAtErrors,J=Number.isInteger(o.maxImageSize)&&o.maxImageSize>-1?o.maxImageSize:-1,Q=!1!==o.isEvalSupported,Z="boolean"==typeof o.isOffscreenCanvasSupported?o.isOffscreenCanvasSupported:!_is_node.isNodeJS,tt=Number.isInteger(o.canvasMaxAreaInBytes)?o.canvasMaxAreaInBytes:-1,te="boolean"==typeof o.disableFontFace?o.disableFontFace:_is_node.isNodeJS,ti=!0===o.fontExtraProperties,tr=!0===o.enableXfa,ts=o.ownerDocument||globalThis.document,tn=!0===o.disableRange,ta=!0===o.disableStream,to=!0===o.disableAutoFetch,tl=!0===o.pdfBug,th=I?I.length:o.length??NaN,td="boolean"==typeof o.useSystemFonts?o.useSystemFonts:!_is_node.isNodeJS&&!te,tc="boolean"==typeof o.useWorkerFetch?o.useWorkerFetch:W===_display_utils.DOMCMapReaderFactory&&K===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(H,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(X,document.baseURI),tu=o.canvasFactory||new DefaultCanvasFactory({ownerDocument:ts}),tp=o.filterFactory||new DefaultFilterFactory({docId:u,ownerDocument:ts}),tf=null;(0,_util.setVerbosityLevel)(N);let tg={canvasFactory:tu,filterFactory:tp};if(tc||(tg.cMapReaderFactory=new W({baseUrl:H,isCompressed:z}),tg.standardFontDataFactory=new K({baseUrl:X})),!L){let o={verbosity:N,port:_worker_options.GlobalWorkerOptions.workerPort};L=o.port?PDFWorker.fromPort(o):new PDFWorker(o),l._worker=L}let tm={docId:u,apiVersion:"3.8.162",data:S,password:M,disableAutoFetch:to,rangeChunkSize:D,length:th,docBaseUrl:U,enableXfa:tr,evaluatorOptions:{maxImageSize:J,disableFontFace:te,ignoreErrors:Y,isEvalSupported:Q,isOffscreenCanvasSupported:Z,canvasMaxAreaInBytes:tt,fontExtraProperties:ti,useSystemFonts:td,cMapUrl:tc?H:null,standardFontDataUrl:tc?X:null}},tb={ignoreErrors:Y,isEvalSupported:Q,disableFontFace:te,fontExtraProperties:ti,enableXfa:tr,ownerDocument:ts,disableAutoFetch:to,pdfBug:tl,styleElement:tf};return L.promise.then(function(){if(l.destroyed)throw Error("Loading aborted");let o=_fetchDocument(L,tm),M=new Promise(function(o){let l;
1I?l=new _transport_stream.PDFDataTransportStream({length:th,initialData:I.initialData,progressiveDone:I.progressiveDone,contentDispositionFilename:I.contentDispositionFilename,disableRange:tn,disableStream:ta},I):S||(l=createPDFNetworkStream({url:A,length:th,httpHeaders:E,withCredentials:T,rangeChunkSize:D,disableRange:tn,disableStream:ta})),o(l)});return Promise.all([o,M]).then(function(o){let[A,S]=o;if(l.destroyed)throw Error("Loading aborted");let E=new _message_handler.MessageHandler(u,A,L.port),T=new WorkerTransport(E,l,S,tb,tg);l._transport=T,E.send("Ready",null)})}).catch(l._capability.reject),l}async function _fetchDocument(o,l){if(o.destroyed)throw Error("Worker was destroyed");let u=await o.messageHandler.sendWithPromise("GetDocRequest",l,l.data?[l.data.buffer]:null);if(o.destroyed)throw Error("Worker was destroyed");return u}function getUrlProp(o){if(o instanceof URL)return o.href;try{return new URL(o,window.location).href}catch{if(_is_node.isNodeJS&&"string"==typeof o)return o}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(o){if(_is_node.isNodeJS&&void 0!==Buffer&&o instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength)return o;if("string"==typeof o)return(0,_util.stringToBytes)(o);if("object"==typeof o&&!isNaN(o?.length)||(0,_util.isArrayBuffer)(o))return new Uint8Array(o);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static #e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${PDFDocumentLoadingTask.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await this._transport?.destroy(),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(o,l){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=o,this.initialData=l,this.progressiveDone=u,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,l){for(let u of this._rangeListeners)u(o,l)}onDataProgress(o,l){this._readyCapability.promise.then(()=>{for(let u of this._progressListeners)u(o,l)})}onDataProgressiveRead(o){this._readyCapability.promise.then(()=>{for(let l of this._progressiveReadListeners)l(o)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let o of this._progressiveDoneListeners)o()})}transportReady(){this._readyCapability.resolve()}requestDataRange(o,l){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(o,l){this._pdfInfo=o,this._transport=l}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()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#i=null;#r=!1;constructor(o,l,u){let A=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=o,this._pageInfo=l,this._transport=u,this._stats=A?new _display_utils.StatTimer:null,this._pdfBug=A,this.commonObjs=u.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:l=this.rotate,offsetX:u=0,offsetY:A=0,dontFlip:S=!1}
1=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:o,rotation:l,offsetX:u,offsetY:A,dontFlip:S})}getAnnotations(){let{intent:o="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=this._transport.getRenderingIntent(o);return this._transport.getAnnotations(this._pageIndex,l.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:l,viewport:u,intent:A="display",annotationMode:S=_util.AnnotationMode.ENABLE,transform:E=null,background:T=null,optionalContentConfigPromise:M=null,annotationCanvasMap:I=null,pageColors:D=null,printAnnotationStorage:L=null}=o;this._stats?.time("Overall");let N=this._transport.getRenderingIntent(A,S,L);this.#r=!1,this.#s(),M||(M=this._transport.getOptionalContentConfig());let U=this._intentStates.get(N.cacheKey);U||(U=Object.create(null),this._intentStates.set(N.cacheKey,U)),U.streamReaderCancelTimeout&&(clearTimeout(U.streamReaderCancelTimeout),U.streamReaderCancelTimeout=null);let H=!!(N.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(N));let z=o=>{U.renderTasks.delete(W),(this._maybeCleanupAfterRender||H)&&(this.#r=!0),this.#n(!H),o?(W.capability.reject(o),this._abortOperatorList({intentState:U,reason:o instanceof Error?o:Error(o)})):W.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},W=new InternalRenderTask({callback:z,params:{canvasContext:l,viewport:u,transform:E,background:T},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:I,operatorList:U.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!H,pdfBug:this._pdfBug,pageColors:D});(U.renderTasks||=new Set).add(W);let X=W.task;return Promise.all([U.displayReadyCapability.promise,M]).then(o=>{let[l,u]=o;if(this.destroyed){z();return}this._stats?.time("Rendering"),W.initializeGraphics({transparency:l,optionalContentConfig:u}),W.operatorListChanged()}).catch(z),X}getOperatorList(){let o,{intent:l="display",annotationMode:u=_util.AnnotationMode.ENABLE,printAnnotationStorage:A=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};function S(){T.operatorList.lastChunk&&(T.opListReadCapability.resolve(T.operatorList),T.renderTasks.delete(o))}let E=this._transport.getRenderingIntent(l,u,A,!0),T=this._intentStates.get(E.cacheKey);return T||(T=Object.create(null),this._intentStates.set(E.cacheKey,T)),T.opListReadCapability||((o=Object.create(null)).operatorListChanged=S,T.opListReadCapability=new _util.PromiseCapability,(T.renderTasks||=new Set).add(o),T.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(E)),T.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:o=!1,disableNormalization:l=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===o,disableNormalization:!0===l},{highWaterMark:u,size:o=>o.items.length})}getTextContent(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(o=>_xfa_text.XfaText.textContent(o));let l=this.streamTextContent(o);return new Promise(function(o,u){function A(){S.read().then(function(l){let{value:u,done:S}=l;if(S){o(E);return}Object.assign(E.styles,u.styles),E.items.push(...u.items),A()},u)}let S=l.getReader(),E={items:[],styles:Object.create(null)};A()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let o=[];for(let l of this._intentStates.values())if(this._abortOperatorList({intentState:l,reason:Error("Page was destroyed."),force:!0}),!l.opListReadCapability)for(let u of l.renderTasks)o.push(u.completed),u.cancel();return this.objs.clear(),this.#r=!1,this.#s(),Promise.all(o)}cleanup(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#r=!0;let l=this.#n(!1);
1return o&&l&&(this._stats&&=new _display_utils.StatTimer),l}#n(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#s(),!this.#r||this.destroyed)return!1;if(o)return this.#i=setTimeout(()=>{this.#i=null,this.#n(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(let{renderTasks:o,operatorList:l}of this._intentStates.values())if(o.size>0||!l.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#r=!1,!0}#s(){this.#i&&(clearTimeout(this.#i),this.#i=null)}_startRenderPage(o,l){let u=this._intentStates.get(l);u&&(this._stats?.timeEnd("Page Request"),u.displayReadyCapability?.resolve(o))}_renderPageChunk(o,l){for(let u=0,A=o.length;u<A;u++)l.operatorList.fnArray.push(o.fnArray[u]),l.operatorList.argsArray.push(o.argsArray[u]);for(let u of(l.operatorList.lastChunk=o.lastChunk,l.operatorList.separateAnnots=o.separateAnnots,l.renderTasks))u.operatorListChanged();o.lastChunk&&this.#n(!0)}_pumpOperatorList(o){let{renderingIntent:l,cacheKey:u,annotationStorageSerializable:A}=o,{map:S,transfers:E}=A,T=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:l,cacheKey:u,annotationStorage:S},E),M=T.getReader(),I=this._intentStates.get(u);I.streamReader=M;let D=()=>{M.read().then(o=>{let{value:l,done:u}=o;if(u){I.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(l,I),D())},o=>{if(I.streamReader=null,!this._transport.destroyed){if(I.operatorList){for(let o of(I.operatorList.lastChunk=!0,I.renderTasks))o.operatorListChanged();this.#n(!0)}if(I.displayReadyCapability)I.displayReadyCapability.reject(o);else if(I.opListReadCapability)I.opListReadCapability.reject(o);else throw o}})};D()}_abortOperatorList(o){let{intentState:l,reason:u,force:A=!1}=o;if(l.streamReader){if(l.streamReaderCancelTimeout&&(clearTimeout(l.streamReaderCancelTimeout),l.streamReaderCancelTimeout=null),!A){if(l.renderTasks.size>0)return;if(u instanceof _display_utils.RenderingCancelledException){let o=RENDERING_CANCELLED_TIMEOUT;u.extraDelay>0&&u.extraDelay<1e3&&(o+=u.extraDelay),l.streamReaderCancelTimeout=setTimeout(()=>{l.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:l,reason:u,force:!0})},o);return}}if(l.streamReader.cancel(new _util.AbortException(u.message)).catch(()=>{}),l.streamReader=null,!this._transport.destroyed){for(let[o,u]of this._intentStates)if(u===l){this._intentStates.delete(o);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(o,l){let u={data:structuredClone(o,null)};this.#o.then(()=>{for(let o of this.#a)o.call(this,u)})}addEventListener(o,l){this.#a.add(l)}removeEventListener(o,l){this.#a.delete(l)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let pdfjsFilePath=document?.currentScript?.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(o,l){let u;try{if(!(u=new URL(o)).origin||"null"===u.origin)return!1}catch{return!1}let A=new URL(l,u);return u.origin===A.origin},PDFWorkerUtil.createCDNWrapper=function(o){let l=`importScripts("${o}");`;return URL.createObjectURL(new Blob([l]))};class PDFWorker{static #l=new WeakMap;constructor(){let{name:o=null,port:l=null,verbosity:u=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l&&PDFWorker.#l.has(l))throw Error("Cannot use more than one PDFWorker per port.");if(this.name=o,this.destroyed=!1,this.verbosity=u,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,l){PDFWorker.#l.set(l,this),this._initializeFromPort(l);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(o){this._port=o,this._messageHandler=new _message_handler.MessageHandler("main","worker",o),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:o}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,o)||(o=PDFWorkerUtil.createCDNWrapper(new URL(o,window.location).href));let l=new Worker(o),u=new _message_handler.MessageHandler("main","worker",l),A=()=>{l.removeEventListener("error",S),u.destroy(),l.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},S=()=>{this._webWorker||A()};l.addEventListener("error",S),u.on("test",o=>{if(l.removeEventListener("error",S),this.destroyed){A();return}o?(this._messageHandler=u,this._port=l,this._webWorker=l,this._readyCapability.resolve(),u.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),u.destroy(),l.terminate())}),u.on("ready",o=>{if(l.removeEventListener("error",S),this.destroyed){A();return}try{E()}catch{this._setupFakeWorker()}});let E=()=>{let o=new Uint8Array;u.send("test",o,[o.buffer])};E();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(o=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let l=new LoopbackPort;this._port=l;let u=`fake${PDFWorkerUtil.fakeWorkerId++}`,A=new _message_handler.MessageHandler(u+"_worker",u,l);o.setup(A,l);let S=new _message_handler.MessageHandler(u,u+"_worker",l);this._messageHandler=S,this._readyCapability.resolve(),S.send("configure",{verbosity:this.verbosity})}).catch(o=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${o.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(o){if(!o?.port)throw Error("PDFWorker.fromPort - invalid method signature.");return this.#l.has(o.port)?this.#l.get(o.port):new PDFWorker(o)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await (0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#h=new Map;#d=new Map;#c=new Map;constructor(o,l,u,A,S){this.messageHandler=o,this.loadingTask=l,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:A.ownerDocument,styleElement:A.styleElement}),this._params=A,this.canvasFactory=S.canvasFactory,this.filterFactory=S.filterFactory,this.cMapReaderFactory=S.cMapReaderFactory,this.standardFontDataFactory=S.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=u,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#u(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this.#h.get(o);if(u)return u;
1let A=this.messageHandler.sendWithPromise(o,l);return this.#h.set(o,A),A}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,A=arguments.length>3&&void 0!==arguments[3]&&arguments[3],S=_util.RenderingIntentFlag.DISPLAY,E=_annotation_storage.SerializableEmpty;switch(o){case"any":S=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":S=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${o}`)}switch(l){case _util.AnnotationMode.DISABLE:S+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:S+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:S+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;let T=S&_util.RenderingIntentFlag.PRINT&&u instanceof _annotation_storage.PrintAnnotationStorage?u:this.annotationStorage;E=T.serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${l}`)}return A&&(S+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:S,cacheKey:`${S}_${E.hash}`,annotationStorageSerializable:E}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(Error("Worker was destroyed during onPassword callback"));let o=[];for(let l of this.#d.values())o.push(l._destroy());this.#d.clear(),this.#c.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let l=this.messageHandler.sendWithPromise("Terminate",null);return o.push(l),Promise.all(o).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#h.clear(),this.filterFactory.destroy(),this._networkStream&&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(){let{messageHandler:o,loadingTask:l}=this;o.on("GetReader",(o,l)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=o=>{this._lastProgress={loaded:o.loaded,total:o.total}},l.onPull=()=>{this._fullReader.read().then(function(o){let{value:u,done:A}=o;if(A){l.close();return}(0,_util.assert)(u instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(u),1,[u])}).catch(o=>{l.error(o)})},l.onCancel=o=>{this._fullReader.cancel(o),l.ready.catch(o=>{if(!this.destroyed)throw o})}}),o.on("ReaderHeadersReady",o=>
1{let u=new _util.PromiseCapability,A=this._fullReader;return A.headersReady.then(()=>{A.isStreamingSupported&&A.isRangeSupported||(this._lastProgress&&l.onProgress?.(this._lastProgress),A.onProgress=o=>{l.onProgress?.({loaded:o.loaded,total:o.total})}),u.resolve({isStreamingSupported:A.isStreamingSupported,isRangeSupported:A.isRangeSupported,contentLength:A.contentLength})},u.reject),u.promise}),o.on("GetRangeReader",(o,l)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let u=this._networkStream.getRangeReader(o.begin,o.end);if(!u){l.close();return}l.onPull=()=>{u.read().then(function(o){let{value:u,done:A}=o;if(A){l.close();return}(0,_util.assert)(u instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(u),1,[u])}).catch(o=>{l.error(o)})},l.onCancel=o=>{u.cancel(o),l.ready.catch(o=>{if(!this.destroyed)throw o})}}),o.on("GetDoc",o=>{let{pdfInfo:u}=o;this._numPages=u.numPages,this._htmlForXfa=u.htmlForXfa,delete u.htmlForXfa,l._capability.resolve(new PDFDocumentProxy(u,this))}),o.on("DocException",function(o){let u;switch(o.name){case"PasswordException":u=new _util.PasswordException(o.message,o.code);break;case"InvalidPDFException":u=new _util.InvalidPDFException(o.message);break;case"MissingPDFException":u=new _util.MissingPDFException(o.message);break;case"UnexpectedResponseException":u=new _util.UnexpectedResponseException(o.message,o.status);break;case"UnknownErrorException":u=new _util.UnknownErrorException(o.message,o.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}l._capability.reject(u)}),o.on("PasswordRequest",o=>{if(this._passwordCapability=new _util.PromiseCapability,l.onPassword){let u=o=>{o instanceof Error?this._passwordCapability.reject(o):this._passwordCapability.resolve({password:o})};try{l.onPassword(u,o.code)}catch(o){this._passwordCapability.reject(o)}}else this._passwordCapability.reject(new _util.PasswordException(o.message,o.code));return this._passwordCapability.promise}),o.on("DataLoaded",o=>{l.onProgress?.({loaded:o.length,total:o.length}),this.downloadInfoCapability.resolve(o)}),o.on("StartRenderPage",o=>{if(this.destroyed)return;let l=this.#d.get(o.pageIndex);l._startRenderPage(o.transparency,o.cacheKey)}),o.on("commonobj",l=>{let[u,A,S]=l;if(!(this.destroyed||this.commonObjs.has(u)))switch(A){case"Font":let E=this._params;if("error"in S){let o=S.error;(0,_util.warn)(`Error during font loading: ${o}`),this.commonObjs.resolve(u,o);break}let T=E.pdfBug&&globalThis.FontInspector?.enabled?(o,l)=>globalThis.FontInspector.fontAdded(o,l):null,M=new _font_loader.FontFaceObject(S,{isEvalSupported:E.isEvalSupported,disableFontFace:E.disableFontFace,ignoreErrors:E.ignoreErrors,inspectFont:T});this.fontLoader.bind(M).catch(l=>o.sendWithPromise("FontFallback",{id:u})).finally(()=>{!E.fontExtraProperties&&M.data&&(M.data=null),this.commonObjs.resolve(u,M)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(u,S);break;default:throw Error(`Got unknown common object type ${A}`)}}),o.on("obj",o=>{let[l,u,A,S]=o;if(this.destroyed)return;let E=this.#d.get(u);if(!E.objs.has(l))switch(A){case"Image":if(E.objs.resolve(l,S),S){let o;if(S.bitmap){let{width:l,height:u}=S;o=l*u*4}else o=S.data?.length||0;o>_util.MAX_IMAGE_SIZE_TO_CACHE&&(E._maybeCleanupAfterRender=!0)}break;case"Pattern":E.objs.resolve(l,S);break;default:throw Error(`Got unknown object type ${A}`)}}),o.on("DocProgress",o=>{this.destroyed||l.onProgress?.({loaded:o.loaded,total:o.total})}),o.on("FetchBuiltInCMap",o=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(o):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),o.on("FetchStandardFontData",o=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(o):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}
1getData(){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.");let{map:o,transfers:l}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:o,filename:this._fullReader?.filename??null},l).finally(()=>{this.annotationStorage.resetModified()})}getPage(o){if(!Number.isInteger(o)||o<=0||o>this._numPages)return Promise.reject(Error("Invalid page request."));let l=o-1,u=this.#c.get(l);if(u)return u;let A=this.messageHandler.sendWithPromise("GetPage",{pageIndex:l}).then(o=>{if(this.destroyed)throw Error("Transport destroyed");let u=new PDFPageProxy(l,o,this,this._params.pdfBug);return this.#d.set(l,u),u});return this.#c.set(l,A),A}getPageIndex(o){return"object"!=typeof o||null===o||!Number.isInteger(o.num)||o.num<0||!Number.isInteger(o.gen)||o.gen<0?Promise.reject(Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:o.num,gen:o.gen})}getAnnotations(o,l){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:o,intent:l})}getFieldObjects(){return this.#u("GetFieldObjects")}hasJSActions(){return this.#u("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(o){return"string"!=typeof o?Promise.reject(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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}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.sendWithPromise("GetOptionalContentConfig",null).then(o=>new _optional_content_config.OptionalContentConfig(o))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let o="GetMetadata",l=this.#h.get(o);if(l)return l;let u=this.messageHandler.sendWithPromise(o,null).then(o=>({info:o[0],metadata:o[1]?new _metadata.Metadata(o[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#h.set(o,u),u}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){for(let o of(await this.messageHandler.sendWithPromise("Cleanup",null),this.#d.values())){let l=o.cleanup();if(!l)throw Error(`startCleanup: Page ${o.pageNumber} is currently rendering.`)}this.commonObjs.clear(),o||this.fontLoader.clear(),this.#h.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){let{disableAutoFetch:o,enableXfa:l}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:o,enableXfa:l})}}class PDFObjects{#p=Object.create(null);#f(o){let l=this.#p[o];return l||(this.#p[o]={capability:new _util.PromiseCapability,data:null})}get(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(l){let u=this.#f(o);return u.capability.promise.then(()=>l(u.data)),null}let u=this.#p[o];if(!u?.capability.settled)throw Error(`Requesting object that isn't resolved yet ${o}.`);return u.data}has(o){let l=this.#p[o];return l?.capability.settled||!1}resolve(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this.#f(o);u.data=l,u.capability.resolve()}clear(){for(let o in this.#p){let{data:l}=this.#p[o];l?.bitmap?.close()}this.#p=Object.create(null)}}class RenderTask{#g=null;constructor(o){this.#g=o,this.onContinue=null}get promise(){return this.#g.capability.promise}cancel(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#g.cancel(null,o)}get separateAnnots(){let{separateAnnots:o}=this.#g.operatorList;if(!o)return!1;let{annotationCanvasMap:l}=this.#g;return o.form||o.canvas&&l?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static #m=new WeakSet;constructor(o){let{callback:l,params:u,objs:A,commonObjs:S,annotationCanvasMap:E,operatorList:T,pageIndex:M,canvasFactory:I,filterFactory:D,useRequestAnimationFrame:L=!1,pdfBug:N=!1,pageColors:U=null}=o;this.callback=l,this.params=u,this.objs=A,this.commonObjs=S,this.annotationCanvasMap=E,this.operatorListIdx=null,this.operatorList=T,this._pageIndex=M,this.canvasFactory=I,this.filterFactory=D,this._pdfBug=N,this.pageColors=U,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===L&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=u.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(o){let{transparency:l=!1,optionalContentConfig:u}=o;if(this.cancelled)return;
1if(this._canvas){if(InternalRenderTask.#m.has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#m.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());let{canvasContext:A,viewport:S,transform:E,background:T}=this.params;this.gfx=new _canvas.CanvasGraphics(A,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:u},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:E,viewport:S,transparency:l,background:T}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback(o||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,l))}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)}):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(this.pageColors),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback())))}}let version="3.8.162";exports.version=version;let build="2c74323e3";exports.build=build},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.SerializableEmpty=l.PrintAnnotationStorage=l.AnnotationStorage=void 0;var A=u(1),S=u(133),E=u(137);let T=Object.freeze({map:null,hash:"",transfers:void 0});l.SerializableEmpty=T;class M{#b=!1;#v=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(o,l){let u=this.#v.get(o);return void 0===u?l:Object.assign(l,u)}getRawValue(o){return this.#v.get(o)}remove(o){if(this.#v.delete(o),0===this.#v.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let o of this.#v.values())if(o instanceof S.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(o,l){let u=this.#v.get(o),A=!1;if(void 0!==u)for(let[o,S]of Object.entries(l))u[o]!==S&&(A=!0,u[o]=S);else A=!0,this.#v.set(o,l);A&&this.#A(),l instanceof S.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(l.constructor._type)}has(o){return this.#v.has(o)}getAll(){return this.#v.size>0?(0,A.objectFromMap)(this.#v):null}setAll(o){for(let[l,u]of Object.entries(o))this.setValue(l,u)}get size(){return this.#v.size}#A(){this.#b||(this.#b=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#b&&(this.#b=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new I(this)}get serializable(){if(0===this.#v.size)return T;let o=new Map,l=new E.MurmurHash3_64,u=[];for(let[A,E]of this.#v){let T=E instanceof S.AnnotationEditor?E.serialize():E;T&&(o.set(A,T),l.update(`${A}:${JSON.stringify(T)}`),T.bitmap&&u.push(T.bitmap))}return o.size>0?{map:o,hash:l.hexdigest(),transfers:u}:T}}l.AnnotationStorage=M;class I extends M{#y;constructor(o){super();let{map:l,hash:u,transfers:A}=o.serializable,S=structuredClone(l,null);this.#y={map:S,hash:u,transfers:A}}get print(){(0,A.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#y}}l.PrintAnnotationStorage=I},(o,l,u)=>{"use strict";
1Object.defineProperty(l,"__esModule",{value:!0}),l.AnnotationEditor=void 0;var A=u(134),S=u(1);class E{#_=this.focusin.bind(this);#S=this.focusout.bind(this);#x=!1;#E=!1;#C=!1;_uiManager=null;#T=E._zIndex++;static _colorManager=new A.ColorManager;static _zIndex=1;constructor(o){this.constructor===E&&(0,S.unreachable)("Cannot initialize AnnotationEditor."),this.parent=o.parent,this.id=o.id,this.width=this.height=null,this.pageIndex=o.parent.pageIndex,this.name=o.name,this.div=null,this._uiManager=o.uiManager,this.annotationElementId=null;let{rotation:l,rawDims:{pageWidth:u,pageHeight:A,pageX:T,pageY:M}}=this.parent.viewport;this.rotation=l,this.pageRotation=(360+l-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[u,A],this.pageTranslation=[T,M];let[I,D]=this.parentDimensions;this.x=o.x/I,this.y=o.y/D,this.isAttachedToDOM=!1,this.deleted=!1}static get _defaultLineColor(){return(0,S.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(o){let l=new T({i
1d:o.parent.getNextId(),parent:o.parent,uiManager:o._uiManager});l.annotationElementId=o.annotationElementId,l.deleted=!0,l._uiManager.addToAnnotationStorage(l)}addCommands(o){this._uiManager.addCommands(o)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(o){null!==o&&(this.pageIndex=o.pageIndex,this.pageDimensions=o.pageDimensions),this.parent=o}focusin(o){this.#x?this.#x=!1:this.parent.setSelected(this)}focusout(o){if(!this.isAttachedToDOM)return;let l=o.relatedTarget;!l?.closest(`#${this.id}`)&&(o.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(o){let l=this.parent.div.getBoundingClientRect();this.startX=o.clientX-l.x,this.startY=o.clientY-l.y,o.dataTransfer.setData("text/plain",this.id),o.dataTransfer.effectAllowed="move"}setAt(o,l,u,A){let[S,E]=this.parentDimensions;[u,A]=this.screenToPageTranslation(u,A),this.x=(o+u)/S,this.y=(l+A)/E,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(o,l){let[u,A]=this.parentDimensions;[o,l]=this.screenToPageTranslation(o,l),this.x+=o/u,this.y+=l/A,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(o,l){switch(this.parentRotation){case 90:return[l,-o];case 180:return[-o,-l];case 270:return[-l,o];default:return[o,l]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{realScale:o}=this._uiManager.viewParameters,[l,u]=this.pageDimensions;return[l*o,u*o]}setDims(o,l){let[u,A]=this.parentDimensions;this.div.style.width=`${100*o/u}%`,this.div.style.height=`${100*l/A}%`}fixDims(){let{style:o}=this.div,{height:l,width:u}=o,A=u.endsWith("%"),S=l.endsWith("%");if(A&&S)return;let[E,T]=this.parentDimensions;A||(o.width=`${100*parseFloat(u)/E}%`),S||(o.height=`${100*parseFloat(l)/T}%`)}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#_),this.div.addEventListener("focusout",this.#S);let[o,l]=this.getInitialTranslation();return this.translate(o,l),(0,A.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(o){let{isMac:l}=S.FeatureTest.platform;if(0!==o.button||o.ctrlKey&&l){o.preventDefault();return}o.ctrlKey&&!l||o.shiftKey||o.metaKey&&l?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#x=!0}getRect(o,l){let u=this.parentScale,[A,S]=this.pageDimensions,[E,T]=this.pageTranslation,M=o/u,I=l/u,D=this.x*A,L=this.y*S,N=this.width*A,U=this.height*S;switch(this.rotation){case 0:return[D+M+E,S-L-I-U+T,D+M+N+E,S-L-I+T];case 90:return[D+I+E,S-L+M+T,D+I+U+E,S-L+M+N+T];case 180:return[D-M-N+E,S-L+I+T,D-M+E,S-L+I+U+T];case 270:return[D-I-U+E,S-L-M-N+T,D-I+E,S-L-M+T];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(o,l){let[u,A,S,E]=o,T=S-u,M=E-A;switch(this.rotation){case 0:return[u,l-E,T,M];case 90:return[u,l-A,M,T];case 180:return[S,l-A,T,M];case 270:return[S,l-E,M,T];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#C=!0}disableEditMode(){this.#C=!1}isInEditMode(){return this.#C}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#_),this.div?.addEventListener("focusout",this.#S)}serialize(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],(0,S.unreachable)("An editor must be serializable")}static deserialize(o,l,u){let A=new this.prototype.constructor({parent:l,id:l.getNextId(),uiManager:u});A.rotation=o.rotation;let[S,E]=A.pageDimensions,[T,M,I,D]=A.getRectInCurrentCoords(o.rect,E);return A.x=T/S,A.y=M/E,A.width=I/S,A.height=D/E,A}remove(){this.div.removeEventListener("focusin",this.#_),this.div.removeEventListener("focusout",this.#S),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(o,l){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#E}
1set isEditing(o){this.#E=o,o?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}l.AnnotationEditor=E;class T extends E{constructor(o){super(o),this.annotationElementId=o.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.KeyboardManager=l.CommandManager=l.ColorManager=l.AnnotationEditorUIManager=void 0,l.bindEvents=E,l.opacityToHex=T;var A=u(1),S=u(135);function E(o,l,u){for(let A of u)l.addEventListener(A,o[A].bind(o))}function T(o){return Math.round(Math.min(255,Math.max(1,255*o))).toString(16).padStart(2,"0")}class M{#w=0;getId(){return`${A.AnnotationEditorPrefix}${this.#w++}`}}class I{#P=[];#k=!1;#M;#R=-1;constructor(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#M=o}add(o){let{cmd:l,undo:u,mustExec:A,type:S=NaN,overwriteIfSameType:E=!1,keepUndo:T=!1}=o;if(A&&l(),this.#k)return;let M={cmd:l,undo:u,type:S};if(-1===this.#R){this.#P.length>0&&(this.#P.length=0),this.#R=0,this.#P.push(M);return}if(E&&this.#P[this.#R].type===S){T&&(M.undo=this.#P[this.#R].undo),this.#P[this.#R]=M;return}let I=this.#R+1;I===this.#M?this.#P.splice(0,1):(this.#R=I,I<this.#P.length&&this.#P.splice(I)),this.#P.push(M)}undo(){-1!==this.#R&&(this.#k=!0,this.#P[this.#R].undo(),this.#k=!1,this.#R-=1)}redo(){this.#R<this.#P.length-1&&(this.#R+=1,this.#k=!0,this.#P[this.#R].cmd(),this.#k=!1)}hasSomethingToUndo(){return -1!==this.#R}hasSomethingToRedo(){return this.#R<this.#P.length-1}destroy(){this.#P=null}}l.CommandManager=I;class D{constructor(o){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:l}=A.FeatureTest.platform;for(let[u,A,S=!1]of o)for(let o of u){let u=o.startsWith("mac+");l&&u?(this.callbacks.set(o.slice(4),{callback:A,bubbles:S}),this.allKeys.add(o.split("+").at(-1))):l||u||(this.callbacks.set(o,{callback:A,bubbles:S}),this.allKeys.add(o.split("+").at(-1)))}}#F(o){o.altKey&&this.buffer.push("alt"),o.ctrlKey&&this.buffer.push("ctrl"),o.metaKey&&this.buffer.push("meta"),o.shiftKey&&this.buffer.push("shift"),this.buffer.push(o.key);let l=this.buffer.join("+");return this.buffer.length=0,l}exec(o,l){if(!this.allKeys.has(l.key))return;let u=this.callbacks.get(this.#F(l));if(!u)return;let{callback:A,bubbles:S}=u;A.bind(o)(),S||(l.stopPropagation(),l.preventDefault())}}l.KeyboardManager=D;class L{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let o=new Map([["CanvasText",null],["Canvas",null]]);return(0,S.getColorValues)(o),(0,A.shadow)(this,"_colors",o)}convert(o){let l=(0,S.getRGB)(o);if(!window.matchMedia("(forced-colors: active)").matches)return l;for(let[o,u]of this._colors)if(u.every((o,u)=>o===l[u]))return L._colorsMapping.get(o);return l}getHexCode(o){let l=this._colors.get(o);return l?A.Util.makeHexColor(...l):o}}l.ColorManager=L;class N{#O=null;#I=new Map;#D=new Map;#L=null;#N=new I;#j=0;#B=new Set;#U=null;#H=new Set;#z=null;#G=new M;#W=!1;#q=A.AnnotationEditorType.NONE;#V=new Set;#$=this.copy.bind(this);#X=this.cut.bind(this);#K=this.paste.bind(this);#Y=this.keydown.bind(this);#J=this.onEditingAction.bind(this);#Q=this.onPageChanging.bind(this);#Z=this.onScaleChanging.bind(this);#tt=this.onRotationChanging.bind(this);#te={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#ti=null;static get _keyboardManager(){return(0,A.shadow)(this,"_keyboardManager",new D([[["ctrl+a","mac+meta+a"],N.prototype.selectAll],[["ctrl+z","mac+meta+z"],N.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],N.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],N.prototype.delete],[["Escape","mac+Escape"],N.prototype.unselectAll]]))}constructor(o,l,u){this.#ti=o,this.#z=l,this.#z._on("editingaction",this.#J),this.#z._on("pagechanging",this.#Q),this.#z._on("scalechanging",this.#Z),this.#z._on("rotationchanging",this.#tt),this.#L=u,this.viewParameters={realScale:S.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){for(let o of(this.#tr(),this.#z._off("editingaction",this.#J),this.#z._off("pagechanging",this.#Q),this.#z._off("scalechanging",this.#Z),this.#z._off("rotationchanging",this.#tt),this.#D.values())
1)o.destroy();this.#D.clear(),this.#I.clear(),this.#H.clear(),this.#O=null,this.#V.clear(),this.#N.destroy()}onPageChanging(o){let{pageNumber:l}=o;this.#j=l-1}focusMainContainer(){this.#ti.focus()}addShouldRescale(o){this.#H.add(o)}removeShouldRescale(o){this.#H.delete(o)}onScaleChanging(o){let{scale:l}=o;for(let o of(this.commitOrRemove(),this.viewParameters.realScale=l*S.PixelsPerInch.PDF_TO_CSS_UNITS,this.#H))o.onScaleChanging()}onRotationChanging(o){let{pagesRotation:l}=o;this.commitOrRemove(),this.viewParameters.rotation=l}addToAnnotationStorage(o){o.isEmpty()||!this.#L||this.#L.has(o.id)||this.#L.setValue(o.id,o)}#ts(){this.#ti.addEventListener("keydown",this.#Y)}#tr(){this.#ti.removeEventListener("keydown",this.#Y)}#tn(){document.addEventListener("copy",this.#$),document.addEventListener("cut",this.#X),document.addEventListener("paste",this.#K)}#ta(){document.removeEventListener("copy",this.#$),document.removeEventListener("cut",this.#X),document.removeEventListener("paste",this.#K)}copy(o){if(o.preventDefault(),this.#O&&this.#O.commitOrRemove(),!this.hasSelection)return;let l=[];for(let o of this.#V){let u=o.serialize(!0);u&&l.push(u)}0!==l.length&&o.clipboardData.setData("application/pdfjs",JSON.stringify(l))}cut(o){this.copy(o),this.delete()}paste(o){o.preventDefault();let l=o.clipboardData.getData("application/pdfjs");if(!l)return;try{l=JSON.parse(l)}catch(o){(0,A.warn)(`paste: "${o.message}".`);return}if(!Array.isArray(l))return;this.unselectAll();let u=this.#D.get(this.#j);try{let o=[];for(let A of l){let l=u.deserialize(A);if(!l)return;o.push(l)}let A=()=>{for(let l of o)this.#to(l);this.#tl(o)},S=()=>{for(let l of o)l.remove()};this.addCommands({cmd:A,undo:S,mustExec:!0})}catch(o){(0,A.warn)(`paste: "${o.message}".`)}}keydown(o){this.getActive()?.shouldGetKeyboardEvents()||N._keyboardManager.exec(this,o)}onEditingAction(o){["undo","redo","delete","selectAll"].includes(o.name)&&this[o.name]()}#th(o){let l=Object.entries(o).some(o=>{let[l,u]=o;return this.#te[l]!==u});l&&this.#z.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#te,o)})}#td(o){this.#z.dispatch("annotationeditorparamschanged",{source:this,details:o})}setEditingState(o){o?(this.#ts(),this.#tn(),this.#th({isEditing:this.#q!==A.AnnotationEditorType.NONE,isEmpty:this.#tc(),hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:this.#N.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#tr(),this.#ta(),this.#th({isEditing:!1}))}registerEditorTypes(o){if(!this.#U)for(let l of(this.#U=o,this.#U))this.#td(l.defaultPropertiesToUpdate)}getId(){return this.#G.getId()}get currentLayer(){return this.#D.get(this.#j)}get currentPageIndex(){return this.#j}addLayer(o){this.#D.set(o.pageIndex,o),this.#W?o.enable():o.disable()}removeLayer(o){this.#D.delete(o.pageIndex)}updateMode(o){if(this.#q=o,o===A.AnnotationEditorType.NONE)this.setEditingState(!1),this.#tu();else for(let l of(this.setEditingState(!0),this.#tp(),this.#D.values()))l.updateMode(o)}updateToolbar(o){o!==this.#q&&this.#z.dispatch("switchannotationeditormode",{source:this,mode:o})}updateParams(o,l){if(this.#U){for(let u of this.#V)u.updateParams(o,l);for(let u of this.#U)u.updateDefaultParams(o,l)}}#tp(){if(!this.#W)for(let o of(this.#W=!0,this.#D.values()))o.enable()}#tu(){if(this.unselectAll(),this.#W)for(let o of(this.#W=!1,this.#D.values()))o.disable()}getEditors(o){let l=[];for(let u of this.#I.values())u.pageIndex===o&&l.push(u);return l}getEditor(o){return this.#I.get(o)}addEditor(o){this.#I.set(o.id,o)}removeEditor(o){this.#I.delete(o.id),this.unselect(o),o.annotationElementId&&this.#B.has(o.annotationElementId)||this.#L?.remove(o.id)}addDeletedAnnotationElement(o){this.#B.add(o.annotationElementId),o.deleted=!0}isDeletedAnnotationElement(o){return this.#B.has(o)}removeDeletedAnnotationElement(o){this.#B.delete(o.annotationElementId),o.deleted=!1}#to(o){let l=this.#D.get(o.pageIndex);l?l.addOrRebuild(o):this.addEditor(o)}setActiveEditor(o){this.#O!==o&&(this.#O=o,o&&this.#td(o.propertiesToUpdate))}toggleSelected(o){if(this.#V.has(o)){this.#V.delete(o),o.unselect(),this.#th({hasSelectedEditor:this.hasSelection});return}this.#V.add(o),o.select(),this.#td(o.propertiesToUpdate),this.#th({hasSelectedEditor:!0})}setSelected(o){for(let l of this.#V)l!==o&&l.unselect();this.#V.clear(),this.#V.add(o),o.select(),this.#td(o.propertiesToUpdate),this.#th({hasSelectedEditor:!0})}isSelected(o){return this.#V.has(o)}unselect(o){o.unselect(),this.#V.delete(o),this.#th({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#V.size}undo(){this.#N.undo(),this.#th({hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#tc()})}redo(){this.#N.redo(),this.#th({hasSomethingToUndo:!0,hasSomethingToRedo:this.#N.hasSomethingToRedo(),isEmpty:this.#tc()})}addCommands(o){this.#N.add(o),this.#th({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#tc()})}#tc(){if(0===this.#I.size)return!0;
1if(1===this.#I.size)for(let o of this.#I.values())return o.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let o=[...this.#V],l=()=>{for(let l of o)l.remove()},u=()=>{for(let l of o)this.#to(l)};this.addCommands({cmd:l,undo:u,mustExec:!0})}commitOrRemove(){this.#O?.commitOrRemove()}#tl(o){for(let l of(this.#V.clear(),o))l.isEmpty()||(this.#V.add(l),l.select());this.#th({hasSelectedEditor:!0})}selectAll(){for(let o of this.#V)o.commit();this.#tl(this.#I.values())}unselectAll(){if(this.#O){this.#O.commitOrRemove();return}if(0!==this.#V.size){for(let o of this.#V)o.unselect();this.#V.clear(),this.#th({hasSelectedEditor:!1})}}isActive(o){return this.#O===o}getActive(){return this.#O}getMode(){return this.#q}}l.AnnotationEditorUIManager=N},(o,l,u)=>{"use strict";let A;Object.defineProperty(l,"__esModule",{value:!0}),l.StatTimer=l.RenderingCancelledException=l.PixelsPerInch=l.PageViewport=l.PDFDateString=l.DOMStandardFontDataFactory=l.DOMSVGFactory=l.DOMFilterFactory=l.DOMCanvasFactory=l.DOMCMapReaderFactory=l.AnnotationPrefix=void 0,l.deprecated=ti,l.getColorValues=ta,l.getCurrentTransform=to,l.getCurrentTransformInverse=tl,l.getFilenameFromUrl=J,l.getPdfFilenameFromUrl=Q,l.getRGB=tn,l.getXfaPageViewport=ts,l.isDataScheme=K,l.isPdfFile=Y,l.isValidFetchUrl=tt,l.loadScript=te,l.setLayerDimensions=th;var S=u(136),E=u(1);let T="http://www.w3.org/2000/svg",M="pdfjs_internal_id_";l.AnnotationPrefix=M;class I{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}l.PixelsPerInch=I;class D extends S.BaseFilterFactory{#tf;#tg;#e;#tm;#tb;#tv;#tA;#ty;#t_;#tS;#w=0;constructor(){let{docId:o,ownerDocument:l=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=o,this.#tm=l}get #tx(){return this.#tf||=new Map}get #tE(){if(!this.#tg){let o=this.#tm.createElement("div"),{style:l}=o;l.visibility="hidden",l.contain="strict",l.width=l.height=0,l.position="absolute",l.top=l.left=0,l.zIndex=-1;let u=this.#tm.createElementNS(T,"svg");u.setAttribute("width",0),u.setAttribute("height",0),this.#tg=this.#tm.createElementNS(T,"defs"),o.append(u),u.append(this.#tg),this.#tm.body.append(o)}return this.#tg}addFilter(o){let l,u,A,S;if(!o)return"none";let E=this.#tx.get(o);if(E)return E;if(1===o.length){let E=o[0],T=Array(256);for(let o=0;o<256;o++)T[o]=E[o]/255;S=l=u=A=T.join(",")}else{let[E,T,M]=o,I=Array(256),D=Array(256),L=Array(256);for(let o=0;o<256;o++)I[o]=E[o]/255,D[o]=T[o]/255,L[o]=M[o]/255;S=`${l=I.join(",")}${u=D.join(",")}${A=L.join(",")}`}if(E=this.#tx.get(S))return this.#tx.set(o,E),E;let T=`g_${this.#e}_transfer_map_${this.#w++}`,M=`url(#${T})`;this.#tx.set(o,M),this.#tx.set(S,M);let I=this.#tC(T);return this.#tT(l,u,A,I),M}addHCMFilter(o,l){let u=`${o}-${l}`;if(this.#tv===u||(this.#tv=u,this.#tA="none",this.#tb?.remove(),!o||!l))return this.#tA;let A=this.#tw(o);o=E.Util.makeHexColor(...A);let S=this.#tw(l);if(l=E.Util.makeHexColor(...S),this.#tE.style.color="","#000000"===o&&"#ffffff"===l||o===l)return this.#tA;let T=Array(256);for(let o=0;o<=255;o++){let l=o/255;T[o]=l<=.03928?l/12.92:((l+.055)/1.055)**2.4}let M=T.join(","),I=`g_${this.#e}_hcm_filter`,D=this.#ty=this.#tC(I);this.#tT(M,M,M,D),this.#tP(D);let L=(o,l)=>{let u=A[o]/255,E=S[o]/255,T=Array(l+1);for(let o=0;o<=l;o++)T[o]=u+o/l*(E-u);return T.join(",")};return this.#tT(L(0,5),L(1,5),L(2,5),D),this.#tA=`url(#${I})`,this.#tA}addHighlightHCMFilter(o,l,u,A){let S=`${o}-${l}-${u}-${A}`;if(this.#t_===S||(this.#t_=S,this.#tS="none",this.#ty?.remove(),!o||!l))return this.#tS;let[E,T]=[o,l].map(this.#tw.bind(this)),M=Math.round(.2126*E[0]+.7152*E[1]+.0722*E[2]),I=Math.round(.2126*T[0]+.7152*T[1]+.0722*T[2]),[D,L]=[u,A].map(this.#tw.bind(this));I<M&&([M,I,D,L]=[I,M,L,D]),this.#tE.style.color="";let N=(o,l,u)=>{let A=Array(256),S=(I-M)/u,E=o/255,T=(l-o)/(255*u),D=0;for(let o=0;o<=u;o++){let l=Math.round(M+o*S),u=E+o*T;for(let o=D;o<=l;o++)A[o]=u;D=l+1}for(let o=D;o<256;o++)A[o]=A[D-1];return A.join(",")},U=`g_${this.#e}_hcm_highlight_filter`,H=this.#ty=this.#tC(U);return this.#tP(H),this.#tT(N(D[0],L[0],5),N(D[1],L[1],5),N(D[2],L[2],5),H),this.#tS=`url(#${U})`,this.#tS}destroy(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o&&(this.#tA||this.#tS)||(this.#tg&&(this.#tg.parentNode.parentNode.remove(),this.#tg=null),this.#tf&&(this.#tf.clear(),this.#tf=null),this.#w=0)}#tP(o){let l=this.#tm.createElementNS(T,"feColorMatrix");
1l.setAttribute("type","matrix"),l.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"),o.append(l)}#tC(o){let l=this.#tm.createElementNS(T,"filter");return l.setAttribute("color-interpolation-filters","sRGB"),l.setAttribute("id",o),this.#tE.append(l),l}#tk(o,l,u){let A=this.#tm.createElementNS(T,l);A.setAttribute("type","discrete"),A.setAttribute("tableValues",u),o.append(A)}#tT(o,l,u,A){let S=this.#tm.createElementNS(T,"feComponentTransfer");A.append(S),this.#tk(S,"feFuncR",o),this.#tk(S,"feFuncG",l),this.#tk(S,"feFuncB",u)}#tw(o){return this.#tE.style.color=o,tn(getComputedStyle(this.#tE).getPropertyValue("color"))}}l.DOMFilterFactory=D;class L extends S.BaseCanvasFactory{constructor(){let{ownerDocument:o=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=o}_createCanvas(o,l){let u=this._document.createElement("canvas");return u.width=o,u.height=l,u}}async function N(o){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(tt(o,document.baseURI)){let u=await fetch(o);if(!u.ok)throw Error(u.statusText);return l?new Uint8Array(await u.arrayBuffer()):(0,E.stringToBytes)(await u.text())}return new Promise((u,A)=>{let S=new XMLHttpRequest;S.open("GET",o,!0),l&&(S.responseType="arraybuffer"),S.onreadystatechange=()=>{if(S.readyState===XMLHttpRequest.DONE){if(200===S.status||0===S.status){let o;if(l&&S.response?o=new Uint8Array(S.response):!l&&S.responseText&&(o=(0,E.stringToBytes)(S.responseText)),o){u(o);return}}A(Error(S.statusText))}},S.send(null)})}l.DOMCanvasFactory=L;class U extends S.BaseCMapReaderFactory{_fetchData(o,l){return N(o,this.isCompressed).then(o=>({cMapData:o,compressionType:l}))}}l.DOMCMapReaderFactory=U;class H extends S.BaseStandardFontDataFactory{_fetchData(o){return N(o,!0)}}l.DOMStandardFontDataFactory=H;class z extends S.BaseSVGFactory{_createSVG(o){return document.createElementNS(T,o)}}l.DOMSVGFactory=z;class W{constructor(o){let l,u,A,S,E,T,M,I,{viewBox:D,scale:L,rotation:N,offsetX:U=0,offsetY:H=0,dontFlip:z=!1}=o;this.viewBox=D,this.scale=L,this.rotation=N,this.offsetX=U,this.offsetY=H;let W=(D[2]+D[0])/2,X=(D[3]+D[1])/2;switch((N%=360)<0&&(N+=360),N){case 180:l=-1,u=0,A=0,S=1;break;case 90:l=0,u=1,A=1,S=0;break;case 270:l=0,u=-1,A=-1,S=0;break;case 0:l=1,u=0,A=0,S=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}z&&(A=-A,S=-S),0===l?(E=Math.abs(X-D[1])*L+U,T=Math.abs(W-D[0])*L+H,M=(D[3]-D[1])*L,I=(D[2]-D[0])*L):(E=Math.abs(W-D[0])*L+U,T=Math.abs(X-D[1])*L+H,M=(D[2]-D[0])*L,I=(D[3]-D[1])*L),this.transform=[l*L,u*L,A*L,S*L,E-l*L*W-A*L*X,T-u*L*W-S*L*X],this.width=M,this.height=I}get rawDims(){let{viewBox:o}=this;return(0,E.shadow)(this,"rawDims",{pageWidth:o[2]-o[0],pageHeight:o[3]-o[1],pageX:o[0],pageY:o[1]})}clone(){let{scale:o=this.scale,rotation:l=this.rotation,offsetX:u=this.offsetX,offsetY:A=this.offsetY,dontFlip:S=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new W({viewBox:this.viewBox.slice(),scale:o,rotation:l,offsetX:u,offsetY:A,dontFlip:S})}convertToViewportPoint(o,l){return E.Util.applyTransform([o,l],this.transform)}convertToViewportRectangle(o){let l=E.Util.applyTransform([o[0],o[1]],this.transform),u=E.Util.applyTransform([o[2],o[3]],this.transform);return[l[0],l[1],u[0],u[1]]}convertToPdfPoint(o,l){return E.Util.applyInverseTransform([o,l],this.transform)}}l.PageViewport=W;class X extends E.BaseException{constructor(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(o,"RenderingCancelledException"),this.extraDelay=l}}function K(o){let l=o.length,u=0;for(;u<l&&""===o[u].trim();)u++;return"data:"===o.substring(u,u+5).toLowerCase()}function Y(o){return"string"==typeof o&&/\.pdf$/i.test(o)}function J(o){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l||([o]=o.split(/[#?]/,1)),o.substring(o.lastIndexOf("/")+1)}function Q(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof o)return l;if(K(o))return(0,E.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),l;let u=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,A=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,S=u.exec(o),T=A.exec(S[1])||A.exec(S[2])||A.exec(S[3]);if(T&&(T=T[0]).includes("%"))try{T=A.exec(decodeURIComponent(T))[0]}catch{}return T||l}l.RenderingCancelledException=X;class Z{started=Object.create(null);times=[];time(o){o in this.started&&(0,E.warn)(`Timer is already running for ${o}`),this.started[o]=Date.now()}timeEnd(o){o in this.started||(0,E.warn)(`Timer has not been started for ${o}`),this.times.push({name:o,start:this.started[o],end:Date.now()}),delete this.started[o]}toString(){let o=[],l=0;for(let{name:o}of this.times)l=Math.max(o.length,l);for(let{name:u,start:A,end:S}of this.times)o.push(`${u.padEnd(l)} ${S-A}ms
2`);return o.join("")}}function tt(o,l){try{let{protocol:u}=l?new URL(o,l):new URL(o);return"http:"===u||"https:"===u}catch{return!1}}function te(o){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((u,A)=>{let S=document.createElement("script");S.src=o,S.onload=function(o){l&&S.remove(),u(o)},S.onerror=function(){A(Error(`Cannot load script at: ${S.src}`))},(document.head||document.documentElement).append(S)})}function ti(o){console.log("Deprecated API usage: "+o)}l.StatTimer=Z;class tr{static toDateObject(o){if(!o||"string"!=typeof o)return null;A||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let l=A.exec(o);if(!l)return null;let u=parseInt(l[1],10),S=parseInt(l[2],10);S=S>=1&&S<=12?S-1:0;let E=parseInt(l[3],10);E=E>=1&&E<=31?E:1;let T=parseInt(l[4],10);T=T>=0&&T<=23?T:0;let M=parseInt(l[5],10);M=M>=0&&M<=59?M:0;let I=parseInt(l[6],10);I=I>=0&&I<=59?I:0;let D=l[7]||"Z",L=parseInt(l[8],10);L=L>=0&&L<=23?L:0;let N=parseInt(l[9],10)||0;return N=N>=0&&N<=59?N:0,"-"===D?(T+=L,M+=N):"+"===D&&(T-=L,M-=N),new Date(Date.UTC(u,S,E,T,M,I))}}function ts(o,l){let{scale:u=1,rotation:A=0}=l,{width:S,height:E}=o.attributes.style,T=[0,0,parseInt(S),parseInt(E)];return new W({viewBox:T,scale:u,rotation:A})}function tn(o){if(o.startsWith("#")){let l=parseInt(o.slice(1),16);return[(16711680&l)>>16,(65280&l)>>8,255&l]}return o.startsWith("rgb(")?o.slice(4,-1).split(",").map(o=>parseInt(o)):o.startsWith("rgba(")?o.slice(5,-1).split(",").map(o=>parseInt(o)).slice(0,3):((0,E.warn)(`Not a valid color format: "${o}"`),[0,0,0])}
2function ta(o){let l=document.createElement("span");for(let u of(l.style.visibility="hidden",document.body.append(l),o.keys())){l.style.color=u;let A=window.getComputedStyle(l).color;o.set(u,tn(A))}l.remove()}function to(o){let{a:l,b:u,c:A,d:S,e:E,f:T}=o.getTransform();return[l,u,A,S,E,T]}function tl(o){let{a:l,b:u,c:A,d:S,e:E,f:T}=o.getTransform().invertSelf();return[l,u,A,S,E,T]}function th(o,l){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],A=!(arguments.length>3)||void 0===arguments[3]||arguments[3];if(l instanceof W){let{pageWidth:A,pageHeight:S}=l.rawDims,{style:E}=o,T=`calc(var(--scale-factor) * ${A}px)`,M=`calc(var(--scale-factor) * ${S}px)`;u&&l.rotation%180!=0?(E.width=M,E.height=T):(E.width=T,E.height=M)}A&&o.setAttribute("data-main-rotation",l.rotation)}l.PDFDateString=tr},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.BaseStandardFontDataFactory=l.BaseSVGFactory=l.BaseFilterFactory=l.BaseCanvasFactory=l.BaseCMapReaderFactory=void 0;var A=u(1);class S{constructor(){this.constructor===S&&(0,A.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(o){return"none"}addHCMFilter(o,l){return"none"}addHighlightHCMFilter(o,l,u,A){return"none"}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}}l.BaseFilterFactory=S;class E{constructor(){this.constructor===E&&(0,A.unreachable)("Cannot initialize BaseCanvasFactory.")}create(o,l){if(o<=0||l<=0)throw Error("Invalid canvas size");let u=this._createCanvas(o,l);return{canvas:u,context:u.getContext("2d")}}reset(o,l,u){if(!o.canvas)throw Error("Canvas is not specified");if(l<=0||u<=0)throw Error("Invalid canvas size");o.canvas.width=l,o.canvas.height=u}destroy(o){if(!o.canvas)throw Error("Canvas is not specified");o.canvas.width=0,o.canvas.height=0,o.canvas=null,o.context=null}_createCanvas(o,l){(0,A.unreachable)("Abstract method `_createCanvas` called.")}}l.BaseCanvasFactory=E;class T{constructor(o){let{baseUrl:l=null,isCompressed:u=!0}=o;this.constructor===T&&(0,A.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=l,this.isCompressed=u}async fetch(o){let{name:l}=o;if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!l)throw Error("CMap name must be specified.");let u=this.baseUrl+l+(this.isCompressed?".bcmap":""),S=this.isCompressed?A.CMapCompressionType.BINARY:A.CMapCompressionType.NONE;return this._fetchData(u,S).catch(o=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${u}`)})}_fetchData(o,l){(0,A.unreachable)("Abstract method `_fetchData` called.")}}l.BaseCMapReaderFactory=T;class M{constructor(o){let{baseUrl:l=null}=o;this.constructor===M&&(0,A.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=l}async fetch(o){let{filename:l}=o;if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!l)throw Error("Font filename must be specified.");let u=`${this.baseUrl}${l}`;return this._fetchData(u).catch(o=>{throw Error(`Unable to load font data at: ${u}`)})}_fetchData(o){(0,A.unreachable)("Abstract method `_fetchData` called.")}}l.BaseStandardFontDataFactory=M;class I{constructor(){this.constructor===I&&(0,A.unreachable)("Cannot initialize BaseSVGFactory.")}create(o,l){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o<=0||l<=0)throw Error("Invalid SVG dimensions");let A=this._createSVG("svg:svg");return A.setAttribute("version","1.1"),u||(A.setAttribute("width",`${o}px`),A.setAttribute("height",`${l}px`)),A.setAttribute("preserveAspectRatio","none"),A.setAttribute("viewBox",`0 0 ${o} ${l}`),A}createElement(o){if("string"!=typeof o)throw Error("Invalid SVG element type");return this._createSVG(o)}_createSVG(o){(0,A.unreachable)("Abstract method `_createSVG` called.")}}l.BaseSVGFactory=I},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.MurmurHash3_64=void 0;var A=u(1);let S=3285377520,E=4294901760,T=65535;class M{constructor(o){this.h1=o?4294967295&o:S,this.h2=o?4294967295&o:S}update(o){let l,u;
2if("string"==typeof o){l=new Uint8Array(2*o.length),u=0;for(let A=0,S=o.length;A<S;A++){let S=o.charCodeAt(A);S<=255?l[u++]=S:(l[u++]=S>>>8,l[u++]=255&S)}}else if((0,A.isArrayBuffer)(o))u=(l=o.slice()).byteLength;else throw Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let S=u>>2,M=u-4*S,I=new Uint32Array(l.buffer,0,S),D=0,L=0,N=this.h1,U=this.h2,H=3432918353,z=461845907,W=H&T,X=z&T;for(let o=0;o<S;o++)1&o?(N^=D=(D=(D=(D=I[o])*H&E|D*W&T)<<15|D>>>17)*z&E|D*X&T,N=5*(N=N<<13|N>>>19)+3864292196):(U^=L=(L=(L=(L=I[o])*H&E|L*W&T)<<15|L>>>17)*z&E|L*X&T,U=5*(U=U<<13|U>>>19)+3864292196);switch(D=0,M){case 3:D^=l[4*S+2]<<16;case 2:D^=l[4*S+1]<<8;case 1:D^=l[4*S],D=(D=(D=D*H&E|D*W&T)<<15|D>>>17)*z&E|D*X&T,1&S?N^=D:U^=D}this.h1=N,this.h2=U}hexdigest(){let o=this.h1,l=this.h2;return o^=l>>>1,o=3981806797*o&E|36045*o&T,l=4283543511*l&E|((l<<16|o>>>16)*2950163797&E)>>>16,o^=l>>>1,o=444984403*o&E|60499*o&T,l=3301882366*l&E|((l<<16|o>>>16)*3120437893&E)>>>16,((o^=l>>>1)>>>0).toString(16).padStart(8,"0")+(l>>>0).toString(16).padStart(8,"0")}}l.MurmurHash3_64=M},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.FontLoader=l.FontFaceObject=void 0;var A=u(1),S=u(3);class E{#tM=new Set;constructor(o){let{ownerDocument:l=globalThis.document,styleElement:u=null}=o;this._document=l,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(o){this.nativeFontFaces.add(o),this._document.fonts.add(o)}removeNativeFontFace(o){this.nativeFontFaces.delete(o),this._document.fonts.delete(o)}insertRule(o){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let l=this.styleElement.sheet;l.insertRule(o,l.cssRules.length)}clear(){for(let o of this.nativeFontFaces)this._document.fonts.delete(o);this.nativeFontFaces.clear(),this.#tM.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(o){if(!(!o||this.#tM.has(o.loadedName))){if((0,A.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:l,src:u,style:S}=o,E=new FontFace(l,u,S);this.addNativeFontFace(E);try{await E.load(),this.#tM.add(l)}catch{(0,A.warn)(`Cannot load system font: ${o.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(E)}return}(0,A.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(o){if(o.attached||o.missingFile&&!o.systemFontInfo)return;if(o.attached=!0,o.systemFontInfo){await this.loadSystemFont(o.systemFontInfo);return}if(this.isFontLoadingAPISupported){let l=o.createNativeFontFace();if(l){this.addNativeFontFace(l);try{await l.loaded}catch(u){throw(0,A.warn)(`Failed to load font '${l.family}': '${u}'.`),o.disableFontFace=!0,u}}return}let l=o.createFontFaceRule();if(l){if(this.insertRule(l),this.isSyncFontLoadingSupported)return;await new Promise(l=>{let u=this._queueLoadingCallback(l);this._prepareFontLoadEvent(o,u)})}}get isFontLoadingAPISupported(){let o=!!this._document?.fonts;return(0,A.shadow)(this,"isFontLoadingAPISupported",o)}get isSyncFontLoadingSupported(){let o=!1;return S.isNodeJS?o=!0:"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)&&(o=!0),(0,A.shadow)(this,"isSyncFontLoadingSupported",o)}_queueLoadingCallback(o){function l(){for((0,A.assert)(!S.done,"completeRequest() cannot be called twice."),S.done=!0;u.length>0&&u[0].done;){let o=u.shift();setTimeout(o.callback,0)}}let{loadingRequests:u}=this,S={done:!1,complete:l,callback:o};return u.push(S),S}get _loadTestFont(){let o=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,A.shadow)(this,"_loadTestFont",o)}_prepareFontLoadEvent(o,l){let u,S;function E(o,l){return o.charCodeAt(l)<<24|o.charCodeAt(l+1)<<16|o.charCodeAt(l+2)<<8|255&o.charCodeAt(l+3)}function T(o,l,u,A){let S=o.substring(0,l),E=o.substring(l+u);return S+A+E}let M=this._document.createElement("canvas");M.width=1,M.height=1;let I=M.getContext("2d"),D=0;function L(o,l){if(++D>30){(0,A.warn)("Load test font never loaded."),l();return}I.font="30px "+o,I.fillText(".",0,20);let u=I.getImageData(0,0,1,1);if(u.data[3]>0){l();return}setTimeout(L.bind(null,o,l))}let N=`lt${Date.now()}${this.loadTestFontId++}`,U=this._loadTestFont,H=976;U=T(U,H,N.length,N);let z=16,W=1482184792,X=E(U,z);for(u=0,S=N.length-3;u<S;u+=4)X=X-W+E(N,u)|0;u<N.length&&(X=X-W+E(N+"XXX",u)|0),U=T(U,z,4,(0,A.string32)(X));let K=`url(data:font/opentype;base64,${btoa(U)});`,Y=`@font-face {font-family:"${N}";src:${K}}`;this.insertRule(Y);let J=this._document.createElement("div");for(let l of(J.style.visibility="hidden",J.style.width=J.style.height="10px",J.style.position="absolute",J.style.top=J.style.left="0px",[o.loadedName,N])){let o=this._document.createElement("span");o.textContent="Hi",o.style.fontFamily=l,J.append(o)}this._document.body.append(J),L(N,()=>{J.remove(),l.complete()})}}l.FontLoader=E;class T{constructor(o,l){let{isEvalSupported:u=!0,disableFontFace:A=!1,ignoreErrors:S=!1,inspectFont:E=null}=l;for(let l in this.compiledGlyphs=Object.create(null),o)this[l]=o[l];this.isEvalSupported=!1!==u,this.disableFontFace=!0===A,this.ignoreErrors=!0===S,this._inspectFont=E}createNativeFontFace(){let o;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let l={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(l.style=`oblique ${this.cssFontInfo.italicAngle}deg`),o=new FontFace(this.cssFontInfo.fontFamily,this.data,l)}else o=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),o}createFontFaceRule(){let o;if(!this.data||this.disableFontFace)return null;let l=(0,A.bytesToString)(this.data),u=`url(data:${this.mimetype};base64,${btoa(l)});`;if(this.cssFontInfo){let l=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(l+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),o=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${l}src:${u}}`}else o=`@font-face {font-family:"${this.loadedName}";src:${u}}`;return this._inspectFont?.(this,u),o}getPathGenerator(o,l){let u;if(void 0!==this.compiledGlyphs[l])return this.compiledGlyphs[l];try{u=o.get(this.loadedName+"_path_"+l)}catch(o){if(!this.ignoreErrors)throw o;
2return(0,A.warn)(`getPathGenerator - ignoring character: "${o}".`),this.compiledGlyphs[l]=function(o,l){}}if(this.isEvalSupported&&A.FeatureTest.isEvalSupported){let o=[];for(let l of u){let u=void 0!==l.args?l.args.join(","):"";o.push("c.",l.cmd,"(",u,");\n")}return this.compiledGlyphs[l]=Function("c","size",o.join(""))}return this.compiledGlyphs[l]=function(o,l){for(let A of u)"scale"===A.cmd&&(A.args=[l,-l]),o[A.cmd].apply(o,A.args)}}}l.FontFaceObject=T},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.CanvasGraphics=void 0;var A=u(1),S=u(135),E=u(140),T=u(141),M=u(3);let I=16,D=100,L=4096,N=15,U=10,H=1e3,z=16;function W(o,l){if(o._removeMirroring)throw Error("Context is already forwarding operations.");o.__originalSave=o.save,o.__originalRestore=o.restore,o.__originalRotate=o.rotate,o.__originalScale=o.scale,o.__originalTranslate=o.translate,o.__originalTransform=o.transform,o.__originalSetTransform=o.setTransform,o.__originalResetTransform=o.resetTransform,o.__originalClip=o.clip,o.__originalMoveTo=o.moveTo,o.__originalLineTo=o.lineTo,o.__originalBezierCurveTo=o.bezierCurveTo,o.__originalRect=o.rect,o.__originalClosePath=o.closePath,o.__originalBeginPath=o.beginPath,o._removeMirroring=()=>{o.save=o.__originalSave,o.restore=o.__originalRestore,o.rotate=o.__originalRotate,o.scale=o.__originalScale,o.translate=o.__originalTranslate,o.transform=o.__originalTransform,o.setTransform=o.__originalSetTransform,o.resetTransform=o.__originalResetTransform,o.clip=o.__originalClip,o.moveTo=o.__originalMoveTo,o.lineTo=o.__originalLineTo,o.bezierCurveTo=o.__originalBezierCurveTo,o.rect=o.__originalRect,o.closePath=o.__originalClosePath,o.beginPath=o.__originalBeginPath,delete o._removeMirroring},o.save=function(){l.save(),this.__originalSave()},o.restore=function(){l.restore(),this.__originalRestore()},o.translate=function(o,u){l.translate(o,u),this.__originalTranslate(o,u)},o.scale=function(o,u){l.scale(o,u),this.__originalScale(o,u)},o.transform=function(o,u,A,S,E,T){l.transform(o,u,A,S,E,T),this.__originalTransform(o,u,A,S,E,T)},o.setTransform=function(o,u,A,S,E,T){l.setTransform(o,u,A,S,E,T),this.__originalSetTransform(o,u,A,S,E,T)},o.resetTransform=function(){l.resetTransform(),this.__originalResetTransform()},o.rotate=function(o){l.rotate(o),this.__originalRotate(o)},o.clip=function(o){l.clip(o),this.__originalClip(o)},o.moveTo=function(o,u){l.moveTo(o,u),this.__originalMoveTo(o,u)},o.lineTo=function(o,u){l.lineTo(o,u),this.__originalLineTo(o,u)},o.bezierCurveTo=function(o,u,A,S,E,T){l.bezierCurveTo(o,u,A,S,E,T),this.__originalBezierCurveTo(o,u,A,S,E,T)},o.rect=function(o,u,A,S){l.rect(o,u,A,S),this.__originalRect(o,u,A,S)},o.closePath=function(){l.closePath(),this.__originalClosePath()},o.beginPath=function(){l.beginPath(),this.__originalBeginPath()}}class X{constructor(o){this.canvasFactory=o,this.cache=Object.create(null)}getCanvas(o,l,u){let A;return void 0!==this.cache[o]?(A=this.cache[o],this.canvasFactory.reset(A,l,u)):(A=this.canvasFactory.create(l,u),this.cache[o]=A),A}delete(o){delete this.cache[o]}clear(){for(let o in this.cache){let l=this.cache[o];this.canvasFactory.destroy(l),delete this.cache[o]}}}function K(o,l,u,A,E,T,M,I,D,L){let[N,U,H,z,W,X]=(0,S.getCurrentTransform)(o);if(0===U&&0===H){let S=M*N+W,K=Math.round(S),Y=I*z+X,J=Math.round(Y),Q=(M+D)*N+W,Z=Math.abs(Math.round(Q)-K)||1,tt=(I+L)*z+X,te=Math.abs(Math.round(tt)-J)||1;return o.setTransform(Math.sign(N),0,0,Math.sign(z),K,J),o.drawImage(l,u,A,E,T,0,0,Z,te),o.setTransform(N,U,H,z,W,X),[Z,te]}if(0===N&&0===z){let S=I*H+W,K=Math.round(S),Y=M*U+X,J=Math.round(Y),Q=(I+L)*H+W,Z=Math.abs(Math.round(Q)-K)||1,tt=(M+D)*U+X,te=Math.abs(Math.round(tt)-J)||1;return o.setTransform(0,Math.sign(U),Math.sign(H),0,K,J),o.drawImage(l,u,A,E,T,0,0,te,Z),o.setTransform(N,U,H,z,W,X),[te,Z]}o.drawImage(l,u,A,E,T,M,I,D,L);let K=Math.hypot(N,U),Y=Math.hypot(H,z);return[K*D,Y*L]}function Y(o){let l,u,A;let{width:S,height:E}=o;if(S>H||E>H)return null;let T=1e3,M=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),I=S+1,D=new Uint8Array(I*(E+1)),L=S+7&-8,N=new Uint8Array(L*E),U=0;for(let l of o.data){let o=128;for(;o>0;)N[U++]=l&o?0:255,o>>=1}let z=0;for(0!==N[U=0]&&(D[0]=1,++z),u=1;u<S;u++)N[U]!==N[U+1]&&(D[u]=N[U]?2:1,++z),U++;for(0!==N[U]&&(D[u]=2,++z),l=1;l<E;l++){U=l*L,A=l*I,N[U-L]!==N[U]&&(D[A]=N[U]?1:8,++z);let o=(N[U]?4:0)+(N[U-L]?8:0);for(u=1;u<S;u++)M[o=(o>>2)+(N[U+1]?4:0)+(N[U-L+1]?8:0)]&&(D[A+u]=M[o],++z),U++;if(N[U-L]!==N[U]&&(D[A+u]=N[U]?2:4,++z),z>T)return null}for(U=L*(E-1),A=l*I,0!==N[U]&&(D[A]=8,++z),u=1;u<S;u++)N[U]!==N[U+1]&&(D[A+u]=N[U]?4:8,++z),U++;if(0!==N[U]&&(D[A+u]=4,++z),z>T)return null;let W=new Int32Array([0,I,-1,0,-I,0,0,0,1]),X=new Path2D;for(l=0;z&&l<=E;l++){let o=l*I,u=o+S;for(;o<u&&!D[o];)o++;if(o===u)continue;X.moveTo(o%I,l);let A=o,E=D[o];do{let l=W[E];do o+=l;while(!D[o]);let u=D[o];5!==u&&10!==u?(E=u,D[o]=0):(E=u&51*E>>4,D[o]&=E>>2|E<<2),X.lineTo(o%I,o/I|0),!D[o]&&--z}while(A!==o);--l}N=null,D=null;let K=function(o){o.save(),o.scale(1/S,-1/E),o.translate(0,-E),o.fill(X),o.beginPath(),o.restore(
2)};return K}class J{constructor(o,l){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=A.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=A.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=A.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,o,l])}clone(){let o=Object.create(this);return o.clipBox=this.clipBox.slice(),o}setCurrentPoint(o,l){this.x=o,this.y=l}updatePathMinMax(o,l,u){[l,u]=A.Util.applyTransform([l,u],o),this.minX=Math.min(this.minX,l),this.minY=Math.min(this.minY,u),this.maxX=Math.max(this.maxX,l),this.maxY=Math.max(this.maxY,u)}updateRectMinMax(o,l){let u=A.Util.applyTransform(l,o),S=A.Util.applyTransform(l.slice(2),o);this.minX=Math.min(this.minX,u[0],S[0]),this.minY=Math.min(this.minY,u[1],S[1]),this.maxX=Math.max(this.maxX,u[0],S[0]),this.maxY=Math.max(this.maxY,u[1],S[1])}updateScalingPathMinMax(o,l){A.Util.scaleMinMax(o,l),this.minX=Math.min(this.minX,l[0]),this.maxX=Math.max(this.maxX,l[1]),this.minY=Math.min(this.minY,l[2]),this.maxY=Math.max(this.maxY,l[3])}updateCurvePathMinMax(o,l,u,S,E,T,M,I,D,L){let N=A.Util.bezierBoundingBox(l,u,S,E,T,M,I,D);if(L){L[0]=Math.min(L[0],N[0],N[2]),L[1]=Math.max(L[1],N[0],N[2]),L[2]=Math.min(L[2],N[1],N[3]),L[3]=Math.max(L[3],N[1],N[3]);return}this.updateRectMinMax(o,N)}getPathBoundingBox(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E.PathType.FILL,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=[this.minX,this.minY,this.maxX,this.maxY];if(o===E.PathType.STROKE){l||(0,A.unreachable)("Stroke bounding box must include transform.");let o=A.Util.singularValueDecompose2dScale(l),S=o[0]*this.lineWidth/2,E=o[1]*this.lineWidth/2;u[0]-=S,u[1]-=E,u[2]+=S,u[3]+=E}return u}updateClipFromPath(){let o=A.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(o||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(o){this.clipBox=o,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E.PathType.FILL,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return A.Util.intersect(this.clipBox,this.getPathBoundingBox(o,l))}}function Q(o,l){let u,S,E,T;if("undefined"!=typeof ImageData&&l instanceof ImageData){o.putImageData(l,0,0);return}let M=l.height,I=l.width,D=M%z,L=(M-D)/z,N=0===D?L:L+1,U=o.createImageData(I,z),H=0,W,X=l.data,K=U.data;if(l.kind===A.ImageKind.GRAYSCALE_1BPP){let l=X.byteLength,T=new Uint32Array(K.buffer,0,K.byteLength>>2),M=T.length,Y=I+7>>3,J=4294967295,Q=A.FeatureTest.isLittleEndian?4278190080:255;for(u=0;u<N;u++){for(S=0,E=u<L?z:D,W=0;S<E;S++){let o=l-H,u=0,A=o>Y?I:8*o-7,S=-8&A,E=0,M=0;for(;u<S;u+=8)M=X[H++],T[W++]=128&M?J:Q,T[W++]=64&M?J:Q,T[W++]=32&M?J:Q,T[W++]=16&M?J:Q,T[W++]=8&M?J:Q,T[W++]=4&M?J:Q,T[W++]=2&M?J:Q,T[W++]=1&M?J:Q;for(;u<A;u++)0===E&&(M=X[H++],E=128),T[W++]=M&E?J:Q,E>>=1}for(;W<M;)T[W++]=0;o.putImageData(U,0,u*z)}}else if(l.kind===A.ImageKind.RGBA_32BPP){for(u=0,S=0,T=I*z*4;u<L;u++)K.set(X.subarray(H,H+T)),H+=T,o.putImageData(U,0,S),S+=z;u<N&&(T=I*D*4,K.set(X.subarray(H,H+T)),o.putImageData(U,0,S))}else if(l.kind===A.ImageKind.RGB_24BPP)for(u=0,T=I*(E=z);u<N;u++){for(u>=L&&(T=I*(E=D)),W=0,S=T;S--;)K[W++]=X[H++],K[W++]=X[H++],K[W++]=X[H++],K[W++]=255;o.putImageData(U,0,u*z)}else throw Error(`bad image kind: ${l.kind}`)}function Z(o,l){if(l.bitmap){o.drawImage(l.bitmap,0,0);return}let u=l.height,A=l.width,S=u%z,E=(u-S)/z,M=0===S?E:E+1,I=o.createImageData(A,z),D=0,L=l.data,N=I.data;for(let l=0;l<M;l++){let u=l<E?z:S;({srcPos:D}=(0,T.convertBlackAndWhiteToRGBA)({src:L,srcPos:D,dest:N,width:A,height:u,nonBlackColor:0})),o.putImageData(I,0,l*z)}}function tt(o,l){let u=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let A of u)void 0!==o[A]&&(l[A]=o[A]);void 0!==o.setLineDash&&(l.setLineDash(o.getLineDash()),l.lineDashOffset=o.lineDashOffset)}function te(o){o.strokeStyle=o.fillStyle="#000000",o.fillRule="nonzero",o.globalAlpha=1,o.lineWidth=1,o.lineCap="butt",o.lineJoin="miter",o.miterLimit=10,o.globalCompositeOperation="source-over",o.font="10px sans-serif",void 0!==o.setLineDash&&(o.setLineDash([]),o.lineDashOffset=0),M.isNodeJS||(o.filter="none")}function ti(o,l,u,A){let S=o.length;for(let E=3;E<S;E+=4){let S=o[E];if(0===S)o[E-3]=l,o[E-2]=u,o[E-1]=A;else if(S<255){let T=255-S;o[E-3]=o[E-3]*S+l*T>>8,o[E-2]=o[E-2]*S+u*T>>8,o[E-1]=o[E-1]*S+A*T>>8}}}function tr(o,l,u){let A=o.length,S=1/255;for(let E=3;E<A;E+=4){let A=u?u[o[E]]:o[E];l[E]=l[E]*A*S|0}}function ts(o,l,u){let A=o.length;for(let S=3;S<A;S+=4){let A=77*o[S-3]+152*o[S-2]+28*o[S-1];l[S]=u?l[S]*u[A>>8]>>8:l[S]*A>>16}}function tn(o,l,u,A,S,E,T,M,I,D,L){let N;let U=!!E,H=U?E[0]:0,z=U?E[1]:0,W=U?E[2]:0;N="Luminosity"===S?ts:tr;let X=1048576,K=Math.min(A,Math.ceil(X/u));for(let S=0;S<A;S+=K){let E=Math.min(K,A-S),X=o.getImageData(M-D,S+(I-L),u,E),Y=l.getImageData(M,S+I,u,E);U&&ti(X.data,H,z,W),N(X.data,Y.data,T),l.putImageData(Y,M,S+I)}}function ta(o,l,u,A){let S=A[0],E=A[1],T=A[2]-S,M=A[3]-E;0!==T&&0!==M&&(tn(l.context,u,T,M,l.subtype,l.backdrop,l.transferMap,S,E,l.offsetX,l.offsetY),o.save(),o.globalAlpha=1,o.globalCompositeOperation="source-over",o.setTransform(1,0,0,1,0,0),o.drawImage(u.canvas,0,0),o.restore(
2))}function to(o,l){let u=A.Util.singularValueDecompose2dScale(o);u[0]=Math.fround(u[0]),u[1]=Math.fround(u[1]);let E=Math.fround((globalThis.devicePixelRatio||1)*S.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==l?l:u[0]<=E||u[1]<=E}let tl=["butt","round","square"],th=["miter","round","bevel"],td={},tc={};class tu{constructor(o,l,u,A,S,E,T,M){let{optionalContentConfig:I,markedContentStack:D=null}=E;this.ctx=o,this.current=new J(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=l,this.objs=u,this.canvasFactory=A,this.filterFactory=S,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=D||[],this.optionalContentConfig=I,this.cachedCanvases=new X(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=T,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=M,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof o?o.startsWith("g_")?this.commonObjs.get(o):this.objs.get(o):l}beginDrawing(o){let{transform:l,viewport:u,transparency:A=!1,background:E=null}=o,T=this.ctx.canvas.width,M=this.ctx.canvas.height,I=this.ctx.fillStyle;if(this.ctx.fillStyle=E||"#ffffff",this.ctx.fillRect(0,0,T,M),this.ctx.fillStyle=I,A){let o=this.cachedCanvases.getCanvas("transparent",T,M);this.compositeCtx=this.ctx,this.transparentCanvas=o.canvas,this.ctx=o.context,this.ctx.save(),this.ctx.transform(...(0,S.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),te(this.ctx),l&&(this.ctx.transform(...l),this.outputScaleX=l[0],this.outputScaleY=l[0]),this.ctx.transform(...u.transform),this.viewportScale=u.scale,this.baseTransform=(0,S.getCurrentTransform)(this.ctx)}executeOperatorList(o,l,u,S){let E;let T=o.argsArray,M=o.fnArray,I=l||0,D=T.length;if(D===I)return I;let L=D-I>U&&"function"==typeof u,H=L?Date.now()+N:0,z=0,W=this.commonObjs,X=this.objs;for(;;){if(void 0!==S&&I===S.nextBreakPoint)return S.breakIt(I,u),I;if((E=M[I])!==A.OPS.dependency)this[E].apply(this,T[I]);else for(let o of T[I]){let l=o.startsWith("g_")?W:X;if(!l.has(o))return l.get(o,u),I}if(++I===D)return I;if(L&&++z>U){if(Date.now()>H)return u(),I;z=0}}}#tR(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){for(let o of(this.#tR(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let l of o.values())"undefined"!=typeof HTMLCanvasElement&&l instanceof HTMLCanvasElement&&(l.width=l.height=0);o.clear()}this._cachedBitmapsMap.clear(),this.#tF()}#tF(){if(this.pageColors){let o=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==o){let l=this.ctx.filter;this.ctx.filter=o,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=l}}}_scaleImage(o,l){let u,A;let S=o.width,E=o.height,T=Math.max(Math.hypot(l[0],l[1]),1),M=Math.max(Math.hypot(l[2],l[3]),1),I=S,D=E,L="prescale1";for(;T>2&&I>1||M>2&&D>1;){let l=I,S=D;T>2&&I>1&&(l=I>=16384?Math.floor(I/2)-1||1:Math.ceil(I/2),T/=I/l),M>2&&D>1&&(S=D>=16384?Math.floor(D/2)-1||1:Math.ceil(D)/2,M/=D/S),(A=(u=this.cachedCanvases.getCanvas(L,l,S)).context).clearRect(0,0,l,S),A.drawImage(o,0,0,I,D,0,0,l,S),o=u.canvas,I=l,D=S,L="prescale1"===L?"prescale2":"prescale1"}return{img:o,paintWidth:I,paintHeight:D}}_createMaskCanvas(o){let l,u,T,M;let I=this.ctx,{width:D,height:L}=o,N=this.current.fillColor,U=this.current.patternFill,H=(0,S.getCurrentTransform)(I);if((o.bitmap||o.data)&&o.count>1){let A=o.bitmap||o.data.buffer;u=JSON.stringify(U?H:[H.slice(0,4),N]),(l=this._cachedBitmapsMap.get(A))||(l=new Map,this._cachedBitmapsMap.set(A,l));let S=l.get(u);if(S&&!U){let o=Math.round(Math.min(H[0],H[2])+H[4]),l=Math.round(Math.min(H[1],H[3])+H[5]);return{canvas:S,offsetX:o,offsetY:l}}T=S}T||Z((M=this.cachedCanvases.getCanvas("maskCanvas",D,L)).context,o);let z=A.Util.transform(H,[1/D,0,0,-1/L,0,0]);z=A.Util.transform(z,[1,0,0,1,0,-L]);let W=A.Util.applyTransform([0,0],z),X=A.Util.applyTransform([D,L],z),Y=A.Util.normalizeRect([W[0],W[1],X[0],X[1]]),J=
2Math.round(Y[2]-Y[0])||1,Q=Math.round(Y[3]-Y[1])||1,tt=this.cachedCanvases.getCanvas("fillCanvas",J,Q),te=tt.context,ti=Math.min(W[0],X[0]),tr=Math.min(W[1],X[1]);te.translate(-ti,-tr),te.transform(...z),!T&&(T=(T=this._scaleImage(M.canvas,(0,S.getCurrentTransformInverse)(te))).img,l&&U&&l.set(u,T)),te.imageSmoothingEnabled=to((0,S.getCurrentTransform)(te),o.interpolate),K(te,T,0,0,T.width,T.height,0,0,D,L),te.globalCompositeOperation="source-in";let ts=A.Util.transform((0,S.getCurrentTransformInverse)(te),[1,0,0,1,-ti,-tr]);return te.fillStyle=U?N.getPattern(I,this,ts,E.PathType.FILL):N,te.fillRect(0,0,D,L),l&&!U&&(this.cachedCanvases.delete("fillCanvas"),l.set(u,tt.canvas)),{canvas:tt.canvas,offsetX:Math.round(ti),offsetY:Math.round(tr)}}setLineWidth(o){o!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=o,this.ctx.lineWidth=o}setLineCap(o){this.ctx.lineCap=tl[o]}setLineJoin(o){this.ctx.lineJoin=th[o]}setMiterLimit(o){this.ctx.miterLimit=o}setDash(o,l){let u=this.ctx;void 0!==u.setLineDash&&(u.setLineDash(o),u.lineDashOffset=l)}setRenderingIntent(o){}setFlatness(o){}setGState(o){for(let[l,u]of o)switch(l){case"LW":this.setLineWidth(u);break;case"LC":this.setLineCap(u);break;case"LJ":this.setLineJoin(u);break;case"ML":this.setMiterLimit(u);break;case"D":this.setDash(u[0],u[1]);break;case"RI":this.setRenderingIntent(u);break;case"FL":this.setFlatness(u);break;case"Font":this.setFont(u[0],u[1]);break;case"CA":this.current.strokeAlpha=u;break;case"ca":this.current.fillAlpha=u,this.ctx.globalAlpha=u;break;case"BM":this.ctx.globalCompositeOperation=u;break;case"SMask":this.current.activeSMask=u?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(u)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let o=this.inSMaskMode;this.current.activeSMask&&!o?this.beginSMaskMode():!this.current.activeSMask&&o&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let o=this.ctx.canvas.width,l=this.ctx.canvas.height,u="smaskGroupAt"+this.groupLevel,A=this.cachedCanvases.getCanvas(u,o,l);this.suspendedCtx=this.ctx,this.ctx=A.context;let E=this.ctx;E.setTransform(...(0,S.getCurrentTransform)(this.suspendedCtx)),tt(this.suspendedCtx,E),W(E,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),tt(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(o){if(!this.current.activeSMask)return;o?(o[0]=Math.floor(o[0]),o[1]=Math.floor(o[1]),o[2]=Math.ceil(o[2]),o[3]=Math.ceil(o[3])):o=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let l=this.current.activeSMask,u=this.suspendedCtx;ta(u,l,this.ctx,o),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(tt(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let o=this.current;this.stateStack.push(o),this.current=o.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),tt(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(o,l,u,A,S,E){this.ctx.transform(o,l,u,A,S,E),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(o,l,u){let E,T;let M=this.ctx,I=this.current,D=I.x,L=I.y,N=(0,S.getCurrentTransform)(M),U=0===N[0]&&0===N[3]||0===N[1]&&0===N[2],H=U?u.slice(0):null;for(let u=0,S=0,z=o.length;u<z;u++)switch(0|o[u]){case A.OPS.rectangle:D=l[S++],L=l[S++];let z=l[S++],W=l[S++],X=D+z,K=L+W;M.moveTo(D,L),0===z||0===W?M.lineTo(X,K):(M.lineTo(X,L),M.lineTo(X,K),M.lineTo(D,K)),U||I.updateRectMinMax(N,[D,L,X,K]),M.closePath();break;case A.OPS.moveTo:D=l[S++],L=l[S++],M.moveTo(D,L),U||I.updatePathMinMax(N,D,L);break;case A.OPS.lineTo:D=l[S++],L=l[S++],M.lineTo(D,L),U||I.updatePathMinMax(N,D,L);break;case A.OPS.curveTo:E=D,T=L,D=l[S+4],L=l[S+5],M.bezierCurveTo(l[S],l[S+1],l[S+2],l[S+3],D,L),I.updateCurvePathMinMax(N,E,T,l[S],l[S+1],l[S+2],l[S+3],D,L,H),S+=6;break;case A.OPS.curveTo2:E=D,T=L,M.bezierCurveTo(D,L,l[S],l[S+1],l[S+2],l[S+3]),I.updateCurvePathMinMax(N,E,T,D,L,l[S],l[S+1],l[S+2],l[S+3],H),D=l[S+2],L=l[S+3],S+=4;break;case A.OPS.curveTo3:E=D,T=L,D=l[S+2],L=l[S+3],M.bezierCurveTo(l[S],l[S+1],D,L,D,L),I.updateCurvePathMinMax(N,E,T,l[S],l[S+1],D,L,D,L,H),S+=4;break;case A.OPS.closePath:M.closePath()}U&&I.updateScalingPathMinMax(N,H),I.setCurrentPoint(D,L)}closePath(){this.ctx.closePath()}stroke(){let o=!(arguments.length>0)||void 0===arguments[0]||arguments[0],l=this.ctx,u=this.current.strokeColor;l.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof u&&u?.getPattern?(l.save(),l.strokeStyle=u.getPattern(l,this,(0,S.getCurrentTransformInverse)(l),E.PathType.STROKE),this.rescaleAndStroke(!1),l.restore(
2)):this.rescaleAndStroke(!0)),o&&this.consumePath(this.current.getClippedPathBoundingBox()),l.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let o=!(arguments.length>0)||void 0===arguments[0]||arguments[0],l=this.ctx,u=this.current.fillColor,A=this.current.patternFill,T=!1;A&&(l.save(),l.fillStyle=u.getPattern(l,this,(0,S.getCurrentTransformInverse)(l),E.PathType.FILL),T=!0);let M=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==M&&(this.pendingEOFill?(l.fill("evenodd"),this.pendingEOFill=!1):l.fill()),T&&l.restore(),o&&this.consumePath(M)}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=td}eoClip(){this.pendingClip=tc}beginText(){this.current.textMatrix=A.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let o=this.pendingTextPaths,l=this.ctx;if(void 0===o){l.beginPath();return}for(let u of(l.save(),l.beginPath(),o))l.setTransform(...u.transform),l.translate(u.x,u.y),u.addToPath(l,u.fontSize);l.restore(),l.clip(),l.beginPath(),delete this.pendingTextPaths}setCharSpacing(o){this.current.charSpacing=o}setWordSpacing(o){this.current.wordSpacing=o}setHScale(o){this.current.textHScale=o/100}setLeading(o){this.current.leading=-o}setFont(o,l){let u=this.commonObjs.get(o),S=this.current;if(!u)throw Error(`Can't find font for ${o}`);if(S.fontMatrix=u.fontMatrix||A.FONT_IDENTITY_MATRIX,(0===S.fontMatrix[0]||0===S.fontMatrix[3])&&(0,A.warn)("Invalid font matrix for font "+o),l<0?(l=-l,S.fontDirection=-1):S.fontDirection=1,this.current.font=u,this.current.fontSize=l,u.isType3Font)return;let E=u.loadedName||"sans-serif",T=u.systemFontInfo?.css||`"${E}", ${u.fallbackName}`,M="normal";u.black?M="900":u.bold&&(M="bold");let L=u.italic?"italic":"normal",N=l;l<I?N=I:l>D&&(N=D),this.current.fontSizeScale=l/N,this.ctx.font=`${L} ${M} ${N}px ${T}`}setTextRenderingMode(o){this.current.textRenderingMode=o}setTextRise(o){this.current.textRise=o}moveText(o,l){this.current.x=this.current.lineX+=o,this.current.y=this.current.lineY+=l}setLeadingMoveText(o,l){this.setLeading(-l),this.moveText(o,l)}setTextMatrix(o,l,u,A,S,E){this.current.textMatrix=[o,l,u,A,S,E],this.current.textMatrixScale=Math.hypot(o,l),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(o,l,u,E){let T;let M=this.ctx,I=this.current,D=I.font,L=I.textRenderingMode,N=I.fontSize/I.fontSizeScale,U=L&A.TextRenderingMode.FILL_STROKE_MASK,H=!!(L&A.TextRenderingMode.ADD_TO_PATH_FLAG),z=I.patternFill&&!D.missingFile;if((D.disableFontFace||H||z)&&(T=D.getPathGenerator(this.commonObjs,o)),D.disableFontFace||z?(M.save(),M.translate(l,u),M.beginPath(),T(M,N),E&&M.setTransform(...E),(U===A.TextRenderingMode.FILL||U===A.TextRenderingMode.FILL_STROKE)&&M.fill(),(U===A.TextRenderingMode.STROKE||U===A.TextRenderingMode.FILL_STROKE)&&M.stroke(),M.restore()):((U===A.TextRenderingMode.FILL||U===A.TextRenderingMode.FILL_STROKE)&&M.fillText(o,l,u),(U===A.TextRenderingMode.STROKE||U===A.TextRenderingMode.FILL_STROKE)&&M.strokeText(o,l,u)),H){let o=this.pendingTextPaths||=[];o.push({transform:(0,S.getCurrentTransform)(M),x:l,y:u,fontSize:N,addToPath:T})}}get isFontSubpixelAAEnabled(){let{context:o}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);o.scale(1.5,1),o.fillText("I",0,10);let l=o.getImageData(0,0,10,10).data,u=!1;for(let o=3;o<l.length;o+=4)if(l[o]>0&&l[o]<255){u=!0;break}return(0,A.shadow)(this,"isFontSubpixelAAEnabled",u)}showText(o){let l;let u=this.current,T=u.font;if(T.isType3Font)return this.showType3Text(o);let M=u.fontSize;if(0===M)return;let I=this.ctx,D=u.fontSizeScale,L=u.charSpacing,N=u.wordSpacing,U=u.fontDirection,H=u.textHScale*U,z=o.length,W=T.vertical,X=W?1:-1,K=T.defaultVMetrics,Y=M*u.fontMatrix[0],J=u.textRenderingMode===A.TextRenderingMode.FILL&&!T.disableFontFace&&!u.patternFill;if(I.save(),I.transform(...u.textMatrix),I.translate(u.x,u.y+u.textRise),U>0?I.scale(H,-1):I.scale(H,1),u.patternFill){I.save();let o=u.fillColor.getPattern(I,this,(0,S.getCurrentTransformInverse)(I),E.PathType.FILL);
2l=(0,S.getCurrentTransform)(I),I.restore(),I.fillStyle=o}let Q=u.lineWidth,Z=u.textMatrixScale;if(0===Z||0===Q){let o=u.textRenderingMode&A.TextRenderingMode.FILL_STROKE_MASK;(o===A.TextRenderingMode.STROKE||o===A.TextRenderingMode.FILL_STROKE)&&(Q=this.getSinglePixelWidth())}else Q/=Z;if(1!==D&&(I.scale(D,D),Q/=D),I.lineWidth=Q,T.isInvalidPDFjsFont){let l=[],A=0;for(let u of o)l.push(u.unicode),A+=u.width;I.fillText(l.join(""),0,0),u.x+=A*Y*H,I.restore(),this.compose();return}let tt=0,te;for(te=0;te<z;++te){let u,A,S;let E=o[te];if("number"==typeof E){tt+=X*E*M/1e3;continue}let H=!1,z=(E.isSpace?N:0)+L,Q=E.fontChar,Z=E.accent,ti=E.width;if(W){let o=E.vmetric||K,l=-(E.vmetric?o[1]:.5*ti)*Y,S=o[2]*Y;ti=o?-o[0]:ti,u=l/D,A=(tt+S)/D}else u=tt/D,A=0;if(T.remeasure&&ti>0){let o=1e3*I.measureText(Q).width/M*D;if(ti<o&&this.isFontSubpixelAAEnabled){let l=ti/o;H=!0,I.save(),I.scale(l,1),u/=l}else ti!==o&&(u+=(ti-o)/2e3*M/D)}if(this.contentVisible&&(E.isInFont||T.missingFile)){if(J&&!Z)I.fillText(Q,u,A);else if(this.paintChar(Q,u,A,l),Z){let o=u+M*Z.offset.x/D,S=A-M*Z.offset.y/D;this.paintChar(Z.fontChar,o,S,l)}}tt+=S=W?ti*Y-z*U:ti*Y+z*U,H&&I.restore()}W?u.y-=tt:u.x+=tt*H,I.restore(),this.compose()}showType3Text(o){let l,u,S,E;let T=this.ctx,M=this.current,I=M.font,D=M.fontSize,L=M.fontDirection,N=I.vertical?1:-1,U=M.charSpacing,H=M.wordSpacing,z=M.textHScale*L,W=M.fontMatrix||A.FONT_IDENTITY_MATRIX,X=o.length,K=M.textRenderingMode===A.TextRenderingMode.INVISIBLE;if(!K&&0!==D){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,T.save(),T.transform(...M.textMatrix),T.translate(M.x,M.y),T.scale(z,L),l=0;l<X;++l){if("number"==typeof(u=o[l])){E=N*u*D/1e3,this.ctx.translate(E,0),M.x+=E*z;continue}let L=(u.isSpace?H:0)+U,X=I.charProcOperatorList[u.operatorListId];if(!X){(0,A.warn)(`Type3 character "${u.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=u,this.save(),T.scale(D,D),T.transform(...W),this.executeOperatorList(X),this.restore());let K=A.Util.applyTransform([u.width,0],W);S=K[0]*D+L,T.translate(S,0),M.x+=S*z}T.restore(),this.processingType3=null}}setCharWidth(o,l){}setCharWidthAndBounds(o,l,u,A,S,E){this.ctx.rect(u,A,S-u,E-A),this.ctx.clip(),this.endPath()}getColorN_Pattern(o){let l;if("TilingPattern"===o[0]){let u=o[1],A=this.baseTransform||(0,S.getCurrentTransform)(this.ctx),T={createCanvasGraphics:o=>new tu(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};l=new E.TilingPattern(o,u,this.ctx,T,A)}else l=this._getPattern(o[1],o[2]);return l}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(o,l,u){let S=A.Util.makeHexColor(o,l,u);this.ctx.strokeStyle=S,this.current.strokeColor=S}setFillRGBColor(o,l,u){let S=A.Util.makeHexColor(o,l,u);this.ctx.fillStyle=S,this.current.fillColor=S,this.current.patternFill=!1}_getPattern(o){let l,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(o)?l=this.cachedPatterns.get(o):(l=(0,E.getShadingPattern)(this.getObject(o)),this.cachedPatterns.set(o,l)),u&&(l.matrix=u),l}shadingFill(o){if(!this.contentVisible)return;let l=this.ctx;this.save();let u=this._getPattern(o);l.fillStyle=u.getPattern(l,this,(0,S.getCurrentTransformInverse)(l),E.PathType.SHADING);let T=(0,S.getCurrentTransformInverse)(l);if(T){let{width:o,height:u}=l.canvas,[S,E,M,I]=A.Util.getAxialAlignedBoundingBox([0,0,o,u],T);this.ctx.fillRect(S,E,M-S,I-E)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,A.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,A.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(o,l){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(o)&&6===o.length&&this.transform(...o),this.baseTransform=(0,S.getCurrentTransform)(this.ctx),l)){let o=l[2]-l[0],u=l[3]-l[1];this.ctx.rect(l[0],l[1],o,u),this.current.updateRectMinMax((0,S.getCurrentTransform)(this.ctx),l),this.clip(),this.endPath()}}
2paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(o){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let l=this.ctx;o.isolated||(0,A.info)("TODO: Support non-isolated groups."),o.knockout&&(0,A.warn)("Knockout groups not supported.");let u=(0,S.getCurrentTransform)(l);if(o.matrix&&l.transform(...o.matrix),!o.bbox)throw Error("Bounding box is required.");let E=A.Util.getAxialAlignedBoundingBox(o.bbox,(0,S.getCurrentTransform)(l)),T=[0,0,l.canvas.width,l.canvas.height];E=A.Util.intersect(E,T)||[0,0,0,0];let M=Math.floor(E[0]),I=Math.floor(E[1]),D=Math.max(Math.ceil(E[2])-M,1),N=Math.max(Math.ceil(E[3])-I,1),U=1,H=1;D>L&&(U=D/L,D=L),N>L&&(H=N/L,N=L),this.current.startNewPathAndClipBox([0,0,D,N]);let z="groupAt"+this.groupLevel;o.smask&&(z+="_smask_"+this.smaskCounter++%2);let W=this.cachedCanvases.getCanvas(z,D,N),X=W.context;X.scale(1/U,1/H),X.translate(-M,-I),X.transform(...u),o.smask?this.smaskStack.push({canvas:W.canvas,context:X,offsetX:M,offsetY:I,scaleX:U,scaleY:H,subtype:o.smask.subtype,backdrop:o.smask.backdrop,transferMap:o.smask.transferMap||null,startTransformInverse:null}):(l.setTransform(1,0,0,1,0,0),l.translate(M,I),l.scale(U,H),l.save()),tt(l,X),this.ctx=X,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(l),this.groupLevel++}endGroup(o){if(!this.contentVisible)return;this.groupLevel--;let l=this.ctx,u=this.groupStack.pop();if(this.ctx=u,this.ctx.imageSmoothingEnabled=!1,o.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let o=(0,S.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...o);let u=A.Util.getAxialAlignedBoundingBox([0,0,l.canvas.width,l.canvas.height],o);this.ctx.drawImage(l.canvas,0,0),this.ctx.restore(),this.compose(u)}}beginAnnotation(o,l,u,E,T){if(this.#tR(),te(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(l)&&4===l.length){let E=l[2]-l[0],M=l[3]-l[1];if(T&&this.annotationCanvasMap){u=u.slice(),u[4]-=l[0],u[5]-=l[1],(l=l.slice())[0]=l[1]=0,l[2]=E,l[3]=M;let[T,I]=A.Util.singularValueDecompose2dScale((0,S.getCurrentTransform)(this.ctx)),{viewportScale:D}=this,L=Math.ceil(E*this.outputScaleX*D),N=Math.ceil(M*this.outputScaleY*D);this.annotationCanvas=this.canvasFactory.create(L,N);let{canvas:U,context:H}=this.annotationCanvas;this.annotationCanvasMap.set(o,U),this.annotationCanvas.savedCtx=this.ctx,this.ctx=H,this.ctx.save(),this.ctx.setTransform(T,0,0,-I,0,M*I),te(this.ctx)}else te(this.ctx),this.ctx.rect(l[0],l[1],E,M),this.ctx.clip(),this.endPath()}this.current=new J(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...u),this.transform(...E)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#tF(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(o){if(!this.contentVisible)return;let l=o.count;(o=this.getObject(o.data,o)).count=l;let u=this.ctx,A=this.processingType3;if(A&&(void 0===A.compiled&&(A.compiled=Y(o)),A.compiled)){A.compiled(u);return}let S=this._createMaskCanvas(o),E=S.canvas;u.save(),u.setTransform(1,0,0,1,0,0),u.drawImage(E,S.offsetX,S.offsetY),u.restore(),this.compose()}paintImageMaskXObjectRepeat(o,l){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,E=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,T=arguments.length>4?arguments[4]:void 0,M=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;o=this.getObject(o.data,o);let I=this.ctx;I.save();let D=(0,S.getCurrentTransform)(I);I.transform(l,u,E,T,0,0);let L=this._createMaskCanvas(o);I.setTransform(1,0,0,1,L.offsetX-D[4],L.offsetY-D[5]);for(let o=0,S=M.length;o<S;o+=2){let S=A.Util.transform(D,[l,u,E,T,M[o],M[o+1]]),[N,U]=A.Util.applyTransform([0,0],S);I.drawImage(L.canvas,N,U)}I.restore(),this.compose()}paintImageMaskXObjectGroup(o){if(!this.contentVisible)return;let l=this.ctx,u=this.current.fillColor,A=this.current.patternFill;for(let T of o){let{data:o,width:M,height:I,transform:D}=T,L=this.cachedCanvases.getCanvas("maskCanvas",M,I),N=L.context;N.save();let U=this.getObject(o,T);Z(N,U),N.globalCompositeOperation="source-in",N.fillStyle=A?u.getPattern(N,this,(0,S.getCurrentTransformInverse)(l),E.PathType.FILL):u,N.fillRect(0,0,M,I),N.restore(
2),l.save(),l.transform(...D),l.scale(1,-1),K(l,L.canvas,0,0,M,I,0,-1,1,1),l.restore()}this.compose()}paintImageXObject(o){if(!this.contentVisible)return;let l=this.getObject(o);if(!l){(0,A.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(l)}paintImageXObjectRepeat(o,l,u,S){if(!this.contentVisible)return;let E=this.getObject(o);if(!E){(0,A.warn)("Dependent image isn't ready yet");return}let T=E.width,M=E.height,I=[];for(let o=0,A=S.length;o<A;o+=2)I.push({transform:[l,0,0,u,S[o],S[o+1]],x:0,y:0,w:T,h:M});this.paintInlineImageXObjectGroup(E,I)}applyTransferMapsToCanvas(o){return"none"!==this.current.transferMaps&&(o.filter=this.current.transferMaps,o.drawImage(o.canvas,0,0),o.filter="none"),o.canvas}applyTransferMapsToBitmap(o){if("none"===this.current.transferMaps)return o.bitmap;let{bitmap:l,width:u,height:A}=o,S=this.cachedCanvases.getCanvas("inlineImage",u,A),E=S.context;return E.filter=this.current.transferMaps,E.drawImage(l,0,0),E.filter="none",S.canvas}paintInlineImageXObject(o){let l;if(!this.contentVisible)return;let u=o.width,A=o.height,E=this.ctx;if(this.save(),M.isNodeJS||(E.filter="none"),E.scale(1/u,-1/A),o.bitmap)l=this.applyTransferMapsToBitmap(o);else if("function"==typeof HTMLElement&&o instanceof HTMLElement||!o.data)l=o;else{let S=this.cachedCanvases.getCanvas("inlineImage",u,A),E=S.context;Q(E,o),l=this.applyTransferMapsToCanvas(E)}let T=this._scaleImage(l,(0,S.getCurrentTransformInverse)(E));E.imageSmoothingEnabled=to((0,S.getCurrentTransform)(E),o.interpolate),K(E,T.img,0,0,T.paintWidth,T.paintHeight,0,-A,u,A),this.compose(),this.restore()}paintInlineImageXObjectGroup(o,l){let u;if(!this.contentVisible)return;let A=this.ctx;if(o.bitmap)u=o.bitmap;else{let l=o.width,A=o.height,S=this.cachedCanvases.getCanvas("inlineImage",l,A),E=S.context;Q(E,o),u=this.applyTransferMapsToCanvas(E)}for(let o of l)A.save(),A.transform(...o.transform),A.scale(1,-1),K(A,u,o.x,o.y,o.w,o.h,0,-1,1,1),A.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(o){}markPointProps(o,l){}beginMarkedContent(o){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(o,l){"OC"===o?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(l)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(o){let l=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(o);let u=this.ctx;this.pendingClip&&(l||(this.pendingClip===tc?u.clip("evenodd"):u.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),u.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let o=(0,S.getCurrentTransform)(this.ctx);if(0===o[1]&&0===o[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(o[0]),Math.abs(o[3]));else{let l=Math.abs(o[0]*o[3]-o[2]*o[1]),u=Math.hypot(o[0],o[2]),A=Math.hypot(o[1],o[3]);this._cachedGetSinglePixelWidth=Math.max(u,A)/l}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let o,l;let{lineWidth:u}=this.current,{a:A,b:S,c:E,d:T}=this.ctx.getTransform();if(0===S&&0===E){let S=Math.abs(A),E=Math.abs(T);if(S===E){if(0===u)o=l=1/S;else{let A=S*u;o=l=A<1?1/A:1}}else if(0===u)o=1/S,l=1/E;else{let A=S*u,T=E*u;o=A<1?1/A:1,l=T<1?1/T:1}}else{let M=Math.abs(A*T-S*E),I=Math.hypot(A,S),D=Math.hypot(E,T);if(0===u)o=D/M,l=I/M;else{let A=u*M;o=D>A?D/A:1,l=I>A?I/A:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=l}return this._cachedScaleForStroking}rescaleAndStroke(o){let{ctx:l}=this,{lineWidth:u}=this.current,[A,S]=this.getScaleForStroking();if(l.lineWidth=u||1,1===A&&1===S){l.stroke();return}let E=l.getLineDash();if(o&&l.save(),l.scale(A,S),E.length>0){let o=Math.max(A,S);l.setLineDash(E.map(l=>l/o)),l.lineDashOffset/=o}l.stroke(),o&&l.restore()}isContentVisible(){for(let o=this.markedContentStack.length-1;o>=0;o--)if(!this.markedContentStack[o].visible)return!1;return!0}}for(let o in l.CanvasGraphics=tu,A.OPS)void 0!==tu.prototype[o]&&(tu.prototype[A.OPS[o]]=tu.prototype[o])},(o,l,u)=>{"use strict";
vendor: 1,739 bytes, line 2
2Object.defineProperty(l,"__esModule",{value:!0}),l.TilingPattern=l.PathType=void 0,l.getShadingPattern=H;var A=u(1),S=u(135);let E={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function T(o,l){if(!l)return;let u=l[2]-l[0],A=l[3]-l[1],S=new Path2D;S.rect(l[0],l[1],u,A),o.clip(S)}l.PathType=E;class M{constructor(){this.constructor===M&&(0,A.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,A.unreachable)("Abstract method `getPattern` called.")}}class I extends M{constructor(o){super(),this._type=o[1],this._bbox=o[2],this._colorStops=o[3],this._p0=o[4],this._p1=o[5],this._r0=o[6],this._r1=o[7],this.matrix=null}_createGradient(o){let l;for(let u of("axial"===this._type?l=o.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(l=o.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))l.addColorStop(u[0],u[1]);return l}getPattern(o,l,u,M){let I;if(M===E.STROKE||M===E.FILL){let E=l.current.getClippedPathBoundingBox(M,(0,S.getCurrentTransform)(o))||[0,0,0,0],D=Math.ceil(E[2]-E[0])||1,L=Math.ceil(E[3]-E[1])||1,N=l.cachedCanvases.getCanvas("pattern",D,L,!0),U=N.context;U.clearRect(0,0,U.canvas.width,U.canvas.height),U.beginPath(),U.rect(0,0,U.canvas.width,U.canvas.height),U.translate(-E[0],-E[1]),u=A.Util.transform(u,[1,0,0,1,E[0],E[1]]),U.transform(...l.baseTransform),this.matrix&&U.transform(...this.matrix),T(U,this._bbox),U.fillStyle=this._createGradient(U),U.fill(),I=o.createPattern(N.canvas,"no-repeat");let H=new DOMMatrix(u);I.setTransform(H)}else T(o,this._bbox),I=this._createGradient(o);return I}}function D(o,l,u,A,S,E,T,M){let I,D,L,N,U,H,z,W,X;let K=l.coords,Y=l.colors,J=o.data,Q=4*o.width;K[u+1]>
2K[A+1]&&(I=u,u=A,A=I,I=E,E=T,T=I),K[A+1]>K[S+1]&&(I=A,A=S,S=I,I=T,T=M,M=I),K[u+1]>K[A+1]&&(I=u,u=A,A=I,I=E,E=T,T=I);let Z=(K[u]+l.offsetX)*l.scaleX,tt=(K[u+1]+l.offsetY)*l.scaleY,te=(K[A]+l.offsetX)*l.scaleX,ti=(K[A+1]+l.offsetY)*l.scaleY,tr=(K[S]+l.offsetX)*l.scaleX,ts=(K[S+1]+l.offsetY)*l.scaleY;if(tt>=ts)return;let tn=Y[E],ta=Y[E+1],to=Y[E+2],tl=Y[T],th=Y[T+1],td=Y[T+2],tc=Y[M],tu=Y[M+1],tp=Y[M+2],tf=Math.round(tt),tg=Math.round(ts);for(let o=tf;o<=tg;o++){let l;if(o<ti){let l;D=Z-(Z-te)*(l=o<tt?0:(tt-o)/(tt-ti)),L=tn-(tn-tl)*l,N=ta-(ta-th)*l,U=to-(to-td)*l}else{let l;D=te-(te-tr)*(l=o>ts?1:ti===ts?0:(ti-o)/(ti-ts)),L=tl-(tl-tc)*l,N=th-(th-tu)*l,U=td-(td-tp)*l}H=Z-(Z-tr)*(l=o<tt?0:o>ts?1:(tt-o)/(tt-ts)),z=tn-(tn-tc)*l,W=ta-(ta-tu)*l,X=to-(to-tp)*l;let u=Math.round(Math.min(D,H)),A=Math.round(Math.max(D,H)),S=Q*o+4*u;for(let o=u;o<=A;o++)(l=(D-o)/(D-H))<0?l=0:l>1&&(l=1),J[S++]=L-(L-z)*l|0,J[S++]=N-(N-W)*l|0,J[S++]=U-(U-X)*l|0,J[S++]=255}}function L(o,l,u){let A,S;let E=l.coords,T=l.colors;switch(l.type){case"lattice":let M=l.verticesPerRow,I=Math.floor(E.length/M)-1,L=M-1;for(A=0;A<I;A++){let l=A*M;for(let A=0;A<L;A++,l++)D(o,u,E[l],E[l+1],E[l+M],T[l],T[l+1],T[l+M]),D(o,u,E[l+M+1],E[l+1],E[l+M],T[l+M+1],T[l+1],T[l+M])}break;case"triangles":for(A=0,S=E.length;A<S;A+=3)D(o,u,E[A],E[A+1],E[A+2],T[A],T[A+1],T[A+2]);break;default:throw Error("illegal figure")}}class N extends M{constructor(o){super(),this._coords=o[2],this._colors=o[3],this._figures=o[4],this._bounds=o[5],this._bbox=o[7],this._background=o[8],this.matrix=null}_createMeshCanvas(o,l,u){let A=1.1,S=3e3,E=2,T=Math.floor(this._bounds[0]),M=Math.floor(this._bounds[1]),I=Math.ceil(this._bounds[2])-T,D=Math.ceil(this._bounds[3])-M,N=Math.min(Math.ceil(Math.abs(I*o[0]*A)),S),U=Math.min(Math.ceil(Math.abs(D*o[1]*A)),S),H=I/N,z=D/U,W={coords:this._coords,colors:this._colors,offsetX:-T,offsetY:-M,scaleX:1/H,scaleY:1/z},X=N+2*E,K=U+2*E,Y=u.getCanvas("mesh",X,K,!1),J=Y.context,Q=J.createImageData(N,U);if(l){let o=Q.data;for(let u=0,A=o.length;u<A;u+=4)o[u]=l[0],o[u+1]=l[1],o[u+2]=l[2],o[u+3]=255}for(let o of this._figures)L(Q,o,W);J.putImageData(Q,E,E);let Z=Y.canvas;return{canvas:Z,offsetX:T-E*H,offsetY:M-E*z,scaleX:H,scaleY:z}}getPattern(o,l,u,M){let I;if(T(o,this._bbox),M===E.SHADING)I=A.Util.singularValueDecompose2dScale((0,S.getCurrentTransform)(o));else if(I=A.Util.singularValueDecompose2dScale(l.baseTransform),this.matrix){let o=A.Util.singularValueDecompose2dScale(this.matrix);I=[I[0]*o[0],I[1]*o[1]]}let D=this._createMeshCanvas(I,M===E.SHADING?null:this._background,l.cachedCanvases);return M!==E.SHADING&&(o.setTransform(...l.baseTransform),this.matrix&&o.transform(...this.matrix)),o.translate(D.offsetX,D.offsetY),o.scale(D.scaleX,D.scaleY),o.createPattern(D.canvas,"no-repeat")}}class U extends M{getPattern(){return"hotpink"}}function H(o){switch(o[0]){case"RadialAxial":return new I(o);case"Mesh":return new N(o);case"Dummy":return new U}throw Error(`Unknown IR type: ${o[0]}`)}let z={COLORED:1,UNCOLORED:2};class W{static MAX_PATTERN_SIZE=3e3;constructor(o,l,u,A,S){this.operatorList=o[2],this.matrix=o[3]||[1,0,0,1,0,0],this.bbox=o[4],this.xstep=o[5],this.ystep=o[6],this.paintType=o[7],this.tilingType=o[8],this.color=l,this.ctx=u,this.canvasGraphicsFactory=A,this.baseTransform=S}createPatternCanvas(o){let l=this.operatorList,u=this.bbox,E=this.xstep,T=this.ystep,M=this.paintType,I=this.tilingType,D=this.color,L=this.canvasGraphicsFactory;(0,A.info)("TilingType: "+I);let N=u[0],U=u[1],H=u[2],z=u[3],W=A.Util.singularValueDecompose2dScale(this.matrix),X=A.Util.singularValueDecompose2dScale(this.baseTransform),K=[W[0]*X[0],W[1]*X[1]],Y=this.getSizeAndScale(E,this.ctx.canvas.width,K[0]),J=this.getSizeAndScale(T,this.ctx.canvas.height,K[1]),Q=o.cachedCanvases.getCanvas("pattern",Y.size,J.size,!0),Z=Q.context,tt=L.createCanvasGraphics(Z);tt.groupLevel=o.groupLevel,this.setFillAndStrokeStyleToContext(tt,M,D);let te=N,ti=U,tr=H,ts=z;return N<0&&(te=0,tr+=Math.abs(N)),U<0&&(ti=0,ts+=Math.abs(U)),Z.translate(-(Y.scale*te),-(J.scale*ti)),tt.transform(Y.scale,0,0,J.scale,0,0),Z.save(),this.clipBbox(tt,te,ti,tr,ts),tt.baseTransform=(0,S.getCurrentTransform)(tt.ctx),tt.executeOperatorList(l),tt.endDrawing(),{canvas:Q.canvas,scaleX:Y.scale,scaleY:J.scale,offsetX:te,offsetY:ti}}getSizeAndScale(o,l,u){o=Math.abs(o);let A=Math.max(W.MAX_PATTERN_SIZE,l),S=Math.ceil(o*u);return S>=A?S=A:u=S/o,{scale:u,size:S}}clipBbox(o,l,u,A,E){let T=A-l,M=E-u;o.ctx.rect(l,u,T,M),o.current.updateRectMinMax((0,S.getCurrentTransform)(o.ctx),[l,u,A,E]),o.clip(),o.endPath()}setFillAndStrokeStyleToContext(o,l,u){let S=o.ctx,E=o.current;switch(l){case z.COLORED:let T=this.ctx;S.fillStyle=T.fillStyle,S.strokeStyle=T.strokeStyle,E.fillColor=T.fillStyle,E.strokeColor=T.strokeStyle;break;case z.UNCOLORED:let M=A.Util.makeHexColor(u[0],u[1],u[2]);S.fillStyle=M,S.strokeStyle=M,E.fillColor=M,E.strokeColor=M;break;default:throw new A.FormatError(`Unsupported paint type: ${l}`)}}getPattern(o,l,u,S){let T=u;S!==E.SHADING&&(T=A.Util.transform(T,l.baseTransform),this.matrix&&(T=A.Util.transform(T,this.matrix
2)));let M=this.createPatternCanvas(l),I=new DOMMatrix(T);I=(I=I.translate(M.offsetX,M.offsetY)).scale(1/M.scaleX,1/M.scaleY);let D=o.createPattern(M.canvas,"repeat");return D.setTransform(I),D}}l.TilingPattern=W},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.convertBlackAndWhiteToRGBA=E,l.convertToRGBA=S,l.grayToRGBA=M;var A=u(1);function S(o){switch(o.kind){case A.ImageKind.GRAYSCALE_1BPP:return E(o);case A.ImageKind.RGB_24BPP:return T(o)}return null}function E(o){let{src:l,srcPos:u=0,dest:S,width:E,height:T,nonBlackColor:M=4294967295,inverseDecode:I=!1}=o,D=A.FeatureTest.isLittleEndian?4278190080:255,[L,N]=I?[M,D]:[D,M],U=E>>3,H=7&E,z=l.length;S=new Uint32Array(S.buffer);let W=0;for(let o=0;o<T;o++){for(let o=u+U;u<o;u++){let o=u<z?l[u]:255;S[W++]=128&o?N:L,S[W++]=64&o?N:L,S[W++]=32&o?N:L,S[W++]=16&o?N:L,S[W++]=8&o?N:L,S[W++]=4&o?N:L,S[W++]=2&o?N:L,S[W++]=1&o?N:L}if(0===H)continue;let o=u<z?l[u++]:255;for(let l=0;l<H;l++)S[W++]=o&1<<7-l?N:L}return{srcPos:u,destPos:W}}function T(o){let{src:l,srcPos:u=0,dest:S,destPos:E=0,width:T,height:M}=o,I=0,D=l.length>>2,L=new Uint32Array(l.buffer,u,D);if(A.FeatureTest.isLittleEndian){for(;I<D-2;I+=3,E+=4){let o=L[I],l=L[I+1],u=L[I+2];S[E]=4278190080|o,S[E+1]=o>>>24|l<<8|4278190080,S[E+2]=l>>>16|u<<16|4278190080,S[E+3]=u>>>8|4278190080}for(let o=4*I,u=l.length;o<u;o+=3)S[E++]=l[o]|l[o+1]<<8|l[o+2]<<16|4278190080}else{for(;I<D-2;I+=3,E+=4){let o=L[I],l=L[I+1],u=L[I+2];S[E]=255|o,S[E+1]=o<<24|l>>>8|255,S[E+2]=l<<16|u>>>16|255,S[E+3]=u<<8|255}for(let o=4*I,u=l.length;o<u;o+=3)S[E++]=l[o]<<24|l[o+1]<<16|l[o+2]<<8|255}return{srcPos:u,destPos:E}}function M(o,l){if(A.FeatureTest.isLittleEndian)for(let u=0,A=o.length;u<A;u++)l[u]=65793*o[u]|4278190080;else for(let u=0,A=o.length;u<A;u++)l[u]=16843008*o[u]|255}},(o,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.GlobalWorkerOptions=void 0;let u=Object.create(null);l.GlobalWorkerOptions=u,u.workerPort=null,u.workerSrc=""},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.MessageHandler=void 0;var A=u(1);let S={UNKNOWN:0,DATA:1,ERROR:2},E={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function T(o){switch(o instanceof Error||"object"==typeof o&&null!==o||(0,A.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),o.name){case"AbortException":return new A.AbortException(o.message);case"MissingPDFException":return new A.MissingPDFException(o.message);case"PasswordException":return new A.PasswordException(o.message,o.code);case"UnexpectedResponseException":return new A.UnexpectedResponseException(o.message,o.status);case"UnknownErrorException":return new A.UnknownErrorException(o.message,o.details);default:return new A.UnknownErrorException(o.message,o.toString())}}class M{constructor(o,l,u){this.sourceName=o,this.targetName=l,this.comObj=u,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=o=>{let l=o.data;if(l.targetName!==this.sourceName)return;if(l.stream){this.#tO(l);return}if(l.callback){let o=l.callbackId,u=this.callbackCapabilities[o];if(!u)throw Error(`Cannot resolve callback ${o}`);if(delete this.callbackCapabilities[o],l.callback===S.DATA)u.resolve(l.data);else if(l.callback===S.ERROR)u.reject(T(l.reason));else throw Error("Unexpected callback case");return}let A=this.actionHandler[l.action];if(!A)throw Error(`Unknown action from worker: ${l.action}`);if(l.callbackId){let o=this.sourceName,E=l.sourceName;new Promise(function(o){o(A(l.data))}).then(function(A){u.postMessage({sourceName:o,targetName:E,callback:S.DATA,callbackId:l.callbackId,data:A})},function(A){u.postMessage({sourceName:o,targetName:E,callback:S.ERROR,callbackId:l.callbackId,reason:T(A)})});return}if(l.streamId){this.#tI(l);return}A(l.data)},u.addEventListener("message",this._onComObjOnMessage)}on(o,l){let u=this.actionHandler;if(u[o])throw Error(`There is already an actionName called "${o}"`);u[o]=l}send(o,l,u){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:o,data:l},u)}
2sendWithPromise(o,l,u){let S=this.callbackId++,E=new A.PromiseCapability;this.callbackCapabilities[S]=E;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:o,callbackId:S,data:l},u)}catch(o){E.reject(o)}return E.promise}sendWithStream(o,l,u,S){let M=this.streamId++,I=this.sourceName,D=this.targetName,L=this.comObj;return new ReadableStream({start:u=>{let E=new A.PromiseCapability;return this.streamControllers[M]={controller:u,startCall:E,pullCall:null,cancelCall:null,isClosed:!1},L.postMessage({sourceName:I,targetName:D,action:o,streamId:M,data:l,desiredSize:u.desiredSize},S),E.promise},pull:o=>{let l=new A.PromiseCapability;return this.streamControllers[M].pullCall=l,L.postMessage({sourceName:I,targetName:D,stream:E.PULL,streamId:M,desiredSize:o.desiredSize}),l.promise},cancel:o=>{(0,A.assert)(o instanceof Error,"cancel must have a valid reason");let l=new A.PromiseCapability;return this.streamControllers[M].cancelCall=l,this.streamControllers[M].isClosed=!0,L.postMessage({sourceName:I,targetName:D,stream:E.CANCEL,streamId:M,reason:T(o)}),l.promise}},u)}#tI(o){let l=o.streamId,u=this.sourceName,S=o.sourceName,M=this.comObj,I=this,D=this.actionHandler[o.action],L={enqueue(o){let T=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,I=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;let D=this.desiredSize;this.desiredSize-=T,D>0&&this.desiredSize<=0&&(this.sinkCapability=new A.PromiseCapability,this.ready=this.sinkCapability.promise),M.postMessage({sourceName:u,targetName:S,stream:E.ENQUEUE,streamId:l,chunk:o},I)},close(){this.isCancelled||(this.isCancelled=!0,M.postMessage({sourceName:u,targetName:S,stream:E.CLOSE,streamId:l}),delete I.streamSinks[l])},error(o){(0,A.assert)(o instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,M.postMessage({sourceName:u,targetName:S,stream:E.ERROR,streamId:l,reason:T(o)}))},sinkCapability:new A.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:o.desiredSize,ready:null};L.sinkCapability.resolve(),L.ready=L.sinkCapability.promise,this.streamSinks[l]=L,new Promise(function(l){l(D(o.data,L))}).then(function(){M.postMessage({sourceName:u,targetName:S,stream:E.START_COMPLETE,streamId:l,success:!0})},function(o){M.postMessage({sourceName:u,targetName:S,stream:E.START_COMPLETE,streamId:l,reason:T(o)})})}#tO(o){let l=o.streamId,u=this.sourceName,S=o.sourceName,M=this.comObj,I=this.streamControllers[l],D=this.streamSinks[l];switch(o.stream){case E.START_COMPLETE:o.success?I.startCall.resolve():I.startCall.reject(T(o.reason));break;case E.PULL_COMPLETE:o.success?I.pullCall.resolve():I.pullCall.reject(T(o.reason));break;case E.PULL:if(!D){M.postMessage({sourceName:u,targetName:S,stream:E.PULL_COMPLETE,streamId:l,success:!0});break}D.desiredSize<=0&&o.desiredSize>0&&D.sinkCapability.resolve(),D.desiredSize=o.desiredSize,new Promise(function(o){o(D.onPull?.())}).then(function(){M.postMessage({sourceName:u,targetName:S,stream:E.PULL_COMPLETE,streamId:l,success:!0})},function(o){M.postMessage({sourceName:u,targetName:S,stream:E.PULL_COMPLETE,streamId:l,reason:T(o)})});break;case E.ENQUEUE:if((0,A.assert)(I,"enqueue should have stream controller"),I.isClosed)break;I.controller.enqueue(o.chunk);break;case E.CLOSE:if((0,A.assert)(I,"close should have stream controller"),I.isClosed)break;I.isClosed=!0,I.controller.close(),this.#tD(I,l);break;case E.ERROR:(0,A.assert)(I,"error should have stream controller"),I.controller.error(T(o.reason)),this.#tD(I,l);break;case E.CANCEL_COMPLETE:o.success?I.cancelCall.resolve():I.cancelCall.reject(T(o.reason)),this.#tD(I,l);break;case E.CANCEL:if(!D)break;new Promise(function(l){l(D.onCancel?.(T(o.reason)))}).then(function(){M.postMessage({sourceName:u,targetName:S,stream:E.CANCEL_COMPLETE,streamId:l,success:!0})},function(o){M.postMessage({sourceName:u,targetName:S,stream:E.CANCEL_COMPLETE,streamId:l,reason:T(o)})}),D.sinkCapability.reject(T(o.reason)),D.isCancelled=!0,delete this.streamSinks[l];break;default:throw Error("Unexpected stream case")}}async #tD(o,l){await Promise.allSettled([o.startCall?.promise,o.pullCall?.promise,o.cancelCall?.promise]),delete this.streamControllers[l]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}l.MessageHandler=M},(o,l,u)=>{"use strict";
2Object.defineProperty(l,"__esModule",{value:!0}),l.Metadata=void 0;var A=u(1);class S{#tL;#tN;constructor(o){let{parsedData:l,rawData:u}=o;this.#tL=l,this.#tN=u}getRaw(){return this.#tN}get(o){return this.#tL.get(o)??null}getAll(){return(0,A.objectFromMap)(this.#tL)}has(o){return this.#tL.has(o)}}l.Metadata=S},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.OptionalContentConfig=void 0;var A=u(1),S=u(137);let E=Symbol("INTERNAL");class T{#tj=!0;constructor(o,l){this.name=o,this.intent=l}get visible(){return this.#tj}_setVisible(o,l){o!==E&&(0,A.unreachable)("Internal method `_setVisible` called."),this.#tj=l}}class M{#tB=null;#tU=new Map;#tH=null;#tz=null;constructor(o){if(this.name=null,this.creator=null,null===o)return;for(let l of(this.name=o.name,this.creator=o.creator,this.#tz=o.order,o.groups))this.#tU.set(l.id,new T(l.name,l.intent));if("OFF"===o.baseState)for(let o of this.#tU.values())o._setVisible(E,!1);for(let l of o.on)this.#tU.get(l)._setVisible(E,!0);for(let l of o.off)this.#tU.get(l)._setVisible(E,!1);this.#tH=this.getHash()}#tG(o){let l=o.length;if(l<2)return!0;let u=o[0];for(let S=1;S<l;S++){let l;let E=o[S];if(Array.isArray(E))l=this.#tG(E);else{if(!this.#tU.has(E))return(0,A.warn)(`Optional content group not found: ${E}`),!0;l=this.#tU.get(E).visible}switch(u){case"And":if(!l)return!1;break;case"Or":if(l)return!0;break;case"Not":return!l;default:return!0}}return"And"===u}isVisible(o){if(0===this.#tU.size)return!0;if(!o)return(0,A.warn)("Optional content group not defined."),!0;if("OCG"===o.type)return this.#tU.has(o.id)?this.#tU.get(o.id).visible:((0,A.warn)(`Optional content group not found: ${o.id}`),!0);if("OCMD"===o.type){if(o.expression)return this.#tG(o.expression);if(o.policy&&"AnyOn"!==o.policy){if("AllOn"===o.policy){for(let l of o.ids){if(!this.#tU.has(l)){(0,A.warn)(`Optional content group not found: ${l}`);break}if(!this.#tU.get(l).visible)return!1}return!0}if("AnyOff"===o.policy){for(let l of o.ids){if(!this.#tU.has(l))return(0,A.warn)(`Optional content group not found: ${l}`),!0;if(!this.#tU.get(l).visible)return!0}return!1}if("AllOff"===o.policy){for(let l of o.ids){if(!this.#tU.has(l)){(0,A.warn)(`Optional content group not found: ${l}`);break}if(this.#tU.get(l).visible)return!1}return!0}}else{for(let l of o.ids){if(!this.#tU.has(l))return(0,A.warn)(`Optional content group not found: ${l}`),!0;if(this.#tU.get(l).visible)return!0}return!1}return(0,A.warn)(`Unknown optional content policy ${o.policy}.`),!0}return(0,A.warn)(`Unknown group type ${o.type}.`),!0}setVisibility(o){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!this.#tU.has(o)){(0,A.warn)(`Optional content group not found: ${o}`);return}this.#tU.get(o)._setVisible(E,!!l),this.#tB=null}get hasInitialVisibility(){return this.getHash()===this.#tH}getOrder(){return this.#tU.size?this.#tz?this.#tz.slice():[...this.#tU.keys()]:null}getGroups(){return this.#tU.size>0?(0,A.objectFromMap)(this.#tU):null}getGroup(o){return this.#tU.get(o)||null}getHash(){if(null!==this.#tB)return this.#tB;let o=new S.MurmurHash3_64;for(let[l,u]of this.#tU)o.update(`${l}:${u.visible}`);return this.#tB=o.hexdigest()}}l.OptionalContentConfig=M},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.PDFDataTransportStream=void 0;var A=u(1),S=u(135);class E{constructor(o,l){let{length:u,initialData:S,progressiveDone:E=!1,contentDispositionFilename:T=null,disableRange:M=!1,disableStream:I=!1}=o;if((0,A.assert)(l,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=E,this._contentDispositionFilename=T,S?.length>0){let o=S instanceof Uint8Array&&S.byteLength===S.buffer.byteLength?S.buffer:new Uint8Array(S).buffer;this._queuedChunks.push(o)}this._pdfDataRangeTransport=l,this._isStreamingSupported=!I,this._isRangeSupported=!M,this._contentLength=u,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((o,l)=>{this._onReceiveData({begin:o,chunk:l})}),this._pdfDataRangeTransport.addProgressListener((o,l)=>{this._onProgress({loaded:o,total:l})}),this._pdfDataRangeTransport.addProgressiveReadListener(o=>{this._onReceiveData({chunk:o})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(o){let{begin:l,chunk:u}=o,S=u instanceof Uint8Array&&u.byteLength===u.buffer.byteLength?u.buffer:new Uint8Array(u).buffer;if(void 0===l)this._fullRequestReader?this._fullRequestReader._enqueue(S):this._queuedChunks.push(S);else{let o=this._rangeReaders.some(function(o){return o._begin===l&&(o._enqueue(S),!0)});(0,A.assert)(o,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(o){void 0===o.total?this._rangeReaders[0]?.onProgress?.({loaded:o.loaded}):this._fullRequestReader?.onProgress?.({loaded:o.loaded,total:o.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(o){let l=this._rangeReaders.indexOf(o);l>=0&&this._rangeReaders.splice(l,1)}getFullReader(){(0,A.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let o=this._queuedChunks;return this._queuedChunks=null,new T(this,o,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(o,l){if(l<=this._progressiveDataLength)return null;let u=new M(this,o,l);return this._pdfDataRangeTransport.requestDataRange(o,l),this._rangeReaders.push(u),u}cancelAllRequests(o){for(let l of(this._fullRequestReader?.cancel(o),this._rangeReaders.slice(0)))l.cancel(o);this._pdfDataRangeTransport.abort()}}l.PDFDataTransportStream=E;class T{constructor(o,l){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;for(let E of(this._stream=o,this._done=u||!1,this._filename=(0,S.isPdfFile)(A)?A:null,this._queuedChunks=l||[],this._loaded=0,this._queuedChunks))this._loaded+=E.byteLength;
2this._requests=[],this._headersReady=Promise.resolve(),o._fullRequestReader=this,this.onProgress=null}_enqueue(o){if(!this._done){if(this._requests.length>0){let l=this._requests.shift();l.resolve({value:o,done:!1})}else this._queuedChunks.push(o);this._loaded+=o.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){let o=this._queuedChunks.shift();return{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};let o=new A.PromiseCapability;return this._requests.push(o),o.promise}cancel(o){for(let o of(this._done=!0,this._requests))o.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class M{constructor(o,l,u){this._stream=o,this._begin=l,this._end=u,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(o){if(!this._done){if(0===this._requests.length)this._queuedChunk=o;else{let l=this._requests.shift();for(let u of(l.resolve({value:o,done:!1}),this._requests))u.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};let o=new A.PromiseCapability;return this._requests.push(o),o.promise}cancel(o){for(let o of(this._done=!0,this._requests))o.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(o,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.XfaText=void 0;class u{static textContent(o){let l=[],A={items:l,styles:Object.create(null)};function S(o){if(!o)return;let A=null,E=o.name;if("#text"===E)A=o.value;else{if(!u.shouldBuildText(E))return;o?.attributes?.textContent?A=o.attributes.textContent:o.value&&(A=o.value)}if(null!==A&&l.push({str:A}),o.children)for(let l of o.children)S(l)}return S(o),A}static shouldBuildText(o){return!("textarea"===o||"input"===o||"option"===o||"select"===o)}}l.XfaText=u},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.NodeStandardFontDataFactory=l.NodeFilterFactory=l.NodeCanvasFactory=l.NodeCMapReaderFactory=void 0;var A=u(136);let S=function(o){return new Promise((l,u)=>{let A=__webpack_require__(32767);A.readFile(o,(o,A)=>{if(o||!A){u(Error(o));return}l(new Uint8Array(A))})})};class E extends A.BaseFilterFactory{}l.NodeFilterFactory=E;class T extends A.BaseCanvasFactory{_createCanvas(o,l){let u=__webpack_require__(14601);return u.createCanvas(o,l)}}l.NodeCanvasFactory=T;class M extends A.BaseCMapReaderFactory{_fetchData(o,l){return S(o).then(o=>({cMapData:o,compressionType:l}))}}l.NodeCMapReaderFactory=M;class I extends A.BaseStandardFontDataFactory{_fetchData(o){return S(o)}}l.NodeStandardFontDataFactory=I},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.PDFNodeStream=void 0;var A=u(1),S=u(150);let E=__webpack_require__(32767),T=__webpack_require__(28251),M=__webpack_require__(57677),I=__webpack_require__(11987),D=/^file:\/\/\/[a-zA-Z]:\//;function L(o){let l=I.parse(o);return"file:"===l.protocol||l.host?l:/^[a-z]:[/\\]/i.test(o)?I.parse(`file:///${o}`):(l.host||(l.protocol="file:"),l)}class N{constructor(o){this.source=o,this.url=L(o.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&o.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,A.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new K(this):new W(this),this._fullRequestReader}getRangeReader(o,l){if(l<=this._progressiveDataLength)return null;let u=this.isFsUrl?new Y(this,o,l):new X(this,o,l);return this._rangeRequestReaders.push(u),u}cancelAllRequests(o){for(let l of(this._fullRequestReader?.cancel(o),this._rangeRequestReaders.slice(0)))l.cancel(o)}}l.PDFNodeStream=N;class U{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null;let l=o.source;this._contentLength=l.length,this._loaded=0,this._filename=null,this._disableRange=l.disableRange||!1,this._rangeChunkSize=l.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!l.disableStream,this._isRangeSupported=!l.disableRange,this._readableStream=null,this._readCapability=new A.PromiseCapability,this._headersCapability=new A.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;let o=this._readableStream.read();if(null===o)return this._readCapability=new A.PromiseCapability,this.read();this._loaded+=o.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});let l=new Uint8Array(o).buffer;return{value:l,done:!1}}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",o=>{this._error(o)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new A.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class H{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new A.PromiseCapability;let l=o.source;this._isStreamingSupported=!l.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;let o=this._readableStream.read();if(null===o)return this._readCapability=new A.PromiseCapability,this.read();this._loaded+=o.length,this.onProgress?.({loaded:this._loaded});let l=new Uint8Array(o).buffer;return{value:l,done:!1}}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",o=>{this._error(o)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function z(o,l){return{protocol:o.protocol,auth:o.auth,host:o.hostname,port:o.port,path:o.path,method:"GET",headers:l}}class W extends U{constructor(o){super(o);let l=l=>{if(404===l.statusCode){let o=new A.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=o,this._headersCapability.reject(o);return}this._headersCapability.resolve(),this._setReadableStream(l);let u=o=>this._readableStream.headers[o.toLowerCase()],{allowRangeRequests:E,suggestedLength:T}=(0,S.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:o.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=E,this._contentLength=T||this._contentLength,this._filename=(0,S.extractFilenameFromHeader)(u)};this._request=null,"http:"===this._url.protocol?this._request=T.request(z(this._url,o.httpHeaders),l):this._request=M.request(z(this._url,o.httpHeaders),l),this._request.on("error",o=>{this._storedError=o,this._headersCapability.reject(o)}),this._request.end()}}class X extends H{constructor(o,l,u){for(let l in super(o),this._httpHeaders={},o.httpHeaders){let u=o.httpHeaders[l];void 0!==u&&(this._httpHeaders[l]=u)}this._httpHeaders.Range=`bytes=${l}-${u-1}`;let S=o=>
2{if(404===o.statusCode){let o=new A.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=o;return}this._setReadableStream(o)};this._request=null,"http:"===this._url.protocol?this._request=T.request(z(this._url,this._httpHeaders),S):this._request=M.request(z(this._url,this._httpHeaders),S),this._request.on("error",o=>{this._storedError=o}),this._request.end()}}class K extends U{constructor(o){super(o);let l=decodeURIComponent(this._url.path);D.test(this._url.href)&&(l=l.replace(/^\//,"")),E.lstat(l,(o,u)=>{if(o){"ENOENT"===o.code&&(o=new A.MissingPDFException(`Missing PDF "${l}".`)),this._storedError=o,this._headersCapability.reject(o);return}this._contentLength=u.size,this._setReadableStream(E.createReadStream(l)),this._headersCapability.resolve()})}}class Y extends H{constructor(o,l,u){super(o);let A=decodeURIComponent(this._url.path);D.test(this._url.href)&&(A=A.replace(/^\//,"")),this._setReadableStream(E.createReadStream(A,{start:l,end:u-1}))}}},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.createResponseStatusError=I,l.extractFilenameFromHeader=M,l.validateRangeRequestCapabilities=T,l.validateResponseStatus=D;var A=u(1),S=u(151),E=u(135);function T(o){let{getResponseHeader:l,isHttp:u,rangeChunkSize:A,disableRange:S}=o,E={allowRangeRequests:!1,suggestedLength:void 0},T=parseInt(l("Content-Length"),10);if(!Number.isInteger(T)||(E.suggestedLength=T,T<=2*A||S||!u||"bytes"!==l("Accept-Ranges")))return E;let M=l("Content-Encoding")||"identity";return"identity"!==M||(E.allowRangeRequests=!0),E}function M(o){let l=o("Content-Disposition");if(l){let o=(0,S.getFilenameFromContentDispositionHeader)(l);if(o.includes("%"))try{o=decodeURIComponent(o)}catch{}if((0,E.isPdfFile)(o))return o}return null}function I(o,l){return 404===o||0===o&&l.startsWith("file:")?new A.MissingPDFException('Missing PDF "'+l+'".'):new A.UnexpectedResponseException(`Unexpected server response (${o}) while retrieving PDF "${l}".`,o)}function D(o){return 200===o||206===o}},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.getFilenameFromContentDispositionHeader=S;var A=u(1);function S(o){let l=!0,u=S("filename\\*","i").exec(o);if(u){let o=I(u=u[1]);return T(o=L(o=D(o=unescape(o))))}if(u=M(o)){let o=L(u);return T(o)}if(u=S("filename","i").exec(o)){let o=I(u=u[1]);return T(o=L(o))}function S(o,l){return RegExp("(?:^|;)\\s*"+o+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',l)}function E(o,u){if(o){if(!/^[\x00-\xFF]+$/.test(u))return u;try{let S=new TextDecoder(o,{fatal:!0}),E=(0,A.stringToBytes)(u);u=S.decode(E),l=!1}catch{}}return u}function T(o){return l&&/[\x80-\xff]/.test(o)&&(o=E("utf-8",o),l&&(o=E("iso-8859-1",o))),o}function M(o){let l;let u=[],A=S("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(l=A.exec(o));){let[,o,A,S]=l;if((o=parseInt(o,10))in u){if(0===o)break;continue}u[o]=[A,S]}let E=[];for(let o=0;o<u.length&&(o in u);++o){let[l,A]=u[o];A=I(A),l&&(A=unescape(A),0===o&&(A=D(A))),E.push(A)}return E.join("")}function I(o){if(o.startsWith('"')){let l=o.slice(1).split('\\"');for(let o=0;o<l.length;++o){let u=l[o].indexOf('"');-1!==u&&(l[o]=l[o].slice(0,u),l.length=o+1),l[o]=l[o].replaceAll(/\\(.)/g,"$1")}o=l.join('"')}return o}function D(o){let l=o.indexOf("'");if(-1===l)return o;let u=o.slice(0,l),A=o.slice(l+1),S=A.replace(/^[^']*'/,"");return E(u,S)}function L(o){return!o.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(o)?o:o.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(o,l,u,A){if("q"===u||"Q"===u)return E(l,A=(A=A.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(o,l){return String.fromCharCode(parseInt(l,16))}));try{A=atob(A)}catch{}return E(l,A)})}return""}},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.PDFNetworkStream=void 0;var A=u(1),S=u(150);let E=200,T=206;function M(o){let l=o.response;return"string"!=typeof l?l:(0,A.stringToBytes)(l).buffer}class I{constructor(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=o,this.isHttp=/^https?:/i.test(o),this.httpHeaders=this.isHttp&&l.httpHeaders||Object.create(null),this.withCredentials=l.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(o,l,u){let A={begin:o,end:l};for(let o in u)A[o]=u[o];return this.request(A)}requestFull(o){return this.request(o)}request(o){let l=new XMLHttpRequest,u=this.currXhrId++,A=this.pendingRequests[u]={xhr:l};for(let o in l.open("GET",this.url),l.withCredentials=this.withCredentials,this.httpHeaders){let u=this.httpHeaders[o];void 0!==u&&l.setRequestHeader(o,u)}return this.isHttp&&"begin"in o&&"end"in o?(l.setRequestHeader("Range",`bytes=${o.begin}-${o.end-1}`),A.expectedStatus=T):A.expectedStatus=E,l.responseType="arraybuffer",o.onError&&(l.onerror=function(u){o.onError(l.status)}),l.onreadystatechange=this.onStateChange.bind(this,u),l.onprogress=this.onProgress.bind(this,u),A.onHeadersReceived=o.onHeadersReceived,A.onDone=o.onDone,A.onError=o.onError,A.onProgress=o.onProgress,l.send(null),u}onProgress(o,l){let u=this.pendingRequests[o];u&&u.onProgress?.(l)}onStateChange(o,l){let u=this.pendingRequests[o];if(!u)return;let A=u.xhr;if(A.readyState>=2&&u.onHeadersReceived&&(u.onHeadersReceived(),delete u.onHeadersReceived),4!==A.readyState||!(o in this.pendingRequests))return;if(delete this.pendingRequests[o],0===A.status&&this.isHttp){u.onError?.(A.status);return}let S=A.status||E,I=S===E&&u.expectedStatus===T;if(!I&&S!==u.expectedStatus){u.onError?.(A.status);return}let D=M(A);if(S===T){let o=A.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);u.onDone({begin:parseInt(l[1],10),chunk:D})}else D?u.onDone({begin:0,chunk:D}):u.onError?.(A.status)}getRequestXhr(o){return this.pendingRequests[o].xhr}isPendingRequest(o){return o in this.pendingRequests}
2abortRequest(o){let l=this.pendingRequests[o].xhr;delete this.pendingRequests[o],l.abort()}}class D{constructor(o){this._source=o,this._manager=new I(o.url,{httpHeaders:o.httpHeaders,withCredentials:o.withCredentials}),this._rangeChunkSize=o.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(o){let l=this._rangeRequestReaders.indexOf(o);l>=0&&this._rangeRequestReaders.splice(l,1)}getFullReader(){return(0,A.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new L(this._manager,this._source),this._fullRequestReader}getRangeReader(o,l){let u=new N(this._manager,o,l);return u.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(u),u}cancelAllRequests(o){for(let l of(this._fullRequestReader?.cancel(o),this._rangeRequestReaders.slice(0)))l.cancel(o)}}l.PDFNetworkStream=D;class L{constructor(o,l){this._manager=o;let u={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=l.url,this._fullRequestId=o.requestFull(u),this._headersReceivedCapability=new A.PromiseCapability,this._disableRange=l.disableRange||!1,this._contentLength=l.length,this._rangeChunkSize=l.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let o=this._fullRequestId,l=this._manager.getRequestXhr(o),u=o=>l.getResponseHeader(o),{allowRangeRequests:A,suggestedLength:E}=(0,S.validateRangeRequestCapabilities)({getResponseHeader:u,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});A&&(this._isRangeSupported=!0),this._contentLength=E||this._contentLength,this._filename=(0,S.extractFilenameFromHeader)(u),this._isRangeSupported&&this._manager.abortRequest(o),this._headersReceivedCapability.resolve()}_onDone(o){if(o){if(this._requests.length>0){let l=this._requests.shift();l.resolve({value:o.chunk,done:!1})}else this._cachedChunks.push(o.chunk)}if(this._done=!0,!(this._cachedChunks.length>0)){for(let o of this._requests)o.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(o){for(let l of(this._storedError=(0,S.createResponseStatusError)(o,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))l.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(o){this.onProgress?.({loaded:o.loaded,total:o.lengthComputable?o.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){let o=this._cachedChunks.shift();return{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};let o=new A.PromiseCapability;return this._requests.push(o),o.promise}cancel(o){for(let l of(this._done=!0,this._headersReceivedCapability.reject(o),this._requests))l.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class N{constructor(o,l,u){this._manager=o;let A={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=o.url,this._requestId=o.requestRange(l,u,A),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(o){let l=o.chunk;if(this._requests.length>0){let o=this._requests.shift();o.resolve({value:l,done:!1})}else this._queuedChunk=l;for(let o of(this._done=!0,this._requests))o.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(o){for(let l of(this._storedError=(0,S.createResponseStatusError)(o,this._url),this._requests))l.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(o){this.isStreamingSupported||this.onProgress?.({loaded:o.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let o=this._queuedChunk;return this._queuedChunk=null,{value:o,done:!1}}if(this._done)return{value:void 0,done:!0};let o=new A.PromiseCapability;return this._requests.push(o),o.promise}cancel(o){for(let o of(this._done=!0,this._requests))o.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
2(this._requestId),this._close()}}},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.PDFFetchStream=void 0;var A=u(1),S=u(150);function E(o,l,u){return{method:"GET",headers:o,signal:u.signal,mode:"cors",credentials:l?"include":"same-origin",redirect:"follow"}}function T(o){let l=new Headers;for(let u in o){let A=o[u];void 0!==A&&l.append(u,A)}return l}function M(o){return o instanceof Uint8Array?o.buffer:o instanceof ArrayBuffer?o:((0,A.warn)(`getArrayBuffer - unexpected data format: ${o}`),new Uint8Array(o).buffer)}class I{constructor(o){this.source=o,this.isHttp=/^https?:/i.test(o.url),this.httpHeaders=this.isHttp&&o.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,A.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new D(this),this._fullRequestReader}getRangeReader(o,l){if(l<=this._progressiveDataLength)return null;let u=new L(this,o,l);return this._rangeRequestReaders.push(u),u}cancelAllRequests(o){for(let l of(this._fullRequestReader?.cancel(o),this._rangeRequestReaders.slice(0)))l.cancel(o)}}l.PDFFetchStream=I;class D{constructor(o){this._stream=o,this._reader=null,this._loaded=0,this._filename=null;let l=o.source;this._withCredentials=l.withCredentials||!1,this._contentLength=l.length,this._headersCapability=new A.PromiseCapability,this._disableRange=l.disableRange||!1,this._rangeChunkSize=l.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!l.disableStream,this._isRangeSupported=!l.disableRange,this._headers=T(this._stream.httpHeaders);let u=l.url;fetch(u,E(this._headers,this._withCredentials,this._abortController)).then(o=>{if(!(0,S.validateResponseStatus)(o.status))throw(0,S.createResponseStatusError)(o.status,u);this._reader=o.body.getReader(),this._headersCapability.resolve();let l=l=>o.headers.get(l),{allowRangeRequests:E,suggestedLength:T}=(0,S.validateRangeRequestCapabilities)({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=E,this._contentLength=T||this._contentLength,this._filename=(0,S.extractFilenameFromHeader)(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new A.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:o,done:l}=await this._reader.read();return l?{value:o,done:l}:(this._loaded+=o.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:M(o),done:!1})}cancel(o){this._reader?.cancel(o),this._abortController.abort()}}class L{constructor(o,l,u){this._stream=o,this._reader=null,this._loaded=0;let M=o.source;this._withCredentials=M.withCredentials||!1,this._readCapability=new A.PromiseCapability,this._isStreamingSupported=!M.disableStream,this._abortController=new AbortController,this._headers=T(this._stream.httpHeaders),this._headers.append("Range",`bytes=${l}-${u-1}`);let I=M.url;fetch(I,E(this._headers,this._withCredentials,this._abortController)).then(o=>{if(!(0,S.validateResponseStatus)(o.status))throw(0,S.createResponseStatusError)(o.status,I);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:o,done:l}=await this._reader.read();return l?{value:o,done:l}:(this._loaded+=o.byteLength,this.onProgress?.({loaded:this._loaded}),{value:M(o),done:!1})}cancel(o){this._reader?.cancel(o),this._abortController.abort()}}},(o,l,u)=>{"use strict";
2Object.defineProperty(l,"__esModule",{value:!0}),l.TextLayerRenderTask=void 0,l.renderTextLayer=W,l.updateTextLayer=X;var A=u(1),S=u(135);let E=1e5,T=30,M=.8,I=new Map;function D(o,l){let u;if(l&&A.FeatureTest.isOffscreenCanvasSupported)u=new OffscreenCanvas(o,o).getContext("2d",{alpha:!1});else{let l=document.createElement("canvas");l.width=l.height=o,u=l.getContext("2d",{alpha:!1})}return u}function L(o,l){let u=I.get(o);if(u)return u;let A=D(T,l);A.font=`${T}px ${o}`;let S=A.measureText(""),E=S.fontBoundingBoxAscent,L=Math.abs(S.fontBoundingBoxDescent);if(E){let l=E/(E+L);return I.set(o,l),A.canvas.width=A.canvas.height=0,l}A.strokeStyle="red",A.clearRect(0,0,T,T),A.strokeText("g",0,0);let N=A.getImageData(0,0,T,T).data;L=0;for(let o=N.length-1-3;o>=0;o-=4)if(N[o]>0){L=Math.ceil(o/4/T);break}A.clearRect(0,0,T,T),A.strokeText("A",0,T),N=A.getImageData(0,0,T,T).data,E=0;for(let o=0,l=N.length;o<l;o+=4)if(N[o]>0){E=T-Math.floor(o/4/T);break}if(A.canvas.width=A.canvas.height=0,E){let l=E/(E+L);return I.set(o,l),l}return I.set(o,M),M}function N(o,l,u){let S,E;let T=document.createElement("span"),M={angle:0,canvasWidth:0,hasText:""!==l.str,hasEOL:l.hasEOL,fontSize:0};o._textDivs.push(T);let I=A.Util.transform(o._transform,l.transform),D=Math.atan2(I[1],I[0]),N=u[l.fontName];N.vertical&&(D+=Math.PI/2);let U=Math.hypot(I[2],I[3]),H=U*L(N.fontFamily,o._isOffscreenCanvasSupported);0===D?(S=I[4],E=I[5]-H):(S=I[4]+H*Math.sin(D),E=I[5]-H*Math.cos(D));let z="calc(var(--scale-factor)*",W=T.style;o._container===o._rootContainer?(W.left=`${(100*S/o._pageWidth).toFixed(2)}%`,W.top=`${(100*E/o._pageHeight).toFixed(2)}%`):(W.left=`${z}${S.toFixed(2)}px)`,W.top=`${z}${E.toFixed(2)}px)`),W.fontSize=`${z}${U.toFixed(2)}px)`,W.fontFamily=N.fontFamily,M.fontSize=U,T.setAttribute("role","presentation"),T.textContent=l.str,T.dir=l.dir,o._fontInspectorEnabled&&(T.dataset.fontName=l.fontName),0!==D&&(M.angle=D*(180/Math.PI));let X=!1;if(l.str.length>1)X=!0;else if(" "!==l.str&&l.transform[0]!==l.transform[3]){let o=Math.abs(l.transform[0]),u=Math.abs(l.transform[3]);o!==u&&Math.max(o,u)/Math.min(o,u)>1.5&&(X=!0)}X&&(M.canvasWidth=N.vertical?l.height:l.width),o._textDivProperties.set(T,M),o._isReadableStream&&o._layoutText(T)}function U(o){let{div:l,scale:u,properties:A,ctx:S,prevFontSize:E,prevFontFamily:T}=o,{style:M}=l,I="";if(0!==A.canvasWidth&&A.hasText){let{fontFamily:D}=M,{canvasWidth:L,fontSize:N}=A;(E!==N||T!==D)&&(S.font=`${N*u}px ${D}`,o.prevFontSize=N,o.prevFontFamily=D);let{width:U}=S.measureText(l.textContent);U>0&&(I=`scaleX(${L*u/U})`)}0!==A.angle&&(I=`rotate(${A.angle}deg) ${I}`),I.length>0&&(M.transform=I)}function H(o){if(o._canceled)return;let l=o._textDivs,u=o._capability,A=l.length;if(A>E){u.resolve();return}if(!o._isReadableStream)for(let u of l)o._layoutText(u);u.resolve()}class z{constructor(o){let{textContentSource:l,container:u,viewport:E,textDivs:T,textDivProperties:M,textContentItemsStr:I,isOffscreenCanvasSupported:L}=o;this._textContentSource=l,this._isReadableStream=l instanceof ReadableStream,this._container=this._rootContainer=u,this._textDivs=T||[],this._textContentItemsStr=I||[],this._isOffscreenCanvasSupported=L,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=M||new WeakMap,this._canceled=!1,this._capability=new A.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:E.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:D(0,L)};let{pageWidth:N,pageHeight:U,pageX:H,pageY:z}=E.rawDims;this._transform=[1,0,0,-1,-H,z+U],this._pageWidth=N,this._pageHeight=U,(0,S.setLayerDimensions)(u,E),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new A.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new A.AbortException("TextLayer task cancelled."))}_processItems(o,l){for(let u of o){if(void 0===u.str){if("beginMarkedContentProps"===u.type||"beginMarkedContent"===u.type){let o=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==u.id&&this._container.setAttribute("id",`${u.id}`),o.append(this._container)}else"endMarkedContent"===u.type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(u.str),N(this,u,l)}}_layoutText(o){let l=this._layoutTextParams.properties=this._textDivProperties.get(o);if(this._layoutTextParams.div=o,U(this._layoutTextParams),l.hasText&&this._container.append(o),l.hasEOL){let o=document.createElement("br");o.setAttribute("role","presentation"),this._container.append(o)}}_render(){let o=new A.PromiseCapability,l=Object.create(null);if(this._isReadableStream){let u=()=>{this._reader.read().then(A=>{let{value:S,done:E}=A;if(E){o.resolve();return}Object.assign(l,S.styles),this._processItems(S.items,l),u()},o.reject)};this._reader=this._textContentSource.getReader(),u()}else if(this._textContentSource){let{items:l,styles:u}=this._textContentSource;this._processItems(l,u),o.resolve()}else throw Error('No "textContentSource" parameter specified.');o.promise.then(()=>{l=null,H(this)},this._capability.reject)}}function W(o){!o.textContentSource&&(o.textContent||o.textContentStream)&&((0,S.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),o.textContentSource=o.textContent||o.textContentStream);let{container:l,viewport:u}=o,A=getComputedStyle(l),E=A.getPropertyValue("visibility"),T=parseFloat(A.getPropertyValue("--scale-factor"));"visible"===E&&(!T||Math.abs(T-u.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");let M=new z(o);return M._render(),M}function X(o){let{container:l,viewport:u,textDivs:A,textDivProperties:E,isOffscreenCanvasSupported:T,mustRotate:M=!0,mustRescale:I=!0}=o;if(M&&(0,S.setLayerDimensions)(l,{rotation:u.rotation}),I){let o=D(0,T),l=u.scale*(globalThis.devicePixelRatio||1),S={prevFontSize:null,prevFontFamily:null,div:null,scale:l,properties:null,ctx:o};for(let o of A)S.properties=E.get(o),S.div=o,U(S)}}l.TextLayerRenderTask=z},(o,l,u)=>{"use strict";
2Object.defineProperty(l,"__esModule",{value:!0}),l.AnnotationEditorLayer=void 0;var A=u(1),S=u(133),E=u(134),T=u(156),M=u(161),I=u(135);class D{#tW;#tq=!1;#tV=null;#t$=this.pointerup.bind(this);#tX=this.pointerdown.bind(this);#tK=new Map;#tY=!1;#tJ=!1;#tQ=!1;#tZ;static _initialized=!1;constructor(o){D._initialized||(D._initialized=!0,T.FreeTextEditor.initialize(o.l10n),M.InkEditor.initialize(o.l10n)),o.uiManager.registerEditorTypes([T.FreeTextEditor,M.InkEditor]),this.#tZ=o.uiManager,this.pageIndex=o.pageIndex,this.div=o.div,this.#tW=o.accessibilityManager,this.#tV=o.annotationLayer,this.viewport=o.viewport,this.#tZ.addLayer(this)}get isEmpty(){return 0===this.#tK.size}updateToolbar(o){this.#tZ.updateToolbar(o)}updateMode(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#tZ.getMode();this.#t0(),o===A.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#tZ.unselectAll(),o!==A.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",o===A.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",o===A.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(o){if(!o&&this.#tZ.getMode()!==A.AnnotationEditorType.INK)return;if(!o){for(let o of this.#tK.values())if(o.isEmpty()){o.setInBackground();return}}let l=this.#t1({offsetX:0,offsetY:0});l.setInBackground()}setEditingState(o){this.#tZ.setEditingState(o)}addCommands(o){this.#tZ.addCommands(o)}enable(){this.div.style.pointerEvents="auto";let o=new Set;for(let l of this.#tK.values())l.enableEditing(),l.annotationElementId&&o.add(l.annotationElementId);if(!this.#tV)return;let l=this.#tV.getEditableAnnotations();for(let u of l){if(u.hide(),this.#tZ.isDeletedAnnotationElement(u.data.id)||o.has(u.data.id))continue;let l=this.deserialize(u);l&&(this.addOrRebuild(l),l.enableEditing())}}disable(){this.#tQ=!0,this.div.style.pointerEvents="none";let o=new Set;for(let l of this.#tK.values()){if(l.disableEditing(),!l.annotationElementId||null!==l.serialize()){o.add(l.annotationElementId);continue}this.getEditableAnnotation(l.annotationElementId)?.show(),l.remove()}if(this.#tV){let l=this.#tV.getEditableAnnotations();for(let u of l){let{id:l}=u.data;o.has(l)||this.#tZ.isDeletedAnnotationElement(l)||u.show()}}this.#t0(),this.isEmpty&&(this.div.hidden=!0),this.#tQ=!1}getEditableAnnotation(o){return this.#tV?.getEditableAnnotation(o)||null}setActiveEditor(o){let l=this.#tZ.getActive();l!==o&&this.#tZ.setActiveEditor(o)}enableClick(){this.div.addEventListener("pointerdown",this.#tX),this.div.addEventListener("pointerup",this.#t$)}disableClick(){this.div.removeEventListener("pointerdown",this.#tX),this.div.removeEventListener("pointerup",this.#t$)}attach(o){this.#tK.set(o.id,o);let{annotationElementId:l}=o;l&&this.#tZ.isDeletedAnnotationElement(l)&&this.#tZ.removeDeletedAnnotationElement(o)}detach(o){this.#tK.delete(o.id),this.#tW?.removePointerInTextLayer(o.contentDiv),!this.#tQ&&o.annotationElementId&&this.#tZ.addDeletedAnnotationElement(o)}remove(o){this.detach(o),this.#tZ.removeEditor(o),o.div.style.display="none",setTimeout(()=>{o.div.style.display="",o.div.remove(),o.isAttachedToDOM=!1,document.activeElement===document.body&&this.#tZ.focusMainContainer()},0),this.#tJ||this.addInkEditorIfNeeded(!1)}#t2(o){o.parent!==this&&(o.annotationElementId&&(this.#tZ.addDeletedAnnotationElement(o.annotationElementId),S.AnnotationEditor.deleteAnnotationElement(o),o.annotationElementId=null),this.attach(o),o.parent?.detach(o),o.setParent(this),o.div&&o.isAttachedToDOM&&(o.div.remove(),this.div.append(o.div)))}add(o){if(this.#t2(o),this.#tZ.addEditor(o),this.attach(o),!o.isAttachedToDOM){let l=o.render();this.div.append(l),o.isAttachedToDOM=!0}this.moveEditorInDOM(o),o.onceAdded(),this.#tZ.addToAnnotationStorage(o)}moveEditorInDOM(o){this.#tW?.moveElementInDOM(this.div,o.div,o.contentDiv,!0)}addOrRebuild(o){o.needsToBeRebuilt()?o.rebuild():this.add(o)}getNextId(){return this.#tZ.getId()}#t3(o){switch(this.#tZ.getMode()){case A.AnnotationEditorType.FREETEXT:return new T.FreeTextEditor(o);case A.AnnotationEditorType.INK:return new M.InkEditor(o)}return null}deserialize(o){switch(o.annotationType??o.annotationEditorType){case A.AnnotationEditorType.FREETEXT:return T.FreeTextEditor.deserialize(o,this,this.#tZ);case A.AnnotationEditorType.INK:return M.InkEditor.deserialize(o,this,this.#tZ)}return null}#t1(o){let l=this.getNextId(),u=this.#t3({parent:this,id:l,x:o.offsetX,y:o.offsetY,uiManager:this.#tZ});return u&&this.add(u),u}setSelected(o){this.#tZ.setSelected(o)}toggleSelected(o){this.#tZ.toggleSelected(o)}isSelected(o){return this.#tZ.isSelected(o)}unselect(o){this.#tZ.unselect(o)}pointerup(o){let{isMac:l}=A.FeatureTest.platform;if(0===o.button&&(!o.ctrlKey||!l)&&o.target===this.div&&this.#tY){if(this.#tY=!1,!this.#tq){this.#tq=!0;return}this.#t1(o)}}pointerdown(o){let{isMac:l}=A.FeatureTest.platform;if(0!==o.button||o.ctrlKey&&l||o.target!==this.div)return;this.#tY=!0;let u=this.#tZ.getActive();this.#tq=!u||u.isEmpty()}drop(o){let l=o.dataTransfer.getData("text/plain"),u=this.#tZ.getEditor(l);
2if(!u)return;o.preventDefault(),o.dataTransfer.dropEffect="move",this.#t2(u);let A=this.div.getBoundingClientRect(),S=o.clientX-A.x,E=o.clientY-A.y;u.translate(S-u.startX,E-u.startY),this.moveEditorInDOM(u),u.div.focus()}dragover(o){o.preventDefault()}destroy(){for(let o of(this.#tZ.getActive()?.parent===this&&this.#tZ.setActiveEditor(null),this.#tK.values()))this.#tW?.removePointerInTextLayer(o.contentDiv),o.setParent(null),o.isAttachedToDOM=!1,o.div.remove();this.div=null,this.#tK.clear(),this.#tZ.removeLayer(this)}#t0(){for(let o of(this.#tJ=!0,this.#tK.values()))o.isEmpty()&&o.remove();this.#tJ=!1}render(o){let{viewport:l}=o;for(let o of(this.viewport=l,(0,I.setLayerDimensions)(this.div,l),(0,E.bindEvents)(this,this.div,["dragover","drop"]),this.#tZ.getEditors(this.pageIndex)))this.add(o);this.updateMode()}update(o){let{viewport:l}=o;this.#tZ.commitOrRemove(),this.viewport=l,(0,I.setLayerDimensions)(this.div,{rotation:l.rotation}),this.updateMode()}get pageDimensions(){let{pageWidth:o,pageHeight:l}=this.viewport.rawDims;return[o,l]}}l.AnnotationEditorLayer=D},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.FreeTextEditor=void 0;var A=u(1),S=u(134),E=u(133),T=u(157);class M extends E.AnnotationEditor{#t5=this.editorDivBlur.bind(this);#t4=this.editorDivFocus.bind(this);#t8=this.editorDivInput.bind(this);#t6=this.editorDivKeydown.bind(this);#t7;#t9="";#et=`${this.id}-editor`;#ee;#ei=null;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){return(0,A.shadow)(this,"_keyboardManager",new S.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],M.prototype.commitOrRemove,!0],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],M.prototype.commitOrRemove]]))}static _type="freetext";constructor(o){super({...o,name:"freeTextEditor"}),this.#t7=o.color||M._defaultColor||E.AnnotationEditor._defaultLineColor,this.#ee=o.fontSize||M._defaultFontSize}static initialize(o){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(l=>[l,o.get(l)]));let l=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(l.getPropertyValue("--freetext-padding"))}static updateDefaultParams(o,l){switch(o){case A.AnnotationEditorParamsType.FREETEXT_SIZE:M._defaultFontSize=l;break;case A.AnnotationEditorParamsType.FREETEXT_COLOR:M._defaultColor=l}}updateParams(o,l){switch(o){case A.AnnotationEditorParamsType.FREETEXT_SIZE:this.#er(l);break;case A.AnnotationEditorParamsType.FREETEXT_COLOR:this.#es(l)}}static get defaultPropertiesToUpdate(){return[[A.AnnotationEditorParamsType.FREETEXT_SIZE,M._defaultFontSize],[A.AnnotationEditorParamsType.FREETEXT_COLOR,M._defaultColor||E.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[A.AnnotationEditorParamsType.FREETEXT_SIZE,this.#ee],[A.AnnotationEditorParamsType.FREETEXT_COLOR,this.#t7]]}#er(o){let l=o=>{this.editorDiv.style.fontSize=`calc(${o}px * var(--scale-factor))`,this.translate(0,-(o-this.#ee)*this.parentScale),this.#ee=o,this.#en()},u=this.#ee;this.addCommands({cmd:()=>{l(o)},undo:()=>
2{l(u)},mustExec:!0,type:A.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#es(o){let l=this.#t7;this.addCommands({cmd:()=>{this.#t7=this.editorDiv.style.color=o},undo:()=>{this.#t7=this.editorDiv.style.color=l},mustExec:!0,type:A.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){let o=this.parentScale;return[-M._internalPadding*o,-(M._internalPadding+this.#ee)*o]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(A.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#t6),this.editorDiv.addEventListener("focus",this.#t4),this.editorDiv.addEventListener("blur",this.#t5),this.editorDiv.addEventListener("input",this.#t8))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#et),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#t6),this.editorDiv.removeEventListener("focus",this.#t4),this.editorDiv.removeEventListener("blur",this.#t5),this.editorDiv.removeEventListener("input",this.#t8),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(o){super.focusin(o),o.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(this.width){this.#ea();return}this.enableEditMode(),this.editorDiv.focus()}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}#eo(){let o=this.editorDiv.getElementsByTagName("div");if(0===o.length)return this.editorDiv.innerText;let l=[];for(let u of o)l.push(u.innerText.replace(/\r\n?|\n/,""));return l.join("\n")}#en(){let o;let[l,u]=this.parentDimensions;if(this.isAttachedToDOM)o=this.div.getBoundingClientRect();else{let{currentLayer:l,div:u}=this,A=u.style.display;u.style.display="hidden",l.div.append(this.div),o=u.getBoundingClientRect(),u.remove(),u.style.display=A}this.width=o.width/l,this.height=o.height/u}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let o=this.#t9,l=this.#t9=this.#eo().trimEnd();if(o===l)return;let u=o=>{if(this.#t9=o,!o){this.remove();return}this.#el(),this.rebuild(),this.#en()};this.addCommands({cmd:()=>{u(l)},undo:()=>{u(o)},mustExec:!1}),this.#en()}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(o){this.enableEditMode(),this.editorDiv.focus()}keydown(o){o.target===this.div&&"Enter"===o.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(o){M._keyboardManager.exec(this,o)}editorDivFocus(o){this.isEditing=!0}editorDivBlur(o){this.isEditing=!1}editorDivInput(o){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){let o,l;if(this.div)return this.div;this.width&&(o=this.x,l=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#et),this.enableEditing(),M._l10nPromise.get("editor_free_text2_aria_label").then(o=>this.editorDiv?.setAttribute("aria-label",o)),M._l10nPromise.get("free_text2_default_content").then(o=>this.editorDiv?.setAttribute("default-content",o)),this.editorDiv.contentEditable=!0;let{style:u}=this.editorDiv;if(u.fontSize=`calc(${this.#ee}px * var(--scale-factor))`,u.color=this.#t7,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,S.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[u,A]=this.parentDimensions;
2if(this.annotationElementId){let[S]=this.getInitialTranslation();this.setAt(o*u,l*A,S,S)}else this.setAt(o*u,l*A,this.width*u,this.height*A);this.#el(),this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}#el(){if(this.editorDiv.replaceChildren(),this.#t9)for(let o of this.#t9.split("\n")){let l=document.createElement("div");l.append(o?document.createTextNode(o):document.createElement("br")),this.editorDiv.append(l)}}get contentDiv(){return this.editorDiv}static deserialize(o,l,u){let S=null;if(o instanceof T.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:l,fontColor:u},rect:E,rotation:T,id:M},textContent:I,parent:{page:{pageNumber:D}}}=o;if(!I||0===I.length)return null;S=o={annotationType:A.AnnotationEditorType.FREETEXT,color:Array.from(u),fontSize:l,value:I.join("\n"),pageIndex:D-1,rect:E,rotation:T,id:M,deleted:!1}}let E=super.deserialize(o,l,u);return E.#ee=o.fontSize,E.#t7=A.Util.makeHexColor(...o.color),E.#t9=o.value,E.annotationElementId=o.id||null,E.#ei=S,E}serialize(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};let l=M._internalPadding*this.parentScale,u=this.getRect(l,l),S=E.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#t7),T={annotationType:A.AnnotationEditorType.FREETEXT,color:S,fontSize:this.#ee,value:this.#t9,pageIndex:this.pageIndex,rect:u,rotation:this.rotation};return o?T:this.annotationElementId&&!this.#eh(T)?null:(T.id=this.annotationElementId,T)}#eh(o){let{value:l,fontSize:u,color:A,rect:S,pageIndex:E}=this.#ei;return o.value!==l||o.fontSize!==u||o.rect.some((o,l)=>Math.abs(o-S[l])>=1)||o.color.some((o,l)=>o!==A[l])||o.pageIndex!==E}#ea(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(this.#en(),!o&&(0===this.width||0===this.height)){setTimeout(()=>this.#ea(!0),0);return}let l=M._internalPadding*this.parentScale;this.#ei.rect=this.getRect(l,l)}}l.FreeTextEditor=M},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.InkAnnotationElement=l.FreeTextAnnotationElement=l.AnnotationLayer=void 0;var A=u(1),S=u(135),E=u(132),T=u(158),M=u(159);let I=1e3,D=9,L=new WeakSet;function N(o){return{width:o[2]-o[0],height:o[3]-o[1]}}class U{static create(o){let l=o.data.annotationType;switch(l){case A.AnnotationType.LINK:return new z(o);case A.AnnotationType.TEXT:return new W(o);case A.AnnotationType.WIDGET:let u=o.data.fieldType;switch(u){case"Tx":return new K(o);case"Btn":if(o.data.radioButton)return new Q(o);if(o.data.checkBox)return new J(o);return new Z(o);case"Ch":return new tt(o);case"Sig":return new Y(o)}return new X(o);case A.AnnotationType.POPUP:return new te(o);case A.AnnotationType.FREETEXT:return new tr(o);case A.AnnotationType.LINE:return new ts(o);case A.AnnotationType.SQUARE:return new tn(o);case A.AnnotationType.CIRCLE:return new ta(o);case A.AnnotationType.POLYLINE:return new to(o);case A.AnnotationType.CARET:return new th(o);case A.AnnotationType.INK:return new td(o);case A.AnnotationType.POLYGON:return new tl(o);case A.AnnotationType.HIGHLIGHT:return new tc(o);case A.AnnotationType.UNDERLINE:return new tu(o);case A.AnnotationType.SQUIGGLY:return new tp(o);case A.AnnotationType.STRIKEOUT:return new tf(o);case A.AnnotationType.STAMP:return new tg(o);case A.AnnotationType.FILEATTACHMENT:return new tm(o);default:return new H(o)}}}class H{constructor(o){let{isRenderable:l=!1,ignoreBorder:u=!1,createQuadrilaterals:A=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=l,this.data=o.data,this.layer=o.layer,this.linkService=o.linkService,this.downloadManager=o.downloadManager,this.imageResourcesPath=o.imageResourcesPath,this.renderForms=o.renderForms,this.svgFactory=o.svgFactory,this.annotationStorage=o.annotationStorage,this.enableScripting=o.enableScripting,this.hasJSActions=o.hasJSActions,this._fieldObjects=o.fieldObjects,this.parent=o.parent,l&&(this.container=this._createContainer(u)),A&&(this.quadrilaterals=this._createQuadrilaterals(u))}_createContainer(o){let{data:l,parent:{page:u,viewport:S}}=this,E=document.createElement("section");E.setAttribute("data-annotation-id",l.id),E.style.zIndex=this.parent.zIndex++,this.data.popupRef&&E.setAttribute("aria-haspopup","dialog"),l.noRotate&&E.classList.add("norotate");let{pageWidth:T,pageHeight:M,pageX:I,pageY:D}=S.rawDims;if(!l.rect||this instanceof te){let{rotation:o}=l;return l.hasOwnCanvas||0===o||this.setRotation(o,E),E}let{width:L,height:U}=N(l.rect),H=A.Util.normalizeRect([l.rect[0],u.view[3]-l.rect[1]+u.view[
21],l.rect[2],u.view[3]-l.rect[3]+u.view[1]]);if(!o&&l.borderStyle.width>0){E.style.borderWidth=`${l.borderStyle.width}px`;let o=l.borderStyle.horizontalCornerRadius,u=l.borderStyle.verticalCornerRadius;if(o>0||u>0){let l=`calc(${o}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;E.style.borderRadius=l}else if(this instanceof Q){let o=`calc(${L}px * var(--scale-factor)) / calc(${U}px * var(--scale-factor))`;E.style.borderRadius=o}switch(l.borderStyle.style){case A.AnnotationBorderStyleType.SOLID:E.style.borderStyle="solid";break;case A.AnnotationBorderStyleType.DASHED:E.style.borderStyle="dashed";break;case A.AnnotationBorderStyleType.BEVELED:(0,A.warn)("Unimplemented border style: beveled");break;case A.AnnotationBorderStyleType.INSET:(0,A.warn)("Unimplemented border style: inset");break;case A.AnnotationBorderStyleType.UNDERLINE:E.style.borderBottomStyle="solid"}let S=l.borderColor||null;S?E.style.borderColor=A.Util.makeHexColor(0|S[0],0|S[1],0|S[2]):E.style.borderWidth=0}E.style.left=`${100*(H[0]-I)/T}%`,E.style.top=`${100*(H[1]-D)/M}%`;let{rotation:z}=l;return l.hasOwnCanvas||0===z?(E.style.width=`${100*L/T}%`,E.style.height=`${100*U/M}%`):this.setRotation(z,E),E}setRotation(o){let l,u,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container,{pageWidth:S,pageHeight:E}=this.parent.viewport.rawDims,{width:T,height:M}=N(this.data.rect);o%180==0?(l=100*T/S,u=100*M/E):(l=100*M/S,u=100*T/E),A.style.width=`${l}%`,A.style.height=`${u}%`,A.setAttribute("data-main-rotation",(360-o)%360)}get _commonActions(){let o=(o,l,u)=>{let A=u.detail[o];u.target.style[l]=T.ColorConverters[`${A[0]}_HTML`](A.slice(1))};return(0,A.shadow)(this,"_commonActions",{display:o=>{let l=o.detail.display%2==1;this.container.style.visibility=l?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:l,print:0===o.detail.display||3===o.detail.display})},print:o=>{this.annotationStorage.setValue(this.data.id,{print:o.detail.print})},hidden:o=>{this.container.style.visibility=o.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:o.detail.hidden})},focus:o=>{setTimeout(()=>o.target.focus({preventScroll:!1}),0)},userName:o=>{o.target.title=o.detail.userName},readonly:o=>{o.detail.readonly?o.target.setAttribute("readonly",""):o.target.removeAttribute("readonly")},required:o=>{this._setRequired(o.target,o.detail.required)},bgColor:l=>{o("bgColor","backgroundColor",l)},fillColor:l=>{o("fillColor","backgroundColor",l)},fgColor:l=>{o("fgColor","color",l)},textColor:l=>{o("textColor","color",l)},borderColor:l=>{o("borderColor","borderColor",l)},strokeColor:l=>{o("strokeColor","borderColor",l)},rotation:o=>{let l=o.detail.rotation;this.setRotation(l),this.annotationStorage.setValue(this.data.id,{rotation:l})}})}_dispatchEventFromSandbox(o,l){let u=this._commonActions;for(let A of Object.keys(l.detail)){let S=o[A]||u[A];S?.(l)}}_setDefaultPropertiesFromJS(o){if(!this.enableScripting)return;let l=this.annotationStorage.getRawValue(this.data.id);if(!l)return;let u=this._commonActions;for(let[A,S]of Object.entries(l)){let E=u[A];
2if(E){let u={detail:{[A]:S},target:o};E(u),delete l[A]}}}_createQuadrilaterals(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;let l=[],u=this.data.rect,A=null;for(let u of this.data.quadPoints)this.data.rect=[u[2].x,u[2].y,u[1].x,u[1].y],l.push(this._createContainer(o)),A||=this.data.rect;return this.data.rect=u,this.firstQuadRect=A,l}_createPopup(){let{container:o,data:l}=this;o.setAttribute("aria-haspopup","dialog");let u=new te({data:{color:l.color,titleObj:l.titleObj,modificationDate:l.modificationDate,contentsObj:l.contentsObj,richText:l.richText,parentRect:this.firstQuadRect||l.rect,borderStyle:0,id:`popup_${l.id}`,rotation:l.rotation},parent:this.parent,elements:[this]});this.parent.div.append(u.render())}_renderQuadrilaterals(o){for(let l of this.quadrilaterals)l.classList.add(o);return this.quadrilaterals}render(){(0,A.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=[];if(this._fieldObjects){let S=this._fieldObjects[o];if(S)for(let{page:o,id:E,exportValues:T}of S){if(-1===o||E===l)continue;let S="string"==typeof T?T:null,M=document.querySelector(`[data-element-id="${E}"]`);if(M&&!L.has(M)){(0,A.warn)(`_getElementsByName - element not allowed: ${E}`);continue}u.push({id:E,exportValue:S,domElement:M})}return u}for(let A of document.getElementsByName(o)){let{exportValue:o}=A,S=A.getAttribute("data-element-id");S!==l&&L.has(A)&&u.push({id:S,exportValue:o,domElement:A})}return u}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.quadrilaterals||this.container}addHighlightArea(){let o=this.getElementsToTriggerPopup();if(Array.isArray(o))for(let l of o)l.classList.add("highlightArea");else o.classList.add("highlightArea")}}class z extends H{constructor(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(o,{isRenderable:!0,ignoreBorder:!!l?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=o.data.isTooltipOnly}render(){let{data:o,linkService:l}=this,u=document.createElement("a");u.setAttribute("data-element-id",o.id);let A=!1;return(o.url?(l.addLinkAttributes(u,o.url,o.newWindow),A=!0):o.action?(this._bindNamedAction(u,o.action),A=!0):o.attachment?(this._bindAttachment(u,o.attachment),A=!0):o.setOCGState?(this.#ed(u,o.setOCGState),A=!0):o.dest?(this._bindLink(u,o.dest),A=!0):(o.actions&&(o.actions.Action||o.actions["Mouse Up"]||o.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(u,o),A=!0),o.resetForm?(this._bindResetFormAction(u,o.resetForm),A=!0):this.isTooltipOnly&&!A&&(this._bindLink(u,""),A=!0)),this.quadrilaterals)?this._renderQuadrilaterals("linkAnnotation").map((o,l)=>{let A=0===l?u:u.cloneNode();return o.append(A),o}):(this.container.classList.add("linkAnnotation"),A&&this.container.append(u),this.container)}#ec(){this.container.setAttribute("data-internal-link","")}_bindLink(o,l){o.href=this.linkService.getDestinationHash(l),o.onclick=()=>(l&&this.linkService.goToDestination(l),!1),(l||""===l)&&this.#ec()}_bindNamedAction(o,l){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>(this.linkService.executeNamedAction(l),!1),this.#ec()}_bindAttachment(o,l){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,l.content,l.filename),!1),this.#ec()}#ed(o,l){o.href=this.linkService.getAnchorUrl(""),o.onclick=()=>(this.linkService.executeSetOCGState(l),!1),this.#ec()}_bindJSAction(o,l){o.href=this.linkService.getAnchorUrl("");let u=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let A of Object.keys(l.actions)){let S=u.get(A);S&&(o[S]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l.id,name:A}}),!1))}o.onclick||(o.onclick=()=>!1),this.#ec()}_bindResetFormAction(o,l){let u=o.onclick;if(u||(o.href=this.linkService.getAnchorUrl("")),this.#ec(),!this._fieldObjects){(0,A.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),u||(o.onclick=()=>!1);return}o.onclick=()=>{u?.();let{fields:o,refs:S,include:E}=l,T=[];if(0!==o.length||0!==S.length){let l=new Set(S);for(let u of o){let o=this._fieldObjects[u]||[];for(let{id:u}of o)l.add(u)}for(let o of Object.values(this._fieldObjects))for(let u of o)l.has(u.id)===E&&T.push(u)}else for(let o of Object.values(this._fieldObjects))T.push(...o);let M=this.annotationStorage,I=[];for(let o of T){let{id:l}=o;switch(I.push(l),o.type){case"text":{let u=o.defaultValue||"";M.setValue(l,{value:u});break}case"checkbox":case"radiobutton":{let u=o.defaultValue===o.exportValues;M.setValue(l,{value:u});break}case"combobox":case"listbox":{let u=o.defaultValue||"";M.setValue(l,{value:u});break}default:continue}let u=document.querySelector(`[data-element-id="${l}"]`);if(u){if(!L.has(u)){(0,A.warn)(`_bindResetFormAction - element not allowed: ${l}`);continue}u.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:I,name:"ResetForm"}}),!1}}}class W extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l})}render(){this.container.classList.add("textAnnotation");let o=document.createElement("img");return o.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",o.alt="[{{type}} Annotation]",o.dataset.l10nId="text_annotation_type",o.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.popupRef||this._createPopup(),this.container.append(o),this.container}}
2class X extends H{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(o){this.data.hasOwnCanvas&&(o.previousSibling?.nodeName==="CANVAS"&&(o.previousSibling.hidden=!0),o.hidden=!1)}_getKeyModifier(o){let{isWin:l,isMac:u}=A.FeatureTest.platform;return l&&o.ctrlKey||u&&o.metaKey}_setEventListener(o,l,u,A){l.includes("mouse")?o.addEventListener(l,o=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:u,value:A(o),shift:o.shiftKey,modifier:this._getKeyModifier(o)}})}):o.addEventListener(l,o=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:u,value:A(o)}})})}_setEventListeners(o,l,u){for(let[A,S]of l)("Action"===S||this.data.actions?.[S])&&this._setEventListener(o,A,S,u)}_setBackgroundColor(o){let l=this.data.backgroundColor||null;o.style.backgroundColor=null===l?"transparent":A.Util.makeHexColor(l[0],l[1],l[2])}_setTextStyle(o){let l;let u=["left","center","right"],{fontColor:S}=this.data.defaultAppearanceData,E=this.data.defaultAppearanceData.fontSize||D,T=o.style,M=2,I=o=>
2Math.round(10*o)/10;if(this.data.multiLine){let o=Math.abs(this.data.rect[3]-this.data.rect[1]-M),u=Math.round(o/(A.LINE_FACTOR*E))||1,S=o/u;l=Math.min(E,I(S/A.LINE_FACTOR))}else{let o=Math.abs(this.data.rect[3]-this.data.rect[1]-M);l=Math.min(E,I(o/A.LINE_FACTOR))}T.fontSize=`calc(${l}px * var(--scale-factor))`,T.color=A.Util.makeHexColor(S[0],S[1],S[2]),null!==this.data.textAlignment&&(T.textAlign=u[this.data.textAlignment])}_setRequired(o,l){l?o.setAttribute("required",!0):o.removeAttribute("required"),o.setAttribute("aria-required",l)}}class K extends X{constructor(o){let l=o.renderForms||!o.data.hasAppearance&&!!o.data.fieldValue;super(o,{isRenderable:l})}setPropertyOnSiblings(o,l,u,A){let S=this.annotationStorage;for(let E of this._getElementsByName(o.name,o.id))E.domElement&&(E.domElement[l]=u),S.setValue(E.id,{[A]:u})}render(){let o=this.annotationStorage,l=this.data.id;this.container.classList.add("textWidgetAnnotation");let u=null;if(this.renderForms){let A=o.getValue(l,{value:this.data.fieldValue}),S=A.value||"",E=o.getValue(l,{charLimit:this.data.maxLen}).charLimit;E&&S.length>E&&(S=S.slice(0,E));let T=A.formattedValue||this.data.textContent?.join("\n")||null;T&&this.data.comb&&(T=T.replaceAll(/\s+/g,""));
2let M={userValue:S,formattedValue:T,lastCommittedValue:null,commitKey:1};this.data.multiLine?((u=document.createElement("textarea")).textContent=T??S,this.data.doNotScroll&&(u.style.overflowY="hidden")):((u=document.createElement("input")).type="text",u.setAttribute("value",T??S),this.data.doNotScroll&&(u.style.overflowX="hidden")),this.data.hasOwnCanvas&&(u.hidden=!0),L.add(u),u.setAttribute("data-element-id",l),u.disabled=this.data.readOnly,u.name=this.data.baseFieldName||this.data.fieldName,u.tabIndex=I,this._setRequired(u,this.data.required),E&&(u.maxLength=E),u.addEventListener("input",A=>{o.setValue(l,{value:A.target.value}),this.setPropertyOnSiblings(u,"value",A.target.value,"value"),M.formattedValue=null}),u.addEventListener("resetform",o=>{let l=this.data.defaultFieldValue??"";u.value=M.userValue=l,M.formattedValue=null});let D=o=>{let{formattedValue:l}=M;null!=l&&(o.target.value=l),o.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){u.addEventListener("focus",o=>{let{target:l}=o;M.userValue&&(l.value=M.userValue),M.lastCommittedValue=l.value,M.commitKey=1}),u.addEventListener("updatefromsandbox",u=>{this.showElementAndHideCanvas(u.target);let A={value(u){M.userValue=u.detail.value??"",o.setValue(l,{value:M.userValue.toString()}),u.target.value=M.userValue},formattedValue(u){let{formattedValue:A}=u.detail;M.formattedValue=A,null!=A&&u.target!==document.activeElement&&(u.target.value=A),o.setValue(l,{formattedValue:A})},selRange(o){o.target.setSelectionRange(...o.detail.selRange)},charLimit:u=>{let{charLimit:A}=u.detail,{target:S}=u;if(0===A){S.removeAttribute("maxLength");return}S.setAttribute("maxLength",A);let E=M.userValue;E&&!(E.length<=A)&&(E=E.slice(0,A),S.value=M.userValue=E,o.setValue(l,{value:E}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:S.selectionStart,selEnd:S.selectionEnd}}))}};this._dispatchEventFromSandbox(A,u)}),u.addEventListener("keydown",o=>{M.commitKey=1;let u=-1;if("Escape"===o.key?u=0:"Enter"!==o.key||this.data.multiLine?"Tab"===o.key&&(M.commitKey=3):u=2,-1===u)return;let{value:A}=o.target;M.lastCommittedValue!==A&&(M.lastCommittedValue=A,M.userValue=A,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:A,willCommit:!0,commitKey:u,selStart:o.target.selectionStart,selEnd:o.target.selectionEnd}}))});let A=D;D=null,u.addEventListener("blur",o=>{if(!o.relatedTarget)return;let{value:u}=o.target;M.userValue=u,M.lastCommittedValue!==u&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:u,willCommit:!0,commitKey:M.commitKey,selStart:o.target.selectionStart,selEnd:o.target.selectionEnd}}),A(o)}),this.data.actions?.Keystroke&&u.addEventListener("beforeinput",o=>{M.lastCommittedValue=null;let{data:u,target:A}=o,{value:S,selectionStart:E,selectionEnd:T}=A,I=E,D=T;switch(o.inputType){case"deleteWordBackward":{let o=S.substring(0,E).match(/\w*[^\w]*$/);o&&(I-=o[0].length);break}
2case"deleteWordForward":{let o=S.substring(E).match(/^[^\w]*\w*/);o&&(D+=o[0].length);break}case"deleteContentBackward":E===T&&(I-=1);break;case"deleteContentForward":E===T&&(D+=1)}o.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:S,change:u||"",willCommit:!1,selStart:I,selEnd:D}})}),this._setEventListeners(u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.value)}if(D&&u.addEventListener("blur",D),this.data.comb){let o=this.data.rect[2]-this.data.rect[0],l=o/E;u.classList.add("comb"),u.style.letterSpacing=`calc(${l}px * var(--scale-factor) - 1ch)`}}else(u=document.createElement("div")).textContent=this.data.fieldValue,u.style.verticalAlign="middle",u.style.display="table-cell";return this._setTextStyle(u),this._setBackgroundColor(u),this._setDefaultPropertiesFromJS(u),this.container.append(u),this.container}}class Y extends X{constructor(o){super(o,{isRenderable:!!o.data.hasOwnCanvas})}}class J extends X{constructor(o){super(o,{isRenderable:o.renderForms})}render(){let o=this.annotationStorage,l=this.data,u=l.id,A=o.getValue(u,{value:l.exportValue===l.fieldValue}).value;"string"==typeof A&&(A="Off"!==A,o.setValue(u,{value:A})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let S=document.createElement("input");return L.add(S),S.setAttribute("data-element-id",u),S.disabled=l.readOnly,this._setRequired(S,this.data.required),S.type="checkbox",S.name=l.baseFieldName||l.fieldName,A&&S.setAttribute("checked",!0),S.setAttribute("exportValue",l.exportValue),S.tabIndex=I,S.addEventListener("change",A=>{let{name:S,checked:E}=A.target;for(let A of this._getElementsByName(S,u)){let u=E&&A.exportValue===l.exportValue;A.domElement&&(A.domElement.checked=u),o.setValue(A.id,{value:u})}o.setValue(u,{value:E})}),S.addEventListener("resetform",o=>{let u=l.defaultFieldValue||"Off";o.target.checked=u===l.exportValue}),this.enableScripting&&this.hasJSActions&&(S.addEventListener("updatefromsandbox",l=>{let A={value(l){l.target.checked="Off"!==l.detail.value,o.setValue(u,{value:l.target.checked})}};this._dispatchEventFromSandbox(A,l)}),this._setEventListeners(S,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)),this._setBackgroundColor(S),this._setDefaultPropertiesFromJS(S),this.container.append(S),this.container}}class Q extends X{constructor(o){super(o,{isRenderable:o.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let o=this.annotationStorage,l=this.data,u=l.id,A=o.getValue(u,{value:l.fieldValue===l.buttonValue}).value;"string"==typeof A&&(A=A!==l.buttonValue,o.setValue(u,{value:A}));let S=document.createElement("input");if(L.add(S),S.setAttribute("data-element-id",u),S.disabled=l.readOnly,this._setRequired(S,this.data.required),S.type="radio",S.name=l.baseFieldName||l.fieldName,A&&S.setAttribute("checked",!0),S.tabIndex=I,S.addEventListener("change",l=>{let{name:A,checked:S}=l.target;for(let l of this._getElementsByName(A,u))o.setValue(l.id,{value:!1});o.setValue(u,{value:S})}),S.addEventListener("resetform",o=>{let u=l.defaultFieldValue;o.target.checked=null!=u&&u===l.buttonValue}),this.enableScripting&&this.hasJSActions){let A=l.buttonValue;S.addEventListener("updatefromsandbox",l=>{let S={value:l=>{let S=A===l.detail.value;for(let A of this._getElementsByName(l.target.name)){let l=S&&A.id===u;A.domElement&&(A.domElement.checked=l),o.setValue(A.id,{value:l})}}};this._dispatchEventFromSandbox(S,l)}),this._setEventListeners(S,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(S),this._setDefaultPropertiesFromJS(S),this.container.append(S),this.container}}class Z extends z{constructor(o){super(o,{ignoreBorder:o.data.hasAppearance})}render(){let o=super.render();o.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(o.title=this.data.alternativeText);let l=o.lastChild;return this.enableScripting&&this.hasJSActions&&l&&(this._setDefaultPropertiesFromJS(l),l.addEventListener("updatefromsandbox",o=>{this._dispatchEventFromSandbox({},o)})),o}}class tt extends X{constructor(o){super(o,{isRenderable:o.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let o=this.annotationStorage,l=this.data.id,u=o.getValue(l,{value:this.data.fieldValue}),A=document.createElement("select");L.add(A),A.setAttribute("data-element-id",l),A.disabled=this.data.readOnly,this._setRequired(A,this.data.required),A.name=this.data.baseFieldName||this.data.fieldName,A.tabIndex=I;let S=this.data.combo&&this.data.options.length>0;for(let o of(!this.data.combo&&(A.size=this.data.options.length,this.data.multiSelect&&(A.multiple=!0)),A.addEventListener("resetform",o=>{let l=this.data.defaultFieldValue;for(let o of A.options)o.selected=o.value===l}
2),this.data.options)){let l=document.createElement("option");l.textContent=o.displayValue,l.value=o.exportValue,u.value.includes(o.exportValue)&&(l.setAttribute("selected",!0),S=!1),A.append(l)}let E=null;if(S){let o=document.createElement("option");o.value=" ",o.setAttribute("hidden",!0),o.setAttribute("selected",!0),A.prepend(o),E=()=>{o.remove(),A.removeEventListener("input",E),E=null},A.addEventListener("input",E)}let T=o=>{let l=o?"value":"textContent",{options:u,multiple:S}=A;return S?Array.prototype.filter.call(u,o=>o.selected).map(o=>o[l]):-1===u.selectedIndex?null:u[u.selectedIndex][l]},M=T(!1),D=o=>{let l=o.target.options;return Array.prototype.map.call(l,o=>({displayValue:o.textContent,exportValue:o.value}))};return this.enableScripting&&this.hasJSActions?(A.addEventListener("updatefromsandbox",u=>{let S={value(u){E?.();let S=u.detail.value,I=new Set(Array.isArray(S)?S:[S]);for(let o of A.options)o.selected=I.has(o.value);o.setValue(l,{value:T(!0)}),M=T(!1)},multipleSelection(o){A.multiple=!0},remove(u){let S=A.options,E=u.detail.remove;if(S[E].selected=!1,A.remove(E),S.length>0){let o=Array.prototype.findIndex.call(S,o=>o.selected);-1===o&&(S[0].selected=!0)}o.setValue(l,{value:T(!0),items:D(u)}),M=T(!1)},clear(u){for(;0!==A.length;)A.remove(0);o.setValue(l,{value:null,items:[]}),M=T(!1)},insert(u){let{index:S,displayValue:E,exportValue:I}=u.detail.insert,L=A.children[S],N=document.createElement("option");N.textContent=E,N.value=I,L?L.before(N):A.append(N),o.setValue(l,{value:T(!0),items:D(u)}),M=T(!1)},items(u){let{items:S}=u.detail;for(;0!==A.length;)A.remove(0);for(let o of S){let{displayValue:l,exportValue:u}=o,S=document.createElement("option");S.textContent=l,S.value=u,A.append(S)}A.options.length>0&&(A.options[0].selected=!0),o.setValue(l,{value:T(!0),items:D(u)}),M=T(!1)},indices(u){let A=new Set(u.detail.indices);for(let o of u.target.options)o.selected=A.has(o.index);o.setValue(l,{value:T(!0)}),M=T(!1)},editable(o){o.target.disabled=!o.detail.editable}};this._dispatchEventFromSandbox(S,u)}),A.addEventListener("input",u=>{let A=T(!0);o.setValue(l,{value:A}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:M,changeEx:A,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(A,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],o=>o.target.value)):A.addEventListener("input",function(u){o.setValue(l,{value:T(!0)})}),this.data.combo&&this._setTextStyle(A),this._setBackgroundColor(A),this._setDefaultPropertiesFromJS(A),this.container.append(A),this.container}}class te extends H{constructor(o){let{data:l,elements:u}=o,A=!!(l.titleObj?.str||l.contentsObj?.str||l.richText?.str);super(o,{isRenderable:A}),this.elements=u}render(){this.container.classList.add("popupAnnotation");let o=new ti({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}),l=[];for(let u of this.elements)u.popup=o,l.push(u.data.id),u.addHighlightArea();return this.container.setAttribute("aria-controls",l.join(",")),this.container}}class ti{#eu=null;#ep=this.#ef.bind(this);#eg=this.#em.bind(this);#eb=this.#ev.bind(this);#t7=null;#ti=null;#eA=null;#ey=null;#e_=null;#eS=null;#ex=!1;#eE=null;#eC=null;#eT=null;#ew=null;#eP=!1;constructor(o){let{container:l,color:u,elements:A,titleObj:E,modificationDate:T,contentsObj:M,richText:I,parent:D,rect:L,parentRect:N,open:U}=o;this.#ti=l,this.#ew=E,this.#eA=M,this.#eT=I,this.#e_=D,this.#t7=u,this.#eC=L,this.#eS=N,this.#ey=A;let H=S.PDFDateString.toDateObject(T);for(let o of(H&&(this.#eu=D.l10n.get("annotation_date_string",{date:H.toLocaleDateString(),time:H.toLocaleTimeString()})),this.trigger=A.flatMap(o=>o.getElementsToTriggerPopup()),this.trigger))o.addEventListener("click",this.#eb),o.addEventListener("mouseenter",this.#eg),o.addEventListener("mouseleave",this.#ep);this.#ti.hidden=!0,U&&this.#ev()}
2render(){if(this.#eE)return;let{page:{view:o},viewport:{rawDims:{pageWidth:l,pageHeight:u,pageX:S,pageY:E}}}=this.#e_,T=this.#eE=document.createElement("div");if(T.className="popup",this.#t7){let o=T.style.outlineColor=A.Util.makeHexColor(...this.#t7);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))T.style.backgroundColor=`color-mix(in srgb, ${o} 30%, white)`;else{let o=.7;T.style.backgroundColor=A.Util.makeHexColor(...this.#t7.map(l=>Math.floor(o*(255-l)+l)))}}let I=document.createElement("span");I.className="header";let D=document.createElement("h1");if(I.append(D),{dir:D.dir,str:D.textContent}=this.#ew,T.append(I),this.#eu){let o=document.createElement("span");o.classList.add("popupDate"),this.#eu.then(l=>{o.textContent=l}),I.append(o)}let L=this.#eA,N=this.#eT;if(N?.str&&(!L?.str||L.str===N.str))M.XfaLayer.render({xfaHtml:N.html,intent:"richText",div:T}),T.lastChild.classList.add("richText","popupContent");else{let o=this._formatContents(L);T.append(o)}let U=!!this.#eS,H=U?this.#eS:this.#eC;for(let o of this.#ey)if(!H||null!==A.Util.intersect(o.data.rect,H)){H=o.data.rect,U=!0;break}let z=A.Util.normalizeRect([H[0],o[3]-H[1]+o[1],H[2],o[3]-H[3]+o[1]]),W=5,X=U?H[2]-H[0]+W:0,K=z[0]+X,Y=z[1],{style:J}=this.#ti;J.left=`${100*(K-S)/l}%`,J.top=`${100*(Y-E)/u}%`,this.#ti.append(T)}_formatContents(o){let{str:l,dir:u}=o,A=document.createElement("p");A.classList.add("popupContent"),A.dir=u;let S=l.split(/(?:\r\n?|\n)/);for(let o=0,l=S.length;o<l;++o){let u=S[o];A.append(document.createTextNode(u)),o<l-1&&A.append(document.createElement("br"))}return A}#ev(){this.#ex=!this.#ex,this.#ex?(this.#em(),this.#ti.addEventListener("click",this.#eb)):(this.#ef(),this.#ti.removeEventListener("click",this.#eb))}#em(){this.#eE||this.render(),this.isVisible?this.#ex&&this.#ti.classList.add("focused"):(this.#ti.hidden=!1,this.#ti.style.zIndex=parseInt(this.#ti.style.zIndex)+1e3)}#ef(){this.#ti.classList.remove("focused"),this.#ex||(this.#ti.hidden=!0,this.#ti.style.zIndex=parseInt(this.#ti.style.zIndex)-1e3)}forceHide(){this.#eP=this.isVisible,this.#eP&&(this.#ti.hidden=!0)}maybeShow(){this.#eP&&(this.#eP=!1,this.#ti.hidden=!1)}get isVisible(){return!1===this.#ti.hidden}}class tr extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0}),this.textContent=o.data.textContent,this.annotationEditorType=A.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let o=document.createElement("div");for(let l of(o.classList.add("annotationTextContent"),o.setAttribute("role","comment"),this.textContent)){let u=document.createElement("span");u.textContent=l,o.append(u)}this.container.append(o)}return this.data.popupRef||this._createPopup(),this.container}}l.FreeTextAnnotationElement=tr;class ts extends H{#ek=null;constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let o=this.data,{width:l,height:u}=N(o.rect),A=this.svgFactory.create(l,u,!0),S=this.#ek=this.svgFactory.createElement("svg:line");return S.setAttribute("x1",o.rect[2]-o.lineCoordinates[0]),S.setAttribute("y1",o.rect[3]-o.lineCoordinates[1]),S.setAttribute("x2",o.rect[2]-o.lineCoordinates[2]),S.setAttribute("y2",o.rect[3]-o.lineCoordinates[3]),S.setAttribute("stroke-width",o.borderStyle.width||1),S.setAttribute("stroke","transparent"),S.setAttribute("fill","transparent"),A.append(S),this.container.append(A),o.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ek}addHighlightArea(){this.container.classList.add("highlightArea")}}class tn extends H{#eM=null;constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let o=this.data,{width:l,height:u}=N(o.rect),A=this.svgFactory.create(l,u,!0),S=o.borderStyle.width,E=this.#eM=this.svgFactory.createElement("svg:rect");return E.setAttribute("x",S/2),E.setAttribute("y",S/2),E.setAttribute("width",l-S),E.setAttribute("height",u-S),E.setAttribute("stroke-width",S||1),E.setAttribute("stroke","transparent"),E.setAttribute("fill","transparent"),A.append(E),this.container.append(A),o.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#eM}addHighlightArea(){this.container.classList.add("highlightArea")}}class ta extends H{#eR=null;constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let o=this.data,{width:l,height:u}=N(o.rect),A=this.svgFactory.create(l,u,!0),S=o.borderStyle.width,E=this.#eR=this.svgFactory.createElement("svg:ellipse");return E.setAttribute("cx",l/2),E.setAttribute("cy",u/2),E.setAttribute("rx",l/2-S/2),E.setAttribute("ry",u/2-S/2),E.setAttribute("stroke-width",S||1),E.setAttribute("stroke","transparent"),E.setAttribute("fill","transparent"),A.append(E),this.container.append(A),o.popupRef||this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#eR}addHighlightArea(){this.container.classList.add("highlightArea")}}class to extends H{#eF=null;constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let o=this.data,{width:l,height:u}=N(o.rect),A=this.svgFactory.create(l,u,!0),S=[];for(let l of o.vertices){let u=l.x-o.rect[0],A=o.rect[3]-l.y;S.push(u+","+A)}S=S.join(" ");let E=this.#eF=this.svgFactory.createElement(this.svgElementName);return E.setAttribute("points",S),E.setAttribute("stroke-width",o.borderStyle.width||1),E.setAttribute("stroke","transparent"),E.setAttribute("fill","transparent"),A.append(E),this.container.append(A),o.popupRef||this._createPopup(E,o),this.container}getElementsToTriggerPopup(){return this.#eF}addHighlightArea(){this.container.classList.add("highlightArea")}}class tl extends to{constructor(o){super(o),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class th extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.popupRef||this._createPopup(),this.container}}
2class td extends H{#eO=[];constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=A.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let o=this.data,{width:l,height:u}=N(o.rect),A=this.svgFactory.create(l,u,!0);for(let l of o.inkLists){let u=[];for(let A of l){let l=A.x-o.rect[0],S=o.rect[3]-A.y;u.push(`${l},${S}`)}u=u.join(" ");let S=this.svgFactory.createElement(this.svgElementName);this.#eO.push(S),S.setAttribute("points",u),S.setAttribute("stroke-width",o.borderStyle.width||1),S.setAttribute("stroke","transparent"),S.setAttribute("fill","transparent"),o.popupRef||this._createPopup(S,o),A.append(S)}return this.container.append(A),this.container}getElementsToTriggerPopup(){return this.#eO}addHighlightArea(){this.container.classList.add("highlightArea")}}l.InkAnnotationElement=td;class tc extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.popupRef||this._createPopup(),this.quadrilaterals)?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class tu extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.popupRef||this._createPopup(),this.quadrilaterals)?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class tp extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.popupRef||this._createPopup(),this.quadrilaterals)?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class tf extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return(this.data.popupRef||this._createPopup(),this.quadrilaterals)?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class tg extends H{constructor(o){let l=!!(o.data.popupRef||o.data.titleObj?.str||o.data.contentsObj?.str||o.data.richText?.str);super(o,{isRenderable:l,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.popupRef||this._createPopup(),this.container}}class tm extends H{#eI=null;constructor(o){super(o,{isRenderable:!0});let{filename:l,content:u}=this.data.file;this.filename=(0,S.getFilenameFromUrl)(l,!0),this.content=u,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:l,content:u})}render(){let o;return this.container.classList.add("fileAttachmentAnnotation"),this.data.hasAppearance?o=document.createElement("div"):(o=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`,o.classList.add("popupTriggerArea"),o.addEventListener("dblclick",this._download.bind(this)),this.#eI=o,!this.data.popupRef&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(),this.container.append(o),this.container}getElementsToTriggerPopup(){return this.#eI}addHighlightArea(){this.container.classList.add("highlightArea")}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class tb{#tW=null;#eD=null;#eL=new Map;constructor(o){let{div:l,accessibilityManager:A,annotationCanvasMap:S,l10n:E,page:T,viewport:M}=o;this.div=l,this.#tW=A,this.#eD=S,this.l10n=E,this.page=T,this.viewport=M,this.zIndex=0;let{NullL10n:I}=u(160);this.l10n||=I}#eN(o,l){let u=o.firstChild||o;u.id=`${S.AnnotationPrefix}${l}`,this.div.append(o),this.#tW?.moveElementInDOM(this.div,o,u,!1)}async render(o){let{annotations:l}=o,u=this.div;(0,S.setLayerDimensions)(u,this.viewport);let T=new Map,M={data:null,layer:u,linkService:o.linkService,downloadManager:o.downloadManager,imageResourcesPath:o.imageResourcesPath||"",renderForms:!1!==o.renderForms,svgFactory:new S.DOMSVGFactory,annotationStorage:o.annotationStorage||new E.AnnotationStorage,enableScripting:!0===o.enableScripting,hasJSActions:o.hasJSActions,fieldObjects:o.fieldObjects,parent:this,elements:null};for(let o of l){if(o.noHTML)continue;let l=o.annotationType===A.AnnotationType.POPUP;if(l){let l=T.get(o.id);if(!l)continue;M.elements=l}else{let{width:l,height:u}=N(o.rect);if(l<=0||u<=0)continue}M.data=o;let u=U.create(M);if(!u.isRenderable)continue;if(!l&&o.popupRef){let l=T.get(o.popupRef);l?l.push(u):T.set(o.popupRef,[u])}u.annotationEditorType>0&&this.#eL.set(u.data.id,u);let S=u.render();if(o.hidden&&(S.style.visibility="hidden"),Array.isArray(S))for(let l of S)this.#eN(l,o.id);else this.#eN(S,o.id)}this.#ej(),await this.l10n.translate(u)}update(o){let{viewport:l}=o,u=this.div;this.viewport=l,(0,S.setLayerDimensions)(u,{rotation:l.rotation}),this.#ej(),u.hidden=!1}#ej(){if(!this.#eD)return;let o=this.div;for(let[l,u]of this.#eD){let A=o.querySelector(`[data-annotation-id="${l}"]`);if(!A)continue;let{firstChild:S}=A;S?"CANVAS"===S.nodeName?S.replaceWith(u):S.before(u):A.append(u)}this.#eD.clear()}getEditableAnnotations(){return Array.from(this.#eL.values())}getEditableAnnotation(o){return this.#eL.get(o)}}l.AnnotationLayer=tb},(o,l)=>{"use strict";function u(o){return Math.floor(255*Math.max(0,Math.min(1,o))).toString(16).padStart(2,"0")}
2Object.defineProperty(l,"__esModule",{value:!0}),l.ColorConverters=void 0;class A{static CMYK_G(o){let[l,u,A,S]=o;return["G",1-Math.min(1,.3*l+.59*A+.11*u+S)]}static G_CMYK(o){let[l]=o;return["CMYK",0,0,0,1-l]}static G_RGB(o){let[l]=o;return["RGB",l,l,l]}static G_HTML(o){let[l]=o,A=u(l);return`#${A}${A}${A}`}static RGB_G(o){let[l,u,A]=o;return["G",.3*l+.59*u+.11*A]}static RGB_HTML(o){let[l,A,S]=o,E=u(l),T=u(A),M=u(S);return`#${E}${T}${M}`}static T_HTML(){return"#00000000"}static CMYK_RGB(o){let[l,u,A,S]=o;return["RGB",1-Math.min(1,l+S),1-Math.min(1,A+S),1-Math.min(1,u+S)]}static CMYK_HTML(o){let l=this.CMYK_RGB(o).slice(1);return this.RGB_HTML(l)}static RGB_CMYK(o){let[l,u,A]=o,S=1-l,E=1-u,T=1-A,M=Math.min(S,E,T);return["CMYK",S,E,T,M]}}l.ColorConverters=A},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.XfaLayer=void 0;var A=u(147);class S{static setupStorage(o,l,u,A,S){let E=A.getValue(l,{value:null});switch(u.name){case"textarea":if(null!==E.value&&(o.textContent=E.value),"print"===S)break;o.addEventListener("input",o=>{A.setValue(l,{value:o.target.value})});break;case"input":if("radio"===u.attributes.type||"checkbox"===u.attributes.type){if(E.value===u.attributes.xfaOn?o.setAttribute("checked",!0):E.value===u.attributes.xfaOff&&o.removeAttribute("checked"),"print"===S)break;o.addEventListener("change",o=>{A.setValue(l,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(null!==E.value&&o.setAttribute("value",E.value),"print"===S)break;o.addEventListener("input",o=>{A.setValue(l,{value:o.target.value})})}break;case"select":if(null!==E.value)for(let o of u.children)o.attributes.value===E.value&&(o.attributes.selected=!0);o.addEventListener("input",o=>{let u=o.target.options,S=-1===u.selectedIndex?"":u[u.selectedIndex].value;A.setValue(l,{value:S})})}}static setAttributes(o){let{html:l,element:u,storage:A=null,intent:S,linkService:E}=o,{attributes:T}=u,M=l instanceof HTMLAnchorElement;for(let[o,u]of("radio"===T.type&&(T.name=`${T.name}-${S}`),Object.entries(T)))if(null!=u)switch(o){case"class":u.length&&l.setAttribute(o,u.join(" "));break;case"dataId":break;case"id":l.setAttribute("data-element-id",u);break;case"style":Object.assign(l.style,u);break;case"textContent":l.textContent=u;break;default:M&&("href"===o||"newWindow"===o)||l.setAttribute(o,u)}M&&E.addLinkAttributes(l,T.href,T.newWindow),A&&T.dataId&&this.setupStorage(l,T.dataId,u,A)}static render(o){let l=o.annotationStorage,u=o.linkService,S=o.xfaHtml,E=o.intent||"display",T=document.createElement(S.name);S.attributes&&this.setAttributes({html:T,element:S,intent:E,linkService:u});let M=[[S,-1,T]],I=o.div;if(I.append(T),o.viewport){let l=`matrix(${o.viewport.transform.join(",")})`;I.style.transform=l}"richText"!==E&&I.setAttribute("class","xfaLayer xfaFont");let D=[];for(;M.length>0;){let o;let[S,T,I]=M.at(-1);if(T+1===S.children.length){M.pop();continue}let L=S.children[++M.at(-1)[1]];if(null===L)continue;let{name:N}=L;if("#text"===N){let o=document.createTextNode(L.value);D.push(o),I.append(o);continue}if(o=L?.attributes?.xmlns?document.createElementNS(L.attributes.xmlns,N):document.createElement(N),I.append(o),L.attributes&&this.setAttributes({html:o,element:L,storage:l,intent:E,linkService:u}),L.children&&L.children.length>0)M.push([L,-1,o]);else if(L.value){let l=document.createTextNode(L.value);A.XfaText.shouldBuildText(N)&&D.push(l),o.append(l)}}for(let o of I.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))o.setAttribute("readOnly",!0);return{textDivs:D}}static update(o){let l=`matrix(${o.viewport.transform.join(",")})`;o.div.style.transform=l,o.div.hidden=!1}}l.XfaLayer=S},(o,l)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.NullL10n=void 0,l.getL10nFallback=A;let u={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}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{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"};function A(o,l){switch(o){case"find_match_count":o=`find_match_count[${1===l.total?"one":"other"}]`;break;case"find_match_count_limit":o=`find_match_count_limit[${1===l.limit?"one"
2:"other"}]`}return u[o]||""}function S(o,l){return l?o.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(o,u)=>u in l?l[u]:"{{"+u+"}}"):o}u.print_progress_percent="{{progress}}%";let E={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:A(o,l);return S(u,l)},async translate(o){}};l.NullL10n=E},(o,l,u)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.InkEditor=void 0;var A=u(1),S=u(133),E=u(157),T=u(134);let M=16;class I extends S.AnnotationEditor{#eB=0;#eU=0;#eH=0;#ez=this.canvasContextMenu.bind(this);#eG=this.canvasPointermove.bind(this);#eW=this.canvasPointerleave.bind(this);#eq=this.canvasPointerup.bind(this);#eV=this.canvasPointerdown.bind(this);#e$=new Path2D;#eX=!1;#eK=!1;#eY=!1;#eJ=null;#eQ=0;#eZ=0;#e0=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(o){super({...o,name:"inkEditor"}),this.color=o.color||null,this.thickness=o.thickness||null,this.opacity=o.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(o){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(l=>[l,o.get(l)]))}static updateDefaultParams(o,l){switch(o){case A.AnnotationEditorParamsType.INK_THICKNESS:I._defaultThickness=l;break;case A.AnnotationEditorParamsType.INK_COLOR:I._defaultColor=l;break;case A.AnnotationEditorParamsType.INK_OPACITY:I._defaultOpacity=l/100}}updateParams(o,l){switch(o){case A.AnnotationEditorParamsType.INK_THICKNESS:this.#e1(l);break;case A.AnnotationEditorParamsType.INK_COLOR:this.#es(l);break;case A.AnnotationEditorParamsType.INK_OPACITY:this.#e2(l)}}static get defaultPropertiesToUpdate(){return[[A.AnnotationEditorParamsType.INK_THICKNESS,I._defaultThickness],[A.AnnotationEditorParamsType.INK_COLOR,I._defaultColor||S.AnnotationEditor._defaultLineColor],[A.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*I._defaultOpacity)]]}get propertiesToUpdate(){return[[A.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||I._defaultThickness],[A.AnnotationEditorParamsType.INK_COLOR,this.color||I._defaultColor||S.AnnotationEditor._defaultLineColor],[A.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??I._defaultOpacity))]]}#e1(o){let l=this.thickness;this.addCommands({cmd:()=>{this.thickness=o,this.#e3()},undo:()=>{this.thickness=l,this.#e3()},mustExec:!0,type:A.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#es(o){let l=this.color;this.addCommands({cmd:()=>{this.color=o,this.#e5()},undo:()=>{this.color=l,this.#e5()},mustExec:!0,type:A.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#e2(o){o/=100;let l=this.opacity;this.addCommands({cmd:()=>{this.opacity=o,this.#e5()},undo:()=>{this.opacity=l,this.#e5()},mustExec:!0,type:A.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#e4(),this.#e8()),this.isAttachedToDOM||(this.parent.add(this),this.#e6()),this.#e3())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#eJ.disconnect(),this.#eJ=null,super.remove())}setParent(o){!this.parent&&o?this._uiManager.removeShouldRescale(this):this.parent&&null===o&&this._uiManager.addShouldRescale(this),super.setParent(o)}onScaleChanging(){let[o,l]=this.parentDimensions,u=this.width*o,A=this.height*l;this.setDimensions(u,A)}enableEditMode(){this.#eX||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#eV))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#eV))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#e7(){let{parentRotation:o,parentDimensions:[l,u]}=this;switch(o){case 90:return[0,u,u,l];case 180:return[l,u,l,u];case 270:return[l,0,u,l];default:return[0,0,l,u]}}#e9(){let{ctx:o,color:l,opacity:u,thickness:A,parentScale:S,scaleFactor:E}=this;o.lineWidth=A*S/E,o.lineCap="round",o.lineJoin="round",o.miterLimit=10,o.strokeStyle=`${l}${(0,T.opacityToHex)(u)}`}#it(o,l){this.canvas.addEventListener("contextmenu",this.#ez),this.canvas.addEventListener("pointerleave",this.#eW),this.canvas.addEventListener("pointermove",this.#eG),this.canvas.addEventListener("pointerup",this.#eq),this.canvas.removeEventListener("pointerdown",this.#eV),this.isEditing=!0,this.#eY||(this.#eY=!0,this.#e6(),this.thickness||=I._defaultThickness,this.color||=I._defaultColor||S.AnnotationEditor._defaultLineColor,this.opacity??=I._defaultOpacity),this.currentPath.push([o,l]),this.#eK=!1,this.#e9(),this.#e0=()=>{this.#ie(),this.#e0&&window.requestAnimationFrame(this.#e0)},window.requestAnimationFrame(this.#e0)}#ii(o,l){let[u,A]=this.currentPath.at(-1);if(this.currentPath.length>1&&o===u&&l===A)return;let S=this.currentPath,E=this.#e$;
2if(S.push([o,l]),this.#eK=!0,S.length<=2){E.moveTo(...S[0]),E.lineTo(o,l);return}3===S.length&&(this.#e$=E=new Path2D,E.moveTo(...S[0])),this.#ir(E,...S.at(-3),...S.at(-2),o,l)}#is(){if(0===this.currentPath.length)return;let o=this.currentPath.at(-1);this.#e$.lineTo(...o)}#ia(o,l){let u;if(this.#e0=null,o=Math.min(Math.max(o,0),this.canvas.width),l=Math.min(Math.max(l,0),this.canvas.height),this.#ii(o,l),this.#is(),1!==this.currentPath.length)u=this.#io();else{let A=[o,l];u=[[A,A.slice(),A.slice(),A]]}let A=this.#e$,S=this.currentPath;this.currentPath=[],this.#e$=new Path2D;let E=()=>{this.allRawPaths.push(S),this.paths.push(u),this.bezierPath2D.push(A),this.rebuild()},T=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#e4(),this.#e8()),this.#e3())};this.addCommands({cmd:E,undo:T,mustExec:!0})}#ie(){if(!this.#eK)return;this.#eK=!1,this.thickness,this.parentScale;let o=this.currentPath.slice(-3),{ctx:l}=(o.map(o=>o[0]),o.map(o=>o[1]),this);for(let o of(l.save(),l.clearRect(0,0,this.canvas.width,this.canvas.height),this.bezierPath2D))l.stroke(o);l.stroke(this.#e$),l.restore()}#ir(o,l,u,A,S,E,T){let M=(l+A)/2,I=(u+S)/2,D=(A+E)/2,L=(S+T)/2;o.bezierCurveTo(M+2*(A-M)/3,I+2*(S-I)/3,D+2*(A-D)/3,L+2*(S-L)/3,D,L)}#io(){let o;let l=this.currentPath;if(l.length<=2)return[[l[0],l[0],l.at(-1),l.at(-1)]];let u=[],[A,S]=l[0];for(o=1;o<l.length-2;o++){let[E,T]=l[o],[M,I]=l[o+1],D=(E+M)/2,L=(T+I)/2,N=[A+2*(E-A)/3,S+2*(T-S)/3],U=[D+2*(E-D)/3,L+2*(T-L)/3];u.push([[A,S],N,U,[D,L]]),[A,S]=[D,L]}let[E,T]=l[o],[M,I]=l[o+1],D=[A+2*(E-A)/3,S+2*(T-S)/3],L=[M+2*(E-M)/3,I+2*(T-I)/3];return u.push([[A,S],D,L,[M,I]]),u}#e5(){if(this.isEmpty()){this.#il();return}this.#e9();let{canvas:o,ctx:l}=this;for(let u of(l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,o.width,o.height),this.#il(),this.bezierPath2D))l.stroke(u)}commit(){this.#eX||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#eX=!0,this.div.classList.add("disabled"),this.#e3(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(o){super.focusin(o),this.enableEditMode()}canvasPointerdown(o){0===o.button&&this.isInEditMode()&&!this.#eX&&(this.setInForeground(),o.preventDefault(),"mouse"!==o.type&&this.div.focus(),this.#it(o.offsetX,o.offsetY))}canvasContextMenu(o){o.preventDefault()}canvasPointermove(o){o.preventDefault(),this.#ii(o.offsetX,o.offsetY)}canvasPointerup(o){o.preventDefault(),this.#ih(o)}canvasPointerleave(o){this.#ih(o)}#ih(o){this.canvas.removeEventListener("pointerleave",this.#eW),this.canvas.removeEventListener("pointermove",this.#eG),this.canvas.removeEventListener("pointerup",this.#eq),this.canvas.addEventListener("pointerdown",this.#eV),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",this.#ez)},10),this.#ia(o.offsetX,o.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#e4(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",I._l10nPromise.get("editor_ink_canvas_aria_label").then(o=>this.canvas?.setAttribute("aria-label",o)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#e8(){this.#eJ=new ResizeObserver(o=>
2{let l=o[0].contentRect;l.width&&l.height&&this.setDimensions(l.width,l.height)}),this.#eJ.observe(this.div)}render(){let o,l;if(this.div)return this.div;this.width&&(o=this.x,l=this.y),super.render(),I._l10nPromise.get("editor_ink2_aria_label").then(o=>this.div?.setAttribute("aria-label",o));let[u,A,S,E]=this.#e7();if(this.setAt(u,A,0,0),this.setDims(S,E),this.#e4(),this.width){let[u,A]=this.parentDimensions;this.setAt(o*u,l*A,this.width*u,this.height*A),this.#eY=!0,this.#e6(),this.setDims(this.width*u,this.height*A),this.#e5(),this.#id(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#e8(),this.div}#e6(){if(!this.#eY)return;let[o,l]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*o),this.canvas.height=Math.ceil(this.height*l),this.#il()}setDimensions(o,l){let u=Math.round(o),A=Math.round(l);if(this.#eQ===u&&this.#eZ===A)return;this.#eQ=u,this.#eZ=A,this.canvas.style.visibility="hidden",this.#eB&&Math.abs(this.#eB-o/l)>.01&&(l=Math.ceil(o/this.#eB),this.setDims(o,l));let[S,E]=this.parentDimensions;this.width=o/S,this.height=l/E,this.#eX&&this.#ic(o,l),this.#e6(),this.#e5(),this.canvas.style.visibility="visible",this.fixDims()}#ic(o,l){let u=this.#iu(),A=(o-u)/this.#eH,S=(l-u)/this.#eU;this.scaleFactor=Math.min(A,S)}#il(){let o=this.#iu()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+o,this.translationY*this.scaleFactor+o)}static #ip(o){let l=new Path2D;for(let u=0,A=o.length;u<A;u++){let[A,S,E,T]=o[u];0===u&&l.moveTo(...A),l.bezierCurveTo(S[0],S[1],E[0],E[1],T[0],T[1])}return l}static #ig(o,l,u){let[A,S,E,T]=l;switch(u){case 0:for(let l=0,u=o.length;l<u;l+=2)o[l]+=A,o[l+1]=T-o[l+1];break;case 90:for(let l=0,u=o.length;l<u;l+=2){let u=o[l];o[l]=o[l+1]+A,o[l+1]=u+S}break;case 180:for(let l=0,u=o.length;l<u;l+=2)o[l]=E-o[l],o[l+1]+=S;break;case 270:for(let l=0,u=o.length;l<u;l+=2){let u=o[l];o[l]=E-o[l+1],o[l+1]=T-u}break;default:throw Error("Invalid rotation")}return o}static #im(o,l,u){let[A,S,E,T]=l;switch(u){case 0:for(let l=0,u=o.length;l<u;l+=2)o[l]-=A,o[l+1]=T-o[l+1];break;case 90:for(let l=0,u=o.length;l<u;l+=2){let u=o[l];o[l]=o[l+1]-S,o[l+1]=u-A}break;case 180:for(let l=0,u=o.length;l<u;l+=2)o[l]=E-o[l],o[l+1]-=S;break;case 270:for(let l=0,u=o.length;l<u;l+=2){let u=o[l];o[l]=T-o[l+1],o[l+1]=E-u}break;default:throw Error("Invalid rotation")}return o}#ib(o,l,u,A){let S=[],E=this.thickness/2,T=o*l+E,M=o*u+E;for(let l of this.paths){let u=[],E=[];for(let A=0,S=l.length;A<S;A++){let[I,D,L,N]=l[A],U=o*I[0]+T,H=o*I[1]+M,z=o*D[0]+T,W=o*D[1]+M,X=o*L[0]+T,K=o*L[1]+M,Y=o*N[0]+T,J=o*N[1]+M;0===A&&(u.push(U,H),E.push(U,H)),u.push(z,W,X,K,Y,J),E.push(z,W),A===S-1&&E.push(Y,J)}S.push({bezier:I.#ig(u,A,this.rotation),points:I.#ig(E,A,this.rotation)})}return S}#iv(){let o=1/0,l=-1/0,u=1/0,S=-1/0;for(let E of this.paths)for(let[T,M,I,D]of E){let E=A.Util.bezierBoundingBox(...T,...M,...I,...D);o=Math.min(o,E[0]),u=Math.min(u,E[1]),l=Math.max(l,E[2]),S=Math.max(S,E[3])}return[o,u,l,S]}#iu(){return this.#eX?Math.ceil(this.thickness*this.parentScale):0}#e3(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#eX){this.#e5();return}let l=this.#iv(),u=this.#iu();this.#eH=Math.max(M,l[2]-l[0]),this.#eU=Math.max(M,l[3]-l[1]);let A=Math.ceil(u+this.#eH*this.scaleFactor),S=Math.ceil(u+this.#eU*this.scaleFactor),[E,T]=this.parentDimensions;this.width=A/E,this.height=S/T,this.#eB=A/S,this.#id();let I=this.translationX,D=this.translationY;this.translationX=-l[0],this.translationY=-l[1],this.#e6(),this.#e5(),this.#eQ=A,this.#eZ=S,this.setDims(A,S);let L=o?u/this.scaleFactor/2:0;this.translate(I-this.translationX-L,D-this.translationY-L)}#id(){let{style:o}=this.div;this.#eB>=1?(o.minHeight=`${M}px`,o.minWidth=`${Math.round(this.#eB*M)}px`):(o.minWidth=`${M}px`,o.minHeight=`${Math.round(M/this.#eB)}px`)}static deserialize(o,l,u){if(o instanceof E.InkAnnotationElement)return null;let S=super.deserialize(o,l,u);S.thickness=o.thickness,S.color=A.Util.makeHexColor(...o.color),S.opacity=o.opacity;let[T,D]=S.pageDimensions,L=S.width*T,N=S.height*D,U=S.parentScale,H=o.thickness/2;S.#eB=L/N,S.#eX=!0,S.#eQ=Math.round(L),S.#eZ=Math.round(N);let{paths:z,rect:W,rotation:X}=o;for(let{bezier:o}of z){o=I.#im(o,W,X);let l=[];S.paths.push(l);let u=U*(o[0]-H),A=U*(o[1]-H);for(let S=2,E=o.length;S<E;S+=6){let E=U*(o[S]-H),T=U*(o[S+1]-H),M=U*(o[S+2]-H),I=U*(o[S+3]-H),D=U*(o[S+4]-H),L=U*(o[S+5]-H);l.push([[u,A],[E,T],[M,I],[D,L]]),u=D,A=L}let E=this.#ip(l);S.bezierPath2D.push(E)}let K=S.#iv();return S.#eH=Math.max(M,K[2]-K[0]),S.#eU=Math.max(M,K[3]-K[1]),S.#ic(L,N),S}serialize(){if(this.isEmpty())return null;let o=this.getRect(0,0),l=S.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:A.AnnotationEditorType.INK,color:l,thickness:this.thickness,opacity:this.opacity,paths:this.#ib(this.scaleFactor/this.parentScale,this.translationX,this.translationY,o),pageIndex:this.pageIndex,rect:o,rotation:this.rotation}}}l.InkEditor=I},(o,l,u)=>{"use strict";
2Object.defineProperty(l,"__esModule",{value:!0}),l.SVGGraphics=void 0;var A=u(135),S=u(1),E=u(3);let T={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},M="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/1999/xlink",D=["butt","round","square"],L=["miter","round","bevel"],N=function(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!u)return URL.createObjectURL(new Blob([o],{type:l}));let A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",S=`data:${l};base64,`;for(let l=0,u=o.length;l<u;l+=3){let E=255&o[l],T=255&o[l+1],M=255&o[l+2],I=E>>2,D=(3&E)<<4|T>>4,L=l+1<u?(15&T)<<2|M>>6:64,N=l+2<u?63&M:64;S+=A[I]+A[D]+A[L]+A[N]}return S},U=function(){let o=new Uint8Array([137,80,78,71,13,10,26,10]),l=12,u=new Int32Array(256);for(let o=0;o<256;o++){let l=o;for(let o=0;o<8;o++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;u[o]=l}function A(o,l,A){let S=-1;for(let E=l;E<A;E++){let l=(S^o[E])&255,A=u[l];S=S>>>8^A}return -1^S}function T(o,l,u,S){let E=S,T=l.length;u[E]=T>>24&255,u[E+1]=T>>16&255,u[E+2]=T>>8&255,u[E+3]=255&T,u[E+=4]=255&o.charCodeAt(0),u[E+1]=255&o.charCodeAt(1),u[E+2]=255&o.charCodeAt(2),u[E+3]=255&o.charCodeAt(3),E+=4,u.set(l,E),E+=l.length;let M=A(u,S+4,E);u[E]=M>>24&255,u[E+1]=M>>16&255,u[E+2]=M>>8&255,u[E+3]=255&M}function M(o,l,u){let A=1,S=0;for(let E=l;E<u;++E)S=(S+(A=(A+(255&o[E]))%65521))%65521;return S<<16|A}function I(o){if(!E.isNodeJS)return D(o);try{let l;l=parseInt(process.versions.node)>=8?o:Buffer.from(o);let u=__webpack_require__(87324).deflateSync(l,{level:9});return u instanceof Uint8Array?u:new Uint8Array(u)}catch(o){(0,S.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+o)}return D(o)}function D(o){let l=o.length,u=65535,A=Math.ceil(l/u),S=new Uint8Array(2+l+5*A+4),E=0;S[E++]=120,S[E++]=156;let T=0;for(;l>u;)S[E++]=0,S[E++]=255,S[E++]=255,S[E++]=0,S[E++]=0,S.set(o.subarray(T,T+u),E),E+=u,T+=u,l-=u;S[E++]=1,S[E++]=255&l,S[E++]=l>>8&255,S[E++]=255&~l,S[E++]=(65535&~l)>>8&255,S.set(o.subarray(T),E),E+=o.length-T;let I=M(o,0,o.length);return S[E++]=I>>24&255,S[E++]=I>>16&255,S[E++]=I>>8&255,S[E++]=255&I,S}function L(u,A,E,M){let D,L,U;let H=u.width,z=u.height,W=u.data;switch(A){case S.ImageKind.GRAYSCALE_1BPP:L=0,D=1,U=H+7>>3;break;case S.ImageKind.RGB_24BPP:L=2,D=8,U=3*H;break;case S.ImageKind.RGBA_32BPP:L=6,D=8,U=4*H;break;default:throw Error("invalid format")}let X=new Uint8Array((1+U)*z),K=0,Y=0;for(let o=0;o<z;++o)X[K++]=0,X.set(W.subarray(Y,Y+U),K),Y+=U,K+=U;if(A===S.ImageKind.GRAYSCALE_1BPP&&M){K=0;for(let o=0;o<z;o++){K++;for(let o=0;o<U;o++)X[K++]^=255}}let J=new Uint8Array([H>>24&255,H>>16&255,H>>8&255,255&H,z>>24&255,z>>16&255,z>>8&255,255&z,D,L,0,0,0]),Q=I(X),Z=o.length+3*l+J.length+Q.length,tt=new Uint8Array(Z),te=0;return tt.set(o,te),T("IHDR",J,tt,te+=o.length),T("IDATA",Q,tt,te+=l+J.length),te+=l+Q.length,T("IEND",new Uint8Array(0),tt,te),N(tt,"image/png",E)}return function(o,l,u){let A=void 0===o.kind?S.ImageKind.GRAYSCALE_1BPP:o.kind;return L(o,A,l,u)}}();class H{constructor(){this.fontSizeScale=1,this.fontWeight=T.fontWeight,this.fontSize=0,this.textMatrix=S.IDENTITY_MATRIX,this.fontMatrix=S.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=S.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=T.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(o,l){this.x=o,this.y=l}}function z(o){let l=[],u=[];for(let A of o){if("save"===A.fn){l.push({fnId:92,fn:"group",items:[]}),u.push(l),l=l.at(-1).items;continue}"restore"===A.fn?l=u.pop():l.push(A)}return l}function W(o){if(Number.isInteger(o))return o.toString();let l=o.toFixed(10),u=l.length-1;if("0"!==l[u])return l;do u--;while("0"===l[u]);return l.substring(0,"."===l[u]?u:u+1)}function X(o){if(0===o[4]&&0===o[5]){if(0===o[1]&&0===o[2])return 1===o[0]&&1===o[3]?"":`scale(${W(o[0])} ${W(o[3])})`;if(o[0]===o[3]&&o[1]===-o[2]){let l=180*Math.acos(o[0])/Math.PI;return`rotate(${W(l)})`}}else if(1===o[0]&&0===o[1]&&0===o[2]&&1===o[3])return`translate(${W(o[4])} ${W(o[5])})`;return`matrix(${W(o[0])} ${W(o[1])} ${W(o[2])} ${W(o[3])} ${W(o[4])} ${W(o[5])})`}let K=0,Y=0,J=0;class Q{constructor(o,l){let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(let E in(0,A.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new A.DOMSVGFactory,this.current=ne
2w H,this.transformMatrix=S.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=o,this.objs=l,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!u,this._operatorIdMapping=[],S.OPS)this._operatorIdMapping[S.OPS[E]]=E}getObject(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof o?o.startsWith("g_")?this.commonObjs.get(o):this.objs.get(o):l}save(){this.transformStack.push(this.transformMatrix);let o=this.current;this.extraStack.push(o),this.current=o.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(o){this.save(),this.executeOpTree(o),this.restore()}loadDependencies(o){let l=o.fnArray,u=o.argsArray;for(let o=0,A=l.length;o<A;o++)if(l[o]===S.OPS.dependency)for(let l of u[o]){let o=l.startsWith("g_")?this.commonObjs:this.objs,u=new Promise(u=>{o.get(l,u)});this.current.dependencies.push(u)}return Promise.all(this.current.dependencies)}transform(o,l,u,A,E,T){let M=[o,l,u,A,E,T];this.transformMatrix=S.Util.transform(this.transformMatrix,M),this.tgrp=null}getSVG(o,l){this.viewport=l;let u=this._initialize(l);return this.loadDependencies(o).then(()=>(this.transformMatrix=S.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(o)),u))}convertOpList(o){let l=this._operatorIdMapping,u=o.argsArray,A=o.fnArray,S=[];for(let o=0,E=A.length;o<E;o++){let E=A[o];S.push({fnId:E,fn:l[E],args:u[o]})}return z(S)}executeOpTree(o){for(let l of o){let o=l.fn,u=l.fnId,A=l.args;switch(0|u){case S.OPS.beginText:this.beginText();break;case S.OPS.dependency:break;case S.OPS.setLeading:this.setLeading(A);break;case S.OPS.setLeadingMoveText:this.setLeadingMoveText(A[0],A[1]);break;case S.OPS.setFont:this.setFont(A);break;case S.OPS.showText:case S.OPS.showSpacedText:this.showText(A[0]);break;case S.OPS.endText:this.endText();break;case S.OPS.moveText:this.moveText(A[0],A[1]);break;case S.OPS.setCharSpacing:this.setCharSpacing(A[0]);break;case S.OPS.setWordSpacing:this.setWordSpacing(A[0]);break;case S.OPS.setHScale:this.setHScale(A[0]);break;case S.OPS.setTextMatrix:this.setTextMatrix(A[0],A[1],A[2],A[3],A[4],A[5]);break;case S.OPS.setTextRise:this.setTextRise(A[0]);break;case S.OPS.setTextRenderingMode:this.setTextRenderingMode(A[0]);break;case S.OPS.setLineWidth:this.setLineWidth(A[0]);break;case S.OPS.setLineJoin:this.setLineJoin(A[0]);break;case S.OPS.setLineCap:this.setLineCap(A[0]);break;case S.OPS.setMiterLimit:this.setMiterLimit(A[0]);break;case S.OPS.setFillRGBColor:this.setFillRGBColor(A[0],A[1],A[2]);break;case S.OPS.setStrokeRGBColor:this.setStrokeRGBColor(A[0],A[1],A[2]);break;case S.OPS.setStrokeColorN:this.setStrokeColorN(A);break;case S.OPS.setFillColorN:this.setFillColorN(A);break;case S.OPS.shadingFill:this.shadingFill(A[0]);break;case S.OPS.setDash:this.setDash(A[0],A[1]);break;case S.OPS.setRenderingIntent:this.setRenderingIntent(A[0]);break;case S.OPS.setFlatness:this.setFlatness(A[0]);break;case S.OPS.setGState:this.setGState(A[0]);break;case S.OPS.fill:this.fill();break;case S.OPS.eoFill:this.eoFill();break;case S.OPS.stroke:this.stroke();break;case S.OPS.fillStroke:this.fillStroke();break;case S.OPS.eoFillStroke:this.eoFillStroke();break;case S.OPS.clip:this.clip("nonzero");break;case S.OPS.eoClip:this.clip("evenodd");break;case S.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case S.OPS.paintImageXObject:this.paintImageXObject(A[0]);break;case S.OPS.paintInlineImageXObject:this.paintInlineImageXObject(A[0]);break;case S.OPS.paintImageMaskXObject:this.paintImageMaskXObject(A[0]);break;case S.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(A[0],A[1]);break;case S.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case S.OPS.closePath:this.closePath();break;case S.OPS.closeStroke:this.closeStroke();break;case S.OPS.closeFillStroke:this.closeFillStroke();break;case S.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case S.OPS.nextLine:this.nextLine();break;case S.OPS.transform:this.transform(A[0],A[1],A[2],A[3],A[4],A[5]);break;case S.OPS.constructPath:this.constructPath(A[0],A[1]);break;case S.OPS.endPath:this.endPath();break;case 92:this.group(l.items);break;default:(0,S.warn)(`Unimplemented operator ${o}`)}}}setWordSpacing(o){this.current.wordSpacing=o}setCharSpacing(o){this.current.charSpacing=o}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(o,l,u,A,S,E){let T=this.current;T.textMatrix=T.lineMatrix=[o,l,u,A,S,E],T.textMatrixScale=Math.hypot(o,l),T.x=T.lineX=0,T.y=T.lineY=0,T.xcoords=[],T.ycoords=[],T.tspan=this.svgFactory.createElement("svg:tspan"),T.tspan.setAttributeNS(null,"font-family",T.fontFamily),T.tspan.setAttributeNS(null,"font-size",`${W(T.fontSize)}px`),T.tspan.setAttributeNS(null,"y",W(-T.y)),T.txtElement=this.svgFactory.createElement("svg:text"),T.txtElement.append(T.tspan)}beginText(){let o=this.current;o.x=o.lineX=0,o.y=o.lineY=0,o.textMatrix=S.IDENTITY_MATRIX,o.lineMatrix=S.IDENTITY_MATRIX,o.textMatrixScale=1,o.tspan=this.svgFactory.createElement("svg:tspan"),o.txtElement=this.svgFactory.createElement("svg:text"),o.txtgrp=this.svgFactory.createElement("svg:g"),o.xcoords=[],o.ycoords=[]}moveText(o,l){let u=this.current;u.x=u.lineX+=o,u.y=u.lineY+=l,u.xcoords=[],u.ycoords=[],u.tspan=this.svgFactory.createElement("svg:tspan"),u.tspan.setAttributeNS(null,"font-family",u.fontFamily),u.tspan.setAttributeNS(null,"font-size",`${W(u.fontSize)}
2px`),u.tspan.setAttributeNS(null,"y",W(-u.y))}showText(o){let l=this.current,u=l.font,A=l.fontSize;if(0===A)return;let E=l.fontSizeScale,I=l.charSpacing,D=l.wordSpacing,L=l.fontDirection,N=l.textHScale*L,U=u.vertical,H=U?1:-1,z=u.defaultVMetrics,K=A*l.fontMatrix[0],Y=0;for(let S of o){let o,T,M;if(null===S){Y+=L*D;continue}if("number"==typeof S){Y+=H*S*A/1e3;continue}let N=(S.isSpace?D:0)+I,W=S.fontChar,X=S.width;if(U){let l;let u=S.vmetric||z;l=-(l=S.vmetric?u[1]:.5*X)*K;let A=u[2]*K;X=u?-u[0]:X,o=l/E,T=(Y+A)/E}else o=Y/E,T=0;(S.isInFont||u.missingFile)&&(l.xcoords.push(l.x+o),U&&l.ycoords.push(-l.y+T),l.tspan.textContent+=W),Y+=M=U?X*K-N*L:X*K+N*L}l.tspan.setAttributeNS(null,"x",l.xcoords.map(W).join(" ")),U?l.tspan.setAttributeNS(null,"y",l.ycoords.map(W).join(" ")):l.tspan.setAttributeNS(null,"y",W(-l.y)),U?l.y-=Y:l.x+=Y*N,l.tspan.setAttributeNS(null,"font-family",l.fontFamily),l.tspan.setAttributeNS(null,"font-size",`${W(l.fontSize)}px`),l.fontStyle!==T.fontStyle&&l.tspan.setAttributeNS(null,"font-style",l.fontStyle),l.fontWeight!==T.fontWeight&&l.tspan.setAttributeNS(null,"font-weight",l.fontWeight);let J=l.textRenderingMode&S.TextRenderingMode.FILL_STROKE_MASK;if(J===S.TextRenderingMode.FILL||J===S.TextRenderingMode.FILL_STROKE?(l.fillColor!==T.fillColor&&l.tspan.setAttributeNS(null,"fill",l.fillColor),l.fillAlpha<1&&l.tspan.setAttributeNS(null,"fill-opacity",l.fillAlpha)):l.textRenderingMode===S.TextRenderingMode.ADD_TO_PATH?l.tspan.setAttributeNS(null,"fill","transparent"):l.tspan.setAttributeNS(null,"fill","none"),J===S.TextRenderingMode.STROKE||J===S.TextRenderingMode.FILL_STROKE){let o=1/(l.textMatrixScale||1);this._setStrokeAttributes(l.tspan,o)}let Q=l.textMatrix;0!==l.textRise&&(Q=Q.slice(),Q[5]+=l.textRise),l.txtElement.setAttributeNS(null,"transform",`${X(Q)} scale(${W(N)}, -1)`),l.txtElement.setAttributeNS(M,"xml:space","preserve"),l.txtElement.append(l.tspan),l.txtgrp.append(l.txtElement),this._ensureTransformGroup().append(l.txtElement)}setLeadingMoveText(o,l){this.setLeading(-l),this.moveText(o,l)}addFontStyle(o){if(!o.data)throw 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));let l=N(o.data,o.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${o.loadedName}"; src: url(${l}); }
3`}setFont(o){let l=this.current,u=this.commonObjs.get(o[0]),A=o[1];l.font=u,!this.embedFonts||u.missingFile||this.embeddedFonts[u.loadedName]||(this.addFontStyle(u),this.embeddedFonts[u.loadedName]=u),l.fontMatrix=u.fontMatrix||S.FONT_IDENTITY_MATRIX;let E="normal";u.black?E="900":u.bold&&(E="bold");let T=u.italic?"italic":"normal";A<0?(A=-A,l.fontDirection=-1):l.fontDirection=1,l.fontSize=A,l.fontFamily=u.loadedName,l.fontWeight=E,l.fontStyle=T,l.tspan=this.svgFactory.createElement("svg:tspan"),l.tspan.setAttributeNS(null,"y",W(-l.y)),l.xcoords=[],l.ycoords=[]}endText(){let o=this.current;o.textRenderingMode&S.TextRenderingMode.ADD_TO_PATH_FLAG&&o.txtElement?.hasChildNodes()&&(o.element=o.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(o){o>0&&(this.current.lineWidth=o)}setLineCap(o){this.current.lineCap=D[o]}setLineJoin(o){this.current.lineJoin=L[o]}setMiterLimit(o){this.current.miterLimit=o}setStrokeAlpha(o){this.current.strokeAlpha=o}setStrokeRGBColor(o,l,u){this.current.strokeColor=S.Util.makeHexColor(o,l,u)}setFillAlpha(o){this.current.fillAlpha=o}setFillRGBColor(o,l,u){this.current.fillColor=S.Util.makeHexColor(o,l,u),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(o){this.current.strokeColor=this._makeColorN_Pattern(o)}setFillColorN(o){this.current.fillColor=this._makeColorN_Pattern(o)}shadingFill(o){let{width:l,height:u}=this.viewport,A=S.Util.inverseTransform(this.transformMatrix),[E,T,M,I]=S.Util.getAxialAlignedBoundingBox([0,0,l,u],A),D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x",E),D.setAttributeNS(null,"y",T),D.setAttributeNS(null,"width",M-E),D.setAttributeNS(null,"height",I-T),D.setAttributeNS(null,"fill",this._makeShadingPattern(o)),this.current.fillAlpha<1&&D.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(D)}_makeColorN_Pattern(o){return"TilingPattern"===o[0]?this._makeTilingPattern(o):this._makeShadingPattern(o)}_makeTilingPattern(o){let l=o[1],u=o[2],A=o[3]||S.IDENTITY_MATRIX,[E,T,M,I]=o[4],D=o[5],L=o[6],N=o[7],U=`shading${J++}`,[H,z,W,X]=S.Util.normalizeRect([...S.Util.applyTransform([E,T],A),...S.Util.applyTransform([M,I],A)]),[K,Y]=S.Util.singularValueDecompose2dScale(A),Q=D*K,Z=L*Y,tt=this.svgFactory.createElement("svg:pattern");tt.setAttributeNS(null,"id",U),tt.setAttributeNS(null,"patternUnits","userSpaceOnUse"),tt.setAttributeNS(null,"width",Q),tt.setAttributeNS(null,"height",Z),tt.setAttributeNS(null,"x",`${H}`),tt.setAttributeNS(null,"y",`${z}`);let te=this.svg,ti=this.transformMatrix,tr=this.current.fillColor,ts=this.current.strokeColor,tn=this.svgFactory.create(W-H,X-z);
3if(this.svg=tn,this.transformMatrix=A,2===N){let o=S.Util.makeHexColor(...l);this.current.fillColor=o,this.current.strokeColor=o}return this.executeOpTree(this.convertOpList(u)),this.svg=te,this.transformMatrix=ti,this.current.fillColor=tr,this.current.strokeColor=ts,tt.append(tn.childNodes[0]),this.defs.append(tt),`url(#${U})`}_makeShadingPattern(o){switch("string"==typeof o&&(o=this.objs.get(o)),o[0]){case"RadialAxial":let l;let u=`shading${J++}`,A=o[3];switch(o[1]){case"axial":let E=o[4],T=o[5];(l=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",u),l.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),l.setAttributeNS(null,"x1",E[0]),l.setAttributeNS(null,"y1",E[1]),l.setAttributeNS(null,"x2",T[0]),l.setAttributeNS(null,"y2",T[1]);break;case"radial":let M=o[4],I=o[5],D=o[6],L=o[7];(l=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",u),l.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),l.setAttributeNS(null,"cx",I[0]),l.setAttributeNS(null,"cy",I[1]),l.setAttributeNS(null,"r",L),l.setAttributeNS(null,"fx",M[0]),l.setAttributeNS(null,"fy",M[1]),l.setAttributeNS(null,"fr",D);break;default:throw Error(`Unknown RadialAxial type: ${o[1]}`)}for(let o of A){let u=this.svgFactory.createElement("svg:stop");u.setAttributeNS(null,"offset",o[0]),u.setAttributeNS(null,"stop-color",o[1]),l.append(u)}return this.defs.append(l),`url(#${u})`;case"Mesh":return(0,S.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw Error(`Unknown IR type: ${o[0]}`)}}setDash(o,l){this.current.dashArray=o,this.current.dashPhase=l}constructPath(o,l){let u=this.current,A=u.x,E=u.y,T=[],M=0;for(let u of o)switch(0|u){case S.OPS.rectangle:A=l[M++],E=l[M++];let o=l[M++],I=l[M++],D=A+o,L=E+I;T.push("M",W(A),W(E),"L",W(D),W(E),"L",W(D),W(L),"L",W(A),W(L),"Z");break;case S.OPS.moveTo:A=l[M++],E=l[M++],T.push("M",W(A),W(E));break;case S.OPS.lineTo:A=l[M++],E=l[M++],T.push("L",W(A),W(E));break;case S.OPS.curveTo:A=l[M+4],E=l[M+5],T.push("C",W(l[M]),W(l[M+1]),W(l[M+2]),W(l[M+3]),W(A),W(E)),M+=6;break;case S.OPS.curveTo2:T.push("C",W(A),W(E),W(l[M]),W(l[M+1]),W(l[M+2]),W(l[M+3])),A=l[M+2],E=l[M+3],M+=4;break;case S.OPS.curveTo3:A=l[M+2],E=l[M+3],T.push("C",W(l[M]),W(l[M+1]),W(A),W(E),W(A),W(E)),M+=4;break;case S.OPS.closePath:T.push("Z")}T=T.join(" "),u.path&&o.length>0&&o[0]!==S.OPS.rectangle&&o[0]!==S.OPS.moveTo?T=u.path.getAttributeNS(null,"d")+T:(u.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(u.path)),u.path.setAttributeNS(null,"d",T),u.path.setAttributeNS(null,"fill","none"),u.element=u.path,u.setCurrentPoint(A,E)}endPath(){let o=this.current;if(o.path=null,!this.pendingClip)return;if(!o.element){this.pendingClip=null;return}let l=`clippath${K++}`,u=this.svgFactory.createElement("svg:clipPath");u.setAttributeNS(null,"id",l),u.setAttributeNS(null,"transform",X(this.transformMatrix));let A=o.element.cloneNode(!0);if("evenodd"===this.pendingClip?A.setAttributeNS(null,"clip-rule","evenodd"):A.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,u.append(A),this.defs.append(u),o.activeClipUrl){for(let l of(o.clipGroup=null,this.extraStack))l.clipGroup=null;u.setAttributeNS(null,"clip-path",o.activeClipUrl)}o.activeClipUrl=`url(#${l})`,this.tgrp=null}clip(o){this.pendingClip=o}closePath(){let o=this.current;if(o.path){let l=`${o.path.getAttributeNS(null,"d")}Z`;o.path.setAttributeNS(null,"d",l)}}setLeading(o){this.current.leading=-o}setTextRise(o){this.current.textRise=o}setTextRenderingMode(o){this.current.textRenderingMode=o}setHScale(o){this.current.textHScale=o/100}setRenderingIntent(o){}setFlatness(o){}setGState(o){for(let[l,u]of o)switch(l){case"LW":this.setLineWidth(u);break;case"LC":this.setLineCap(u);break;case"LJ":this.setLineJoin(u);break;case"ML":this.setMiterLimit(u);break;case"D":this.setDash(u[0],u[1]);break;case"RI":this.setRenderingIntent(u);break;case"FL":this.setFlatness(u);break;case"Font":this.setFont(u);break;case"CA":this.setStrokeAlpha(u);break;case"ca":this.setFillAlpha(u);break;default:(0,S.warn)(`Unimplemented graphic state operator ${l}`)}}fill(){let o=this.current;o.element&&(o.element.setAttributeNS(null,"fill",o.fillColor),o.element.setAttributeNS(null,"fill-opacity",o.fillAlpha),this.endPath())}stroke(){let o=this.current;o.element&&(this._setStrokeAttributes(o.element),o.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(o){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=this.current,A=u.dashArray;1!==l&&A.length>0&&(A=A.map(function(o){return l*o}
vendor: 6,855 bytes, line 3
3)),o.setAttributeNS(null,"stroke",u.strokeColor),o.setAttributeNS(null,"stroke-opacity",u.strokeAlpha),o.setAttributeNS(null,"stroke-miterlimit",W(u.miterLimit)),o.setAttributeNS(null,"stroke-linecap",u.lineCap),o.setAttributeNS(null,"stroke-linejoin",u.lineJoin),o.setAttributeNS(null,"stroke-width",W(l*u.lineWidth)+"px"),o.setAttributeNS(null,"stroke-dasharray",A.map(W).join(" ")),o.setAttributeNS(null,"stroke-dashoffset",W(l*u.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(){let o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width","1px"),o.setAttributeNS(null,"height","1px"),o.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(o)}paintImageXObject(o){let l=this.getObject(o);if(!l){(0,S.warn)(`Dependent image with object ID ${o} is not ready yet`);return}this.paintInlineImageXObject(l)}paintInlineImageXObject(o,l){let u=o.width,A=o.height,S=U(o,this.forceDataSchema,!!l),E=this.svgFactory.createElement("svg:rect");E.setAttributeNS(null,"x","0"),E.setAttributeNS(null,"y","0"),E.setAttributeNS(null,"width",W(u)),E.setAttributeNS(null,"height",W(A)),this.current.element=E,this.clip("nonzero");let T=this.svgFactory.createElement("svg:image");T.setAttributeNS(I,"xlink:href",S),T.setAttributeNS(null,"x","0"),T.setAttributeNS(null,"y",W(-A)),T.setAttributeNS(null,"width",W(u)+"px"),T.setAttributeNS(null,"height",W(A)+"px"),T.setAttributeNS(null,"transform",`scale(${W(1/u)} ${W(-1/A)})`),l?l.append(T):this._ensureTransformGroup().append(T)}paintImageMaskXObject(o){let l=this.getObject(o.data,o);if(l.bitmap){(0,S.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}let u=this.current,A=l.width,E=l.height,T=u.fillColor;u.maskId=`mask${Y++}`;let M=this.svgFactory.createElement("svg:mask");M.setAttributeNS(null,"id",u.maskId);let I=this.svgFactory.createElement("svg:rect");I.setAttributeNS(null,"x","0"),I.setAttributeNS(null,"y","0"),I.setAttributeNS(null,"width",W(A)),I.setAttributeNS(null,"height",W(E)),I.setAttributeNS(null,"fill",T),I.setAttributeNS(null,"mask",`url(#${u.maskId})`),this.defs.append(M),this._ensureTransformGroup().append(I),this.paintInlineImageXObject(l,M)}paintFormXObjectBegin(o,l){if(Array.isArray(o)&&6===o.length&&this.transform(o[0],o[1],o[2],o[3],o[4],o[5]),l){let o=l[2]-l[0],u=l[3]-l[1],A=this.svgFactory.createElement("svg:rect");A.setAttributeNS(null,"x",l[0]),A.setAttributeNS(null,"y",l[1]),A.setAttributeNS(null,"width",W(o)),A.setAttributeNS(null,"height",W(u)),this.current.element=A,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(o){let l=this.svgFactory.create(o.width,o.height),u=this.svgFactory.createElement("svg:defs");l.append(u),this.defs=u;let A=this.svgFactory.createElement("svg:g");return A.setAttributeNS(null,"transform",X(o.transform)),l.append(A),this.svg=A,l}_ensureClipGroup(){if(!this.current.clipGroup){let o=this.svgFactory.createElement("svg:g");o.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(o),this.current.clipGroup=o}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",X(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}l.SVGGraphics=Q}],__webpack_module_cache__={};function __w_pdfjs_require__(o){var l=__webpack_module_cache__[o];if(void 0!==l)return l.exports;var u=__webpack_module_cache__[o]={exports:{}};return __webpack_modules__[o].call(u.exports,u,u.exports,__w_pdfjs_require__),u.exports}var __nested_webpack_exports__={};return(()=>{"use strict";var o=__nested_webpack_exports__;Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"AbortException",{enumerable:!0,get:function(){return l.AbortException}}),Object.defineProperty(o,"AnnotationEditorLayer",{enumerable:!0,get:function(){return E.AnnotationEditorLayer}}),Object.defineProperty(o,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return l.AnnotationEditorParamsType}}),Object.defineProperty(o,"AnnotationEditorType",{enumerable:!0,get:function(){return l.AnnotationEditorType}}),Object.defineProperty(o,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return T.AnnotationEditorUIManager}}),Object.defineProperty(o,"AnnotationLayer",{enumerable:!0,get:function(){return M.AnnotationLayer}}),Object.defineProperty(o,"AnnotationMode",{enumerable:!0,get:function(){return l.AnnotationMode}}),Object.defineProperty(o,"CMapCompressionType",{enumerable:!0,get:function(){return l.CMapCompressionType}}),Object.defineProperty(o,"FeatureTest",{enumerable:!0,get:function(){return l.FeatureTest}}),Object.defineProperty(o,"GlobalWorkerOptions",{enumerable:!0,get:function(){return I.GlobalWorkerOptions}}),Object.defineProperty(o,"ImageKind",{enumerable:!0,get:function(){return l.ImageKind}}),Object.defineProperty(o,"InvalidPDFException",{enumerable:!0,get:function(){return l.InvalidPDFException}}),Object.defineProperty(o,"MissingPDFException",{enumerable:!0,get:function(){return l.MissingPDFException}}),Object.defineProperty(o,"OPS",{enumerable:!0,get:function(){return l.OPS}}),Object.defineProperty(o,"PDFDataRangeTransport",{enumerable:!0,get:function(){return u.PDFDataRangeTransport}}),Object.defineProperty(o,"PDFDateString",{enumerable:!0,get:function(){return A.PDFDateString}}),Object.defineProperty(o,"PDFWorker",{enumerable:!0,get:function(){return u.PDFWorker}}),Object.defineProperty(o,"PasswordResponses",{enumerable:!0,get:function(){return l.PasswordResponses}}),Object.defineProperty(o,"PermissionFlag",{enumerable:!0,get:function(){return l.PermissionFlag}}),Object.defineProperty(o,"PixelsPerInch",{enumerable:!0,get:function(){return A.PixelsPerInch}}),Object.defineProperty(o,"PromiseCapability",{enumerable:!0,get:function(){return l.PromiseCapability}}),Object.defineProperty(o,"RenderingCancelledException",{enumerable:!0,get:function(){return A.RenderingCancelledException}}),o.SVGGraphics=void 0,Object.defineProperty(o,"UnexpectedResponseException",{enumerable:!0,get:function(){return l.UnexpectedResponseException}}),Object.defineProperty(o,"Util",{enumerable:!0,get:function(){return l.Util}}),Object.defineProperty(o,"VerbosityLevel",{enumerable:!0,get:function(){return l.VerbosityLevel}}
3),Object.defineProperty(o,"XfaLayer",{enumerable:!0,get:function(){return D.XfaLayer}}),Object.defineProperty(o,"build",{enumerable:!0,get:function(){return u.build}}),Object.defineProperty(o,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return l.createValidAbsoluteUrl}}),Object.defineProperty(o,"getDocument",{enumerable:!0,get:function(){return u.getDocument}}),Object.defineProperty(o,"getFilenameFromUrl",{enumerable:!0,get:function(){return A.getFilenameFromUrl}}),Object.defineProperty(o,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return A.getPdfFilenameFromUrl}}),Object.defineProperty(o,"getXfaPageViewport",{enumerable:!0,get:function(){return A.getXfaPageViewport}}),Object.defineProperty(o,"isDataScheme",{enumerable:!0,get:function(){return A.isDataScheme}}),Object.defineProperty(o,"isPdfFile",{enumerable:!0,get:function(){return A.isPdfFile}}),Object.defineProperty(o,"loadScript",{enumerable:!0,get:function(){return A.loadScript}}),Object.defineProperty(o,"normalizeUnicode",{enumerable:!0,get:function(){return l.normalizeUnicode}}),Object.defineProperty(o,"renderTextLayer",{enumerable:!0,get:function(){return S.renderTextLayer}}),Object.defineProperty(o,"setLayerDimensions",{enumerable:!0,get:function(){return A.setLayerDimensions}}),Object.defineProperty(o,"shadow",{enumerable:!0,get:function(){return l.shadow}}),Object.defineProperty(o,"updateTextLayer",{enumerable:!0,get:function(){return S.updateTextLayer}}),Object.defineProperty(o,"version",{enumerable:!0,get:function(){return u.version}});var l=__w_pdfjs_require__(1),u=__w_pdfjs_require__(131),A=__w_pdfjs_require__(135),S=__w_pdfjs_require__(154),E=__w_pdfjs_require__(155),T=__w_pdfjs_require__(134),M=__w_pdfjs_require__(157),I=__w_pdfjs_require__(142),D=__w_pdfjs_require__(159);let L=__w_pdfjs_require__(162).SVGGraphics;o.SVGGraphics=L})(),__nested_webpack_exports__})())}}]);

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.