1var es=Object.defineProperty;var ns=(F,n,L)=>n in F?es(F,n,{enumerable:!0,configurable:!0,writable:!0,value:L}):F[n]=L;var ne=(F,n,L)=>(ns(F,typeof n!="symbol"?n+"":n,L),L),Be=(F,n,L)=>{if(!n.has(F))throw TypeError("Cannot "+L)};var t=(F,n,L)=>(Be(F,n,"read from private field"),L?L.call(F):n.get(F)),W=(F,n,L)=>{if(n.has(F))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(F):n.set(F,L)},rt=(F,n,L,i)=>(Be(F,n,"write to private field"),i?i.call(F,L):n.set(F,L),L);var me=(F,n,L,i)=>({set _(f){rt(F,n,f,L)},get _(){return t(F,n,i)}}),q=(F,n,L)=>(Be(F,n,"access private method"),L);import{g as getDefaultExportFromCjs,c as getAugmentedNamespace,r as reactExports,R as React}from"./vendor-aea060b0.js";function _mergeNamespaces(F,n){for(var L=0;L<n.length;L++){const i=n[L];if(typeof i!="string"&&!Array.isArray(i)){for(const f in i)if(f!=="default"&&!(f in F)){const z=Object.getOwnPropertyDescriptor(i,f);z&&Object.defineProperty(F,f,z.get?z:{enumerable:!0,get:()=>i[f]})}}}return Object.freeze(Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}))}var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function F(i,f,z,H,ut,M){if(M!==ReactPropTypesSecret){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}F.isRequired=F;function n(){return F}var L={array:F,bigint:F,bool:F,func:F,number:F,object:F,string:F,symbol:F,any:F,arrayOf:n,element:F,elementType:F,instanceOf:n,node:F,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return L.PropTypes=L,L};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function r(F){var n,L,i="";if(typeof F=="string"||typeof F=="number")i+=F;else if(typeof F=="object")if(Array.isArray(F)){var f=F.length;for(n=0;n<f;n++)F[n]&&(L=r(F[n]))&&(i&&(i+=" "),i+=L)}else for(L in F)F[L]&&(i&&(i+=" "),i+=L);return i}function clsx(){for(var F,n,L=0,i="",f=arguments.length;L<f;L++)(F=arguments[L])&&(n=r(F))&&(i&&(i+=" "),i+=n);return i}function commonjsRequire(F){throw new Error('Could not dynamically require "'+F+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(n,L){module.exports=n.pdfjsLib=L()})(globalThis,()=>(()=>{var __webpack_modules__=[,(F,n)=>{var Xt;Object.defineProperty(n,"__esModule",{value:!0}),n.VerbosityLevel=n.Util=n.UnknownErrorException=n.UnexpectedResponseException=n.TextRenderingMode=n.RenderingIntentFlag=n.PromiseCapability=n.PermissionFlag=n.PasswordResponses=n.PasswordException=n.PageActionEventType=n.OPS=n.MissingPDFException=n.MAX_IMAGE_SIZE_TO_CACHE=n.LINE_FACTOR=n.LINE_DESCENT_FACTOR=n.InvalidPDFException=n.ImageKind=n.IDENTITY_MATRIX=n.FormatError=n.FeatureTest=n.FONT_IDENTITY_MATRIX=n.DocumentActionEventType=n.CMapCompressionType=n.BaseException=n.BASELINE_FACTOR=n.AnnotationType=n.AnnotationReplyType=n.AnnotationPrefix=n.AnnotationMode=n.AnnotationFlag=n.AnnotationFieldFlag=n.AnnotationEditorType=n.AnnotationEditorPrefix=n.AnnotationEditorParamsType=n.AnnotationBorderStyleType=n.AnnotationActionEventType=n.AbortException=void 0,n.assert=ht,n.bytesToString=j,n.createValidAbsoluteUrl=St,n.getModificationDate=Ct,n.getUuid=Gt,n.getVerbosityLevel=Y,n.info=it,n.isArrayBuffer=pt,n.isArrayEqual=wt,n.isNodeJS=void 0,n.normalizeUnicode=zt,n.objectFromMap=dt,n.objectSize=at,n.setVerbosityLevel=T,n.shadow=Pt,n.string32=tt,n.stringToBytes=st,n.str
1ingToPDFString=mt,n.stringToUTF8String=et,n.unreachable=G,n.utf8StringToString=nt,n.warn=lt;const L=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");n.isNodeJS=L;const i=[1,0,0,1,0,0];n.IDENTITY_MATRIX=i;const f=[.001,0,0,.001,0,0];n.FONT_IDENTITY_MATRIX=f;const z=1e7;n.MAX_IMAGE_SIZE_TO_CACHE=z;const H=1.35;n.LINE_FACTOR=H;const ut=.35;n.LINE_DESCENT_FACTOR=ut;const M=ut/H;n.BASELINE_FACTOR=M;const C={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};n.RenderingIntentFlag=C;const m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};n.AnnotationMode=m;const I="pdfjs_internal_editor_";n.AnnotationEditorPrefix=I;const N={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};n.AnnotationEditorType=N;const R={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};n.AnnotationEditorParamsType=R;const E={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};n.PermissionFlag=E;const v={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};n.TextRenderingMode=v;const p={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};n.ImageKind=p;const _={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};n.AnnotationType=_;const w={GROUP:"Group",REPLY:"R"};n.AnnotationReplyType=w;const P={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};n.AnnotationFlag=P;const A={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};n.AnnotationFieldFlag=A;const l={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};n.AnnotationBorderStyleType=l;const d={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"};n.AnnotationActionEventType=d;const D={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};n.DocumentActionEventType=D;const b={O:"PageOpen",C:"PageClose"};n.PageActionEventType=b;const c={ERRORS:0,WARNINGS:1,INFOS:5};n.VerbosityLevel=c;const k={NONE:0,BINARY:1};n.CMapCompressionType=k;const g={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};n.OPS=g;const $={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};n.PasswordResponses=$;let V=c.WARNINGS;function T(ft){Number.isInteger(ft)&&(V=ft)}function Y(){return V}function it(ft){V>=c.INFOS&&console.log(`Info: ${ft}`)}function lt(ft){V>=c.WARNINGS&&console.log(`Warning: ${ft}`)}function G(ft){throw new Error(ft)}function ht(ft,Z){ft||G(Z)}function bt(ft){switch(ft==null?void 0:ft.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function St(ft,Z=null,K=null){if(!ft)return null;try{if(K&&typeof ft=="string"){if(K.addDefaultProtocol&&ft.startsWith("www.")){const vt=ft.match(/\./g);
1(vt==null?void 0:vt.length)>=2&&(ft=`http://${ft}`)}if(K.tryConvertEncoding)try{ft=et(ft)}catch{}}const _t=Z?new URL(ft,Z):new URL(ft);if(bt(_t))return _t}catch{}return null}function Pt(ft,Z,K,_t=!1){return Object.defineProperty(ft,Z,{value:K,enumerable:!_t,configurable:!0,writable:!1}),K}const x=function(){function Z(K,_t){this.constructor===Z&&G("Cannot initialize BaseException."),this.message=K,this.name=_t}return Z.prototype=new Error,Z.constructor=Z,Z}();n.BaseException=x;class s extends x{constructor(Z,K){super(Z,"PasswordException"),this.code=K}}n.PasswordException=s;class o extends x{constructor(Z,K){super(Z,"UnknownErrorException"),this.details=K}}n.UnknownErrorException=o;class a extends x{constructor(Z){super(Z,"InvalidPDFException")}}n.InvalidPDFException=a;class h extends x{constructor(Z){super(Z,"MissingPDFException")}}n.MissingPDFException=h;class u extends x{constructor(Z,K){super(Z,"UnexpectedResponseException"),this.status=K}}n.UnexpectedResponseException=u;class S extends x{constructor(Z){super(Z,"FormatError")}}n.FormatError=S;class O extends x{constructor(Z){super(Z,"AbortException")}}n.AbortException=O;function j(ft){(typeof ft!="object"||(ft==null?void 0:ft.length)===void 0)&&G("Invalid argument for bytesToString");const Z=ft.length,K=8192;if(Z<K)return String.fromCharCode.apply(null,ft);const _t=[];for(let vt=0;vt<Z;vt+=K){const ee=Math.min(vt+K,Z),te=ft.subarray(vt,ee);_t.push(String.fromCharCode.apply(null,te))}return _t.join("")}function st(ft){typeof ft!="string"&&G("Invalid argument for stringToBytes");const Z=ft.length,K=new Uint8Array(Z);for(let _t=0;_t<Z;++_t)K[_t]=ft.charCodeAt(_t)&255;return K}function tt(ft){return String.fromCharCode(ft>>24&255,ft>>16&255,ft>>8&255,ft&255)}function at(ft){return Object.keys(ft).length}function dt(ft){const Z=Object.create(null);for(const[K,_t]of ft)Z[K]=_t;return Z}function gt(){const ft=new Uint8Array(4);return ft[0]=1,new Uint32Array(ft.buffer,0,1)[0]===1}function ct(){try{return new Function(""),!0}catch{return!1}}class xt{static get isLittleEndian(){return Pt(this,"isLittleEndian",gt())}static get isEvalSupported(){return Pt(this,"isEvalSupported",ct())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Pt(this,"platform",{isWin:!1,isMac:!1}):Pt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Z,K;return Pt(this,"isCSSRoundSupported",(K=(Z=globalThis.CSS)==null?void 0:Z.supports)==null?void 0:K.call(Z,"width: round(1.5px, 1px)"))}}n.FeatureTest=xt;const Ot=[...Array(256).keys()].map(ft=>ft.toString(16).padStart(2,"0"));class Et{static makeHexColor(Z,K,_t){return`#${Ot[Z]}${Ot[K]}${Ot[_t]}`}static scaleMinMax(Z,K){let _t;Z[0]?(Z[0]<0&&(_t=K[0],K[0]=K[1],K[1]=_t),K[0]*=Z[0],K[1]*=Z[0],Z[3]<0&&(_t=K[2],K[2]=K[3],K[3]=_t),K[2]*=Z[3],K[3]*=Z[3]):(_t=K[0],K[0]=K[2],K[2]=_t,_t=K[1],K[1]=K[3],K[3]=_t,Z[1]<0&&(_t=K[2],K[2]=K[3],K[3]=_t),K[2]*=Z[1],K[3]*=Z[1],Z[2]<0&&(_t=K[0],K[0]=K[1],K[1]=_t),K[0]*=Z[2],K[1]*=Z[2]),K[0]+=Z[4],K[1]+=Z[4],K[2]+=Z[5],K[3]+=Z[5]}static transform(Z,K){return[Z[0]*K[0]+Z[2]*K[1],Z[1]*K[0]+Z[3]*K[1],Z[0]*K[2]+Z[2]*K[3],Z[1]*K[2]+Z[3]*K[3],Z[0]*K[4]+Z[2]*K[5]+Z[4],Z[1]*K[4]+Z[3]*K[5]+Z[5]]}static applyTransform(Z,K){const _t=Z[0]*K[0]+Z[1]*K[2]+K[4],vt=Z[0]*K[1]+Z[1]*K[3]+K[5];return[_t,vt]}static applyInverseTransform(Z,K){const _t=K[0]*K[3]-K[1]*K[2],vt=(Z[0]*K[3]-Z[1]*K[2]+K[2]*K[5]-K[4]*K[3])/_t,ee=(-Z[0]*K[1]+Z[1]*K[0]+K[4]*K[1]-K[5]*K[0])/_t;return[vt,ee]}static getAxialAlignedBoundingBox(Z,K){const _t=this.applyTransform(Z,K),vt=this.applyTransform(Z.slice(2,4),K),ee=this.applyTransform([Z[0],Z[3]],K),te=this.applyTransform([Z[2],Z[1]],K);return[Math.min(_t[0],vt[0],ee[0],te[0]),Math.min(_t[1],vt[1],ee[1],te[1]),Math.max(_t[0],vt[0],ee[0],te[0]),Math.max(_t[1],vt[1],ee[1],te[1])]}static inverseTransform(Z){const K=Z[0]*Z[3]-Z[1]*Z[2];return[Z[3]/K,-Z[1]/K,-Z[2]/K,Z[0]/K,(Z[2]*Z[5]-Z[4]*Z[3])/K,(Z[4]*Z[1]-Z[5]*Z[0])/K]}static singularValueDecompose2dScale(Z){const K=[Z[0],Z[2],Z[1],Z[3]],_t=Z[0]*K[0]+Z[1]*K[2],vt=Z[0]*K[1]+Z[1]*K[3],ee=Z[2]*K[0]+Z[3]*K[2],te=Z[2]*K[1]+Z[3]*K[3],Q=(_t+te)/2,Tt=Math.sqrt((_t+te)**2-4*(_t*te-ee*vt))/2,Nt=Q+Tt||1,Rt=Q-Tt||1;return[Math.sqrt(Nt),Math.sqrt(Rt)]}static normalizeRect(Z){const K=Z.slice(0);return Z[0]>Z[2]&&(K[0]=Z[2],K[2]=Z[0]),Z[1]>Z[3]&&(K[1]=Z[3],K[3]=Z[1]),K}static intersect(Z,K){const _t=Math.max(Math.min(Z[0],Z[2]),Math.min(K[0],K[2])),vt=Math.min(Math.max(Z[0],Z[2]),Math.max(K[0],K[2]));if(_t>vt)return null;const ee=Math.max(Math.min(Z[1],Z[3]),Math.min(K[1],K[3])),te=Math.min(Math.max(Z[1],Z[3]),Math.max(K[1],K[3]));return ee>te?null:[_t,ee,vt,te]}static bezierBoundingBox(Z,K,_t,vt,ee,te,Q,Tt){const Nt=[],Rt=[[],[]];let Bt,Ut,Qt,At,Kt,It,B,e;for(let J=0;J<2;++J){if(J===0?(Ut=6*Z-12*_t+6*ee,Bt=-3*Z+9*_t-9*ee+3*Q,Qt=3*_t-3*Z):(Ut=6*K-12*vt+6*te,Bt=-3*K+9*vt-9*te+3*Tt,Qt=3*vt-3*K),Math.abs(Bt)<1e-12){if(Math.abs(Ut)<1e-12)continue;At=-Qt/Ut,0<At&&At<1&&Nt.push(At);continue}B=Ut*Ut-4*Qt*Bt,e=Math.sqrt(B),!(B<0)&&(Kt=(-Ut+e)/(2*Bt),0<Kt&&Kt<1&&Nt.push(Kt),It=(-Ut-e)/(2*Bt),0<It&&It<1&&Nt.push(It))}let y=Nt.length,U;const X=y;for(;y--;)At=Nt[y],U=1-At,Rt[0][y]=U*U*U*Z+3*U*U*At*_t+3*U*At*At*ee+At*At*At*Q,Rt[1][y]=U*U*U*K+3*U*U*At*vt+3*U*At*At*te+At*At*At*Tt;return Rt[0][X]=Z,Rt[1][X]=K,Rt[0][X+1]=Q,Rt[1][X+1]=Tt,Rt[0].length=Rt[1].length=X+2,[Math.min(...Rt[0]),Math.min(...Rt[1]),Math.max(...Rt[0]),Math.max(...Rt[1])]}}n.Util=Et;const Lt=[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 mt(ft){if(ft[0]>="ï"){let K;if(ft[0]==="þ"&&ft[1]==="ÿ"?K="utf-16be":ft[0]==="ÿ"&&ft[1]==="þ"?K="utf-16le":ft[0]==="ï"&&ft[1]==="»"&&ft[2]==="¿"&&(K="utf-8"),K)try{const _t=new TextDecoder(K,{fatal:!0}),vt=st(ft);return _t.decode(vt)}catch(_t){lt(`stringToPDFString: "${_t}".`)}}const Z=[];for(let K=0,_t=ft.length;K<_t;K++){const vt=Lt[ft.charCodeAt(K)];Z.push(vt?String.fromCharCode(vt):ft.charAt(K))}return Z.join("")}function et(ft){return decodeURIComponent(escape(ft))}function nt(ft){return unescape(encodeURIComponent(ft))}function pt(ft){return typeof ft=="object"&&(ft==null?void 0:ft.byteLength)!==void 0}function wt(ft,Z){if(ft.length!==Z.length)return!1;for(let K=0,_t=ft.length;K<_t;K++)if(ft[K]!==Z[K])return!1;return!0}function Ct(ft=new Date){return[ft.getUTCFullYear().toString(),(ft.getUTCMonth()+1).toString().padStart(2,"0"),ft.getUTCDate().toString().padStart(2,"0"),ft.getUTCHours().toString().padStart(2,"0"),ft.getUTCMinutes().toString().padStart(2,"0"),ft.getUTCSeconds().toString().padStart(2,"0")].join("")}class jt{constructor(){W(this,Xt,!1);this.promise=new Promise((Z,K)=>{this.resolve=_t=>{rt(this,Xt,!0),Z(_t)},this.reject=_t=>{rt(this,Xt,!0),K(_t)}})}get settled(){return t(this,Xt)}}Xt=new WeakMap,n.PromiseCapability=jt;let Vt=null,Wt=null;function zt(ft){return Vt||(Vt=/([\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,Wt=new Map([["ï¬
","ſt"]])),ft.replaceAll(Vt,(Z,K,_t)=>K?K.normalize("NFKC"):Wt.get(_t))}function Gt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();
1const ft=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(ft);else for(let Z=0;Z<32;Z++)ft[Z]=Math.floor(Math.random()*255);return j(ft)}const Ht="pdfjs_internal_id_";n.AnnotationPrefix=Ht},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var F,L,i,f,de,H,Te,M,C,m,I,N,R,E,v,p,Pe,w,P,Ue,l,d;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(b){if(typeof b=="string"||b instanceof URL?b={url:b}:(0,_util.isArrayBuffer)(b)&&(b={data:b}),typeof b!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!b.url&&!b.data&&!b.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const c=new PDFDocumentLoadingTask,{docId:k}=c,g=b.url?getUrlProp(b.url):null,$=b.data?getDataProp(b.data):null,V=b.httpHeaders||null,T=b.withCredentials===!0,Y=b.password??null,it=b.range instanceof PDFDataRangeTransport?b.range:null,lt=Number.isInteger(b.rangeChunkSize)&&b.rangeChunkSize>0?b.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let G=b.worker instanceof PDFWorker?b.worker:null;const ht=b.verbosity,bt=typeof b.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(b.docBaseUrl)?b.docBaseUrl:null,St=typeof b.cMapUrl=="string"?b.cMapUrl:null,Pt=b.cMapPacked!==!1,x=b.CMapReaderFactory||DefaultCMapReaderFactory,s=typeof b.standardFontDataUrl=="string"?b.standardFontDataUrl:null,o=b.StandardFontDataFactory||DefaultStandardFontDataFactory,a=b.stopAtErrors!==!0,h=Number.isInteger(b.maxImageSize)&&b.max
1ImageSize>-1?b.maxImageSize:-1,u=b.isEvalSupported!==!1,S=typeof b.isOffscreenCanvasSupported=="boolean"?b.isOffscreenCanvasSupported:!_util.isNodeJS,O=Number.isInteger(b.canvasMaxAreaInBytes)?b.canvasMaxAreaInBytes:-1,j=typeof b.disableFontFace=="boolean"?b.disableFontFace:_util.isNodeJS,st=b.fontExtraProperties===!0,tt=b.enableXfa===!0,at=b.ownerDocument||globalThis.document,dt=b.disableRange===!0,gt=b.disableStream===!0,ct=b.disableAutoFetch===!0,xt=b.pdfBug===!0,Ot=it?it.length:b.length??NaN,Et=typeof b.useSystemFonts=="boolean"?b.useSystemFonts:!_util.isNodeJS&&!j,Lt=typeof b.useWorkerFetch=="boolean"?b.useWorkerFetch:x===_display_utils.DOMCMapReaderFactory&&o===_display_utils.DOMStandardFontDataFactory&&St&&s&&(0,_display_utils.isValidFetchUrl)(St,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(s,document.baseURI),mt=b.canvasFactory||new DefaultCanvasFactory({ownerDocument:at}),et=b.filterFactory||new DefaultFilterFactory({docId:k,ownerDocument:at}),nt=null;(0,_util.setVerbosityLevel)(ht);const pt={canvasFactory:mt,filterFactory:et};if(Lt||(pt.cMapReaderFactory=new x({baseUrl:St,isCompressed:Pt}),pt.standardFontDataFactory=new o({baseUrl:s})),!G){const jt={verbosity:ht,port:_worker_options.GlobalWorkerOptions.workerPort};G=jt.port?PDFWorker.fromPort(jt):new PDFWorker(jt),c._worker=G}const wt={docId:k,apiVersion:"3.11.174",data:$,password:Y,disableAutoFetch:ct,rangeChunkSize:lt,length:Ot,docBaseUrl:bt,enableXfa:tt,evaluatorOptions:{maxImageSize:h,disableFontFace:j,ignoreErrors:a,isEvalSupported:u,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:O,fontExtraProperties:st,useSystemFonts:Et,cMapUrl:Lt?St:null,standardFontDataUrl:Lt?s:null}},Ct={ignoreErrors:a,isEvalSupported:u,disableFontFace:j,fontExtraProperties:st,enableXfa:tt,ownerDocument:at,disableAutoFetch:ct,pdfBug:xt,styleElement:nt};return G.promise.then(function(){if(c.destroyed)throw new Error("Loading aborted");const jt=_fetchDocument(G,wt),Vt=new Promise(function(Wt){let zt;it?zt=new _transport_stream.PDFDataTransportStream({length:Ot,initialData:it.initialData,progressiveDone:it.progressiveDone,contentDispositionFilename:it.contentDispositionFilename,disableRange:dt,disableStream:gt},it):$||(zt=(Ht=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(Ht):(0,_display_utils.isValidFetchUrl)(Ht.url)?new _displayFetch_stream.PDFFetchStream(Ht):new _displayNetwork.PDFNetworkStream(Ht))({url:g,length:Ot,httpHeaders:V,withCredentials:T,rangeChunkSize:lt,disableRange:dt,disableStream:gt})),Wt(zt)});return Promise.all([jt,Vt]).then(function([Wt,zt]){if(c.destroyed)throw new Error("Loading aborted");const Gt=new _message_handler.MessageHandler(k,Wt,G.port),Ht=new WorkerTransport(Gt,c,zt,Ct,pt);c._transport=Ht,Gt.send("Ready",null)})}).catch(c._capability.reject),c}async function _fetchDocument(b,c){if(b.destroyed)throw new Error("Worker was destroyed");const k=await b.messageHandler.sendWithPromise("GetDocRequest",c,c.data?[c.data.buffer]:null);if(b.destroyed)throw new Error("Worker was destroyed");return k}function getUrlProp(b){if(b instanceof URL)return b.href;try{return new URL(b,window.location).href}catch{if(_util.isNodeJS&&typeof b=="string")return b}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(b){if(_util.isNodeJS&&typeof Buffer<"u"&&b instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(b instanceof Uint8Array&&b.byteLength===b.buffer.byteLength)return b;if(typeof b=="string")return(0,_util.stringToBytes)(b);if(typeof b=="object"&&!isNaN(b==null?void 0:b.length)||(0,_util.isArrayBuffer)(b))return new Uint8Array(b);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const n=class n{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${me(n,F)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var c,k,g;this.destroyed=!0;try{(c=this._worker)!=null&&c.port&&(this._worker._pendingDestroy=!0),await((k=this._transport)==null?void 0:k.destroy())}catch($){throw(g=this._worker)!=null&&g.port&&delete this._worker._pendingDestroy,$}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};F=new WeakMap,W(n,F,0);let PDFDocumentLoadingTask=n;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(c,k,g=!1,$=null){this.length=c,this.initialData=k,this.progressiveDone=g,this.contentDispositionFilename=$,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(c){this._rangeListeners.push(c)}addProgressListener(c){this._progressListeners.push(c)}addProgressiveReadListener(c){this._progressiveReadListeners.push(c)}addProgressiveDoneListener(c){this._progressiveDoneListeners.push(c)}onDataRange(c,k){for(const g of this._rangeListeners)g(c,k)}onDataProgress(c,k){this._readyCapability.promise.then(()=>{for(const g of this._progressListeners)g(c,k)})}onDataProgressiveRead(c){this._readyCapability.promise.then(()=>{for(const k of this._progressiveReadListeners)k(c)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const c of this._progressiveDoneListeners)c()})}transportReady(){this._readyCapability.resolve()}requestDataRange(c,k){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(c,k){this._pdfInfo=c,this._transport=k,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(g=>{if(!g)return g;const $=[];for(const V in g)$.push(...g[V]);return $}))})}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(c){return this._transport.getPage(c)}getPageIndex(c){return this._transport.getPageIndex(c)}getDestinations(){return this._transport.getDestinations()}getDestination(c){return this._transport.getDestination(c)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(c=!1){return this._transport.startCleanup(c||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(c,k,g,$=!1){W(this,f);W(this,H);W(this,L,null);W(this,i,!1);this._pageIndex=c,this._pageInfo=k,this._transport=g,this._stats=$?new _display_utils.StatTimer:null,this._pdfBug=$,this.commonObjs=g.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({scale:c,rotation:k=this.rotate,offsetX:g=0,offsetY:$=0,dontFlip:V=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:c,rotation:k,offsetX:g,offsetY:$,dontFlip:V})}getAnnotations({intent:c="display"}={}
1){const k=this._transport.getRenderingIntent(c);return this._transport.getAnnotations(this._pageIndex,k.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var c;return((c=this._transport._htmlForXfa)==null?void 0:c.children[this._pageIndex])||null}render({canvasContext:c,viewport:k,intent:g="display",annotationMode:$=_util.AnnotationMode.ENABLE,transform:V=null,background:T=null,optionalContentConfigPromise:Y=null,annotationCanvasMap:it=null,pageColors:lt=null,printAnnotationStorage:G=null}){var o,a;(o=this._stats)==null||o.time("Overall");const ht=this._transport.getRenderingIntent(g,$,G);rt(this,i,!1),q(this,H,Te).call(this),Y||(Y=this._transport.getOptionalContentConfig());let bt=this._intentStates.get(ht.cacheKey);bt||(bt=Object.create(null),this._intentStates.set(ht.cacheKey,bt)),bt.streamReaderCancelTimeout&&(clearTimeout(bt.streamReaderCancelTimeout),bt.streamReaderCancelTimeout=null);const St=!!(ht.renderingIntent&_util.RenderingIntentFlag.PRINT);bt.displayReadyCapability||(bt.displayReadyCapability=new _util.PromiseCapability,bt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(a=this._stats)==null||a.time("Page Request"),this._pumpOperatorList(ht));const Pt=h=>{var u,S;bt.renderTasks.delete(x),(this._maybeCleanupAfterRender||St)&&rt(this,i,!0),q(this,f,de).call(this,!St),h?(x.capability.reject(h),this._abortOperatorList({intentState:bt,reason:h instanceof Error?h:new Error(h)})):x.capability.resolve(),(u=this._stats)==null||u.timeEnd("Rendering"),(S=this._stats)==null||S.timeEnd("Overall")},x=new InternalRenderTask({callback:Pt,params:{canvasContext:c,viewport:k,transform:V,background:T},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:it,operatorList:bt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!St,pdfBug:this._pdfBug,pageColors:lt});(bt.renderTasks||(bt.renderTasks=new Set)).add(x);const s=x.task;return Promise.all([bt.displayReadyCapability.promise,Y]).then(([h,u])=>{var S;if(this.destroyed){Pt();return}(S=this._stats)==null||S.time("Rendering"),x.initializeGraphics({transparency:h,optionalContentConfig:u}),x.operatorListChanged()}).catch(Pt),s}getOperatorList({intent:c="display",annotationMode:k=_util.AnnotationMode.ENABLE,printAnnotationStorage:g=null}={}){var it;function $(){T.operatorList.lastChunk&&(T.opListReadCapability.resolve(T.operatorList),T.renderTasks.delete(Y))}const V=this._transport.getRenderingIntent(c,k,g,!0);let T=this._intentStates.get(V.cacheKey);T||(T=Object.create(null),this._intentStates.set(V.cacheKey,T));let Y;return T.opListReadCapability||(Y=Object.create(null),Y.operatorListChanged=$,T.opListReadCapability=new _util.PromiseCapability,(T.renderTasks||(T.renderTasks=new Set)).add(Y),T.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(it=this._stats)==null||it.time("Page Request"),this._pumpOperatorList(V)),T.opListReadCapability.promise}streamTextContent({includeMarkedContent:c=!1,disableNormalization:k=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:c===!0,disableNormalization:k===!0},{highWaterMark:100,size($){return $.items.length}})}getTextContent(c={}){if(this._transport._htmlForXfa)return this.getXfa().then(g=>_xfa_text.XfaText.textContent(g));const k=this.streamTextContent(c);return new Promise(function(g,$){function V(){T.read().then(function({value:it,done:lt}){if(lt){g(Y);return}Object.assign(Y.styles,it.styles),Y.items.push(...it.items),V()},$)}const T=k.getReader(),Y={items:[],styles:Object.create(null)};V()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const c=[];for(const k of this._intentStates.values())if(this._abortOperatorList({intentState:k,reason:new Error("Page was destroyed."),force:!0}),!k.opListReadCapability)for(const g of k.renderTasks)c.push(g.completed),g.cancel();return this.objs.clear(),rt(this,i,!1),q(this,H,Te).call(this),Promise.all(c)}cleanup(c=!1){rt(this,i,!0);const k=q(this,f,de).call(this,!1);return c&&k&&this._stats&&(this._stats=new _display_utils.StatTimer),k}_startRenderPage(c,k){var $,V;const g=this._intentStates.get(k);g&&(($=this._stats)==null||$.timeEnd("Page Request"),(V=g.displayReadyCapability)==null||V.resolve(c))}_renderPageChunk(c,k){for(let g=0,$=c.length;g<$;g++)k.operatorList.fnArray.push(c.fnArray[g]),k.operatorList.argsArray.push(c.argsArray[g]);k.operatorList.lastChunk=c.lastChunk,k.operatorList.separateAnnots=c.separateAnnots;for(const g of k.renderTasks)g.operatorListChanged();c.lastChunk&&q(this,f,de).call(this,!0)}_pumpOperatorList({renderingIntent:c,cacheKey:k,annotationStorageSerializable:g}){const{map:$,transfers:V}=g,Y=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:c,cacheKey:k,annotationStorage:$},V).getReader(),it=this._intentStates.get(k);it.streamReader=Y;const lt=()=>{Y.read().then(({value:G,done:ht})=>{if(ht){it.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(G,it),lt())},G=>
1{if(it.streamReader=null,!this._transport.destroyed){if(it.operatorList){it.operatorList.lastChunk=!0;for(const ht of it.renderTasks)ht.operatorListChanged();q(this,f,de).call(this,!0)}if(it.displayReadyCapability)it.displayReadyCapability.reject(G);else if(it.opListReadCapability)it.opListReadCapability.reject(G);else throw G}})};lt()}_abortOperatorList({intentState:c,reason:k,force:g=!1}){if(c.streamReader){if(c.streamReaderCancelTimeout&&(clearTimeout(c.streamReaderCancelTimeout),c.streamReaderCancelTimeout=null),!g){if(c.renderTasks.size>0)return;if(k instanceof _display_utils.RenderingCancelledException){let $=RENDERING_CANCELLED_TIMEOUT;k.extraDelay>0&&k.extraDelay<1e3&&($+=k.extraDelay),c.streamReaderCancelTimeout=setTimeout(()=>{c.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:c,reason:k,force:!0})},$);return}}if(c.streamReader.cancel(new _util.AbortException(k.message)).catch(()=>{}),c.streamReader=null,!this._transport.destroyed){for(const[$,V]of this._intentStates)if(V===c){this._intentStates.delete($);break}this.cleanup()}}}get stats(){return this._stats}}L=new WeakMap,i=new WeakMap,f=new WeakSet,de=function(c=!1){if(q(this,H,Te).call(this),!t(this,i)||this.destroyed)return!1;if(c)return rt(this,L,setTimeout(()=>{rt(this,L,null),q(this,f,de).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:k,operatorList:g}of this._intentStates.values())if(k.size>0||!g.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),rt(this,i,!1),!0},H=new WeakSet,Te=function(){t(this,L)&&(clearTimeout(t(this,L)),rt(this,L,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){W(this,M,new Set);W(this,C,Promise.resolve())}postMessage(c,k){const g={data:structuredClone(c,k?{transfer:k}:null)};t(this,C).then(()=>{for(const $ of t(this,M))$.call(this,g)})}addEventListener(c,k){t(this,M).add(k)}removeEventListener(c,k){t(this,M).delete(k)}terminate(){t(this,M).clear()}}M=new WeakMap,C=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const b=(m=document==null?void 0:document.currentScript)==null?void 0:m.src;b&&(PDFWorkerUtil.fallbackWorkerSrc=b.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(b,c){let k;try{if(k=new URL(b),!k.origin||k.origin==="null")return!1}catch{return!1}const g=new URL(c,k);return k.origin===g.origin},PDFWorkerUtil.createCDNWrapper=function(b){const c=`importScripts("${b}");`;return URL.createObjectURL(new Blob([c]))}}const _PDFWorker=class _PDFWorker{constructor({name:b=null,port:c=null,verbosity:k=(0,_util.getVerbosityLevel)()}={}){var g;if(this.name=b,this.destroyed=!1,this.verbosity=k,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,c){if((g=t(_PDFWorker,I))!=null&&g.has(c))throw new Error("Cannot use more than one PDFWorker per port.");(t(_PDFWorker,I)||rt(_PDFWorker,I,new WeakMap)).set(c,this),this._initializeFromPort(c);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(b){this._port=b,this._messageHandler=new _message_handler.MessageHandler("main","worker",b),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:b}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,b)||(b=PDFWorkerUtil.createCDNWrapper(new URL(b,window.location).href));const c=new Worker(b),k=new _message_handler.MessageHandler("main","worker",c),g=()=>{c.removeEventListener("error",$),k.destroy(),c.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},$=()=>{this._webWorker||g()};c.addEventListener("error",$),k.on("test",T=>{if(c.removeEventListener("error",$),this.destroyed){g();return}T?(this._messageHandler=k,this._port=c,this._webWorker=c,this._readyCapability.resolve(),k.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),k.destroy(),c.terminate())}),k.on("ready",T=>{if(c.removeEventListener("error",$),this.destroyed){g();return}try{V()}catch{this._setupFakeWorker()}});const V=()=>{const T=new Uint8Array;k.send("test",T,[T.buffer])};V();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(b=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const c=new LoopbackPort;this._port=c;const k=`fake${PDFWorkerUtil.fakeWorkerId++}`,g=new _message_handler.MessageHandler(k+"_worker",k,c);b.setup(g,c);const $=new _message_handler.MessageHandler(k,k+"_worker",c);this._messageHandler=$,this._readyCapability.resolve(),$.send("configure",{verbosity:this.verbosity})}).catch(b=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${b.message}".`))})}destroy(){var b;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(b=t(_PDFWorker,I))==null||b.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(b){var k;if(!(b!=null&&b.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const c=(k=t(this,I))==null?void 0:k.get(b.port);
1if(c){if(c._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return c}return new _PDFWorker(b)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var b;try{return((b=globalThis.pdfjsWorker)==null?void 0:b.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};I=new WeakMap,W(_PDFWorker,I,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(c,k,g,$,V){W(this,p);W(this,N,new Map);W(this,R,new Map);W(this,E,new Map);W(this,v,null);this.messageHandler=c,this.loadingTask=k,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:$.ownerDocument,styleElement:$.styleElement}),this._params=$,this.canvasFactory=V.canvasFactory,this.filterFactory=V.filterFactory,this.cMapReaderFactory=V.cMapReaderFactory,this.standardFontDataFactory=V.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=g,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(c,k=_util.AnnotationMode.ENABLE,g=null,$=!1){let V=_util.RenderingIntentFlag.DISPLAY,T=_annotation_storage.SerializableEmpty;switch(c){case"any":V=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":V=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${c}`)}switch(k){case _util.AnnotationMode.DISABLE:V+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:V+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:V+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,T=(V&_util.RenderingIntentFlag.PRINT&&g instanceof _annotation_storage.PrintAnnotationStorage?g:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${k}`)}return $&&(V+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:V,cacheKey:`${V}_${T.hash}`,annotationStorageSerializable:T}}destroy(){var g;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(g=t(this,v))==null||g.reject(new Error("Worker was destroyed during onPassword callback"));const c=[];for(const $ of t(this,R).values())c.push($._destroy());t(this,R).clear(),t(this,E).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const k=this.messageHandler.sendWithPromise("Terminate",null);return c.push(k),Promise.all(c).then(()=>{var $;this.commonObjs.clear(),this.fontLoader.clear(),t(this,N).clear(),this.filterFactory.destroy(),($=this._networkStream)==null||$.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:c,loadingTask:k}=this;c.on("GetReader",(g,$)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=V=>{this._lastProgress={loaded:V.loaded,total:V.total}},$.onPull=()=>{this._fullReader.read().then(function({value:V,done:T}){if(T){$.close();return}(0,_util.assert)(V instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),$.enqueue(new Uint8Array(V),1,[V])}).catch(V=>{$.error(V)})},$.onCancel=V=>{this._fullReader.cancel(V),$.ready.catch(T=>{if(!this.destroyed)throw T})}}),c.on("ReaderHeadersReady",g=>{const $=new _util.PromiseCapability,V=this._fullReader;return V.headersReady.then(()=>{var T;(!V.isStreamingSupported||!V.isRangeSupported)&&(this._lastProgress&&((T=k.onProgress)==null||T.call(k,this._lastProgress)),V.onProgress=Y=>{var it;(it=k.onProgress)==null||it.call(k,{loaded:Y.loaded,total:Y.total})}),$.resolve({isStreamingSupported:V.isStreamingSupported,isRangeSupported:V.isRangeSupported,contentLength:V.contentLength})},$.reject),$.promise}),c.on("GetRangeReader",(g,$)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const V=this._networkStream.getRangeReader(g.begin,g.end);if(!V){$.close();return}$.onPull=()=>{V.read().then(function({value:T,done:Y}){if(Y){$.close();return}(0,_util.assert)(T instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),$.enqueue(new Uint8Array(T),1,[T])}).catch(T=>{$.error(T)})},$.onCancel=T=>{V.cancel(T),$.ready.catch(Y=>{if(!this.destroyed)throw Y})}}),c.on("GetDoc",({pdfInfo:g})=>{this._numPages=g.numPages,this._htmlForXfa=g.htmlForXfa,delete g.htmlForXfa,k._capability.resolve(new PDFDocumentProxy(g,this))}),c.on("DocException",function(g){let $;switch(g.name){case"PasswordException":$=new _util.PasswordException(g.message,g.code);break;case"InvalidPDFException":$=new _util.InvalidPDFException(g.message);break;case"MissingPDFException":$=new _util.MissingPDFException(g.message);break;case"UnexpectedResponseException":$=new _util.UnexpectedResponseException(g.message,g.status);break;case"UnknownErrorException":$=new _util.UnknownErrorException(g.message,g.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}k._capability.reject($)}),c.on("PasswordRequest",g=>{if(rt(this,v,new _util.PromiseCapability),k.onPassword){const $=V=>{V instanceof Error?t(this,v).reject(V):t(this,v).resolve({password:V})};try{k.onPassword($,g.code)}catch(V){t(this,v).reject(V)}}else t(this,v).reject(new _util.PasswordException(g.message,g.code));return t(this,v).promise}),c.on("DataLoaded",g=>{var $;($=k.onProgress)==null||$.call(k,{loaded:g.length,total:g.length}),this.downloadInfoCapability.resolve(g)}),c.on("StartRenderPage",g=>{if(this.destroyed)return;t(this,R).get(g.pageIndex)._startRenderPage(g.transparency,g.cac
1heKey)}),c.on("commonobj",([g,$,V])=>{var T;if(!this.destroyed&&!this.commonObjs.has(g))switch($){case"Font":const Y=this._params;if("error"in V){const G=V.error;(0,_util.warn)(`Error during font loading: ${G}`),this.commonObjs.resolve(g,G);break}const it=Y.pdfBug&&((T=globalThis.FontInspector)!=null&&T.enabled)?(G,ht)=>globalThis.FontInspector.fontAdded(G,ht):null,lt=new _font_loader.FontFaceObject(V,{isEvalSupported:Y.isEvalSupported,disableFontFace:Y.disableFontFace,ignoreErrors:Y.ignoreErrors,inspectFont:it});this.fontLoader.bind(lt).catch(G=>c.sendWithPromise("FontFallback",{id:g})).finally(()=>{!Y.fontExtraProperties&<.data&&(lt.data=null),this.commonObjs.resolve(g,lt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(g,V);break;default:throw new Error(`Got unknown common object type ${$}`)}}),c.on("obj",([g,$,V,T])=>{var it;if(this.destroyed)return;const Y=t(this,R).get($);if(!Y.objs.has(g))switch(V){case"Image":if(Y.objs.resolve(g,T),T){let lt;if(T.bitmap){const{width:G,height:ht}=T;lt=G*ht*4}else lt=((it=T.data)==null?void 0:it.length)||0;lt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Y._maybeCleanupAfterRender=!0)}break;case"Pattern":Y.objs.resolve(g,T);break;default:throw new Error(`Got unknown object type ${V}`)}}),c.on("DocProgress",g=>{var $;this.destroyed||($=k.onProgress)==null||$.call(k,{loaded:g.loaded,total:g.total})}),c.on("FetchBuiltInCMap",g=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(g):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),c.on("FetchStandardFontData",g=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(g):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var g;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:c,transfers:k}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:c,filename:((g=this._fullReader)==null?void 0:g.filename)??null},k).finally(()=>{this.annotationStorage.resetModified()})}getPage(c){if(!Number.isInteger(c)||c<=0||c>this._numPages)return Promise.reject(new Error("Invalid page request."));const k=c-1,g=t(this,E).get(k);if(g)return g;const $=this.messageHandler.sendWithPromise("GetPage",{pageIndex:k}).then(V=>{if(this.destroyed)throw new Error("Transport destroyed");const T=new PDFPageProxy(k,V,this,this._params.pdfBug);return t(this,R).set(k,T),T});return t(this,E).set(k,$),$}getPageIndex(c){return typeof c!="object"||c===null||!Number.isInteger(c.num)||c.num<0||!Number.isInteger(c.gen)||c.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:c.num,gen:c.gen})}getAnnotations(c,k){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:c,intent:k})}getFieldObjects(){return q(this,p,Pe).call(this,"GetFieldObjects")}hasJSActions(){return q(this,p,Pe).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(c){return typeof c!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:c})}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)}
1getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return q(this,p,Pe).call(this,"GetDocJSActions")}getPageJSActions(c){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:c})}getStructTree(c){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:c})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(c=>new _optional_content_config.OptionalContentConfig(c))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const c="GetMetadata",k=t(this,N).get(c);if(k)return k;const g=this.messageHandler.sendWithPromise(c,null).then($=>{var V,T;return{info:$[0],metadata:$[1]?new _metadata.Metadata($[1]):null,contentDispositionFilename:((V=this._fullReader)==null?void 0:V.filename)??null,contentLength:((T=this._fullReader)==null?void 0:T.contentLength)??null}});return t(this,N).set(c,g),g}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(c=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const k of t(this,R).values())if(!k.cleanup())throw new Error(`startCleanup: Page ${k.pageNumber} is currently rendering.`);this.commonObjs.clear(),c||this.fontLoader.clear(),t(this,N).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:c,enableXfa:k}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:c,enableXfa:k})}}N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakSet,Pe=function(c,k=null){const g=t(this,N).get(c);if(g)return g;const $=this.messageHandler.sendWithPromise(c,k);return t(this,N).set(c,$),$};class PDFObjects{constructor(){W(this,P);W(this,w,Object.create(null))}get(c,k=null){if(k){const $=q(this,P,Ue).call(this,c);return $.capability.promise.then(()=>k($.data)),null}const g=t(this,w)[c];if(!(g!=null&&g.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${c}.`);return g.data}has(c){const k=t(this,w)[c];return(k==null?void 0:k.capability.settled)||!1}resolve(c,k=null){const g=q(this,P,Ue).call(this,c);g.data=k,g.capability.resolve()}clear(){var c;for(const k in t(this,w)){const{data:g}=t(this,w)[k];(c=g==null?void 0:g.bitmap)==null||c.close()}rt(this,w,Object.create(null))}}w=new WeakMap,P=new WeakSet,Ue=function(c){var k;return(k=t(this,w))[c]||(k[c]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(c){W(this,l,null);rt(this,l,c),this.onContinue=null}get promise(){return t(this,l).capability.promise}cancel(c=0){t(this,l).cancel(null,c)}get separateAnnots(){const{separateAnnots:c}=t(this,l).operatorList;if(!c)return!1;const{annotationCanvasMap:k}=t(this,l);return c.form||c.canvas&&(k==null?void 0:k.size)>0}}l=new WeakMap,exports.RenderTask=RenderTask;const D=class D{constructor({callback:c,params:k,objs:g,commonObjs:$,annotationCanvasMap:V,operatorList:T,pageIndex:Y,canvasFactory:it,filterFactory:lt,useRequestAnimationFrame:G=!1,pdfBug:ht=!1,pageColors:bt=null}){this.callback=c,this.params=k,this.objs=g,this.commonObjs=$,this.annotationCanvasMap=V,this.operatorListIdx=null,this.operatorList=T,this._pageIndex=Y,this.canvasFactory=it,this.filterFactory=lt,this._pdfBug=ht,this.pageColors=bt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=G===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=k.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:c=!1,optionalContentConfig:k}){var Y,it;if(this.cancelled)return;if(this._canvas){if(t(D,d).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");t(D,d).add(this._canvas)}this._pdfBug&&((Y=globalThis.StepperManager)!=null&&Y.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:g,viewport:$,transform:V,background:T}=this.params;this.gfx=new _canvas.CanvasGraphics(g,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:k},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:V,viewport:$,transparency:c,background:T}),this.operatorListIdx=0,this.graphicsReady=!0,(it=this.graphicsReadyCallback)==null||it.call(this)}cancel(c=null,k=0){var g;this.running=!1,this.cancelled=!0,(g=this.gfx)==null||g.endDrawing(),t(D,d).delete(this._canvas),this.callback(c||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,k))}operatorListChanged(){var c;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(c=this.stepper)==null||c.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}
1):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),t(D,d).delete(this._canvas),this.callback())))}};d=new WeakMap,W(D,d,new WeakSet);let InternalRenderTask=D;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(F,n,L)=>{var C,m,I,vn,R;Object.defineProperty(n,"__esModule",{value:!0}),n.SerializableEmpty=n.PrintAnnotationStorage=n.AnnotationStorage=void 0;var i=L(1),f=L(4),z=L(8);const H=Object.freeze({map:null,hash:"",transfers:void 0});n.SerializableEmpty=H;class ut{constructor(){W(this,I);W(this,C,!1);W(this,m,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(v,p){const _=t(this,m).get(v);return _===void 0?p:Object.assign(p,_)}getRawValue(v){return t(this,m).get(v)}remove(v){if(t(this,m).delete(v),t(this,m).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const p of t(this,m).values())if(p instanceof f.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(v,p){const _=t(this,m).get(v);let w=!1;if(_!==void 0)for(const[P,A]of Object.entries(p))_[P]!==A&&(w=!0,_[P]=A);else w=!0,t(this,m).set(v,p);w&&q(this,I,vn).call(this),p instanceof f.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(p.constructor._type)}has(v){return t(this,m).has(v)}getAll(){return t(this,m).size>0?(0,i.objectFromMap)(t(this,m)):null}setAll(v){for(const[p,_]of Object.entries(v))this.setValue(p,_)}get size(){return t(this,m).size}resetModified(){t(this,C)&&(rt(this,C,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new M(this)}get serializable(){if(t(this,m).size===0)return H;const v=new Map,p=new z.MurmurHash3_64,_=[],w=Object.create(null);let P=!1;for(const[A,l]of t(this,m)){const d=l instanceof f.AnnotationEditor?l.serialize(!1,w):l;d&&(v.set(A,d),p.update(`${A}:${JSON.stringify(d)}`),P||(P=!!d.bitmap))}if(P)for(const A of v.values())A.bitmap&&_.push(A.bitmap);return v.size>0?{map:v,hash:p.hexdigest(),transfers:_}:H}}C=new WeakMap,m=new WeakMap,I=new WeakSet,vn=function(){t(this,C)||(rt(this,C,!0),typeof this.onSetModified=="function"&&this.onSetModified())},n.AnnotationStorage=ut;class M extends ut{constructor(p){super();W(this,R,void 0);const{map:_,hash:w,transfers:P}=p.serializable,A=structuredClone(_,P?{transfer:P}:null);rt(this,R,{map:A,hash:w,transfers:P})}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return t(this,R)}}R=new WeakMap,n.PrintAnnotationStorage=M},(F,n,L)=>{var M,C,m,I,N,R,E,v,p,_,w,P,A,l,d,je,b,We,k,He,$,$e,T,En,it,Sn,G,Tn,bt,Ge,Pt,Pn;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditor=void 0;var i=L(5),f=L(1),z=L(6);const s=class s{constructor(a){W(this,d);W(this,b);W(this,$);W(this,T);W(this,it);W(this,G);W(this,bt);W(this,Pt);W(this,M,"");W(this,C,!1);W(this,m,null);W(this,I,null);W(this,N,null);W(this,R,!1);W(this,E,null);W(this,v,this.focusin.bind(this));W(this,p,this.focusout.bind(this));W(this,_,!1);W(this,w,!1);W(this,P,!1);ne(this,"_initialOptions",Object.create(null));ne(this,"_uiManager",null);ne(this,"_focusEventsAllowed",!0);ne(this,"_l10nPromise",null);W(this,A,!1);W(this,l,s._zIndex++);this.constructor===s&&(0,f.unreachable)("Cannot initialize AnnotationEditor."),this.parent=a.parent,this.id=a.id,this.width=this.height=null,this.pageIndex=a.parent.pageIndex,this.name=a.name,this.div=null,this._uiManager=a.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=a.isCentered,this._structTreeParentId=null;const{rotation:h,rawDims:{pageWidth:u,pageHeight:S,pageX:O,pageY:j}}=this.parent.viewport;this.rotation=h,this.pageRotation=(360+h-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[u,S],this.pageTranslation=[O,j];const[st,tt]=this.parentDimensions;this.x=a.x/st,this.y=a.y/tt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,f.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(a){const h=new ut({id:a.parent.getNextId(),parent:a.parent,uiManager:a._uiManager});h.annotationElementId=a.annotationElementId,h.deleted=!0,h._uiManager.addToAnnotationStorage(h)}static initialize(a,h=null){if(s._l10nPromise||(s._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(S=>[S,a.get(S)]))),h!=null&&h.strings)for(const S of h.strings)s._l10nPromise.set(S,a.get(S));if(s._borderLineWidth!==-1)return;const u=getComputedStyle(document.documentElement);s._borderLineWidth=parseFloat(u.getPropertyValue("--outline-width"))||0}static updateDefaultParams(a,h){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(a){return!1}static paste(a,h){(0,f.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return t(this,A)}set _isDraggable(a){var h;rt(this,A,a),(h=this.div)==null||h.classList.toggle("draggable",a)}center(){const[a,h]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*h/(a*2),this.y+=this.width*a/(h*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*h/(a*2),this.y-=this.width*a/(h*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(a){this._uiManager.addCommands(a)}get currentLayer(){return this._uiManager.currentLayer}
1setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=t(this,l)}setParent(a){a!==null&&(this.pageIndex=a.pageIndex,this.pageDimensions=a.pageDimensions),this.parent=a}focusin(a){this._focusEventsAllowed&&(t(this,_)?rt(this,_,!1):this.parent.setSelected(this))}focusout(a){var u;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const h=a.relatedTarget;h!=null&&h.closest(`#${this.id}`)||(a.preventDefault(),(u=this.parent)!=null&&u.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(a,h,u,S){const[O,j]=this.parentDimensions;[u,S]=this.screenToPageTranslation(u,S),this.x=(a+u)/O,this.y=(h+S)/j,this.fixAndSetPosition()}translate(a,h){q(this,d,je).call(this,this.parentDimensions,a,h)}translateInPage(a,h){q(this,d,je).call(this,this.pageDimensions,a,h),this.div.scrollIntoView({block:"nearest"})}drag(a,h){const[u,S]=this.parentDimensions;if(this.x+=a/u,this.y+=h/S,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:at,y:dt}=this.div.getBoundingClientRect();this.parent.findNewParent(this,at,dt)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:O,y:j}=this;const[st,tt]=q(this,b,We).call(this);O+=st,j+=tt,this.div.style.left=`${(100*O).toFixed(2)}%`,this.div.style.top=`${(100*j).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[a,h]=this.pageDimensions;let{x:u,y:S,width:O,height:j}=this;switch(O*=a,j*=h,u*=a,S*=h,this.rotation){case 0:u=Math.max(0,Math.min(a-O,u)),S=Math.max(0,Math.min(h-j,S));break;case 90:u=Math.max(0,Math.min(a-j,u)),S=Math.min(h,Math.max(O,S));break;case 180:u=Math.min(a,Math.max(O,u)),S=Math.min(h,Math.max(j,S));break;case 270:u=Math.min(a,Math.max(j,u)),S=Math.max(0,Math.min(h-O,S));break}this.x=u/=a,this.y=S/=h;const[st,tt]=q(this,b,We).call(this);u+=st,S+=tt;const{style:at}=this.div;at.left=`${(100*u).toFixed(2)}%`,at.top=`${(100*S).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(a,h){var u;return q(u=s,k,He).call(u,a,h,this.parentRotation)}pageTranslationToScreen(a,h){var u;return q(u=s,k,He).call(u,a,h,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:a,pageDimensions:[h,u]}=this,S=h*a,O=u*a;return f.FeatureTest.isCSSRoundSupported?[Math.round(S),Math.round(O)]:[S,O]}setDims(a,h){var O;const[u,S]=this.parentDimensions;this.div.style.width=`${(100*a/u).toFixed(2)}%`,t(this,R)||(this.div.style.height=`${(100*h/S).toFixed(2)}%`),(O=t(this,m))==null||O.classList.toggle("small",a<s.SMALL_EDITOR_SIZE||h<s.SMALL_EDITOR_SIZE)}fixDims(){const{style:a}=this.div,{height:h,width:u}=a,S=u.endsWith("%"),O=!t(this,R)&&h.endsWith("%");if(S&&O)return;const[j,st]=this.parentDimensions;S||(a.width=`${(100*parseFloat(u)/j).toFixed(2)}%`),!t(this,R)&&!O&&(a.height=`${(100*parseFloat(h)/st).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(t(this,m))return;const a=rt(this,m,document.createElement("button"));a.className="altText";const h=await s._l10nPromise.get("editor_alt_text_button_label");a.textContent=h,a.setAttribute("aria-label",h),a.tabIndex="0",a.addEventListener("contextmenu",z.noContextMenu),a.addEventListener("pointerdown",u=>u.stopPropagation()),a.addEventListener("click",u=>{u.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),a.addEventListener("keydown",u=>{u.target===a&&u.key==="Enter"&&(u.preventDefault(),this._uiManager.editAltText(this))}),q(this,bt,Ge).call(this),this.div.append(a),s.SMALL_EDITOR_SIZE||(s.SMALL_EDITOR_SIZE=Math.min(128,Math.round(a.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:t(this,M),decorative:t(this,C)}}set altTextData({altText:a,decorative:h}){t(this,M)===a&&t(this,C)===h||(rt(this,M,a),rt(this,C,h),q(this,bt,Ge).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",t(this,v)),this.div.addEventListener("focusout",t(this,p));const[a,h]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*h/a).toFixed(2)}%`,this.div.style.maxHeight=`${(100*a/h).toFixed(2)}%`);const[u,S]=this.getInitialTranslation();return this.translate(u,S),(0,i.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(a){const{isMac:h}=f.FeatureTest.platform;if(a.button!==0||a.ctrlKey&&h){a.preventDefault();return}rt(this,_,!0),q(this,Pt,Pn).call(this,a)}moveInDOM(){var a;(a=this.parent)==null||a.moveEditorInDOM(this)}_setParentAndPosition(a,h,u){a.changeParent(this),this.x=h,this.y=u,this.fixAndSetPosition()}getRect(a,h){const u=this.parentScale,[S,O]=this.pageDimensions,[j,st]=this.pageTranslation,tt=a/u,at=h/u,dt=this.x*S,gt=this.y*O,ct=this.width*S,xt=this.height*O;switch(this.rotation){case 0:return[dt+tt+j,O-gt-at-xt+st,dt+tt+ct+j,O-gt-at+st];case 90:return[dt+at+j,O-gt+tt+st,dt+at+xt+j,O-gt+tt+ct+st];case 180:return[dt-tt-ct+j,O-gt+at+st,dt-tt+j,O-gt+at+xt+st];case 270:return[dt-at-xt+j,O-gt-tt-ct+st,dt-at+j,O-gt-tt+st];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(a,h){const[u,S,O,j]=a,st=O-u,tt=j-S;switch(this.rotation){case 0:return[u,h-j,st,tt];case 90:return[u,h-S,tt,st];case 180:return[O,h-S,st,tt];case 270:return[O,h-j,tt,st];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){rt(this,P,!0)}disableEditMode(){rt(this,P,!1)}isInEditMode(){return t(this,P)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var a,h;(a=this.div)==null||a.addEventListener("focusin",t(this,v)),(h=this.div)==null||h.addEventListener("focusout",t(this,p))}serialize(a=!1,h=null){(0,f.unreachable)("An editor must be serializable")}static deserialize(a,h,u){const S=new this.prototype.constructor({parent:h,id:h.getNextId(),uiManager:u});S.rotation=a.rotation;const[O,j]=S.pageDimensions,[st,tt,at,dt]=S.getRectInCurrentCoords(a.rect,j);return S.x=st/O,S.y=tt/j,S.width=at/O,S.height=dt/j,S}remove(){var a;this.div.removeEventListener("focusin",t(this,v)),this.div.removeEventListener("focusout",t(this,p)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(a=t(this,m))==null||a.remove(),rt(this,m,null),rt(this,I,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(q(this,T,En).call(this),t(this,E).classList.remove("hidden"))}select(){var a;this.makeResizable(),(a=this.div)==null||a.classList.add("selectedEditor")}unselect(){var a,h,u;(a=t(this,E))==null||a.classList.add("hidden"),(h=this.div)==null||h.classList.remove("selectedEditor"),(u=this.div)!=null&&u.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(a,h){}disableEditing(){t(this,m)&&(t(this,m).hidden=!0)}enableEditing(){t(this,m)&&(t(this,m).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return t(this,w)}set isEditing(a){rt(this,w,a),this.parent&&(a?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(a,h){rt(this,R,!0);const u=a/h,{style:S}=this.div;S.aspectRatio=u,S.height="auto"}static get MIN_SIZE(){return 16}};M=new WeakMap,C=new WeakMap,m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakMap,w=new WeakMap,P=new WeakMap,A=new WeakMap,l=new WeakMap,d=new WeakSet,je=function([a,h],u,S){[u,S]=this.screenToPageTranslation(u,S),this.x+=u/a,this.y+=S/h,this.fixAndSetPosition()},b=new WeakSet,We=function(){const[a,h]=this.parentDimensions,{_borderLineWidth:u}=s,S=u/a,O=u/h;switch(this.rotation){case 90:return[-S,O];case 180:return[S,O];case 270:return[S,-O];default:return[-S,-O]}},k=new WeakSet,He=function(a,h,u){switch(u){case 90:return[h,-a];case 180:return[-a,-h];case 270:return[-h,a];default:return[a,h]}},$=new WeakSet,$e=function(a){switch(a){case 90:{const[h,u]=this.pageDimensions;return[0,-h/u,u/h,0]}case 180:return[-1,0,0,-1];case 270:{const[h,u]=this.pageDimensions;return[0,h/u,-u/h,0]}default:return[1,0,0,1]}},T=new WeakSet,En=function(){if(t(this,E))return;rt(this,E,document.createElement("div")),t(this,E).classList.add("resizers");const a=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||a.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const h of a){const u=document.createElement("div");t(this,E).append(u),u.classList.add("resizer",h),u.addEventListener("pointerdown",q(this,it,Sn).bind(this,h)),u.addEventListener("contextmenu",z.noContextMenu)}this.div.prepend(t(this,E))},it=new WeakSet,Sn=function(a,h){h.preventDefault();const{isMac:u}=f.FeatureTest.platform;if(h.button!==0||h.ctrlKey&&u)return;const S=q(this,G,Tn).bind(this,a),O=this._isDraggable;this._isDraggable=!1;const j={passive:!0,capture:!0};window.addEventListener("pointermove",S,j);const st=this.x,tt=this.y,at=this.width,dt=this.height,gt=this.parent.div.style.cursor,ct=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(h.target).cursor;const xt=()=>{this._isDraggable=O,window.removeEventListener("pointerup",xt),window.removeEventListener("blur",xt),window.removeEventListener("pointermove",S,j),this.parent.div.style.cursor=gt,this.div.style.cursor=ct;const Ot=this.x,Et=this.y,Lt=this.width,mt=this.height;Ot===st&&Et===tt&&Lt===at&&mt===dt||this.addCommands({cmd:()=>{this.width=Lt,this.height=mt,this.x=Ot,this.y=Et;const[et,nt]=this.parentDimensions;this.setDims(et*Lt,nt*mt),this.fixAndSetPosition()},undo:()=>{this.width=at,this.height=dt,this.x=st,this.y=tt;const[et,nt]=this.parentDimensions;this.setDims(et*at,nt*dt),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",xt),window.addEventListener("blur",xt)},G=new WeakSet,Tn=function(a,h){const[u,S]=this.parentDimensions,O=this.x,j=this.y,st=this.width,tt=this.height,at=s.MIN_SIZE/u,dt=s.MIN_SIZE/S,gt=_t=>Math.round(_t*1e4)/1e4,ct=q(this,$,$e).call(this,this.rotation),xt=(_t,vt)=>[ct[0]*_t+ct[2]*vt,ct[1]*_t+ct[3]*vt],Ot=q(this,$,$e).call(this,360-this.rotation),Et=(_t,vt)=>[Ot[0]*_t+Ot[2]*vt,Ot[1]*_t+Ot[3]*vt];let Lt,mt,et=!1,nt=!1;switch(a){case"topLeft":et=!0,Lt=(_t,vt)=>[0,0],mt=(_t,vt)=>[_t,vt];break;case"topMiddle":Lt=(_t,vt)=>[_t/2,0],mt=(_t,vt)=>[_t/2,vt];break;case"topRight":et=!0,Lt=(_t,vt)=>[_t,0],mt=(_t,vt)=>[0,vt];break;case"middleRight":nt=!0,Lt=(_t,vt)=>[_t,vt/2],mt=(_t,vt)=>[0,vt/2];break;case"bottomRight":et=!0,Lt=(_t,vt)=>[_t,vt],mt=(_t,vt)=>[0,0];break;case"bottomMiddle":Lt=(_t,vt)=>[_t/2,vt],mt=(_t,vt)=>[_t/2,0];break;case"bottomLeft":et=!0,Lt=(_t,vt)=>[0,vt],mt=(_t,vt)=>[_t,0];break;case"middleLeft":nt=!0,Lt=(_t,vt)=>[0,vt/2],mt=(_t,vt)=>[_t,vt/2];break}const pt=Lt(st,tt),wt=mt(st,tt);let Ct=xt(...wt);const jt=gt(O+Ct[0]),Vt=gt(j+Ct[1]);let Wt=1,zt=1,[Gt,Ht]=this.screenToPageTranslation(h.movementX,h.movementY);if([Gt,Ht]=Et(Gt/u,Ht/S),et){const _t=Math.hypot(st,tt);Wt=zt=Math.max(Math.min(Math.hypot(wt[0]-pt[0]-Gt,wt[1]-pt[1]-Ht)/_t,1/st,1/tt),at/st,dt/tt)}else nt?Wt=Math.max(at,Math.min(1,Math.abs(wt[0]-pt[0]-Gt)))/st:zt=Math.max(dt,Math.min(1,Math.abs(wt[1]-pt[1]-Ht)))/tt;const Xt=gt(st*Wt),ft=gt(tt*zt);Ct=xt(...mt(Xt,ft));const Z=jt-Ct[0],K=Vt-Ct[1];this.width=Xt,this.height=ft,this.x=Z,this.y=K,this.setDims(u*Xt,S*ft),this.fixAndSetPosition()},bt=new WeakSet,Ge=async function(){var u;const a=t(this,m);if(!a)return;if(!t(this,M)&&!t(this,C)){a.classList.remove("done"),(u=t(this,I))==null||u.remove();return}s._l10nPromise.get("editor_alt_text_edit_button_label").then(S=>{a.setAttribute("aria-label",S)});let h=t(this,I);if(!h){rt(this,I,h=document.createElement("span")),h.className="tooltip",h.setAttribute("role","tooltip");const S=h.id=`alt-text-tooltip-${this.id}`;a.setAttribute("aria-describedby",S);const O=100;a.addEventListener("mouseenter",()=>{rt(this,N,setTimeout(()=>{rt(this,N,null),t(this,I).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},O))}),a.addEventListener("mouseleave",()=>{var j;clearTimeout(t(this,N)),rt(this,N,null),(j=t(this,I))==null||j.classList.remove("show")})}a.classList.add("done"),h.innerText=t(this,C)?await s._l10nPromise.get("editor_alt_text_decorative_tooltip"):t(this,M),h.parentNode||a.append(h)}
1,Pt=new WeakSet,Pn=function(a){if(!this._isDraggable)return;const h=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let u,S;h&&(u={passive:!0,capture:!0},S=j=>{const[st,tt]=this.screenToPageTranslation(j.movementX,j.movementY);this._uiManager.dragSelectedEditors(st,tt)},window.addEventListener("pointermove",S,u));const O=()=>{if(window.removeEventListener("pointerup",O),window.removeEventListener("blur",O),h&&window.removeEventListener("pointermove",S,u),rt(this,_,!1),!this._uiManager.endDragSession()){const{isMac:j}=f.FeatureTest.platform;a.ctrlKey&&!j||a.shiftKey||a.metaKey&&j?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",O),window.addEventListener("blur",O)},W(s,k),ne(s,"_borderLineWidth",-1),ne(s,"_colorManager",new i.ColorManager),ne(s,"_zIndex",1),ne(s,"SMALL_EDITOR_SIZE",0);let H=s;n.AnnotationEditor=H;class ut extends H{constructor(a){super(a),this.annotationElementId=a.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(F,n,L)=>{var R,E,v,p,_,Ve,A,l,d,D,b,wn,g,$,V,T,Y,it,lt,G,ht,bt,St,Pt,x,s,o,a,h,u,S,O,j,st,tt,at,dt,gt,ct,xt,Ot,Et,Lt,mt,et,nt,pt,Cn,Ct,ze,Vt,Xe,zt,we,Ht,qe,ft,Ye,K,ae,vt,be,te,xn,Tt,Rn,Rt,Ke,Ut,ye,At,Je;Object.defineProperty(n,"__esModule",{value:!0}),n.KeyboardManager=n.CommandManager=n.ColorManager=n.AnnotationEditorUIManager=void 0,n.bindEvents=z,n.opacityToHex=H;var i=L(1),f=L(6);function z(B,e,y){for(const U of y)e.addEventListener(U,B[U].bind(B))}function H(B){return Math.round(Math.min(255,Math.max(1,255*B))).toString(16).padStart(2,"0")}class ut{constructor(){W(this,R,0)}getId(){return`${i.AnnotationEditorPrefix}${me(this,R)._++}`}}R=new WeakMap;const P=class P{constructor(){W(this,_);W(this,E,(0,i.getUuid)());W(this,v,0);W(this,p,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',U=new OffscreenCanvas(1,3).getContext("2d"),X=new Image;X.src=e;const J=X.decode().then(()=>(U.drawImage(X,0,0,1,1,0,0,1,3),new Uint32Array(U.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,i.shadow)(this,"_isSVGFittingCanvas",J)}async getFromFile(e){const{lastModified:y,name:U,size:X,type:J}=e;return q(this,_,Ve).call(this,`${y}_${U}_${X}_${J}`,e)}async getFromUrl(e){return q(this,_,Ve).call(this,e,e)}async getFromId(e){t(this,p)||rt(this,p,new Map);const y=t(this,p).get(e);return y?y.bitmap?(y.refCounter+=1,y):y.file?this.getFromFile(y.file):this.getFromUrl(y.url):null}getSvgUrl(e){const y=t(this,p).get(e);return y!=null&&y.isSvg?y.svgUrl:null}deleteId(e){t(this,p)||rt(this,p,new Map);const y=t(this,p).get(e);y&&(y.refCounter-=1,y.refCounter===0&&(y.bitmap=null))}isValidId(e){return e.startsWith(`image_${t(this,E)}_`)}};E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakSet,Ve=async function(e,y){t(this,p)||rt(this,p,new Map);let U=t(this,p).get(e);if(U===null)return null;if(U!=null&&U.bitmap)return U.refCounter+=1,U;try{U||(U={bitmap:null,id:`image_${t(this,E)}_${me(this,v)._++}`,refCounter:0,isSvg:!1});let X;if(typeof y=="string"){U.url=y;const J=await fetch(y);if(!J.ok)throw new Error(J.statusText);X=await J.blob()}else X=U.file=y;if(X.type==="image/svg+xml"){const J=P._isSVGFittingCanvas,ot=new FileReader,yt=new Image,Ft=new Promise((kt,qt)=>{yt.onload=()=>{U.bitmap=yt,U.isSvg=!0,kt()},ot.onload=async()=>{const Mt=U.svgUrl=ot.result;yt.src=await J?`${Mt}#svgView(preserveAspectRatio(none))`:Mt},yt.onerror=ot.onerror=qt});ot.readAsDataURL(X),await Ft}else U.bitmap=await createImageBitmap(X);U.refCounter=1}catch(X){console.error(X),U=null}return t(this,p).set(e,U),U&&t(this,p).set(U.id,U),U};let M=P;class C{constructor(e=128){W(this,A,[]);W(this,l,!1);W(this,d,void 0);W(this,D,-1);rt(this,d,e)}add({cmd:e,undo:y,mustExec:U,type:X=NaN,overwriteIfSameType:J=!1,keepUndo:ot=!1}){if(U&&e(),t(this,l))return;const yt={cmd:e,undo:y,type:X};if(t(this,D)===-1){t(this,A).length>0&&(t(this,A).length=0),rt(this,D,0),t(this,A).push(yt);return}if(J&&t(this,A)[t(this,D)].type===X){ot&&(yt.undo=t(this,A)[t(this,D)].undo),t(this,A)[t(this,D)]=yt;return}const Ft=t(this,D)+1;Ft===t(this,d)?t(this,A).splice(0,1):(rt(this,D,Ft),Ft<t(this,A).length&&t(this,A).splice(Ft)),t(this,A).push(yt)}undo(){t(this,D)!==-1&&(rt(this,l,!0),t(this,A)[t(this,D)].undo(),rt(this,l,!1),rt(this,D,t(this,D)-1))}redo(){t(this,D)<t(this,A).length-1&&(rt(this,D,t(this,D)+1),rt(this,l,!0),t(this,A)[t(this,D)].cmd(),rt(this,l,!1))}hasSomethingToUndo(){return t(this,D)!==-1}hasSomethingToRedo(){return t(this,D)<t(this,A).length-1}destroy(){rt(this,A,null)}}
1A=new WeakMap,l=new WeakMap,d=new WeakMap,D=new WeakMap,n.CommandManager=C;class m{constructor(e){W(this,b);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:y}=i.FeatureTest.platform;for(const[U,X,J={}]of e)for(const ot of U){const yt=ot.startsWith("mac+");y&&yt?(this.callbacks.set(ot.slice(4),{callback:X,options:J}),this.allKeys.add(ot.split("+").at(-1))):!y&&!yt&&(this.callbacks.set(ot,{callback:X,options:J}),this.allKeys.add(ot.split("+").at(-1)))}}exec(e,y){if(!this.allKeys.has(y.key))return;const U=this.callbacks.get(q(this,b,wn).call(this,y));if(!U)return;const{callback:X,options:{bubbles:J=!1,args:ot=[],checker:yt=null}}=U;yt&&!yt(e,y)||(X.bind(e,...ot)(),J||(y.stopPropagation(),y.preventDefault()))}}b=new WeakSet,wn=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const y=this.buffer.join("+");return this.buffer.length=0,y},n.KeyboardManager=m;const k=class k{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,f.getColorValues)(e),(0,i.shadow)(this,"_colors",e)}convert(e){const y=(0,f.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return y;for(const[U,X]of this._colors)if(X.every((J,ot)=>J===y[ot]))return k._colorsMapping.get(U);return y}getHexCode(e){const y=this._colors.get(e);return y?i.Util.makeHexColor(...y):e}};ne(k,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let I=k;n.ColorManager=I;const It=class It{constructor(e,y,U,X,J,ot){W(this,pt);W(this,Ct);W(this,Vt);W(this,zt);W(this,Ht);W(this,ft);W(this,K);W(this,vt);W(this,te);W(this,Tt);W(this,Rt);W(this,Ut);W(this,At);W(this,g,null);W(this,$,new Map);W(this,V,new Map);W(this,T,null);W(this,Y,null);W(this,it,new C);W(this,lt,0);W(this,G,new Set);W(this,ht,null);W(this,bt,null);W(this,St,new Set);W(this,Pt,null);W(this,x,new ut);W(this,s,!1);W(this,o,!1);W(this,a,null);W(this,h,i.AnnotationEditorType.NONE);W(this,u,new Set);W(this,S,null);W(this,O,this.blur.bind(this));W(this,j,this.focus.bind(this));W(this,st,this.copy.bind(this));W(this,tt,this.cut.bind(this));W(this,at,this.paste.bind(this));W(this,dt,this.keydown.bind(this));W(this,gt,this.onEditingAction.bind(this));W(this,ct,this.onPageChanging.bind(this));W(this,xt,this.onScaleChanging.bind(this));W(this,Ot,this.onRotationChanging.bind(this));W(this,Et,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});W(this,Lt,[0,0]);W(this,mt,null);W(this,et,null);W(this,nt,null);rt(this,et,e),rt(this,nt,y),rt(this,T,U),this._eventBus=X,this._eventBus._on("editingaction",t(this,gt)),this._eventBus._on("pagechanging",t(this,ct)),this._eventBus._on("scalechanging",t(this,xt)),this._eventBus._on("rotationchanging",t(this,Ot)),rt(this,Y,J.annotationStorage),rt(this,Pt,J.filterFactory),rt(this,S,ot),this.viewParameters={realScale:f.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const e=It.prototype,y=J=>{const{activeElement:ot}=document;return ot&&t(J,et).contains(ot)&&J.hasSomethingToControl()},U=this.TRANSLATE_SMALL,X=this.TRANSLATE_BIG;return(0,i.shadow)(this,"_keyboardManager",new m([[["ctrl+a","mac+meta+a"],e.selectAll],[["ctrl+z","mac+meta+z"],e.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-U,0],checker:y}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-X,0],checker:y}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[U,0],checker:y}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[X,0],checker:y}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-U],checker:y}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-X],checker:y}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,U],checker:y}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,X],checker:y}]]))}destroy(){q(this,zt,we).call(this),q(this,Ct,ze).call(this),this._eventBus._off("editingaction",t(this,gt)),this._eventBus._off("pagechanging",t(this,ct)),this._eventBus._off("scalechanging",t(this,xt)),this._eventBus._off("rotationchanging",t(this,Ot));for(const e of t(this,V).values())e.destroy();
1t(this,V).clear(),t(this,$).clear(),t(this,St).clear(),rt(this,g,null),t(this,u).clear(),t(this,it).destroy(),t(this,T).destroy()}get hcmFilter(){return(0,i.shadow)(this,"hcmFilter",t(this,S)?t(this,Pt).addHCMFilter(t(this,S).foreground,t(this,S).background):"none")}get direction(){return(0,i.shadow)(this,"direction",getComputedStyle(t(this,et)).direction)}editAltText(e){var y;(y=t(this,T))==null||y.editAltText(this,e)}onPageChanging({pageNumber:e}){rt(this,lt,e-1)}focusMainContainer(){t(this,et).focus()}findParent(e,y){for(const U of t(this,V).values()){const{x:X,y:J,width:ot,height:yt}=U.div.getBoundingClientRect();if(e>=X&&e<=X+ot&&y>=J&&y<=J+yt)return U}return null}disableUserSelect(e=!1){t(this,nt).classList.toggle("noUserSelect",e)}addShouldRescale(e){t(this,St).add(e)}removeShouldRescale(e){t(this,St).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*f.PixelsPerInch.PDF_TO_CSS_UNITS;for(const y of t(this,St))y.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(e){!e.isEmpty()&&t(this,Y)&&!t(this,Y).has(e.id)&&t(this,Y).setValue(e.id,e)}blur(){if(!this.hasSelection)return;const{activeElement:e}=document;for(const y of t(this,u))if(y.div.contains(e)){rt(this,a,[y,e]),y._focusEventsAllowed=!1;break}}focus(){if(!t(this,a))return;const[e,y]=t(this,a);rt(this,a,null),y.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),y.focus()}addEditListeners(){q(this,Vt,Xe).call(this),q(this,Ht,qe).call(this)}removeEditListeners(){q(this,zt,we).call(this),q(this,ft,Ye).call(this)}copy(e){var U;if(e.preventDefault(),(U=t(this,g))==null||U.commitOrRemove(),!this.hasSelection)return;const y=[];for(const X of t(this,u)){const J=X.serialize(!0);J&&y.push(J)}y.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(y))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:y}=e;for(const J of y.items)for(const ot of t(this,bt))if(ot.isHandlingMimeForPasting(J.type)){ot.paste(J,this.currentLayer);return}let U=y.getData("application/pdfjs");if(!U)return;try{U=JSON.parse(U)}catch(J){(0,i.warn)(`paste: "${J.message}".`);return}if(!Array.isArray(U))return;this.unselectAll();const X=this.currentLayer;try{const J=[];for(const Ft of U){const kt=X.deserialize(Ft);if(!kt)return;J.push(kt)}const ot=()=>{for(const Ft of J)q(this,Rt,Ke).call(this,Ft);q(this,At,Je).call(this,J)},yt=()=>{for(const Ft of J)Ft.remove()};this.addCommands({cmd:ot,undo:yt,mustExec:!0})}catch(J){(0,i.warn)(`paste: "${J.message}".`)}}keydown(e){var y;(y=this.getActive())!=null&&y.shouldGetKeyboardEvents()||It._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}setEditingState(e){e?(q(this,pt,Cn).call(this),q(this,Vt,Xe).call(this),q(this,Ht,qe).call(this),q(this,K,ae).call(this,{isEditing:t(this,h)!==i.AnnotationEditorType.NONE,isEmpty:q(this,Ut,ye).call(this),hasSomethingToUndo:t(this,it).hasSomethingToUndo(),hasSomethingToRedo:t(this,it).hasSomethingToRedo(),hasSelectedEditor:!1})):(q(this,Ct,ze).call(this),q(this,zt,we).call(this),q(this,ft,Ye).call(this),q(this,K,ae).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!t(this,bt)){rt(this,bt,e);for(const y of t(this,bt))q(this,vt,be).call(this,y.defaultPropertiesToUpdate)}}getId(){return t(this,x).getId()}get currentLayer(){return t(this,V).get(t(this,lt))}getLayer(e){return t(this,V).get(e)}get currentPageIndex(){return t(this,lt)}addLayer(e){t(this,V).set(e.pageIndex,e),t(this,s)?e.enable():e.disable()}removeLayer(e){t(this,V).delete(e.pageIndex)}updateMode(e,y=null){if(t(this,h)!==e){if(rt(this,h,e),e===i.AnnotationEditorType.NONE){this.setEditingState(!1),q(this,Tt,Rn).call(this);return}this.setEditingState(!0),q(this,te,xn).call(this),this.unselectAll();for(const U of t(this,V).values())U.updateMode(e);if(y){for(const U of t(this,$).values())if(U.annotationElementId===y){this.setSelected(U),U.enterInEditMode();break}}}}updateToolbar(e){e!==t(this,h)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,y){if(t(this,bt)){if(e===i.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(e);return}for(const U of t(this,u))U.updateParams(e,y);for(const U of t(this,bt))U.updateDefaultParams(e,y)}}enableWaiting(e=!1){if(t(this,o)!==e){rt(this,o,e);for(const y of t(this,V).values())e?y.disableClick():y.enableClick(),y.div.classList.toggle("waiting",e)}}getEditors(e){const y=[];for(const U of t(this,$).values())U.pageIndex===e&&y.push(U);return y}getEditor(e){return t(this,$).get(e)}addEditor(e){t(this,$).set(e.id,e)}removeEditor(e){var y;t(this,$).delete(e.id),this.unselect(e),(!e.annotationElementId||!t(this,G).has(e.annotationElementId))&&((y=t(this,Y))==null||y.remove(e.id))}addDeletedAnnotationElement(e){t(this,G).add(e.annotationElementId),e.deleted=!0}
1isDeletedAnnotationElement(e){return t(this,G).has(e)}removeDeletedAnnotationElement(e){t(this,G).delete(e.annotationElementId),e.deleted=!1}setActiveEditor(e){t(this,g)!==e&&(rt(this,g,e),e&&q(this,vt,be).call(this,e.propertiesToUpdate))}toggleSelected(e){if(t(this,u).has(e)){t(this,u).delete(e),e.unselect(),q(this,K,ae).call(this,{hasSelectedEditor:this.hasSelection});return}t(this,u).add(e),e.select(),q(this,vt,be).call(this,e.propertiesToUpdate),q(this,K,ae).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const y of t(this,u))y!==e&&y.unselect();t(this,u).clear(),t(this,u).add(e),e.select(),q(this,vt,be).call(this,e.propertiesToUpdate),q(this,K,ae).call(this,{hasSelectedEditor:!0})}isSelected(e){return t(this,u).has(e)}unselect(e){e.unselect(),t(this,u).delete(e),q(this,K,ae).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return t(this,u).size!==0}undo(){t(this,it).undo(),q(this,K,ae).call(this,{hasSomethingToUndo:t(this,it).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:q(this,Ut,ye).call(this)})}redo(){t(this,it).redo(),q(this,K,ae).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:t(this,it).hasSomethingToRedo(),isEmpty:q(this,Ut,ye).call(this)})}addCommands(e){t(this,it).add(e),q(this,K,ae).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:q(this,Ut,ye).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...t(this,u)],y=()=>{for(const X of e)X.remove()},U=()=>{for(const X of e)q(this,Rt,Ke).call(this,X)};this.addCommands({cmd:y,undo:U,mustExec:!0})}commitOrRemove(){var e;(e=t(this,g))==null||e.commitOrRemove()}hasSomethingToControl(){return t(this,g)||this.hasSelection}selectAll(){for(const e of t(this,u))e.commit();q(this,At,Je).call(this,t(this,$).values())}unselectAll(){if(t(this,g)){t(this,g).commitOrRemove();return}if(this.hasSelection){for(const e of t(this,u))e.unselect();t(this,u).clear(),q(this,K,ae).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,y,U=!1){if(U||this.commitOrRemove(),!this.hasSelection)return;t(this,Lt)[0]+=e,t(this,Lt)[1]+=y;const[X,J]=t(this,Lt),ot=[...t(this,u)],yt=1e3;t(this,mt)&&clearTimeout(t(this,mt)),rt(this,mt,setTimeout(()=>{rt(this,mt,null),t(this,Lt)[0]=t(this,Lt)[1]=0,this.addCommands({cmd:()=>{for(const Ft of ot)t(this,$).has(Ft.id)&&Ft.translateInPage(X,J)},undo:()=>{for(const Ft of ot)t(this,$).has(Ft.id)&&Ft.translateInPage(-X,-J)},mustExec:!1})},yt));for(const Ft of ot)Ft.translateInPage(e,y)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),rt(this,ht,new Map);for(const e of t(this,u))t(this,ht).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!t(this,ht))return!1;this.disableUserSelect(!1);const e=t(this,ht);rt(this,ht,null);let y=!1;for(const[{x:X,y:J,pageIndex:ot},yt]of e)yt.newX=X,yt.newY=J,yt.newPageIndex=ot,y||(y=X!==yt.savedX||J!==yt.savedY||ot!==yt.savedPageIndex);if(!y)return!1;const U=(X,J,ot,yt)=>{if(t(this,$).has(X.id)){const Ft=t(this,V).get(yt);Ft?X._setParentAndPosition(Ft,J,ot):(X.pageIndex=yt,X.x=J,X.y=ot)}};return this.addCommands({cmd:()=>{for(const[X,{newX:J,newY:ot,newPageIndex:yt}]of e)U(X,J,ot,yt)},undo:()=>{for(const[X,{savedX:J,savedY:ot,savedPageIndex:yt}]of e)U(X,J,ot,yt)},mustExec:!0}),!0}dragSelectedEditors(e,y){if(t(this,ht))for(const U of t(this,ht).keys())U.drag(e,y)}rebuild(e){if(e.parent===null){const y=this.getLayer(e.pageIndex);y?(y.changeParent(e),y.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}isActive(e){return t(this,g)===e}getActive(){return t(this,g)}getMode(){return t(this,h)}get imageManager(){return(0,i.shadow)(this,"imageManager",new M)}};g=new WeakMap,$=new WeakMap,V=new WeakMap,T=new WeakMap,Y=new WeakMap,it=new WeakMap,lt=new WeakMap,G=new WeakMap,ht=new WeakMap,bt=new WeakMap,St=new WeakMap,Pt=new WeakMap,x=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakMap,S=new WeakMap,O=new WeakMap,j=new WeakMap,st=new WeakMap,tt=new WeakMap,at=new WeakMap,dt=new WeakMap,gt=new WeakMap,ct=new WeakMap,xt=new WeakMap,Ot=new WeakMap,Et=new WeakMap,Lt=new WeakMap,mt=new WeakMap,et=new WeakMap,nt=new WeakMap,pt=new WeakSet,Cn=function(){window.addEventListener("focus",t(this,j)),window.addEventListener("blur",t(this,O))},Ct=new WeakSet,ze=function(){window.removeEventListener("focus",t(this,j)),window.removeEventListener("blur",t(this,O))},Vt=new WeakSet,Xe=function(){window.addEventListener("keydown",t(this,dt),{capture:!0})},zt=new WeakSet,we=function(){window.removeEventListener("keydown",t(this,dt),{capture:!0})},Ht=new WeakSet,qe=function(){document.addEventListener("copy",t(this,st)),document.addEventListener("cut",t(this,tt)),document.addEventListener("paste",t(this,at))},ft=new WeakSet,Ye=function(){document.removeEventListener("copy",t(this,st)),document.removeEventListener("cut",t(this,tt)),document.removeEventListener("paste",t(this,at))},K=new WeakSet,ae=function(e){Object.entries(e).some(([U,X])=>t(this,Et)[U]!==X)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(t(this,Et),e)})},vt=new WeakSet,be=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},te=new WeakSet,xn=function(){if(!t(this,s)){rt(this,s,!0);for(const e of t(this,V).values())e.enable()}},Tt=new WeakSet,Rn=function(){if(this.unselectAll(),t(this,s)){rt(this,s,!1);for(const e of t(this,V).values())e.disable()}},Rt=new WeakSet,Ke=function(e){const y=t(this,V).get(e.pageIndex);y?y.addOrRebuild(e):this.addEditor(e)},Ut=new WeakSet,ye=function(){if(t(this,$).size===0)return!0;
1if(t(this,$).size===1)for(const e of t(this,$).values())return e.isEmpty();return!1},At=new WeakSet,Je=function(e){t(this,u).clear();for(const y of e)y.isEmpty()||(t(this,u).add(y),y.select());q(this,K,ae).call(this,{hasSelectedEditor:!0})},ne(It,"TRANSLATE_SMALL",1),ne(It,"TRANSLATE_BIG",10);let N=It;n.AnnotationEditorUIManager=N},(F,n,L)=>{var lt,G,ht,bt,St,Pt,x,s,o,a,h,u,ue,O,fe,st,Qe,at,Ce,gt,xe,xt,_e,Et,Ae;Object.defineProperty(n,"__esModule",{value:!0}),n.StatTimer=n.RenderingCancelledException=n.PixelsPerInch=n.PageViewport=n.PDFDateString=n.DOMStandardFontDataFactory=n.DOMSVGFactory=n.DOMFilterFactory=n.DOMCanvasFactory=n.DOMCMapReaderFactory=void 0,n.deprecated=D,n.getColorValues=$,n.getCurrentTransform=V,n.getCurrentTransformInverse=T,n.getFilenameFromUrl=_,n.getPdfFilenameFromUrl=w,n.getRGB=g,n.getXfaPageViewport=k,n.isDataScheme=v,n.isPdfFile=p,n.isValidFetchUrl=A,n.loadScript=d,n.noContextMenu=l,n.setLayerDimensions=Y;var i=L(7),f=L(1);const z="http://www.w3.org/2000/svg",it=class it{};ne(it,"CSS",96),ne(it,"PDF",72),ne(it,"PDF_TO_CSS_UNITS",it.CSS/it.PDF);let H=it;n.PixelsPerInch=H;class ut extends i.BaseFilterFactory{constructor({docId:nt,ownerDocument:pt=globalThis.document}={}){super();W(this,u);W(this,O);W(this,st);W(this,at);W(this,gt);W(this,xt);W(this,Et);W(this,lt,void 0);W(this,G,void 0);W(this,ht,void 0);W(this,bt,void 0);W(this,St,void 0);W(this,Pt,void 0);W(this,x,void 0);W(this,s,void 0);W(this,o,void 0);W(this,a,void 0);W(this,h,0);rt(this,ht,nt),rt(this,bt,pt)}addFilter(nt){if(!nt)return"none";let pt=t(this,u,ue).get(nt);if(pt)return pt;let wt,Ct,jt,Vt;if(nt.length===1){const Ht=nt[0],Xt=new Array(256);for(let ft=0;ft<256;ft++)Xt[ft]=Ht[ft]/255;Vt=wt=Ct=jt=Xt.join(",")}else{const[Ht,Xt,ft]=nt,Z=new Array(256),K=new Array(256),_t=new Array(256);for(let vt=0;vt<256;vt++)Z[vt]=Ht[vt]/255,K[vt]=Xt[vt]/255,_t[vt]=ft[vt]/255;wt=Z.join(","),Ct=K.join(","),jt=_t.join(","),Vt=`${wt}${Ct}${jt}`}if(pt=t(this,u,ue).get(Vt),pt)return t(this,u,ue).set(nt,pt),pt;const Wt=`g_${t(this,ht)}_transfer_map_${me(this,h)._++}`,zt=`url(#${Wt})`;t(this,u,ue).set(nt,zt),t(this,u,ue).set(Vt,zt);const Gt=q(this,at,Ce).call(this,Wt);return q(this,xt,_e).call(this,wt,Ct,jt,Gt),zt}addHCMFilter(nt,pt){var Xt;const wt=`${nt}-${pt}`;if(t(this,Pt)===wt)return t(this,x);if(rt(this,Pt,wt),rt(this,x,"none"),(Xt=t(this,St))==null||Xt.remove(),!nt||!pt)return t(this,x);const Ct=q(this,Et,Ae).call(this,nt);nt=f.Util.makeHexColor(...Ct);const jt=q(this,Et,Ae).call(this,pt);if(pt=f.Util.makeHexColor(...jt),t(this,O,fe).style.color="",nt==="#000000"&&pt==="#ffffff"||nt===pt)return t(this,x);const Vt=new Array(256);for(let ft=0;ft<=255;ft++){const Z=ft/255;Vt[ft]=Z<=.03928?Z/12.92:((Z+.055)/1.055)**2.4}const Wt=Vt.join(","),zt=`g_${t(this,ht)}_hcm_filter`,Gt=rt(this,s,q(this,at,Ce).call(this,zt));q(this,xt,_e).call(this,Wt,Wt,Wt,Gt),q(this,st,Qe).call(this,Gt);const Ht=(ft,Z)=>{const K=Ct[ft]/255,_t=jt[ft]/255,vt=new Array(Z+1);for(let ee=0;ee<=Z;ee++)vt[ee]=K+ee/Z*(_t-K);return vt.join(",")};return q(this,xt,_e).call(this,Ht(0,5),Ht(1,5),Ht(2,5),Gt),rt(this,x,`url(#${zt})`),t(this,x)}addHighlightHCMFilter(nt,pt,wt,Ct){var _t;const jt=`${nt}-${pt}-${wt}-${Ct}`;if(t(this,o)===jt)return t(this,a);if(rt(this,o,jt),rt(this,a,"none"),(_t=t(this,s))==null||_t.remove(),!nt||!pt)return t(this,a);const[Vt,Wt]=[nt,pt].map(q(this,Et,Ae).bind(this));let zt=Math.round(.2126*Vt[0]+.7152*Vt[1]+.0722*Vt[2]),Gt=Math.round(.2126*Wt[0]+.7152*Wt[1]+.
10722*Wt[2]),[Ht,Xt]=[wt,Ct].map(q(this,Et,Ae).bind(this));Gt<zt&&([zt,Gt,Ht,Xt]=[Gt,zt,Xt,Ht]),t(this,O,fe).style.color="";const ft=(vt,ee,te)=>{const Q=new Array(256),Tt=(Gt-zt)/te,Nt=vt/255,Rt=(ee-vt)/(255*te);let Bt=0;for(let Ut=0;Ut<=te;Ut++){const Qt=Math.round(zt+Ut*Tt),At=Nt+Ut*Rt;for(let Kt=Bt;Kt<=Qt;Kt++)Q[Kt]=At;Bt=Qt+1}for(let Ut=Bt;Ut<256;Ut++)Q[Ut]=Q[Bt-1];return Q.join(",")},Z=`g_${t(this,ht)}_hcm_highlight_filter`,K=rt(this,s,q(this,at,Ce).call(this,Z));return q(this,st,Qe).call(this,K),q(this,xt,_e).call(this,ft(Ht[0],Xt[0],5),ft(Ht[1],Xt[1],5),ft(Ht[2],Xt[2],5),K),rt(this,a,`url(#${Z})`),t(this,a)}destroy(nt=!1){nt&&(t(this,x)||t(this,a))||(t(this,G)&&(t(this,G).parentNode.parentNode.remove(),rt(this,G,null)),t(this,lt)&&(t(this,lt).clear(),rt(this,lt,null)),rt(this,h,0))}}lt=new WeakMap,G=new WeakMap,ht=new WeakMap,bt=new WeakMap,St=new WeakMap,Pt=new WeakMap,x=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,u=new WeakSet,ue=function(){return t(this,lt)||rt(this,lt,new Map)},O=new WeakSet,fe=function(){if(!t(this,G)){const nt=t(this,bt).createElement("div"),{style:pt}=nt;pt.visibility="hidden",pt.contain="strict",pt.width=pt.height=0,pt.position="absolute",pt.top=pt.left=0,pt.zIndex=-1;const wt=t(this,bt).createElementNS(z,"svg");wt.setAttribute("width",0),wt.setAttribute("height",0),rt(this,G,t(this,bt).createElementNS(z,"defs")),nt.append(wt),wt.append(t(this,G)),t(this,bt).body.append(nt)}return t(this,G)},st=new WeakSet,Qe=function(nt){const pt=t(this,bt).createElementNS(z,"feColorMatrix");pt.setAttribute("type","matrix"),pt.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"),nt.append(pt)},at=new WeakSet,Ce=function(nt){const pt=t(this,bt).createElementNS(z,"filter");return pt.setAttribute("color-interpolation-filters","sRGB"),pt.setAttribute("id",nt),t(this,O,fe).append(pt),pt},gt=new WeakSet,xe=function(nt,pt,wt){const Ct=t(this,bt).createElementNS(z,pt);Ct.setAttribute("type","discrete"),Ct.setAttribute("tableValues",wt),nt.append(Ct)},xt=new WeakSet,_e=function(nt,pt,wt,Ct){const jt=t(this,bt).createElementNS(z,"feComponentTransfer");Ct.append(jt),q(this,gt,xe).call(this,jt,"feFuncR",nt),q(this,gt,xe).call(this,jt,"feFuncG",pt),q(this,gt,xe).call(this,jt,"feFuncB",wt)},Et=new WeakSet,Ae=function(nt){return t(this,O,fe).style.color=nt,g(getComputedStyle(t(this,O,fe)).getPropertyValue("color"))},n.DOMFilterFactory=ut;class M extends i.BaseCanvasFactory{constructor({ownerDocument:et=globalThis.document}={}){super(),this._document=et}_createCanvas(et,nt){const pt=this._document.createElement("canvas");return pt.width=et,pt.height=nt,pt}}n.DOMCanvasFactory=M;async function C(mt,et=!1){if(A(mt,document.baseURI)){const nt=await fetch(mt);if(!nt.ok)throw new Error(nt.statusText);return et?new Uint8Array(await nt.arrayBuffer()):(0,f.stringToBytes)(await nt.text())}return new Promise((nt,pt)=>{const wt=new XMLHttpRequest;wt.open("GET",mt,!0),et&&(wt.responseType="arraybuffer"),wt.onreadystatechange=()=>{if(wt.readyState===XMLHttpRequest.DONE){if(wt.status===200||wt.status===0){let Ct;if(et&&wt.response?Ct=new Uint8Array(wt.response):!et&&wt.responseText&&(Ct=(0,f.stringToBytes)(wt.responseText)),Ct){nt(Ct);return}}pt(new Error(wt.statusText))}},wt.send(null)})}class m extends i.BaseCMapReaderFactory{_fetchData(et,nt){return C(et,this.isCompressed).then(pt=>({cMapData:pt,compressionType:nt}))}}n.DOMCMapReaderFactory=m;class I extends i.BaseStandardFontDataFactory{_fetchData(et){return C(et,!0)}}n.DOMStandardFontDataFactory=I;class N extends i.BaseSVGFactory{_createSVG(et){return document.createElementNS(z,et)}}n.DOMSVGFactory=N;class R{constructor({viewBox:et,scale:nt,rotation:pt,offsetX:wt=0,offsetY:Ct=0,dontFlip:jt=!1}){this.viewBox=et,this.scale=nt,this.rotation=pt,this.offsetX=wt,this.offsetY=Ct;const Vt=(et[2]+et[0])/2,Wt=(et[3]+et[1])/2;let zt,Gt,Ht,Xt;switch(pt%=360,pt<0&&(pt+=360),pt){case 180:zt=-1,Gt=0,Ht=0,Xt=1;break;case 90:zt=0,Gt=1,Ht=1,Xt=0;break;case 270:zt=0,Gt=-1,Ht=-1,Xt=0;break;case 0:zt=1,Gt=0,Ht=0,Xt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}jt&&(Ht=-Ht,Xt=-Xt);let ft,Z,K,_t;zt===0?(ft=Math.abs(Wt-et[1])*nt+wt,Z=Math.abs(Vt-et[0])*nt+Ct,K=(et[3]-et[1])*nt,_t=(et[2]-et[0])*nt):(ft=Math.abs(Vt-et[0])*nt+wt,Z=Math.abs(Wt-et[1])*nt+Ct,K=(et[2]-et[0])*nt,_t=(et[3]-et[1])*nt),this.transform=[zt*nt,Gt*nt,Ht*nt,Xt*nt,ft-zt*nt*Vt-Ht*nt*Wt,Z-Gt*nt*Vt-Xt*nt*Wt],this.width=K,this.height=_t}get rawDims(){const{viewBox:et}=this;return(0,f.shadow)(this,"rawDims",{pageWidth:et[2]-et[0],pageHeight:et[3]-et[1],pageX:et[0],pageY:et[1]})}clone({scale:et=this.scale,rotation:nt=this.rotation,offsetX:pt=this.offsetX,offsetY:wt=this.offsetY,dontFlip:Ct=!1}={}){return new R({viewBox:this.viewBox.slice(),scale:et,rotation:nt,offsetX:pt,offsetY:wt,dontFlip:Ct})}convertToViewportPoint(et,nt){return f.Util.applyTransform([et,nt],this.transform)}convertToViewportRectangle(et){const nt=f.Util.applyTransform([et[0],et[1]],this.transform),pt=f.Util.applyTransform([et[2],et[3]],this.transform);return[nt[0],nt[1],pt[0],pt[1]]}convertToPdfPoint(et,nt){return f.Util.applyInverseTransform([et,nt],this.transform)}}n.PageViewport=R;class E extends f.BaseException{constructor(et,nt=0){super(et,"RenderingCancelledException"),this.extraDelay=nt}}n.RenderingCancelledException=E;function v(mt){const et=mt.length;let nt=0;for(;nt<et&&mt[nt].trim()==="";)nt++;return mt.substring(nt,nt+5).toLowerCase()==="data:"}function p(mt){return typeof mt=="string"&&/\.pdf$/i.test(mt)}function _(mt,et=!1){return et||([mt]=mt.split(/[#?]/,1)),mt.substring(mt.lastIndexOf("/")+1)}function w(mt,et="document.pdf"){if(typeof mt!="string")return et;if(v(mt))return(0,f.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),et;const nt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,pt=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,wt=nt.exec(mt);let Ct=pt.exec(wt[1])||pt.exec(wt[2])||pt.exec(wt[3]);if(Ct&&(Ct=Ct[0],Ct.includes("%")))try{Ct=pt.exec(decodeURIComponent(Ct))[0]}catch{}return Ct||et}class P{constructor(){ne(this,"started",Object.create(null));ne(this,"times",[])}time(et){et in this.started&&(0,f.warn)(`Timer is already running for ${et}`),this.started[et]=Date.now()}timeEnd(et){et in this.started||(0,f.warn)(`Timer has not been started for ${et}`),this.times.push({name:et,start:this.started[et],end:Date.now()}),delete this.started[et]}toString(){const et=[];let nt=0;for(const{name:pt}of this.times)nt=Math.max(pt.length,nt);for(const{name:pt,start:wt,end:Ct}of this.times)et.push(`${pt.padEnd(nt)} ${Ct-wt}ms 2`);return et.join("")}}n.StatTimer=P;function A(mt,et){try{const{protocol:nt}=et?new URL(mt,et):new URL(mt);return nt==="http:"||nt==="https:"}catch{return!1}}function l(mt){mt.preventDefault()}function d(mt,et=!1){return new Promise((nt,pt)=>{const wt=document.createElement("script");wt.src=mt,wt.onload=function(Ct){et&&wt.remove(),nt(Ct)},wt.onerror=function(){pt(new Error(`Cannot load script at: ${wt.src}`))},(document.head||document.documentElement).append(wt)})}function D(mt){console.log("Deprecated API usage: "+mt)}let b;class c{static toDateObject(et){if(!et||typeof et!="string")return null;b||(b=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const nt=b.exec(et);if(!nt)return null;const pt=parseInt(nt[1],10);let wt=parseInt(nt[2],10);wt=wt>=1&&wt<=12?wt-1:0;let Ct=parseInt(nt[3],10);Ct=Ct>=1&&Ct<=31?Ct:1;let jt=parseInt(nt[4],10);jt=jt>=0&&jt<=23?jt:0;let Vt=parseInt(nt[5],10);Vt=Vt>=0&&Vt<=59?Vt:0;let Wt=parseInt(nt[6],10);Wt=Wt>=0&&Wt<=59?Wt:0;
2const zt=nt[7]||"Z";let Gt=parseInt(nt[8],10);Gt=Gt>=0&&Gt<=23?Gt:0;let Ht=parseInt(nt[9],10)||0;return Ht=Ht>=0&&Ht<=59?Ht:0,zt==="-"?(jt+=Gt,Vt+=Ht):zt==="+"&&(jt-=Gt,Vt-=Ht),new Date(Date.UTC(pt,wt,Ct,jt,Vt,Wt))}}n.PDFDateString=c;function k(mt,{scale:et=1,rotation:nt=0}){const{width:pt,height:wt}=mt.attributes.style,Ct=[0,0,parseInt(pt),parseInt(wt)];return new R({viewBox:Ct,scale:et,rotation:nt})}function g(mt){if(mt.startsWith("#")){const et=parseInt(mt.slice(1),16);return[(et&16711680)>>16,(et&65280)>>8,et&255]}return mt.startsWith("rgb(")?mt.slice(4,-1).split(",").map(et=>parseInt(et)):mt.startsWith("rgba(")?mt.slice(5,-1).split(",").map(et=>parseInt(et)).slice(0,3):((0,f.warn)(`Not a valid color format: "${mt}"`),[0,0,0])}function $(mt){const et=document.createElement("span");et.style.visibility="hidden",document.body.append(et);for(const nt of mt.keys()){et.style.color=nt;const pt=window.getComputedStyle(et).color;mt.set(nt,g(pt))}et.remove()}function V(mt){const{a:et,b:nt,c:pt,d:wt,e:Ct,f:jt}=mt.getTransform();return[et,nt,pt,wt,Ct,jt]}function T(mt){const{a:et,b:nt,c:pt,d:wt,e:Ct,f:jt}=mt.getTransform().invertSelf();return[et,nt,pt,wt,Ct,jt]}function Y(mt,et,nt=!1,pt=!0){if(et instanceof R){const{pageWidth:wt,pageHeight:Ct}=et.rawDims,{style:jt}=mt,Vt=f.FeatureTest.isCSSRoundSupported,Wt=`var(--scale-factor) * ${wt}px`,zt=`var(--scale-factor) * ${Ct}px`,Gt=Vt?`round(${Wt}, 1px)`:`calc(${Wt})`,Ht=Vt?`round(${zt}, 1px)`:`calc(${zt})`;!nt||et.rotation%180===0?(jt.width=Gt,jt.height=Ht):(jt.width=Ht,jt.height=Gt)}pt&&mt.setAttribute("data-main-rotation",et.rotation)}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseStandardFontDataFactory=n.BaseSVGFactory=n.BaseFilterFactory=n.BaseCanvasFactory=n.BaseCMapReaderFactory=void 0;var i=L(1);class f{constructor(){this.constructor===f&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(m){return"none"}addHCMFilter(m,I){return"none"}addHighlightHCMFilter(m,I,N,R){return"none"}destroy(m=!1){}}n.BaseFilterFactory=f;class z{constructor(){this.constructor===z&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(m,I){if(m<=0||I<=0)throw new Error("Invalid canvas size");const N=this._createCanvas(m,I);return{canvas:N,context:N.getContext("2d")}}reset(m,I,N){if(!m.canvas)throw new Error("Canvas is not specified");if(I<=0||N<=0)throw new Error("Invalid canvas size");m.canvas.width=I,m.canvas.height=N}destroy(m){if(!m.canvas)throw new Error("Canvas is not specified");m.canvas.width=0,m.canvas.height=0,m.canvas=null,m.context=null}_createCanvas(m,I){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}n.BaseCanvasFactory=z;class H{constructor({baseUrl:m=null,isCompressed:I=!0}){this.constructor===H&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=m,this.isCompressed=I}async fetch({name:m}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!m)throw new Error("CMap name must be specified.");const I=this.baseUrl+m+(this.isCompressed?".bcmap":""),N=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(I,N).catch(R=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${I}`)})}_fetchData(m,I){(0,i.unreachable)("Abstract method `_fetchData` called.")}}n.BaseCMapReaderFactory=H;class ut{constructor({baseUrl:m=null}){this.constructor===ut&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=m}async fetch({filename:m}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!m)throw new Error("Font filename must be specified.");const I=`${this.baseUrl}${m}`;return this._fetchData(I).catch(N=>{throw new Error(`Unable to load font data at: ${I}`)})}_fetchData(m){(0,i.unreachable)("Abstract method `_fetchData` called.")}}n.BaseStandardFontDataFactory=ut;class M{constructor(){this.constructor===M&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(m,I,N=!1){if(m<=0||I<=0)throw new Error("Invalid SVG dimensions");const R=this._createSVG("svg:svg");return R.setAttribute("version","1.1"),N||(R.setAttribute("width",`${m}px`),R.setAttribute("height",`${I}px`)),R.setAttribute("preserveAspectRatio","none"),R.setAttribute("viewBox",`0 0 ${m} ${I}`),R}createElement(m){if(typeof m!="string")throw new Error("Invalid SVG element type");return this._createSVG(m)}_createSVG(m){(0,i.unreachable)("Abstract method `_createSVG` called.")}}n.BaseSVGFactory=M},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.MurmurHash3_64=void 0;var i=L(1);const f=3285377520,z=4294901760,H=65535;class ut{constructor(C){this.h1=C?C&4294967295:f,this.h2=C?C&4294967295:f}update(C){let m,I;
2if(typeof C=="string"){m=new Uint8Array(C.length*2),I=0;for(let D=0,b=C.length;D<b;D++){const c=C.charCodeAt(D);c<=255?m[I++]=c:(m[I++]=c>>>8,m[I++]=c&255)}}else if((0,i.isArrayBuffer)(C))m=C.slice(),I=m.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const N=I>>2,R=I-N*4,E=new Uint32Array(m.buffer,0,N);let v=0,p=0,_=this.h1,w=this.h2;const P=3432918353,A=461845907,l=P&H,d=A&H;for(let D=0;D<N;D++)D&1?(v=E[D],v=v*P&z|v*l&H,v=v<<15|v>>>17,v=v*A&z|v*d&H,_^=v,_=_<<13|_>>>19,_=_*5+3864292196):(p=E[D],p=p*P&z|p*l&H,p=p<<15|p>>>17,p=p*A&z|p*d&H,w^=p,w=w<<13|w>>>19,w=w*5+3864292196);switch(v=0,R){case 3:v^=m[N*4+2]<<16;case 2:v^=m[N*4+1]<<8;case 1:v^=m[N*4],v=v*P&z|v*l&H,v=v<<15|v>>>17,v=v*A&z|v*d&H,N&1?_^=v:w^=v}this.h1=_,this.h2=w}hexdigest(){let C=this.h1,m=this.h2;return C^=m>>>1,C=C*3981806797&z|C*36045&H,m=m*4283543511&z|((m<<16|C>>>16)*2950163797&z)>>>16,C^=m>>>1,C=C*444984403&z|C*60499&H,m=m*3301882366&z|((m<<16|C>>>16)*3120437893&z)>>>16,C^=m>>>1,(C>>>0).toString(16).padStart(8,"0")+(m>>>0).toString(16).padStart(8,"0")}}n.MurmurHash3_64=ut},(F,n,L)=>{var H;Object.defineProperty(n,"__esModule",{value:!0}),n.FontLoader=n.FontFaceObject=void 0;var i=L(1);class f{constructor({ownerDocument:M=globalThis.document,styleElement:C=null}){W(this,H,new Set);this._document=M,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(M){this.nativeFontFaces.add(M),this._document.fonts.add(M)}removeNativeFontFace(M){this.nativeFontFaces.delete(M),this._document.fonts.delete(M)}insertRule(M){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const C=this.styleElement.sheet;C.insertRule(M,C.cssRules.length)}clear(){for(const M of this.nativeFontFaces)this._document.fonts.delete(M);this.nativeFontFaces.clear(),t(this,H).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(M){if(!(!M||t(this,H).has(M.loadedName))){if((0,i.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:C,src:m,style:I}=M,N=new FontFace(C,m,I);this.addNativeFontFace(N);try{await N.load(),t(this,H).add(C)}catch{(0,i.warn)(`Cannot load system font: ${M.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(N)}return}(0,i.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}
2async bind(M){if(M.attached||M.missingFile&&!M.systemFontInfo)return;if(M.attached=!0,M.systemFontInfo){await this.loadSystemFont(M.systemFontInfo);return}if(this.isFontLoadingAPISupported){const m=M.createNativeFontFace();if(m){this.addNativeFontFace(m);try{await m.loaded}catch(I){throw(0,i.warn)(`Failed to load font '${m.family}': '${I}'.`),M.disableFontFace=!0,I}}return}const C=M.createFontFaceRule();if(C){if(this.insertRule(C),this.isSyncFontLoadingSupported)return;await new Promise(m=>{const I=this._queueLoadingCallback(m);this._prepareFontLoadEvent(M,I)})}}get isFontLoadingAPISupported(){var C;const M=!!((C=this._document)!=null&&C.fonts);return(0,i.shadow)(this,"isFontLoadingAPISupported",M)}get isSyncFontLoadingSupported(){let M=!1;return(i.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(M=!0),(0,i.shadow)(this,"isSyncFontLoadingSupported",M)}_queueLoadingCallback(M){function C(){for((0,i.assert)(!I.done,"completeRequest() cannot be called twice."),I.done=!0;m.length>0&&m[0].done;){const N=m.shift();setTimeout(N.callback,0)}}const{loadingRequests:m}=this,I={done:!1,complete:C,callback:M};return m.push(I),I}get _loadTestFont(){const M=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",M)}_prepareFontLoadEvent(M,C){function m(g,$){return g.charCodeAt($)<<24|g.charCodeAt($+1)<<16|g.charCodeAt($+2)<<8|g.charCodeAt($+3)&255}function I(g,$,V,T){const Y=g.substring(0,$),it=g.substring($+V);return Y+T+it}let N,R;const E=this._document.createElement("canvas");E.width=1,E.height=1;const v=E.getContext("2d");let p=0;function _(g,$){if(++p>30){(0,i.warn)("Load test font never loaded."),$();return}if(v.font="30px "+g,v.fillText(".",0,20),v.getImageData(0,0,1,1).data[3]>0){$();return}setTimeout(_.bind(null,g,$))}const w=`lt${Date.now()}${this.loadTestFontId++}`;let P=this._loadTestFont;P=I(P,976,w.length,w);const l=16,d=1482184792;let D=m(P,l);for(N=0,R=w.length-3;N<R;N+=4)D=D-d+m(w,N)|0;N<w.length&&(D=D-d+m(w+"XXX",N)|0),P=I(P,l,4,(0,i.string32)(D));const b=`url(data:font/opentype;base64,${btoa(P)});`,c=`@font-face {font-family:"${w}";src:${b}}`;this.insertRule(c);const k=this._document.createElement("div");k.style.visibility="hidden",k.style.width=k.style.height="10px",k.style.position="absolute",k.style.top=k.style.left="0px";for(const g of[M.loadedName,w]){const $=this._document.createElement("span");$.textContent="Hi",$.style.fontFamily=g,k.append($)}this._document.body.append(k),_(w,()=>{k.remove(),C.complete()})}}H=new WeakMap,n.FontLoader=f;class z{constructor(M,{isEvalSupported:C=!0,disableFontFace:m=!1,ignoreErrors:I=!1,inspectFont:N=null}){this.compiledGlyphs=Object.create(null);for(const R in M)this[R]=M[R];this.isEvalSupported=C!==!1,this.disableFontFace=m===!0,this.ignoreErrors=I===!0,this._inspectFont=N}createNativeFontFace(){var C;if(!this.data||this.disableFontFace)return null;let M;if(!this.cssFontInfo)M=new FontFace(this.loadedName,this.data,{});else{const m={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(m.style=`oblique ${this.cssFontInfo.italicAngle}deg`),M=new FontFace(this.cssFontInfo.fontFamily,this.data,m)}return(C=this._inspectFont)==null||C.call(this,this),M}createFontFaceRule(){var I;if(!this.data||this.disableFontFace)return null;const M=(0,i.bytesToString)(this.data),C=`url(data:${this.mimetype};base64,${btoa(M)});`;let m;if(!this.cssFontInfo)m=`@font-face {font-family:"${this.loadedName}";src:${C}}`;else{let N=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(N+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),m=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${N}src:${C}}`}return(I=this._inspectFont)==null||I.call(this,this,C),m}getPathGenerator(M,C){if(this.compiledGlyphs[C]!==void 0)return this.compiledGlyphs[C];let m;try{m=M.get(this.loadedName+"_path_"+C)}
2catch(I){if(!this.ignoreErrors)throw I;return(0,i.warn)(`getPathGenerator - ignoring character: "${I}".`),this.compiledGlyphs[C]=function(N,R){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const I=[];for(const N of m){const R=N.args!==void 0?N.args.join(","):"";I.push("c.",N.cmd,"(",R,`); 3`)}return this.compiledGlyphs[C]=new Function("c","size",I.join(""))}return this.compiledGlyphs[C]=function(I,N){for(const R of m)R.cmd==="scale"&&(R.args=[N,-N]),I[R.cmd].apply(I,R.args)}}}n.FontFaceObject=z},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.NodeStandardFontDataFactory=n.NodeFilterFactory=n.NodeCanvasFactory=n.NodeCMapReaderFactory=void 0;var i=L(7);L(1);const f=function(C){return new Promise((m,I)=>{require$$5.readFile(C,(R,E)=>{if(R||!E){I(new Error(R));return}m(new Uint8Array(E))})})};class z extends i.BaseFilterFactory{}n.NodeFilterFactory=z;class H extends i.BaseCanvasFactory{_createCanvas(m,I){return require$$5.createCanvas(m,I)}}n.NodeCanvasFactory=H;class ut extends i.BaseCMapReaderFactory{_fetchData(m,I){return f(m).then(N=>({cMapData:N,compressionType:I}))}}n.NodeCMapReaderFactory=ut;class M extends i.BaseStandardFontDataFactory{_fetchData(m){return f(m)}}n.NodeStandardFontDataFactory=M},(F,n,L)=>{var G,Ze,bt,tn;Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasGraphics=void 0;var i=L(1),f=L(6),z=L(12),H=L(13);const ut=16,M=100,C=4096,m=15,I=10,N=1e3,R=16;function E(x,s){if(x._removeMirroring)throw new Error("Context is already forwarding operations.");x.__originalSave=x.save,x.__originalRestore=x.restore,x.__originalRotate=x.rotate,x.__originalScale=x.scale,x.__originalTranslate=x.translate,x.__originalTransform=x.transform,x.__originalSetTransform=x.setTransform,x.__originalResetTransform=x.resetTransform,x.__originalClip=x.clip,x.__originalMoveTo=x.moveTo,x.__originalLineTo=x.lineTo,x.__originalBezierCurveTo=x.bezierCurveTo,x.__originalRect=x.rect,x.__originalClosePath=x.closePath,x.__originalBeginPath=x.beginPath,x._removeMirroring=()=>{x.save=x.__originalSave,x.restore=x.__originalRestore,x.rotate=x.__originalRotate,x.scale=x.__originalScale,x.translate=x.__originalTranslate,x.transform=x.__originalTransform,x.setTransform=x.__originalSetTransform,x.resetTransform=x.__originalResetTransform,x.clip=x.__originalClip,x.moveTo=x.__originalMoveTo,x.lineTo=x.__originalLineTo,x.bezierCurveTo=x.__originalBezierCurveTo,x.rect=x.__originalRect,x.closePath=x.__originalClosePath,x.beginPath=x.__originalBeginPath,delete x._removeMirroring},x.save=function(){s.save(),this.__originalSave()},x.restore=function(){s.restore(),this.__originalRestore()},x.translate=function(a,h){s.translate(a,h),this.__originalTranslate(a,h)},x.scale=function(a,h){s.scale(a,h),this.__originalScale(a,h)},x.transform=function(a,h,u,S,O,j){s.transform(a,h,u,S,O,j),this.__originalTransform(a,h,u,S,O,j)},x.setTransform=function(a,h,u,S,O,j){s.setTransform(a,h,u,S,O,j),this.__originalSetTransform(a,h,u,S,O,j)},x.resetTransform=function(){s.resetTransform(),this.__originalResetTransform()},x.rotate=function(a){s.rotate(a),this.__originalRotate(a)},x.clip=function(a){s.clip(a),this.__originalClip(a)},x.moveTo=function(o,a){s.moveTo(o,a),this.__originalMoveTo(o,a)},x.lineTo=function(o,a){s.lineTo(o,a),this.__originalLineTo(o,a)},x.bezierCurveTo=function(o,a,h,u,S,O){s.bezierCurveTo(o,a,h,u,S,O),this.__originalBezierCurveTo(o,a,h,u,S,O)},x.rect=function(o,a,h,u){s.rect(o,a,h,u),this.__originalRect(o,a,h,u)},x.closePath=function(){s.closePath(),this.__originalClosePath()},x.beginPath=function(){s.beginPath(),this.__originalBeginPath()}}class v{constructor(s){this.canvasFactory=s,this.cache=Object.create(null)}getCanvas(s,o,a){let h;return this.cache[s]!==void 0?(h=this.cache[s],this.canvasFactory.reset(h,o,a)):(h=this.canvasFactory.create(o,a),this.cache[s]=h),h}delete(s){delete this.cache[s]}clear(){for(const s in this.cache){const o=this.cache[s];this.canvasFactory.destroy(o),delete this.cache[s]}}}function p(x,s,o,a,h,u,S,O,j,st){const[tt,at,dt,gt,ct,xt]=(0,f.getCurrentTransform)(x);if(at===0&&dt===0){const Lt=S*tt+ct,mt=Math.round(Lt),et=O*gt+xt,nt=Math.round(et),pt=(S+j)*tt+ct,wt=Math.abs(Math.round(pt)-mt)||1,Ct=(O+st)*gt+xt,jt=Math.abs(Math.round(Ct)-nt)||1;return x.setTransform(Math.sign(tt),0,0,Math.sign(gt),mt,nt),x.drawImage(s,o,a,h,u,0,0,wt,jt),x.setTransform(tt,at,dt,gt,ct,xt),[wt,jt]}if(tt===0&>===0){const Lt=O*dt+ct,mt=Math.round(Lt),et=S*at+xt,nt=Math.round(et),pt=(O+st)*dt+ct,wt=Math.abs(Math.round(pt)-mt)||1,Ct=(S+j)*at+xt,jt=Math.abs(Math.round(Ct)-nt)||1;return x.setTransform(0,Math.sign(at),Math.sign(dt),0,mt,nt),x.drawImage(s,o,a,h,u,0,0,jt,wt),x.setTransform(tt,at,dt,gt,ct,xt),[jt,wt]}x.drawImage(s,o,a,h,u,S,O,j,st);const Ot=Math.hypot(tt,at),Et=Math.hypot(dt,gt);return[Ot*j,Et*st]}function _(x){const{width:s,height:o}=x;if(s>N||o>N)return null;const a=1e3,h=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=s+1;let S=new Uint8Array(u*(o+1)),O,j,st;const tt=s+7&-8;let at=new Uint8Array(tt*o),dt=0;for(const Et of x.data){let Lt=128;for(;Lt>0;)at[dt++]=Et&Lt?0:255,Lt>>=1}let gt=0;for(dt=0,at[dt]!==0&&(S[0]=1,++gt),j=1;j<s;
3j++)at[dt]!==at[dt+1]&&(S[j]=at[dt]?2:1,++gt),dt++;for(at[dt]!==0&&(S[j]=2,++gt),O=1;O<o;O++){dt=O*tt,st=O*u,at[dt-tt]!==at[dt]&&(S[st]=at[dt]?1:8,++gt);let Et=(at[dt]?4:0)+(at[dt-tt]?8:0);for(j=1;j<s;j++)Et=(Et>>2)+(at[dt+1]?4:0)+(at[dt-tt+1]?8:0),h[Et]&&(S[st+j]=h[Et],++gt),dt++;if(at[dt-tt]!==at[dt]&&(S[st+j]=at[dt]?2:4,++gt),gt>a)return null}for(dt=tt*(o-1),st=O*u,at[dt]!==0&&(S[st]=8,++gt),j=1;j<s;j++)at[dt]!==at[dt+1]&&(S[st+j]=at[dt]?4:8,++gt),dt++;if(at[dt]!==0&&(S[st+j]=4,++gt),gt>a)return null;const ct=new Int32Array([0,u,-1,0,-u,0,0,0,1]),xt=new Path2D;for(O=0;gt&&O<=o;O++){let Et=O*u;const Lt=Et+s;for(;Et<Lt&&!S[Et];)Et++;if(Et===Lt)continue;xt.moveTo(Et%u,O);const mt=Et;let et=S[Et];do{const nt=ct[et];do Et+=nt;while(!S[Et]);const pt=S[Et];pt!==5&&pt!==10?(et=pt,S[Et]=0):(et=pt&51*et>>4,S[Et]&=et>>2|et<<2),xt.lineTo(Et%u,Et/u|0),S[Et]||--gt}while(mt!==Et);--O}return at=null,S=null,function(Et){Et.save(),Et.scale(1/s,-1/o),Et.translate(0,-o),Et.fill(xt),Et.beginPath(),Et.restore()}}class w{constructor(s,o){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=i.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,s,o])}clone(){const s=Object.create(this);return s.clipBox=this.clipBox.slice(),s}setCurrentPoint(s,o){this.x=s,this.y=o}updatePathMinMax(s,o,a){[o,a]=i.Util.applyTransform([o,a],s),this.minX=Math.min(this.minX,o),this.minY=Math.min(this.minY,a),this.maxX=Math.max(this.maxX,o),this.maxY=Math.max(this.maxY,a)}updateRectMinMax(s,o){const a=i.Util.applyTransform(o,s),h=i.Util.applyTransform(o.slice(2),s);this.minX=Math.min(this.minX,a[0],h[0]),this.minY=Math.min(this.minY,a[1],h[1]),this.maxX=Math.max(this.maxX,a[0],h[0]),this.maxY=Math.max(this.maxY,a[1],h[1])}updateScalingPathMinMax(s,o){i.Util.scaleMinMax(s,o),this.minX=Math.min(this.minX,o[0]),this.maxX=Math.max(this.maxX,o[1]),this.minY=Math.min(this.minY,o[2]),this.maxY=Math.max(this.maxY,o[3])}updateCurvePathMinMax(s,o,a,h,u,S,O,j,st,tt){const at=i.Util.bezierBoundingBox(o,a,h,u,S,O,j,st);if(tt){tt[0]=Math.min(tt[0],at[0],at[2]),tt[1]=Math.max(tt[1],at[0],at[2]),tt[2]=Math.min(tt[2],at[1],at[3]),tt[3]=Math.max(tt[3],at[1],at[3]);return}this.updateRectMinMax(s,at)}getPathBoundingBox(s=z.PathType.FILL,o=null){const a=[this.minX,this.minY,this.maxX,this.maxY];if(s===z.PathType.STROKE){o||(0,i.unreachable)("Stroke bounding box must include transform.");const h=i.Util.singularValueDecompose2dScale(o),u=h[0]*this.lineWidth/2,S=h[1]*this.lineWidth/2;a[0]-=u,a[1]-=S,a[2]+=u,a[3]+=S}return a}updateClipFromPath(){const s=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(s||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(s){this.clipBox=s,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(s=z.PathType.FILL,o=null){return i.Util.intersect(this.clipBox,this.getPathBoundingBox(s,o))}}function P(x,s){if(typeof ImageData<"u"&&s instanceof ImageData){x.putImageData(s,0,0);return}const o=s.height,a=s.width,h=o%R,u=(o-h)/R,S=h===0?u:u+1,O=x.createImageData(a,R);let j=0,st;const tt=s.data,at=O.data;let dt,gt,ct,xt;if(s.kind===i.ImageKind.GRAYSCALE_1BPP){const Ot=tt.byteLength,Et=new Uint32Array(at.buffer,0,at.byteLength>>2),Lt=Et.length,mt=a+7>>3,et=4294967295,nt=i.FeatureTest.isLittleEndian?4278190080:255;for(dt=0;dt<S;dt++){for(ct=dt<u?R:h,st=0,gt=0;gt<ct;gt++){const pt=Ot-j;let wt=0;const Ct=pt>mt?a:pt*8-7,jt=Ct&-8;let Vt=0,Wt=0;for(;wt<jt;wt+=8)Wt=tt[j++],Et[st++]=Wt&128?et:nt,Et[st++]=Wt&64?et:nt,Et[st++]=Wt&32?et:nt,Et[st++]=Wt&16?et:nt,Et[st++]=Wt&8?et:nt,Et[st++]=Wt&4?et:nt,Et[st++]=Wt&2?et:nt,Et[st++]=Wt&1?et:nt;for(;wt<Ct;wt++)Vt===0&&(Wt=tt[j++],Vt=128),Et[st++]=Wt&Vt?et:nt,Vt>>=1}for(;st<Lt;)Et[st++]=0;x.putImageData(O,0,dt*R)}}else if(s.kind===i.ImageKind.RGBA_32BPP){for(gt=0,xt=a*R*4,dt=0;dt<u;dt++)at.set(tt.subarray(j,j+xt)),j+=xt,x.putImageData(O,0,gt),gt+=R;dt<S&&(xt=a*h*4,at.set(tt.subarray(j,j+xt)),x.putImageData(O,0,gt))}else if(s.kind===i.ImageKind.RGB_24BPP)for(ct=R,xt=a*ct,dt=0;dt<S;dt++){for(dt>=u&&(ct=h,xt=a*ct),st=0,gt=xt;gt--;)at[st++]=tt[j++],at[st++]=tt[j++],at[st++]=tt[j++],at[st++]=255;x.putImageData(O,0,dt*R)}else throw new Error(`bad image kind: ${s.kind}`)}function A(x,s){if(s.bitmap){x.drawImage(s.bitmap,0,0);return}const o=s.height,a=s.width,h=o%R,u=(o-h)/R,S=h===0?u:u+1,O=x.createImageData(a,R);let j=0;const st=s.data,tt=O.data;for(let at=0;at<S;at++){const dt=at<u?R:h;({srcPos:j}=(0,H.convertBlackAndWhiteToRGBA)({src:st,srcPos:j,dest:tt,width:a,height:dt,nonBlackColor:0})),x.putImageData(O,0,at*R)}}function l(x,s){const o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const a of o)x[a]!==void 0&&(s[a]=x[a]);x.setLineDash!==void 0&&(s.setLineDash(x.getLineDash()),s.lineDashOffset=x.lineDashOffset)}function d(x){if(x.strokeStyle=x.fillStyle="#000000",x.fillRule="nonzero",x.globalAlpha=1,x.lineWidth=1,x.lineCap="butt",x.lineJoin="miter",x.miterLimit=10,x.globalCompositeOperation="source-over",x.font="10px sans-serif",x.setLineDash!==void 0&&(x.setLineDash([]),x.lineDashOffset=0),!i.isNodeJS){const{filter:s}=x;s!=="none"&&s!==""&&(x.filter="none")}}function D(x,s,o,a){const h=x.length;for(let u=3;u<h;u+=4){const S=x[u];if(S===0)x[u-3]=s,x[u-2]=o,x[u-1]=a;else if(S<255){const O=255-S;x[u-3]=x[u-3]*S+s*O>>8,x[u-2]=x[u-2]*S+o*O>>8,x[u-1]=x[u-1]*S+a*O>>8}}}function b(x,s,o){const a=x.length,h=1/255;for(let u=3;u<a;u+=4){const S=o?o[x[u]]:x[u];s[u]=s[u]*S*h|0}}function c(x,s,o){const a=x.length;for(let h=3;h<a;h+=4){const u=x[h-3]*77+x[h-2]*152+x[h-1]*28;s[h]=o?s[h]*o[u>>8]>>8:s[h]*u>>16}}function k(x,s,o,a,h,u,S,O,j,st,tt){const at=!!u,dt=at?u[0]:0,gt=at?u[1]:0,ct=at?u[2]:0,xt=h==="Luminosity"?c:b,Et=Math.min(a,Math.ceil(1048576/o));for(let Lt=0;Lt<a;Lt+=Et){const mt=Math.min(Et,a-Lt),et=x.getImageData(O-st,Lt+(j-tt),o,mt),nt=s.getImageData(O,Lt+j,o,mt);at&&D(et.data,dt,gt,ct),xt(et.data,nt.data,S),s.putImageData(nt,O,Lt+j)}}function g(x,s,o,a){const h=a[0],u=a[1],S=a[2]-h,O=a[3]-u;S===0||O===0||(k(s.context,o,S,O,s.subtype,s.backdrop,s.transferMap,h,u,s.offsetX,s.offsetY),x.save(),x.globalAlpha=1,x.globalCompositeOperation="source-over",x.setTransform(1,0,0,1,0,0),x.drawImage(o.canvas,0,0),x.restore(
3))}function $(x,s){const o=i.Util.singularValueDecompose2dScale(x);o[0]=Math.fround(o[0]),o[1]=Math.fround(o[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*f.PixelsPerInch.PDF_TO_CSS_UNITS);return s!==void 0?s:o[0]<=a||o[1]<=a}const V=["butt","round","square"],T=["miter","round","bevel"],Y={},it={},Pt=class Pt{constructor(s,o,a,h,u,{optionalContentConfig:S,markedContentStack:O=null},j,st){W(this,G);W(this,bt);this.ctx=s,this.current=new w(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=o,this.objs=a,this.canvasFactory=h,this.filterFactory=u,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=O||[],this.optionalContentConfig=S,this.cachedCanvases=new v(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=j,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=st,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(s,o=null){return typeof s=="string"?s.startsWith("g_")?this.commonObjs.get(s):this.objs.get(s):o}beginDrawing({transform:s,viewport:o,transparency:a=!1,background:h=null}){const u=this.ctx.canvas.width,S=this.ctx.canvas.height,O=this.ctx.fillStyle;if(this.ctx.fillStyle=h||"#ffffff",this.ctx.fillRect(0,0,u,S),this.ctx.fillStyle=O,a){const j=this.cachedCanvases.getCanvas("transparent",u,S);this.compositeCtx=this.ctx,this.transparentCanvas=j.canvas,this.ctx=j.context,this.ctx.save(),this.ctx.transform(...(0,f.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),d(this.ctx),s&&(this.ctx.transform(...s),this.outputScaleX=s[0],this.outputScaleY=s[0]),this.ctx.transform(...o.transform),this.viewportScale=o.scale,this.baseTransform=(0,f.getCurrentTransform)(this.ctx)}executeOperatorList(s,o,a,h){const u=s.argsArray,S=s.fnArray;let O=o||0;const j=u.length;if(j===O)return O;const st=j-O>I&&typeof a=="function",tt=st?Date.now()+m:0;let at=0;const dt=this.commonObjs,gt=this.objs;let ct;for(;;){if(h!==void 0&&O===h.nextBreakPoint)return h.breakIt(O,a),O;if(ct=S[O],ct!==i.OPS.dependency)this[ct].apply(this,u[O]);else for(const xt of u[O]){const Ot=xt.startsWith("g_")?dt:gt;if(!Ot.has(xt))return Ot.get(xt,a),O}if(O++,O===j)return O;if(st&&++at>I){if(Date.now()>tt)return a(),O;at=0}}}endDrawing(){q(this,G,Ze).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const s of this._cachedBitmapsMap.values()){for(const o of s.values())typeof HTMLCanvasElement<"u"&&o instanceof HTMLCanvasElement&&(o.width=o.height=0);s.clear()}this._cachedBitmapsMap.clear(),q(this,bt,tn).call(this)}_scaleImage(s,o){const a=s.width,h=s.height;let u=Math.max(Math.hypot(o[0],o[1]),1),S=Math.max(Math.hypot(o[2],o[3]),1),O=a,j=h,st="prescale1",tt,at;for(;u>2&&O>1||S>2&&j>1;){let dt=O,gt=j;u>2&&O>1&&(dt=O>=16384?Math.floor(O/2)-1||1:Math.ceil(O/2),u/=O/dt),S>2&&j>1&&(gt=j>=16384?Math.floor(j/2)-1||1:Math.ceil(j)/2,S/=j/gt),tt=this.cachedCanvases.getCanvas(st,dt,gt),at=tt.context,at.clearRect(0,0,dt,gt),at.drawImage(s,0,0,O,j,0,0,dt,gt),s=tt.canvas,O=dt,j=gt,st=st==="prescale1"?"prescale2":"prescale1"}return{img:s,paintWidth:O,paintHeight:j}}_createMaskCanvas(s){const o=this.ctx,{width:a,height:h}=s,u=this.current.fillColor,S=this.current.patternFill,O=(0,f.getCurrentTransform)(o);let j,st,tt,at;if((s.bitmap||s.data)&&s.count>1){const wt=s.bitmap||s.data.buffer;st=JSON.stringify(S?O:[O.slice(0,4),u]),j=this._cachedBitmapsMap.get(wt),j||(j=new Map,this._cachedBitmapsMap.set(wt,j));const Ct=j.get(st);if(Ct&&!S){const jt=Math.round(Math.min(O[0],O[2])+O[4]),Vt=Math.round(Math.min(O[1],O[3])+O[5]);return{canvas:Ct,offsetX:jt,offsetY:Vt}}tt=Ct}tt||(at=this.cachedCanvases.getCanvas("maskCanvas",a,h),A(at.context,s));let dt=i.Util.transform(O,[1/a,0,0,-1/h,0,0]);dt=i.Util.transform(dt,[1,0,0,1,0,-h]);const gt=i.Util.applyTransform([0,0],dt),ct=i.Util.applyTransform([a,h],dt),xt=i.Util.normalizeRect([gt[0],gt[1],ct[0],ct[1]]),Ot=Math.round(xt[2]-xt[0])||1,Et=Math.round(xt[3]-xt[1])||1,Lt=this.cachedCanvases.getCanvas("fillCanvas",Ot,Et),mt=Lt.context,et=Math.min(gt[0],ct[0]),nt=Math.min(gt[1],ct[1]);mt.translate(-et,-nt),mt.transform(...dt),tt||(tt=this._scaleImage(at.canvas,(0,f.getCurrentTransformInverse)(mt)),tt=tt.img,j&&S&&j.set(st,tt)),mt.imageSmoothingEnabled=$((0,f.getCurrentTransform)(mt),s.interpolate),p(mt,tt,0,0,tt.width,tt.height,0,0,a,h),mt.globalCompositeOperation="source-in";const pt=i.Util.transform((0,f.getCurrentTransformInverse)(mt),[1,0,0,1,-et,-nt]);return mt.fillStyle=S?u.getPattern(o,this,pt,z.PathType.FILL):u,mt.fillRect(0,0,a,h),j&&!S&&(this.cachedCanvases.delete("fillCanvas"),j.set(st,Lt.canvas)),{canvas:Lt.canvas,offsetX:Math.round(et),offsetY:Math.round(nt)}}setLineWidth(s){s!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=s,this.ctx.lineWidth=s}setLineCap(s){this.ctx.lineCap=V[s]}setLineJoin(s){this.ctx.lineJoin=T[s]}setMiterLimit(s){this.ctx.miterLimit=s}setDash(s,o){const a=this.ctx;a.setLineDash!==void 0&&(a.setLineDash(s),a.lineDashOffset=o)}
3setRenderingIntent(s){}setFlatness(s){}setGState(s){for(const[o,a]of s)switch(o){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a[0],a[1]);break;case"CA":this.current.strokeAlpha=a;break;case"ca":this.current.fillAlpha=a,this.ctx.globalAlpha=a;break;case"BM":this.ctx.globalCompositeOperation=a;break;case"SMask":this.current.activeSMask=a?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(a);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const s=this.inSMaskMode;this.current.activeSMask&&!s?this.beginSMaskMode():!this.current.activeSMask&&s&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const s=this.ctx.canvas.width,o=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,h=this.cachedCanvases.getCanvas(a,s,o);this.suspendedCtx=this.ctx,this.ctx=h.context;const u=this.ctx;u.setTransform(...(0,f.getCurrentTransform)(this.suspendedCtx)),l(this.suspendedCtx,u),E(u,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),l(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(s){if(!this.current.activeSMask)return;s?(s[0]=Math.floor(s[0]),s[1]=Math.floor(s[1]),s[2]=Math.ceil(s[2]),s[3]=Math.ceil(s[3])):s=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const o=this.current.activeSMask,a=this.suspendedCtx;g(a,o,this.ctx,s),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?(l(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const s=this.current;this.stateStack.push(s),this.current=s.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),l(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(s,o,a,h,u,S){this.ctx.transform(s,o,a,h,u,S),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(s,o,a){const h=this.ctx,u=this.current;let S=u.x,O=u.y,j,st;const tt=(0,f.getCurrentTransform)(h),at=tt[0]===0&&tt[3]===0||tt[1]===0&&tt[2]===0,dt=at?a.slice(0):null;for(let gt=0,ct=0,xt=s.length;gt<xt;gt++)switch(s[gt]|0){case i.OPS.rectangle:S=o[ct++],O=o[ct++];const Ot=o[ct++],Et=o[ct++],Lt=S+Ot,mt=O+Et;h.moveTo(S,O),Ot===0||Et===0?h.lineTo(Lt,mt):(h.lineTo(Lt,O),h.lineTo(Lt,mt),h.lineTo(S,mt)),at||u.updateRectMinMax(tt,[S,O,Lt,mt]),h.closePath();break;case i.OPS.moveTo:S=o[ct++],O=o[ct++],h.moveTo(S,O),at||u.updatePathMinMax(tt,S,O);break;case i.OPS.lineTo:S=o[ct++],O=o[ct++],h.lineTo(S,O),at||u.updatePathMinMax(tt,S,O);break;case i.OPS.curveTo:j=S,st=O,S=o[ct+4],O=o[ct+5],h.bezierCurveTo(o[ct],o[ct+1],o[ct+2],o[ct+3],S,O),u.updateCurvePathMinMax(tt,j,st,o[ct],o[ct+1],o[ct+2],o[ct+3],S,O,dt),ct+=6;break;case i.OPS.curveTo2:j=S,st=O,h.bezierCurveTo(S,O,o[ct],o[ct+1],o[ct+2],o[ct+3]),u.updateCurvePathMinMax(tt,j,st,S,O,o[ct],o[ct+1],o[ct+2],o[ct+3],dt),S=o[ct+2],O=o[ct+3],ct+=4;break;case i.OPS.curveTo3:j=S,st=O,S=o[ct+2],O=o[ct+3],h.bezierCurveTo(o[ct],o[ct+1],S,O,S,O),u.updateCurvePathMinMax(tt,j,st,o[ct],o[ct+1],S,O,S,O,dt),ct+=4;break;case i.OPS.closePath:h.closePath();break}at&&u.updateScalingPathMinMax(tt,dt),u.setCurrentPoint(S,O)}closePath(){this.ctx.closePath()}stroke(s=!0){const o=this.ctx,a=this.current.strokeColor;o.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof a=="object"&&(a!=null&&a.getPattern)?(o.save(),o.strokeStyle=a.getPattern(o,this,(0,f.getCurrentTransformInverse)(o),z.PathType.STROKE),this.rescaleAndStroke(!1),o.restore(
3)):this.rescaleAndStroke(!0)),s&&this.consumePath(this.current.getClippedPathBoundingBox()),o.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(s=!0){const o=this.ctx,a=this.current.fillColor,h=this.current.patternFill;let u=!1;h&&(o.save(),o.fillStyle=a.getPattern(o,this,(0,f.getCurrentTransformInverse)(o),z.PathType.FILL),u=!0);const S=this.current.getClippedPathBoundingBox();this.contentVisible&&S!==null&&(this.pendingEOFill?(o.fill("evenodd"),this.pendingEOFill=!1):o.fill()),u&&o.restore(),s&&this.consumePath(S)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Y}eoClip(){this.pendingClip=it}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const s=this.pendingTextPaths,o=this.ctx;if(s===void 0){o.beginPath();return}o.save(),o.beginPath();for(const a of s)o.setTransform(...a.transform),o.translate(a.x,a.y),a.addToPath(o,a.fontSize);o.restore(),o.clip(),o.beginPath(),delete this.pendingTextPaths}setCharSpacing(s){this.current.charSpacing=s}setWordSpacing(s){this.current.wordSpacing=s}setHScale(s){this.current.textHScale=s/100}setLeading(s){this.current.leading=-s}setFont(s,o){var tt;const a=this.commonObjs.get(s),h=this.current;if(!a)throw new Error(`Can't find font for ${s}`);if(h.fontMatrix=a.fontMatrix||i.FONT_IDENTITY_MATRIX,(h.fontMatrix[0]===0||h.fontMatrix[3]===0)&&(0,i.warn)("Invalid font matrix for font "+s),o<0?(o=-o,h.fontDirection=-1):h.fontDirection=1,this.current.font=a,this.current.fontSize=o,a.isType3Font)return;const u=a.loadedName||"sans-serif",S=((tt=a.systemFontInfo)==null?void 0:tt.css)||`"${u}", ${a.fallbackName}`;let O="normal";a.black?O="900":a.bold&&(O="bold");const j=a.italic?"italic":"normal";let st=o;o<ut?st=ut:o>M&&(st=M),this.current.fontSizeScale=o/st,this.ctx.font=`${j} ${O} ${st}px ${S}`}setTextRenderingMode(s){this.current.textRenderingMode=s}setTextRise(s){this.current.textRise=s}moveText(s,o){this.current.x=this.current.lineX+=s,this.current.y=this.current.lineY+=o}setLeadingMoveText(s,o){this.setLeading(-o),this.moveText(s,o)}setTextMatrix(s,o,a,h,u,S){this.current.textMatrix=[s,o,a,h,u,S],this.current.textMatrixScale=Math.hypot(s,o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(s,o,a,h){const u=this.ctx,S=this.current,O=S.font,j=S.textRenderingMode,st=S.fontSize/S.fontSizeScale,tt=j&i.TextRenderingMode.FILL_STROKE_MASK,at=!!(j&i.TextRenderingMode.ADD_TO_PATH_FLAG),dt=S.patternFill&&!O.missingFile;let gt;(O.disableFontFace||at||dt)&&(gt=O.getPathGenerator(this.commonObjs,s)),O.disableFontFace||dt?(u.save(),u.translate(o,a),u.beginPath(),gt(u,st),h&&u.setTransform(...h),(tt===i.TextRenderingMode.FILL||tt===i.TextRenderingMode.FILL_STROKE)&&u.fill(),(tt===i.TextRenderingMode.STROKE||tt===i.TextRenderingMode.FILL_STROKE)&&u.stroke(),u.restore()):((tt===i.TextRenderingMode.FILL||tt===i.TextRenderingMode.FILL_STROKE)&&u.fillText(s,o,a),(tt===i.TextRenderingMode.STROKE||tt===i.TextRenderingMode.FILL_STROKE)&&u.strokeText(s,o,a)),at&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,f.getCurrentTransform)(u),x:o,y:a,fontSize:st,addToPath:gt})}get isFontSubpixelAAEnabled(){const{context:s}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);s.scale(1.5,1),s.fillText("I",0,10);const o=s.getImageData(0,0,10,10).data;let a=!1;for(let h=3;h<o.length;h+=4)if(o[h]>0&&o[h]<255){a=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",a)}showText(s){const o=this.current,a=o.font;if(a.isType3Font)return this.showType3Text(s);const h=o.fontSize;if(h===0)return;const u=this.ctx,S=o.fontSizeScale,O=o.charSpacing,j=o.wordSpacing,st=o.fontDirection,tt=o.textHScale*st,at=s.length,dt=a.vertical,gt=dt?1:-1,ct=a.defaultVMetrics,xt=h*o.fontMatrix[0],Ot=o.textRenderingMode===i.TextRenderingMode.FILL&&!a.disableFontFace&&!o.patternFill;u.save(),u.transform(...o.textMatrix),u.translate(o.x,o.y+o.textRise),st>0?u.scale(tt,-1):u.scale(tt,1);let Et;if(o.patternFill){u.save();const pt=o.fillColor.getPattern(u,this,(0,f.getCurrentTransformInverse)(u),z.PathType.FILL);
3Et=(0,f.getCurrentTransform)(u),u.restore(),u.fillStyle=pt}let Lt=o.lineWidth;const mt=o.textMatrixScale;if(mt===0||Lt===0){const pt=o.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;(pt===i.TextRenderingMode.STROKE||pt===i.TextRenderingMode.FILL_STROKE)&&(Lt=this.getSinglePixelWidth())}else Lt/=mt;if(S!==1&&(u.scale(S,S),Lt/=S),u.lineWidth=Lt,a.isInvalidPDFjsFont){const pt=[];let wt=0;for(const Ct of s)pt.push(Ct.unicode),wt+=Ct.width;u.fillText(pt.join(""),0,0),o.x+=wt*xt*tt,u.restore(),this.compose();return}let et=0,nt;for(nt=0;nt<at;++nt){const pt=s[nt];if(typeof pt=="number"){et+=gt*pt*h/1e3;continue}let wt=!1;const Ct=(pt.isSpace?j:0)+O,jt=pt.fontChar,Vt=pt.accent;let Wt,zt,Gt=pt.width;if(dt){const Xt=pt.vmetric||ct,ft=-(pt.vmetric?Xt[1]:Gt*.5)*xt,Z=Xt[2]*xt;Gt=Xt?-Xt[0]:Gt,Wt=ft/S,zt=(et+Z)/S}else Wt=et/S,zt=0;if(a.remeasure&&Gt>0){const Xt=u.measureText(jt).width*1e3/h*S;if(Gt<Xt&&this.isFontSubpixelAAEnabled){const ft=Gt/Xt;wt=!0,u.save(),u.scale(ft,1),Wt/=ft}else Gt!==Xt&&(Wt+=(Gt-Xt)/2e3*h/S)}if(this.contentVisible&&(pt.isInFont||a.missingFile)){if(Ot&&!Vt)u.fillText(jt,Wt,zt);else if(this.paintChar(jt,Wt,zt,Et),Vt){const Xt=Wt+h*Vt.offset.x/S,ft=zt-h*Vt.offset.y/S;this.paintChar(Vt.fontChar,Xt,ft,Et)}}const Ht=dt?Gt*xt-Ct*st:Gt*xt+Ct*st;et+=Ht,wt&&u.restore()}dt?o.y-=et:o.x+=et*tt,u.restore(),this.compose()}showType3Text(s){const o=this.ctx,a=this.current,h=a.font,u=a.fontSize,S=a.fontDirection,O=h.vertical?1:-1,j=a.charSpacing,st=a.wordSpacing,tt=a.textHScale*S,at=a.fontMatrix||i.FONT_IDENTITY_MATRIX,dt=s.length,gt=a.textRenderingMode===i.TextRenderingMode.INVISIBLE;let ct,xt,Ot,Et;if(!(gt||u===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,o.save(),o.transform(...a.textMatrix),o.translate(a.x,a.y),o.scale(tt,S),ct=0;ct<dt;++ct){if(xt=s[ct],typeof xt=="number"){Et=O*xt*u/1e3,this.ctx.translate(Et,0),a.x+=Et*tt;continue}const Lt=(xt.isSpace?st:0)+j,mt=h.charProcOperatorList[xt.operatorListId];if(!mt){(0,i.warn)(`Type3 character "${xt.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=xt,this.save(),o.scale(u,u),o.transform(...at),this.executeOperatorList(mt),this.restore()),Ot=i.Util.applyTransform([xt.width,0],at)[0]*u+Lt,o.translate(Ot,0),a.x+=Ot*tt}o.restore(),this.processingType3=null}}setCharWidth(s,o){}setCharWidthAndBounds(s,o,a,h,u,S){this.ctx.rect(a,h,u-a,S-h),this.ctx.clip(),this.endPath()}getColorN_Pattern(s){let o;if(s[0]==="TilingPattern"){const a=s[1],h=this.baseTransform||(0,f.getCurrentTransform)(this.ctx),u={createCanvasGraphics:S=>new Pt(S,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};o=new z.TilingPattern(s,a,this.ctx,u,h)}else o=this._getPattern(s[1],s[2]);return o}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(s,o,a){const h=i.Util.makeHexColor(s,o,a);this.ctx.strokeStyle=h,this.current.strokeColor=h}setFillRGBColor(s,o,a){const h=i.Util.makeHexColor(s,o,a);this.ctx.fillStyle=h,this.current.fillColor=h,this.current.patternFill=!1}_getPattern(s,o=null){let a;return this.cachedPatterns.has(s)?a=this.cachedPatterns.get(s):(a=(0,z.getShadingPattern)(this.getObject(s)),this.cachedPatterns.set(s,a)),o&&(a.matrix=o),a}shadingFill(s){if(!this.contentVisible)return;const o=this.ctx;this.save();const a=this._getPattern(s);o.fillStyle=a.getPattern(o,this,(0,f.getCurrentTransformInverse)(o),z.PathType.SHADING);const h=(0,f.getCurrentTransformInverse)(o);if(h){const{width:u,height:S}=o.canvas,[O,j,st,tt]=i.Util.getAxialAlignedBoundingBox([0,0,u,S],h);this.ctx.fillRect(O,j,st-O,tt-j)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(s,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(s)&&s.length===6&&this.transform(...s),this.baseTransform=(0,f.getCurrentTransform)(this.ctx),o)){const a=o[2]-o[0],h=o[3]-o[1];this.ctx.rect(o[0],o[1],a,h),this.current.updateRectMinMax((0,f.getCurrentTransform)(this.ctx),o),this.clip(),this.endPath()}}
3paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(s){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const o=this.ctx;s.isolated||(0,i.info)("TODO: Support non-isolated groups."),s.knockout&&(0,i.warn)("Knockout groups not supported.");const a=(0,f.getCurrentTransform)(o);if(s.matrix&&o.transform(...s.matrix),!s.bbox)throw new Error("Bounding box is required.");let h=i.Util.getAxialAlignedBoundingBox(s.bbox,(0,f.getCurrentTransform)(o));const u=[0,0,o.canvas.width,o.canvas.height];h=i.Util.intersect(h,u)||[0,0,0,0];const S=Math.floor(h[0]),O=Math.floor(h[1]);let j=Math.max(Math.ceil(h[2])-S,1),st=Math.max(Math.ceil(h[3])-O,1),tt=1,at=1;j>C&&(tt=j/C,j=C),st>C&&(at=st/C,st=C),this.current.startNewPathAndClipBox([0,0,j,st]);let dt="groupAt"+this.groupLevel;s.smask&&(dt+="_smask_"+this.smaskCounter++%2);const gt=this.cachedCanvases.getCanvas(dt,j,st),ct=gt.context;ct.scale(1/tt,1/at),ct.translate(-S,-O),ct.transform(...a),s.smask?this.smaskStack.push({canvas:gt.canvas,context:ct,offsetX:S,offsetY:O,scaleX:tt,scaleY:at,subtype:s.smask.subtype,backdrop:s.smask.backdrop,transferMap:s.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(S,O),o.scale(tt,at),o.save()),l(o,ct),this.ctx=ct,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++}endGroup(s){if(!this.contentVisible)return;this.groupLevel--;const o=this.ctx,a=this.groupStack.pop();if(this.ctx=a,this.ctx.imageSmoothingEnabled=!1,s.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const h=(0,f.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...h);const u=i.Util.getAxialAlignedBoundingBox([0,0,o.canvas.width,o.canvas.height],h);this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.compose(u)}}beginAnnotation(s,o,a,h,u){if(q(this,G,Ze).call(this),d(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(o)&&o.length===4){const S=o[2]-o[0],O=o[3]-o[1];if(u&&this.annotationCanvasMap){a=a.slice(),a[4]-=o[0],a[5]-=o[1],o=o.slice(),o[0]=o[1]=0,o[2]=S,o[3]=O;const[j,st]=i.Util.singularValueDecompose2dScale((0,f.getCurrentTransform)(this.ctx)),{viewportScale:tt}=this,at=Math.ceil(S*this.outputScaleX*tt),dt=Math.ceil(O*this.outputScaleY*tt);this.annotationCanvas=this.canvasFactory.create(at,dt);const{canvas:gt,context:ct}=this.annotationCanvas;this.annotationCanvasMap.set(s,gt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=ct,this.ctx.save(),this.ctx.setTransform(j,0,0,-st,0,O*st),d(this.ctx)}else d(this.ctx),this.ctx.rect(o[0],o[1],S,O),this.ctx.clip(),this.endPath()}this.current=new w(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...a),this.transform(...h)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),q(this,bt,tn).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(s){if(!this.contentVisible)return;const o=s.count;s=this.getObject(s.data,s),s.count=o;const a=this.ctx,h=this.processingType3;if(h&&(h.compiled===void 0&&(h.compiled=_(s)),h.compiled)){h.compiled(a);return}const u=this._createMaskCanvas(s),S=u.canvas;a.save(),a.setTransform(1,0,0,1,0,0),a.drawImage(S,u.offsetX,u.offsetY),a.restore(),this.compose()}paintImageMaskXObjectRepeat(s,o,a=0,h=0,u,S){if(!this.contentVisible)return;s=this.getObject(s.data,s);const O=this.ctx;O.save();const j=(0,f.getCurrentTransform)(O);O.transform(o,a,h,u,0,0);const st=this._createMaskCanvas(s);O.setTransform(1,0,0,1,st.offsetX-j[4],st.offsetY-j[5]);for(let tt=0,at=S.length;tt<at;tt+=2){const dt=i.Util.transform(j,[o,a,h,u,S[tt],S[tt+1]]),[gt,ct]=i.Util.applyTransform([0,0],dt);O.drawImage(st.canvas,gt,ct)}O.restore(),this.compose()}paintImageMaskXObjectGroup(s){if(!this.contentVisible)return;const o=this.ctx,a=this.current.fillColor,h=this.current.patternFill;for(const u of s){const{data:S,width:O,height:j,transform:st}=u,tt=this.cachedCanvases.getCanvas("maskCanvas",O,j),at=tt.context;at.save();const dt=this.getObject(S,u);A(at,dt),at.globalCompositeOperation="source-in",at.fillStyle=h?a.getPattern(at,this,(0,f.getCurrentTransformInverse)(o),z.PathType.FILL):a,at.fillRect(0,0,O,j),at.restore(
3),o.save(),o.transform(...st),o.scale(1,-1),p(o,tt.canvas,0,0,O,j,0,-1,1,1),o.restore()}this.compose()}paintImageXObject(s){if(!this.contentVisible)return;const o=this.getObject(s);if(!o){(0,i.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(o)}paintImageXObjectRepeat(s,o,a,h){if(!this.contentVisible)return;const u=this.getObject(s);if(!u){(0,i.warn)("Dependent image isn't ready yet");return}const S=u.width,O=u.height,j=[];for(let st=0,tt=h.length;st<tt;st+=2)j.push({transform:[o,0,0,a,h[st],h[st+1]],x:0,y:0,w:S,h:O});this.paintInlineImageXObjectGroup(u,j)}applyTransferMapsToCanvas(s){return this.current.transferMaps!=="none"&&(s.filter=this.current.transferMaps,s.drawImage(s.canvas,0,0),s.filter="none"),s.canvas}applyTransferMapsToBitmap(s){if(this.current.transferMaps==="none")return s.bitmap;const{bitmap:o,width:a,height:h}=s,u=this.cachedCanvases.getCanvas("inlineImage",a,h),S=u.context;return S.filter=this.current.transferMaps,S.drawImage(o,0,0),S.filter="none",u.canvas}paintInlineImageXObject(s){if(!this.contentVisible)return;const o=s.width,a=s.height,h=this.ctx;if(this.save(),!i.isNodeJS){const{filter:O}=h;O!=="none"&&O!==""&&(h.filter="none")}h.scale(1/o,-1/a);let u;if(s.bitmap)u=this.applyTransferMapsToBitmap(s);else if(typeof HTMLElement=="function"&&s instanceof HTMLElement||!s.data)u=s;else{const j=this.cachedCanvases.getCanvas("inlineImage",o,a).context;P(j,s),u=this.applyTransferMapsToCanvas(j)}const S=this._scaleImage(u,(0,f.getCurrentTransformInverse)(h));h.imageSmoothingEnabled=$((0,f.getCurrentTransform)(h),s.interpolate),p(h,S.img,0,0,S.paintWidth,S.paintHeight,0,-a,o,a),this.compose(),this.restore()}paintInlineImageXObjectGroup(s,o){if(!this.contentVisible)return;const a=this.ctx;let h;if(s.bitmap)h=s.bitmap;else{const u=s.width,S=s.height,j=this.cachedCanvases.getCanvas("inlineImage",u,S).context;P(j,s),h=this.applyTransferMapsToCanvas(j)}for(const u of o)a.save(),a.transform(...u.transform),a.scale(1,-1),p(a,h,u.x,u.y,u.w,u.h,0,-1,1,1),a.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(s){}markPointProps(s,o){}beginMarkedContent(s){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(s,o){s==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(o)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(s){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const a=this.ctx;this.pendingClip&&(o||(this.pendingClip===it?a.clip("evenodd"):a.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),a.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const s=(0,f.getCurrentTransform)(this.ctx);if(s[1]===0&&s[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(s[0]),Math.abs(s[3]));else{const o=Math.abs(s[0]*s[3]-s[2]*s[1]),a=Math.hypot(s[0],s[2]),h=Math.hypot(s[1],s[3]);this._cachedGetSinglePixelWidth=Math.max(a,h)/o}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:s}=this.current,{a:o,b:a,c:h,d:u}=this.ctx.getTransform();let S,O;if(a===0&&h===0){const j=Math.abs(o),st=Math.abs(u);if(j===st)if(s===0)S=O=1/j;else{const tt=j*s;S=O=tt<1?1/tt:1}else if(s===0)S=1/j,O=1/st;else{const tt=j*s,at=st*s;S=tt<1?1/tt:1,O=at<1?1/at:1}}else{const j=Math.abs(o*u-a*h),st=Math.hypot(o,a),tt=Math.hypot(h,u);if(s===0)S=tt/j,O=st/j;else{const at=s*j;S=tt>at?tt/at:1,O=st>at?st/at:1}}this._cachedScaleForStroking[0]=S,this._cachedScaleForStroking[1]=O}return this._cachedScaleForStroking}rescaleAndStroke(s){const{ctx:o}=this,{lineWidth:a}=this.current,[h,u]=this.getScaleForStroking();if(o.lineWidth=a||1,h===1&&u===1){o.stroke();return}const S=o.getLineDash();if(s&&o.save(),o.scale(h,u),S.length>0){const O=Math.max(h,u);o.setLineDash(S.map(j=>j/O)),o.lineDashOffset/=O}
3o.stroke(),s&&o.restore()}isContentVisible(){for(let s=this.markedContentStack.length-1;s>=0;s--)if(!this.markedContentStack[s].visible)return!1;return!0}};G=new WeakSet,Ze=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},bt=new WeakSet,tn=function(){if(this.pageColors){const s=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(s!=="none"){const o=this.ctx.filter;this.ctx.filter=s,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=o}}};let lt=Pt;n.CanvasGraphics=lt;for(const x in i.OPS)lt.prototype[x]!==void 0&&(lt.prototype[i.OPS[x]]=lt.prototype[x])},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TilingPattern=n.PathType=void 0,n.getShadingPattern=R;var i=L(1),f=L(6);const z={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};n.PathType=z;function H(_,w){if(!w)return;const P=w[2]-w[0],A=w[3]-w[1],l=new Path2D;l.rect(w[0],w[1],P,A),_.clip(l)}class ut{constructor(){this.constructor===ut&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class M extends ut{constructor(w){super(),this._type=w[1],this._bbox=w[2],this._colorStops=w[3],this._p0=w[4],this._p1=w[5],this._r0=w[6],this._r1=w[7],this.matrix=null}_createGradient(w){let P;this._type==="axial"?P=w.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(P=w.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const A of this._colorStops)P.addColorStop(A[0],A[1]);return P}getPattern(w,P,A,l){let d;if(l===z.STROKE||l===z.FILL){const D=P.current.getClippedPathBoundingBox(l,(0,f.getCurrentTransform)(w))||[0,0,0,0],b=Math.ceil(D[2]-D[0])||1,c=Math.ceil(D[3]-D[1])||1,k=P.cachedCanvases.getCanvas("pattern",b,c,!0),g=k.context;g.clearRect(0,0,g.canvas.width,g.canvas.height),g.beginPath(),g.rect(0,0,g.canvas.width,g.canvas.height),g.translate(-D[0],-D[1]),A=i.Util.transform(A,[1,0,0,1,D[0],D[1]]),g.transform(...P.baseTransform),this.matrix&&g.transform(...this.matrix),H(g,this._bbox),g.fillStyle=this._createGradient(g),g.fill(),d=w.createPattern(k.canvas,"no-repeat");const $=new DOMMatrix(A);d.setTransform($)}else H(w,this._bbox),d=this._createGradient(w);return d}}function C(_,w,P,A,l,d,D,b){const c=w.coords,k=w.colors,g=_.data,$=_.width*4;let V;c[P+1]>c[A+1]&&(V=P,P=A,A=V,V=d,d=D,D=V),c[A+1]>c[l+1]&&(V=A,A=l,l=V,V=D,D=b,b=V),c[P+1]>c[A+1]&&(V=P,P=A,A=V,V=d,d=D,D=V);const T=(c[P]+w.offsetX)*w.scaleX,Y=(c[P+1]+w.offsetY)*w.scaleY,it=(c[A]+w.offsetX)*w.scaleX,lt=(c[A+1]+w.offsetY)*w.scaleY,G=(c[l]+w.offsetX)*w.scaleX,ht=(c[l+1]+w.offsetY)*w.scaleY;if(Y>=ht)return;const bt=k[d],St=k[d+1],Pt=k[d+2],x=k[D],s=k[D+1],o=k[D+2],a=k[b],h=k[b+1],u=k[b+2],S=Math.round(Y),O=Math.round(ht);let j,st,tt,at,dt,gt,ct,xt;for(let Ot=S;Ot<=O;Ot++){if(Ot<lt){const nt=Ot<Y?0:(Y-Ot)/(Y-lt);j=T-(T-it)*nt,st=bt-(bt-x)*nt,tt=St-(St-s)*nt,at=Pt-(Pt-o)*nt}else{let nt;Ot>ht?nt=1:lt===ht?nt=0:nt=(lt-Ot)/(lt-ht),j=it-(it-G)*nt,st=x-(x-a)*nt,tt=s-(s-h)*nt,at=o-(o-u)*nt}let Et;Ot<Y?Et=0:Ot>ht?Et=1:Et=(Y-Ot)/(Y-ht),dt=T-(T-G)*Et,gt=bt-(bt-a)*Et,ct=St-(St-h)*Et,xt=Pt-(Pt-u)*Et;const Lt=Math.round(Math.min(j,dt)),mt=Math.round(Math.max(j,dt));let et=$*Ot+Lt*4;for(let nt=Lt;nt<=mt;nt++)Et=(j-nt)/(j-dt),Et<0?Et=0:Et>1&&(Et=1),g[et++]=st-(st-gt)*Et|0,g[et++]=tt-(tt-ct)*Et|0,g[et++]=at-(at-xt)*Et|0,g[et++]=255}}function m(_,w,P){const A=w.coords,l=w.colors;let d,D;switch(w.type){case"lattice":const b=w.verticesPerRow,c=Math.floor(A.length/b)-1,k=b-1;for(d=0;d<c;d++){let g=d*b;for(let $=0;$<k;$++,g++)C(_,P,A[g],A[g+1],A[g+b],l[g],l[g+1],l[g+b]),C(_,P,A[g+b+1],A[g+1],A[g+b],l[g+b+1],l[g+1],l[g+b])}break;case"triangles":for(d=0,D=A.length;d<D;d+=3)C(_,P,A[d],A[d+1],A[d+2],l[d],l[d+1],l[d+2]);break;default:throw new Error("illegal figure")}}class I extends ut{constructor(w){super(),this._coords=w[2],this._colors=w[3],this._figures=w[4],this._bounds=w[5],this._bbox=w[7],this._background=w[8],this.matrix=null}_createMeshCanvas(w,P,A){const b=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),k=Math.ceil(this._bounds[2])-b,g=Math.ceil(this._bounds[3])-c,$=Math.min(Math.ceil(Math.abs(k*w[0]*1.1)),3e3),V=Math.min(Math.ceil(Math.abs(g*w[1]*1.1)),3e3),T=k/$,Y=g/V,it={coords:this._coords,colors:this._colors,offsetX:-b,offsetY:-c,scaleX:1/T,scaleY:1/Y}
3,lt=$+2*2,G=V+2*2,ht=A.getCanvas("mesh",lt,G,!1),bt=ht.context,St=bt.createImageData($,V);if(P){const x=St.data;for(let s=0,o=x.length;s<o;s+=4)x[s]=P[0],x[s+1]=P[1],x[s+2]=P[2],x[s+3]=255}for(const x of this._figures)m(St,x,it);return bt.putImageData(St,2,2),{canvas:ht.canvas,offsetX:b-2*T,offsetY:c-2*Y,scaleX:T,scaleY:Y}}getPattern(w,P,A,l){H(w,this._bbox);let d;if(l===z.SHADING)d=i.Util.singularValueDecompose2dScale((0,f.getCurrentTransform)(w));else if(d=i.Util.singularValueDecompose2dScale(P.baseTransform),this.matrix){const b=i.Util.singularValueDecompose2dScale(this.matrix);d=[d[0]*b[0],d[1]*b[1]]}const D=this._createMeshCanvas(d,l===z.SHADING?null:this._background,P.cachedCanvases);return l!==z.SHADING&&(w.setTransform(...P.baseTransform),this.matrix&&w.transform(...this.matrix)),w.translate(D.offsetX,D.offsetY),w.scale(D.scaleX,D.scaleY),w.createPattern(D.canvas,"no-repeat")}}class N extends ut{getPattern(){return"hotpink"}}function R(_){switch(_[0]){case"RadialAxial":return new M(_);case"Mesh":return new I(_);case"Dummy":return new N}throw new Error(`Unknown IR type: ${_[0]}`)}const E={COLORED:1,UNCOLORED:2},p=class p{constructor(w,P,A,l,d){this.operatorList=w[2],this.matrix=w[3]||[1,0,0,1,0,0],this.bbox=w[4],this.xstep=w[5],this.ystep=w[6],this.paintType=w[7],this.tilingType=w[8],this.color=P,this.ctx=A,this.canvasGraphicsFactory=l,this.baseTransform=d}createPatternCanvas(w){const P=this.operatorList,A=this.bbox,l=this.xstep,d=this.ystep,D=this.paintType,b=this.tilingType,c=this.color,k=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+b);const g=A[0],$=A[1],V=A[2],T=A[3],Y=i.Util.singularValueDecompose2dScale(this.matrix),it=i.Util.singularValueDecompose2dScale(this.baseTransform),lt=[Y[0]*it[0],Y[1]*it[1]],G=this.getSizeAndScale(l,this.ctx.canvas.width,lt[0]),ht=this.getSizeAndScale(d,this.ctx.canvas.height,lt[1]),bt=w.cachedCanvases.getCanvas("pattern",G.size,ht.size,!0),St=bt.context,Pt=k.createCanvasGraphics(St);Pt.groupLevel=w.groupLevel,this.setFillAndStrokeStyleToContext(Pt,D,c);let x=g,s=$,o=V,a=T;return g<0&&(x=0,o+=Math.abs(g)),$<0&&(s=0,a+=Math.abs($)),St.translate(-(G.scale*x),-(ht.scale*s)),Pt.transform(G.scale,0,0,ht.scale,0,0),St.save(),this.clipBbox(Pt,x,s,o,a),Pt.baseTransform=(0,f.getCurrentTransform)(Pt.ctx),Pt.executeOperatorList(P),Pt.endDrawing(),{canvas:bt.canvas,scaleX:G.scale,scaleY:ht.scale,offsetX:x,offsetY:s}}getSizeAndScale(w,P,A){w=Math.abs(w);const l=Math.max(p.MAX_PATTERN_SIZE,P);let d=Math.ceil(w*A);return d>=l?d=l:A=d/w,{scale:A,size:d}}clipBbox(w,P,A,l,d){const D=l-P,b=d-A;w.ctx.rect(P,A,D,b),w.current.updateRectMinMax((0,f.getCurrentTransform)(w.ctx),[P,A,l,d]),w.clip(),w.endPath()}setFillAndStrokeStyleToContext(w,P,A){const l=w.ctx,d=w.current;switch(P){case E.COLORED:const D=this.ctx;l.fillStyle=D.fillStyle,l.strokeStyle=D.strokeStyle,d.fillColor=D.fillStyle,d.strokeColor=D.strokeStyle;break;case E.UNCOLORED:const b=i.Util.makeHexColor(A[0],A[1],A[2]);l.fillStyle=b,l.strokeStyle=b,d.fillColor=b,d.strokeColor=b;break;default:throw new i.FormatError(`Unsupported paint type: ${P}`)}}getPattern(w,P,A,l){let d=A;l!==z.SHADING&&(d=i.Util.transform(d,P.baseTransform),this.matrix&&(d=i.Util.transform(d,this.matrix)));const D=this.createPatternCanvas(P);let b=new DOMMatrix(d);b=b.translate(D.offsetX,D.offsetY),b=b.scale(1/D.scaleX,1/D.scaleY);const c=w.createPattern(D.canvas,"repeat");return c.setTransform(b),c}};ne(p,"MAX_PATTERN_SIZE",3e3);let v=p;n.TilingPattern=v},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.convertBlackAndWhiteToRGBA=z,n.convertToRGBA=f,n.grayToRGBA=ut;var i=L(1);function f(M){switch(M.kind){case i.ImageKind.GRAYSCALE_1BPP:return z(M);case i.ImageKind.RGB_24BPP:return H(M)}return null}function z({src:M,srcPos:C=0,dest:m,width:I,height:N,nonBlackColor:R=4294967295,inverseDecode:E=!1}){const v=i.FeatureTest.isLittleEndian?4278190080:255,[p,_]=E?[R,v]:[v,R],w=I>>3,P=I&7,A=M.length;m=new Uint32Array(m.buffer);let l=0;for(let d=0;d<N;d++){for(const b=C+w;C<b;C++){const c=C<A?M[C]:255;m[l++]=c&128?_:p,m[l++]=c&64?_:p,m[l++]=c&32?_:p,m[l++]=c&16?_:p,m[l++]=c&8?_:p,m[l++]=c&4?_:p,m[l++]=c&2?_:p,m[l++]=c&1?_:p}if(P===0)continue;const D=C<A?M[C++]:255;for(let b=0;b<P;b++)m[l++]=D&1<<7-b?_:p}return{srcPos:C,destPos:l}}function H({src:M,srcPos:C=0,dest:m,destPos:I=0,width:N,height:R}){let E=0;const v=M.length>>2,p=new Uint32Array(M.buffer,C,v);if(i.FeatureTest.isLittleEndian){for(;E<v-2;E+=3,I+=4){const _=p[E],w=p[E+1],P=p[E+2];m[I]=_|4278190080,m[I+1]=_>>>24|w<<8|4278190080,m[I+2]=w>>>16|P<<16|4278190080,m[I+3]=P>>>8|4278190080}for(let _=E*4,w=M.length;_<w;_+=3)m[I++]=M[_]|M[_+1]<<8|M[_+2]<<16|4278190080}else{for(;E<v-2;E+=3,I+=4){const _=p[E],w=p[E+1],P=p[E+2];m[I]=_|255,m[I+1]=_<<24|w>>>8|255,m[I+2]=w<<16|P>>>16|255,m[I+3]=P<<8|255}for(let _=E*4,w=M.length;_<w;_+=3)m[I++]=M[_]<<24|M[_+1]<<16|M[_+2]<<8|255}return{srcPos:C,destPos:I}}function ut(M,C){if(i.FeatureTest.isLittleEndian)for(let m=0,I=M.length;m<I;m++)C[m]=M[m]*65793|4278190080;else for(let m=0,I=M.length;m<I;m++)C[m]=M[m]*16843008|255}},(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlobalWorkerOptions=void 0;const L=Object.create(null);n.GlobalWorkerOptions=L,L.workerPort=null,L.workerSrc=""},(F,n,L)=>{var M,kn,m,Fn,N,Re;Object.defineProperty(n,"__esModule",{value:!0}),n.MessageHandler=void 0;var i=L(1);const f={UNKNOWN:0,DATA:1,ERROR:2},z={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function H(E){switch(E instanceof Error||typeof E=="object"&&E!==null||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),E.name){case"AbortException":return new i.AbortException(E.message);case"MissingPDFException":return new i.MissingPDFException(E.message);case"PasswordException":return new i.PasswordException(E.message,E.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(E.message,E.status);case"UnknownErrorException":return new i.UnknownErrorException(E.message,E.details);default:return new i.UnknownErrorException(E.message,E.toString())}}class ut{constructor(v,p,_){W(this,M);W(this,m);W(this,N);this.sourceName=v,this.targetName=p,this.comObj=_,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=w=>{const P=w.data;if(P.targetName!==this.sourceName)return;if(P.stream){q(this,m,Fn).call(this,P);return}if(P.callback){const l=P.callbackId,d=this.callbackCapabilities[l];if(!d)throw new Error(`Cannot resolve callback ${l}`);if(delete this.callbackCapabilities[l],P.callback===f.DATA)d.resolve(P.data);else if(P.callback===f.ERROR)d.reject(H(P.reason));else throw new Error("Unexpected callback case");return}const A=this.actionHandler[P.action];if(!A)throw new Error(`Unknown action from worker: ${P.action}`);if(P.callbackId){const l=this.sourceName,d=P.sourceName;new Promise(function(D){D(A(P.data))}).then(function(D){_.postMessage({sourceName:l,targetName:d,callback:f.DATA,callbackId:P.callbackId,data:D})},function(D){_.postMessage({sourceName:l,targetName:d,callback:f.ERROR,callbackId:P.callbackId,reason:H(D)})});return}if(P.streamId){q(this,M,kn).call(this,P);return}A(P.data)},_.addEventListener("message",this._onComObjOnMessage)}on(v,p){const _=this.actionHandler;if(_[v])throw new Error(`There is already an actionName called "${v}"`);_[v]=p}send(v,p,_){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:v,data:p},_)}
3sendWithPromise(v,p,_){const w=this.callbackId++,P=new i.PromiseCapability;this.callbackCapabilities[w]=P;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:v,callbackId:w,data:p},_)}catch(A){P.reject(A)}return P.promise}sendWithStream(v,p,_,w){const P=this.streamId++,A=this.sourceName,l=this.targetName,d=this.comObj;return new ReadableStream({start:D=>{const b=new i.PromiseCapability;return this.streamControllers[P]={controller:D,startCall:b,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:A,targetName:l,action:v,streamId:P,data:p,desiredSize:D.desiredSize},w),b.promise},pull:D=>{const b=new i.PromiseCapability;return this.streamControllers[P].pullCall=b,d.postMessage({sourceName:A,targetName:l,stream:z.PULL,streamId:P,desiredSize:D.desiredSize}),b.promise},cancel:D=>{(0,i.assert)(D instanceof Error,"cancel must have a valid reason");const b=new i.PromiseCapability;return this.streamControllers[P].cancelCall=b,this.streamControllers[P].isClosed=!0,d.postMessage({sourceName:A,targetName:l,stream:z.CANCEL,streamId:P,reason:H(D)}),b.promise}},_)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}M=new WeakSet,kn=function(v){const p=v.streamId,_=this.sourceName,w=v.sourceName,P=this.comObj,A=this,l=this.actionHandler[v.action],d={enqueue(D,b=1,c){if(this.isCancelled)return;const k=this.desiredSize;this.desiredSize-=b,k>0&&this.desiredSize<=0&&(this.sinkCapability=new i.PromiseCapability,this.ready=this.sinkCapability.promise),P.postMessage({sourceName:_,targetName:w,stream:z.ENQUEUE,streamId:p,chunk:D},c)},close(){this.isCancelled||(this.isCancelled=!0,P.postMessage({sourceName:_,targetName:w,stream:z.CLOSE,streamId:p}),delete A.streamSinks[p])},error(D){(0,i.assert)(D instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,P.postMessage({sourceName:_,targetName:w,stream:z.ERROR,streamId:p,reason:H(D)}))},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:v.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[p]=d,new Promise(function(D){D(l(v.data,d))}).then(function(){P.postMessage({sourceName:_,targetName:w,stream:z.START_COMPLETE,streamId:p,success:!0})},function(D){P.postMessage({sourceName:_,targetName:w,stream:z.START_COMPLETE,streamId:p,reason:H(D)})})},m=new WeakSet,Fn=function(v){const p=v.streamId,_=this.sourceName,w=v.sourceName,P=this.comObj,A=this.streamControllers[p],l=this.streamSinks[p];switch(v.stream){case z.START_COMPLETE:v.success?A.startCall.resolve():A.startCall.reject(H(v.reason));break;case z.PULL_COMPLETE:v.success?A.pullCall.resolve():A.pullCall.reject(H(v.reason));break;case z.PULL:if(!l){P.postMessage({sourceName:_,targetName:w,stream:z.PULL_COMPLETE,streamId:p,success:!0});break}l.desiredSize<=0&&v.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=v.desiredSize,new Promise(function(d){var D;d((D=l.onPull)==null?void 0:D.call(l))}).then(function(){P.postMessage({sourceName:_,targetName:w,stream:z.PULL_COMPLETE,streamId:p,success:!0})},function(d){P.postMessage({sourceName:_,targetName:w,stream:z.PULL_COMPLETE,streamId:p,reason:H(d)})});break;case z.ENQUEUE:if((0,i.assert)(A,"enqueue should have stream controller"),A.isClosed)break;A.controller.enqueue(v.chunk);break;case z.CLOSE:if((0,i.assert)(A,"close should have stream controller"),A.isClosed)break;A.isClosed=!0,A.controller.close(),q(this,N,Re).call(this,A,p);break;case z.ERROR:(0,i.assert)(A,"error should have stream controller"),A.controller.error(H(v.reason)),q(this,N,Re).call(this,A,p);break;case z.CANCEL_COMPLETE:v.success?A.cancelCall.resolve():A.cancelCall.reject(H(v.reason)),q(this,N,Re).call(this,A,p);break;case z.CANCEL:if(!l)break;new Promise(function(d){var D;d((D=l.onCancel)==null?void 0:D.call(l,H(v.reason)))}).then(function(){P.postMessage({sourceName:_,targetName:w,stream:z.CANCEL_COMPLETE,streamId:p,success:!0})},function(d){P.postMessage({sourceName:_,targetName:w,stream:z.CANCEL_COMPLETE,streamId:p,reason:H(d)})}),l.sinkCapability.reject(H(v.reason)),l.isCancelled=!0,delete this.streamSinks[p];break;default:throw new Error("Unexpected stream case")}},N=new WeakSet,Re=async function(v,p){var _,w,P;await Promise.allSettled([(_=v.startCall)==null?void 0:_.promise,(w=v.pullCall)==null?void 0:w.promise,(P=v.cancelCall)==null?void 0:P.promise]),delete this.streamControllers[p]},n.MessageHandler=ut},(F,n,L)=>{var z,H;Object.defineProperty(n,"__esModule",{value:!0}),n.Metadata=void 0;var i=L(1);class f{constructor({parsedData:M,rawData:C}){W(this,z,void 0);W(this,H,void 0);rt(this,z,M),rt(this,H,C)}getRaw(){return t(this,H)}get(M){return t(this,z).get(M)??null}getAll(){return(0,i.objectFromMap)(t(this,z))}has(M){return t(this,z).has(M)}}z=new WeakMap,H=new WeakMap,n.Metadata=f},(F,n,L)=>{var M,C,m,I,N,R,en;Object.defineProperty(n,"__esModule",{value:!0}),n.OptionalContentConfig=void 0;var i=L(1),f=L(8);const z=Symbol("INTERNAL");class H{constructor(p,_){W(this,M,!0);this.name=p,this.intent=_}get visible(){return t(this,M)}_setVisible(p,_){p!==z&&(0,i.unreachable)("Internal method `_setVisible` called."),rt(this,M,_)}}M=new WeakMap;class ut{constructor(p){W(this,R);W(this,C,null);W(this,m,new Map);W(this,I,null);W(this,N,null);if(this.name=null,this.creator=null,p!==null){this.name=p.name,this.creator=p.creator,rt(this,N,p.order);for(const _ of p.groups)t(this,m).set(_.id,new H(_.name,_.intent));if(p.baseState==="OFF")for(const _ of t(this,m).values())_._setVisible(z,!1);for(const _ of p.on)t(this,m).get(_)._setVisible(z,!0);for(const _ of p.off)t(this,m).get(_)._setVisible(z,!1);rt(this,I,this.getHash())}}
3isVisible(p){if(t(this,m).size===0)return!0;if(!p)return(0,i.warn)("Optional content group not defined."),!0;if(p.type==="OCG")return t(this,m).has(p.id)?t(this,m).get(p.id).visible:((0,i.warn)(`Optional content group not found: ${p.id}`),!0);if(p.type==="OCMD"){if(p.expression)return q(this,R,en).call(this,p.expression);if(!p.policy||p.policy==="AnyOn"){for(const _ of p.ids){if(!t(this,m).has(_))return(0,i.warn)(`Optional content group not found: ${_}`),!0;if(t(this,m).get(_).visible)return!0}return!1}else if(p.policy==="AllOn"){for(const _ of p.ids){if(!t(this,m).has(_))return(0,i.warn)(`Optional content group not found: ${_}`),!0;if(!t(this,m).get(_).visible)return!1}return!0}else if(p.policy==="AnyOff"){for(const _ of p.ids){if(!t(this,m).has(_))return(0,i.warn)(`Optional content group not found: ${_}`),!0;if(!t(this,m).get(_).visible)return!0}return!1}else if(p.policy==="AllOff"){for(const _ of p.ids){if(!t(this,m).has(_))return(0,i.warn)(`Optional content group not found: ${_}`),!0;if(t(this,m).get(_).visible)return!1}return!0}return(0,i.warn)(`Unknown optional content policy ${p.policy}.`),!0}return(0,i.warn)(`Unknown group type ${p.type}.`),!0}setVisibility(p,_=!0){if(!t(this,m).has(p)){(0,i.warn)(`Optional content group not found: ${p}`);return}t(this,m).get(p)._setVisible(z,!!_),rt(this,C,null)}get hasInitialVisibility(){return t(this,I)===null||this.getHash()===t(this,I)}getOrder(){return t(this,m).size?t(this,N)?t(this,N).slice():[...t(this,m).keys()]:null}getGroups(){return t(this,m).size>0?(0,i.objectFromMap)(t(this,m)):null}getGroup(p){return t(this,m).get(p)||null}getHash(){if(t(this,C)!==null)return t(this,C);const p=new f.MurmurHash3_64;for(const[_,w]of t(this,m))p.update(`${_}:${w.visible}`);return rt(this,C,p.hexdigest())}}C=new WeakMap,m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakSet,en=function(p){const _=p.length;if(_<2)return!0;const w=p[0];for(let P=1;P<_;P++){const A=p[P];let l;if(Array.isArray(A))l=q(this,R,en).call(this,A);else if(t(this,m).has(A))l=t(this,m).get(A).visible;else return(0,i.warn)(`Optional content group not found: ${A}`),!0;switch(w){case"And":if(!l)return!1;break;case"Or":if(l)return!0;break;case"Not":return!l;default:return!0}}return w==="And"},n.OptionalContentConfig=ut},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFDataTransportStream=void 0;var i=L(1),f=L(6);class z{constructor({length:C,initialData:m,progressiveDone:I=!1,contentDispositionFilename:N=null,disableRange:R=!1,disableStream:E=!1},v){if((0,i.assert)(v,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=I,this._contentDispositionFilename=N,(m==null?void 0:m.length)>0){const p=m instanceof Uint8Array&&m.byteLength===m.buffer.byteLength?m.buffer:new Uint8Array(m).buffer;this._queuedChunks.push(p)}this._pdfDataRangeTransport=v,this._isStreamingSupported=!E,this._isRangeSupported=!R,this._contentLength=C,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((p,_)=>{this._onReceiveData({begin:p,chunk:_})}),this._pdfDataRangeTransport.addProgressListener((p,_)=>{this._onProgress({loaded:p,total:_})}),this._pdfDataRangeTransport.addProgressiveReadListener(p=>{this._onReceiveData({chunk:p})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:C,chunk:m}){const I=m instanceof Uint8Array&&m.byteLength===m.buffer.byteLength?m.buffer:new Uint8Array(m).buffer;if(C===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(I):this._queuedChunks.push(I);else{const N=this._rangeReaders.some(function(R){return R._begin!==C?!1:(R._enqueue(I),!0)});(0,i.assert)(N,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var C;return((C=this._fullRequestReader)==null?void 0:C._loaded)??0}_onProgress(C){var m,I,N,R;C.total===void 0?(I=(m=this._rangeReaders[0])==null?void 0:m.onProgress)==null||I.call(m,{loaded:C.loaded}):(R=(N=this._fullRequestReader)==null?void 0:N.onProgress)==null||R.call(N,{loaded:C.loaded,total:C.total})}_onProgressiveDone(){var C;(C=this._fullRequestReader)==null||C.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(C){const m=this._rangeReaders.indexOf(C);m>=0&&this._rangeReaders.splice(m,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const C=this._queuedChunks;return this._queuedChunks=null,new H(this,C,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(C,m){if(m<=this._progressiveDataLength)return null;const I=new ut(this,C,m);return this._pdfDataRangeTransport.requestDataRange(C,m),this._rangeReaders.push(I),I}cancelAllRequests(C){var m;(m=this._fullRequestReader)==null||m.cancel(C);for(const I of this._rangeReaders.slice(0))I.cancel(C);this._pdfDataRangeTransport.abort()}}n.PDFDataTransportStream=z;class H{constructor(C,m,I=!1,N=null){this._stream=C,this._done=I||!1,this._filename=(0,f.isPdfFile)(N)?N:null,this._queuedChunks=m||[],this._loaded=0;for(const R of this._queuedChunks)this._loaded+=R.byteLength;
3this._requests=[],this._headersReady=Promise.resolve(),C._fullRequestReader=this,this.onProgress=null}_enqueue(C){this._done||(this._requests.length>0?this._requests.shift().resolve({value:C,done:!1}):this._queuedChunks.push(C),this._loaded+=C.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const C=new i.PromiseCapability;return this._requests.push(C),C.promise}cancel(C){this._done=!0;for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class ut{constructor(C,m,I){this._stream=C,this._begin=m,this._end=I,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(C){if(!this._done){if(this._requests.length===0)this._queuedChunk=C;else{this._requests.shift().resolve({value:C,done:!1});for(const I of this._requests)I.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const m=this._queuedChunk;return this._queuedChunk=null,{value:m,done:!1}}if(this._done)return{value:void 0,done:!0};const C=new i.PromiseCapability;return this._requests.push(C),C.promise}cancel(C){this._done=!0;for(const m of this._requests)m.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFFetchStream=void 0;var i=L(1),f=L(20);function z(I,N,R){return{method:"GET",headers:I,signal:R.signal,mode:"cors",credentials:N?"include":"same-origin",redirect:"follow"}}function H(I){const N=new Headers;for(const R in I){const E=I[R];E!==void 0&&N.append(R,E)}return N}function ut(I){return I instanceof Uint8Array?I.buffer:I instanceof ArrayBuffer?I:((0,i.warn)(`getArrayBuffer - unexpected data format: ${I}`),new Uint8Array(I).buffer)}class M{constructor(N){this.source=N,this.isHttp=/^https?:/i.test(N.url),this.httpHeaders=this.isHttp&&N.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var N;return((N=this._fullRequestReader)==null?void 0:N._loaded)??0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new C(this),this._fullRequestReader}getRangeReader(N,R){if(R<=this._progressiveDataLength)return null;const E=new m(this,N,R);return this._rangeRequestReaders.push(E),E}cancelAllRequests(N){var R;(R=this._fullRequestReader)==null||R.cancel(N);for(const E of this._rangeRequestReaders.slice(0))E.cancel(N)}}n.PDFFetchStream=M;class C{constructor(N){this._stream=N,this._reader=null,this._loaded=0,this._filename=null;const R=N.source;this._withCredentials=R.withCredentials||!1,this._contentLength=R.length,this._headersCapability=new i.PromiseCapability,this._disableRange=R.disableRange||!1,this._rangeChunkSize=R.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!R.disableStream,this._isRangeSupported=!R.disableRange,this._headers=H(this._stream.httpHeaders);const E=R.url;fetch(E,z(this._headers,this._withCredentials,this._abortController)).then(v=>{if(!(0,f.validateResponseStatus)(v.status))throw(0,f.createResponseStatusError)(v.status,E);this._reader=v.body.getReader(),this._headersCapability.resolve();const p=P=>v.headers.get(P),{allowRangeRequests:_,suggestedLength:w}=(0,f.validateRangeRequestCapabilities)({getResponseHeader:p,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=_,this._contentLength=w||this._contentLength,this._filename=(0,f.extractFilenameFromHeader)(p),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var E;await this._headersCapability.promise;const{value:N,done:R}=await this._reader.read();return R?{value:N,done:R}:(this._loaded+=N.byteLength,(E=this.onProgress)==null||E.call(this,{loaded:this._loaded,total:this._contentLength}),{value:ut(N),done:!1})}cancel(N){var R;(R=this._reader)==null||R.cancel(N),this._abortController.abort()}}class m{constructor(N,R,E){this._stream=N,this._reader=null,this._loaded=0;const v=N.source;this._withCredentials=v.withCredentials||!1,this._readCapability=new i.PromiseCapability,this._isStreamingSupported=!v.disableStream,this._abortController=new AbortController,this._headers=H(this._stream.httpHeaders),this._headers.append("Range",`bytes=${R}-${E-1}`);const p=v.url;fetch(p,z(this._headers,this._withCredentials,this._abortController)).then(_=>{if(!(0,f.validateResponseStatus)(_.status))throw(0,f.createResponseStatusError)(_.status,p);this._readCapability.resolve(),this._reader=_.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var E;await this._readCapability.promise;const{value:N,done:R}=await this._reader.read();return R?{value:N,done:R}:(this._loaded+=N.byteLength,(E=this.onProgress)==null||E.call(this,{loaded:this._loaded}),{value:ut(N),done:!1})}cancel(N){var R;(R=this._reader)==null||R.cancel(N),this._abortController.abort()}}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createResponseStatusError=M,n.extractFilenameFromHeader=ut,n.validateRangeRequestCapabilities=H,n.val
3idateResponseStatus=C;var i=L(1),f=L(21),z=L(6);function H({getResponseHeader:m,isHttp:I,rangeChunkSize:N,disableRange:R}){const E={allowRangeRequests:!1,suggestedLength:void 0},v=parseInt(m("Content-Length"),10);return!Number.isInteger(v)||(E.suggestedLength=v,v<=2*N)||R||!I||m("Accept-Ranges")!=="bytes"||(m("Content-Encoding")||"identity")!=="identity"||(E.allowRangeRequests=!0),E}function ut(m){const I=m("Content-Disposition");if(I){let N=(0,f.getFilenameFromContentDispositionHeader)(I);if(N.includes("%"))try{N=decodeURIComponent(N)}catch{}if((0,z.isPdfFile)(N))return N}return null}function M(m,I){return m===404||m===0&&I.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+I+'".'):new i.UnexpectedResponseException(`Unexpected server response (${m}) while retrieving PDF "${I}".`,m)}function C(m){return m===200||m===206}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getFilenameFromContentDispositionHeader=f;var i=L(1);function f(z){let H=!0,ut=M("filename\\*","i").exec(z);if(ut){ut=ut[1];let v=N(ut);return v=unescape(v),v=R(v),v=E(v),m(v)}if(ut=I(z),ut){const v=E(ut);return m(v)}if(ut=M("filename","i").exec(z),ut){ut=ut[1];let v=N(ut);return v=E(v),m(v)}function M(v,p){return new RegExp("(?:^|;)\\s*"+v+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',p)}function C(v,p){if(v){if(!/^[\x00-\xFF]+$/.test(p))return p;try{const _=new TextDecoder(v,{fatal:!0}),w=(0,i.stringToBytes)(p);p=_.decode(w),H=!1}catch{}}return p}function m(v){return H&&/[\x80-\xff]/.test(v)&&(v=C("utf-8",v),H&&(v=C("iso-8859-1",v))),v}function I(v){const p=[];let _;const w=M("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(_=w.exec(v))!==null;){let[,A,l,d]=_;if(A=parseInt(A,10),A in p){if(A===0)break;continue}p[A]=[l,d]}const P=[];for(let A=0;A<p.length&&A in p;++A){let[l,d]=p[A];d=N(d),l&&(d=unescape(d),A===0&&(d=R(d))),P.push(d)}return P.join("")}function N(v){if(v.startsWith('"')){const p=v.slice(1).split('\\"');for(let _=0;_<p.length;++_){const w=p[_].indexOf('"');w!==-1&&(p[_]=p[_].slice(0,w),p.length=_+1),p[_]=p[_].replaceAll(/\\(.)/g,"$1")}v=p.join('"')}return v}function R(v){const p=v.indexOf("'");if(p===-1)return v;const _=v.slice(0,p),P=v.slice(p+1).replace(/^[^']*'/,"");return C(_,P)}function E(v){return!v.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(v)?v:v.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(p,_,w,P){if(w==="q"||w==="Q")return P=P.replaceAll("_"," "),P=P.replaceAll(/=([0-9a-fA-F]{2})/g,function(A,l){return String.fromCharCode(parseInt(l,16))}),C(_,P);try{P=atob(P)}catch{}return C(_,P)})}return""}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNetworkStream=void 0;var i=L(1),f=L(20);const z=200,H=206;function ut(N){const R=N.response;return typeof R!="string"?R:(0,i.stringToBytes)(R).buffer}class M{constructor(R,E={}){this.url=R,this.isHttp=/^https?:/i.test(R),this.httpHeaders=this.isHttp&&E.httpHeaders||Object.create(null),this.withCredentials=E.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(R,E,v){const p={begin:R,end:E};for(const _ in v)p[_]=v[_];return this.request(p)}requestFull(R){return this.request(R)}request(R){const E=new XMLHttpRequest,v=this.currXhrId++,p=this.pendingRequests[v]={xhr:E};E.open("GET",this.url),E.withCredentials=this.withCredentials;for(const _ in this.httpHeaders){const w=this.httpHeaders[_];w!==void 0&&E.setRequestHeader(_,w)}return this.isHttp&&"begin"in R&&"end"in R?(E.setRequestHeader("Range",`bytes=${R.begin}-${R.end-1}`),p.expectedStatus=H):p.expectedStatus=z,E.responseType="arraybuffer",R.onError&&(E.onerror=function(_){R.onError(E.status)}),E.onreadystatechange=this.onStateChange.bind(this,v),E.onprogress=this.onProgress.bind(this,v),p.onHeadersReceived=R.onHeadersReceived,p.onDone=R.onDone,p.onError=R.onError,p.onProgress=R.onProgress,E.send(null),v}onProgress(R,E){var p;const v=this.pendingRequests[R];v&&((p=v.onProgress)==null||p.call(v,E))}onStateChange(R,E){var A,l,d;const v=this.pendingRequests[R];if(!v)return;const p=v.xhr;if(p.readyState>=2&&v.onHeadersReceived&&(v.onHeadersReceived(),delete v.onHeadersReceived),p.readyState!==4||!(R in this.pendingRequests))return;if(delete this.pendingRequests[R],p.status===0&&this.isHttp){(A=v.onError)==null||A.call(v,p.status);return}const _=p.status||z;if(!(_===z&&v.expectedStatus===H)&&_!==v.expectedStatus){(l=v.onError)==null||l.call(v,p.status);return}const P=ut(p);if(_===H){const D=p.getResponseHeader("Content-Range"),b=/bytes (\d+)-(\d+)\/(\d+)/.exec(D);v.onDone({begin:parseInt(b[1],10),chunk:P})}else P?v.onDone({begin:0,chunk:P}):(d=v.onError)==null||d.call(v,p.status)}getRequestXhr(R){return this.pendingRequests[R].xhr}isPendingRequest(R){return R in this.pendingRequests}
3abortRequest(R){const E=this.pendingRequests[R].xhr;delete this.pendingRequests[R],E.abort()}}class C{constructor(R){this._source=R,this._manager=new M(R.url,{httpHeaders:R.httpHeaders,withCredentials:R.withCredentials}),this._rangeChunkSize=R.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(R){const E=this._rangeRequestReaders.indexOf(R);E>=0&&this._rangeRequestReaders.splice(E,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new m(this._manager,this._source),this._fullRequestReader}getRangeReader(R,E){const v=new I(this._manager,R,E);return v.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(v),v}cancelAllRequests(R){var E;(E=this._fullRequestReader)==null||E.cancel(R);for(const v of this._rangeRequestReaders.slice(0))v.cancel(R)}}n.PDFNetworkStream=C;class m{constructor(R,E){this._manager=R;const v={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=E.url,this._fullRequestId=R.requestFull(v),this._headersReceivedCapability=new i.PromiseCapability,this._disableRange=E.disableRange||!1,this._contentLength=E.length,this._rangeChunkSize=E.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const R=this._fullRequestId,E=this._manager.getRequestXhr(R),v=w=>E.getResponseHeader(w),{allowRangeRequests:p,suggestedLength:_}=(0,f.validateRangeRequestCapabilities)({getResponseHeader:v,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});p&&(this._isRangeSupported=!0),this._contentLength=_||this._contentLength,this._filename=(0,f.extractFilenameFromHeader)(v),this._isRangeSupported&&this._manager.abortRequest(R),this._headersReceivedCapability.resolve()}_onDone(R){if(R&&(this._requests.length>0?this._requests.shift().resolve({value:R.chunk,done:!1}):this._cachedChunks.push(R.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const E of this._requests)E.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(R){this._storedError=(0,f.createResponseStatusError)(R,this._url),this._headersReceivedCapability.reject(this._storedError);for(const E of this._requests)E.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(R){var E;(E=this.onProgress)==null||E.call(this,{loaded:R.loaded,total:R.lengthComputable?R.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const R=new i.PromiseCapability;return this._requests.push(R),R.promise}cancel(R){this._done=!0,this._headersReceivedCapability.reject(R);for(const E of this._requests)E.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class I{constructor(R,E,v){this._manager=R;const p={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=R.url,this._requestId=R.requestRange(E,v,p),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var R;(R=this.onClosed)==null||R.call(this,this)}_onDone(R){const E=R.chunk;this._requests.length>0?this._requests.shift().resolve({value:E,done:!1}):this._queuedChunk=E,this._done=!0;for(const v of this._requests)v.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(R){this._storedError=(0,f.createResponseStatusError)(R,this._url);for(const E of this._requests)E.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(R){var E;this.isStreamingSupported||(E=this.onProgress)==null||E.call(this,{loaded:R.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const E=this._queuedChunk;return this._queuedChunk=null,{value:E,done:!1}}if(this._done)return{value:void 0,done:!0};const R=new i.PromiseCapability;return this._requests.push(R),R.promise}cancel(R){this._done=!0;for(const E of this._requests)E.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
3(this._requestId),this._close()}}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNodeStream=void 0;var i=L(1),f=L(20);const z=/^file:\/\/\/[a-zA-Z]:\//;function H(v){const p=require$$5,_=p.parse(v);return _.protocol==="file:"||_.host?_:/^[a-z]:[/\\]/i.test(v)?p.parse(`file:///${v}`):(_.host||(_.protocol="file:"),_)}class ut{constructor(p){this.source=p,this.url=H(p.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&p.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var p;return((p=this._fullRequestReader)==null?void 0:p._loaded)??0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new R(this):new I(this),this._fullRequestReader}getRangeReader(p,_){if(_<=this._progressiveDataLength)return null;const w=this.isFsUrl?new E(this,p,_):new N(this,p,_);return this._rangeRequestReaders.push(w),w}cancelAllRequests(p){var _;(_=this._fullRequestReader)==null||_.cancel(p);for(const w of this._rangeRequestReaders.slice(0))w.cancel(p)}}n.PDFNodeStream=ut;class M{constructor(p){this._url=p.url,this._done=!1,this._storedError=null,this.onProgress=null;const _=p.source;this._contentLength=_.length,this._loaded=0,this._filename=null,this._disableRange=_.disableRange||!1,this._rangeChunkSize=_.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!_.disableStream,this._isRangeSupported=!_.disableRange,this._readableStream=null,this._readCapability=new i.PromiseCapability,this._headersCapability=new i.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var w;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const p=this._readableStream.read();return p===null?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=p.length,(w=this.onProgress)==null||w.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(p).buffer,done:!1})}cancel(p){if(!this._readableStream){this._error(p);return}this._readableStream.destroy(p)}_error(p){this._storedError=p,this._readCapability.resolve()}_setReadableStream(p){this._readableStream=p,p.on("readable",()=>{this._readCapability.resolve()}),p.on("end",()=>{p.destroy(),this._done=!0,this._readCapability.resolve()}),p.on("error",_=>{this._error(_)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class C{constructor(p){this._url=p.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new i.PromiseCapability;const _=p.source;this._isStreamingSupported=!_.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var w;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const p=this._readableStream.read();return p===null?(this._readCapability=new i.PromiseCapability,this.read()):(this._loaded+=p.length,(w=this.onProgress)==null||w.call(this,{loaded:this._loaded}),{value:new Uint8Array(p).buffer,done:!1})}cancel(p){if(!this._readableStream){this._error(p);return}this._readableStream.destroy(p)}_error(p){this._storedError=p,this._readCapability.resolve()}_setReadableStream(p){this._readableStream=p,p.on("readable",()=>{this._readCapability.resolve()}),p.on("end",()=>{p.destroy(),this._done=!0,this._readCapability.resolve()}),p.on("error",_=>{this._error(_)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function m(v,p){return{protocol:v.protocol,auth:v.auth,host:v.hostname,port:v.port,path:v.path,method:"GET",headers:p}}class I extends M{constructor(p){super(p);const _=w=>{if(w.statusCode===404){const d=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=d,this._headersCapability.reject(d);return}this._headersCapability.resolve(),this._setReadableStream(w);const P=d=>this._readableStream.headers[d.toLowerCase()],{allowRangeRequests:A,suggestedLength:l}=(0,f.validateRangeRequestCapabilities)({getResponseHeader:P,isHttp:p.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=A,this._contentLength=l||this._contentLength,this._filename=(0,f.extractFilenameFromHeader)(P)};if(this._request=null,this._url.protocol==="http:"){const w=require$$5;this._request=w.request(m(this._url,p.httpHeaders),_)}else{const w=require$$5;this._request=w.request(m(this._url,p.httpHeaders),_)}this._request.on("error",w=>{this._storedError=w,this._headersCapability.reject(w)}),this._request.end()}}class N extends C{constructor(p,_,w){super(p),this._httpHeaders={};for(const A in p.httpHeaders){const l=p.httpHeaders[A];l!==void 0&&(this._httpHeaders[A]=l)}this._httpHeaders.Range=`bytes=${_}-${w-1}`;const P=A=>{if(A.statusCode===404){const l=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=l;return}this._setReadableStream(A)};if(this._request=null,this._url.protocol==="http:"){const A=require$$5;this._request=A.request(m(this._url,this._httpHeaders),P)}else{const A=require$$5;this._request=A.request(m(this._url,this._httpHeaders),P)}this._request.on("error",A=>{this._storedError=A}),this._request.end()}}class R extends M{constructor(p){super(p);let _=decodeURIComponent(this._url.path);z.test(this._url.href)&&(_=_.replace(/^\//,""));const w=require$$5;w.lstat(_,(P,A)=>{if(P){P.code==="ENOENT"&&(P=new i.MissingPDFException(`Missing PDF "${_}".`)),this._storedError=P,this._headersCapability.reject(P);return}this._contentLength=A.size,this._setReadableStream(w.createReadStream(_)),this._headersCapability.resolve()})}}class E extends C{constructor(p,_,w){super(p);let P=decodeURIComponent(this._url.path);z.test(this._url.href)&&(P=P.replace(/^\//,""));const A=require$$5;this._setReadableStream(A.createReadStream(P,{start:_,end:w-1}))}}},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SVGGraphics=void 0;var i=L(6),f=L(1);const z={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},H="http://www.w3.org/XML/1998/namespace",ut="http://www.w3.org/1999/xlink",M=["butt","round","square"],C=["miter","round","bevel"],m=function(A,l="",d=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!d)return URL.createObjectURL(new Blob([A],{type:l}));const D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
3+/=";let b=`data:${l};base64,`;for(let c=0,k=A.length;c<k;c+=3){const g=A[c]&255,$=A[c+1]&255,V=A[c+2]&255,T=g>>2,Y=(g&3)<<4|$>>4,it=c+1<k?($&15)<<2|V>>6:64,lt=c+2<k?V&63:64;b+=D[T]+D[Y]+D[it]+D[lt]}return b},I=function(){const A=new Uint8Array([137,80,78,71,13,10,26,10]),l=12,d=new Int32Array(256);for(let V=0;V<256;V++){let T=V;for(let Y=0;Y<8;Y++)T=T&1?3988292384^T>>1&2147483647:T>>1&2147483647;d[V]=T}function D(V,T,Y){let it=-1;for(let lt=T;lt<Y;lt++){const G=(it^V[lt])&255,ht=d[G];it=it>>>8^ht}return it^-1}function b(V,T,Y,it){let lt=it;const G=T.length;Y[lt]=G>>24&255,Y[lt+1]=G>>16&255,Y[lt+2]=G>>8&255,Y[lt+3]=G&255,lt+=4,Y[lt]=V.charCodeAt(0)&255,Y[lt+1]=V.charCodeAt(1)&255,Y[lt+2]=V.charCodeAt(2)&255,Y[lt+3]=V.charCodeAt(3)&255,lt+=4,Y.set(T,lt),lt+=T.length;const ht=D(Y,it+4,lt);Y[lt]=ht>>24&255,Y[lt+1]=ht>>16&255,Y[lt+2]=ht>>8&255,Y[lt+3]=ht&255}function c(V,T,Y){let it=1,lt=0;for(let G=T;G<Y;++G)it=(it+(V[G]&255))%65521,lt=(lt+it)%65521;return lt<<16|it}function k(V){if(!f.isNodeJS)return g(V);try{const T=parseInt(process.versions.node)>=8?V:Buffer.from(V),Y=require$$5.deflateSync(T,{level:9});return Y instanceof Uint8Array?Y:new Uint8Array(Y)}catch(T){(0,f.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+T)}return g(V)}function g(V){let T=V.length;const Y=65535,it=Math.ceil(T/Y),lt=new Uint8Array(2+T+it*5+4);let G=0;lt[G++]=120,lt[G++]=156;let ht=0;for(;T>Y;)lt[G++]=0,lt[G++]=255,lt[G++]=255,lt[G++]=0,lt[G++]=0,lt.set(V.subarray(ht,ht+Y),G),G+=Y,ht+=Y,T-=Y;lt[G++]=1,lt[G++]=T&255,lt[G++]=T>>8&255,lt[G++]=~T&65535&255,lt[G++]=(~T&65535)>>8&255,lt.set(V.subarray(ht),G),G+=V.length-ht;const bt=c(V,0,V.length);return lt[G++]=bt>>24&255,lt[G++]=bt>>16&255,lt[G++]=bt>>8&255,lt[G++]=bt&255,lt}function $(V,T,Y,it){const lt=V.width,G=V.height;let ht,bt,St;const Pt=V.data;switch(T){case f.ImageKind.GRAYSCALE_1BPP:bt=0,ht=1,St=lt+7>>3;break;case f.ImageKind.RGB_24BPP:bt=2,ht=8,St=lt*3;break;case f.ImageKind.RGBA_32BPP:bt=6,ht=8,St=lt*4;break;default:throw new Error("invalid format")}const x=new Uint8Array((1+St)*G);let s=0,o=0;for(let j=0;j<G;++j)x[s++]=0,x.set(Pt.subarray(o,o+St),s),o+=St,s+=St;if(T===f.ImageKind.GRAYSCALE_1BPP&&it){s=0;for(let j=0;j<G;j++){s++;for(let st=0;st<St;st++)x[s++]^=255}}const a=new Uint8Array([lt>>24&255,lt>>16&255,lt>>8&255,lt&255,G>>24&255,G>>16&255,G>>8&255,G&255,ht,bt,0,0,0]),h=k(x),u=A.length+l*3+a.length+h.length,S=new Uint8Array(u);let O=0;return S.set(A,O),O+=A.length,b("IHDR",a,S,O),O+=l+a.length,b("IDATA",h,S,O),O+=l+h.length,b("IEND",new Uint8Array(0),S,O),m(S,"image/png",Y)}return function(T,Y,it){const lt=T.kind===void 0?f.ImageKind.GRAYSCALE_1BPP:T.kind;return $(T,lt,Y,it)}}();class N{constructor(){this.fontSizeScale=1,this.fontWeight=z.fontWeight,this.fontSize=0,this.textMatrix=f.IDENTITY_MATRIX,this.fontMatrix=f.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=f.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=z.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(l,d){this.x=l,this.y=d}}function R(A){let l=[];const d=[];for(const D of A){if(D.fn==="save"){l.push({fnId:92,fn:"group",items:[]}),d.push(l),l=l.at(-1).items;continue}D.fn==="restore"?l=d.pop():l.push(D)}return l}function E(A){if(Number.isInteger(A))return A.toString();const l=A.toFixed(10);let d=l.length-1;if(l[d]!=="0")return l;do d--;while(l[d]==="0");return l.substring(0,l[d]==="."?d:d+1)}function v(A){if(A[4]===0&&A[5]===0){if(A[1]===0&&A[2]===0)return A[0]===1&&A[3]===1?"":`scale(${E(A[0])} ${E(A[3])})`;if(A[0]===A[3]&&A[1]===-A[2]){const l=Math.acos(A[0])*180/Math.PI;return`rotate(${E(l)})`}}else if(A[0]===1&&A[1]===0&&A[2]===0&&A[3]===1)return`translate(${E(A[4])} ${E(A[5])})`;return`matrix(${E(A[0])} ${E(A[1])} ${E(A[2])} ${E(A[3])} ${E(A[4])} ${E(A[5])})`}let p=0,_=0,w=0;class P{constructor(l,d,D=!1){(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new i.DOMSVGFactory,this.current=ne
vendor: 5,672 bytes, line 3
3w N,this.transformMatrix=f.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=l,this.objs=d,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!D,this._operatorIdMapping=[];for(const b in f.OPS)this._operatorIdMapping[f.OPS[b]]=b}getObject(l,d=null){return typeof l=="string"?l.startsWith("g_")?this.commonObjs.get(l):this.objs.get(l):d}save(){this.transformStack.push(this.transformMatrix);const l=this.current;this.extraStack.push(l),this.current=l.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(l){this.save(),this.executeOpTree(l),this.restore()}loadDependencies(l){const d=l.fnArray,D=l.argsArray;for(let b=0,c=d.length;b<c;b++)if(d[b]===f.OPS.dependency)for(const k of D[b]){const g=k.startsWith("g_")?this.commonObjs:this.objs,$=new Promise(V=>{g.get(k,V)});this.current.dependencies.push($)}return Promise.all(this.current.dependencies)}transform(l,d,D,b,c,k){const g=[l,d,D,b,c,k];this.transformMatrix=f.Util.transform(this.transformMatrix,g),this.tgrp=null}getSVG(l,d){this.viewport=d;const D=this._initialize(d);return this.loadDependencies(l).then(()=>(this.transformMatrix=f.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(l)),D))}convertOpList(l){const d=this._operatorIdMapping,D=l.argsArray,b=l.fnArray,c=[];for(let k=0,g=b.length;k<g;k++){const $=b[k];c.push({fnId:$,fn:d[$],args:D[k]})}return R(c)}executeOpTree(l){for(const d of l){const D=d.fn,b=d.fnId,c=d.args;switch(b|0){case f.OPS.beginText:this.beginText();break;case f.OPS.dependency:break;case f.OPS.setLeading:this.setLeading(c);break;case f.OPS.setLeadingMoveText:this.setLeadingMoveText(c[0],c[1]);break;case f.OPS.setFont:this.setFont(c);break;case f.OPS.showText:this.showText(c[0]);break;case f.OPS.showSpacedText:this.showText(c[0]);break;case f.OPS.endText:this.endText();break;case f.OPS.moveText:this.moveText(c[0],c[1]);break;case f.OPS.setCharSpacing:this.setCharSpacing(c[0]);break;case f.OPS.setWordSpacing:this.setWordSpacing(c[0]);break;case f.OPS.setHScale:this.setHScale(c[0]);break;case f.OPS.setTextMatrix:this.setTextMatrix(c[0],c[1],c[2],c[3],c[4],c[5]);break;case f.OPS.setTextRise:this.setTextRise(c[0]);break;case f.OPS.setTextRenderingMode:this.setTextRenderingMode(c[0]);break;case f.OPS.setLineWidth:this.setLineWidth(c[0]);break;case f.OPS.setLineJoin:this.setLineJoin(c[0]);break;case f.OPS.setLineCap:this.setLineCap(c[0]);break;case f.OPS.setMiterLimit:this.setMiterLimit(c[0]);break;case f.OPS.setFillRGBColor:this.setFillRGBColor(c[0],c[1],c[2]);break;case f.OPS.setStrokeRGBColor:this.setStrokeRGBColor(c[0],c[1],c[2]);break;case f.OPS.setStrokeColorN:this.setStrokeColorN(c);break;case f.OPS.setFillColorN:this.setFillColorN(c);break;case f.OPS.shadingFill:this.shadingFill(c[0]);break;case f.OPS.setDash:this.setDash(c[0],c[1]);break;case f.OPS.setRenderingIntent:this.setRenderingIntent(c[0]);break;case f.OPS.setFlatness:this.setFlatness(c[0]);break;case f.OPS.setGState:this.setGState(c[0]);break;case f.OPS.fill:this.fill();break;case f.OPS.eoFill:this.eoFill();break;case f.OPS.stroke:this.stroke();break;case f.OPS.fillStroke:this.fillStroke();break;case f.OPS.eoFillStroke:this.eoFillStroke();break;case f.OPS.clip:this.clip("nonzero");break;case f.OPS.eoClip:this.clip("evenodd");break;case f.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case f.OPS.paintImageXObject:this.paintImageXObject(c[0]);break;case f.OPS.paintInlineImageXObject:this.paintInlineImageXObject(c[0]);break;case f.OPS.paintImageMaskXObject:this.paintImageMaskXObject(c[0]);break;case f.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(c[0],c[1]);break;case f.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case f.OPS.closePath:this.closePath();break;case f.OPS.closeStroke:this.closeStroke();break;case f.OPS.closeFillStroke:this.closeFillStroke();break;case f.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case f.OPS.nextLine:this.nextLine();break;case f.OPS.transform:this.transform(c[0],c[1],c[2],c[3],c[4],c[5]);break;case f.OPS.constructPath:this.constructPath(c[0],c[1]);break;case f.OPS.endPath:this.endPath();break;case 92:this.group(d.items);break;default:(0,f.warn)(`Unimplemented operator ${D}`);break}}}setWordSpacing(l){this.current.wordSpacing=l}setCharSpacing(l){this.current.charSpacing=l}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(l,d,D,b,c,k){const g=this.current;g.textMatrix=g.lineMatrix=[l,d,D,b,c,k],g.textMatrixScale=Math.hypot(l,d),g.x=g.lineX=0,g.y=g.lineY=0,g.xcoords=[],g.ycoords=[],g.tspan=this.svgFactory.createElement("svg:tspan"),g.tspan.setAttributeNS(null,"font-family",g.fontFamily),g.tspan.setAttributeNS(null,"font-size",`${E(g.fontSize)}px`),g.tspan.setAttributeNS(null,"y",E(-g.y)),g.txtElement=this.svgFactory.createElement("svg:text"),g.txtElement.append(g.tspan)}beginText(){const l=this.current;l.x=l.lineX=0,l.y=l.lineY=0,l.textMatrix=f.IDENTITY_MATRIX,l.lineMatrix=f.IDENTITY_MATRIX,l.textMatrixScale=1,l.tspan=this.svgFactory.createElement("svg:tspan"),l.txtElement=this.svgFactory.createElement("svg:text"),l.txtgrp=this.svgFactory.createElement("svg:g"),l.xcoords=[],l.ycoords=[]}moveText(l,d){const D=this.current;D.x=D.lineX+=l,D.y=D.lineY+=d,D.xcoords=[],D.ycoords=[],D.tspan=this.svgFactory.createElement("svg:tspan"),D.tspan.setAttributeNS(null,"font-family",D.fontFamily),D.tspan.setAttributeNS(null,"font-size",`${E(D.fontSize)}px`),D.tspan.setAttributeNS(null,"y",E(-D.y))}showText(l){const d=this.current,D=d.font,b=d.fontSize;if(b===0)return;
3const c=d.fontSizeScale,k=d.charSpacing,g=d.wordSpacing,$=d.fontDirection,V=d.textHScale*$,T=D.vertical,Y=T?1:-1,it=D.defaultVMetrics,lt=b*d.fontMatrix[0];let G=0;for(const St of l){if(St===null){G+=$*g;continue}else if(typeof St=="number"){G+=Y*St*b/1e3;continue}const Pt=(St.isSpace?g:0)+k,x=St.fontChar;let s,o,a=St.width;if(T){let u;const S=St.vmetric||it;u=St.vmetric?S[1]:a*.5,u=-u*lt;const O=S[2]*lt;a=S?-S[0]:a,s=u/c,o=(G+O)/c}else s=G/c,o=0;(St.isInFont||D.missingFile)&&(d.xcoords.push(d.x+s),T&&d.ycoords.push(-d.y+o),d.tspan.textContent+=x);const h=T?a*lt-Pt*$:a*lt+Pt*$;G+=h}d.tspan.setAttributeNS(null,"x",d.xcoords.map(E).join(" ")),T?d.tspan.setAttributeNS(null,"y",d.ycoords.map(E).join(" ")):d.tspan.setAttributeNS(null,"y",E(-d.y)),T?d.y-=G:d.x+=G*V,d.tspan.setAttributeNS(null,"font-family",d.fontFamily),d.tspan.setAttributeNS(null,"font-size",`${E(d.fontSize)}px`),d.fontStyle!==z.fontStyle&&d.tspan.setAttributeNS(null,"font-style",d.fontStyle),d.fontWeight!==z.fontWeight&&d.tspan.setAttributeNS(null,"font-weight",d.fontWeight);const ht=d.textRenderingMode&f.TextRenderingMode.FILL_STROKE_MASK;if(ht===f.TextRenderingMode.FILL||ht===f.TextRenderingMode.FILL_STROKE?(d.fillColor!==z.fillColor&&d.tspan.setAttributeNS(null,"fill",d.fillColor),d.fillAlpha<1&&d.tspan.setAttributeNS(null,"fill-opacity",d.fillAlpha)):d.textRenderingMode===f.TextRenderingMode.ADD_TO_PATH?d.tspan.setAttributeNS(null,"fill","transparent"):d.tspan.setAttributeNS(null,"fill","none"),ht===f.TextRenderingMode.STROKE||ht===f.TextRenderingMode.FILL_STROKE){const St=1/(d.textMatrixScale||1);this._setStrokeAttributes(d.tspan,St)}let bt=d.textMatrix;d.textRise!==0&&(bt=bt.slice(),bt[5]+=d.textRise),d.txtElement.setAttributeNS(null,"transform",`${v(bt)} scale(${E(V)}, -1)`),d.txtElement.setAttributeNS(H,"xml:space","preserve"),d.txtElement.append(d.tspan),d.txtgrp.append(d.txtElement),this._ensureTransformGroup().append(d.txtElement)}setLeadingMoveText(l,d){this.setLeading(-d),this.moveText(l,d)}addFontStyle(l){if(!l.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const d=m(l.data,l.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${l.loadedName}"; src: url(${d}); } 4`}setFont(l){const d=this.current,D=this.commonObjs.get(l[0]);let b=l[1];d.font=D,this.embedFonts&&!D.missingFile&&!this.embeddedFonts[D.loadedName]&&(this.addFontStyle(D),this.embeddedFonts[D.loadedName]=D),d.fontMatrix=D.fontMatrix||f.FONT_IDENTITY_MATRIX;let c="normal";D.black?c="900":D.bold&&(c="bold");const k=D.italic?"italic":"normal";b<0?(b=-b,d.fontDirection=-1):d.fontDirection=1,d.fontSize=b,d.fontFamily=D.loadedName,d.fontWeight=c,d.fontStyle=k,d.tspan=this.svgFactory.createElement("svg:tspan"),d.tspan.setAttributeNS(null,"y",E(-d.y)),d.xcoords=[],d.ycoords=[]}endText(){var d;const l=this.current;l.textRenderingMode&f.TextRenderingMode.ADD_TO_PATH_FLAG&&((d=l.txtElement)!=null&&d.hasChildNodes())&&(l.element=l.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(l){l>0&&(this.current.lineWidth=l)}setLineCap(l){this.current.lineCap=M[l]}setLineJoin(l){this.current.lineJoin=C[l]}setMiterLimit(l){this.current.miterLimit=l}setStrokeAlpha(l){this.current.strokeAlpha=l}setStrokeRGBColor(l,d,D){this.current.strokeColor=f.Util.makeHexColor(l,d,D)}setFillAlpha(l){this.current.fillAlpha=l}setFillRGBColor(l,d,D){this.current.fillColor=f.Util.makeHexColor(l,d,D),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(l){this.current.strokeColor=this._makeColorN_Pattern(l)}setFillColorN(l){this.current.fillColor=this._makeColorN_Pattern(l)}shadingFill(l){const{width:d,height:D}=this.viewport,b=f.Util.inverseTransform(this.transformMatrix),[c,k,g,$]=f.Util.getAxialAlignedBoundingBox([0,0,d,D],b),V=this.svgFactory.createElement("svg:rect");V.setAttributeNS(null,"x",c),V.setAttributeNS(null,"y",k),V.setAttributeNS(null,"width",g-c),V.setAttributeNS(null,"height",$-k),V.setAttributeNS(null,"fill",this._makeShadingPattern(l)),this.current.fillAlpha<1&&V.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(V)}_makeColorN_Pattern(l){return l[0]==="TilingPattern"?this._makeTilingPattern(l):this._makeShadingPattern(l)}_makeTilingPattern(l){const d=l[1],D=l[2],b=l[3]||f.IDENTITY_MATRIX,[c,k,g,$]=l[4],V=l[5],T=l[6],Y=l[7],it=`shading${w++}`,[lt,G,ht,bt]=f.Util.normalizeRect([...f.Util.applyTransform([c,k],b),...f.Util.applyTransform([g,$],b)]),[St,Pt]=f.Util.singularValueDecompose2dScale(b),x=V*St,s=T*Pt,o=this.svgFactory.createElement("svg:pattern");o.setAttributeNS(null,"id",it),o.setAttributeNS(null,"patternUnits","userSpaceOnUse"),o.setAttributeNS(null,"width",x),o.setAttributeNS(null,"height",s),o.setAttributeNS(null,"x",`${lt}`),o.setAttributeNS(null,"y",`${G}`);const a=this.svg,h=this.transformMatrix,u=this.current.fillColor,S=this.current.strokeColor,O=this.svgFactory.create(ht-lt,bt-G);if(this.svg=O,this.transformMatrix=b,Y===2){const j=f.Util.makeHexColor(...d);this.current.fillColor=j,this.current.strokeColor=j}return this.executeOpTree(this.convertOpList(D)),this.svg=a,this.transformMatrix=h,this.current.fillColor=u,this.current.strokeColor=S,o.append(O.childNodes[0]),this.defs.append(o),`url(#${it})`}_makeShadingPattern(l){switch(typeof l=="string"&&(l=this.objs.get(l)),l[0]){case"RadialAxial":const d=`shading${w++}`,D=l[3];let b;switch(l[1]){case"axial":const c=l[4],k=l[5];b=this.svgFactory.createElement("svg:linearGradient"),b.setAttributeNS(null,"id",d),b.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),b.setAttributeNS(null,"x1",c[0]),b.setAttributeNS(null,"y1",c[1]),b.setAttributeNS(null,"x2",k[0]),b.setAttributeNS(null,"y2",k[1]);break;case"radial":const g=l[4],$=l[5],V=l[6],T=l[7];b=this.svgFactory.createElement("svg:radialGradient"),b.setAttributeNS(null,"id",d),b.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),b.setAttributeNS(null,"cx",$[0]),b.setAttributeNS(null,"cy",$[1]),b.setAttributeNS(null,"r",T),b.setAttributeNS(null,"fx",g[0]),b.setAttributeNS(null,"fy",g[1]),b.setAttributeNS(null,"fr",V);break;default:throw new Error(`Unknown RadialAxial type: ${l[1]}`)}for(const c of D){const k=this.svgFactory.createElement("svg:stop");
4k.setAttributeNS(null,"offset",c[0]),k.setAttributeNS(null,"stop-color",c[1]),b.append(k)}return this.defs.append(b),`url(#${d})`;case"Mesh":return(0,f.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${l[0]}`)}}setDash(l,d){this.current.dashArray=l,this.current.dashPhase=d}constructPath(l,d){const D=this.current;let b=D.x,c=D.y,k=[],g=0;for(const $ of l)switch($|0){case f.OPS.rectangle:b=d[g++],c=d[g++];const V=d[g++],T=d[g++],Y=b+V,it=c+T;k.push("M",E(b),E(c),"L",E(Y),E(c),"L",E(Y),E(it),"L",E(b),E(it),"Z");break;case f.OPS.moveTo:b=d[g++],c=d[g++],k.push("M",E(b),E(c));break;case f.OPS.lineTo:b=d[g++],c=d[g++],k.push("L",E(b),E(c));break;case f.OPS.curveTo:b=d[g+4],c=d[g+5],k.push("C",E(d[g]),E(d[g+1]),E(d[g+2]),E(d[g+3]),E(b),E(c)),g+=6;break;case f.OPS.curveTo2:k.push("C",E(b),E(c),E(d[g]),E(d[g+1]),E(d[g+2]),E(d[g+3])),b=d[g+2],c=d[g+3],g+=4;break;case f.OPS.curveTo3:b=d[g+2],c=d[g+3],k.push("C",E(d[g]),E(d[g+1]),E(b),E(c),E(b),E(c)),g+=4;break;case f.OPS.closePath:k.push("Z");break}k=k.join(" "),D.path&&l.length>0&&l[0]!==f.OPS.rectangle&&l[0]!==f.OPS.moveTo?k=D.path.getAttributeNS(null,"d")+k:(D.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(D.path)),D.path.setAttributeNS(null,"d",k),D.path.setAttributeNS(null,"fill","none"),D.element=D.path,D.setCurrentPoint(b,c)}endPath(){const l=this.current;if(l.path=null,!this.pendingClip)return;if(!l.element){this.pendingClip=null;return}const d=`clippath${p++}`,D=this.svgFactory.createElement("svg:clipPath");D.setAttributeNS(null,"id",d),D.setAttributeNS(null,"transform",v(this.transformMatrix));const b=l.element.cloneNode(!0);if(this.pendingClip==="evenodd"?b.setAttributeNS(null,"clip-rule","evenodd"):b.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,D.append(b),this.defs.append(D),l.activeClipUrl){l.clipGroup=null;for(const c of this.extraStack)c.clipGroup=null;D.setAttributeNS(null,"clip-path",l.activeClipUrl)}l.activeClipUrl=`url(#${d})`,this.tgrp=null}clip(l){this.pendingClip=l}closePath(){const l=this.current;if(l.path){const d=`${l.path.getAttributeNS(null,"d")}Z`;l.path.setAttributeNS(null,"d",d)}}setLeading(l){this.current.leading=-l}setTextRise(l){this.current.textRise=l}setTextRenderingMode(l){this.current.textRenderingMode=l}setHScale(l){this.current.textHScale=l/100}setRenderingIntent(l){}setFlatness(l){}setGState(l){for(const[d,D]of l)switch(d){case"LW":this.setLineWidth(D);break;case"LC":this.setLineCap(D);break;case"LJ":this.setLineJoin(D);break;case"ML":this.setMiterLimit(D);break;case"D":this.setDash(D[0],D[1]);break;case"RI":this.setRenderingIntent(D);break;case"FL":this.setFlatness(D);break;case"Font":this.setFont(D);break;case"CA":this.setStrokeAlpha(D);break;case"ca":this.setFillAlpha(D);break;default:(0,f.warn)(`Unimplemented graphic state operator ${d}`);break}}fill(){const l=this.current;l.element&&(l.element.setAttributeNS(null,"fill",l.fillColor),l.element.setAttributeNS(null,"fill-opacity",l.fillAlpha),this.endPath())}stroke(){const l=this.current;l.element&&(this._setStrokeAttributes(l.element),l.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(l,d=1){const D=this.current;let b=D.dashArray;d!==1&&b.length>0&&(b=b.map(function(c){return d*c})),l.setAttributeNS(null,"stroke",D.strokeColor),l.setAttributeNS(null,"stroke-opacity",D.strokeAlpha),l.setAttributeNS(null,"stroke-miterlimit",E(D.miterLimit)),l.setAttributeNS(null,"stroke-linecap",D.lineCap),l.setAttributeNS(null,"stroke-linejoin",D.lineJoin),l.setAttributeNS(null,"stroke-width",E(d*D.lineWidth)+"px"),l.setAttributeNS(null,"stroke-dasharray",b.map(E).join(" ")),l.setAttributeNS(null,"stroke-dashoffset",E(d*D.dashPhase)+"px")}eoFill(){var l;(l=this.current.element)==null||l.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var l;(l=this.current.element)==null||l.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width","1px"),l.setAttributeNS(null,"height","1px"),l.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(l)}paintImageXObject(l){const d=this.getObject(l);
4if(!d){(0,f.warn)(`Dependent image with object ID ${l} is not ready yet`);return}this.paintInlineImageXObject(d)}paintInlineImageXObject(l,d){const D=l.width,b=l.height,c=I(l,this.forceDataSchema,!!d),k=this.svgFactory.createElement("svg:rect");k.setAttributeNS(null,"x","0"),k.setAttributeNS(null,"y","0"),k.setAttributeNS(null,"width",E(D)),k.setAttributeNS(null,"height",E(b)),this.current.element=k,this.clip("nonzero");const g=this.svgFactory.createElement("svg:image");g.setAttributeNS(ut,"xlink:href",c),g.setAttributeNS(null,"x","0"),g.setAttributeNS(null,"y",E(-b)),g.setAttributeNS(null,"width",E(D)+"px"),g.setAttributeNS(null,"height",E(b)+"px"),g.setAttributeNS(null,"transform",`scale(${E(1/D)} ${E(-1/b)})`),d?d.append(g):this._ensureTransformGroup().append(g)}paintImageMaskXObject(l){const d=this.getObject(l.data,l);if(d.bitmap){(0,f.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const D=this.current,b=d.width,c=d.height,k=D.fillColor;D.maskId=`mask${_++}`;const g=this.svgFactory.createElement("svg:mask");g.setAttributeNS(null,"id",D.maskId);const $=this.svgFactory.createElement("svg:rect");$.setAttributeNS(null,"x","0"),$.setAttributeNS(null,"y","0"),$.setAttributeNS(null,"width",E(b)),$.setAttributeNS(null,"height",E(c)),$.setAttributeNS(null,"fill",k),$.setAttributeNS(null,"mask",`url(#${D.maskId})`),this.defs.append(g),this._ensureTransformGroup().append($),this.paintInlineImageXObject(d,g)}paintFormXObjectBegin(l,d){if(Array.isArray(l)&&l.length===6&&this.transform(l[0],l[1],l[2],l[3],l[4],l[5]),d){const D=d[2]-d[0],b=d[3]-d[1],c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",d[0]),c.setAttributeNS(null,"y",d[1]),c.setAttributeNS(null,"width",E(D)),c.setAttributeNS(null,"height",E(b)),this.current.element=c,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(l){const d=this.svgFactory.create(l.width,l.height),D=this.svgFactory.createElement("svg:defs");d.append(D),this.defs=D;const b=this.svgFactory.createElement("svg:g");return b.setAttributeNS(null,"transform",v(l.transform)),d.append(b),this.svg=b,d}_ensureClipGroup(){if(!this.current.clipGroup){const l=this.svgFactory.createElement("svg:g");l.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(l),this.current.clipGroup=l}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",v(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}n.SVGGraphics=P},(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaText=void 0;class L{static textContent(f){const z=[],H={items:z,styles:Object.create(null)};function ut(M){var I;if(!M)return;let C=null;const m=M.name;if(m==="#text")C=M.value;else if(L.shouldBuildText(m))(I=M==null?void 0:M.attributes)!=null&&I.textContent?C=M.attributes.textContent:M.value&&(C=M.value);else return;if(C!==null&&z.push({str:C}),!!M.children)for(const N of M.children)ut(N)}return ut(f),H}static shouldBuildText(f){return!(f==="textarea"||f==="input"||f==="option"||f==="select")}}n.XfaText=L},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextLayerRenderTask=void 0,n.renderTextLayer=v,n.updateTextLayer=p;var i=L(1),f=L(6);const z=1e5,H=30,ut=.8,M=new Map;function C(_,w){let P;if(w&&i.FeatureTest.isOffscreenCanvasSupported)P=new OffscreenCanvas(_,_).getContext("2d",{alpha:!1});else{const A=document.createElement("canvas");A.width=A.height=_,P=A.getContext("2d",{alpha:!1})}return P}function m(_,w){const P=M.get(_);if(P)return P;const A=C(H,w);A.font=`${H}px ${_}`;const l=A.measureText("");let d=l.fontBoundingBoxAscent,D=Math.abs(l.fontBoundingBoxDescent);if(d){const c=d/(d+D);return M.set(_,c),A.canvas.width=A.canvas.height=0,c}A.strokeStyle="red",A.clearRect(0,0,H,H),A.strokeText("g",0,0);let b=A.getImageData(0,0,H,H).data;D=0;for(let c=b.length-1-3;c>=0;c-=4)if(b[c]>0){D=Math.ceil(c/4/H);break}A.clearRect(0,0,H,H),A.strokeText("A",0,H),b=A.getImageData(0,0,H,H).data,d=0;for(let c=0,k=b.length;c<k;c+=4)if(b[c]>0){d=H-Math.floor(c/4/H);break}if(A.canvas.width=A.canvas.height=0,d){const c=d/(d+D);return M.set(_,c),c}return M.set(_,ut),ut}function I(_,w,P){const A=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:w.str!=="",hasEOL:w.hasEOL,fontSize:0};_._textDivs.push(A);const d=i.Util.transform(_._transform,w.transform);let D=Math.atan2(d[1],d[0]);const b=P[w.fontName];b.vertical&&(D+=Math.PI/2);const c=Math.hypot(d[2],d[3]),k=c*m(b.fontFamily,_._isOffscreenCanvasSupported);let g,$;D===0?(g=d[4],$=d[5]-k):(g=d[4]+k*Math.sin(D),$=d[5]-k*Math.cos(D)
4);const V="calc(var(--scale-factor)*",T=A.style;_._container===_._rootContainer?(T.left=`${(100*g/_._pageWidth).toFixed(2)}%`,T.top=`${(100*$/_._pageHeight).toFixed(2)}%`):(T.left=`${V}${g.toFixed(2)}px)`,T.top=`${V}${$.toFixed(2)}px)`),T.fontSize=`${V}${c.toFixed(2)}px)`,T.fontFamily=b.fontFamily,l.fontSize=c,A.setAttribute("role","presentation"),A.textContent=w.str,A.dir=w.dir,_._fontInspectorEnabled&&(A.dataset.fontName=w.fontName),D!==0&&(l.angle=D*(180/Math.PI));let Y=!1;if(w.str.length>1)Y=!0;else if(w.str!==" "&&w.transform[0]!==w.transform[3]){const it=Math.abs(w.transform[0]),lt=Math.abs(w.transform[3]);it!==lt&&Math.max(it,lt)/Math.min(it,lt)>1.5&&(Y=!0)}Y&&(l.canvasWidth=b.vertical?w.height:w.width),_._textDivProperties.set(A,l),_._isReadableStream&&_._layoutText(A)}function N(_){const{div:w,scale:P,properties:A,ctx:l,prevFontSize:d,prevFontFamily:D}=_,{style:b}=w;let c="";if(A.canvasWidth!==0&&A.hasText){const{fontFamily:k}=b,{canvasWidth:g,fontSize:$}=A;(d!==$||D!==k)&&(l.font=`${$*P}px ${k}`,_.prevFontSize=$,_.prevFontFamily=k);const{width:V}=l.measureText(w.textContent);V>0&&(c=`scaleX(${g*P/V})`)}A.angle!==0&&(c=`rotate(${A.angle}deg) ${c}`),c.length>0&&(b.transform=c)}function R(_){if(_._canceled)return;const w=_._textDivs,P=_._capability;if(w.length>z){P.resolve();return}if(!_._isReadableStream)for(const l of w)_._layoutText(l);P.resolve()}class E{constructor({textContentSource:w,container:P,viewport:A,textDivs:l,textDivProperties:d,textContentItemsStr:D,isOffscreenCanvasSupported:b}){var V;this._textContentSource=w,this._isReadableStream=w instanceof ReadableStream,this._container=this._rootContainer=P,this._textDivs=l||[],this._textContentItemsStr=D||[],this._isOffscreenCanvasSupported=b,this._fontInspectorEnabled=!!((V=globalThis.FontInspector)!=null&&V.enabled),this._reader=null,this._textDivProperties=d||new WeakMap,this._canceled=!1,this._capability=new i.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:A.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:C(0,b)};const{pageWidth:c,pageHeight:k,pageX:g,pageY:$}=A.rawDims;this._transform=[1,0,0,-1,-g,$+k],this._pageWidth=c,this._pageHeight=k,(0,f.setLayerDimensions)(P,A),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(w,P){for(const A of w){if(A.str===void 0){if(A.type==="beginMarkedContentProps"||A.type==="beginMarkedContent"){const l=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),A.id!==null&&this._container.setAttribute("id",`${A.id}`),l.append(this._container)}else A.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(A.str),I(this,A,P)}}_layoutText(w){const P=this._layoutTextParams.properties=this._textDivProperties.get(w);if(this._layoutTextParams.div=w,N(this._layoutTextParams),P.hasText&&this._container.append(w),P.hasEOL){const A=document.createElement("br");A.setAttribute("role","presentation"),this._container.append(A)}}_render(){const w=new i.PromiseCapability;let P=Object.create(null);if(this._isReadableStream){const A=()=>{this._reader.read().then(({value:l,done:d})=>{if(d){w.resolve();return}Object.assign(P,l.styles),this._processItems(l.items,P),A()},w.reject)};this._reader=this._textContentSource.getReader(),A()}else if(this._textContentSource){const{items:A,styles:l}=this._textContentSource;this._processItems(A,l),w.resolve()}else throw new Error('No "textContentSource" parameter specified.');w.promise.then(()=>{P=null,R(this)},this._capability.reject)}}n.TextLayerRenderTask=E;function v(_){!_.textContentSource&&(_.textContent||_.textContentStream)&&((0,f.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),_.textContentSource=_.textContent||_.textContentStream);const{container:w,viewport:P}=_,A=getComputedStyle(w),l=A.getPropertyValue("visibility"),d=parseFloat(A.getPropertyValue("--scale-factor"));l==="visible"&&(!d||Math.abs(d-P.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const D=new E(_);return D._render(),D}function p({container:_,viewport:w,textDivs:P,textDivProperties:A,isOffscreenCanvasSupported:l,mustRotate:d=!0,mustRescale:D=!0}){if(d&&(0,f.setLayerDimensions)(_,{rotation:w.rotation}),D){const b=C(0,l),k={prevFontSize:null,prevFontFamily:null,div:null,scale:w.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:b};for(const g of P)k.properties=A.get(g),k.div=g,N(k)}}},(F,n,L)=>{var m,I,N,R,E,v,p,_,w,P,A,nn,d,ke,b,sn,k,rn;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditorLayer=void 0;var i=L(1),f=L(4),z=L(28),H=L(33),ut=L(6),M=L(34);const $=class ${constructor({uiManager:T,pageIndex:Y,div:it,accessibilityManager:lt,annotationLayer:G,viewport:ht,l10n:bt}){W(this,A);W(this,d);W(this,b);W(this,k);W(this,m,void 0);W(this,I,!1);W(this,N,null);W(this,R,this.pointerup.bind(this));W(this,E,this.pointerdown.bind(this));W(this,v,new Map);W(this,p,!1);W(this,_,!1);W(this,w,!1);W(this,P,void 0);const St=[z.FreeTextEditor,H.InkEditor,M.StampEditor];if(!$._initialized){$._initialized=!0;for(const Pt of St)Pt.initialize(bt)}
4T.registerEditorTypes(St),rt(this,P,T),this.pageIndex=Y,this.div=it,rt(this,m,lt),rt(this,N,G),this.viewport=ht,t(this,P).addLayer(this)}get isEmpty(){return t(this,v).size===0}updateToolbar(T){t(this,P).updateToolbar(T)}updateMode(T=t(this,P).getMode()){q(this,k,rn).call(this),T===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),T!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",T===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",T===i.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",T===i.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(T){if(!T&&t(this,P).getMode()!==i.AnnotationEditorType.INK)return;if(!T){for(const it of t(this,v).values())if(it.isEmpty()){it.setInBackground();return}}q(this,d,ke).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(T){t(this,P).setEditingState(T)}addCommands(T){t(this,P).addCommands(T)}enable(){this.div.style.pointerEvents="auto";const T=new Set;for(const it of t(this,v).values())it.enableEditing(),it.annotationElementId&&T.add(it.annotationElementId);if(!t(this,N))return;const Y=t(this,N).getEditableAnnotations();for(const it of Y){if(it.hide(),t(this,P).isDeletedAnnotationElement(it.data.id)||T.has(it.data.id))continue;const lt=this.deserialize(it);lt&&(this.addOrRebuild(lt),lt.enableEditing())}}disable(){var Y;rt(this,w,!0),this.div.style.pointerEvents="none";const T=new Set;for(const it of t(this,v).values()){if(it.disableEditing(),!it.annotationElementId||it.serialize()!==null){T.add(it.annotationElementId);continue}(Y=this.getEditableAnnotation(it.annotationElementId))==null||Y.show(),it.remove()}if(t(this,N)){const it=t(this,N).getEditableAnnotations();for(const lt of it){const{id:G}=lt.data;T.has(G)||t(this,P).isDeletedAnnotationElement(G)||lt.show()}}q(this,k,rn).call(this),this.isEmpty&&(this.div.hidden=!0),rt(this,w,!1)}getEditableAnnotation(T){var Y;return((Y=t(this,N))==null?void 0:Y.getEditableAnnotation(T))||null}setActiveEditor(T){t(this,P).getActive()!==T&&t(this,P).setActiveEditor(T)}enableClick(){this.div.addEventListener("pointerdown",t(this,E)),this.div.addEventListener("pointerup",t(this,R))}disableClick(){this.div.removeEventListener("pointerdown",t(this,E)),this.div.removeEventListener("pointerup",t(this,R))}attach(T){t(this,v).set(T.id,T);const{annotationElementId:Y}=T;Y&&t(this,P).isDeletedAnnotationElement(Y)&&t(this,P).removeDeletedAnnotationElement(T)}detach(T){var Y;t(this,v).delete(T.id),(Y=t(this,m))==null||Y.removePointerInTextLayer(T.contentDiv),!t(this,w)&&T.annotationElementId&&t(this,P).addDeletedAnnotationElement(T)}remove(T){this.detach(T),t(this,P).removeEditor(T),T.div.contains(document.activeElement)&&setTimeout(()=>{t(this,P).focusMainContainer()},0),T.div.remove(),T.isAttachedToDOM=!1,t(this,_)||this.addInkEditorIfNeeded(!1)}changeParent(T){var Y;T.parent!==this&&(T.annotationElementId&&(t(this,P).addDeletedAnnotationElement(T.annotationElementId),f.AnnotationEditor.deleteAnnotationElement(T),T.annotationElementId=null),this.attach(T),(Y=T.parent)==null||Y.detach(T),T.setParent(this),T.div&&T.isAttachedToDOM&&(T.div.remove(),this.div.append(T.div)))}add(T){if(this.changeParent(T),t(this,P).addEditor(T),this.attach(T),!T.isAttachedToDOM){const Y=T.render();this.div.append(Y),T.isAttachedToDOM=!0}T.fixAndSetPosition(),T.onceAdded(),t(this,P).addToAnnotationStorage(T)}moveEditorInDOM(T){var it;if(!T.isAttachedToDOM)return;const{activeElement:Y}=document;T.div.contains(Y)&&(T._focusEventsAllowed=!1,setTimeout(()=>{T.div.contains(document.activeElement)?T._focusEventsAllowed=!0:(T.div.addEventListener("focusin",()=>{T._focusEventsAllowed=!0},{once:!0}),Y.focus())},0)),T._structTreeParentId=(it=t(this,m))==null?void 0:it.moveElementInDOM(this.div,T.div,T.contentDiv,!0)}addOrRebuild(T){T.needsToBeRebuilt()?T.rebuild():this.add(T)}addUndoableEditor(T){const Y=()=>T._uiManager.rebuild(T),it=()=>{T.remove()};this.addCommands({cmd:Y,undo:it,mustExec:!1})}getNextId(){return t(this,P).getId()}pasteEditor(T,Y){t(this,P).updateToolbar(T),t(this,P).updateMode(T);const{offsetX:it,offsetY:lt}=q(this,b,sn).call(this),G=this.getNextId(),ht=q(this,A,nn).call(this,{parent:this,id:G,x:it,y:lt,uiManager:t(this,P),isCentered:!0,...Y});ht&&this.add(ht)}deserialize(T){switch(T.annotationType??T.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return z.FreeTextEditor.deserialize(T,this,t(this,P));case i.AnnotationEditorType.INK:return H.InkEditor.deserialize(T,this,t(this,P));case i.AnnotationEditorType.STAMP:return M.StampEditor.deserialize(T,this,t(this,P))}return null}addNewEditor(){q(this,d,ke).call(this,q(this,b,sn).call(this),!0)}setSelected(T){t(this,P).setSelected(T)}toggleSelected(T){t(this,P).toggleSelected(T)}isSelected(T){return t(this,P).isSelected(T)}unselect(T){t(this,P).unselect(T)}pointerup(T){const{isMac:Y}=i.FeatureTest.platform;if(!(T.button!==0||T.ctrlKey&&Y)&&T.target===this.div&&t(this,p)){if(rt(this,p,!1),!t(this,I)){rt(this,I,!0);return}if(t(this,P).getMode()===i.AnnotationEditorType.STAMP){t(this,P).unselectAll();return}q(this,d,ke).call(this,T,!1)}}pointerdown(T){if(t(this,p)){rt(this,p,!1);return}const{isMac:Y}=i.FeatureTest.platform;if(T.button!==0||T.ctrlKey&&Y||T.target!==this.div)return;rt(this,p,!0);const it=t(this,P).getActive();rt(this,I,!it||it.isEmpty())}findNewParent(T,Y,it){const lt=t(this,P).findParent(Y,it);return lt===null||lt===this?!1:(lt.changeParent(T),!0)}destroy(){var T,Y;((T=t(this,P).getActive())==null?void 0:T.parent)===this&&(t(this,P).commitOrRemove(),t(this,P).setActiveEditor(null));for(const it of t(this,v).values())(Y=t(this,m))==null||Y.removePointerInTextLayer(it.contentDiv),it.setParent(null),it.isAttachedToDOM=!1,it.div.remove();this.div=null,t(this,v).clear(),t(this,P).removeLayer(this)}render({viewport:T}){this.viewport=T,(0,ut.setLayerDimensions)(this.div,T);for(const Y of t(this,P).getEditors(this.pageIndex))this.add(Y);this.updateMode()}update({viewport:T}){t(this,P).commitOrRemove(),this.viewport=T,(0,ut.setLayerDimensions)(this.div,{rotation:T.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:T,pageHeight:Y}=this.viewport.rawDims;return[T,Y]}};m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakMap,w=new WeakMap,P=new WeakMap,A=new WeakSet,nn=function(T){switch(t(this,P).getMode()){case i.AnnotationEditorType.FREETEXT:return new z.FreeTextEditor(T);case i.AnnotationEditorType.INK:return new H.InkEditor(T);case i.AnnotationEditorType.STAMP:return new M.StampEditor(T)}return null},d=new WeakSet,ke=function(T,Y){const it=this.getNextId(),lt=q(this,A,nn).call(this,{parent:this,id:it,x:T.offsetX,y:T.offsetY,uiManager:t(this,P),isCentered:Y});return lt&&this.add(lt),lt},b=new WeakSet,sn=function(){const{x:T,y:Y,width:it,height:lt}=this.div.getBoundingClientRect(),G=Math.max(0,T),ht=Math.max(0,Y),bt=M
4ath.min(window.innerWidth,T+it),St=Math.min(window.innerHeight,Y+lt),Pt=(G+bt)/2-T,x=(ht+St)/2-Y,[s,o]=this.viewport.rotation%180===0?[Pt,x]:[x,Pt];return{offsetX:s,offsetY:o}},k=new WeakSet,rn=function(){rt(this,_,!0);for(const T of t(this,v).values())T.isEmpty()&&T.remove();rt(this,_,!1)},ne($,"_initialized",!1);let C=$;n.AnnotationEditorLayer=C},(F,n,L)=>{var M,C,m,I,N,R,E,v,p,_,Mn,P,Dn,l,Ln,D,ve,c,an,g,On,V,on;Object.defineProperty(n,"__esModule",{value:!0}),n.FreeTextEditor=void 0;var i=L(1),f=L(5),z=L(4),H=L(29);const Y=class Y extends z.AnnotationEditor{constructor(G){super({...G,name:"freeTextEditor"});W(this,_);W(this,P);W(this,l);W(this,D);W(this,c);W(this,g);W(this,V);W(this,M,this.editorDivBlur.bind(this));W(this,C,this.editorDivFocus.bind(this));W(this,m,this.editorDivInput.bind(this));W(this,I,this.editorDivKeydown.bind(this));W(this,N,void 0);W(this,R,"");W(this,E,`${this.id}-editor`);W(this,v,void 0);W(this,p,null);rt(this,N,G.color||Y._defaultColor||z.AnnotationEditor._defaultLineColor),rt(this,v,G.fontSize||Y._defaultFontSize)}static get _keyboardManager(){const G=Y.prototype,ht=Pt=>Pt.isEmpty(),bt=f.AnnotationEditorUIManager.TRANSLATE_SMALL,St=f.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,i.shadow)(this,"_keyboardManager",new f.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],G.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],G.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],G._translateEmpty,{args:[-bt,0],checker:ht}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],G._translateEmpty,{args:[-St,0],checker:ht}],[["ArrowRight","mac+ArrowRight"],G._translateEmpty,{args:[bt,0],checker:ht}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],G._translateEmpty,{args:[St,0],checker:ht}],[["ArrowUp","mac+ArrowUp"],G._translateEmpty,{args:[0,-bt],checker:ht}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],G._translateEmpty,{args:[0,-St],checker:ht}],[["ArrowDown","mac+ArrowDown"],G._translateEmpty,{args:[0,bt],checker:ht}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],G._translateEmpty,{args:[0,St],checker:ht}]]))}static initialize(G){z.AnnotationEditor.initialize(G,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const ht=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ht.getPropertyValue("--freetext-padding"))}static updateDefaultParams(G,ht){switch(G){case i.AnnotationEditorParamsType.FREETEXT_SIZE:Y._defaultFontSize=ht;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:Y._defaultColor=ht;break}}updateParams(G,ht){switch(G){case i.AnnotationEditorParamsType.FREETEXT_SIZE:q(this,_,Mn).call(this,ht);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:q(this,P,Dn).call(this,ht);break}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,Y._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,Y._defaultColor||z.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,t(this,v)],[i.AnnotationEditorParamsType.FREETEXT_COLOR,t(this,N)]]}_translateEmpty(G,ht){this._uiManager.translateSelectedEditors(G,ht,!0)}getInitialTranslation(){const G=this.parentScale;return[-Y._internalPadding*G,-(Y._internalPadding+t(this,v))*G]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(i.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",t(this,I)),this.editorDiv.addEventListener("focus",t(this,C)),this.editorDiv.addEventListener("blur",t(this,M)),this.editorDiv.addEventListener("input",t(this,m)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",t(this,E)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",t(this,I)),this.editorDiv.removeEventListener("focus",t(this,C)),this.editorDiv.removeEventListener("blur",t(this,M)),this.editorDiv.removeEventListener("input",t(this,m)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(G){this._focusEventsAllowed&&(super.focusin(G),G.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var G;if(this.width){q(this,V,on).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(G=this._initialOptions)!=null&&G.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const G=t(this,R),ht=rt(this,R,q(this,l,Ln).call(this).trimEnd());if(G===ht)return;const bt=St=>{if(rt(this,R,St),!St){this.remove();return}q(this,c,an).call(this),this._uiManager.rebuild(this),q(this,D,ve).call(this)};this.addCommands({cmd:()=>{bt(ht)}
4,undo:()=>{bt(G)},mustExec:!1}),q(this,D,ve).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(G){this.enterInEditMode()}keydown(G){G.target===this.div&&G.key==="Enter"&&(this.enterInEditMode(),G.preventDefault())}editorDivKeydown(G){Y._keyboardManager.exec(this,G)}editorDivFocus(G){this.isEditing=!0}editorDivBlur(G){this.isEditing=!1}editorDivInput(G){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let G,ht;this.width&&(G=this.x,ht=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",t(this,E)),this.enableEditing(),z.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(St=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("aria-label",St)}),z.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(St=>{var Pt;return(Pt=this.editorDiv)==null?void 0:Pt.setAttribute("default-content",St)}),this.editorDiv.contentEditable=!0;const{style:bt}=this.editorDiv;if(bt.fontSize=`calc(${t(this,v)}px * var(--scale-factor))`,bt.color=t(this,N),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,f.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[St,Pt]=this.parentDimensions;if(this.annotationElementId){const{position:x}=t(this,p);let[s,o]=this.getInitialTranslation();[s,o]=this.pageTranslationToScreen(s,o);const[a,h]=this.pageDimensions,[u,S]=this.pageTranslation;let O,j;switch(this.rotation){case 0:O=G+(x[0]-u)/a,j=ht+this.height-(x[1]-S)/h;break;case 90:O=G+(x[0]-u)/a,j=ht-(x[1]-S)/h,[s,o]=[o,-s];break;case 180:O=G-this.width+(x[0]-u)/a,j=ht-(x[1]-S)/h,[s,o]=[-s,-o];break;case 270:O=G+(x[0]-u-this.height*h)/a,j=ht+(x[1]-S-this.width*a)/h,[s,o]=[-o,s];break}this.setAt(O*St,j*Pt,s,o)}else this.setAt(G*St,ht*Pt,this.width*St,this.height*Pt);q(this,c,an).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(G,ht,bt){let St=null;if(G instanceof H.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:x,fontColor:s},rect:o,rotation:a,id:h},textContent:u,textPosition:S,parent:{page:{pageNumber:O}}}=G;if(!u||u.length===0)return null;St=G={annotationType:i.AnnotationEditorType.FREETEXT,color:Array.from(s),fontSize:x,value:u.join(` 5`),position:S,pageIndex:O-1,rect:o,rotation:a,id:h,deleted:!1}}const Pt=super.deserialize(G,ht,bt);return rt(Pt,v,G.fontSize),rt(Pt,N,i.Util.makeHexColor(...G.color)),rt(Pt,R,G.value),Pt.annotationElementId=G.id||null,rt(Pt,p,St),Pt}serialize(G=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ht=Y._internalPadding*this.parentScale,bt=this.getRect(ht,ht),St=z.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:t(this,N)),Pt={annotationType:i.AnnotationEditorType.FREETEXT,color:St,fontSize:t(this,v),value:t(this,R),pageIndex:this.pageIndex,rect:bt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return G?Pt:this.annotationElementId&&!q(this,g,On).call(this,Pt)?null:(Pt.id=this.annotationElementId,Pt)}};M=new WeakMap,C=new WeakMap,m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakSet,Mn=function(G){const ht=St=>{this.editorDiv.style.fontSize=`calc(${St}px * var(--scale-factor))`,this.translate(0,-(St-t(this,v))*this.parentScale),rt(this,v,St),q(this,D,ve).call(this)},bt=t(this,v);this.addCommands({cmd:()=>{ht(G)},undo:()=>{ht(bt)}
5,mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},P=new WeakSet,Dn=function(G){const ht=t(this,N);this.addCommands({cmd:()=>{rt(this,N,this.editorDiv.style.color=G)},undo:()=>{rt(this,N,this.editorDiv.style.color=ht)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},l=new WeakSet,Ln=function(){const G=this.editorDiv.getElementsByTagName("div");if(G.length===0)return this.editorDiv.innerText;const ht=[];for(const bt of G)ht.push(bt.innerText.replace(/\r\n?|\n/,""));return ht.join(` 6`)},D=new WeakSet,ve=function(){const[G,ht]=this.parentDimensions;let bt;if(this.isAttachedToDOM)bt=this.div.getBoundingClientRect();else{const{currentLayer:St,div:Pt}=this,x=Pt.style.display;Pt.style.display="hidden",St.div.append(this.div),bt=Pt.getBoundingClientRect(),Pt.remove(),Pt.style.display=x}this.rotation%180===this.parentRotation%180?(this.width=bt.width/G,this.height=bt.height/ht):(this.width=bt.height/G,this.height=bt.width/ht),this.fixAndSetPosition()},c=new WeakSet,an=function(){if(this.editorDiv.replaceChildren(),!!t(this,R))for(const G of t(this,R).split(` 7`)){const ht=document.createElement("div");ht.append(G?document.createTextNode(G):document.createElement("br")),this.editorDiv.append(ht)}},g=new WeakSet,On=function(G){const{value:ht,fontSize:bt,color:St,rect:Pt,pageIndex:x}=t(this,p);return G.value!==ht||G.fontSize!==bt||G.rect.some((s,o)=>Math.abs(s-Pt[o])>=1)||G.color.some((s,o)=>s!==St[o])||G.pageIndex!==x},V=new WeakSet,on=function(G=!1){if(!this.annotationElementId)return;if(q(this,D,ve).call(this),!G&&(this.width===0||this.height===0)){setTimeout(()=>q(this,V,on).call(this,!0),0);return}const ht=Y._internalPadding*this.parentScale;t(this,p).rect=this.getRect(ht,ht)},ne(Y,"_freeTextDefaultContent",""),ne(Y,"_internalPadding",0),ne(Y,"_defaultColor",null),ne(Y,"_defaultFontSize",10),ne(Y,"_type","freetext");let ut=Y;n.FreeTextEditor=ut},(F,n,L)=>{var o,h,he,S,In,j,st,tt,at,dt,gt,ct,xt,Ot,Et,Lt,mt,et,nt,pt,wt,Ct,jt,Nn,Wt,Fe,Gt,ln,Xt,cn,Z,K,_t,vt,ee,te,Q,hn,Nt,Rt,Bt,Ut,Bn,At,dn;Object.defineProperty(n,"__esModule",{value:!0}),n.StampAnnotationElement=n.InkAnnotationElement=n.FreeTextAnnotationElement=n.AnnotationLayer=void 0;var i=L(1),f=L(6),z=L(3),H=L(30),ut=L(31),M=L(32);const C=1e3,m=9,I=new WeakSet;function N(It){return{width:It[2]-It[0],height:It[3]-It[1]}}class R{static create(B){switch(B.data.annotationType){case i.AnnotationType.LINK:return new v(B);case i.AnnotationType.TEXT:return new p(B);case i.AnnotationType.WIDGET:switch(B.data.fieldType){case"Tx":return new w(B);case"Btn":return B.data.radioButton?new l(B):B.data.checkBox?new A(B):new d(B);case"Ch":return new D(B);case"Sig":return new P(B)}return new _(B);case i.AnnotationType.POPUP:return new b(B);case i.AnnotationType.FREETEXT:return new k(B);case i.AnnotationType.LINE:return new g(B);case i.AnnotationType.SQUARE:return new $(B);case i.AnnotationType.CIRCLE:return new V(B);case i.AnnotationType.POLYLINE:return new T(B);case i.AnnotationType.CARET:return new it(B);case i.AnnotationType.INK:return new lt(B);case i.AnnotationType.POLYGON:return new Y(B);case i.AnnotationType.HIGHLIGHT:return new G(B);case i.AnnotationType.UNDERLINE:return new ht(B);case i.AnnotationType.SQUIGGLY:return new bt(B);case i.AnnotationType.STRIKEOUT:return new St(B);case i.AnnotationType.STAMP:return new Pt(B);case i.AnnotationType.FILEATTACHMENT:return new x(B);default:return new E(B)}}}const a=class a{constructor(B,{isRenderable:e=!1,ignoreBorder:y=!1,createQuadrilaterals:U=!1}={}){W(this,o,!1);this.isRenderable=e,this.data=B.data,this.layer=B.layer,this.linkService=B.linkService,this.downloadManager=B.downloadManager,this.imageResourcesPath=B.imageResourcesPath,this.renderForms=B.renderForms,this.svgFactory=B.svgFactory,this.annotationStorage=B.annotationStorage,this.enableScripting=B.enableScripting,this.hasJSActions=B.hasJSActions,this._fieldObjects=B.fieldObjects,this.parent=B.parent,e&&(this.container=this._createContainer(y)),U&&this._createQuadrilaterals()}static _hasPopupData({titleObj:B,contentsObj:e,richText:y}){return!!(B!=null&&B.str||e!=null&&e.str||y!=null&&y.str)}get hasPopupData(){return a._hasPopupData(this.data)}_createContainer(B){const{data:e,parent:{page:y,viewport:U}}=this,X=document.createElement("section");X.setAttribute("data-annotation-id",e.id),this instanceof _||(X.tabIndex=C),X.style.zIndex=this.parent.zIndex++,this.data.popupRef&&X.setAttribute("aria-haspopup","dialog"),e.noRotate&&X.classList.add("norotate");const{pageWidth:J,pageHeight:ot,pageX:yt,pageY:Ft}=U.rawDims;if(!e.rect||this instanceof b){const{rotation:$t}=e;return!e.hasOwnCanvas&&$t!==0&&this.setRotation($t,X),X}const{width:kt,height:qt}=N(e.rect),Mt=i.Util.normalizeRect([e.rect[0],y.view[3]-e.rect[1]+y.view[1],e.rect[2],y.view[3]-e.rect[3]+y.view[1]]);if(!B&&e.borderStyle.width>0){X.style.borderWidth=`${e.borderStyle.width}px`;const $t=e.borderStyle.horizontalCornerRadius,Yt=e.borderStyle.verticalCornerRadius;if($t>0||Yt>0){const Zt=`calc(${$t}px * var(--scale-factor)) / calc(${Yt}px * var(--scale-factor))`;X.style.borderRadius=Zt}else if(this instanceof l){const Zt=`calc(${kt}px * var(--scale-factor)) / calc(${qt}px * var(--scale-factor))`;X.style.borderRadius=Zt}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:X.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:X.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:X.style.borderBottomStyle="solid";break}const Jt=e.borderColor||null;Jt?(rt(this,o,!0),X.style.borderColor=i.Util.makeHexColor(Jt[0]|0,Jt[1]|0,Jt[2]|0)):X.style.borderWidth=0}X.style.left=`${100*(Mt[0]-yt)/J}%`,X.style.top=`${100*(Mt[1]-Ft)/ot}%`;const{rotation:Dt}=e;return e.hasOwnCanvas||Dt===0?(X.style.width=`${100*kt/J}%`,X.style.height=`${100*qt/ot}%`):this.setRotation(Dt,X),X}setRotation(B,e=this.container){if(!this.data.rect)return;const{pageWidth:y,pageHeight:U}=this.parent.viewport.rawDims,{width:X,height:J}=N(this.data.rect);let ot,yt;B%180===0?(ot=100*X/y,yt=100*J/U):(ot=100*J/y,yt=100*X/U),e.style.width=`${ot}%`,e.style.height=`${yt}%`,e.setAttribute("data-main-rotation",(360-B)%360)}get _commonActions(){const B=(e,y,U)=>{const X=U.detail[e],J=X[0],ot=X.slice(1);U.target.style[y]=H.ColorConverters[`${J}_HTML`](ot),this.annotationStorage.setValue(this.data.id,{[y]:H.ColorConverters[`${J}_rgb`](ot)})};return(0,i.shadow)(this,"_commonActions",{display:e=>{const{display:y}=e.detail,U=y%2===1;this.container.style.visibility=U?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:U,noPrint:y===1||y===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:y}=e.detail;this.container.style.visibility=y?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:y,noView:y})},focus:e=>{setTimeout(()=>
7e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{B("bgColor","backgroundColor",e)},fillColor:e=>{B("fillColor","backgroundColor",e)},fgColor:e=>{B("fgColor","color",e)},textColor:e=>{B("textColor","color",e)},borderColor:e=>{B("borderColor","borderColor",e)},strokeColor:e=>{B("strokeColor","borderColor",e)},rotation:e=>{const y=e.detail.rotation;this.setRotation(y),this.annotationStorage.setValue(this.data.id,{rotation:y})}})}_dispatchEventFromSandbox(B,e){const y=this._commonActions;for(const U of Object.keys(e.detail)){const X=B[U]||y[U];X==null||X(e)}}_setDefaultPropertiesFromJS(B){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const y=this._commonActions;for(const[U,X]of Object.entries(e)){const J=y[U];if(J){const ot={detail:{[U]:X},target:B};J(ot),delete e[U]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:B}=this.data;if(!B)return;const[e,y,U,X]=this.data.rect;if(B.length===1){const[,{x:Yt,y:Jt},{x:Zt,y:ie}]=B[0];if(U===Yt&&X===Jt&&e===Zt&&y===ie)return}const{style:J}=this.container;let ot;if(t(this,o)){const{borderColor:Yt,borderWidth:Jt}=J;J.borderWidth=0,ot=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${Yt}" stroke-width="${Jt}">`],this.container.classList.add("hasBorder")}const yt=U-e,Ft=X-y,{svgFactory:kt}=this,qt=kt.createElement("svg");qt.classList.add("quadrilateralsContainer"),qt.setAttribute("width",0),qt.setAttribute("height",0);const Mt=kt.createElement("defs");qt.append(Mt);const Dt=kt.createElement("clipPath"),$t=`clippath_${this.data.id}`;Dt.setAttribute("id",$t),Dt.setAttribute("clipPathUnits","objectBoundingBox"),Mt.append(Dt);for(const[,{x:Yt,y:Jt},{x:Zt,y:ie}]of B){const se=kt.createElement("rect"),re=(Zt-e)/yt,le=(X-Jt)/Ft,ce=(Yt-Zt)/yt,An=(Jt-ie)/Ft;se.setAttribute("x",re),se.setAttribute("y",le),se.setAttribute("width",ce),se.setAttribute("height",An),Dt.append(se),ot==null||ot.push(`<rect vector-effect="non-scaling-stroke" x="${re}" y="${le}" width="${ce}" height="${An}"/>`)}t(this,o)&&(ot.push("</g></svg>')"),J.backgroundImage=ot.join("")),this.container.append(qt),this.container.style.clipPath=`url(#${$t})`}_createPopup(){const{container:B,data:e}=this;B.setAttribute("aria-haspopup","dialog");const y=new b({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(y.render())}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(B,e=null){const y=[];if(this._fieldObjects){const U=this._fieldObjects[B];if(U)for(const{page:X,id:J,exportValues:ot}of U){if(X===-1||J===e)continue;const yt=typeof ot=="string"?ot:null,Ft=document.querySelector(`[data-element-id="${J}"]`);if(Ft&&!I.has(Ft)){(0,i.warn)(`_getElementsByName - element not allowed: ${J}`);continue}y.push({id:J,exportValue:yt,domElement:Ft})}return y}for(const U of document.getElementsByName(B)){const{exportValue:X}=U,J=U.getAttribute("data-element-id");J!==e&&I.has(U)&&y.push({id:J,exportValue:X,domElement:U})}return y}show(){var B;this.container&&(this.container.hidden=!1),(B=this.popup)==null||B.maybeShow()}hide(){var B;this.container&&(this.container.hidden=!0),(B=this.popup)==null||B.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const B=this.getElementsToTriggerPopup();if(Array.isArray(B))for(const e of B)e.classList.add("highlightArea");else B.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:B,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var y;(y=this.linkService.eventBus)==null||y.dispatch("switchannotationeditormode",{source:this,mode:B,editId:e})})}};o=new WeakMap;let E=a;
7class v extends E{constructor(e,y=null){super(e,{isRenderable:!0,ignoreBorder:!!(y!=null&&y.ignoreBorder),createQuadrilaterals:!0});W(this,h);W(this,S);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:y}=this,U=document.createElement("a");U.setAttribute("data-element-id",e.id);let X=!1;return e.url?(y.addLinkAttributes(U,e.url,e.newWindow),X=!0):e.action?(this._bindNamedAction(U,e.action),X=!0):e.attachment?(this._bindAttachment(U,e.attachment),X=!0):e.setOCGState?(q(this,S,In).call(this,U,e.setOCGState),X=!0):e.dest?(this._bindLink(U,e.dest),X=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(U,e),X=!0),e.resetForm?(this._bindResetFormAction(U,e.resetForm),X=!0):this.isTooltipOnly&&!X&&(this._bindLink(U,""),X=!0)),this.container.classList.add("linkAnnotation"),X&&this.container.append(U),this.container}_bindLink(e,y){e.href=this.linkService.getDestinationHash(y),e.onclick=()=>(y&&this.linkService.goToDestination(y),!1),(y||y==="")&&q(this,h,he).call(this)}_bindNamedAction(e,y){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(y),!1),q(this,h,he).call(this)}_bindAttachment(e,y){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>{var U;return(U=this.downloadManager)==null||U.openOrDownloadData(this.container,y.content,y.filename),!1},q(this,h,he).call(this)}_bindJSAction(e,y){e.href=this.linkService.getAnchorUrl("");const U=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const X of Object.keys(y.actions)){const J=U.get(X);J&&(e[J]=()=>{var ot;return(ot=this.linkService.eventBus)==null||ot.dispatch("dispatcheventinsandbox",{source:this,detail:{id:y.id,name:X}}),!1})}e.onclick||(e.onclick=()=>!1),q(this,h,he).call(this)}_bindResetFormAction(e,y){const U=e.onclick;if(U||(e.href=this.linkService.getAnchorUrl("")),q(this,h,he).call(this),!this._fieldObjects){(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),U||(e.onclick=()=>!1);return}e.onclick=()=>{var qt;U==null||U();const{fields:X,refs:J,include:ot}=y,yt=[];if(X.length!==0||J.length!==0){const Mt=new Set(J);for(const Dt of X){const $t=this._fieldObjects[Dt]||[];for(const{id:Yt}of $t)Mt.add(Yt)}for(const Dt of Object.values(this._fieldObjects))for(const $t of Dt)Mt.has($t.id)===ot&&yt.push($t)}else for(const Mt of Object.values(this._fieldObjects))yt.push(...Mt);const Ft=this.annotationStorage,kt=[];for(const Mt of yt){const{id:Dt}=Mt;switch(kt.push(Dt),Mt.type){case"text":{const Yt=Mt.defaultValue||"";Ft.setValue(Dt,{value:Yt});break}case"checkbox":case"radiobutton":{const Yt=Mt.defaultValue===Mt.exportValues;Ft.setValue(Dt,{value:Yt});break}case"combobox":case"listbox":{const Yt=Mt.defaultValue||"";Ft.setValue(Dt,{value:Yt});break}default:continue}const $t=document.querySelector(`[data-element-id="${Dt}"]`);if($t){if(!I.has($t)){(0,i.warn)(`_bindResetFormAction - element not allowed: ${Dt}`);continue}}else continue;$t.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:kt,name:"ResetForm"}})),!1}}}h=new WeakSet,he=function(){this.container.setAttribute("data-internal-link","")},S=new WeakSet,In=function(e,y){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(y),!1),q(this,h,he).call(this)};
7class p extends E{constructor(B){super(B,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const B=document.createElement("img");return B.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",B.alt="[{{type}} Annotation]",B.dataset.l10nId="text_annotation_type",B.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(B),this.container}}class _ extends E{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(B){var e;this.data.hasOwnCanvas&&(((e=B.previousSibling)==null?void 0:e.nodeName)==="CANVAS"&&(B.previousSibling.hidden=!0),B.hidden=!1)}_getKeyModifier(B){const{isWin:e,isMac:y}=i.FeatureTest.platform;return e&&B.ctrlKey||y&&B.metaKey}_setEventListener(B,e,y,U,X){y.includes("mouse")?B.addEventListener(y,J=>{var ot;(ot=this.linkService.eventBus)==null||ot.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:U,value:X(J),shift:J.shiftKey,modifier:this._getKeyModifier(J)}})}):B.addEventListener(y,J=>{var ot;if(y==="blur"){if(!e.focused||!J.relatedTarget)return;e.focused=!1}else if(y==="focus"){if(e.focused)return;e.focused=!0}X&&((ot=this.linkService.eventBus)==null||ot.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:U,value:X(J)}}))})}_setEventListeners(B,e,y,U){var X,J,ot;for(const[yt,Ft]of y)(Ft==="Action"||(X=this.data.actions)!=null&&X[Ft])&&((Ft==="Focus"||Ft==="Blur")&&(e||(e={focused:!1})),this._setEventListener(B,e,yt,Ft,U),Ft==="Focus"&&!((J=this.data.actions)!=null&&J.Blur)?this._setEventListener(B,e,"blur","Blur",null):Ft==="Blur"&&!((ot=this.data.actions)!=null&&ot.Focus)&&this._setEventListener(B,e,"focus","Focus",null))}_setBackgroundColor(B){const e=this.data.backgroundColor||null;B.style.backgroundColor=e===null?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(B){const e=["left","center","right"],{fontColor:y}=this.data.defaultAppearanceData,U=this.data.defaultAppearanceData.fontSize||m,X=B.style;let J;const ot=2,yt=Ft=>Math.round(10*Ft)/10;if(this.data.multiLine){const Ft=Math.abs(this.data.rect[3]-this.data.rect[1]-ot),kt=Math.round(Ft/(i.LINE_FACTOR*U))||1,qt=Ft/kt;J=Math.min(U,yt(qt/i.LINE_FACTOR))}else{const Ft=Math.abs(this.data.rect[3]-this.data.rect[1]-ot);J=Math.min(U,yt(Ft/i.LINE_FACTOR))}X.fontSize=`calc(${J}px * var(--scale-factor))`,X.color=i.Util.makeHexColor(y[0],y[1],y[2]),this.data.textAlignment!==null&&(X.textAlign=e[this.data.textAlignment])}_setRequired(B,e){e?B.setAttribute("required",!0):B.removeAttribute("required"),B.setAttribute("aria-required",e)}}class w extends _{constructor(B){const e=B.renderForms||!B.data.hasAppearance&&!!B.data.fieldValue;super(B,{isRenderable:e})}setPropertyOnSiblings(B,e,y,U){const X=this.annotationStorage;
7for(const J of this._getElementsByName(B.name,B.id))J.domElement&&(J.domElement[e]=y),X.setValue(J.id,{[U]:y})}render(){var U,X;const B=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let y=null;if(this.renderForms){const J=B.getValue(e,{value:this.data.fieldValue});let ot=J.value||"";const yt=B.getValue(e,{charLimit:this.data.maxLen}).charLimit;yt&&ot.length>yt&&(ot=ot.slice(0,yt));let Ft=J.formattedValue||((U=this.data.textContent)==null?void 0:U.join(` 8`))||null;Ft&&this.data.comb&&(Ft=Ft.replaceAll(/\s+/g,""));const kt={userValue:ot,formattedValue:Ft,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(y=document.createElement("textarea"),y.textContent=Ft??ot,this.data.doNotScroll&&(y.style.overflowY="hidden")):(y=document.createElement("input"),y.type="text",y.setAttribute("value",Ft??ot),this.data.doNotScroll&&(y.style.overflowX="hidden")),this.data.hasOwnCanvas&&(y.hidden=!0),I.add(y),y.setAttribute("data-element-id",e),y.disabled=this.data.readOnly,y.name=this.data.fieldName,y.tabIndex=C,this._setRequired(y,this.data.required),yt&&(y.maxLength=yt),y.addEventListener("input",Mt=>{B.setValue(e,{value:Mt.target.value}),this.setPropertyOnSiblings(y,"value",Mt.target.value,"value"),kt.formattedValue=null}),y.addEventListener("resetform",Mt=>{const Dt=this.data.defaultFieldValue??"";y.value=kt.userValue=Dt,kt.formattedValue=null});let qt=Mt=>{const{formattedValue:Dt}=kt;Dt!=null&&(Mt.target.value=Dt),Mt.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){y.addEventListener("focus",Dt=>{if(kt.focused)return;const{target:$t}=Dt;kt.userValue&&($t.value=kt.userValue),kt.lastCommittedValue=$t.value,kt.commitKey=1,kt.focused=!0}),y.addEventListener("updatefromsandbox",Dt=>{this.showElementAndHideCanvas(Dt.target);const $t={value(Yt){kt.userValue=Yt.detail.value??"",B.setValue(e,{value:kt.userValue.toString()}),Yt.target.value=kt.userValue},formattedValue(Yt){const{formattedValue:Jt}=Yt.detail;kt.formattedValue=Jt,Jt!=null&&Yt.target!==document.activeElement&&(Yt.target.value=Jt),B.setValue(e,{formattedValue:Jt})},selRange(Yt){Yt.target.setSelectionRange(...Yt.detail.selRange)},charLimit:Yt=>{var se;const{charLimit:Jt}=Yt.detail,{target:Zt}=Yt;if(Jt===0){Zt.removeAttribute("maxLength");return}Zt.setAttribute("maxLength",Jt);let ie=kt.userValue;!ie||ie.length<=Jt||(ie=ie.slice(0,Jt),Zt.value=kt.userValue=ie,B.setValue(e,{value:ie}),(se=this.linkService.eventBus)==null||se.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:ie,willCommit:!0,commitKey:1,selStart:Zt.selectionStart,selEnd:Zt.selectionEnd}}))}};this._dispatchEventFromSandbox($t,Dt)}),y.addEventListener("keydown",Dt=>{var Jt;kt.commitKey=1;let $t=-1;if(Dt.key==="Escape"?$t=0:Dt.key==="Enter"&&!this.data.multiLine?$t=2:Dt.key==="Tab"&&(kt.commitKey=3),$t===-1)return;const{value:Yt}=Dt.target;kt.lastCommittedValue!==Yt&&(kt.lastCommittedValue=Yt,kt.userValue=Yt,(Jt=this.linkService.eventBus)==null||Jt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:Yt,willCommit:!0,commitKey:$t,selStart:Dt.target.selectionStart,selEnd:Dt.target.selectionEnd}}))});const Mt=qt;qt=null,y.addEventListener("blur",Dt=>{var Yt;if(!kt.focused||!Dt.relatedTarget)return;kt.focused=!1;const{value:$t}=Dt.target;kt.userValue=$t,kt.lastCommittedValue!==$t&&((Yt=this.linkService.eventBus)==null||Yt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:$t,willCommit:!0,commitKey:kt.commitKey,selStart:Dt.target.selectionStart,selEnd:Dt.target.selectionEnd}})),Mt(Dt)}),(X=this.data.actions)!=null&&X.Keystroke&&y.addEventListener("beforeinput",Dt=>{var le;kt.lastCommittedValue=null;const{data:$t,target:Yt}=Dt,{value:Jt,selectionStart:Zt,selectionEnd:ie}=Yt;let se=Zt,re=ie;switch(Dt.inputType){case"deleteWordBackward":{const ce=Jt.substring(0,Zt).match(/\w*[^\w]*$/);ce&&(se-=ce[0].length);break}
vendor: 4,097 bytes, line 8
8case"deleteWordForward":{const ce=Jt.substring(Zt).match(/^[^\w]*\w*/);ce&&(re+=ce[0].length);break}case"deleteContentBackward":Zt===ie&&(se-=1);break;case"deleteContentForward":Zt===ie&&(re+=1);break}Dt.preventDefault(),(le=this.linkService.eventBus)==null||le.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:Jt,change:$t||"",willCommit:!1,selStart:se,selEnd:re}})}),this._setEventListeners(y,kt,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Dt=>Dt.target.value)}if(qt&&y.addEventListener("blur",qt),this.data.comb){const Dt=(this.data.rect[2]-this.data.rect[0])/yt;y.classList.add("comb"),y.style.letterSpacing=`calc(${Dt}px * var(--scale-factor) - 1ch)`}}else y=document.createElement("div"),y.textContent=this.data.fieldValue,y.style.verticalAlign="middle",y.style.display="table-cell";return this._setTextStyle(y),this._setBackgroundColor(y),this._setDefaultPropertiesFromJS(y),this.container.append(y),this.container}}class P extends _{constructor(B){super(B,{isRenderable:!!B.data.hasOwnCanvas})}}class A extends _{constructor(B){super(B,{isRenderable:B.renderForms})}render(){const B=this.annotationStorage,e=this.data,y=e.id;let U=B.getValue(y,{value:e.exportValue===e.fieldValue}).value;typeof U=="string"&&(U=U!=="Off",B.setValue(y,{value:U})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const X=document.createElement("input");return I.add(X),X.setAttribute("data-element-id",y),X.disabled=e.readOnly,this._setRequired(X,this.data.required),X.type="checkbox",X.name=e.fieldName,U&&X.setAttribute("checked",!0),X.setAttribute("exportValue",e.exportValue),X.tabIndex=C,X.addEventListener("change",J=>{const{name:ot,checked:yt}=J.target;for(const Ft of this._getElementsByName(ot,y)){const kt=yt&&Ft.exportValue===e.exportValue;Ft.domElement&&(Ft.domElement.checked=kt),B.setValue(Ft.id,{value:kt})}B.setValue(y,{value:yt})}),X.addEventListener("resetform",J=>{const ot=e.defaultFieldValue||"Off";J.target.checked=ot===e.exportValue}),this.enableScripting&&this.hasJSActions&&(X.addEventListener("updatefromsandbox",J=>{const ot={value(yt){yt.target.checked=yt.detail.value!=="Off",B.setValue(y,{value:yt.target.checked})}};this._dispatchEventFromSandbox(ot,J)}),this._setEventListeners(X,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],J=>J.target.checked)),this._setBackgroundColor(X),this._setDefaultPropertiesFromJS(X),this.container.append(X),this.container}}class l extends _{constructor(B){super(B,{isRenderable:B.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const B=this.annotationStorage,e=this.data,y=e.id;let U=B.getValue(y,{value:e.fieldValue===e.buttonValue}).value;typeof U=="string"&&(U=U!==e.buttonValue,B.setValue(y,{value:U}));const X=document.createElement("input");if(I.add(X),X.setAttribute("data-element-id",y),X.disabled=e.readOnly,this._setRequired(X,this.data.required),X.type="radio",X.name=e.fieldName,U&&X.setAttribute("checked",!0),X.tabIndex=C,X.addEventListener("change",J=>{const{name:ot,checked:yt}=J.target;for(const Ft of this._getElementsByName(ot,y))B.setValue(Ft.id,{value:!1});B.setValue(y,{value:yt})}),X.addEventListener("resetform",J=>{const ot=e.defaultFieldValue;J.target.checked=ot!=null&&ot===e.buttonValue}),this.enableScripting&&this.hasJSActions){const J=e.buttonValue;X.addEventListener("updatefromsandbox",ot=>{const yt={value:Ft=>{const kt=J===Ft.detail.value;for(const qt of this._getElementsByName(Ft.target.name)){const Mt=kt&&qt.id===y;qt.domElement&&(qt.domElement.checked=Mt),B.setValue(qt.id,{value:Mt})}}};this._dispatchEventFromSandbox(yt,ot)}),this._setEventListeners(X,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ot=>ot.target.checked)}
8return this._setBackgroundColor(X),this._setDefaultPropertiesFromJS(X),this.container.append(X),this.container}}class d extends v{constructor(B){super(B,{ignoreBorder:B.data.hasAppearance})}render(){const B=super.render();B.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(B.title=this.data.alternativeText);const e=B.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",y=>{this._dispatchEventFromSandbox({},y)})),B}}class D extends _{constructor(B){super(B,{isRenderable:B.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const B=this.annotationStorage,e=this.data.id,y=B.getValue(e,{value:this.data.fieldValue}),U=document.createElement("select");I.add(U),U.setAttribute("data-element-id",e),U.disabled=this.data.readOnly,this._setRequired(U,this.data.required),U.name=this.data.fieldName,U.tabIndex=C;let X=this.data.combo&&this.data.options.length>0;this.data.combo||(U.size=this.data.options.length,this.data.multiSelect&&(U.multiple=!0)),U.addEventListener("resetform",kt=>{const qt=this.data.defaultFieldValue;for(const Mt of U.options)Mt.selected=Mt.value===qt});for(const kt of this.data.options){const qt=document.createElement("option");qt.textContent=kt.displayValue,qt.value=kt.exportValue,y.value.includes(kt.exportValue)&&(qt.setAttribute("selected",!0),X=!1),U.append(qt)}let J=null;if(X){const kt=document.createElement("option");kt.value=" ",kt.setAttribute("hidden",!0),kt.setAttribute("selected",!0),U.prepend(kt),J=()=>{kt.remove(),U.removeEventListener("input",J),J=null},U.addEventListener("input",J)}const ot=kt=>{const qt=kt?"value":"textContent",{options:Mt,multiple:Dt}=U;return Dt?Array.prototype.filter.call(Mt,$t=>$t.selected).map($t=>$t[qt]):Mt.selectedIndex===-1?null:Mt[Mt.selectedIndex][qt]};let yt=ot(!1);const Ft=kt=>{const qt=kt.target.options;return Array.prototype.map.call(qt,Mt=>({displayValue:Mt.textContent,exportValue:Mt.value}))};return this.enableScripting&&this.hasJSActions?(U.addEventListener("updatefromsandbox",kt=>{const qt={value(Mt){J==null||J();const Dt=Mt.detail.value,$t=new Set(Array.isArray(Dt)?Dt:[Dt]);for(const Yt of U.options)Yt.selected=$t.has(Yt.value);B.setValue(e,{value:ot(!0)}),yt=ot(!1)},multipleSelection(Mt){U.multiple=!0},remove(Mt){const Dt=U.options,$t=Mt.detail.remove;Dt[$t].selected=!1,U.remove($t),Dt.length>0&&Array.prototype.findIndex.call(Dt,Jt=>Jt.selected)===-1&&(Dt[0].selected=!0),B.setValue(e,{value:ot(!0),items:Ft(Mt)}),yt=ot(!1)},clear(Mt){for(;U.length!==0;)U.remove(0);B.setValue(e,{value:null,items:[]}),yt=ot(!1)},insert(Mt){const{index:Dt,displayValue:$t,exportValue:Yt}=Mt.detail.insert,Jt=U.children[Dt],Zt=document.createElement("option");Zt.textContent=$t,Zt.value=Yt,Jt?Jt.before(Zt):U.append(Zt),B.setValue(e,{value:ot(!0),items:Ft(Mt)}),yt=ot(!1)},items(Mt){const{items:Dt}=Mt.detail;for(;U.length!==0;)U.remove(0);for(const $t of Dt){const{displayValue:Yt,exportValue:Jt}=$t,Zt=document.createElement("option");Zt.textContent=Yt,Zt.value=Jt,U.append(Zt)}U.options.length>0&&(U.options[0].selected=!0),B.setValue(e,{value:ot(!0),items:Ft(Mt)}),yt=ot(!1)},indices(Mt){const Dt=new Set(Mt.detail.indices);for(const $t of Mt.target.options)$t.selected=Dt.has($t.index);B.setValue(e,{value:ot(!0)}),yt=ot(!1)},editable(Mt){Mt.target.disabled=!Mt.detail.editable}};this._dispatchEventFromSandbox(qt,kt)}),U.addEventListener("input",kt=>{var Mt;const qt=ot(!0);B.setValue(e,{value:qt}),kt.preventDefault(),(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:yt,changeEx:qt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(U,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],kt=>kt.target.value)):U.addEventListener("input",function(kt){B.setValue(e,{value:ot(!0)})}),this.data.combo&&this._setTextStyle(U),this._setBackgroundColor(U),this._setDefaultPropertiesFromJS(U),this.container.append(U),this.container}}
8class b extends E{constructor(B){const{data:e,elements:y}=B;super(B,{isRenderable:E._hasPopupData(e)}),this.elements=y}render(){this.container.classList.add("popupAnnotation");const B=new c({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const y of this.elements)y.popup=B,e.push(y.data.id),y.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(y=>`${i.AnnotationPrefix}${y}`).join(",")),this.container}}class c{constructor({container:B,color:e,elements:y,titleObj:U,modificationDate:X,contentsObj:J,richText:ot,parent:yt,rect:Ft,parentRect:kt,open:qt}){W(this,jt);W(this,Wt);W(this,Gt);W(this,Xt);W(this,j,null);W(this,st,q(this,jt,Nn).bind(this));W(this,tt,q(this,Xt,cn).bind(this));W(this,at,q(this,Gt,ln).bind(this));W(this,dt,q(this,Wt,Fe).bind(this));W(this,gt,null);W(this,ct,null);W(this,xt,null);W(this,Ot,null);W(this,Et,null);W(this,Lt,null);W(this,mt,!1);W(this,et,null);W(this,nt,null);W(this,pt,null);W(this,wt,null);W(this,Ct,!1);var Dt;rt(this,ct,B),rt(this,wt,U),rt(this,xt,J),rt(this,pt,ot),rt(this,Et,yt),rt(this,gt,e),rt(this,nt,Ft),rt(this,Lt,kt),rt(this,Ot,y);const Mt=f.PDFDateString.toDateObject(X);Mt&&rt(this,j,yt.l10n.get("annotation_date_string",{date:Mt.toLocaleDateString(),time:Mt.toLocaleTimeString()})),this.trigger=y.flatMap($t=>$t.getElementsToTriggerPopup());for(const $t of this.trigger)$t.addEventListener("click",t(this,dt)),$t.addEventListener("mouseenter",t(this,at)),$t.addEventListener("mouseleave",t(this,tt)),$t.classList.add("popupTriggerArea");for(const $t of y)(Dt=$t.container)==null||Dt.addEventListener("keydown",t(this,st));t(this,ct).hidden=!0,qt&&q(this,Wt,Fe).call(this)}render(){if(t(this,et))return;const{page:{view:B},viewport:{rawDims:{pageWidth:e,pageHeight:y,pageX:U,pageY:X}}}=t(this,Et),J=rt(this,et,document.createElement("div"));if(J.className="popup",t(this,gt)){const se=J.style.outlineColor=i.Util.makeHexColor(...t(this,gt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?J.style.backgroundColor=`color-mix(in srgb, ${se} 30%, white)`:J.style.backgroundColor=i.Util.makeHexColor(...t(this,gt).map(le=>Math.floor(.7*(255-le)+le)))}const ot=document.createElement("span");ot.className="header";const yt=document.createElement("h1");if(ot.append(yt),{dir:yt.dir,str:yt.textContent}=t(this,wt),J.append(ot),t(this,j)){const se=document.createElement("span");se.classList.add("popupDate"),t(this,j).then(re=>{se.textContent=re}),ot.append(se)}const Ft=t(this,xt),kt=t(this,pt);if(kt!=null&&kt.str&&(!(Ft!=null&&Ft.str)||Ft.str===kt.str))M.XfaLayer.render({xfaHtml:kt.html,intent:"richText",div:J}),J.lastChild.classList.add("richText","popupContent");else{const se=this._formatContents(Ft);J.append(se)}let qt=!!t(this,Lt),Mt=qt?t(this,Lt):t(this,nt);for(const se of t(this,Ot))if(!Mt||i.Util.intersect(se.data.rect,Mt)!==null){Mt=se.data.rect,qt=!0;break}const Dt=i.Util.normalizeRect([Mt[0],B[3]-Mt[1]+B[1],Mt[2],B[3]-Mt[3]+B[1]]),$t=5,Yt=qt?Mt[2]-Mt[0]+$t:0,Jt=Dt[0]+Yt,Zt=Dt[1],{style:ie}=t(this,ct);ie.left=`${100*(Jt-U)/e}%`,ie.top=`${100*(Zt-X)/y}%`,t(this,ct).append(J)}_formatContents({str:B,dir:e}){const y=document.createElement("p");y.classList.add("popupContent"),y.dir=e;const U=B.split(/(?:\r\n?|\n)/);for(let X=0,J=U.length;X<J;++X){const ot=U[X];y.append(document.createTextNode(ot)),X<J-1&&y.append(document.createElement("br"))}return y}forceHide(){rt(this,Ct,this.isVisible),t(this,Ct)&&(t(this,ct).hidden=!0)}maybeShow(){t(this,Ct)&&(rt(this,Ct,!1),t(this,ct).hidden=!1)}get isVisible(){return t(this,ct).hidden===!1}}j=new WeakMap,st=new WeakMap,tt=new WeakMap,at=new WeakMap,dt=new WeakMap,gt=new WeakMap,ct=new WeakMap,xt=new WeakMap,Ot=new WeakMap,Et=new WeakMap,Lt=new WeakMap,mt=new WeakMap,et=new WeakMap,nt=new WeakMap,pt=new WeakMap,wt=new WeakMap,Ct=new WeakMap,jt=new WeakSet,Nn=function(B){B.altKey||B.shiftKey||B.ctrlKey||B.metaKey||(B.key==="Enter"||B.key==="Escape"&&t(this,mt))&&q(this,Wt,Fe).call(this)},Wt=new WeakSet,Fe=function(){rt(this,mt,!t(this,mt)),t(this,mt)?(q(this,Gt,ln).call(this),t(this,ct).addEventListener("click",t(this,dt)),t(this,ct).addEventListener("keydown",t(this,st))):(q(this,Xt,cn).call(this),t(this,ct).removeEventListener("click",t(this,dt)),t(this,ct).removeEventListener("keydown",t(this,st)))},Gt=new WeakSet,ln=function(){t(this,et)||this.render(),this.isVisible?t(this,mt)&&t(this,ct).classList.add("focused"):(t(this,ct).hidden=!1,t(this,ct).style.zIndex=parseInt(t(this,ct).style.zIndex)+1e3)},Xt=new WeakSet,cn=function(){t(this,ct).classList.remove("focused"),!(t(this,mt)||!this.isVisible)&&(t(this,ct).hidden=!0,t(this,ct).style.zIndex=parseInt(t(this,ct).style.zIndex)-1e3)};
8class k extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0}),this.textContent=B.data.textContent,this.textPosition=B.data.textPosition,this.annotationEditorType=i.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const B=document.createElement("div");B.classList.add("annotationTextContent"),B.setAttribute("role","comment");for(const e of this.textContent){const y=document.createElement("span");y.textContent=e,B.append(y)}this.container.append(B)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}n.FreeTextAnnotationElement=k;class g extends E{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});W(this,Z,null)}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:y,height:U}=N(e.rect),X=this.svgFactory.create(y,U,!0),J=rt(this,Z,this.svgFactory.createElement("svg:line"));return J.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),J.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),J.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),J.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),J.setAttribute("stroke-width",e.borderStyle.width||1),J.setAttribute("stroke","transparent"),J.setAttribute("fill","transparent"),X.append(J),this.container.append(X),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,Z)}addHighlightArea(){this.container.classList.add("highlightArea")}}Z=new WeakMap;class $ extends E{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});W(this,K,null)}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:y,height:U}=N(e.rect),X=this.svgFactory.create(y,U,!0),J=e.borderStyle.width,ot=rt(this,K,this.svgFactory.createElement("svg:rect"));return ot.setAttribute("x",J/2),ot.setAttribute("y",J/2),ot.setAttribute("width",y-J),ot.setAttribute("height",U-J),ot.setAttribute("stroke-width",J||1),ot.setAttribute("stroke","transparent"),ot.setAttribute("fill","transparent"),X.append(ot),this.container.append(X),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,K)}addHighlightArea(){this.container.classList.add("highlightArea")}}K=new WeakMap;class V extends E{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});W(this,_t,null)}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:y,height:U}=N(e.rect),X=this.svgFactory.create(y,U,!0),J=e.borderStyle.width,ot=rt(this,_t,this.svgFactory.createElement("svg:ellipse"));return ot.setAttribute("cx",y/2),ot.setAttribute("cy",U/2),ot.setAttribute("rx",y/2-J/2),ot.setAttribute("ry",U/2-J/2),ot.setAttribute("stroke-width",J||1),ot.setAttribute("stroke","transparent"),ot.setAttribute("fill","transparent"),X.append(ot),this.container.append(X),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,_t)}addHighlightArea(){this.container.classList.add("highlightArea")}}_t=new WeakMap;class T extends E{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});W(this,vt,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:y,height:U}=N(e.rect),X=this.svgFactory.create(y,U,!0);let J=[];for(const yt of e.vertices){const Ft=yt.x-e.rect[0],kt=e.rect[3]-yt.y;J.push(Ft+","+kt)}J=J.join(" ");const ot=rt(this,vt,this.svgFactory.createElement(this.svgElementName));return ot.setAttribute("points",J),ot.setAttribute("stroke-width",e.borderStyle.width||1),ot.setAttribute("stroke","transparent"),ot.setAttribute("fill","transparent"),X.append(ot),this.container.append(X),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return t(this,vt)}addHighlightArea(){this.container.classList.add("highlightArea")}}vt=new WeakMap;class Y extends T{constructor(B){super(B),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}
8class it extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class lt extends E{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});W(this,ee,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=i.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:y,height:U}=N(e.rect),X=this.svgFactory.create(y,U,!0);for(const J of e.inkLists){let ot=[];for(const Ft of J){const kt=Ft.x-e.rect[0],qt=e.rect[3]-Ft.y;ot.push(`${kt},${qt}`)}ot=ot.join(" ");const yt=this.svgFactory.createElement(this.svgElementName);t(this,ee).push(yt),yt.setAttribute("points",ot),yt.setAttribute("stroke-width",e.borderStyle.width||1),yt.setAttribute("stroke","transparent"),yt.setAttribute("fill","transparent"),!e.popupRef&&this.hasPopupData&&this._createPopup(),X.append(yt)}return this.container.append(X),this.container}getElementsToTriggerPopup(){return t(this,ee)}addHighlightArea(){this.container.classList.add("highlightArea")}}ee=new WeakMap,n.InkAnnotationElement=lt;class G extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ht extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class bt extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class St extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Pt extends E{constructor(B){super(B,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}n.StampAnnotationElement=Pt;class x extends E{constructor(e){var X;super(e,{isRenderable:!0});W(this,Q);W(this,te,null);const{filename:y,content:U}=this.data.file;this.filename=(0,f.getFilenameFromUrl)(y,!0),this.content=U,(X=this.linkService.eventBus)==null||X.dispatch("fileattachmentannotation",{source:this,filename:y,content:U})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:y}=this;let U;y.hasAppearance||y.fillAlpha===0?U=document.createElement("div"):(U=document.createElement("img"),U.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(y.name)?"paperclip":"pushpin"}.svg`,y.fillAlpha&&y.fillAlpha<1&&(U.style=`filter: opacity(${Math.round(y.fillAlpha*100)}%);`)),U.addEventListener("dblclick",q(this,Q,hn).bind(this)),rt(this,te,U);const{isMac:X}=i.FeatureTest.platform;return e.addEventListener("keydown",J=>{J.key==="Enter"&&(X?J.metaKey:J.ctrlKey)&&q(this,Q,hn).call(this)}),!y.popupRef&&this.hasPopupData?this._createPopup():U.classList.add("popupTriggerArea"),e.append(U),e}getElementsToTriggerPopup(){return t(this,te)}addHighlightArea(){this.container.classList.add("highlightArea")}}te=new WeakMap,Q=new WeakSet,hn=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.container,this.content,this.filename)};class s{constructor({div:B,accessibilityManager:e,annotationCanvasMap:y,l10n:U,page:X,viewport:J}){W(this,Ut);W(this,At);W(this,Nt,null);W(this,Rt,null);W(this,Bt,new Map);this.div=B,rt(this,Nt,e),rt(this,Rt,y),this.l10n=U,this.page=X,this.viewport=J,this.zIndex=0,this.l10n||(this.l10n=ut.NullL10n)}async render(B){const{annotations:e}=B,y=this.div;(0,f.setLayerDimensions)(y,this.viewport);const U=new Map,X={data:null,layer:y,linkService:B.linkService,downloadManager:B.downloadManager,imageResourcesPath:B.imageResourcesPath||"",renderForms:B.renderForms!==!1,svgFactory:new f.DOMSVGFactory,annotationStorage:B.annotationStorage||new z.AnnotationStorage,enableScripting:B.enableScripting===!0,hasJSActions:B.hasJSActions,fieldObjects:B.fieldObjects,parent:this,elements:null};for(const J of e){if(J.noHTML)continue;const ot=J.annotationType===i.AnnotationType.POPUP;if(ot){const kt=U.get(J.id);if(!kt)continue;X.elements=kt}else{const{width:kt,height:qt}=N(J.rect);if(kt<=0||qt<=0)continue}X.data=J;const yt=R.create(X);if(!yt.isRenderable)continue;if(!ot&&J.popupRef){const kt=U.get(J.popupRef);kt?kt.push(yt):U.set(J.popupRef,[yt])}yt.annotationEditorType>0&&t(this,Bt).set(yt.data.id,yt);const Ft=yt.render();J.hidden&&(Ft.style.visibility="hidden"),q(this,Ut,Bn).call(this,Ft,J.id)}q(this,At,dn).call(this),await this.l10n.translate(y)}update({viewport:B}){const e=this.div;this.viewport=B,(0,f.setLayerDimensions)(e,{rotation:B.rotation}),q(this,At,dn).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(t(this,Bt).values())}getEditableAnnotation(B){return t(this,Bt).get(B)}}
8Nt=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,Ut=new WeakSet,Bn=function(B,e){var U;const y=B.firstChild||B;y.id=`${i.AnnotationPrefix}${e}`,this.div.append(B),(U=t(this,Nt))==null||U.moveElementInDOM(this.div,B,y,!1)},At=new WeakSet,dn=function(){if(!t(this,Rt))return;const B=this.div;for(const[e,y]of t(this,Rt)){const U=B.querySelector(`[data-annotation-id="${e}"]`);if(!U)continue;const{firstChild:X}=U;X?X.nodeName==="CANVAS"?X.replaceWith(y):X.before(y):U.append(y)}t(this,Rt).clear()},n.AnnotationLayer=s},(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorConverters=void 0;function L(z){return Math.floor(Math.max(0,Math.min(1,z))*255).toString(16).padStart(2,"0")}function i(z){return Math.max(0,Math.min(255,255*z))}class f{static CMYK_G([H,ut,M,C]){return["G",1-Math.min(1,.3*H+.59*M+.11*ut+C)]}static G_CMYK([H]){return["CMYK",0,0,0,1-H]}static G_RGB([H]){return["RGB",H,H,H]}static G_rgb([H]){return H=i(H),[H,H,H]}static G_HTML([H]){const ut=L(H);return`#${ut}${ut}${ut}`}static RGB_G([H,ut,M]){return["G",.3*H+.59*ut+.11*M]}static RGB_rgb(H){return H.map(i)}static RGB_HTML(H){return`#${H.map(L).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([H,ut,M,C]){return["RGB",1-Math.min(1,H+C),1-Math.min(1,M+C),1-Math.min(1,ut+C)]}static CMYK_rgb([H,ut,M,C]){return[i(1-Math.min(1,H+C)),i(1-Math.min(1,M+C)),i(1-Math.min(1,ut+C))]}static CMYK_HTML(H){const ut=this.CMYK_RGB(H).slice(1);return this.RGB_HTML(ut)}static RGB_CMYK([H,ut,M]){const C=1-H,m=1-ut,I=1-M,N=Math.min(C,m,I);return["CMYK",C,m,I,N]}}n.ColorConverters=f},(F,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.NullL10n=void 0,n.getL10nFallback=i;const L={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} à {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} à {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typingâ¦",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};L.print_progress_percent="{{progress}}%";function i(H,ut){switch(H){case"find_match_count":H=`find_match_count[${ut.total===1?"one":"other"}]`;break;case"find_match_count_limit":H=`find_match_count_limit[${ut.limit===1?"one":"other"}]`;break}return L[H]||""}function f(H,ut){return ut?H.replaceAll(/\{\{\s*(\w+)\s*\}\}
8/g,(M,C)=>C in ut?ut[C]:"{{"+C+"}}"):H}const z={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(H,ut=null,M=i(H,ut)){return f(M,ut)},async translate(H){}};n.NullL10n=z},(F,n,L)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaLayer=void 0;var i=L(25);class f{static setupStorage(H,ut,M,C,m){const I=C.getValue(ut,{value:null});switch(M.name){case"textarea":if(I.value!==null&&(H.textContent=I.value),m==="print")break;H.addEventListener("input",N=>{C.setValue(ut,{value:N.target.value})});break;case"input":if(M.attributes.type==="radio"||M.attributes.type==="checkbox"){if(I.value===M.attributes.xfaOn?H.setAttribute("checked",!0):I.value===M.attributes.xfaOff&&H.removeAttribute("checked"),m==="print")break;H.addEventListener("change",N=>{C.setValue(ut,{value:N.target.checked?N.target.getAttribute("xfaOn"):N.target.getAttribute("xfaOff")})})}else{if(I.value!==null&&H.setAttribute("value",I.value),m==="print")break;H.addEventListener("input",N=>{C.setValue(ut,{value:N.target.value})})}break;case"select":if(I.value!==null){H.setAttribute("value",I.value);for(const N of M.children)N.attributes.value===I.value?N.attributes.selected=!0:N.attributes.hasOwnProperty("selected")&&delete N.attributes.selected}H.addEventListener("input",N=>{const R=N.target.options,E=R.selectedIndex===-1?"":R[R.selectedIndex].value;C.setValue(ut,{value:E})});break}}static setAttributes({html:H,element:ut,storage:M=null,intent:C,linkService:m}){const{attributes:I}=ut,N=H instanceof HTMLAnchorElement;I.type==="radio"&&(I.name=`${I.name}-${C}`);for(const[R,E]of Object.entries(I))if(E!=null)switch(R){case"class":E.length&&H.setAttribute(R,E.join(" "));break;case"dataId":break;case"id":H.setAttribute("data-element-id",E);break;case"style":Object.assign(H.style,E);break;case"textContent":H.textContent=E;break;default:(!N||R!=="href"&&R!=="newWindow")&&H.setAttribute(R,E)}N&&m.addLinkAttributes(H,I.href,I.newWindow),M&&I.dataId&&this.setupStorage(H,I.dataId,ut,M)}static render(H){var v;const ut=H.annotationStorage,M=H.linkService,C=H.xfaHtml,m=H.intent||"display",I=document.createElement(C.name);C.attributes&&this.setAttributes({html:I,element:C,intent:m,linkService:M});const N=[[C,-1,I]],R=H.div;if(R.append(I),H.viewport){const p=`matrix(${H.viewport.transform.join(",")})`;R.style.transform=p}m!=="richText"&&R.setAttribute("class","xfaLayer xfaFont");const E=[];for(;N.length>0;){const[p,_,w]=N.at(-1);if(_+1===p.children.length){N.pop();continue}const P=p.children[++N.at(-1)[1]];if(P===null)continue;const{name:A}=P;if(A==="#text"){const d=document.createTextNode(P.value);E.push(d),w.append(d);continue}const l=(v=P==null?void 0:P.attributes)!=null&&v.xmlns?document.createElementNS(P.attributes.xmlns,A):document.createElement(A);if(w.append(l),P.attributes&&this.setAttributes({html:l,element:P,storage:ut,intent:m,linkService:M}),P.children&&P.children.length>0)N.push([P,-1,l]);else if(P.value){const d=document.createTextNode(P.value);i.XfaText.shouldBuildText(A)&&E.push(d),l.append(d)}}for(const p of R.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))p.setAttribute("readOnly",!0);return{textDivs:E}}static update(H){const ut=`matrix(${H.viewport.transform.join(",")})`;H.div.style.transform=ut,H.div.hidden=!1}}n.XfaLayer=f},(F,n,L)=>{var C,m,I,N,R,E,v,p,_,w,P,A,l,d,D,Un,c,jn,g,Wn,V,Hn,Y,un,lt,$n,ht,fn,St,Gn,x,Vn,o,zn,h,Xn,S,qn,j,oe,tt,pn,dt,Me,ct,De,Ot,pe,Lt,gn,et,Le,pt,Yn,Ct,mn,Vt,Kn,zt,Jn,Ht,bn,ft,Oe,K,ge;Object.defineProperty(n,"__esModule",{value:!0}),n.InkEditor=void 0;var i=L(1),f=L(4),z=L(29),H=L(6),ut=L(5);const vt=class vt extends f.AnnotationEditor{constructor(Q){super({...Q,name:"inkEditor"});W(this,D);W(this,c);W(this,g);W(this,V);W(this,Y);W(this,lt);W(this,ht);W(this,St);W(this,x);W(this,o);W(this,h);W(this,S);W(this,j);W(this,tt);W(this,dt);W(this,ct);W(this,Ot);W(this,Lt);W(this,et);W(this,zt);W(this,Ht);W(this,ft);W(this,K);W(this,C,0);W(this,m,0);W(this,I,this.canvasPointermove.bind(this));W(this,N,this.canvasPointerleave.bind(this));W(this,R,this.canvasPointerup.bind(this));W(this,E,this.canvasPointerdown.bind(this));W(this,v,new Path2D);W(this,p,!1);W(this,_,!1);W(this,w,!1);W(this,P,null);W(this,A,0);W(this,l,0);W(this,d,null);this.color=Q.color||null,this.thickness=Q.thickness||null,this.opacity=Q.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(Q){f.AnnotationEditor.initialize(Q,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(Q,Tt){switch(Q){case i.AnnotationEditorParamsType.INK_THICKNESS:vt._defaultThickness=Tt;break;case i.AnnotationEditorParamsType.INK_COLOR:vt._defaultColor=Tt;break;case i.AnnotationEditorParamsType.INK_OPACITY:vt._defaultOpacity=Tt/100;break}}updateParams(Q,Tt){switch(Q){case i.AnnotationEditorParamsType.INK_THICKNESS:q(this,D,Un).call(this,Tt);break;case i.AnnotationEditorParamsType.INK_COLOR:q(this,c,jn).call(this,Tt);break;
8case i.AnnotationEditorParamsType.INK_OPACITY:q(this,g,Wn).call(this,Tt);break}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,vt._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,vt._defaultColor||f.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(vt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||vt._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||vt._defaultColor||f.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??vt._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(q(this,dt,Me).call(this),q(this,ct,De).call(this)),this.isAttachedToDOM||(this.parent.add(this),q(this,Ot,pe).call(this)),q(this,K,ge).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,t(this,P).disconnect(),rt(this,P,null),super.remove())}setParent(Q){!this.parent&&Q?this._uiManager.removeShouldRescale(this):this.parent&&Q===null&&this._uiManager.addShouldRescale(this),super.setParent(Q)}onScaleChanging(){const[Q,Tt]=this.parentDimensions,Nt=this.width*Q,Rt=this.height*Tt;this.setDimensions(Nt,Rt)}enableEditMode(){t(this,p)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",t(this,E)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",t(this,E)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){t(this,p)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),rt(this,p,!0),this.div.classList.add("disabled"),q(this,K,ge).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(Q){this._focusEventsAllowed&&(super.focusin(Q),this.enableEditMode())}canvasPointerdown(Q){Q.button!==0||!this.isInEditMode()||t(this,p)||(this.setInForeground(),Q.preventDefault(),Q.type!=="mouse"&&this.div.focus(),q(this,lt,$n).call(this,Q.offsetX,Q.offsetY))}canvasPointermove(Q){Q.preventDefault(),q(this,ht,fn).call(this,Q.offsetX,Q.offsetY)}canvasPointerup(Q){Q.preventDefault(),q(this,tt,pn).call(this,Q)}canvasPointerleave(Q){q(this,tt,pn).call(this,Q)}get isResizable(){return!this.isEmpty()&&t(this,p)}render(){if(this.div)return this.div;let Q,Tt;this.width&&(Q=this.x,Tt=this.y),super.render(),f.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Qt=>{var At;return(At=this.div)==null?void 0:At.setAttribute("aria-label",Qt)});const[Nt,Rt,Bt,Ut]=q(this,V,Hn).call(this);if(this.setAt(Nt,Rt,0,0),this.setDims(Bt,Ut),q(this,dt,Me).call(this),this.width){const[Qt,At]=this.parentDimensions;this.setAspectRatio(this.width*Qt,this.height*At),this.setAt(Q*Qt,Tt*At,this.width*Qt,this.height*At),rt(this,w,!0),q(this,Ot,pe).call(this),this.setDims(this.width*Qt,this.height*At),q(this,j,oe).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return q(this,ct,De).call(this),this.div}setDimensions(Q,Tt){const Nt=Math.round(Q),Rt=Math.round(Tt);if(t(this,A)===Nt&&t(this,l)===Rt)return;rt(this,A,Nt),rt(this,l,Rt),this.canvas.style.visibility="hidden";const[Bt,Ut]=this.parentDimensions;this.width=Q/Bt,this.height=Tt/Ut,this.fixAndSetPosition(),t(this,p)&&q(this,Lt,gn).call(this,Q,Tt),q(this,Ot,pe).call(this),q(this,j,oe).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(Q,Tt,Nt){var X,J,ot;if(Q instanceof z.InkAnnotationElement)return null;const Rt=super.deserialize(Q,Tt,Nt);Rt.thickness=Q.thickness,Rt.color=i.Util.makeHexColor(...Q.color),Rt.opacity=Q.opacity;const[Bt,Ut]=Rt.pageDimensions,Qt=Rt.width*Bt,At=Rt.height*Ut,Kt=Rt.parentScale,It=Q.thickness/2;rt(Rt,p,!0),rt(Rt,A,Math.round(Qt)),rt(Rt,l,Math.round(At));const{paths:B,rect:e,rotation:y}=Q;for(let{bezier:yt}of B){yt=q(X=vt,Vt,Kn).call(X,yt,e,y);const Ft=[];Rt.paths.push(Ft);let kt=Kt*(yt[0]-It),qt=Kt*(yt[1]-It);for(let Dt=2,$t=yt.length;Dt<$t;Dt+=6){const Yt=Kt*(yt[Dt]-It),Jt=Kt*(yt[Dt+1]-It),Zt=Kt*(yt[Dt+2]-It),ie=Kt*(yt[Dt+3]-It),se=Kt*(yt[Dt+4]-It),re=Kt*(yt[Dt+5]-It);Ft.push([[kt,qt],[Yt,Jt],[Zt,ie],[se,re]]),kt=se,qt=re}const Mt=q(this,pt,Yn).call(this,Ft);Rt.bezierPath2D.push(Mt)}const U=q(J=Rt,Ht,bn).call(J);return rt(Rt,m,Math.max(f.AnnotationEditor.MIN_SIZE,U[2]-U[0])),rt(Rt,C,Math.max(f.AnnotationEditor.MIN_SIZE,U[3]-U[1])),q(ot=Rt,Lt,gn).call(ot,Qt,At),Rt}serialize(){if(this.isEmpty())return null;const Q=this.getRect(0,0),Tt=f.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:i.AnnotationEditorType.INK,color:Tt,thickness:this.thickness,opacity:this.opacity,paths:q(this,zt,Jn).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,Q),pageIndex:this.pageIndex,rect:Q,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};C=new WeakMap,m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakMap,w=new WeakMap,P=new WeakMap,A=new WeakMap,l=new WeakMap,d=new WeakMap,D=new WeakSet,Un=function(Q){const Tt=this.thickness;this.addCommands({cmd:()=>{this.thickness=Q,q(this,K,ge).call(this)},undo:()=>{this.thickness=Tt,q(this,K,ge).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},c=new WeakSet,jn=function(Q){const Tt=this.color;this.addCommands({cmd:()=>{this.color=Q,q(this,j,oe).call(this)},undo:()=>{this.color=Tt,q(this,j,oe).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},g=new WeakSet,Wn=function(Q){Q/=100;const Tt=this.opacity;this.addCommands({cmd:()=>{this.opacity=Q,q(this,j,oe).call(this)},undo:()=>{this.opacity=Tt,q(this,j,oe).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},V=new WeakSet,Hn=function(){const{parentRotation:Q,parentDimensions:[Tt,Nt]}=this;switch(Q){case 90:return[0,Nt,Nt,Tt];case 180:return[Tt,Nt,Tt,Nt];case 270:return[Tt,0,Nt,Tt];default:return[0,0,Tt,Nt]}},Y=new WeakSet,un=function(){const{ctx:Q,color:Tt,opacity:Nt,thickness:Rt,parentScale:Bt,scaleFactor:Ut}=this;Q.lineWidth=Rt*Bt/Ut,Q.lineCap="round",Q.lineJoin="round",Q.miterLimit=10,Q.strokeStyle=`${Tt}${(0,ut.opacityToHex)(Nt)}`},lt=new WeakSet,$n=function(Q,Tt){this.canvas.addEventListener("contextmenu",H.noContextMenu),this.canvas.addEventListener("pointerleave",t(this,N)),this.canvas.addEventListener("pointermove",t(this,I)),this.canvas.addEventListener("pointerup",t(this,R)),this.canvas.removeEventListener("pointerdown",t(this,E)),this.isEditing=!0,t(this,w)||
8(rt(this,w,!0),q(this,Ot,pe).call(this),this.thickness||(this.thickness=vt._defaultThickness),this.color||(this.color=vt._defaultColor||f.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=vt._defaultOpacity)),this.currentPath.push([Q,Tt]),rt(this,_,!1),q(this,Y,un).call(this),rt(this,d,()=>{q(this,o,zn).call(this),t(this,d)&&window.requestAnimationFrame(t(this,d))}),window.requestAnimationFrame(t(this,d))},ht=new WeakSet,fn=function(Q,Tt){const[Nt,Rt]=this.currentPath.at(-1);if(this.currentPath.length>1&&Q===Nt&&Tt===Rt)return;const Bt=this.currentPath;let Ut=t(this,v);if(Bt.push([Q,Tt]),rt(this,_,!0),Bt.length<=2){Ut.moveTo(...Bt[0]),Ut.lineTo(Q,Tt);return}Bt.length===3&&(rt(this,v,Ut=new Path2D),Ut.moveTo(...Bt[0])),q(this,h,Xn).call(this,Ut,...Bt.at(-3),...Bt.at(-2),Q,Tt)},St=new WeakSet,Gn=function(){if(this.currentPath.length===0)return;const Q=this.currentPath.at(-1);t(this,v).lineTo(...Q)},x=new WeakSet,Vn=function(Q,Tt){rt(this,d,null),Q=Math.min(Math.max(Q,0),this.canvas.width),Tt=Math.min(Math.max(Tt,0),this.canvas.height),q(this,ht,fn).call(this,Q,Tt),q(this,St,Gn).call(this);let Nt;if(this.currentPath.length!==1)Nt=q(this,S,qn).call(this);else{const At=[Q,Tt];Nt=[[At,At.slice(),At.slice(),At]]}const Rt=t(this,v),Bt=this.currentPath;this.currentPath=[],rt(this,v,new Path2D);const Ut=()=>{this.allRawPaths.push(Bt),this.paths.push(Nt),this.bezierPath2D.push(Rt),this.rebuild()},Qt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(q(this,dt,Me).call(this),q(this,ct,De).call(this)),q(this,K,ge).call(this))};this.addCommands({cmd:Ut,undo:Qt,mustExec:!0})},o=new WeakSet,zn=function(){if(!t(this,_))return;rt(this,_,!1);const Q=Math.ceil(this.thickness*this.parentScale),Tt=this.currentPath.slice(-3),Nt=Tt.map(Ut=>Ut[0]),Rt=Tt.map(Ut=>Ut[1]);Math.min(...Nt)-Q,Math.max(...Nt)+Q,Math.min(...Rt)-Q,Math.max(...Rt)+Q;const{ctx:Bt}=this;Bt.save(),Bt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Ut of this.bezierPath2D)Bt.stroke(Ut);Bt.stroke(t(this,v)),Bt.restore()},h=new WeakSet,Xn=function(Q,Tt,Nt,Rt,Bt,Ut,Qt){const At=(Tt+Rt)/2,Kt=(Nt+Bt)/2,It=(Rt+Ut)/2,B=(Bt+Qt)/2;Q.bezierCurveTo(At+2*(Rt-At)/3,Kt+2*(Bt-Kt)/3,It+2*(Rt-It)/3,B+2*(Bt-B)/3,It,B)},S=new WeakSet,qn=function(){const Q=this.currentPath;if(Q.length<=2)return[[Q[0],Q[0],Q.at(-1),Q.at(-1)]];const Tt=[];let Nt,[Rt,Bt]=Q[0];for(Nt=1;Nt<Q.length-2;Nt++){const[e,y]=Q[Nt],[U,X]=Q[Nt+1],J=(e+U)/2,ot=(y+X)/2,yt=[Rt+2*(e-Rt)/3,Bt+2*(y-Bt)/3],Ft=[J+2*(e-J)/3,ot+2*(y-ot)/3];Tt.push([[Rt,Bt],yt,Ft,[J,ot]]),[Rt,Bt]=[J,ot]}const[Ut,Qt]=Q[Nt],[At,Kt]=Q[Nt+1],It=[Rt+2*(Ut-Rt)/3,Bt+2*(Qt-Bt)/3],B=[At+2*(Ut-At)/3,Kt+2*(Qt-Kt)/3];return Tt.push([[Rt,Bt],It,B,[At,Kt]]),Tt},j=new WeakSet,oe=function(){if(this.isEmpty()){q(this,et,Le).call(this);return}q(this,Y,un).call(this);const{canvas:Q,ctx:Tt}=this;Tt.setTransform(1,0,0,1,0,0),Tt.clearRect(0,0,Q.width,Q.height),q(this,et,Le).call(this);for(const Nt of this.bezierPath2D)Tt.stroke(Nt)},tt=new WeakSet,pn=function(Q){this.canvas.removeEventListener("pointerleave",t(this,N)),this.canvas.removeEventListener("pointermove",t(this,I)),this.canvas.removeEventListener("pointerup",t(this,R)),this.canvas.addEventListener("pointerdown",t(this,E)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",H.noContextMenu)},10),q(this,x,Vn).call(this,Q.offsetX,Q.offsetY),this.addToAnnotationStorage(),this.setInBackground()},dt=new WeakSet,Me=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",f.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(Q=>{var Tt;return(Tt=this.canvas)==null?void 0:Tt.setAttribute("aria-label",Q)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},ct=new WeakSet,De=function(){rt(this,P,new ResizeObserver(Q=>{const Tt=Q[0].contentRect;Tt.width&&Tt.height&&this.setDimensions(Tt.width,Tt.height)})),t(this,P).observe(this.div)},Ot=new WeakSet,pe=function(){if(!t(this,w))return;const[Q,Tt]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*Q),this.canvas.height=Math.ceil(this.height*Tt),q(this,et,Le).call(this)},Lt=new WeakSet,gn=function(Q,Tt){const Nt=q(this,ft,Oe).call(this),Rt=(Q-Nt)/t(this,m),Bt=(Tt-Nt)/t(this,C);this.scaleFactor=Math.min(Rt,Bt)},et=new WeakSet,Le=function(){const Q=q(this,ft,Oe).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Q,this.translationY*this.scaleFactor+Q)},pt=new WeakSet,Yn=function(Q){const Tt=new Path2D;for(let Nt=0,Rt=Q.length;Nt<Rt;Nt++){const[Bt,Ut,Qt,At]=Q[Nt];Nt===0&&Tt.moveTo(...Bt),Tt.bezierCurveTo(Ut[0],Ut[1],Qt[0],Qt[1],At[0],At[1])}return Tt},Ct=new WeakSet,mn=function(Q,Tt,Nt){const[Rt,Bt,Ut,Qt]=Tt;switch(Nt){case 0:for(let At=0,Kt=Q.length;At<Kt;At+=2)Q[At]+=Rt,Q[At+1]=Qt-Q[At+1];break;case 90:for(let At=0,Kt=Q.length;At<Kt;At+=2){const It=Q[At];Q[At]=Q[At+1]+Rt,Q[At+1]=It+Bt}break;case 180:for(let At=0,Kt=Q.length;At<Kt;At+=2)Q[At]=Ut-Q[At],Q[At+1]+=Bt;break;case 270:for(let At=0,Kt=Q.length;At<Kt;At+=2){const It=Q[At];Q[At]=Ut-Q[At+1],Q[At+1]=Qt-It}break;default:throw new Error("Invalid rotation")}return Q},Vt=new WeakSet,Kn=function(Q,Tt,Nt){const[Rt,Bt,Ut,Qt]=Tt;switch(Nt){case 0:for(let At=0,Kt=Q.length;At<Kt;At+=2)Q[At]-=Rt,Q[At+1]=Qt-Q[At+1];break;case 90:for(let At=0,Kt=Q.length;At<Kt;At+=2){const It=Q[At];Q[At]=Q[At+1]-Bt,Q[At+1]=It-Rt}break;case 180:for(let At=0,Kt=Q.length;At<Kt;At+=2)Q[At]=Ut-Q[At],Q[At+1]-=Bt;break;case 270:for(let At=0,Kt=Q.length;At<Kt;At+=2){const It=Q[At];Q[At]=Qt-Q[At+1],Q[At+1]=Ut-It}break;default:throw new Error("Invalid rotation")}return Q},zt=new WeakSet,Jn=function(Q,Tt,Nt,Rt){var Kt,It;const Bt=[],Ut=this.thickness/2,Qt=Q*Tt+Ut,At=Q*Nt+Ut;for(const B of this.paths){const e=[],y=[];for(let U=0,X=B.length;U<X;U++){const[J,ot,yt,Ft]=B[U],kt=Q*J[0]+Qt,qt=Q*J[1]+At,Mt=Q*ot[0]+Qt,Dt=Q*ot[1]+At,$t=Q*yt[0]+Qt,Yt=Q*yt[1]+At,Jt=Q*Ft[0]+Qt,Zt=Q*Ft[1]+At;U===0&&(e.push(kt,qt),y.push(kt,qt)),e.push(Mt,Dt,$t,Yt,Jt,Zt),y.push(Mt,Dt),U===X-1&&y.push(Jt,Zt)}Bt.push({bezier:q(Kt=vt,Ct,mn).call(Kt,e,Rt,this.rotation),points:q(It=vt,Ct,mn).call(It,y,Rt,this.rotation)})}return Bt},Ht=new WeakSet,bn=function(){let Q=1/0,Tt=-1/0,Nt=1/0,Rt=-1/0;for(const Bt of this.paths)for(const[Ut,Qt,At,Kt]of Bt){const It=i.Util.bezierBoundingBox(...Ut,...Qt,...At,...Kt);Q=Math.min(Q,It[0]),Nt=Math.min(Nt,It[1]),Tt=Math.max(Tt,It[2]),Rt=Math.max(Rt,It[3])}return[Q,Nt,Tt,Rt]}
8,ft=new WeakSet,Oe=function(){return t(this,p)?Math.ceil(this.thickness*this.parentScale):0},K=new WeakSet,ge=function(Q=!1){if(this.isEmpty())return;if(!t(this,p)){q(this,j,oe).call(this);return}const Tt=q(this,Ht,bn).call(this),Nt=q(this,ft,Oe).call(this);rt(this,m,Math.max(f.AnnotationEditor.MIN_SIZE,Tt[2]-Tt[0])),rt(this,C,Math.max(f.AnnotationEditor.MIN_SIZE,Tt[3]-Tt[1]));const Rt=Math.ceil(Nt+t(this,m)*this.scaleFactor),Bt=Math.ceil(Nt+t(this,C)*this.scaleFactor),[Ut,Qt]=this.parentDimensions;this.width=Rt/Ut,this.height=Bt/Qt,this.setAspectRatio(Rt,Bt);const At=this.translationX,Kt=this.translationY;this.translationX=-Tt[0],this.translationY=-Tt[1],q(this,Ot,pe).call(this),q(this,j,oe).call(this),rt(this,A,Rt),rt(this,l,Bt),this.setDims(Rt,Bt);const It=Q?Nt/this.scaleFactor/2:0;this.translate(At-this.translationX-It,Kt-this.translationY-It)},W(vt,pt),W(vt,Ct),W(vt,Vt),ne(vt,"_defaultColor",null),ne(vt,"_defaultOpacity",1),ne(vt,"_defaultThickness",1),ne(vt,"_type","ink");let M=vt;n.InkEditor=M},(F,n,L)=>{var M,C,m,I,N,R,E,v,p,_,w,Ee,A,Se,d,Ie,b,yn,k,Qn,$,Zn,T,_n,it,Ne,G,ts;Object.defineProperty(n,"__esModule",{value:!0}),n.StampEditor=void 0;var i=L(1),f=L(4),z=L(6),H=L(29);const bt=class bt extends f.AnnotationEditor{constructor(x){super({...x,name:"stampEditor"});W(this,w);W(this,A);W(this,d);W(this,b);W(this,k);W(this,$);W(this,T);W(this,it);W(this,G);W(this,M,null);W(this,C,null);W(this,m,null);W(this,I,null);W(this,N,null);W(this,R,null);W(this,E,null);W(this,v,null);W(this,p,!1);W(this,_,!1);rt(this,I,x.bitmapUrl),rt(this,N,x.bitmapFile)}static initialize(x){f.AnnotationEditor.initialize(x)}static get supportedTypes(){const x=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,i.shadow)(this,"supportedTypes",x.map(s=>`image/${s}`))}static get supportedTypesStr(){return(0,i.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(x){return this.supportedTypes.includes(x)}static paste(x,s){s.pasteEditor(i.AnnotationEditorType.STAMP,{bitmapFile:x.getAsFile()})}remove(){var x,s;t(this,C)&&(rt(this,M,null),this._uiManager.imageManager.deleteId(t(this,C)),(x=t(this,R))==null||x.remove(),rt(this,R,null),(s=t(this,E))==null||s.disconnect(),rt(this,E,null)),super.remove()}rebuild(){if(!this.parent){t(this,C)&&q(this,d,Ie).call(this);return}super.rebuild(),this.div!==null&&(t(this,C)&&q(this,d,Ie).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(t(this,m)||t(this,M)||t(this,I)||t(this,N))}get isResizable(){return!0}render(){if(this.div)return this.div;let x,s;if(this.width&&(x=this.x,s=this.y),super.render(),this.div.hidden=!0,t(this,M)?q(this,b,yn).call(this):q(this,d,Ie).call(this),this.width){const[o,a]=this.parentDimensions;this.setAt(x*o,s*a,this.width*o,this.height*a)}return this.div}static deserialize(x,s,o){if(x instanceof H.StampAnnotationElement)return null;const a=super.deserialize(x,s,o),{rect:h,bitmapUrl:u,bitmapId:S,isSvg:O,accessibilityData:j}=x;S&&o.imageManager.isValidId(S)?rt(a,C,S):rt(a,I,u),rt(a,p,O);const[st,tt]=a.pageDimensions;return a.width=(h[2]-h[0])/st,a.height=(h[3]-h[1])/tt,j&&(a.altTextData=j),a}serialize(x=!1,s=null){if(this.isEmpty())return null;const o={annotationType:i.AnnotationEditorType.STAMP,bitmapId:t(this,C),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:t(this,p),structTreeParentId:this._structTreeParentId};if(x)return o.bitmapUrl=q(this,it,Ne).call(this,!0),o.accessibilityData=this.altTextData,o;const{decorative:a,altText:h}=this.altTextData;if(!a&&h&&(o.accessibilityData={type:"Figure",alt:h}),s===null)return o;s.stamps||(s.stamps=new Map);const u=t(this,p)?(o.rect[2]-o.rect[0])*(o.rect[3]-o.rect[1]):null;if(!s.stamps.has(t(this,C)))s.stamps.set(t(this,C),{area:u,serialized:o}),o.bitmap=q(this,it,Ne).call(this,!1);else if(t(this,p)){const S=s.stamps.get(t(this,C));u>S.area&&(S.area=u,S.serialized.bitmap.close(),S.serialized.bitmap=q(this,it,Ne).call(this,!1))}return o}};M=new WeakMap,C=new WeakMap,m=new WeakMap,I=new WeakMap,N=new WeakMap,R=new WeakMap,E=new WeakMap,v=new WeakMap,p=new WeakMap,_=new WeakMap,w=new WeakSet,Ee=function(x,s=!1){if(!x){this.remove();return}rt(this,M,x.bitmap),s||(rt(this,C,x.id),rt(this,p,x.isSvg)),q(this,b,yn).call(this)},A=new WeakSet,Se=function(){rt(this,m,null),this._uiManager.enableWaiting(!1),t(this,R)&&this.div.focus()},d=new WeakSet,Ie=function(){if(t(this,C)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(t(this,C)).then(s=>q(this,w,Ee).call(this,s,!0)).finally(()=>q(this,A,Se).call(this));return}if(t(this,I)){const s=t(this,I);rt(this,I,null),this._uiManager.enableWaiting(!0),rt(this,m,this._uiManager.imageManager.getFromUrl(s).then(o=>q(this,w,Ee).call(this,o)).finally(()=>q(this,A,Se).call(this)));return}if(t(this,N)){const s=t(this,N);rt(this,N,null),this._uiManager.enableWaiting(!0),rt(this,m,this._uiManager.imageManager.getFromFile(s).then(o=>q(this,w,Ee).call(this,o)).finally(()=>q(this,A,Se).call(this)));return}const x=document.createElement("input");x.type="file",x.accept=bt.supportedTypesStr,rt(this,m,new Promise(s=>{x.addEventListener("change",async()=>
8{if(!x.files||x.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const o=await this._uiManager.imageManager.getFromFile(x.files[0]);q(this,w,Ee).call(this,o)}s()}),x.addEventListener("cancel",()=>{this.remove(),s()})}).finally(()=>q(this,A,Se).call(this))),x.click()},b=new WeakSet,yn=function(){const{div:x}=this;let{width:s,height:o}=t(this,M);const[a,h]=this.pageDimensions,u=.75;if(this.width)s=this.width*a,o=this.height*h;else if(s>u*a||o>u*h){const st=Math.min(u*a/s,u*h/o);s*=st,o*=st}const[S,O]=this.parentDimensions;this.setDims(s*S/a,o*O/h),this._uiManager.enableWaiting(!1);const j=rt(this,R,document.createElement("canvas"));x.append(j),x.hidden=!1,q(this,T,_n).call(this,s,o),q(this,G,ts).call(this),t(this,_)||(this.parent.addUndoableEditor(this),rt(this,_,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},k=new WeakSet,Qn=function(x,s){var u;const[o,a]=this.parentDimensions;this.width=x/o,this.height=s/a,this.setDims(x,s),(u=this._initialOptions)!=null&&u.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,t(this,v)!==null&&clearTimeout(t(this,v)),rt(this,v,setTimeout(()=>{rt(this,v,null),q(this,T,_n).call(this,x,s)},200))},$=new WeakSet,Zn=function(x,s){const{width:o,height:a}=t(this,M);let h=o,u=a,S=t(this,M);for(;h>2*x||u>2*s;){const O=h,j=u;h>2*x&&(h=h>=16384?Math.floor(h/2)-1:Math.ceil(h/2)),u>2*s&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2));const st=new OffscreenCanvas(h,u);st.getContext("2d").drawImage(S,0,0,O,j,0,0,h,u),S=st.transferToImageBitmap()}return S},T=new WeakSet,_n=function(x,s){x=Math.ceil(x),s=Math.ceil(s);const o=t(this,R);if(!o||o.width===x&&o.height===s)return;o.width=x,o.height=s;const a=t(this,p)?t(this,M):q(this,$,Zn).call(this,x,s),h=o.getContext("2d");h.filter=this._uiManager.hcmFilter,h.drawImage(a,0,0,a.width,a.height,0,0,x,s)},it=new WeakSet,Ne=function(x){if(x){if(t(this,p)){const a=this._uiManager.imageManager.getSvgUrl(t(this,C));if(a)return a}const s=document.createElement("canvas");return{width:s.width,height:s.height}=t(this,M),s.getContext("2d").drawImage(t(this,M),0,0),s.toDataURL()}if(t(this,p)){const[s,o]=this.pageDimensions,a=Math.round(this.width*s*z.PixelsPerInch.PDF_TO_CSS_UNITS),h=Math.round(this.height*o*z.PixelsPerInch.PDF_TO_CSS_UNITS),u=new OffscreenCanvas(a,h);return u.getContext("2d").drawImage(t(this,M),0,0,t(this,M).width,t(this,M).height,0,0,a,h),u.transferToImageBitmap()}return structuredClone(t(this,M))},G=new WeakSet,ts=function(){rt(this,E,new ResizeObserver(x=>{const s=x[0].contentRect;s.width&&s.height&&q(this,k,Qn).call(this,s.width,s.height)})),t(this,E).observe(this.div)},ne(bt,"_type","stamp");let ut=bt;n.StampEditor=ut}],__webpack_module_cache__={};function __w_pdfjs_require__(F){var n=__webpack_module_cache__[F];if(n!==void 0)return n.exports;var L=__webpack_module_cache__[F]={exports:{}};return __webpack_modules__[F](L,L.exports,__w_pdfjs_require__),L.exports}var __webpack_exports__={};return(()=>{var F=__webpack_exports__;Object.defineProperty(F,"__esModule",{value:!0}),Object.defineProperty(F,"AbortException",{enumerable:!0,get:function(){return n.AbortException}}),Object.defineProperty(F,"AnnotationEditorLayer",{enumerable:!0,get:function(){return z.AnnotationEditorLayer}}),Object.defineProperty(F,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return n.AnnotationEditorParamsType}}),Object.defineProperty(F,"AnnotationEditorType",{enumerable:!0,get:function(){return n.AnnotationEditorType}}),Object.defineProperty(F,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return H.AnnotationEditorUIManager}}),Object.defineProperty(F,"AnnotationLayer",{enumerable:!0,get:function(){return ut.AnnotationLayer}}),Object.defineProperty(F,"AnnotationMode",{enumerable:!0,get:function(){return n.AnnotationMode}}),Object.defineProperty(F,"CMapCompressionType",{enumerable:!0,get:function(){return n.CMapCompressionType}}),Object.defineProperty(F,"DOMSVGFactory",{enumerable:!0,get:function(){return i.DOMSVGFactory}}),Object.defineProperty(F,"FeatureTest",{enumerable:!0,get:function(){return n.FeatureTest}}),Object.defineProperty(F,"GlobalWorkerOptions",{enumerable:!0,get:function(){return M.GlobalWorkerOptions}}),Object.defineProperty(F,"ImageKind",{enumerable:!0,get:function(){return n.ImageKind}}),Object.defineProperty(F,"InvalidPDFException",{enumerable:!0,get:function(){return n.InvalidPDFException}}),Object.defineProperty(F,"MissingPDFException",{enumerable:!0,get:function(){return n.MissingPDFException}}),Object.defineProperty(F,"OPS",{enumerable:!0,get:function(){return n.OPS}}),Object.defineProperty(F,"PDFDataRangeTransport",{enumerable:!0,get:function(){return L.PDFDataRangeTransport}}),Object.defineProperty(F,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(F,"PDFWorker",{enumerable:!0,get:function(){return L.PDFWorker}}),Object.defineProperty(F,"PasswordResponses",{enumerable:!0,get:function(){return n.PasswordResponses}}),Object.defineProperty(F,"PermissionFlag",{enumerable:!0,get:function(){return n.PermissionFlag}}),Object.defineProperty(F,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(F,"PromiseCapability",{enumerable:!0,get:function(){return n.PromiseCapability}}),Object.defineProperty(F,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(F,"SVGGraphics",{enumerable:!0,get:function(){return L.SVGGraphics}}),Object.defineProperty(F,"UnexpectedResponseException",{enumerable:!0,get:function(){return n.UnexpectedResponseException}}),Object.defineProperty(F,"Util",{enumerable:!0,get:function(){return n.Util}}),Object.defineProperty(F,"VerbosityLevel",{enumerable:!0,get:function(){return n.VerbosityLevel}}
8),Object.defineProperty(F,"XfaLayer",{enumerable:!0,get:function(){return C.XfaLayer}}),Object.defineProperty(F,"build",{enumerable:!0,get:function(){return L.build}}),Object.defineProperty(F,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return n.createValidAbsoluteUrl}}),Object.defineProperty(F,"getDocument",{enumerable:!0,get:function(){return L.getDocument}}),Object.defineProperty(F,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(F,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(F,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(F,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(F,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(F,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(F,"noContextMenu",{enumerable:!0,get:function(){return i.noContextMenu}}),Object.defineProperty(F,"normalizeUnicode",{enumerable:!0,get:function(){return n.normalizeUnicode}}),Object.defineProperty(F,"renderTextLayer",{enumerable:!0,get:function(){return f.renderTextLayer}}),Object.defineProperty(F,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(F,"shadow",{enumerable:!0,get:function(){return n.shadow}}),Object.defineProperty(F,"updateTextLayer",{enumerable:!0,get:function(){return f.updateTextLayer}}),Object.defineProperty(F,"version",{enumerable:!0,get:function(){return L.version}});var n=__w_pdfjs_require__(1),L=__w_pdfjs_require__(2),i=__w_pdfjs_require__(6),f=__w_pdfjs_require__(26),z=__w_pdfjs_require__(27),H=__w_pdfjs_require__(5),ut=__w_pdfjs_require__(29),M=__w_pdfjs_require__(14),C=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var __spreadArray=globalThis&&globalThis.__spreadArray||function(F,n,L){if(L||arguments.length===2)for(var i=0,f=n.length,z;i<f;i++)(z||!(i in n))&&(z||(z=Array.prototype.slice.call(n,0,i)),z[i]=n[i]);return F.concat(z||Array.prototype.slice.call(n))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(F,n){var L={};
8return allEvents.forEach(function(i){var f=F[i];f&&(n?L[i]=function(z){return f(z,n(i))}:L[i]=f)}),L}function makeCancellablePromise(F){var n=!1,L=new Promise(function(i,f){F.then(function(z){return!n&&i(z)}).catch(function(z){return!n&&f(z)})});return{promise:L,cancel:function(){n=!0}}}var isProduction=!0,prefix="Invariant failed";function invariant(F,n){if(!F){if(isProduction)throw new Error(prefix);var L=typeof n=="function"?n():n,i=L?"".concat(prefix,": ").concat(L):prefix;throw new Error(i)}}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs(warning_1);var has=Object.prototype.hasOwnProperty;function find(F,n,L){for(L of F.keys())if(dequal(L,n))return L}function dequal(F,n){var L,i,f;if(F===n)return!0;if(F&&n&&(L=F.constructor)===n.constructor){if(L===Date)return F.getTime()===n.getTime();if(L===RegExp)return F.toString()===n.toString();if(L===Array){if((i=F.length)===n.length)for(;i--&&dequal(F[i],n[i]););return i===-1}if(L===Set){if(F.size!==n.size)return!1;for(i of F)if(f=i,f&&typeof f=="object"&&(f=find(n,f),!f)||!n.has(f))return!1;return!0}if(L===Map){if(F.size!==n.size)return!1;for(i of F)if(f=i[0],f&&typeof f=="object"&&(f=find(n,f),!f)||!dequal(i[1],n.get(f)))return!1;return!0}if(L===ArrayBuffer)F=new Uint8Array(F),n=new Uint8Array(n);else if(L===DataView){if((i=F.byteLength)===n.byteLength)for(;i--&&F.getInt8(i)===n.getInt8(i););return i===-1}if(ArrayBuffer.isView(F)){if((i=F.byteLength)===n.byteLength)for(;i--&&F[i]===n[i];);return i===-1}if(!L||typeof F=="object"){i=0;for(L in F)if(has.call(F,L)&&++i&&!has.call(n,L)||!(L in n)||!dequal(F[L],n[L]))return!1;return Object.keys(n).length===i}}return F!==F&&n!==n}const DocumentContext=reactExports.createContext(null);function Message({children:F,type:n}){return React.createElement("div",{className:`react-pdf__message react-pdf__message--${n}`},F)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(n){this.pdfDocument=n}setViewer(n){this.pdfViewer=n}setExternalLinkRel(n){this.externalLinkRel=n}setExternalLinkTarget(n){this.externalLinkTarget=n}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(n){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=n}get rotation(){return 0}set rotation(n){}goToDestination(n){return new Promise(L=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(n,"Destination is not specified."),typeof n=="string"?this.pdfDocument.getDestination(n).then(L):Array.isArray(n)?L(n):n.then(L)}).then(L=>{invariant(Array.isArray(L),`"${L}" is not a valid destination array.`);const i=L[0];new Promise(f=>{invariant(this.pdfDocument,"PDF document not loaded."),i instanceof Object?this.pdfDocument.getPageIndex(i).then(z=>{f(z)}).catch(()=>{invariant(!1,`"${i}" is not a valid page reference.`)}):typeof i=="number"?f(i):invariant(!1,`"${i}" is not a valid destination reference.`)}).then(f=>{const z=f+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(z>=1&&z<=this.pagesCount,`"${z}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:L,pageIndex:f,pageNumber:z})})})}navigateTo(n){this.goToDestination(n)}goToPage(n){const L=n-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(n>=1&&n<=this.pagesCount,`"${n}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:L,pageNumber:n})}addLinkAttributes(n,L,i){n.href=L,n.rel=this.externalLinkRel||DEFAULT_LINK_REL,n.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(F){return typeof F<"u"}function isProvided(F){return isDefined(F)&&F!==null}function isString(F){return typeof F=="string"}function isArrayBuffer(F){return F instanceof ArrayBuffer}function isBlob(F){return invariant(isBrowser,"isBlob can only be used in a browser environment"),F instanceof Blob}function isDataURI(F){return isString(F)&&/^data:/.test(F)}function dataURItoByteString(F){invariant(isDataURI(F),"Invalid data URI.");const[n="",L=""]=F.split(",");return n.split(";").indexOf("base64")!==-1?atob(L):unescape(L)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}const allowFileAccessFromFilesTip="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){warning$1(!isLocalFileSystem,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`)}function displayWorkerWarning(){warning$1(!isLocalFileSystem,`Loading PDF.js
8worker may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`)}function cancelRunningTask(F){F&&F.cancel&&F.cancel()}function makePageCallback(F,n){return Object.defineProperty(F,"width",{get(){return this.view[2]*n},configurable:!0}),Object.defineProperty(F,"height",{get(){return this.view[3]*n},configurable:!0}),Object.defineProperty(F,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(F,"originalHeight",{get(){return this.view[3]},configurable:!0}),F}function isCancelException(F){return F.name==="RenderingCancelledException"}function loadFromFile(F){return new Promise((n,L)=>{const i=new FileReader;i.onload=()=>{if(!i.result)return L(new Error("Error while reading a file."));n(i.result)},i.onerror=f=>{if(!f.target)return L(new Error("Error while reading a file."));const{error:z}=f.target;if(!z)return L(new Error("Error while reading a file."));switch(z.code){case z.NOT_FOUND_ERR:return L(new Error("Error while reading a file: File not found."));case z.SECURITY_ERR:return L(new Error("Error while reading a file: Security error."));case z.ABORT_ERR:return L(new Error("Error while reading a file: Aborted."));default:return L(new Error("Error while reading a file."))}},i.readAsArrayBuffer(F)})}function reducer(F,n){switch(n.type){case"RESOLVE":return{value:n.value,error:void 0};case"REJECT":return{value:!1,error:n.error};case"RESET":return{value:void 0,error:void 0};default:return F}}function useResolver(){return reactExports.useReducer(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const F={};return allEvents.forEach(n=>{F[n]=PropTypes.func}),F})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService);PropTypes.oneOf(["_self","_blank","_parent","_top"]);PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function F(n,L,i){const{[L]:f,pageNumber:z,pdf:H}=n;if(!isDefined(H))return null;if(isDefined(f)){if(typeof f!="number")return new Error(`\`${L}\` of type \`${typeof f}\` supplied to \`${i}\`, expected \`number\`.`);if(f<0)return new Error(`Expected \`${L}\` to be greater or equal to 0.`);const{numPages:ut}=H;if(f+1>ut)return new Error(`Expected \`${L}\` to be less or equal to ${ut-1}.`)}else if(!isDefined(z))return new Error(`\`${L}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${i}\`.`);return null},isPageNumber=function F(n,L,i){const{[L]:f,pageIndex:z,pdf:H}=n;if(!isDefined(H))return null;if(isDefined(f)){if(typeof f!="number")return new Error(`\`${L}\` of type \`${typeof f}\` supplied to \`${i}\`, expected \`number\`.`);if(f<1)return new Error(`Expected \`${L}\` to be greater or equal to 1.`);const{numPages:ut}=H;if(f>ut)return new Error(`Expected \`${L}\` to be less or equal to ${ut}.`)}else if(!isDefined(z))return new Error(`\`${L}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${i}\`.`);return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter=globalThis&&globalThis.__awaiter||function(F,n,L,i){function f(z){return z instanceof L?z:new L(function(H){H(z)})}
8return new(L||(L=Promise))(function(z,H){function ut(m){try{C(i.next(m))}catch(I){H(I)}}function M(m){try{C(i.throw(m))}catch(I){H(I)}}function C(m){m.done?z(m.value):f(m.value).then(ut,M)}C((i=i.apply(F,n||[])).next())})},__rest$1=globalThis&&globalThis.__rest||function(F,n){var L={};for(var i in F)Object.prototype.hasOwnProperty.call(F,i)&&n.indexOf(i)<0&&(L[i]=F[i]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,i=Object.getOwnPropertySymbols(F);f<i.length;f++)n.indexOf(i[f])<0&&Object.prototype.propertyIsEnumerable.call(F,i[f])&&(L[i[f]]=F[i[f]]);return L};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(F,n)=>{switch(n){case PasswordResponses$1.NEED_PASSWORD:{const L=prompt("Enter the password to open this PDF file.");F(L);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const L=prompt("Invalid password. Please try again.");F(L);break}}};function isParameterObject(F){return typeof F=="object"&&F!==null&&("data"in F||"range"in F||"url"in F)}const Document=reactExports.forwardRef(function F(n,L){var{children:i,className:f,error:z="Failed to load PDF file.",externalLinkRel:H,externalLinkTarget:ut,file:M,inputRef:C,imageResourcesPath:m,loading:I="Loading PDFâ¦",noData:N="No PDF file specified.",onItemClick:R,onLoadError:E,onLoadProgress:v,onLoadSuccess:p,onPassword:_=defaultOnPassword,onSourceError:w,onSourceSuccess:P,options:A,renderMode:l,rotate:d}=n,D=__rest$1(n,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[b,c]=useResolver(),{value:k,error:g}=b,[$,V]=useResolver(),{value:T,error:Y}=$,it=reactExports.useRef(new LinkService),lt=reactExports.useRef([]),G=reactExports.useRef(),ht=reactExports.useRef();reactExports.useEffect(()=>{M&&M!==G.current&&isParameterObject(M)&&(warning$1(!dequal(M,G.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),G.current=M)},[M]),reactExports.useEffect(()=>{A&&A!==ht.current&&(warning$1(!dequal(A,ht.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),ht.current=A)},[A]);const bt=reactExports.useRef({scrollPageIntoView:gt=>{const{dest:ct,pageNumber:xt,pageIndex:Ot=xt-1}=gt;if(R){R({dest:ct,pageIndex:Ot,pageNumber:xt});return}const Et=lt.current[Ot];if(Et){Et.scrollIntoView();return}warning$1(!1,`An internal link leading to page ${xt} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});reactExports.useImperativeHandle(L,()=>({linkService:it,pages:lt,viewer:bt}),[]);function St(){P&&P()}function Pt(){g&&(warning$1(!1,g.toString()),w&&w(g))}function x(){c({type:"RESET"})}reactExports.useEffect(x,[M,c]);const s=reactExports.useCallback(()=>__awaiter(this,void 0,void 0,function*(){if(!M)return null;if(typeof M=="string")return isDataURI(M)?{data:dataURItoByteString(M)}:(displayCORSWarning(),{url:M});if(M instanceof PDFDataRangeTransport)return{range:M};if(isArrayBuffer(M))return{data:M};if(isBrowser&&isBlob(M))return{data:yield loadFromFile(M)};if(invariant(typeof M=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant(isParameterObject(M),"Invalid parameter object: need either .data, .range or .url"),"url"in M&&typeof M.url=="string"){if(isDataURI(M.url)){const{url:gt}=M,ct=__rest$1(M,["url"]),xt=dataURItoByteString(gt);return Object.assign({data:xt},ct)}displayCORSWarning()}return M}),[M]);reactExports.useEffect(()=>{const gt=makeCancellablePromise(s());return gt.promise.then(ct=>{c({type:"RESOLVE",value:ct})}).catch(ct=>{c({type:"REJECT",error:ct})}),()=>{cancelRunningTask(gt)}},[s,c]),reactExports.useEffect(()=>{if(!(typeof k>"u")){if(k===!1){Pt();return}St()}},[k]);
8function o(){T&&(p&&p(T),lt.current=new Array(T.numPages),it.current.setDocument(T))}function a(){Y&&(warning$1(!1,Y.toString()),E&&E(Y))}function h(){V({type:"RESET"})}reactExports.useEffect(h,[V,k]);function u(){if(!k)return;const gt=Object.assign(Object.assign({},A),{isEvalSupported:!1}),ct=Object.assign(Object.assign({},k),gt),xt=pdfjs$1.getDocument(ct);v&&(xt.onProgress=v),_&&(xt.onPassword=_);const Ot=xt;return Ot.promise.then(Et=>{V({type:"RESOLVE",value:Et})}).catch(Et=>{Ot.destroyed||V({type:"REJECT",error:Et})}),()=>{Ot.destroy()}}reactExports.useEffect(u,[A,V,k]),reactExports.useEffect(()=>{if(!(typeof T>"u")){if(T===!1){a();return}o()}},[T]);function S(){it.current.setViewer(bt.current),it.current.setExternalLinkRel(H),it.current.setExternalLinkTarget(ut)}reactExports.useEffect(S,[H,ut]);function O(gt,ct){lt.current[gt]=ct}function j(gt){delete lt.current[gt]}const st=reactExports.useMemo(()=>({imageResourcesPath:m,linkService:it.current,onItemClick:R,pdf:T,registerPage:O,renderMode:l,rotate:d,unregisterPage:j}),[m,R,T,l,d]),tt=reactExports.useMemo(()=>makeEventProps(D,()=>T),[D,T]);function at(){return React.createElement(DocumentContext.Provider,{value:st},i)}function dt(){return M?T==null?React.createElement(Message,{type:"loading"},typeof I=="function"?I():I):T===!1?React.createElement(Message,{type:"error"},typeof z=="function"?z():z):at():React.createElement(Message,{type:"no-data"},typeof N=="function"?N():N)}return React.createElement("div",Object.assign({className:clsx("react-pdf__Document",f),ref:C,style:{"--scale-factor":"1"}},tt),dt())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$1=Document;function useDocumentContext(){return reactExports.useContext(DocumentContext)}function mergeRefs(){for(var F=[],n=0;n<arguments.length;n++)F[n]=arguments[n];var L=F.filter(Boolean);if(L.length<=1){var i=L[0];return i||null}return function(z){L.forEach(function(H){typeof H=="function"?H(z):H&&(H.current=z)})}}const PageContext=reactExports.createContext(null),PDF_ROLE_TO_HTML_ROLE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(F){return F in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(F){return"children"in F}function isStructTreeNodeWithOnlyContentChild(F){return isStructTreeNode(F)?F.children.length===1&&0 in F.children&&"id"in F.children[0]:!1}function getRoleAttributes(F){const n={};if(isStructTreeNode(F)){const{role:L}
8=F,i=L.match(HEADING_PATTERN);if(i)n.role="heading",n["aria-level"]=Number(i[1]);else if(isPdfRole(L)){const f=PDF_ROLE_TO_HTML_ROLE[L];f&&(n.role=f)}}return n}function getBaseAttributes(F){const n={};if(isStructTreeNode(F)){if(F.alt!==void 0&&(n["aria-label"]=F.alt),F.lang!==void 0&&(n.lang=F.lang),isStructTreeNodeWithOnlyContentChild(F)){const[L]=F.children;if(L){const i=getBaseAttributes(L);return Object.assign(Object.assign({},n),i)}}}else"id"in F&&(n["aria-owns"]=F.id);return n}function getAttributes(F){return F?Object.assign(Object.assign({},getRoleAttributes(F)),getBaseAttributes(F)):null}function StructTreeItem({className:F,node:n}){const L=reactExports.useMemo(()=>getAttributes(n),[n]),i=reactExports.useMemo(()=>!isStructTreeNode(n)||isStructTreeNodeWithOnlyContentChild(n)?null:n.children.map((f,z)=>React.createElement(StructTreeItem,{key:z,node:f})),[n]);return React.createElement("span",Object.assign({className:F},L),i)}function usePageContext(){return reactExports.useContext(PageContext)}function StructTree(){const F=usePageContext();invariant(F,"Unable to find Page context.");const{onGetStructTreeError:n,onGetStructTreeSuccess:L}=F,[i,f]=useResolver(),{value:z,error:H}=i,{customTextRenderer:ut,page:M}=F;function C(){z&&L&&L(z)}function m(){H&&(warning$1(!1,H.toString()),n&&n(H))}function I(){f({type:"RESET"})}reactExports.useEffect(I,[f,M]);function N(){if(ut||!M)return;const R=makeCancellablePromise(M.getStructTree()),E=R;return R.promise.then(v=>{f({type:"RESOLVE",value:v})}).catch(v=>{f({type:"REJECT",error:v})}),()=>cancelRunningTask(E)}return reactExports.useEffect(N,[ut,M,f]),reactExports.useEffect(()=>{if(z!==void 0){if(z===!1){m();return}C()}},[z]),z?React.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:z}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(F){const n=usePageContext();invariant(n,"Unable to find Page context.");const L=Object.assign(Object.assign({},n),F),{_className:i,canvasBackground:f,devicePixelRatio:z=getDevicePixelRatio(),onRenderError:H,onRenderSuccess:ut,page:M,renderForms:C,renderTextLayer:m,rotate:I,scale:N}=L,{canvasRef:R}=F;invariant(M,"Attempted to render page canvas, but no page was specified.");const E=reactExports.useRef(null);function v(){M&&ut&&ut(makePageCallback(M,N))}function p(l){isCancelException(l)||(warning$1(!1,l.toString()),H&&H(l))}const _=reactExports.useMemo(()=>M.getViewport({scale:N*z,rotation:I}),[z,M,I,N]),w=reactExports.useMemo(()=>M.getViewport({scale:N,rotation:I}),[M,I,N]);function P(){if(!M)return;M.cleanup();const{current:l}=E;if(!l)return;l.width=_.width,l.height=_.height,l.style.width=`${Math.floor(w.width)}px`,l.style.height=`${Math.floor(w.height)}px`,l.style.visibility="hidden";const d={annotationMode:C?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:l.getContext("2d",{alpha:!1}),viewport:_};f&&(d.background=f);const D=M.render(d),b=D;return D.promise.then(()=>{l.style.visibility="",v()}).catch(p),()=>cancelRunningTask(b)}reactExports.useEffect(P,[f,E,z,M,C,_,w]);const A=reactExports.useCallback(()=>{const{current:l}=E;l&&(l.width=0,l.height=0)},[E]);return reactExports.useEffect(()=>A,[A]),React.createElement("canvas",{className:`${i}__canvas`,dir:"ltr",ref:mergeRefs(R,E),style:{display:"block",userSelect:"none"}},m?React.createElement(StructTree,null):null)}function PageSVG(){const F=usePageContext();invariant(F,"Unable to find Page context.");const{_className:n,onRenderSuccess:L,onRenderError:i,page:f,rotate:z,scale:H}=F;invariant(f,"Attempted to render page SVG, but no page was specified.");const[ut,M]=useResolver(),{value:C,error:m}=ut;function I(){f&&L&&L(makePageCallback(f,H))}function N(){m&&(isCancelException(m)||(warning$1(!1,m.toString()),i&&i(m)))}const R=reactExports.useMemo(()=>f.getViewport({scale:H,rotation:z}),[f,z,H]);function E(){M({type:"RESET"})}reactExports.useEffect(E,[f,M,R]);function v(){if(!f)return;const P=makeCancellablePromise(f.getOperatorList());return P.promise.then(A=>{new pdfjs$1.SVGGraphics(f.commonObjs,f.objs).getSVG(A,R).then(d=>{if(!(d instanceof SVGElement))throw new Error("getSVG returned unexpected result.");M({type:"RESOLVE",value:d})}).catch(d=>{M({type:"REJECT",error:d})})}).catch(A=>{M({type:"REJECT",error:A})}),()=>cancelRunningTask(P)}reactExports.useEffect(v,[f,M,R]),reactExports.useEffect(()=>{if(C!==void 0){if(C===!1){N();return}I()}},[C]);function p(P){if(!P||!C)return;P.firstElementChild||P.appendChild(C);const{width:A,height:l}=R;C.setAttribute("width",`${A}`),C.setAttribute("height",`${l}`)}const{width:_,height:w}=R;return React.createElement("div",{className:`${n}__svg`,ref:P=>p(P),style:{display:"block",backgroundColor:"white",overflow:"hidden",
8width:_,height:w,userSelect:"none"}})}function isTextItem(F){return"str"in F}function TextLayer(){const F=usePageContext();invariant(F,"Unable to find Page context.");const{customTextRenderer:n,onGetTextError:L,onGetTextSuccess:i,onRenderTextLayerError:f,onRenderTextLayerSuccess:z,page:H,pageIndex:ut,pageNumber:M,rotate:C,scale:m}=F;invariant(H,"Attempted to load page text content, but no page was specified.");const[I,N]=useResolver(),{value:R,error:E}=I,v=reactExports.useRef(null),p=reactExports.useRef();warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function _(){R&&i&&i(R)}function w(){E&&(warning$1(!1,E.toString()),L&&L(E))}function P(){N({type:"RESET"})}reactExports.useEffect(P,[H,N]);function A(){if(!H)return;const g=makeCancellablePromise(H.getTextContent()),$=g;return g.promise.then(V=>{N({type:"RESOLVE",value:V})}).catch(V=>{N({type:"REJECT",error:V})}),()=>cancelRunningTask($)}reactExports.useEffect(A,[H,N]),reactExports.useEffect(()=>{if(R!==void 0){if(R===!1){w();return}_()}},[R]);const l=reactExports.useCallback(()=>{z&&z()},[z]),d=reactExports.useCallback(g=>{warning$1(!1,g.toString()),f&&f(g)},[f]);function D(){const g=p.current;g&&g.classList.add("active")}function b(){const g=p.current;g&&g.classList.remove("active")}const c=reactExports.useMemo(()=>H.getViewport({scale:m,rotation:C}),[H,C,m]);function k(){if(!H||!R)return;const{current:g}=v;if(!g)return;g.innerHTML="";const $=H.streamTextContent({includeMarkedContent:!0}),V={container:g,textContentSource:$,viewport:c},T=pdfjs$1.renderTextLayer(V),Y=T;return T.promise.then(()=>{const it=document.createElement("div");it.className="endOfContent",g.append(it),p.current=it;const lt=g.querySelectorAll('[role="presentation"]');if(n){let G=0;R.items.forEach((ht,bt)=>{if(!isTextItem(ht))return;const St=lt[G];if(!St)return;const Pt=n(Object.assign({pageIndex:ut,pageNumber:M,itemIndex:bt},ht));St.innerHTML=Pt,G+=ht.str&&ht.hasEOL?2:1})}l()}).catch(d),()=>cancelRunningTask(Y)}return reactExports.useLayoutEffect(k,[n,d,l,H,ut,M,R,c]),React.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:b,onMouseDown:D,ref:v})}function AnnotationLayer(){const F=useDocumentContext(),n=usePageContext();invariant(n,"Unable to find Page context.");const L=Object.assign(Object.assign({},F),n),{imageResourcesPath:i,linkService:f,onGetAnnotationsError:z,onGetAnnotationsSuccess:H,onRenderAnnotationLayerError:ut,onRenderAnnotationLayerSuccess:M,page:C,pdf:m,renderForms:I,rotate:N,scale:R=1}=L;invariant(m,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),invariant(C,"Attempted to load page annotations, but no page was specified."),invariant(f,"Attempted to load page annotations, but no linkService was specified.");const[E,v]=useResolver(),{value:p,error:_}=E,w=reactExports.useRef(null);warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function P(){p&&H&&H(p)}function A(){_&&(warning$1(!1,_.toString()),z&&z(_))}function l(){v({type:"RESET"})}reactExports.useEffect(l,[v,C]);function d(){if(!C)return;const g=makeCancellablePromise(C.getAnnotations()),$=g;return g.promise.then(V=>{v({type:"RESOLVE",value:V}
8)}).catch(V=>{v({type:"REJECT",error:V})}),()=>{cancelRunningTask($)}}reactExports.useEffect(d,[v,C,I]),reactExports.useEffect(()=>{if(p!==void 0){if(p===!1){A();return}P()}},[p]);function D(){M&&M()}function b(g){warning$1(!1,`${g}`),ut&&ut(g)}const c=reactExports.useMemo(()=>C.getViewport({scale:R,rotation:N}),[C,N,R]);function k(){if(!m||!C||!f||!p)return;const{current:g}=w;if(!g)return;const $=c.clone({dontFlip:!0}),V={accessibilityManager:null,annotationCanvasMap:null,div:g,l10n:null,page:C,viewport:$},T={annotations:p,annotationStorage:m.annotationStorage,div:g,downloadManager:null,imageResourcesPath:i,linkService:f,page:C,renderForms:I,viewport:$};g.innerHTML="";try{new pdfjs$1.AnnotationLayer(V).render(T),D()}catch(Y){b(Y)}return()=>{}}return reactExports.useEffect(k,[p,i,f,C,I,c]),React.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:w})}var __rest=globalThis&&globalThis.__rest||function(F,n){var L={};for(var i in F)Object.prototype.hasOwnProperty.call(F,i)&&n.indexOf(i)<0&&(L[i]=F[i]);if(F!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,i=Object.getOwnPropertySymbols(F);f<i.length;f++)n.indexOf(i[f])<0&&Object.prototype.propertyIsEnumerable.call(F,i[f])&&(L[i[f]]=F[i[f]]);return L};const defaultScale=1,Page=function F(n){const L=useDocumentContext(),i=Object.assign(Object.assign({},L),n),{_className:f="react-pdf__Page",_enableRegisterUnregisterPage:z=!0,canvasBackground:H,canvasRef:ut,children:M,className:C,customRenderer:m,customTextRenderer:I,devicePixelRatio:N,error:R="Failed to load the page.",height:E,inputRef:v,loading:p="Loading pageâ¦",noData:_="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:P,onGetStructTreeError:A,onGetStructTreeSuccess:l,onGetTextError:d,onGetTextSuccess:D,onLoadError:b,onLoadSuccess:c,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:g,onRenderError:$,onRenderSuccess:V,onRenderTextLayerError:T,onRenderTextLayerSuccess:Y,pageIndex:it,pageNumber:lt,pdf:G,registerPage:ht,renderAnnotationLayer:bt=!0,renderForms:St=!1,renderMode:Pt="canvas",renderTextLayer:x=!0,rotate:s,scale:o=defaultScale,unregisterPage:a,width:h}=i,u=__rest(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[S,O]=useResolver(),{value:j,error:st}=S,tt=reactExports.useRef(null);invariant(G,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const at=isProvided(lt)?lt-1:it??null,dt=lt??(isProvided(it)?it+1:null),gt=s??(j?j.rotate:null),ct=reactExports.useMemo(()=>{if(!j)return null;let Gt=1;const Ht=o??defaultScale;if(h||E){const Xt=j.getViewport({scale:1,rotation:gt});h?Gt=h/Xt.width:E&&(Gt=E/Xt.height)}return Ht*Gt},[E,j,gt,o,h]);function xt(){return()=>{isProvided(at)&&z&&a&&a(at)}}reactExports.useEffect(xt,[z,G,at,a]);function Ot(){if(c){if(!j||!ct)return;c(makePageCallback(j,ct))}if(z&&ht){if(!isProvided(at)||!tt.current)return;ht(at,tt.current)}}function Et(){st&&(warning$1(!1,st.toString()),b&&b(st))}function Lt(){O({type:"RESET"})}reactExports.useEffect(Lt,[O,G,at]);function mt(){if(!G||!dt)return;const Gt=makeCancellablePromise(G.getPage(dt)),Ht=Gt;return Gt.promise.then(Xt=>{O({type:"RESOLVE",value:Xt})}).catch(Xt=>{O({type:"REJECT",error:Xt})}),()=>cancelRunningTask(Ht)}reactExports.useEffect(mt,[O,G,at,dt,ht]),reactExports.useEffect(()=>{if(j!==void 0){if(j===!1){Et();return}Ot()}},[j,ct]);const et=reactExports.useMemo(()=>j&&isProvided(at)&&dt&&isProvided(gt)&&isProvided(ct)?{_className:f,canvasBackgroun
8d:H,customTextRenderer:I,devicePixelRatio:N,onGetAnnotationsError:w,onGetAnnotationsSuccess:P,onGetStructTreeError:A,onGetStructTreeSuccess:l,onGetTextError:d,onGetTextSuccess:D,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:g,onRenderError:$,onRenderSuccess:V,onRenderTextLayerError:T,onRenderTextLayerSuccess:Y,page:j,pageIndex:at,pageNumber:dt,renderForms:St,renderTextLayer:x,rotate:gt,scale:ct}:null,[f,H,I,N,w,P,A,l,d,D,k,g,$,V,T,Y,j,at,dt,St,x,gt,ct]),nt=reactExports.useMemo(()=>makeEventProps(u,()=>j&&(ct?makePageCallback(j,ct):void 0)),[u,j,ct]),pt=`${at}@${ct}/${gt}`,wt=`${at}/${gt}`;function Ct(){switch(Pt){case"custom":return invariant(m,'renderMode was set to "custom", but no customRenderer was passed.'),React.createElement(m,{key:`${pt}_custom`});case"none":return null;case"svg":return React.createElement(PageSVG,{key:`${wt}_svg`});case"canvas":default:return React.createElement(PageCanvas,{key:`${pt}_canvas`,canvasRef:ut})}}function jt(){return x?React.createElement(TextLayer,{key:`${pt}_text`}):null}function Vt(){return bt?React.createElement(AnnotationLayer,{key:`${pt}_annotations`}):null}function Wt(){return React.createElement(PageContext.Provider,{value:et},Ct(),jt(),Vt(),M)}function zt(){return dt?G===null||j===void 0||j===null?React.createElement(Message,{type:"loading"},typeof p=="function"?p():p):G===!1||j===!1?React.createElement(Message,{type:"error"},typeof R=="function"?R():R):Wt():React.createElement(Message,{type:"no-data"},typeof _=="function"?_():_)}return React.createElement("div",Object.assign({className:clsx(f,C),"data-page-number":dt,ref:mergeRefs(v,tt),style:{"--scale-factor":`${ct}`,backgroundColor:H||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},nt),zt())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;displayWorkerWarning();pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";export{Document$1 as D,PropTypes as P,Page$1 as a,pdfjs$1 as b,clsx as c,invariant as i,propTypesExports as p};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.