PageSourceSearch

https://staticassets.goreact.com/prod-client/app/pdfjs.f3146f0bf263a772.js

js goreact.com collected 2026-10-02 10:00:52 UTC 461,353 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkdashboard=self.webpackChunkdashboard||[]).push([["pdfjs"],{34722(Zr,Us,Nt){Nt.r(Us),Nt.d(Us,{AbortException:()=>$t,AnnotationEditorLayer:()=>ri,AnnotationEditorParamsType:()=>J,AnnotationEditorType:()=>X,AnnotationEditorUIManager:()=>ie,AnnotationLayer:()=>Qe,AnnotationMode:()=>jt,AnnotationType:()=>ct,CSSConstants:()=>tn,ColorPicker:()=>Ot,DOMSVGFactory:()=>Ie,DrawLayer:()=>yt,FeatureTest:()=>ut,GlobalWorkerOptions:()=>Xt,ImageKind:()=>ue,InvalidPDFException:()=>ke,MathClamp:()=>Et,OPS:()=>qt,OutputScale:()=>Bt,PDFDataRangeTransport:()=>Rs,PDFDateString:()=>Ue,PDFWorker:()=>mt,PasswordResponses:()=>zs,PermissionFlag:()=>Gs,PixelsPerInch:()=>Wt,RenderingCancelledException:()=>Be,ResponseException:()=>ge,SignatureExtractor:()=>Jt,SupportedImageMimeTypes:()=>He,TextLayer:()=>Rt,TouchManager:()=>Ee,Util:()=>B,VerbosityLevel:()=>fe,XfaLayer:()=>ls,applyOpacity:()=>en,build:()=>Yn,createValidAbsoluteUrl:()=>ns,fetchData:()=>se,findContrastColor:()=>on,getDocument:()=>Wn,getFilenameFromUrl:()=>Qs,getPdfFilenameFromUrl:()=>Js,getRGB:()=>ne,getUuid:()=>os,getXfaPageViewport:()=>qs,isDataScheme:()=>ye,isPdfFile:()=>_e,isValidExplicitDest:()=>mn,noContextMenu:()=>It,normalizeUnicode:()=>Ys,renderRichText:()=>ds,setLayerDimensions:()=>zt,shadow:()=>V,stopEvent:()=>ot,updateUrlHash:()=>is,version:()=>Xn});var js,N=Nt(12299),ai=Nt(92687),Mt=Nt(18456),Hs=Nt(17533).Buffer,oi={34:(l,e,t)=>{var s=t(4901);l.exports=function(n){return"object"==typeof n?null!==n:s(n)}},81:(l,e,t)=>{var s=t(9565),n=t(9306),i=t(8551),r=t(6823),a=t(851),o=TypeError;
vendor: 24,715 bytes, line 1
1l.exports=function(h,c){var d=arguments.length<2?a(h):c;if(n(d))return i(s(d,h));throw new o(r(h)+" is not iterable")}},116:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(2652),r=t(9306),a=t(8551),o=t(1767),h=t(9539),d=t(4549)("find",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{find:function(f){a(this);try{r(f)}catch(m){h(this,"throw",m)}if(d)return n(d,this,f);var p=o(this),g=0;return i(p,function(m,v){if(f(m,g++))return v(m)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},283:(l,e,t)=>{var s=t(9504),n=t(9039),i=t(4901),r=t(9297),a=t(3724),o=t(350).CONFIGURABLE,h=t(3706),c=t(1181),d=c.enforce,u=c.get,f=String,p=Object.defineProperty,g=s("".slice),m=s("".replace),v=s([].join),y=a&&!n(function(){return 8!==p(function(){},"length",{value:8}).length}),b=String(String).split("String"),E=l.exports=function(A,w,S){"Symbol("===g(f(w),0,7)&&(w="["+m(f(w),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),S&&S.getter&&(w="get "+w),S&&S.setter&&(w="set "+w),(!r(A,"name")||o&&A.name!==w)&&(a?p(A,"name",{value:w,configurable:!0}):A.name=w),y&&S&&r(S,"arity")&&A.length!==S.arity&&p(A,"length",{value:S.arity});try{S&&r(S,"constructor")&&S.constructor?a&&p(A,"prototype",{writable:!1}):A.prototype&&(A.prototype=void 0)}catch{}var T=d(A);return r(T,"source")||(T.source=v(b,"string"==typeof w?w:"")),A};Function.prototype.toString=E(function(){return i(this)&&u(this).source||h(this)},"toString")},350:(l,e,t)=>{var s=t(3724),n=t(9297),i=Function.prototype,r=s&&Object.getOwnPropertyDescriptor,a=n(i,"name"),o=a&&"something"===function(){}.name,h=a&&(!s||s&&r(i,"name").configurable);l.exports={EXISTS:a,PROPER:o,CONFIGURABLE:h}},397:(l,e,t)=>{var s=t(7751);l.exports=s("document","documentElement")},421:l=>{l.exports={}},456:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(9504),r=t(4154),a=t(5169),o=i(1.1.toString),h=n.Uint8Array,c=!h||!h.prototype.toHex||!function(){try{return"ffffffffffffffff"===new h([255,255,255,255,255,255,255,255]).toHex()}catch{return!1}}();h&&s({target:"Uint8Array",proto:!0,forced:c},{toHex:function(){r(this),a(this.buffer);for(var u="",f=0,p=this.length;f<p;f++){var g=o(this[f],16);u+=1===g.length?"0"+g:g}return u}})},507:(l,e,t)=>{var s=t(9565);l.exports=function(n,i,r){for(var h,c,a=r?n:n.iterator,o=n.next;!(h=s(o,a)).done;)if(void 0!==(c=i(h.value)))return c}},531:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(9306),r=t(8551),a=t(1767),o=t(8646),h=t(9462),c=t(9539),d=t(6395),u=t(684),f=t(4549),p=!d&&!u("flatMap",function(){}),g=!d&&!p&&f("flatMap",TypeError),m=d||p||g,v=h(function(){for(var E,A,y=this.iterator,b=this.mapper;;){if(A=this.inner)try{if(!(E=r(n(A.next,A.iterator))).done)return E.value;this.inner=null}catch(w){c(y,"throw",w)}if(E=r(n(this.next,y)),this.done=!!E.done)return;try{this.inner=o(b(E.value,this.counter++),!1)}catch(w){c(y,"throw",w)}}});s({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(b){r(this);try{i(b)}catch(E){c(this,"throw",E)}return g?n(g,this,b):new v(a(this),{mapper:b,inner:null})}})},616:(l,e,t)=>{var s=t(9039);l.exports=!s(function(){var n=function(){}.bind();return"function"!=typeof n||n.hasOwnProperty("prototype")})},655:(l,e,t)=>{var s=t(6955),n=String;l.exports=function(i){if("Symbol"===s(i))throw new TypeError("Cannot convert a Symbol value to a string");return n(i)}},679:(l,e,t)=>{var s=t(1625),n=TypeError;l.exports=function(i,r){if(s(r,i))return i;throw new n("Incorrect invocation")}},684:l=>{l.exports=function(e,t){var s="function"==typeof Iterator&&Iterator.prototype[e];if(s)try{s.call({next:null},t).next()}catch{return!0}}},741:l=>{var e=Math.ceil,t=Math.floor;l.exports=Math.trunc||function(n){var i=+n;return(i>0?t:e)(i)}},757:(l,e,t)=>{var s=t(7751),n=t(4901),i=t(1625),r=t(7040),a=Object;l.exports=r?function(o){return"symbol"==typeof o}:function(o){var h=s("Symbol");return n(h)&&i(h.prototype,a(o))}},851:(l,e,t)=>{var s=t(6955),n=t(5966),i=t(4117),r=t(6269),o=t(8227)("iterator");l.exports=function(h){if(!i(h))return n(h,o)||n(h,"@@iterator")||r[s(h)]}},944:l=>{var e=TypeError;l.exports=function(t){var s=t&&t.alphabet;if(void 0===s||"base64"===s||"base64url"===s)return s||"base64";throw new e("Incorrect `alphabet` option")}},1072:(l,e,t)=>{var s=t(1828),n=t(8727);l.exports=Object.keys||function(r){return s(r,n)}},1103:l=>{l.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},1108:(l,e,t)=>{var s=t(6955);l.exports=function(n){var i=s(n);return"BigInt64Array"===i||"BigUint64Array"===i}},1148:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(2652),r=t(9306),a=t(8551),o=t(1767),h=t(9539),d=t(4549)("every",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(f){a(this);try{r(f)}catch(m){h(this,"throw",m)}if(d)return n(d,this,f);var p=o(this),g=0;return!i(p,function(m,v){if(!f(m,g++))return v()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1181:(l,e,t)=>{var p,g,m,s=t(8622),n=t(4576),i=t(34),r=t(6699),a=t(9297),o=t(7629),h=t(6119),c=t(421),d="Object already initialized",u=n.TypeError;if(s||o.state){var b=o.state||(o.state=new(0,n.WeakMap));b.get=b.get,b.has=b.has,b.set=b.set,p=function(A,w){if(b.has(A))throw new u(d);return w.facade=A,b.set(A,w),w},g=function(A){return b.get(A)||{}},m=function(A){return b.has(A)}}else{var E=h("state");c[E]=!0,p=function(A,w){if(a(A,E))throw new u(d);return w.facade=A,r(A,E,w),w},g=function(A){return a(A,E)?A[E]:{}},m=function(A){return a(A,E)}}l.exports={set:p,get:g,has:m,enforce:function(A){return m(A)?g(A):p(A,{})},getterFor:function(A){return function(w){var S;if(!i(w)||(S=g(w)).type!==A)throw new u("Incompatible receiver, "+A+" required");return S}}}},1291:(l,e,t)=>{var s=t(741);l.exports=function(n){var i=+n;return i!=i||0===i?0:s(i)}},1385:(l,e,t)=>{var s=t(9539);l.exports=function(n,i,r){for(var a=n.length-1;a>=0;a--)if(void 0!==n[a])try{r=s(n[a].iterator,i,r)}catch(o){i="throw",r=o}if("throw"===i)throw r;return r}},1548:(l,e,t)=>{var s=t(4576),n=t(9039),i=t(9519),r=t(4215),a=s.structuredClone;l.exports=!!a&&!n(function(){if("DENO"===r&&i>92||"NODE"===r&&i>94||"BROWSER"===r&&i>97)return!1;var o=new ArrayBuffer(8),h=a(o,{transfer:[o]});return 0!==o.byteLength||8!==h.byteLength})},1549:(l,e,t)=>{t(6632)},1625:(l,e,t)=>{var s=t(9504);l.exports=s({}.isPrototypeOf)},1689:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(8745),r=t(7680),a=t(6043),o=t(9306),h=t(1103),c=n.Promise,d=!1;s({target:"Promise",stat:!0,forced:!c||!c.try||h(function(){c.try(function(f){d=8===f},8)}).error||!d},{try:function(f){var p=arguments.length>1?r(arguments,1):[],g=a.f(this),m=h(function(){return i(o(f),void 0,p)});return(m.error?g.reject:g.resolve)(m.value),g.promise}})},1698:(l,e,t)=>{var s=t(6518),n=t(4204),i=t(9835);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("union")||!i("union")},{union:n})},1701:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(9306),r=t(8551),a=t(1767),o=t(9462),h=t(6319),c=t(9539),d=t(684),u=t(4549),f=t(6395),p=!f&&!d("map",function(){}),g=!f&&!p&&u("map",TypeError),m=f||p||g,v=o(function(){var y=this.iterator,b=r(n(this.next,y));if(!(this.done=!!b.done))return h(y,this.mapper,[b.value,this.counter++],!0)});s({target:"Iterator",proto:!0,real:!0,forced:m},{map:function(b){r(this);try{i(b)}catch(E){c(this,"throw",E)}return g?n(g,this,b):new v(a(this),{mapper:b})}})},1767:l=>{l.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:(l,e,t)=>{var s=t(9504),n=t(9297),i=t(5397),r=t(9617).indexOf,a=t(421),o=s([].push);l.exports=function(h,c){var p,d=i(h),u=0,f=[];for(p in d)!n(a,p)&&n(d,p)&&o(f,p);for(;c.length>u;)n(d,p=c[u++])&&(~r(f,p)||o(f,p));return f}},2106:(l,e,t)=>{var s=t(283),n=t(4913);l.exports=function(i,r,a){return a.get&&s(a.get,r,{getter:!0}),a.set&&s(a.set,r,{setter:!0}),n.f(i,r,a)}},2140:(l,e,t)=>{var i={};i[t(8227)("toStringTag")]="z",l.exports="[object z]"===String(i)},2195:(l,e,t)=>{var s=t(9504),n=s({}.toString),i=s("".slice);l.exports=function(r){return i(n(r),8,-1)}},2211:(l,e,t)=>{var s=t(9039);l.exports=!s(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype})},2303:(l,e,t)=>{var s=t(4576),n=t(9504),i=s.Uint8Array,r=s.SyntaxError,a=s.parseInt,o=Math.min,h=/[^\da-f]/i,c=n(h.exec),d=n("".slice);l.exports=function(u,f){var p=u.length;if(p%2!=0)throw new r("String should be an even number of characters");for(var g=f?o(f.length,p/2):p/2,m=f||new i(g),v=0,y=0;y<g;){var b=d(u,v,v+=2);if(c(h,b))throw new r("String should only contain hex characters");m[y++]=a(b,16)}return{bytes:m,read:v}}},2360:(l,e,t)=>{var b,s=t(8551),n=t(6801),i=t(8727),r=t(421),a=t(397),o=t(4055),h=t(6119),u="prototype",f="script",p=h("IE_PROTO"),g=function(){},m=function(A){return"<"+f+">"+A+"</"+f+">"},v=function(A){A.write(m("")),A.close();var w=A.parentWindow.Object;return A=null,w},E=function(){try{b=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&b?v(b):function(){var S,A=o("iframe"),w="java"+f+":";return A.style.display="none",a.appendChild(A),A.src=String(w),(S=A.contentWindow.document).open(),S.write(m("document.F=Object")),S.close(),S.F}():v(b);for(var A=i.length;A--;)delete E[u][i[A]];return E()};r[p]=!0,l.exports=Object.create||function(w,S){var T;return null!==w?(g[u]=s(w),T=new g,g[u]=null,T[p]=w):T=E(),void 0===S?T:n.f(T,S)}},2475:(l,e,t)=>{var s=t(6518),n=t(8527);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isSupersetOf",function(a){return!a})},{isSupersetOf:n})},2489:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(9306),r=t(8551),a=t(1767),o=t(9462),h=t(6319),c=t(6395),d=t(9539),u=t(684),f=t(4549),p=!c&&!u("filter",function(){}),g=!c&&!p&&f("filter",TypeError),m=c||p||g,v=o(function(){for(var A,S,y=this.iterator,b=this.predicate,E=this.next;;){if(A=r(n(E,y)),this.done=!!A.done)return;if(h(y,b,[S=A.value,this.counter++],!0))return S}});s({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function(b){r(this);try{i(b)}catch(E){d(this,"throw",E)}return g?n(g,this,b):new v(a(this),{predicate:b})}})},2529:l=>{l.exports=function(e,t){return{value:e,done:t}}},2603:(l,e,t)=>{var s=t(655);l.exports=function(n,i){return void 0===n?arguments.length<2?"":i:s(n)}},2652:(l,e,t)=>{var s=t(6080),n=t(9565),i=t(8551),r=t(6823),a=t(4209),o=t(6198),h=t(1625),c=t(81),d=t(851),u=t(9539),f=TypeError,p=function(m,v){this.stopped=m,this.result=v},g=p.prototype;l.exports=function(m,v,y){var x,R,C,L,O,M,j,E=!(!y||!y.AS_ENTRIES),A=!(!y||!y.IS_RECORD),w=!(!y||!y.IS_ITERATOR),S=!(!y||!y.INTERRUPTED),T=s(v,y&&y.that),D=function(U){return x&&u(x,"normal"),new p(!0,U)},I=function(U){return E?(i(U),S?T(U[0],U[1],D):T(U[0],U[1])):S?T(U,D):T(U)};if(A)x=m.iterator;else if(w)x=m;else{if(!(R=d(m)))throw new f(r(m)+" is not iterable");if(a(R)){for(C=0,L=o(m);L>C;C++)if((O=I(m[C]))&&h(g,O))return O;return new p(!1)}x=c(m,R)}for(M=A?m.next:x.next;!(j=n(M,x)).done;){try{O=I(j.value)}catch(U){u(x,"throw",U)}if("object"==typeof O&&O&&h(g,O))return O}return new p(!1)}},2777:(l,e,t)=>{var s=t(9565),n=t(34),i=t(757),r=t(5966),a=t(4270),o=t(8227),h=TypeError,c=o("toPrimitive");l.exports=function(d,u){if(!n(d)||i(d))return d;var p,f=r(d,c);if(f){if(void 0===u&&(u="default"),p=s(f,d,u),!n(p)||i(p))return p;throw new h("Can't convert object to primitive value")}return void 0===u&&(u="number"),a(d,u)}},2787:(l,e,t)=>{var s=t(9297),n=t(4901),i=t(8981),r=t(6119),a=t(2211),o=r("IE_PROTO"),h=Object,c=h.prototype;l.exports=a?h.getPrototypeOf:function(d){var u=i(d);if(s(u,o))return u[o];var f=u.constructor;return n(f)&&u instanceof f?f.prototype:u instanceof h?c:null}},2796:(l,e,t)=>{var s=t(9039),n=t(4901),i=/#|\.prototype\./,r=function(d,u){var f=o[a(d)];return f===c||f!==h&&(n(u)?s(u):!!u)},a=r.normalize=function(d){return String(d).replace(i,".").toLowerCase()},o=r.data={},h=r.NATIVE="N",c=r.POLYFILL="P";l.exports=r},2804:l=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=e+"+/",s=e+"-_",n=function(i){for(var r={},a=0;a<64;a++)r[i.charAt(a)]=a;return r};l.exports={i2c:t,c2i:n(t),i2cUrl:s,c2iUrl:n(s)}},2812:l=>{var e=TypeError;l.exports=function(t,s){if(t<s)throw new e("Not enough arguments");return t}},2839:(l,e,t)=>{var n=t(4576).navigator,i=n&&n.userAgent;l.exports=i?String(i):""},2967:(l,e,t)=>{var s=t(6706),n=t(34),i=t(7750),r=t(3506);l.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var h,a=!1,o={};try{(h=s(Object.prototype,"__proto__","set"))(o,[]),a=o instanceof Array}catch{}return function(d,u){return i(d),r(u),n(d)&&(a?h(d,u):d.__proto__=u),d}}():void 0)},3068:(l,e,t)=>{var s=t(6518),n=t(9504),i=t(2652),r=RangeError,a=TypeError,o=1/0,c=Math.abs,d=Math.pow,u=n([].push),f=d(2,1023),p=d(2,53)-1,g=Number.MAX_VALUE,m=d(2,971),v={},y={},b={},E={},A={},w=function(S,T){var x=S+T;return{hi:x,lo:T-(x-S)}};s({target:"Math",stat:!0},{sumPrecise:function(T){var x=[],R=0,C=E;switch(i(T,function(F){if(++R>=p)throw new r("Maximum allowed index exceeded");if("number"!=typeof F)throw new a("Value is not a number");C!==v&&(F!=F?C=v:F===o?C=C===y?v:b:F===-o?C=C===b?v:y:(0!==F||1/F===o)&&(C===E||C===A)&&(C=A,u(x,F)))}),C){case v:return NaN;case y:return-o;case b:return o;case E:return-0}for(var M,j,D,I,U,z,L=[],O=0,st=0;st<x.length;st++){M=x[st];for(var q=0,K=0;K<L.length;K++){if(j=L[K],c(M)<c(j)&&(z=M,M=j,j=z),U=(D=w(M,j)).lo,c(I=D.hi)===o){var Q=I===o?1:-1;O+=Q,c(M=M-Q*f-Q*f)<c(j)&&(z=M,M=j,j=z),I=(D=w(M,j)).hi,U=D.lo}0!==U&&(L[q++]=U),M=I}L.length=q,0!==M&&u(L,M)}var it=L.length-1;if(I=0,U=0,0!==O){var bt=it>=0?L[it]:0;if(it--,c(O)>1||O>0&&bt>0||O<0&&bt<0)return O>0?o:-o;if(U=(D=w(O*f,bt/2)).lo,U*=2,c(2*(I=D.hi))===o)return I>0?I===f&&U===-m/2&&it>=0&&L[it]<0?g:o:I===-f&&U===m/2&&it>=0&&L[it]>0?-g:-o;0!==U&&(L[++it]=U,U=0),I*=2}for(;it>=0&&(I=(D=w(I,L[it--])).hi,0===(U=D.lo)););return it>=0&&(U<0&&L[it]<0||U>0&&L[it]>0)&&(j=2*U)===(M=I+j)-I&&(I=M),I}})},3167:(l,e,t)=>{var s=t(4901),n=t(34),i=t(2967);l.exports=function(r,a,o){var h,c;return i&&s(h=a.constructor)&&h!==o&&n(c=h.prototype)&&c!==o.prototype&&i(r,c),r}},3238:(l,e,t)=>{var s=t(4576),n=t(7811),i=t(7394),r=s.DataView;l.exports=function(a){if(!n||0!==i(a))return!1;try{return new r(a),!1}catch{return!0}}},3392:(l,e,t)=>{var s=t(9504),n=0,i=Math.random(),r=s(1.1.toString);l.exports=function(a){return"Symbol("+(void 0===a?"":a)+")_"+r(++n+i,36)}},3440:(l,e,t)=>{var s=t(7080),n=t(4402),i=t(9286),r=t(5170),a=t(3789),o=t(8469),h=t(507),c=n.has,d=n.remove;l.exports=function(f){var p=s(this),g=a(f),m=i(p);return r(p)<=g.size?o(p,function(v){g.includes(v)&&d(m,v)}):h(g.getIterator(),function(v){c(m,v)&&d(m,v)}),m}},3463:l=>{var e=TypeError;l.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},3506:(l,e,t)=>{var s=t(3925),n=String,i=TypeError;l.exports=function(r){if(s(r))return r;throw new i("Can't set "+n(r)+" as a prototype")}},3579:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(2652),r=t(9306),a=t(8551),o=t(1767),h=t(9539),d=t(4549)("some",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(f){a(this);try{r(f)}catch(m){h(this,"throw",m)}if(d)return n(d,this,f);var p=o(this),g=0;return i(p,function(m,v){if(f(m,g++))return v()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(l,e,t)=>{var s=t(7080),n=t(4402),i=t(9286),r=t(3789),a=t(507),o=n.add,h=n.has,c=n.remove;l.exports=function(u){var f=s(this),p=r(u).getIterator(),g=i(f);return a(p,function(m){h(f,m)?c(g,m):o(g,m)}),g}},3706:(l,e,t)=>{var s=t(9504),n=t(4901),i=t(7629),r=s(Function.toString);n(i.inspectSource)||(i.inspectSource=function(a){return r(a)}),l.exports=i.inspectSource},3717:(l,e)=>{e.f=Object.getOwnPropertySymbols},3724:(l,e,t)=>{var s=t(9039);l.exports=!s(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3789:(l,e,t)=>{var s=t(9306),n=t(8551),i=t(9565),r=t(1291),a=t(1767),o="Invalid size",h=RangeError,c=TypeError,d=Math.max,u=function(f,p){this.set=f,this.size=d(p,0),this.has=s(f.has),this.keys=s(f.keys)};u.prototype={getIterator:function(){return a(n(i(this.keys,this.set)))},includes:function(f){return i(this.has,this.set,f)}},l.exports=function(f){n(f);var p=+f.size;if(p!=p)throw new c(o);var g=r(p);if(g<0)throw new h(o);return new u(f,g)}},3838:(l,e,t)=>{var s=t(7080),n=t(5170),i=t(8469),r=t(3789);l.exports=function(o){var h=s(this),c=r(o);return!(n(h)>c.size)&&!1!==i(h,function(d){if(!c.includes(d))return!1},!0)}},3853:(l,e,t)=>{var s=t(6518),n=t(4449);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isDisjointFrom",function(a){return!a})},{isDisjointFrom:n})},3925:(l,e,t)=>{var s=t(34);l.exports=function(n){return s(n)||null===n}},3972:(l,e,t)=>{var s=t(34),n=String,i=TypeError;l.exports=function(r){if(void 0===r||s(r))return r;throw new i(n(r)+" is not an object or undefined")}},4055:(l,e,t)=>{var s=t(4576),n=t(34),i=s.document,r=n(i)&&n(i.createElement);l.exports=function(a){return r?i.createElement(a):{}}},4114:(l,e,t)=>{var s=t(6518),n=t(8981),i=t(6198),r=t(4527),a=t(6837);s({target:"Array",proto:!0,arity:1,forced:t(9039)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}}()},{push:function(f){var p=n(this),g=i(p),m=arguments.length;a(g+m);for(var v=0;v<m;v++)p[g]=arguments[v],g++;return r(p,g),g}})},4117:l=>{l.exports=function(e){return null==e}},4149:l=>{var e=RangeError;l.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},4154:(l,e,t)=>{var s=t(6955),n=TypeError;l.exports=function(i){if("Uint8Array"===s(i))return i;throw new n("Argument is not an Uint8Array")}},4204:(l,e,t)=>{var s=t(7080),n=t(4402).add,i=t(9286),r=t(3789),a=t(507);l.exports=function(h){var c=s(this),d=r(h).getIterator(),u=i(c);return a(d,function(f){n(u,f)}),u}},4209:(l,e,t)=>{var s=t(8227),n=t(6269),i=s("iterator"),r=Array.prototype;l.exports=function(a){return void 0!==a&&(n.Array===a||r[i]===a)}},4215:(l,e,t)=>{var s=t(4576),n=t(2839),i=t(2195),r=function(a){return n.slice(0,a.length)===a};l.exports=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":s.Bun&&"string"==typeof Bun.version?"BUN":s.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(s.process)?"NODE":s.window&&s.document?"BROWSER":"REST"},4226:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(3463),r=t(4154),a=t(5169),o=t(2303);n.Uint8Array&&s({target:"Uint8Array",proto:!0},{setFromHex:function(c){r(this),i(c),a(this.buffer);var d=o(c,this).read;return{read:d,written:d/2}}})},4235:(l,e,t)=>{t(3068)},4270:(l,e,t)=>{var s=t(9565),n=t(4901),i=t(34),r=TypeError;l.exports=function(a,o){var h,c;if("string"===o&&n(h=a.toString)&&!i(c=s(h,a))||n(h=a.valueOf)&&!i(c=s(h,a))||"string"!==o&&n(h=a.toString)&&!i(c=s(h,a)))return c;throw new r("Can't convert object to primitive value")}},4376:(l,e,t)=>{var s=t(2195);l.exports=Array.isArray||function(i){return"Array"===s(i)}},4402:(l,e,t)=>{var s=t(9504),n=Set.prototype;l.exports={Set,add:s(n.add),has:s(n.has),remove:s(n.delete),proto:n}},4449:(l,e,t)=>{var s=t(7080),n=t(4402).has,i=t(5170),r=t(3789),a=t(8469),o=t(507),h=t(9539);l.exports=function(d){var u=s(this),f=r(d);if(i(u)<=f.size)return!1!==a(u,function(g){if(f.includes(g))return!1},!0);var p=f.getIterator();return!1!==o(p,function(g){if(n(u,g))return h(p,"normal",!1)})}},4483:(l,e,t)=>{var c,d,u,f,s=t(4576),n=t(9429),i=t(1548),r=s.structuredClone,a=s.ArrayBuffer,o=s.MessageChannel,h=!1;if(i)h=function(p){r(p,{transfer:[p]})};else if(a)try{o||(c=n("worker_threads"))&&(o=c.MessageChannel),o&&(d=new o,u=new a(2),f=function(p){d.port1.postMessage(null,[p])},2===u.byteLength&&(f(u),0===u.byteLength&&(h=f)))}catch{}l.exports=h},4495:(l,e,t)=>{var s=t(9519),n=t(9039),r=t(4576).String;l.exports=!!Object.getOwnPropertySymbols&&!n(function(){var a=Symbol("symbol detection");return!r(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&s&&s<41})},4527:(l,e,t)=>{var s=t(3724),n=t(4376),i=TypeError,r=Object.getOwnPropertyDescriptor,a=s&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}}();l.exports=a?function(o,h){if(n(o)&&!r(o,"length").writable)throw new i("Cannot set read only .length");return o.length=h}:function(o,h){return o.length=h}},4549:(l,e,t)=>{var s=t(4576);l.exports=function(n,i){var r=s.Iterator,a=r&&r.prototype,o=a&&a[n],h=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){h=!0}},-1)}catch(c){c instanceof i||(h=!1)}if(!h)return o}},4576:function(l){var e=function(t){return t&&t.Math===Math&&t};l.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof Nt.g&&Nt.g)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4603:(l,e,t)=>{var s=t(6840),n=t(9504),i=t(655),r=t(2812),a=URLSearchParams,o=a.prototype,h=n(o.append),c=n(o.delete),d=n(o.forEach),u=n([].push),f=new a("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&s(o,"delete",function(p){var g=arguments.length,m=g<2?void 0:arguments[1];if(g&&void 0===m)return c(this,p);var v=[];d(this,function(x,R){u(v,{key:R,value:x})}),r(g,1);for(var T,y=i(p),b=i(m),E=0,A=0,w=!1,S=v.length;E<S;)T=v[E++],w||T.key===y?(w=!0,c(this,T.key)):A++;for(;A<S;)(T=v[A++]).key===y&&T.value===b||h(this,T.key,T.value)},{enumerable:!0,unsafe:!0})},4628:(l,e,t)=>{var s=t(6518),n=t(6043);s({target:"Promise",stat:!0},{withResolvers:function(){var r=n.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},4644:(l,e,t)=>{var z,st,q,s=t(7811),n=t(3724),i=t(4576),r=t(4901),a=t(34),o=t(9297),h=t(6955),c=t(6823),d=t(6699),u=t(6840),f=t(2106),p=t(1625),g=t(2787),m=t(2967),v=t(8227),y=t(3392),b=t(1181),E=b.enforce,A=b.get,w=i.Int8Array,S=w&&w.prototype,T=i.Uint8ClampedArray,x=T&&T.prototype,R=w&&g(w),C=S&&g(S),L=Object.prototype,O=i.TypeError,M=v("toStringTag"),j=y("TYPED_ARRAY_TAG"),D="TypedArrayConstructor",I=s&&!!m&&"Opera"!==h(i.opera),U=!1,K={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Q={BigInt64Array:8,BigUint64Array:8},bt=function($){var rt=g($);if(a(rt)){var at=A(rt);return at&&o(at,D)?at[D]:bt(rt)}},F=function($){if(!a($))return!1;var rt=h($);return o(K,rt)||o(Q,rt)};for(z in K)(q=(st=i[z])&&st.prototype)?E(q)[D]=st:I=!1;for(z in Q)(q=(st=i[z])&&st.prototype)&&(E(q)[D]=st);if((!I||!r(R)||R===Function.prototype)&&(R=function(){throw new O("Incorrect invocation")},I))for(z in K)i[z]&&m(i[z],R);if((!I||!C||C===L)&&(C=R.prototype,I))for(z in K)i[z]&&m(i[z].prototype,C);if(I&&g(x)!==C&&m(x,C),n&&!o(C,M))for(z in U=!0,f(C,M,{configurable:!0,get:function(){return a(this)?this[j]:void 0}}),K)i[z]&&d(i[z],j,z);l.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:U&&j,aTypedArray:function($){if(F($))return $;throw new O("Target is not a typed array")},aTypedArrayConstructor:function($){if(r($)&&(!m||p(R,$)))return $;throw new O(c($)+" is not a typed array constructor")},exportTypedArrayMethod:function($,rt,at,kt){if(n){if(at)for(var xt in K){var At=i[xt];if(At&&o(At.prototype,$))try{delete At.prototype[$]}catch{try{At.prototype[$]=rt}catch{}}}(!C[$]||at)&&u(C,$,at?rt:I&&S[$]||rt,kt)}},exportTypedArrayStaticMethod:function($,rt,at){var kt,xt;if(n){if(m){if(at)for(kt in K)if((xt=i[kt])&&o(xt,$))try{delete xt[$]}catch{}if(R[$]&&!at)return;try{return u(R,$,at?rt:I&&R[$]||rt)}catch{}}for(kt in K)(xt=i[kt])&&(!xt[$]||at)&&u(xt,$,rt)}},getTypedArrayConstructor:bt,isView:function(rt){if(!a(rt))return!1;var at=h(rt);return"DataView"===at||o(K,at)||o(Q,at)},isTypedArray:F,TypedArray:R,TypedArrayPrototype:C}},4659:(l,e,t)=>{var s=t(3724),n=t(4913),i=t(6980);l.exports=function(r,a,o){s?n.f(r,a,i(0,o)):r[a]=o}},4901:l=>{var e="object"==typeof document&&document.all;l.exports=typeof e>"u"&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},4913:(l,e,t)=>{var s=t(3724),n=t(5917),i=t(8686),r=t(8551),a=t(6969),o=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",f="writable";e.f=s?i?function(g,m,v){if(r(g),m=a(m),r(v),"function"==typeof g&&"prototype"===m&&"value"in v&&f in v&&!v[f]){var y=c(g,m);y&&y[f]&&(g[m]=v.value,v={configurable:u in v?v[u]:y[u],enumerable:d in v?v[d]:y[d],writable:!1})}return h(g,m,v)}:h:function(g,m,v){if(r(g),m=a(m),r(v),n)try{return h(g,m,v)}catch{}if("get"in v||"set"in v)throw new o("Accessors not supported");return"value"in v&&(g[m]=v.value),g}},4916:(l,e,t)=>{var s=t(7751),n=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},i=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};l.exports=function(r,a){var o=s("Set");try{(new o)[r](n(0));try{return(new o)[r](n(-1)),!1}catch{if(!a)return!0;try{return(new o)[r](i(-1/0)),!1}
1catch{return a(new o([1,2])[r](i(1/0)))}}}catch{return!1}}},4972:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(8551),r=t(1767),a=t(4149),o=t(9590),h=t(9462),c=t(9539),d=t(4549),u=t(6395),f=!u&&d("take",RangeError),p=h(function(){var g=this.iterator;if(!this.remaining--)return this.done=!0,c(g,"normal",void 0);var m=i(n(this.next,g));return(this.done=!!m.done)?void 0:m.value});s({target:"Iterator",proto:!0,real:!0,forced:u||f},{take:function(m){var v;i(this);try{v=o(a(+m))}catch(y){c(this,"throw",y)}return f?n(f,this,v):new p(r(this),{remaining:v})}})},4979:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(7751),r=t(6980),a=t(4913).f,o=t(9297),h=t(679),c=t(3167),d=t(2603),u=t(5002),f=t(8574),p=t(3724),g=t(6395),m="DOMException",v=i("Error"),y=i(m),b=function(){h(this,E);var D=arguments.length,I=d(D<1?void 0:arguments[0]),U=d(D<2?void 0:arguments[1],"Error"),z=new y(I,U),st=new v(I);return st.name=m,a(z,"stack",r(1,f(st.stack,1))),c(z,this,b),z},E=b.prototype=y.prototype,A="stack"in new v(m),w="stack"in new y(1,2),S=y&&p&&Object.getOwnPropertyDescriptor(n,m),x=A&&!!(!S||S.writable&&S.configurable)&&!w;s({global:!0,constructor:!0,forced:g||x},{DOMException:x?b:y});var R=i(m),C=R.prototype;if(C.constructor!==R)for(var L in g||a(C,"constructor",r(1,R)),u)if(o(u,L)){var O=u[L],M=O.s;o(R,M)||a(R,M,r(6,O.c))}},5002:l=>{l.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1}
vendor: 15,314 bytes, line 1
1,InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},5024:(l,e,t)=>{var s=t(6518),n=t(3650),i=t(9835);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:n})},5031:(l,e,t)=>{var s=t(7751),n=t(9504),i=t(8480),r=t(3717),a=t(8551),o=n([].concat);l.exports=s("Reflect","ownKeys")||function(c){var d=i.f(a(c)),u=r.f;return u?o(d,u(c)):d}},5169:(l,e,t)=>{var s=t(3238),n=TypeError;l.exports=function(i){if(s(i))throw new n("ArrayBuffer is detached");return i}},5170:(l,e,t)=>{var s=t(6706),n=t(4402);l.exports=s(n.proto,"size","get")||function(i){return i.size}},5213:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(5370),r=t(9143),a=n.Uint8Array,o=!a||!a.fromBase64||!function(){try{return void a.fromBase64("a")}catch{}try{a.fromBase64("",null)}catch{return!0}}();a&&s({target:"Uint8Array",stat:!0,forced:o},{fromBase64:function(c){var d=r(c,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return i(a,d.bytes)}})},5370:(l,e,t)=>{var s=t(6198);l.exports=function(n,i,r){for(var a=0,o=arguments.length>2?r:s(i),h=new n(o);o>a;)h[a]=i[a++];return h}},5397:(l,e,t)=>{var s=t(7055),n=t(7750);l.exports=function(i){return s(n(i))}},5610:(l,e,t)=>{var s=t(1291),n=Math.max,i=Math.min;l.exports=function(r,a){var o=s(r);return o<0?n(o+a,0):i(o,a)}},5623:(l,e,t)=>{t(456)},5636:(l,e,t)=>{var s=t(4576),n=t(9504),i=t(6706),r=t(7696),a=t(5169),o=t(7394),h=t(4483),c=t(1548),d=s.structuredClone,u=s.ArrayBuffer,f=s.DataView,p=Math.min,g=u.prototype,m=f.prototype,v=n(g.slice),y=i(g,"resizable","get"),b=i(g,"maxByteLength","get"),E=n(m.getInt8),A=n(m.setInt8);l.exports=(c||h)&&function(w,S,T){var L,x=o(w),R=void 0===S?x:r(S),C=!y||!y(w);if(a(w),c&&(w=d(w,{transfer:[w]}),x===R&&(T||C)))return w;if(x>=R&&(!T||C))L=v(w,0,R);else{var O=T&&!C&&b?{maxByteLength:b(w)}:void 0;L=new u(R,O);for(var M=new f(w),j=new f(L),D=p(R,x),I=0;I<D;I++)A(j,I,E(M,I))}return c||h(w),L}},5745:(l,e,t)=>{var s=t(7629);l.exports=function(n,i){return s[n]||(s[n]=i||{})}},5781:(l,e,t)=>{var s=t(6518),n=t(7751),i=t(2812),r=t(655),a=t(7416),o=n("URL");s({target:"URL",stat:!0,forced:!a},{parse:function(c){var d=i(arguments.length,1),u=r(c),f=d<2||void 0===arguments[1]?void 0:r(arguments[1]);try{return new o(u,f)}catch{return null}}})},5854:(l,e,t)=>{var s=t(2777),n=TypeError;l.exports=function(i){var r=s(i,"number");if("number"==typeof r)throw new n("Can't convert number to bigint");return BigInt(r)}},5876:(l,e,t)=>{var s=t(6518),n=t(3838);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isSubsetOf",function(a){return a})},{isSubsetOf:n})},5917:(l,e,t)=>{var s=t(3724),n=t(9039),i=t(4055);l.exports=!s&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},5966:(l,e,t)=>{var s=t(9306),n=t(4117);l.exports=function(i,r){var a=i[r];return n(a)?void 0:s(a)}},6043:(l,e,t)=>{var s=t(9306),n=TypeError,i=function(r){var a,o;this.promise=new r(function(h,c){if(void 0!==a||void 0!==o)throw new n("Bad Promise constructor");a=h,o=c}),this.resolve=s(a),this.reject=s(o)};l.exports.f=function(r){return new i(r)}},6080:(l,e,t)=>{var s=t(7476),n=t(9306),i=t(616),r=s(s.bind);l.exports=function(a,o){return n(a),void 0===o?a:i?r(a,o):function(){return a.apply(o,arguments)}}},6119:(l,e,t)=>{var s=t(5745),n=t(3392),i=s("keys");l.exports=function(r){return i[r]||(i[r]=n(r))}},6193:(l,e,t)=>{var s=t(4215);l.exports="NODE"===s},6198:(l,e,t)=>{var s=t(8014);l.exports=function(n){return s(n.length)}},6269:l=>{l.exports={}},6279:(l,e,t)=>{var s=t(6840);l.exports=function(n,i,r){for(var a in i)s(n,a,i[a],r);return n}},6319:(l,e,t)=>{var s=t(8551),n=t(9539);l.exports=function(i,r,a,o){try{return o?r(s(a)[0],a[1]):r(a)}catch(h){n(i,"throw",h)}}},6395:l=>{l.exports=!1},6518:(l,e,t)=>{var s=t(4576),n=t(7347).f,i=t(6699),r=t(6840),a=t(9433),o=t(7740),h=t(2796);l.exports=function(c,d){var m,v,y,b,E,u=c.target,f=c.global,p=c.stat;if(m=f?s:p?s[u]||a(u,{}):s[u]&&s[u].prototype)for(v in d){if(b=d[v],y=c.dontCallGetSet?(E=n(m,v))&&E.value:m[v],!h(f?v:u+(p?".":"#")+v,c.forced)&&void 0!==y){if(typeof b==typeof y)continue;o(b,y)}(c.sham||y&&y.sham)&&i(b,"sham",!0),r(m,v,b,c)}}},6573:(l,e,t)=>{var s=t(3724),n=t(2106),i=t(3238),r=ArrayBuffer.prototype;s&&!("detached"in r)&&n(r,"detached",{configurable:!0,get:function(){return i(this)}})},6632:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(9143),r=t(4154),a=n.Uint8Array,o=!a||!a.prototype.setFromBase64||!function(){var h=new a([255,255,255,255,255]);try{return void h.setFromBase64("",null)}catch{}try{return void h.setFromBase64("a")}catch{}try{h.setFromBase64("MjYyZg===")}catch{return 50===h[0]&&54===h[1]&&50===h[2]&&255===h[3]&&255===h[4]}}();a&&s({target:"Uint8Array",proto:!0,forced:o},{setFromBase64:function(c){r(this);var d=i(c,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:d.read,written:d.written}}})},6699:(l,e,t)=>{var s=t(3724),n=t(4913),i=t(6980);l.exports=s?function(r,a,o){return n.f(r,a,i(1,o))}:function(r,a,o){return r[a]=o,r}},6706:(l,e,t)=>{var s=t(9504),n=t(9306);l.exports=function(i,r,a){try{return s(n(Object.getOwnPropertyDescriptor(i,r)[a]))}catch{}}},6801:(l,e,t)=>{var s=t(3724),n=t(8686),i=t(4913),r=t(8551),a=t(5397),o=t(1072);e.f=s&&!n?Object.defineProperties:function(c,d){r(c);for(var m,u=a(d),f=o(d),p=f.length,g=0;p>g;)i.f(c,m=f[g++],u[m]);return c}},6823:l=>{var e=String;l.exports=function(t){try{return e(t)}catch{return"Object"}}},6837:l=>{var e=TypeError;l.exports=function(s){if(s>9007199254740991)throw e("Maximum allowed index exceeded");return s}},6840:(l,e,t)=>{var s=t(4901),n=t(4913),i=t(283),r=t(9433);l.exports=function(a,o,h,c){c||(c={});var d=c.enumerable,u=void 0!==c.name?c.name:o;if(s(h)&&i(h,u,c),c.global)d?a[o]=h:r(o,h);else{try{c.unsafe?a[o]&&(d=!0):delete a[o]}catch{}d?a[o]=h:n.f(a,o,{value:h,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return a}},6955:(l,e,t)=>{var s=t(2140),n=t(4901),i=t(2195),a=t(8227)("toStringTag"),o=Object,h="Arguments"===i(function(){return arguments}());l.exports=s?i:function(d){var u,f,p;return void 0===d?"Undefined":null===d?"Null":"string"==typeof(f=function(d,u){try{return d[u]}catch{}}(u=o(d),a))?f:h?i(u):"Object"===(p=i(u))&&n(u.callee)?"Arguments":p}},6969:(l,e,t)=>{var s=t(2777),n=t(757);l.exports=function(i){var r=s(i,"string");return n(r)?r:r+""}},6980:l=>{l.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7040:(l,e,t)=>{var s=t(4495);l.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(l,e,t)=>{var s=t(9504),n=t(9039),i=t(2195),r=Object,a=s("".split);l.exports=n(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return"String"===i(o)?a(o,""):r(o)}:r},7080:(l,e,t)=>{var s=t(4402).has;l.exports=function(n){return s(n),n}},7347:(l,e,t)=>{var s=t(3724),n=t(9565),i=t(8773),r=t(6980),a=t(5397),o=t(6969),h=t(9297),c=t(5917),d=Object.getOwnPropertyDescriptor;e.f=s?d:function(f,p){if(f=a(f),p=o(p),c)try{return d(f,p)}catch{}if(h(f,p))return r(!n(i.f,f,p),f[p])}},7394:(l,e,t)=>{var s=t(4576),n=t(6706),i=t(2195),r=s.ArrayBuffer,a=s.TypeError;l.exports=r&&n(r.prototype,"byteLength","get")||function(o){if("ArrayBuffer"!==i(o))throw new a("ArrayBuffer expected");return o.byteLength}},7416:(l,e,t)=>{var s=t(9039),n=t(8227),i=t(3724),r=t(6395),a=n("iterator");l.exports=!s(function(){var o=new URL("b?a=1&b=2&c=3","https://a"),h=o.searchParams,c=new URLSearchParams("a=1&a=2&b=3"),d="";return o.pathname="c%20d",h.forEach(function(u,f){h.delete("b"),d+=f+u}),c.delete("a",2),c.delete("b",void 0),r&&(!o.toJSON||!c.has("a",1)||c.has("a",2)||!c.has("a",void 0)||c.has("b"))||!h.size&&(r||!i)||!h.sort||"https://a/c%20d?a=1&c=3"!==o.href||"3"!==h.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!h[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("https://a#\u0431").hash||"a1c3"!==d||"x"!==new URL("https://x",void 0).host})},7476:(l,e,t)=>{var s=t(2195),n=t(9504);l.exports=function(i){if("Function"===s(i))return n(i)}},7566:(l,e,t)=>{var s=t(6840),n=t(9504),i=t(655),r=t(2812),a=URLSearchParams,o=a.prototype,h=n(o.getAll),c=n(o.has),d=new a("a=1");(d.has("a",2)||!d.has("a",void 0))&&s(o,"has",function(f){var p=arguments.length,g=p<2?void 0:arguments[1];if(p&&void 0===g)return c(this,f);var m=h(this,f);r(p,1);for(var v=i(g),y=0;y<m.length;)if(m[y++]===v)return!0;return!1},{enumerable:!0,unsafe:!0})},7588:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(2652),r=t(9306),a=t(8551),o=t(1767),h=t(9539),d=t(4549)("forEach",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(f){a(this);try{r(f)}catch(m){h(this,"throw",m)}if(d)return n(d,this,f);var p=o(this),g=0;i(p,function(m){f(m,g++)},{IS_RECORD:!0})}})},7629:(l,e,t)=>{var s=t(6395),n=t(4576),i=t(9433),r="__core-js_shared__",a=l.exports=n[r]||i(r,{});(a.versions||(a.versions=[])).push({version:"3.47.0",mode:s?"pure":"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(l,e,t)=>{var s=t(6518),n=t(3440),i=t(9039);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("difference",function(h){return 0===h.size})||i(function(){var h={size:1,has:function(){return!0},keys:function(){var d=0;return{next:function(){var u=d++>1;return c.has(1)&&c.clear(),{done:u,value:2}}}}},c=new Set([1,2,3,4]);return 3!==c.difference(h).size})},{difference:n})},7657:(l,e,t)=>{var f,p,g,s=t(9039),n=t(4901),i=t(34),r=t(2360),a=t(2787),o=t(6840),h=t(8227),c=t(6395),d=h("iterator"),u=!1;[].keys&&("next"in(g=[].keys())?(p=a(a(g)))!==Object.prototype&&(f=p):u=!0),!i(f)||s(function(){var v={};return f[d].call(v)!==v})?f={}:c&&(f=r(f)),n(f[d])||o(f,d,function(){return this}),l.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:u}},7680:(l,e,t)=>{var s=t(9504);l.exports=s([].slice)},7696:(l,e,t)=>{var s=t(1291),n=t(8014),i=RangeError;l.exports=function(r){if(void 0===r)return 0;var a=s(r),o=n(a);if(a!==o)throw new i("Wrong length or index");return o}},7740:(l,e,t)=>{var s=t(9297),n=t(5031),i=t(7347),r=t(4913);l.exports=function(a,o,h){for(var c=n(o),d=r.f,u=i.f,f=0;f<c.length;f++){var p=c[f];!s(a,p)&&(!h||!s(h,p))&&d(a,p,u(o,p))}}},7750:(l,e,t)=>{var s=t(4117),n=TypeError;l.exports=function(i){if(s(i))throw new n("Can't call method on "+i);return i}},7751:(l,e,t)=>{var s=t(4576),n=t(4901);l.exports=function(r,a){return arguments.length<2?function(r){return n(r)?r:void 0}(s[r]):s[r]&&s[r][a]}},7811:l=>{l.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7936:(l,e,t)=>{var s=t(6518),n=t(5636);n&&s({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},8004:(l,e,t)=>{var s=t(6518),n=t(9039),i=t(8750);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("intersection",function(o){return 2===o.size&&o.has(1)&&o.has(2)})||n(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})},8014:(l,e,t)=>{var s=t(1291),n=Math.min;l.exports=function(i){var r=s(i);return r>0?n(r,9007199254740991):0}},8100:(l,e,t)=>{var s=t(6518),n=t(5636);n&&s({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},8111:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(679),r=t(8551),a=t(4901),o=t(2787),h=t(2106),c=t(4659),d=t(9039),u=t(9297),f=t(8227),p=t(7657).IteratorPrototype,g=t(3724),m=t(6395),v="constructor",y="Iterator",b=f("toStringTag"),E=TypeError,A=n[y],w=m||!a(A)||A.prototype!==p||!d(function(){A({})}),S=function(){if(i(this,p),o(this)===p)throw new E("Abstract class Iterator not directly constructable")},T=function(x,R){g?h(p,x,{configurable:!0,get:function(){return R},set:function(C){if(r(this),this===p)throw new E("You can't redefine this property");u(this,x)?this[x]=C:c(this,x,C)}}):p[x]=R};u(p,b)||T(b,y),(w||!u(p,v)||p[v]===Object)&&T(v,S),S.prototype=p,s({global:!0,constructor:!0,forced:w},{Iterator:S})},8227:(l,e,t)=>{var s=t(4576),n=t(5745),i=t(9297),r=t(3392),a=t(4495),o=t(7040),h=s.Symbol,c=n("wks"),d=o?h.for||h:h&&h.withoutSetter||r;l.exports=function(u){return i(c,u)||(c[u]=a&&i(h,u)?h[u]:d("Symbol."+u)),c[u]}},8235:(l,e,t)=>{var s=t(9504),n=t(9297),i=SyntaxError,r=parseInt,a=String.fromCharCode,o=s("".charAt),h=s("".slice),c=s(/./.exec),d={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},u=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;l.exports=function(p,g){for(var m=!0,v="";g<p.length;){var y=o(p,g);if("\\"===y){var b=h(p,g,g+2);if(n(d,b))v+=d[b],g+=2;else{if("\\u"!==b)throw new i('Unknown escape sequence: "'+b+'"');var E=h(p,g+=2,g+4);if(!c(u,E))throw new i("Bad Unicode escape at: "+g);v+=a(r(E,16)),g+=4}}else{if('"'===y){m=!1,g++;break}if(c(f,y))throw new i("Bad control character in string literal at: "+g);v+=y,g++}}if(m)throw new i("Unterminated string at: "+g);return{value:v,end:g}}},8237:(l,e,t)=>{var s=t(6518),n=t(2652),i=t(9306),r=t(8551),a=t(1767),o=t(9539),h=t(4549),c=t(8745),d=t(9039),u=TypeError,f=d(function(){[].keys().reduce(function(){},void 0)}),p=!f&&h("reduce",u);s({target:"Iterator",proto:!0,real:!0,forced:f||p},{reduce:function(m){r(this);try{i(m)}catch(A){o(this,"throw",A)}var v=arguments.length<2,y=v?void 0:arguments[1];if(p)return c(p,this,v?[m]:[m,y]);var b=a(this),E=0;if(n(b,function(A){v?(v=!1,y=A):y=m(y,A,E),E++},{IS_RECORD:!0}),v)throw new u("Reduce of empty iterator with no initial value");return y}})},8335:(l,e,t)=>{t(9112)},8469:(l,e,t)=>{var s=t(9504),n=t(507),i=t(4402),r=i.Set,a=i.proto,o=s(a.forEach),h=s(a.keys),c=h(new r).next;l.exports=function(d,u,f){return f?n({iterator:h(d),next:c},u):o(d,u)}},8480:(l,e,t)=>{var s=t(1828),i=t(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(a){return s(a,i)}},8527:(l,e,t)=>{var s=t(7080),n=t(4402).has,i=t(5170),r=t(3789),a=t(507),o=t(9539);l.exports=function(c){var d=s(this),u=r(c);if(i(d)<u.size)return!1;var f=u.getIterator();return!1!==a(f,function(p){if(!n(d,p))return o(f,"normal",!1)})}},8551:(l,e,t)=>{var s=t(34),n=String,i=TypeError;l.exports=function(r){if(s(r))return r;throw new i(n(r)+" is not an object")}},8574:(l,e,t)=>{var s=t(9504),n=Error,i=s("".replace),r=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(r);l.exports=function(h,c){if(o&&"string"==typeof h&&!n.prepareStackTrace)for(;c--;)h=i(h,a,"");return h}},8622:(l,e,t)=>{var s=t(4576),n=t(4901),i=s.WeakMap;l.exports=n(i)&&/native code/.test(String(i))},8646:(l,e,t)=>{var s=t(9565),n=t(8551),i=t(1767),r=t(851);l.exports=function(a,o){(!o||"string"!=typeof a)&&n(a);var h=r(a);return i(n(void 0!==h?s(h,a):a))}},8686:(l,e,t)=>{var s=t(3724),n=t(9039);l.exports=s&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8721:(l,e,t)=>{var s=t(3724),n=t(9504),i=t(2106),r=URLSearchParams.prototype,a=n(r.forEach);s&&!("size"in r)&&i(r,"size",{get:function(){var h=0;return a(this,function(){h++}),h},configurable:!0,enumerable:!0})},8727:l=>{l.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
1ing","toString","valueOf"]},8745:(l,e,t)=>{var s=t(616),n=Function.prototype,i=n.apply,r=n.call;l.exports="object"==typeof Reflect&&Reflect.apply||(s?r.bind(i):function(){return r.apply(i,arguments)})},8750:(l,e,t)=>{var s=t(7080),n=t(4402),i=t(5170),r=t(3789),a=t(8469),o=t(507),h=n.Set,c=n.add,d=n.has;l.exports=function(f){var p=s(this),g=r(f),m=new h;return i(p)>g.size?o(g.getIterator(),function(v){d(p,v)&&c(m,v)}):a(p,function(v){g.includes(v)&&c(m,v)}),m}},8773:(l,e)=>{var t={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,n=s&&!t.call({1:2},1);e.f=n?function(r){var a=s(this,r);return!!a&&a.enumerable}:t},8981:(l,e,t)=>{var s=t(7750),n=Object;l.exports=function(i){return n(s(i))}},9039:l=>{l.exports=function(e){try{return!!e()}catch{return!0}}},9112:(l,e,t)=>{var s=t(6518),n=t(3724),i=t(4576),r=t(7751),a=t(9504),o=t(9565),h=t(4901),c=t(34),d=t(4376),u=t(9297),f=t(655),p=t(6198),g=t(4659),m=t(9039),v=t(8235),y=t(4495),b=i.JSON,E=i.Number,A=i.SyntaxError,w=b&&b.parse,S=r("Object","keys"),T=Object.getOwnPropertyDescriptor,x=a("".charAt),R=a("".slice),C=a(/./.exec),L=a([].push),O=/^\d$/,M=/^[1-9]$/,j=/^[\d-]$/,D=/^[\t\n\r ]$/,st=function(F,P,k,W){var at,kt,xt,At,ce,et=F[P],$=W&&et===W.value,rt=$&&"string"==typeof W.source?{source:W.source}:{};if(c(et)){var _s=d(et),ts=$?W.nodes:_s?[]:{};if(_s)for(at=ts.length,xt=p(et),At=0;At<xt;At++)q(et,At,st(et,""+At,k,At<at?ts[At]:void 0));else for(kt=S(et),xt=p(kt),At=0;At<xt;At++)q(et,ce=kt[At],st(et,ce,k,u(ts,ce)?ts[ce]:void 0))}return o(k,F,P,et,rt)},q=function(F,P,k){if(n){var W=T(F,P);if(W&&!W.configurable)return}void 0===k?delete F[P]:g(F,P,k)},K=function(F,P,k,W){this.value=F,this.end=P,this.source=k,this.nodes=W},Q=function(F,P){this.source=F,this.index=P};Q.prototype={fork:function(F){return new Q(this.source,F)},parse:function(){var F=this.source,P=this.skip(D,this.index),k=this.fork(P),W=x(F,P);if(C(j,W))return k.number();switch(W){case"{":return k.object();case"[":return k.array();case'"':return k.string();case"t":return k.keyword(!0);case"f":return k.keyword(!1);case"n":return k.keyword(null)}throw new A('Unexpected character: "'+W+'" at: '+P)},node:function(F,P,k,W,et){return new K(P,W,F?null:R(this.source,k,W),et)},object:function(){for(var F=this.source,P=this.index+1,k=!1,W={},et={};P<F.length;){if(P=this.until(['"',"}"],P),"}"===x(F,P)&&!k){P++;break}var $=this.fork(P).string(),rt=$.value;P=this.until([":"],P=$.end)+1,P=this.skip(D,P),$=this.fork(P).parse(),g(et,rt,$),g(W,rt,$.value),P=this.until([",","}"],$.end);var at=x(F,P);if(","===at)k=!0,P++;else if("}"===at){P++;break}}return this.node(1,W,this.index,P,et)},array:function(){for(var F=this.source,P=this.index+1,k=!1,W=[],et=[];P<F.length;){if(P=this.skip(D,P),"]"===x(F,P)&&!k){P++;break}var $=this.fork(P).parse();if(L(et,$),L(W,$.value),P=this.until([",","]"],$.end),","===x(F,P))k=!0,P++;else if("]"===x(F,P)){P++;break}}return this.node(1,W,this.index,P,et)},string:function(){var F=this.index,P=v(this.source,this.index+1);return this.node(0,P.value,F,P.end)},number:function(){var F=this.source,P=this.index,k=P;if("-"===x(F,k)&&k++,"0"===x(F,k))k++;else{if(!C(M,x(F,k)))throw new A("Failed to parse number at: "+k);k=this.skip(O,k+1)}if(!("."===x(F,k)&&(k=this.skip(O,k+1)),"e"!==x(F,k)&&"E"!==x(F,k)||(k++,("+"===x(F,k)||"-"===x(F,k))&&k++,k!==(k=this.skip(O,k)))))throw new A("Failed to parse number's exponent value at: "+k);return this.node(0,E(R(F,P,k)),P,k)},keyword:function(F){var P=""+F,k=this.index,W=k+P.length;if(R(this.source,k,W)!==P)throw new A("Failed to parse value at: "+k);return this.node(0,F,k,W)},skip:function(F,P){for(var k=this.source;P<k.length&&C(F,x(k,P));P++);return P},until:function(F,P){P=this.skip(D,P);for(var k=x(this.source,P),W=0;W<F.length;W++)if(F[W]===k)return P;throw new A('Unexpected character: "'+k+'" at: '+P)}};var it=m(function(){var P,F="9007199254740993";return w(F,function(k,W,et){P=et.source}),P!==F}),bt=y&&!m(function(){return 1/w("-0 \t")!=-1/0});s({target:"JSON",stat:!0,forced:it},{parse:function(P,k){return bt&&!h(k)?w(P):function(F,P){F=f(F);var k=new Q(F,0,""),W=k.parse(),et=W.value,$=k.skip(D,W.end);if($<F.length)throw new A('Unexpected extra character: "'+x(F,$)+'" after the parsed data at: '+$);return h(P)?st({"":et},"",P,W):et}(P,k)}})},9143:(l,e,t)=>{var s=t(4576),n=t(9504),i=t(3972),r=t(3463),a=t(9297),o=t(2804),h=t(944),c=t(5169),d=o.c2i,u=o.c2iUrl,f=s.SyntaxError,p=s.TypeError,g=n("".charAt),m=function(b,E){for(var A=b.length;E<A;E++){var w=g(b,E);if(" "!==w&&"\t"!==w&&"\n"!==w&&"\f"!==w&&"\r"!==w)break}return E},v=function(b,E,A){var w=b.length;w<4&&(b+=2===w?"AA":"A");var S=(E[g(b,0)]<<18)+(E[g(b,1)]<<12)+(E[g(b,2)]<<6)+E[g(b,3)],T=[S>>16&255,S>>8&255,255&S];
vendor: 16,698 bytes, line 1
1if(2===w){if(A&&0!==T[1])throw new f("Extra bits");return[T[0]]}if(3===w){if(A&&0!==T[2])throw new f("Extra bits");return[T[0],T[1]]}return T},y=function(b,E,A){for(var w=E.length,S=0;S<w;S++)b[A+S]=E[S];return A+w};l.exports=function(b,E,A,w){r(b),i(E);var S="base64"===h(E)?d:u,T=E?E.lastChunkHandling:void 0;if(void 0===T&&(T="loose"),"loose"!==T&&"strict"!==T&&"stop-before-partial"!==T)throw new p("Incorrect `lastChunkHandling` option");A&&c(A.buffer);var x=b.length,R=A||[],C=0,L=0,O="",M=0;if(w)for(;;){if((M=m(b,M))===x){if(O.length>0){if("stop-before-partial"===T)break;if("loose"!==T)throw new f("Missing padding");if(1===O.length)throw new f("Malformed padding: exactly one additional character");C=y(R,v(O,S,!1),C)}L=x;break}var j=g(b,M);if(++M,"="===j){if(O.length<2)throw new f("Padding is too early");if(M=m(b,M),2===O.length){if(M===x){if("stop-before-partial"===T)break;throw new f("Malformed padding: only one =")}"="===g(b,M)&&(++M,M=m(b,M))}if(M<x)throw new f("Unexpected character after padding");C=y(R,v(O,S,"strict"===T),C),L=x;break}if(!a(S,j))throw new f("Unexpected character");var D=w-C;if(1===D&&2===O.length||2===D&&3===O.length||4===(O+=j).length&&(C=y(R,v(O,S,!1),C),O="",L=M,C===w))break}return{bytes:R,read:L,written:C}}},9286:(l,e,t)=>{var s=t(4402),n=t(8469),i=s.Set,r=s.add;l.exports=function(a){var o=new i;return n(a,function(h){r(o,h)}),o}},9297:(l,e,t)=>{var s=t(9504),n=t(8981),i=s({}.hasOwnProperty);l.exports=Object.hasOwn||function(a,o){return i(n(a),o)}},9306:(l,e,t)=>{var s=t(4901),n=t(6823),i=TypeError;l.exports=function(r){if(s(r))return r;throw new i(n(r)+" is not a function")}},9314:(l,e,t)=>{var s=t(6518),n=t(9565),i=t(8551),r=t(1767),a=t(4149),o=t(9590),h=t(9539),c=t(9462),d=t(684),u=t(4549),f=t(6395),p=!f&&!d("drop",0),g=!f&&!p&&u("drop",RangeError),m=f||p||g,v=c(function(){for(var E,y=this.iterator,b=this.next;this.remaining;)if(this.remaining--,E=i(n(b,y)),this.done=!!E.done)return;if(E=i(n(b,y)),!(this.done=!!E.done))return E.value});s({target:"Iterator",proto:!0,real:!0,forced:m},{drop:function(b){var E;i(this);try{E=o(a(+b))}catch(A){h(this,"throw",A)}return g?n(g,this,E):new v(r(this),{remaining:E})}})},9429:(l,e,t)=>{var s=t(4576),n=t(6193);l.exports=function(i){if(n){try{return s.process.getBuiltinModule(i)}catch{}try{return Function('return require("'+i+'")')()}catch{}}}},9432:(l,e,t)=>{t(5213)},9433:(l,e,t)=>{var s=t(4576),n=Object.defineProperty;l.exports=function(i,r){try{n(s,i,{value:r,configurable:!0,writable:!0})}catch{s[i]=r}return r}},9462:(l,e,t)=>{var s=t(9565),n=t(2360),i=t(6699),r=t(6279),a=t(8227),o=t(1181),h=t(5966),c=t(7657).IteratorPrototype,d=t(2529),u=t(9539),f=t(1385),p=a("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",b=o.set,E=function(S){var T=o.getterFor(S?m:g);return r(n(c),{next:function(){var R=T(this);if(S)return R.nextHandler();if(R.done)return d(void 0,!0);try{var C=R.nextHandler();return R.returnHandlerResult?C:d(C,R.done)}catch(L){throw R.done=!0,L}},return:function(){var x=T(this),R=x.iterator;if(x.done=!0,S){var C=h(R,"return");return C?s(C,R):d(void 0,!0)}if(x.inner)try{u(x.inner.iterator,v)}catch(L){return u(R,y,L)}if(x.openIters)try{f(x.openIters,v)}catch(L){return u(R,y,L)}return R&&u(R,v),d(void 0,!0)}})},A=E(!0),w=E(!1);i(w,p,"Iterator Helper"),l.exports=function(S,T,x){var R=function(L,O){O?(O.iterator=L.iterator,O.next=L.next):O=L,O.type=T?m:g,O.returnHandlerResult=!!x,O.nextHandler=S,O.counter=0,O.done=!1,b(this,O)};return R.prototype=T?A:w,R}},9486:(l,e,t)=>{var s=t(6518),n=t(4576),i=t(9504),r=t(3972),a=t(4154),o=t(5169),h=t(2804),c=t(944),d=h.i2c,u=h.i2cUrl,f=i("".charAt),p=n.Uint8Array,g=!p||!p.prototype.toBase64||!function(){try{(new p).toBase64(null)}catch{return!0}}();p&&s({target:"Uint8Array",proto:!0,forced:g},{toBase64:function(){var v=a(this),y=arguments.length?r(arguments[0]):void 0,b="base64"===c(y)?d:u,E=!!y&&!!y.omitPadding;o(this.buffer);for(var T,A="",w=0,S=v.length,x=function(R){return f(b,T>>6*R&63)};w+2<S;w+=3)T=(v[w]<<16)+(v[w+1]<<8)+v[w+2],A+=x(3)+x(2)+x(1)+x(0);return w+2===S?(T=(v[w]<<16)+(v[w+1]<<8),A+=x(3)+x(2)+x(1)+(E?"":"=")):w+1===S&&(T=v[w]<<16,A+=x(3)+x(2)+(E?"":"==")),A}})},9504:(l,e,t)=>{var s=t(616),n=Function.prototype,i=n.call,r=s&&n.bind.bind(i,i);l.exports=s?r:function(a){return function(){return i.apply(a,arguments)}}},9519:(l,e,t)=>{var h,c,s=t(4576),n=t(2839),i=s.process,r=s.Deno,a=i&&i.versions||r&&r.version,o=a&&a.v8;o&&(c=(h=o.split("."))[0]>0&&h[0]<4?1:+(h[0]+h[1])),!c&&n&&(!(h=n.match(/Edge\/(\d+)/))||h[1]>=74)&&(h=n.match(/Chrome\/(\d+)/))&&(c=+h[1]),l.exports=c},9539:(l,e,t)=>{var s=t(9565),n=t(8551),i=t(5966);l.exports=function(r,a,o){var h,c;n(r);try{if(!(h=i(r,"return"))){if("throw"===a)throw o;return o}h=s(h,r)}catch(d){c=!0,h=d}if("throw"===a)throw o;if(c)throw h;return n(h),o}},9565:(l,e,t)=>{var s=t(616),n=Function.prototype.call;l.exports=s?n.bind(n):function(){return n.apply(n,arguments)}},9577:(l,e,t)=>{var s=t(9928),n=t(4644),i=t(1108),r=t(1291),a=t(5854),o=n.aTypedArray,h=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,d=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(f){return 8===f}}(),u=d&&function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}}();c("with",function(f,p){var g=o(this),m=r(f),v=i(g)?a(p):+p;return s(g,h(g),m,v)},!d||u)},9590:(l,e,t)=>{var s=t(1291),n=RangeError;l.exports=function(i){var r=s(i);if(r<0)throw new n("The argument can't be less than 0");return r}},9617:(l,e,t)=>{var s=t(5397),n=t(5610),i=t(6198),r=function(a){return function(o,h,c){var d=s(o),u=i(d);if(0===u)return!a&&-1;var p,f=n(c,u);if(a&&h!=h){for(;u>f;)if((p=d[f++])!=p)return!0}else for(;u>f;f++)if((a||f in d)&&d[f]===h)return a||f||0;return!a&&-1}};l.exports={includes:r(!0),indexOf:r(!1)}},9631:(l,e,t)=>{t(9486)},9797:(l,e,t)=>{t(4226)},9835:l=>{l.exports=function(e){try{var t=new Set,s={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},n=t[e](s);return 1===n.size&&4===n.values().next().value}catch{return!1}}},9928:(l,e,t)=>{var s=t(6198),n=t(1291),i=RangeError;l.exports=function(r,a,o,h){var c=s(r),d=n(o),u=d<0?c+d:d;if(u>=c||u<0)throw new i("Incorrect index");for(var f=new a(c),p=0;p<c;p++)f[p]=p===u?h:r[p];return f}}},$s={};function Y(l){var e=$s[l];if(void 0!==e)return e.exports;var t=$s[l]={exports:{}};return oi[l].call(t.exports,t,t.exports,Y),t.exports}Y.d=(l,e)=>{for(var t in e)Y.o(e,t)&&!Y.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:e[t]})},Y.o=(l,e)=>Object.prototype.hasOwnProperty.call(l,e),Y(4114),Y(6573),Y(8100),Y(7936),Y(8111),Y(8237),Y(1689),Y(9577),Y(4235),Y(9432),Y(1549),Y(9797),Y(9631),Y(5623),Y(4979),Y(5781);const St=!("object"!=typeof Mt||Mt+""!="[object process]"||Mt.versions.nw||Mt.versions.electron&&Mt.type&&"browser"!==Mt.type),es=[.001,0,0,.001,0,0],jt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},de="pdfjs_internal_editor_",X={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},J={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},Gs={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ue={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ct={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},fe={ERRORS:0,WARNINGS:1,INFOS:5},qt={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},zs={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Le=fe.WARNINGS;function hi(){return Le}function Fe(l){Le>=fe.INFOS&&console.info(`Info: ${l}`)}function G(l){Le>=fe.WARNINGS&&console.warn(`Warning: ${l}`)}function nt(l){throw new Error(l)}function Z(l,e){l||nt(e)}function ns(l,e=null,t=null){if(!l)return null;if(t&&"string"==typeof l&&(t.addDefaultProtocol&&l.startsWith("www.")&&l.match(/\./g)?.length>=2&&(l=`http://${l}`),t.tryConvertEncoding))try{l=function mi(l){return decodeURIComponent(escape(l))}(l)}catch{}const s=e?URL.parse(l,e):URL.parse(l);return function ci(l){switch(l?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s)?s:null}function is(l,e,t=!1){const s=URL.parse(l);return s?(s.hash=e,s.href):t&&ns(l,"http://example.com")?l.split("#",1)[0]+""+(e?`#${e}`:""):""}function V(l,e,t,s=!1){return Object.defineProperty(l,e,{value:t,enumerable:!s,configurable:!0,writable:!1}),t}const Vt=function(){function e(t,s){this.message=t,this.name=s}return e.prototype=new Error,e.constructor=e,e}();class Vs extends Vt{constructor(e,t){super(e,"PasswordException"),this.code=t}}class rs extends Vt{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class ke extends Vt{constructor(e){super(e,"InvalidPDFException")}}class ge extends Vt{constructor(e,t,s){super(e,"ResponseException"),this.status=t,this.missing=s}}class di extends Vt{constructor(e){super(e,"FormatError")}}class $t extends Vt{constructor(e){super(e,"AbortException")}}function Ws(l){("object"!=typeof l||void 0===l?.length)&&nt("Invalid argument for bytesToString");const e=l.length,t=8192;if(e<t)return String.fromCharCode.apply(null,l);const s=[];for(let n=0;n<e;n+=t){const i=Math.min(n+t,e),r=l.subarray(n,i);s.push(String.fromCharCode.apply(null,r))}return s.join("")}function te(l){"string"!=typeof l&&nt("Invalid argument for stringToBytes");const e=l.length,t=new Uint8Array(e);for(let s=0;s<e;++s)t[s]=255&l.charCodeAt(s);return t}class ut{static get isLittleEndian(){return V(this,"isLittleEndian",function fi(){const l=new Uint8Array(4);return l[0]=1,1===new Uint32Array(l.buffer,0,1)[0]}())}static get isEvalSupported(){return V(this,"isEvalSupported",function pi(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return V(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return V(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return V(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return V(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return V(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return V(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Ne=Array.from(Array(256).keys(),l=>l.toString(16).padStart(2,"0"));class B{static makeHexColor(e,t,s){return`#${Ne[e]}${Ne[t]}${Ne[s]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let s;e[0]?(e[0]<0&&(s=t[0],t[0]=t[2],t[2]=s),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(s=t[1],t[1]=t[3],t[3]=s),t[1]*=e[3],t[3]*=e[3]):(s=t[0],t[0]=t[1],t[1]=s,s=t[2],t[2]=t[3],t[3]=s,e[1]<0&&(s=t[1],t[1]=t[3],t[3]=s),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(s=t[0],t[0]=t[2],t[2]=s),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,s=0){const n=e[s],i=e[s+1];e[s]=n*t[0]+i*t[2]+t[4],e[s+1]=n*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,s=0){const n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],h=t[5];for(let c=0;c<6;c+=2){const d=e[s+c],u=e[s+c+1];e[s+c]=d*n+u*r+o,e[s+c+1]=d*i+u*a+h}}static applyInverseTransform(e,t){const s=e[0],n=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(s*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-s*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,s){const n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],h=t[5],c=e[0],d=e[1],u=e[2],f=e[3];let p=n*c+o,g=p,m=n*u+o,v=m,y=a*d+h,b=y,E=a*f+h,A=E;if(0!==i||0!==r){const w=i*c,S=i*u,T=r*d,x=r*f;p+=T,v+=T,m+=x,g+=x,y+=w,A+=w,E+=S,b+=S}s[0]=Math.min(s[0],p,m,g,v),s[1]=Math.min(s[1],y,E,b,A),s[2]=Math.max(s[2],p,m,g,v),s[3]=Math.max(s[3],y,E,b,A)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const s=e[0],n=e[1],i=e[2],r=e[3],a=s**2+n**2,h=i**2+r**2,c=(a+h)/2,d=Math.sqrt(c**2-(a*h-(s*i+n*r)**2));t[0]=Math.sqrt(c+d||1),t[1]=Math.sqrt(c-d||1)}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const s=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(s>n)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),r=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>r?null:[s,i,n,r]}static pointBoundingBox(e,t,s){s[0]=Math.min(s[0],e),s[1]=Math.min(s[1],t),s[2]=Math.max(s[2],e),s[3]=Math.max(s[3],t)}static rectBoundingBox(e,t,s,n,i){i[0]=Math.min(i[0],e,s),i[1]=Math.min(i[1],t,n),i[2]=Math.max(i[2],e,s),i[3]=Math.max(i[3],t,n)}static#t(e,t,s,n,i,r,a,o,h,c){if(h<=0||h>=1)return;const d=1-h,u=h*h,f=u*h,p=d*(d*(d*e+3*h*t)+3*u*s)+f*n,g=d*(d*(d*i+3*h*r)+3*u*a)+f*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)}static#e(e,t,s,n,i,r,a,o,h,c,d,u){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(e,t,s,n,i,r,a,o,-d/c,u));const f=c**2-4*d*h;if(f<0)return;const p=Math.sqrt(f),g=2*h;this.#t(e,t,s,n,i,r,a,o,(-c+p)/g,u),this.#t(e,t,s,n,i,r,a,o,(-c-p)/g,u)}static bezierBoundingBox(e,t,s,n,i,r,a,o,h){h[0]=Math.min(h[0],e,a),h[1]=Math.min(h[1],t,o),h[2]=Math.max(h[2],e,a),h[3]=Math.max(h[3],t,o),this.#e(e,s,i,a,t,n,r,o,3*(3*(s-i)-e+a),6*(e-2*s+i),3*(s-e),h),this.#e(e,s,i,a,t,n,r,o,3*(3*(n-r)-t+o),6*(t-2*n+r),3*(n-t),h)}}let as=null,Xs=null;function Ys(l){return as||(as=/([\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,Xs=new Map([["\ufb05","\u017ft"]])),l.replaceAll(as,(e,t,s)=>t?t.normalize("NFKC"):Xs.get(s))}function os(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const l=new Uint8Array(32);return crypto.getRandomValues(l),Ws(l)}const ee="pdfjs_internal_id_";function Et(l,e,t){return Math.min(Math.max(l,e),t)}function Ks(l){return Uint8Array.prototype.toBase64?l.toBase64():btoa(Ws(l))}"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(l){return l.reduce((e,t)=>
1e+t,0)}),"function"!=typeof AbortSignal.any&&(AbortSignal.any=function(l){const e=new AbortController,{signal:t}=e;for(const s of l)if(s.aborted)return e.abort(s.reason),t;for(const s of l)s.addEventListener("abort",()=>{e.abort(s.reason)},{signal:t});return t}),Y(1701),Y(4603),Y(7566),Y(8721);class me{static textContent(e){const t=[],s={items:t,styles:Object.create(null)};return function n(i){if(!i)return;let r=null;const a=i.name;if("#text"===a)r=i.value;else{if(!me.shouldBuildText(a))return;i?.attributes?.textContent?r=i.attributes.textContent:i.value&&(r=i.value)}if(null!==r&&t.push({str:r}),i.children)for(const o of i.children)n(o)}(e),s}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}class ls{static setupStorage(e,t,s,n,i){const r=n.getValue(t,{value:null});switch(s.name){case"textarea":if(null!==r.value&&(e.textContent=r.value),"print"===i)break;e.addEventListener("input",a=>{n.setValue(t,{value:a.target.value})});break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){if(r.value===s.attributes.xfaOn?e.setAttribute("checked",!0):r.value===s.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",a=>{n.setValue(t,{value:a.target.getAttribute(a.target.checked?"xfaOn":"xfaOff")})})}else{if(null!==r.value&&e.setAttribute("value",r.value),"print"===i)break;e.addEventListener("input",a=>{n.setValue(t,{value:a.target.value})})}break;case"select":if(null!==r.value){e.setAttribute("value",r.value);for(const a of s.children)a.attributes.value===r.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const o=a.target.options;n.setValue(t,{value:-1===o.selectedIndex?"":o[o.selectedIndex].value})})}}static setAttributes({html:e,element:t,storage:s=null,intent:n,linkService:i}){const{attributes:r}=t,a=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name=`${r.name}-${n}`);for(const[o,h]of Object.entries(r))if(null!=h)switch(o){case"class":h.length&&e.setAttribute(o,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!a||"href"!==o&&"newWindow"!==o)&&e.setAttribute(o,h)}a&&i.addLinkAttributes(e,r.href,r.newWindow),s&&r.dataId&&this.setupStorage(e,r.dataId,t,s)}static render(e){const t=e.annotationStorage,s=e.linkService,n=e.xfaHtml,i=e.intent||"display",r=document.createElement(n.name);n.attributes&&this.setAttributes({html:r,element:n,intent:i,linkService:s});const a="richText"!==i,o=e.div;if(o.append(r),e.viewport){const d=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=d}a&&o.setAttribute("class","xfaLayer xfaFont");const h=[];if(0===n.children.length){if(n.value){const d=document.createTextNode(n.value);r.append(d),a&&me.shouldBuildText(n.name)&&h.push(d)}return{textDivs:h}}const c=[[n,-1,r]];for(;c.length>0;){const[d,u,f]=c.at(-1);if(u+1===d.children.length){c.pop();continue}const p=d.children[++c.at(-1)[1]];if(null===p)continue;const{name:g}=p;if("#text"===g){const v=document.createTextNode(p.value);h.push(v),f.append(v);continue}const m=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,g):document.createElement(g);if(f.append(m),p.attributes&&this.setAttributes({html:m,element:p,storage:t,intent:i,linkService:s}),p.children?.length>0)c.push([p,-1,m]);else if(p.value){const v=document.createTextNode(p.value);a&&me.shouldBuildText(g)&&h.push(v),m.append(v)}}for(const d of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:h}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const Gt="http://www.w3.org/2000/svg";class Wt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}function se(l){return hs.apply(this,arguments)}function hs(){return(hs=(0,N.A)(function*(l,e="text"){if(be(l,document.baseURI)){const t=yield fetch(l);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,s)=>{const n=new XMLHttpRequest;n.open("GET",l,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){switch(e){case"arraybuffer":case"blob":case"json":return void t(n.response)}return void t(n.responseText)}s(new Error(n.statusText))}},n.send(null)})}
vendor: 10,414 bytes, line 1
1)).apply(this,arguments)}class ve{constructor({viewBox:e,userUnit:t,scale:s,rotation:n,offsetX:i=0,offsetY:r=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=t,this.scale=s,this.rotation=n,this.offsetX=i,this.offsetY=r,s*=t;const o=(e[2]+e[0])/2,h=(e[3]+e[1])/2;let c,d,u,f,p,g,m,v;switch((n%=360)<0&&(n+=360),n){case 180:c=-1,d=0,u=0,f=1;break;case 90:c=0,d=1,u=1,f=0;break;case 270:c=0,d=-1,u=-1,f=0;break;case 0:c=1,d=0,u=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(u=-u,f=-f),0===c?(p=Math.abs(h-e[1])*s+i,g=Math.abs(o-e[0])*s+r,m=(e[3]-e[1])*s,v=(e[2]-e[0])*s):(p=Math.abs(o-e[0])*s+i,g=Math.abs(h-e[1])*s+r,m=(e[2]-e[0])*s,v=(e[3]-e[1])*s),this.transform=[c*s,d*s,u*s,f*s,p-c*s*o-u*s*h,g-d*s*o-f*s*h],this.width=m,this.height=v}get rawDims(){const e=this.viewBox;return V(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:s=this.offsetX,offsetY:n=this.offsetY,dontFlip:i=!1}={}){return new ve({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:s,offsetY:n,dontFlip:i})}convertToViewportPoint(e,t){const s=[e,t];return B.applyTransform(s,this.transform),s}convertToViewportRectangle(e){const t=[e[0],e[1]];B.applyTransform(t,this.transform);const s=[e[2],e[3]];return B.applyTransform(s,this.transform),[t[0],t[1],s[0],s[1]]}convertToPdfPoint(e,t){const s=[e,t];return B.applyInverseTransform(s,this.transform),s}}class Be extends Vt{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function ye(l){const e=l.length;let t=0;for(;t<e&&""===l[t].trim();)t++;return"data:"===l.substring(t,t+5).toLowerCase()}function _e(l){return"string"==typeof l&&/\.pdf$/i.test(l)}function Qs(l){return[l]=l.split(/[#?]/,1),l.substring(l.lastIndexOf("/")+1)}function Js(l,e="document.pdf"){if("string"!=typeof l)return e;if(ye(l))return G('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const s=(a=>{try{return new URL(a)}catch{try{return new URL(decodeURIComponent(a))}catch{try{return new URL(a,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{return null}}}}})(l);if(!s)return e;const n=a=>{try{let o=decodeURIComponent(a);return o.includes("/")?(o=o.split("/").at(-1),o.test(/^\.pdf$/i)?o:a):o}catch{return a}},i=/\.pdf$/i,r=s.pathname.split("/").at(-1);if(i.test(r))return n(r);if(s.searchParams.size>0){const a=Array.from(s.searchParams.values()).reverse();for(const h of a)if(i.test(h))return n(h);const o=Array.from(s.searchParams.keys()).reverse();for(const h of o)if(i.test(h))return n(h)}if(s.hash){const o=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(o)return n(o[0])}return e}class Zs{started=Object.create(null);times=[];time(e){e in this.started&&G(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||G(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:s}of this.times)t=Math.max(s.length,t);for(const{name:s,start:n,end:i}of this.times)e.push(`${s.padEnd(t)} ${i-n}ms\n`);return e.join("")}}function be(l,e){const t=e?URL.parse(l,e):URL.parse(l);return"http:"===t?.protocol||"https:"===t?.protocol}function It(l){l.preventDefault()}function ot(l){l.preventDefault(),l.stopPropagation()}class Ue{static#t;static toDateObject(e){if(e instanceof Date)return e;if(!e||"string"!=typeof e)return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#t.exec(e);if(!t)return null;const s=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let r=parseInt(t[4],10);r=r>=0&&r<=23?r:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const h=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===h?(r+=c,a+=d):"+"===h&&(r-=c,a-=d),new Date(Date.UTC(s,n,i,r,a,o))}}function qs(l,{scale:e=1,rotation:t=0}){const{width:s,height:n}=l.attributes.style,i=[0,0,parseInt(s),parseInt(n)];return new ve({viewBox:i,userUnit:1,scale:e,rotation:t})}function ne(l){if(l.startsWith("#")){const e=parseInt(l.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return l.startsWith("rgb(")?l.slice(4,-1).split(",").map(e=>parseInt(e)):l.startsWith("rgba(")?l.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(G(`Not a valid color format: "${l}"`),[0,0,0])}function lt(l){const{a:e,b:t,c:s,d:n,e:i,f:r}=l.getTransform();return[e,t,s,n,i,r]}function _t(l){const{a:e,b:t,c:s,d:n,e:i,f:r}=l.getTransform().invertSelf();return[e,t,s,n,i,r]}function zt(l,e,t=!1,s=!0){if(e instanceof ve){const{pageWidth:n,pageHeight:i}=e.rawDims,{style:r}=l,a=ut.isCSSRoundSupported,o=`var(--total-scale-factor) * ${n}px`,h=`var(--total-scale-factor) * ${i}px`,c=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,d=a?`round(down, ${h}, var(--scale-round-y))`:`calc(${h})`;t&&e.rotation%180!=0?(r.width=d,r.height=c):(r.width=c,r.height=d)}s&&l.setAttribute("data-main-rotation",e.rotation)}class Bt{constructor(){const{pixelRatio:e}=Bt;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,s,n,i=-1){let r=1/0,a=1/0,o=1/0;(s=Bt.capPixels(s,i))>0&&(r=Math.sqrt(s/(e*t))),-1!==n&&(a=n/e,o=n/t);const h=Math.min(r,a,o);return(this.sx>h||this.sy>h)&&(this.sx=h,this.sy=h,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,s):s}return e}}const He=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class wi{static get isDarkMode(){return V(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class tn{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);const{color:s}=window.getComputedStyle(e);return e.remove(),V(this,"commentForegroundColor",ne(s))}}function en(l,e,t,s){const n=255*(1-(s=Math.min(Math.max(s??1,0),1)));return[l=Math.round(l*s+n),e=Math.round(e*s+n),t=Math.round(t*s+n)]}function sn(l,e){const t=l[0]/255,s=l[1]/255,n=l[2]/255,i=Math.max(t,s,n),r=Math.min(t,s,n),a=(i+r)/2;if(i===r)e[0]=e[1]=0;else{const o=i-r;switch(e[1]=a<.5?o/(i+r):o/(2-i-r),i){case t:e[0]=60*((s-n)/o+(s<n?6:0));break;case s:e[0]=60*((n-t)/o+2);break;case n:e[0]=60*((t-s)/o+4)}}e[2]=a}function cs(l,e){const t=l[0],s=l[1],n=l[2],i=(1-Math.abs(2*n-1))*s,r=i*(1-Math.abs(t/60%2-1)),a=n-i/2;switch(Math.floor(t/60)){case 0:e[0]=i+a,e[1]=r+a,e[2]=a;break;case 1:e[0]=r+a,e[1]=i+a,e[2]=a;break;case 2:e[0]=a,e[1]=i+a,e[2]=r+a;break;case 3:e[0]=a,e[1]=r+a,e[2]=i+a;break;case 4:e[0]=r+a,e[1]=a,e[2]=i+a;break;case 5:case 6:e[0]=i+a,e[1]=a,e[2]=r+a}}function nn(l){return l<=.03928?l/12.92:((l+.055)/1.055)**2.4}function rn(l,e,t){cs(l,t),t.map(nn);const s=.2126*t[0]+.7152*t[1]+.0722*t[2];cs(e,t),t.map(nn);const n=.2126*t[0]+.7152*t[1]+.0722*t[2];return s>n?(s+.05)/(n+.05):(n+.05)/(s+.05)}const an=new Map;function on(l,e){const t=l[0]+256*l[1]+65536*l[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let s=an.get(t);if(s)return s;const n=new Float32Array(9),i=n.subarray(0,3),r=n.subarray(3,6);sn(l,r);const a=n.subarray(6,9);sn(e,a);const o=a[2]<.5,h=o?12:4.5;if(r[2]=o?Math.sqrt(r[2]):1-Math.sqrt(1-r[2]),rn(r,a,i)<h){let c,d;o?(c=r[2],d=1):(c=0,d=r[2]);const u=.005;for(;d-c>u;){const f=r[2]=(c+d)/2;o===rn(r,a,i)<h?c=f:d=f}r[2]=o?d:c}return cs(r,i),s=B.makeHexColor(Math.round(255*i[0]),Math.round(255*i[1]),Math.round(255*i[2])),an.set(t,s),s}function ds({html:l,dir:e,className:t},s){const n=document.createDocumentFragment();if("string"==typeof l){const i=document.createElement("p");i.dir=e||"auto";const r=l.split(/(?:\r\n?|\n)/);for(let a=0,o=r.length;a<o;++a)i.append(document.createTextNode(r[a])),a<o-1&&i.append(document.createElement("br"));n.append(i)}else ls.render({xfaHtml:l,div:n,intent:"richText"});n.firstElementChild.classList.add("richText",t),s.append(n)}function ln(l){const e=new Path2D;if(!l)return e;for(let t=0,s=l.length;t<s;)switch(l[t++]){case 0:e.moveTo(l[t++],l[t++]);break;case 1:e.lineTo(l[t++],l[t++]);break;case 2:e.bezierCurveTo(l[t++],l[t++],l[t++],l[t++],l[t++],l[t++]);break;case 3:e.quadraticCurveTo(l[t++],l[t++],l[t++],l[t++]);break;case 4:e.closePath();break;default:G(`Unrecognized drawing path operator: ${l[t-1]}`)}return e}Y(4972),Y(4628),Y(7642),Y(8004),Y(3853),Y(5876),Y(2475),Y(5024),Y(1698),Y(9314),Y(1148),Y(3579),Y(8335);class Ae{#t=null;#e=null;#n;#s=null;#a=null;#r=null;#i=null;#o=null;static#h=null;constructor(e){this.#n=e,Ae.#h||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#t=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#n._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",It,{signal:t}),e.addEventListener("pointerdown",Ae.#l,{signal:t}));const s=this.#s=document.createElement("div");s.className="buttons",e.append(s);const n=this.#n.toolbarPosition;if(n){const{style:i}=e,r="ltr"===this.#n._uiManager.direction?1-n[0]:n[0];i.insetInlineEnd=100*r+"%",i.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#t}static#l(e){e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!1,ot(e)}#d(e){this.#n._focusEventsAllowed=!0,ot(e)}#f(e){const t=this.#n._uiManager._signal;return t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("focusin",this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",It,{signal:t}),!0)}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#a?.shown(),this.#r?.shown()}
1addDeleteButton(){const{editorType:e,_uiManager:t}=this.#n,s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",Ae.#h[e]),this.#f(s)&&s.addEventListener("click",n=>{t.delete()},{signal:t._signal}),this.#s.append(s)}get#m(){const e=document.createElement("div");return e.className="divider",e}addAltText(e){var t=this;return(0,N.A)(function*(){const s=yield e.render();t.#f(s),t.#s.append(s,t.#m),t.#a=e})()}addComment(e,t=null){if(this.#r)return;const s=e.renderForToolbar();if(!s)return;this.#f(s);const n=this.#i=this.#m;t?(this.#s.insertBefore(s,t),this.#s.insertBefore(n,t)):this.#s.append(s,n),this.#r=e,e.toolbar=this}addColorPicker(e){if(this.#e)return;this.#e=e;const t=e.renderButton();this.#f(t),this.#s.append(t,this.#m)}addEditSignatureButton(e){var t=this;return(0,N.A)(function*(){const s=t.#o=yield e.renderEditButton(t.#n);t.#f(s),t.#s.append(s,t.#m)})()}removeButton(e){"comment"===e&&(this.#r?.removeToolbarCommentButton(),this.#r=null,this.#i?.remove(),this.#i=null)}addButton(e,t){var s=this;return(0,N.A)(function*(){switch(e){case"colorPicker":t&&s.addColorPicker(t);break;case"altText":t&&(yield s.addAltText(t));break;case"editSignature":t&&(yield s.addEditSignatureButton(t));break;case"delete":s.addDeleteButton();break;case"comment":t&&s.addComment(t)}})()}addButtonBefore(e,t,s){var n=this;return(0,N.A)(function*(){if(!t&&"comment"===e)return;const i=n.#s.querySelector(s);i&&"comment"===e&&n.addComment(t,i)})()}updateEditSignatureButton(e){this.#o&&(this.#o.title=e)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class Ei{#t=null;#e=null;#n;constructor(e){this.#n=e}#s(){const e=this.#e=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",It,{signal:t});const s=this.#t=document.createElement("div");return s.className="buttons",e.append(s),this.#n.hasCommentManager()&&this.#r("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#n.commentSelection("floating_button")}),this.#r("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#n.highlightSelection("floating_button")}),e}#a(e,t){let s=0,n=0;for(const i of e){const r=i.y+i.height;if(r<s)continue;const a=i.x+(t?i.width:0);r>s?(n=a,s=r):t?a>n&&(n=a):a<n&&(n=a)}return[t?1-n:n,s]}show(e,t,s){const[n,i]=this.#a(t,s),{style:r}=this.#e||=this.#s();e.append(this.#e),r.insetInlineEnd=100*n+"%",r.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#r(e,t,s,n){const i=document.createElement("button");i.classList.add("basic",e),i.tabIndex=0,i.setAttribute("data-l10n-id",t);const r=document.createElement("span");i.append(r),r.className="visuallyHidden",r.setAttribute("data-l10n-id",s);const a=this.#n._signal;a instanceof AbortSignal&&!a.aborted&&(i.addEventListener("contextmenu",It,{signal:a}),i.addEventListener("click",n,{signal:a})),this.#t.append(i)}}function hn(l,e,t){for(const s of t)e.addEventListener(s,l[s].bind(l))}class tt{static#t=NaN;static#e=null;static#n=NaN;static#s=null;static initializeAndAddPointerId(e){(tt.#e||=new Set).add(e)}static setPointer(e,t){tt.#t||=t,tt.#s??=e}static setTimeStamp(e){tt.#n=e}static isSamePointerId(e){return tt.#t===e}static isSamePointerIdOrRemove(e){return tt.#t===e||(tt.#e?.delete(e),!1)}static isSamePointerType(e){return tt.#s===e}static isInitializedAndDifferentPointerType(e){return null!==tt.#s&&!tt.isSamePointerType(e)}static isSameTimeStamp(e){return tt.#n===e}static isUsingMultiplePointers(){return tt.#e?.size>=1}static clearPointerType(){tt.#s=null}static clearPointerIds(){tt.#t=NaN,tt.#e=null}static clearTimeStamp(){tt.#n=NaN}}class Si{#t=0;get id(){return`${de}${this.#t++}`}}class us{#t=os();#e=0;#n=null;static get _isSVGFittingCanvas(){const s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),n=new Image;return n.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',V(this,"_isSVGFittingCanvas",n.decode().then(()=>
1(s.drawImage(n,0,0,1,1,0,0,1,3),0===new Uint32Array(s.getImageData(0,0,1,1).data.buffer)[0])))}#s(e,t){var s=this;return(0,N.A)(function*(){s.#n||=new Map;let n=s.#n.get(e);if(null===n)return null;if(n?.bitmap)return n.refCounter+=1,n;try{let i;if(n||={bitmap:null,id:`image_${s.#t}_${s.#e++}`,refCounter:0,isSvg:!1},"string"==typeof t?(n.url=t,i=yield se(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),"image/svg+xml"===i.type){const r=us._isSVGFittingCanvas,a=new FileReader,o=new Image,h=new Promise((c,d)=>{o.onload=()=>{n.bitmap=o,n.isSvg=!0,c()},a.onload=(0,N.A)(function*(){const u=n.svgUrl=a.result;o.src=(yield r)?`${u}#svgView(preserveAspectRatio(none))`:u}),o.onerror=a.onerror=d});a.readAsDataURL(i),yield h}else n.bitmap=yield createImageBitmap(i);n.refCounter=1}catch(i){G(i),n=null}return s.#n.set(e,n),n&&s.#n.set(n.id,n),n})()}getFromFile(e){var t=this;return(0,N.A)(function*(){const{lastModified:s,name:n,size:i,type:r}=e;return t.#s(`${s}_${n}_${i}_${r}`,e)})()}getFromUrl(e){var t=this;return(0,N.A)(function*(){return t.#s(e,e)})()}getFromBlob(e,t){var s=this;return(0,N.A)(function*(){const n=yield t;return s.#s(e,n)})()}getFromId(e){var t=this;return(0,N.A)(function*(){t.#n||=new Map;const s=t.#n.get(e);if(!s)return null;if(s.bitmap)return s.refCounter+=1,s;if(s.file)return t.getFromFile(s.file);if(s.blobPromise){const{blobPromise:n}=s;return delete s.blobPromise,t.getFromBlob(s.id,n)}return t.getFromUrl(s.url)})()}getFromCanvas(e,t){this.#n||=new Map;let s=this.#n.get(e);if(s?.bitmap)return s.refCounter+=1,s;const n=new OffscreenCanvas(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),s={bitmap:n.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#n.set(e,s),this.#n.set(s.id,s),s}getSvgUrl(e){const t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;const t=this.#n.get(e);if(!t||(t.refCounter-=1,0!==t.refCounter))return;const{bitmap:s}=t;if(!t.url&&!t.file){const n=new OffscreenCanvas(s.width,s.height);n.getContext("bitmaprenderer").transferFromImageBitmap(s),t.blobPromise=n.convertToBlob()}s.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#t}_`)}}class xi{#t=[];#e=!1;#n;#s=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:s,mustExec:n,type:i=NaN,overwriteIfSameType:r=!1,keepUndo:a=!1}){if(n&&e(),this.#e)return;const o={cmd:e,undo:t,post:s,type:i};if(-1===this.#s)return this.#t.length>0&&(this.#t.length=0),this.#s=0,void this.#t.push(o);if(r&&this.#t[this.#s].type===i)return a&&(o.undo=this.#t[this.#s].undo),void(this.#t[this.#s]=o);const h=this.#s+1;h===this.#n?this.#t.splice(0,1):(this.#s=h,h<this.#t.length&&this.#t.splice(h)),this.#t.push(o)}undo(){if(-1===this.#s)return;this.#e=!0;const{undo:e,post:t}=this.#t[this.#s];e(),t?.(),this.#e=!1,this.#s-=1}redo(){if(this.#s<this.#t.length-1){this.#s+=1,this.#e=!0;const{cmd:e,post:t}=this.#t[this.#s];e(),t?.(),this.#e=!1}}hasSomethingToUndo(){return-1!==this.#s}hasSomethingToRedo(){return this.#s<this.#t.length-1}cleanType(e){if(-1!==this.#s){for(let t=this.#s;t>=0;t--)if(this.#t[t].type!==e)return this.#t.splice(t+1,this.#s-t),void(this.#s=t);this.#t.length=0,this.#s=-1}}destroy(){this.#t=null}}class we{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=ut.platform;for(const[s,n,i={}]of e)for(const r of s){const a=r.startsWith("mac+");t&&a?(this.callbacks.set(r.slice(4),{callback:n,options:i}),this.allKeys.add(r.split("+").at(-1))):!t&&!a&&(this.callbacks.set(r,{callback:n,options:i}),this.allKeys.add(r.split("+").at(-1)))}}#t(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 t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const s=this.callbacks.get(this.#t(t));if(!s)return;const{callback:n,options:{bubbles:i=!1,args:r=[],checker:a=null}}=s;a&&!a(e,t)||(n.bind(e,...r,t)(),i||ot(t))}}class fs{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return function Ai(l){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const t of l.keys()){e.style.color=t;
vendor: 5,960 bytes, line 1
1const s=window.getComputedStyle(e).color;l.set(t,ne(s))}e.remove()}(e),V(this,"_colors",e)}convert(e){const t=ne(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[s,n]of this._colors)if(n.every((i,r)=>i===t[r]))return fs._colorsMapping.get(s);return t}getHexCode(e){const t=this._colors.get(e);return t?B.makeHexColor(...t):e}}let ie=(()=>{class l{#t=new AbortController;#e=null;#n=null;#s=new Map;#a=new Map;#r=null;#i=null;#o=null;#h=new xi;#l=null;#u=null;#d=null;#f=0;#m=new Set;#g=null;#c=null;#p=new Set;_editorUndoBar=null;#v=!1;#b=!1;#y=!1;#T=null;#S=null;#w=null;#R=null;#A=!1;#x=null;#D=new Si;#P=!1;#I=!1;#B=!1;#M=null;#F=null;#_=null;#k=null;#z=null;#C=X.NONE;#E=new Set;#L=null;#U=null;#j=null;#X=null;#W=null;#Y={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#$=[0,0];#N=null;#V=null;#Z=null;#q=null;#H=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=l.prototype,s=a=>a.#V.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&a.hasSomethingToControl(),n=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:h}=o;return"text"!==h&&"number"!==h}return!0},i=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return V(this,"_keyboardManager",new we([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],t.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:n}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#V.contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#V.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:s}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:s}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:s}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:s}]]))}constructor(t,s,n,i,r,a,o,h,c,d,u,f,p,g,m,v){const y=this._signal=this.#t.signal;this.#V=t,this.#Z=s,this.#q=n,this.#r=i,this.#l=r,this.#U=a,this.#W=h,this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:y}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:y}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:y}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:y}),o._on("setpreference",this.onSetPreference.bind(this),{signal:y}),o._on("switchannotationeditorparams",b=>this.updateParams(b.type,b.value),{signal:y}),window.addEventListener("pointerdown",()=>{this.#I=!0},{capture:!0,signal:y}),window.addEventListener("pointerup",()=>{this.#I=!1},{capture:!0,signal:y}),this.#at(),this.#ut(),this.#et(),this.#i=h.annotationStorage,this.#T=h.filterFactory,this.#j=c,this.#R=d||null,this.#v=u,this.#b=f,this.#y=p,this.#z=g||null,this.viewParameters={realScale:Wt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=!1!==v,r?.setSidebarUiManager(this)}destroy(){this.#H?.resolve(),this.#H=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const t of this.#a.values())t.destroy();this.#a.clear(),this.#s.clear(),this.#p.clear(),this.#k?.clear(),this.#e=null,this.#E.clear(),this.#h.destroy(),this.#r?.destroy(),this.#l?.destroy(),this.#U?.destroy(),this.#x?.hide(),this.#x=null,this.#_?.destroy(),this.#_=null,this.#n=null,this.#S&&(clearTimeout(this.#S),this.#S=null),this.#N&&(clearTimeout(this.#N),this.#N=null),this._editorUndoBar?.destroy(),this.#W=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#z}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return V(this,"hcmFilter",this.#j?this.#T.addHCMFilter(this.#j.foreground,this.#j.background):"none")}get direction(){return V(this,"direction",getComputedStyle(this.#V).direction)}get _highlightColors(){return V(this,"_highlightColors",this.#R?new Map(this.#R.split(",").map(t=>((t=t.split("=").map(s=>s.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return V(this,"highlightColors",null);const s=new Map,n=!!this.#j;for(const[i,r]of t){const a=i.endsWith("_HCM");n&&a?s.set(i.replace("_HCM",""),r):!n&&!a&&s.set(i,r)}return V(this,"highlightColors",s)}get highlightColorNames(){return V(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const s=this.highlightColorNames.get(t);return this._highlightColors.get(s)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#d=t}setMainHighlightColorPicker(t){this.#_=t}editAltText(t,s=!1){this.#r?.editAltText(this,t,s)}hasCommentManager(){return!!this.#l}editComment(t,s,n,i){this.#l?.showDialog(this,t,s,n,i)}selectComment(t,s){this.#a.get(t)?.getEditorByUID(s)?.toggleComment(!0,!0)}updateComment(t){this.#l?.updateComment(t.getData())}updatePopupColor(t){this.#l?.updatePopupColor(t)}
vendor: 6,290 bytes, line 1
1removeComment(t){this.#l?.removeComments([t.uid])}toggleComment(t,s,n=void 0){this.#l?.toggleCommentPopup(t,s,n)}makeCommentColor(t,s){return t&&this.#l?.makeCommentColor(t,s)||null}getCommentDialogElement(){return this.#l?.dialogElement||null}waitForEditorsRendered(t){var s=this;return(0,N.A)(function*(){if(s.#a.has(t-1))return;const{resolve:n,promise:i}=Promise.withResolvers(),r=a=>{a.pageNumber===t&&(s._eventBus._off("editorsrendered",r),n())};s._eventBus.on("editorsrendered",r),yield i})()}getSignature(t){this.#U?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#U}switchToMode(t,s){this._eventBus.on("annotationeditormodechanged",s,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,s){this._eventBus.dispatch("setpreference",{source:this,name:t,value:s})}onSetPreference({name:t,value:s}){"enableNewAltTextWhenAddingImage"===t&&(this.#y=s)}onPageChanging({pageNumber:t}){this.#f=t-1}focusMainContainer(){this.#V.focus()}findParent(t,s){for(const n of this.#a.values()){const{x:i,y:r,width:a,height:o}=n.div.getBoundingClientRect();if(t>=i&&t<=i+a&&s>=r&&s<=r+o)return n}return null}disableUserSelect(t=!1){this.#Z.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#p.add(t)}removeShouldRescale(t){this.#p.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Wt.PDF_TO_CSS_UNITS;for(const s of this.#p)s.onScaleChanging();this.#d?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#J({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#tt(t){const{currentLayer:s}=this;if(s.hasTextLayer(t))return s;for(const n of this.#a.values())if(n.hasTextLayer(t))return n;return null}highlightSelection(t="",s=!1){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:i,anchorOffset:r,focusNode:a,focusOffset:o}=n,h=n.toString(),d=this.#J(n).closest(".textLayer"),u=this.getSelectionBoxes(d);if(!u)return;n.empty();const f=this.#tt(d),p=this.#C===X.NONE,g=()=>{const m=f?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:u,anchorNode:i,anchorOffset:r,focusNode:a,focusOffset:o,text:h});p&&this.showAllEditors("highlight",!0,!0),s&&m?.editComment()};p?this.switchToMode(X.HIGHLIGHT,g):g()}commentSelection(t=""){this.highlightSelection(t,!0)}#it(){const t=document.getSelection();if(!t||t.isCollapsed)return;const n=this.#J(t).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(this.#x||=new Ei(this),this.#x.show(n,i,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#i)return null;const s=`${de}${t}`,n=this.#i.getRawValue(s);return n&&this.#i.remove(s),n}addToAnnotationStorage(t){!t.isEmpty()&&this.#i&&!this.#i.has(t.id)&&this.#i.setValue(t.id,t)}a11yAlert(t,s=null){const n=this.#q;n&&(n.setAttribute("data-l10n-id",t),s?n.setAttribute("data-l10n-args",JSON.stringify(s)):n.removeAttribute("data-l10n-args"))}#rt(){const t=document.getSelection();if(!t||t.isCollapsed)return void(this.#L&&(this.#x?.hide(),this.#L=null,this.#O({hasSelectedText:!1})));const{anchorNode:s}=t;if(s===this.#L)return;const i=this.#J(t).closest(".textLayer");if(i){if(this.#x?.hide(),this.#L=s,this.#O({hasSelectedText:!0}),(this.#C===X.HIGHLIGHT||this.#C===X.NONE)&&(this.#C===X.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#A=this.isShiftKeyDown,!this.isShiftKeyDown)){const r=this.#C===X.HIGHLIGHT?this.#tt(i):null;if(r?.toggleDrawing(),this.#I){const a=new AbortController,o=this.combinedSignal(a),h=c=>{"pointerup"===c.type&&0!==c.button||(a.abort(),r?.toggleDrawing(!0),"pointerup"===c.type&&this.#K("main_toolbar"))};window.addEventListener("pointerup",h,{signal:o}),window.addEventListener("blur",h,{signal:o})}else r?.toggleDrawing(!0),this.#K("main_toolbar")}}else this.#L&&(this.#x?.hide(),this.#L=null,this.#O({hasSelectedText:!1}))}#K(t=""){this.#C===X.HIGHLIGHT?this.highlightSelection(t):this.#v&&this.#it()}#at(){document.addEventListener("selectionchange",this.#rt.bind(this),{signal:this._signal})}#ot(){if(this.#w)return;this.#w=new AbortController;const t=this.combinedSignal(this.#w);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#lt(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#A&&(this.#A=!1,this.#K("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const s of this.#E)if(s.div.contains(t)){this.#F=[s,t],s._focusEventsAllowed=!1;break}}focus(){if(!this.#F)return;const[t,s]=this.#F;this.#F=null,s.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),s.focus()}#et(){if(this.#M)return;this.#M=new AbortController;const t=this.combinedSignal(this.#M);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#ht(){this.#M?.abort(),this.#M=null}#ct(){if(this.#u)return;this.#u=new AbortController;const t=this.combinedSignal(this.#u);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#dt(){this.#u?.abort(),this.#u=null}#ut(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#et(),this.setEditingState(!0)}removeEditListeners(){this.#ht(),this.setEditingState(!1)}dragOver(t){for(const{type:s}of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(s))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const s of t.dataTransfer.items)for(const n of this.#c)if(n.isHandlingMimeForPasting(s.type))return n.paste(s,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const s=[];for(const n of this.#E){const i=n.serialize(!0);i&&s.push(i)}0!==s.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(s))}cut(t){this.copy(t),this.delete()}paste(t){var s=this;return(0,N.A)(function*(){t.preventDefault();const{clipboardData:n}=t;
1for(const a of n.items)for(const o of s.#c)if(o.isHandlingMimeForPasting(a.type))return void o.paste(a,s.currentLayer);let i=n.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(a){return void G(`paste: "${a.message}".`)}if(!Array.isArray(i))return;s.unselectAll();const r=s.currentLayer;try{const a=[];for(const c of i){const d=yield r.deserialize(c);if(!d)return;a.push(d)}const o=()=>{for(const c of a)s.#st(c);s.#nt(a)};s.addCommands({cmd:o,undo:()=>{for(const c of a)c.remove()},mustExec:!0})}catch(a){G(`paste: "${a.message}".`)}})()}keydown(t){!this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!0),this.#C!==X.NONE&&!this.isEditorHandlingKeyboard&&l._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#A&&(this.#A=!1,this.#K("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}#O(t){Object.entries(t).some(([n,i])=>this.#Y[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Y,t)}),this.#C===X.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#G([[J.HIGHLIGHT_FREE,!0]]))}#G(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ot(),this.#ct(),this.#O({isEditing:this.#C!==X.NONE,isEmpty:this.#Q(),hasSomethingToUndo:this.#h.hasSomethingToUndo(),hasSomethingToRedo:this.#h.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#lt(),this.#dt(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const s of this.#c)this.#G(s.defaultPropertiesToUpdate)}}getId(){return this.#D.id}get currentLayer(){return this.#a.get(this.#f)}getLayer(t){return this.#a.get(t)}get currentPageIndex(){return this.#f}addLayer(t){this.#a.set(t.pageIndex,t),this.#P?t.enable():t.disable()}removeLayer(t){this.#a.delete(t.pageIndex)}updateMode(t){var s=this;return(0,N.A)(function*(n,i=null,r=!1,a=!1,o=!1,h=!1){if(s.#C!==n&&(!s.#H||(yield s.#H.promise,s.#H))){if(s.#H=Promise.withResolvers(),s.#d?.commitOrRemove(),s.#C===X.POPUP&&s.#l?.hideSidebar(),s.#l?.destroyPopup(),s.#C=n,n===X.NONE){s.setEditingState(!1),s.#pt();for(const c of s.#s.values())c.hideStandaloneCommentButton();return s._editorUndoBar?.hide(),s.toggleComment(null),void s.#H.resolve()}for(const c of s.#s.values())c.addStandaloneCommentButton();n===X.SIGNATURE&&(yield s.#U?.loadSignatures()),r&&tt.clearPointerType(),s.setEditingState(!0),yield s.#ft(),s.unselectAll();for(const c of s.#a.values())c.updateMode(n);if(n===X.POPUP){s.#n||=(yield s.#W.getAnnotationsByType(new Set(s.#c.map(u=>u._editorType))));const c=new Set,d=[];for(const u of s.#s.values()){const{annotationElementId:f,hasComment:p,deleted:g}=u;f&&c.add(f),p&&!g&&d.push(u.getData())}for(const u of s.#n){const{id:f,popupRef:p,contentsObj:g}=u;p&&g?.str&&!c.has(f)&&!s.#m.has(f)&&d.push(u)}s.#l?.showSidebar(d)}if(!i)return a&&s.addNewEditorFromKeyboard(),void s.#H.resolve();for(const c of s.#s.values())c.uid===i?(s.setSelected(c),h?c.editComment():o?c.enterInEditMode():c.focus()):c.unselect();s.#H.resolve()}}).apply(this,arguments)}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#C&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,s){if(this.#c){switch(t){case J.CREATE:return void this.currentLayer.addNewEditor(s);case J.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#X||=new Map).set(t,s),this.showAllEditors("highlight",s)}if(this.hasSelection)for(const n of this.#E)n.updateParams(t,s);else for(const n of this.#c)n.updateDefaultParams(t,s)}}showAllEditors(t,s,n=!1){for(const r of this.#s.values())r.editorType===t&&r.show(s);(this.#X?.get(J.HIGHLIGHT_SHOW_ALL)??!0)!==s&&this.#G([[J.HIGHLIGHT_SHOW_ALL,s]])}enableWaiting(t=!1){if(this.#B!==t){this.#B=t;for(const s of this.#a.values())t?s.disableClick():s.enableClick(),s.div.classList.toggle("waiting",t)}}#ft(){var t=this;return(0,N.A)(function*(){if(!t.#P){t.#P=!0;const s=[];for(const n of t.#a.values())s.push(n.enable());yield Promise.all(s);for(const n of t.#s.values())n.enable()}})()}#pt(){if(this.unselectAll(),this.#P){this.#P=!1;for(const t of this.#a.values())t.disable();for(const t of this.#s.values())t.disable()}}*getEditors(t){for(const s of this.#s.values())s.pageIndex===t&&(yield s)}getEditor(t){return this.#s.get(t)}addEditor(t){this.#s.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#s.delete(t.id),t.annotationElementId&&this.#k?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!this.#m.has(t.annotationElementId))&&this.#i?.remove(t.id)}addDeletedAnnotationElement(t){this.#m.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}
vendor: 5,810 bytes, line 1
1isDeletedAnnotationElement(t){return this.#m.has(t)}removeDeletedAnnotationElement(t){this.#m.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#st(t){const s=this.#a.get(t.pageIndex);s?s.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#e!==t&&(this.#e=t,t&&this.#G(t.propertiesToUpdate))}get#gt(){let t=null;for(t of this.#E);return t}updateUI(t){this.#gt===t&&this.#G(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#G(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#E.has(t))return this.#E.delete(t),t.unselect(),void this.#O({hasSelectedEditor:this.hasSelection});this.#E.add(t),t.select(),this.#G(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),this.#d?.commitOrRemove();for(const s of this.#E)s!==t&&s.unselect();this.#E.clear(),this.#E.add(t),t.select(),this.#G(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(t){return this.#E.has(t)}get firstSelectedEditor(){return this.#E.values().next().value}unselect(t){t.unselect(),this.#E.delete(t),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#E.size}get isEnterHandled(){return 1===this.#E.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#h.undo(),this.#O({hasSomethingToUndo:this.#h.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Q()}),this._editorUndoBar?.hide()}redo(){this.#h.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#h.hasSomethingToRedo(),isEmpty:this.#Q()})}addCommands(t){this.#h.add(t),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Q()})}cleanUndoStack(t){this.#h.cleanType(t)}#Q(){if(0===this.#s.size)return!0;if(1===this.#s.size)for(const t of this.#s.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const s=t?[t]:[...this.#E],i=()=>{for(const r of s)this.#st(r)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(i,1===s.length?s[0].editorType:s.length);for(const r of s)r.remove()},undo:i,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#nt(t){for(const s of this.#E)s.unselect();this.#E.clear();for(const s of t)s.isEmpty()||(this.#E.add(s),s.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#E)t.commit();this.#nt(this.#s.values())}unselectAll(){if((!this.#e||(this.#e.commitOrRemove(),this.#C===X.NONE))&&!this.#d?.commitOrRemove()&&this.hasSelection){for(const t of this.#E)t.unselect();this.#E.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(t,s,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#$[0]+=t,this.#$[1]+=s;const[i,r]=this.#$,a=[...this.#E];this.#N&&clearTimeout(this.#N),this.#N=setTimeout(()=>{this.#N=null,this.#$[0]=this.#$[1]=0,this.addCommands({cmd:()=>{for(const h of a)this.#s.has(h.id)&&(h.translateInPage(i,r),h.translationDone())},undo:()=>{for(const h of a)this.#s.has(h.id)&&(h.translateInPage(-i,-r),h.translationDone())},mustExec:!1})},1e3);for(const h of a)h.translateInPage(t,s),h.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(const t of this.#E)this.#g.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);const t=this.#g;this.#g=null;let s=!1;for(const[{x:i,y:r,pageIndex:a},o]of t)o.newX=i,o.newY=r,o.newPageIndex=a,s||=i!==o.savedX||r!==o.savedY||a!==o.savedPageIndex;if(!s)return!1;const n=(i,r,a,o)=>{if(this.#s.has(i.id)){const h=this.#a.get(o);h?i._setParentAndPosition(h,r,a):(i.pageIndex=o,i.x=r,i.y=a)}};return this.addCommands({cmd:()=>{for(const[i,{newX:r,newY:a,newPageIndex:o}]of t)n(i,r,a,o)},undo:()=>{for(const[i,{savedX:r,savedY:a,savedPageIndex:o}]of t)n(i,r,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,s){if(this.#g)for(const n of this.#g.keys())n.drag(t,s)}rebuild(t){if(null===t.parent){const s=this.getLayer(t.pageIndex);s?(s.changeParent(t),s.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#E.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#e===t}getActive(){return this.#e}getMode(){return this.#C}isEditingMode(){return this.#C!==X.NONE}get imageManager(){return V(this,"imageManager",new us)}getSelectionBoxes(t){if(!t)return null;const s=document.getSelection();for(let c=0,d=s.rangeCount;c<d;c++)if(!t.contains(s.getRangeAt(c).commonAncestorContainer))return null;const{x:n,y:i,width:r,height:a}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,d,u,f)=>({x:(d-i)/a,y:1-(c+u-n)/r,width:f/a,height:u/r});break;case"180":o=(c,d,u,f)=>({x:1-(c+u-n)/r,y:1-(d+f-i)/a,width:u/r,height:f/a});break;case"270":o=(c,d,u,f)=>({x:1-(d+f-i)/a,y:(c-n)/r,width:f/a,height:u/r});break;default:o=(c,d,u,f)=>({x:(c-n)/r,y:(d-i)/a,width:u/r,height:f/a})}const h=[];for(let c=0,d=s.rangeCount;c<d;c++){const u=s.getRangeAt(c);if(!u.collapsed)for(const{x:f,y:p,width:g,height:m}of u.getClientRects())0===g||0===m||h.push(o(f,p,g,m))}return 0===h.length?null:h}addChangedExistingAnnotation({annotationElementId:t,id:s}){(this.#o||=new Map).set(t,s)}removeChangedExistingAnnotation({annotationElementId:t}){this.#o?.delete(t)}renderAnnotationElement(t){const s=this.#o?.get(t.data.id);if(!s)return;const n=this.#i.getRawValue(s);n&&(this.#C===X.NONE&&!n.hasBeenModified||n.renderAnnotationElement(t))}setMissingCanvas(t,s,n){const i=this.#k?.get(t);i&&(i.setCanvas(s,n),this.#k.delete(t))}
1addMissingCanvas(t,s){(this.#k||=new Map).set(t,s)}}return l})(),cn=(()=>{class l{#t=null;#e=!1;#n=null;#s=null;#a=null;#r=null;#i=!1;#o=null;#h=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#h=t,this.#d=t._uiManager.useNewAltTextFlow,l.#f||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){l._l10n??=t}render(){var t=this;return(0,N.A)(function*(){const s=t.#n=document.createElement("button");s.className="altText",s.tabIndex="0";const n=t.#s=document.createElement("span");s.append(n),t.#d?(s.classList.add("new"),s.setAttribute("data-l10n-id",l.#f.missing),n.setAttribute("data-l10n-id",l.#f["missing-label"])):(s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=t.#h._uiManager._signal;s.addEventListener("contextmenu",It,{signal:i}),s.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:i});const r=a=>{a.preventDefault(),t.#h._uiManager.editAltText(t.#h),t.#d&&t.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:t.#m}})};return s.addEventListener("click",r,{capture:!0,signal:i}),s.addEventListener("keydown",a=>{a.target===s&&"Enter"===a.key&&(t.#i=!0,r(a))},{signal:i}),yield t.#g(),s})()}get#m(){return(this.#t?"added":null===this.#t&&this.guessedText&&"review")||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#i}),this.#i=!1)}isEmpty(){return this.#d?null===this.#t:!this.#t&&!this.#e}hasData(){return this.#d?null!==this.#t||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}setGuessedText(t){var s=this;return(0,N.A)(function*(){null===s.#t&&(s.#l=t,s.#u=yield l._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),s.#g())})()}toggleAltTextBadge(t=!1){if(!this.#d||this.#t)return this.#o?.remove(),void(this.#o=null);if(!this.#o){const s=this.#o=document.createElement("div");s.className="noAltTextBadge",this.#h.div.append(s)}this.#o.classList.toggle("hidden",!t)}serialize(t){let s=this.#t;return!t&&this.#l===s&&(s=this.#u),{altText:s,decorative:this.#e,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:s,guessedText:n,textWithDisclaimer:i,cancel:r=!1}){n&&(this.#l=n,this.#u=i),(this.#t!==t||this.#e!==s)&&(r||(this.#t=t,this.#e=s),this.#g())}toggle(t=!1){this.#n&&(!t&&this.#r&&(clearTimeout(this.#r),this.#r=null),this.#n.disabled=!t)}shown(){this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#n?.remove(),this.#n=null,this.#s=null,this.#a=null,this.#o?.remove(),this.#o=null}#g(){var t=this;return(0,N.A)(function*(){const s=t.#n;if(!s)return;if(t.#d){if(s.classList.toggle("done",!!t.#t),s.setAttribute("data-l10n-id",l.#f[t.#m]),t.#s?.setAttribute("data-l10n-id",l.#f[`${t.#m}-label`]),!t.#t)return void t.#a?.remove()}else{if(!t.#t&&!t.#e)return s.classList.remove("done"),void t.#a?.remove();s.classList.add("done"),s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=t.#a;if(!n){t.#a=n=document.createElement("span"),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${t.#h.id}`;const r=100,a=t.#h._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(t.#r),t.#r=null},{once:!0}),s.addEventListener("mouseenter",()=>{t.#r=setTimeout(()=>{t.#r=null,t.#a.classList.add("show"),t.#h._reportTelemetry({action:"alt_text_tooltip"})},r)},{signal:a}),s.addEventListener("mouseleave",()=>{t.#r&&(clearTimeout(t.#r),t.#r=null),t.#a?.classList.remove("show")},{signal:a})}t.#e?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=t.#t),n.parentNode||s.append(n),t.#h.getElementForAltText()?.setAttribute("aria-describedby",n.id)})()}}return l})();
vendor: 8,326 bytes, line 1
1class je{#t=null;#e=null;#n=!1;#s=null;#a=null;#r=null;#i=null;#o=null;#h=!1;#l=null;constructor(e){this.#s=e}renderForToolbar(){const e=this.#e=document.createElement("button");return e.className="comment",this.#u(e,!1)}renderForStandalone(){const e=this.#t=document.createElement("button");e.className="annotationCommentButton";const t=this.#s.commentButtonPosition;if(t){const{style:s}=e;s.insetInlineEnd=`calc(${100*("ltr"===this.#s._uiManager.direction?1-t[0]:t[0])}% - var(--comment-button-dim))`,s.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;const n=this.#s.commentButtonColor;n&&(s.backgroundColor=n)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#t??this.#e)?.focus()},0)}onUpdatedColor(){if(!this.#t)return;const e=this.#s.commentButtonColor;e&&(this.#t.style.backgroundColor=e),this.#s._uiManager.updatePopupColor(this.#s)}get commentButtonWidth(){return(this.#t?.getBoundingClientRect().width??0)/this.#s.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#t)return null;const{x:e,y:t,height:s}=this.#t.getBoundingClientRect(),{x:n,y:i,width:r,height:a}=this.#s.parent.boundingClientRect;return[(e-n)/r,(t+s-i)/a]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return null===this.#l}removeStandaloneCommentButton(){this.#t?.remove(),this.#t=null}removeToolbarCommentButton(){this.#e?.remove(),this.#e=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#t&&(this.#t.classList.toggle("selected",e),this.#t.ariaExpanded=t)}#u(e,t){if(!this.#s._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[this.#s._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const s=this.#s._uiManager._signal;if(!(s instanceof AbortSignal)||s.aborted)return e;e.addEventListener("contextmenu",It,{signal:s}),t&&(e.addEventListener("focusin",i=>{this.#s._focusEventsAllowed=!1,ot(i)},{capture:!0,signal:s}),e.addEventListener("focusout",i=>{this.#s._focusEventsAllowed=!0,ot(i)},{capture:!0,signal:s})),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:s});const n=i=>{i.preventDefault(),e===this.#e?this.edit():this.#s.toggleComment(!0)};return e.addEventListener("click",n,{capture:!0,signal:s}),e.addEventListener("keydown",i=>{i.target===e&&"Enter"===i.key&&(this.#n=!0,n(i))},{signal:s}),e.addEventListener("pointerenter",()=>{this.#s.toggleComment(!1,!0)},{signal:s}),e.addEventListener("pointerleave",()=>{this.#s.toggleComment(!1,!1)},{signal:s}),e}edit(e){const t=this.commentPopupPositionInLayer;let s,n;if(t)[s,n]=t;else{[s,n]=this.#s.commentButtonPosition;const{width:c,height:d,x:u,y:f}=this.#s;s=u+s*c,n=f+n*d}const i=this.#s.parent.boundingClientRect,{x:r,y:a,width:o,height:h}=i;this.#s._uiManager.editComment(this.#s,r+s*o,a+n*h,{...e,parentDimensions:i})}finish(){this.#e&&(this.#e.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#h||""===this.#i}isEmpty(){return null===this.#i}hasBeenEdited(){return this.isDeleted()||this.#i!==this.#a}serialize(){return this.data}get data(){return{text:this.#i,richText:this.#r,date:this.#o,deleted:this.isDeleted()}}set data(e){if(e!==this.#i&&(this.#r=null),null===e)return this.#i="",void(this.#h=!0);this.#i=e,this.#o=new Date,this.#h=!1}setInitialText(e,t=null){this.#a=e,this.data=e,this.#o=null,this.#r=t}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#t?.remove(),this.#t=null,this.#i="",this.#r=null,this.#o=null,this.#s=null,this.#n=!1,this.#h=!1}}class Ee{#t;#e=!1;#n=null;#s;#a;#r;#i;#o=null;#h;#l=null;#u;#d=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:s=null,onPinchStart:n=null,onPinching:i=null,onPinchEnd:r=null,signal:a}){this.#t=e,this.#n=s,this.#s=t,this.#a=n,this.#r=i,this.#i=r,this.#u=new AbortController,this.#h=AbortSignal.any([a,this.#u.signal]),e.addEventListener("touchstart",this.#f.bind(this),{passive:!1,signal:this.#h})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Bt.pixelRatio}#f(e){if(this.#s?.())return;if(1===e.touches.length){if(this.#o)return;const n=this.#o=new AbortController,i=AbortSignal.any([this.#h,n.signal]),r=this.#t,a={capture:!0,signal:i,passive:!1},o=h=>{"touch"===h.pointerType&&(this.#o?.abort(),this.#o=null)};return r.addEventListener("pointerdown",h=>{"touch"===h.pointerType&&(ot(h),o(h))},a),r.addEventListener("pointerup",o,a),void r.addEventListener("pointercancel",o,a)}if(!this.#d){this.#d=new AbortController;const n=AbortSignal.any([this.#h,this.#d.signal]),i=this.#t,r={signal:n,capture:!1,passive:!1};i.addEventListener("touchmove",this.#m.bind(this),r);const a=this.#g.bind(this);i.addEventListener("touchend",a,r),i.addEventListener("touchcancel",a,r),r.capture=!0,i.addEventListener("pointerdown",ot,r),i.addEventListener("pointermove",ot,r),i.addEventListener("pointercancel",ot,r),i.addEventListener("pointerup",ot,r),this.#a?.()}if(ot(e),2!==e.touches.length||this.#n?.())return void(this.#l=null);let[t,s]=e.touches;t.identifier>s.identifier&&([t,s]=[s,t]),this.#l={touch0X:t.screenX,touch0Y:t.screenY,touch1X:s.screenX,touch1Y:s.screenY}}#m(e){if(!this.#l||2!==e.touches.length)return;ot(e);let[t,s]=e.touches;t.identifier>s.identifier&&([t,s]=[s,t]);const{screenX:n,screenY:i}=t,{screenX:r,screenY:a}=s,o=this.#l,{touch0X:h,touch0Y:c,touch1X:d,touch1Y:u}=o,f=d-h,p=u-c,v=Math.hypot(r-n,a-i)||1,y=Math.hypot(f,p)||1;if(!this.#e&&Math.abs(y-v)<=Ee.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=n,o.touch0Y=i,o.touch1X=r,o.touch1Y=a,!this.#e)return void(this.#e=!0);const b=[(n+r)/2,(i+a)/2];this.#r?.(b,y,v)}#g(e){e.touches.length>=2||(this.#d&&(this.#d.abort(),this.#d=null,this.#i?.()),this.#l&&(ot(e),this.#l=null,this.#e=!1))}destroy(){this.#u?.abort(),this.#u=null,this.#o?.abort(),this.#o=null}}class H{#t=null;#e=null;#n=null;#s=null;#a=null;#r=!1;#i=null;#o="";#h=null;#l=null;#u=null;#d=null;#f=null;#m="";#g=!1;#c=null;#p=!1;#v=!1;#b=!1;#y=null;#T=0;#S=0;#w=null;#R=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#A=!1;#x=H._zIndex++;static _borderLineWidth=-1;static _colorManager=new fs;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=H.prototype._resizeWithKeyboard,t=ie.TRANSLATE_SMALL,s=ie.TRANSLATE_BIG;return V(this,"_resizerKeyboardManager",new we([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,s]}],[["Escape","mac+Escape"],H.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:t,rawDims:{pageWidth:s,pageHeight:n,pageX:i,pageY:r}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,n],this.pageTranslation=[i,r];const[a,o]=this.parentDimensions;this.x=e.x/a,this.y=e.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return V(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new Ti({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}
vendor: 6,800 bytes, line 1
1static initialize(e,t){if(H._l10n??=e,H._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==H._borderLineWidth)return;const s=getComputedStyle(document.documentElement);H._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){nt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#A}set _isDraggable(e){this.#A=e,this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#x}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(this.#N(),this.#d?.remove(),this.#d=null),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,s,n){const[i,r]=this.parentDimensions;[s,n]=this.screenToPageTranslation(s,n),this.x=(e+s)/i,this.y=(t+n)/r,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[s,n]=this.parentDimensions;this.setAt(e*s,t*n,this.width*s,this.height*n),this._onTranslated()}#D([e,t],s,n){[s,n]=this.screenToPageTranslation(s,n),this.x+=s/e,this.y+=n/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#D(this.parentDimensions,e,t)}translateInPage(e,t){this.#c||=[this.x,this.y,this.width,this.height],this.#D(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#c||=[this.x,this.y,this.width,this.height];const{div:s,parentDimensions:[n,i]}=this;if(this.x+=e/n,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:r,y:a}=this;const[o,h]=this.getBaseTranslation();r+=o,a+=h;const{style:c}=s;c.left=`${(100*r).toFixed(2)}%`,c.top=`${(100*a).toFixed(2)}%`,this._onTranslating(r,a),s.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#c&&(this.#c[0]!==this.x||this.#c[1]!==this.y)}get _hasBeenResized(){return!!this.#c&&(this.#c[2]!==this.width||this.#c[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:s}=H,n=s/e,i=s/t;switch(this.rotation){case 90:return[-n,i];case 180:return[n,i];case 270:return[n,-i];default:return[-n,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[s,n]}=this;let{x:i,y:r,width:a,height:o}=this;if(a*=s,o*=n,i*=s,r*=n,this._mustFixPosition)switch(e){case 0:i=Et(i,0,s-a),r=Et(r,0,n-o);break;case 90:i=Et(i,0,s-o),r=Et(r,a,n);break;case 180:i=Et(i,a,s),r=Et(r,o,n);break;case 270:i=Et(i,o,s),r=Et(r,0,n-a)}this.x=i/=s,this.y=r/=n;const[h,c]=this.getBaseTranslation();i+=h,r+=c,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static#P(e,t,s){switch(s){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return H.#P(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return H.#P(e,t,360-this.parentRotation)}#I(e){switch(e){case 90:{const[t,s]=this.pageDimensions;return[0,-t/s,s/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,s]=this.pageDimensions;return[0,t/s,-s/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,s]}=this;return[t*e,s*e]}setDims(){const{div:{style:e},width:t,height:s}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*s).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#B(){if(this.#h)return;this.#h=document.createElement("div"),this.#h.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const s of e){const n=document.createElement("div");this.#h.append(n),n.classList.add("resizer",s),n.setAttribute("data-resizer-name",s),n.addEventListener("pointerdown",this.#M.bind(this,s),{signal:t}),n.addEventListener("contextmenu",It,{signal:t}),n.tabIndex=-1}this.div.prepend(this.#h)}#M(e,t){t.preventDefault();const{isMac:s}=ut.platform;if(0!==t.button||t.ctrlKey&&s)return;this.#n?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];const i=new AbortController,r=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#k.bind(this,e),{passive:!0,capture:!0,signal:r}),window.addEventListener("touchmove",ot,{passive:!1,signal:r}),window.addEventListener("contextmenu",It,{signal:r}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const h=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#_()};window.addEventListener("pointerup",h,{signal:r}),window.addEventListener("blur",h,{signal:r})}#F(e,t,s,n){this.width=s,this.height=n,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#_(){if(!this.#u)return;
1const{savedX:e,savedY:t,savedWidth:s,savedHeight:n}=this.#u;this.#u=null;const i=this.x,r=this.y,a=this.width,o=this.height;i===e&&r===t&&a===s&&o===n||this.addCommands({cmd:this.#F.bind(this,i,r,a,o),undo:this.#F.bind(this,e,t,s,n),mustExec:!0})}static _round(e){return Math.round(1e4*e)/1e4}#k(e,t){const[s,n]=this.parentDimensions,i=this.x,r=this.y,a=this.width,o=this.height,h=H.MIN_SIZE/s,c=H.MIN_SIZE/n,d=this.#I(this.rotation),u=(D,I)=>[d[0]*D+d[2]*I,d[1]*D+d[3]*I],f=this.#I(360-this.rotation);let g,m,v=!1,y=!1;switch(e){case"topLeft":v=!0,g=(D,I)=>[0,0],m=(D,I)=>[D,I];break;case"topMiddle":g=(D,I)=>[D/2,0],m=(D,I)=>[D/2,I];break;case"topRight":v=!0,g=(D,I)=>[D,0],m=(D,I)=>[0,I];break;case"middleRight":y=!0,g=(D,I)=>[D,I/2],m=(D,I)=>[0,I/2];break;case"bottomRight":v=!0,g=(D,I)=>[D,I],m=(D,I)=>[0,0];break;case"bottomMiddle":g=(D,I)=>[D/2,I],m=(D,I)=>[D/2,0];break;case"bottomLeft":v=!0,g=(D,I)=>[0,I],m=(D,I)=>[D,0];break;case"middleLeft":y=!0,g=(D,I)=>[0,I/2],m=(D,I)=>[D,I/2]}const b=g(a,o),E=m(a,o);let A=u(...E);const w=H._round(i+A[0]),S=H._round(r+A[1]);let R,C,T=1,x=1;if(t.fromKeyboard)({deltaX:R,deltaY:C}=t);else{const{screenX:D,screenY:I}=t,[U,z]=this.#l;[R,C]=this.screenToPageTranslation(D-U,I-z),this.#l[0]=D,this.#l[1]=I}if([R,C]=[f[0]*(D=R/s)+f[2]*(I=C/n),f[1]*D+f[3]*I],v){const D=Math.hypot(a,o);T=x=Math.max(Math.min(Math.hypot(E[0]-b[0]-R,E[1]-b[1]-C)/D,1/a,1/o),h/a,c/o)}else y?T=Et(Math.abs(E[0]-b[0]-R),h,1)/a:x=Et(Math.abs(E[1]-b[1]-C),c,1)/o;var D,I;const L=H._round(a*T),O=H._round(o*x);A=u(...m(L,O));const M=w-A[0],j=S-A[1];this.#c||=[this.x,this.y,this.width,this.height],this.width=L,this.height=O,this.x=M,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}addEditToolbar(){var e=this;return(0,N.A)(function*(){if(e._editToolbar||e.#v)return e._editToolbar;e._editToolbar=new Ae(e),e.div.append(e._editToolbar.render());const{toolbarButtons:t}=e;if(t)for(const[s,n]of t)yield e._editToolbar.addButton(s,n);return e.hasComment||e._editToolbar.addButton("comment",e.addCommentButton()),e._editToolbar.addButton("delete"),e._editToolbar})()}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(cn.initialize(H._l10n),this.#n=new cn(this),this.#t&&(this.#n.data=this.#t,this.#t=null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}setGuessedAltText(e){var t=this;return(0,N.A)(function*(){yield t.#n?.setGuessedText(e)})()}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#s?.focusButton()}addCommentButton(){return this.canAddComment?this.#s||=new je(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#a)return void(this._uiManager.isEditingMode()&&this.#a.classList.remove("hidden"));this.hasComment&&(this.#a=this.#s.renderForStandalone(),this.div.append(this.#a))}}removeStandaloneCommentButton(){this.#s.removeStandaloneCommentButton(),this.#a=null}hideStandaloneCommentButton(){this.#a?.classList.add("hidden")}get comment(){const{data:{richText:e,text:t,date:s,deleted:n}}=this.#s;return{text:t,richText:e,date:s,deleted:n,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#s||=new je(this),this.#s.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:s}){if(!t||(this.#s||=new je(this),this.#s.setInitialText(e,s),!this.annotationElementId))return;const n=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);n&&this.updateFromAnnotationLayer(n)}get hasEditedComment(){return this.#s?.hasBeenEdited()}get hasDeletedComment(){return this.#s?.isDeleted()}get hasComment(){return!!this.#s&&!this.#s.isEmpty()&&!this.#s.isDeleted()}editComment(e){var t=this;return(0,N.A)(function*(){t.#s||=new je(t),t.#s.edit(e)})()}
vendor: 4,787 bytes, line 1
1toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#s.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,n]=e.rect,[i]=this.pageDimensions,[r]=this.pageTranslation,a=r+i+1;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,n-100,a+180,n]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#s.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#r?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#j();const[t,s]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*s/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/s).toFixed(2)}%`);const[n,i]=this.getInitialTranslation();return this.translate(n,i),hn(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#R||=new Ee({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#z.bind(this),onPinching:this.#C.bind(this),onPinchEnd:this.#E.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#z(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#C(e,t,s){let i=s/t*.7+1-.7;if(1===i)return;const r=this.#I(this.rotation),a=(w,S)=>[r[0]*w+r[2]*S,r[1]*w+r[3]*S],[o,h]=this.parentDimensions,c=this.x,d=this.y,u=this.width,f=this.height,p=H.MIN_SIZE/o,g=H.MIN_SIZE/h;i=Math.max(Math.min(i,1/u,1/f),p/u,g/f);const m=H._round(u*i),v=H._round(f*i);if(m===u&&v===f)return;this.#c||=[c,d,u,f];const y=a(u/2,f/2),b=H._round(c+y[0]),E=H._round(d+y[1]),A=a(m/2,v/2);this.x=b-A[0],this.y=E-A[1],this.width=m,this.height=v,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#E(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#_()}pointerdown(e){const{isMac:t}=ut.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#g=!0,this._isDraggable?this.#U(e):this.#L(e))}#L(e){const{isMac:t}=ut.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#U(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let s=!1;const n=new AbortController,i=this._uiManager.combinedSignal(n),r={capture:!0,passive:!1,signal:i},a=h=>{n.abort(),this.#i=null,this.#g=!1,this._uiManager.endDragSession()||this.#L(h),s&&this._onStopDragging()};t&&(this.#T=e.clientX,this.#S=e.clientY,this.#i=e.pointerId,this.#o=e.pointerType,window.addEventListener("pointermove",h=>{s||(s=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=h;if(u!==this.#i)return void ot(h);const[f,p]=this.screenToPageTranslation(c-this.#T,d-this.#S);this.#T=c,this.#S=d,this._uiManager.dragSelectedEditors(f,p)},r),window.addEventListener("touchmove",ot,r),window.addEventListener("pointerdown",h=>{h.pointerType===this.#o&&(this.#R||h.isPrimary)&&a(h),ot(h)},r));const o=h=>{this.#i&&this.#i!==h.pointerId?ot(h):a(h)};window.addEventListener("pointerup",o,{signal:i}),window.addEventListener("blur",o,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,s){e.changeParent(this),this.x=t,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,s=this.rotation){const n=this.parentScale,[i,r]=this.pageDimensions,[a,o]=this.pageTranslation,h=e/n,c=t/n,d=this.x*i,u=this.y*r,f=this.width*i,p=this.height*r;switch(s){case 0:return[d+h+a,r-u-c-p+o,d+h+f+a,r-u-c+o];case 90:return[d+c+a,r-u+h+o,d+c+p+a,r-u+h+f+o];case 180:return[d-h-f+a,r-u+c+o,d-h+a,r-u+c+p+o];case 270:return[d-c-p+a,r-u-h-f+o,d-c+a,r-u-h+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[s,n,i,r]=e,a=i-s,o=r-n;switch(this.rotation){case 0:return[s,t-r,a,o];case 90:return[s,t-n,o,a];case 180:return[i,t-n,a,o];case 270:return[i,t-r,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&H._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#s?.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:s,opacity:n,deleted:i,richText:r},uid:a,pageIndex:o,creationDate:h,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:r,contentsObj:{str:e}
vendor: 7,071 bytes, line 1
1,creationDate:h,modificationDate:s||c,popupRef:!i,color:t,opacity:n}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#v=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#v=!1,!0)}isInEditMode(){return this.#v}shouldGetKeyboardEvents(){return this.#b}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:s,right:n}=this.getClientDimensions(),{innerHeight:i,innerWidth:r}=window;return t<r&&n>0&&e<i&&s>0}#j(){if(this.#f||!this.div)return;this.#f=new AbortController;const e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#j()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static deserialize(e,t,s){var n=this;return(0,N.A)(function*(){const i=new n.prototype.constructor({parent:t,id:t.getNextId(),uiManager:s,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,i.#t=e.accessibilityData,i._isCopy=e.isCopy||!1;const[r,a]=i.pageDimensions,[o,h,c,d]=i.getRectInCurrentCoords(e.rect,a);return i.x=o/r,i.y=h/a,i.width=c/r,i.height=d/a,i})()}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#N(),this.removeEditToolbar(),this.#w){for(const e of this.#w.values())clearTimeout(e);this.#w=null}this.parent=null,this.#R?.destroy(),this.#R=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#B(),this.#h.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,t]}=this,[s,n,i,r]=this.getPDFRect();return[H._round(s+(i-s)*e),H._round(n+(r-n)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#s.commentPopupPositionInLayer}set commentPopupPosition(e){this.#s.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#s.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#s.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#s?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#h.children;if(!this.#e){this.#e=Array.from(t);const r=this.#X.bind(this),a=this.#W.bind(this),o=this._uiManager._signal;for(const h of this.#e){const c=h.getAttribute("data-resizer-name");h.setAttribute("role","spinbutton"),h.addEventListener("keydown",r,{signal:o}),h.addEventListener("blur",a,{signal:o}),h.addEventListener("focus",this.#Y.bind(this,c),{signal:o}),h.setAttribute("data-l10n-id",H._l10nResizer[c])}}const s=this.#e[0];let n=0;for(const r of t){if(r===s)break;n++}const i=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(i!==n){if(i<n)for(let a=0;a<n-i;a++)this.#h.append(this.#h.firstElementChild);else if(i>n)for(let a=0;a<i-n;a++)this.#h.firstElementChild.before(this.#h.lastElementChild);let r=0;for(const a of t){const h=this.#e[r++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",H._l10nResizer[h])}}this.#$(0),this.#b=!0,this.#h.firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#X(e){H._resizerKeyboardManager.exec(this,e)}#W(e){this.#b&&e.relatedTarget?.parentNode!==this.#h&&this.#N()}#Y(e){this.#m=this.#b?e:""}#$(e){if(this.#e)for(const t of this.#e)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#b&&this.#k(this.#m,{deltaX:e,deltaY:t,fromKeyboard:!0})}#N(){this.#b=!1,this.#$(-1),this.#_()}_stopResizingWithKeyboard(){this.#N(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#h?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){"BUTTON"!==e.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#p}set isEditing(e){this.#p=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#w||=new Map;const{action:s}=e;let n=this.#w.get(s);return n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),this.#w.delete(s),0===this.#w.size&&(this.#w=null)},H._telemetryTimeout),void this.#w.set(s,n)}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#r=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#r=!0}updateFakeAnnotationElement(e){if(this.#d||this.deleted)return this.deleted?(this.#d.remove(),void(this.#d=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#d=e.addFakeAnnotation(this)}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");
vendor: 4,211 bytes, line 1
1if(t){if("CANVAS"===t.nodeName){const s=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),s.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstElementChild:t}=e.container;"DIV"===t?.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}class Ti extends H{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const dn=3285377520,Lt=4294901760,Ut=65535;class un{constructor(e){this.h1=e?4294967295&e:dn,this.h2=e?4294967295&e:dn}update(e){let t,s;if("string"==typeof e){t=new Uint8Array(2*e.length),s=0;for(let g=0,m=e.length;g<m;g++){const v=e.charCodeAt(g);v<=255?t[s++]=v:(t[s++]=v>>>8,t[s++]=255&v)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),s=t.byteLength}const n=s>>2,i=s-4*n,r=new Uint32Array(t.buffer,0,n);let a=0,o=0,h=this.h1,c=this.h2;const d=3432918353,u=461845907,f=d&Ut,p=u&Ut;for(let g=0;g<n;g++)1&g?(a=r[g],a=a*d&Lt|a*f&Ut,a=a<<15|a>>>17,a=a*u&Lt|a*p&Ut,h^=a,h=h<<13|h>>>19,h=5*h+3864292196):(o=r[g],o=o*d&Lt|o*f&Ut,o=o<<15|o>>>17,o=o*u&Lt|o*p&Ut,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(a=0,i){case 3:a^=t[4*n+2]<<16;case 2:a^=t[4*n+1]<<8;case 1:a^=t[4*n],a=a*d&Lt|a*f&Ut,a=a<<15|a>>>17,a=a*u&Lt|a*p&Ut,1&n?h^=a:c^=a}this.h1=h,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&Lt|36045*e&Ut,t=4283543511*t&Lt|(2950163797*(t<<16|e>>>16)&Lt)>>>16,e^=t>>>1,e=444984403*e&Lt|60499*e&Ut,t=3301882366*t&Lt|(3120437893*(t<<16|e>>>16)&Lt)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const ps=Object.freeze({map:null,hash:"",transfer:void 0});class gs{#t=!1;#e=null;#n=null;#s=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const s=this.#s.get(e);return void 0===s?t:Object.assign(t,s)}getRawValue(e){return this.#s.get(e)}remove(e){const t=this.#s.get(e);if(void 0!==t&&(t instanceof H&&this.#n.delete(t.annotationElementId),this.#s.delete(e),0===this.#s.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor)){for(const s of this.#s.values())if(s instanceof H)return;this.onAnnotationEditor(null)}}setValue(e,t){const s=this.#s.get(e);let n=!1;if(void 0!==s)for(const[i,r]of Object.entries(t))s[i]!==r&&(n=!0,s[i]=r);else n=!0,this.#s.set(e,t);n&&this.#a(),t instanceof H&&((this.#n||=new Map).set(t.annotationElementId,t),"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type))}has(e){return this.#s.has(e)}get size(){return this.#s.size}#a(){this.#t||(this.#t=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new fn(this)}get serializable(){if(0===this.#s.size)return ps;const e=new Map,t=new un,s=[],n=Object.create(null);let i=!1;for(const[r,a]of this.#s){const o=a instanceof H?a.serialize(!1,n):a;o&&(e.set(r,o),t.update(`${r}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(const r of e.values())r.bitmap&&s.push(r.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:s}:ps}get editorStats(){let e=null;const t=new Map;let s=0,n=0;for(const i of this.#s.values()){if(!(i instanceof H)){i.popup&&(i.popup.deleted?n+=1:s+=1);continue}i.isCommentDeleted?n+=1:i.hasEditedComment&&(s+=1);const r=i.telemetryFinalData;if(!r)continue;const{type:a}=r;t.has(a)||t.set(a,Object.getPrototypeOf(i).constructor),e||=Object.create(null);const o=e[a]||=new Map;for(const[h,c]of Object.entries(r)){if("type"===h)continue;let d=o.get(h);d||(d=new Map,o.set(h,d));const u=d.get(c)??0;d.set(c,u+1)}}if((n>0||s>0)&&(e||=Object.create(null),e.comments={deleted:n,edited:s}),!e)return null;for(const[i,r]of t)e[i]=r.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){this.#e=null}updateEditor(e,t){const s=this.#n?.get(e);return!!s&&(s.updateFromAnnotationLayer(t),!0)}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#e)return this.#e;
1const e=[];if(this.#n)for(const t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);return this.#e={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#s.entries()}}class fn extends gs{#t;constructor(e){super();const{map:t,hash:s,transfer:n}=e.serializable,i=structuredClone(t,n?{transfer:n}:null);this.#t={map:i,hash:s,transfer:n}}get print(){nt("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return V(this,"modifiedIds",{ids:new Set,hash:""})}}class Ci{#t=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(e){var t=this;return(0,N.A)(function*({systemFontInfo:s,disableFontFace:n,_inspectFont:i}){if(s&&!t.#t.has(s.loadedName)){if(Z(!n,"loadSystemFont shouldn't be called when `disableFontFace` is set."),t.isFontLoadingAPISupported){const{loadedName:r,src:a,style:o}=s,h=new FontFace(r,a,o);t.addNativeFontFace(h);try{yield h.load(),t.#t.add(r),i?.(s)}catch{G(`Cannot load system font: ${s.baseFontName}, installing it could help to improve PDF rendering.`),t.removeNativeFontFace(h)}return}nt("Not implemented: loadSystemFont without the Font Loading API.")}}).apply(this,arguments)}bind(e){var t=this;return(0,N.A)(function*(){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void(yield t.loadSystemFont(e));if(t.isFontLoadingAPISupported){const n=e.createNativeFontFace();if(n){t.addNativeFontFace(n);try{yield n.loaded}catch(i){throw G(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}const s=e.createFontFaceRule();if(s){if(t.insertRule(s),t.isSyncFontLoadingSupported)return;yield new Promise(n=>{const i=t._queueLoadingCallback(n);t._prepareFontLoadEvent(e,i)})}})()}get isFontLoadingAPISupported(){return V(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return V(this,"isSyncFontLoadingSupported",St||ut.platform.isFirefox)}_queueLoadingCallback(e){const{loadingRequests:s}=this,n={done:!1,complete:function t(){for(Z(!n.done,"completeRequest() cannot be called twice."),n.done=!0;s.length>0&&s[0].done;){const i=s.shift();setTimeout(i.callback,0)}},callback:e};return s.push(n),n}get _loadTestFont(){return V(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}
1_prepareFontLoadEvent(e,t){function s(E,A){return E.charCodeAt(A)<<24|E.charCodeAt(A+1)<<16|E.charCodeAt(A+2)<<8|255&E.charCodeAt(A+3)}function n(E,A,w,S){return E.substring(0,A)+S+E.substring(A+w)}let i,r;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let h=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=n(u,976,d.length,d);const g=1482184792;let m=s(u,16);for(i=0,r=d.length-3;i<r;i+=4)m=m-g+s(d,i)|0;i<d.length&&(m=m-g+s(d+"XXX",i)|0),u=n(u,16,4,function ui(l){return String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,255&l)}(m));const v=`url(data:font/opentype;base64,${btoa(u)});`;this.insertRule(`@font-face {font-family:"${d}";src:${v}}`);const b=this._document.createElement("div");b.style.visibility="hidden",b.style.width=b.style.height="10px",b.style.position="absolute",b.style.top=b.style.left="0px";for(const E of[e.loadedName,d]){const A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=E,b.append(A)}this._document.body.append(b),function c(E,A){if(++h>30)return G("Load test font never loaded."),void A();o.font="30px "+E,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?A():setTimeout(c.bind(null,E,A))}(d,()=>{b.remove(),t.complete()})}}class Ri{#t;constructor(e,t=null,s,n){this.compiledGlyphs=Object.create(null),this.#t=e,this._inspectFont=t,s&&Object.assign(this,s),n&&(this.charProcOperatorList=n)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${Ks(this.data)});`;let t;if(this.cssFontInfo){let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];const s=this.loadedName+"_path_"+t;let n;try{n=e.get(s)}catch(r){G(`getPathGenerator - ignoring character: "${r}".`)}const i=ln(n?.path);return this.fontExtraProperties||e.delete(s),this.compiledGlyphs[t]=i}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace??!1}set disableFontFace(e){V(this,"disableFontFace",!!e)}get fontExtraProperties(){return this.#t.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get ascent(){return this.#t.ascent}get defaultWidth(){return this.#t.defaultWidth}get descent(){return this.#t.descent}get bbox(){return this.#t.bbox}set bbox(e){V(this,"bbox",e)}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.#t.mimetype}get name(){return this.#t.name}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}get defaultVMetrics(){return this.#t.defaultVMetrics}}let pn=(()=>{class l{#t;#e;#n;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const s=new TextEncoder,n={};let i=0;for(const c of l.strings){const d=s.encode(t[c]);n[c]=d,i+=4+d.length}const r=new ArrayBuffer(i),a=new Uint8Array(r),o=new DataView(r);let h=0;for(const c of l.strings){const d=n[c],u=d.length;o.setUint32(h,u),a.set(d,h+4),h+=4+u}return Z(h===r.byteLength,"CssFontInfo.write: Buffer overflow"),r}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#n=new TextDecoder}#s(t){Z(t<l.strings.length,"Invalid string index");let s=0;for(let i=0;i<t;i++)s+=this.#e.getUint32(s)+4;const n=this.#e.getUint32(s);return this.#n.decode(new Uint8Array(this.#t,s+4,n))}get fontFamily(){return this.#s(0)}get fontWeight(){return this.#s(1)}get italicAngle(){return this.#s(2)}}return l})(),gn=(()=>{class l{#t;#e;#n;static strings=["css","loadedName","baseFontName","src"];static write(t){const s=new TextEncoder,n={};let i=0;for(const f of l.strings){const p=s.encode(t[f]);n[f]=p,i+=4+p.length}i+=4;let r,a,o=1+i;t.style&&(r=s.encode(t.style.style),a=s.encode(t.style.weight),o+=4+r.length+4+a.length);
vendor: 4,151 bytes, line 1
1const h=new ArrayBuffer(o),c=new Uint8Array(h),d=new DataView(h);let u=0;d.setUint8(u++,t.guessFallback?1:0),d.setUint32(u,0),u+=4,i=0;for(const f of l.strings){const p=n[f],g=p.length;i+=4+g,d.setUint32(u,g),c.set(p,u+4),u+=4+g}return d.setUint32(u-i-4,i),t.style&&(d.setUint32(u,r.length),c.set(r,u+4),u+=4+r.length,d.setUint32(u,a.length),c.set(a,u+4),u+=4+a.length),Z(u<=h.byteLength,"SubstitionInfo.write: Buffer overflow"),h.transferToFixedLength(u)}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#n=new TextDecoder}get guessFallback(){return 0!==this.#e.getUint8(0)}#s(t){Z(t<l.strings.length,"Invalid string index");let s=5;for(let i=0;i<t;i++)s+=this.#e.getUint32(s)+4;const n=this.#e.getUint32(s);return this.#n.decode(new Uint8Array(this.#t,s+4,n))}get css(){return this.#s(0)}get loadedName(){return this.#s(1)}get baseFontName(){return this.#s(2)}get src(){return this.#s(3)}get style(){let t=1;t+=4+this.#e.getUint32(t);const s=this.#e.getUint32(t),n=this.#n.decode(new Uint8Array(this.#t,t+4,s));t+=4+s;const i=this.#e.getUint32(t);return{style:n,weight:this.#n.decode(new Uint8Array(this.#t,t+4,i))}}}return l})(),Pi=(()=>{class l{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#t=Math.ceil(2*this.bools.length/8);static#e=this.#t+8*this.numbers.length;static#n=this.#e+1+8;static#s=this.#n+1+48;static#a=this.#s+1+6;#r;#i;#o;constructor({data:t,extra:s}){this.#r=t,this.#i=new TextDecoder,this.#o=new DataView(this.#r),s&&Object.assign(this,s)}#h(t){Z(t<l.bools.length,"Invalid boolean index");const s=Math.floor(t/4),n=2*t%8,i=this.#o.getUint8(s)>>n&3;return 0===i?void 0:2===i}get black(){return this.#h(0)}get bold(){return this.#h(1)}get disableFontFace(){return this.#h(2)}get fontExtraProperties(){return this.#h(3)}get isInvalidPDFjsFont(){return this.#h(4)}get isType3Font(){return this.#h(5)}get italic(){return this.#h(6)}get missingFile(){return this.#h(7)}get remeasure(){return this.#h(8)}get vertical(){return this.#h(9)}#l(t){return Z(t<l.numbers.length,"Invalid number index"),this.#o.getFloat64(l.#t+8*t)}get ascent(){return this.#l(0)}get defaultWidth(){return this.#l(1)}get descent(){return this.#l(2)}get bbox(){let t=l.#e;if(0===this.#o.getUint8(t))return;t+=1;const n=[];for(let i=0;i<4;i++)n.push(this.#o.getInt16(t,!0)),t+=2;return n}get fontMatrix(){let t=l.#n;if(0===this.#o.getUint8(t))return;t+=1;const n=[];for(let i=0;i<6;i++)n.push(this.#o.getFloat64(t,!0)),t+=8;return n}get defaultVMetrics(){let t=l.#s;if(0===this.#o.getUint8(t))return;t+=1;const n=[];for(let i=0;i<3;i++)n.push(this.#o.getInt16(t,!0)),t+=2;return n}#u(t){Z(t<l.strings.length,"Invalid string index");let s=l.#a+4;for(let r=0;r<t;r++)s+=this.#o.getUint32(s)+4;const n=this.#o.getUint32(s),i=new Uint8Array(n);return i.set(new Uint8Array(this.#r,s+4,n)),this.#i.decode(i)}get fallbackName(){return this.#u(0)}get loadedName(){return this.#u(1)}get mimetype(){return this.#u(2)}get name(){return this.#u(3)}get data(){let t=l.#a;t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t);const r=this.#o.getUint32(t);if(0!==r)return new Uint8Array(this.#r,t+4,r)}clearData(){let t=l.#a;t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t);const r=this.#o.getUint32(t);new Uint8Array(this.#r,t+4,r).fill(0),this.#o.setUint32(t,0)}get cssFontInfo(){let t=l.#a;t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t);const i=this.#o.getUint32(t);if(0===i)return null;const r=new Uint8Array(i);return r.set(new Uint8Array(this.#r,t+4,i)),new pn(r.buffer)}get systemFontInfo(){let t=l.#a;t+=4+this.#o.getUint32(t);const n=this.#o.getUint32(t);if(0===n)return null;const i=new Uint8Array(n);return i.set(new Uint8Array(this.#r,t+4,n)),new gn(i.buffer)}static write(t){const s=t.systemFontInfo?gn.write(t.systemFontInfo):null,n=t.cssFontInfo?pn.write(t.cssFontInfo):null,i=new TextEncoder,r={};let a=0;for(const m of l.strings)r[m]=i.encode(t[m]),a+=4+r[m].length;
1const o=l.#a+4+a+4+(s?s.byteLength:0)+4+(n?n.byteLength:0)+4+(t.data?t.data.length:0),h=new ArrayBuffer(o),c=new Uint8Array(h),d=new DataView(h);let u=0;const f=l.bools.length;let p=0,g=0;for(let m=0;m<f;m++){const v=t[l.bools[m]];p|=(void 0===v?0:v?2:1)<<g,g+=2,(8===g||m===f-1)&&(d.setUint8(u++,p),p=0,g=0)}Z(u===l.#t,"FontInfo.write: Boolean properties offset mismatch");for(const m of l.numbers)d.setFloat64(u,t[m]),u+=8;if(Z(u===l.#e,"FontInfo.write: Number properties offset mismatch"),t.bbox){d.setUint8(u++,4);for(const m of t.bbox)d.setInt16(u,m,!0),u+=2}else d.setUint8(u++,0),u+=8;if(Z(u===l.#n,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){d.setUint8(u++,6);for(const m of t.fontMatrix)d.setFloat64(u,m,!0),u+=8}else d.setUint8(u++,0),u+=48;if(Z(u===l.#s,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){d.setUint8(u++,1);for(const m of t.defaultVMetrics)d.setInt16(u,m,!0),u+=2}else d.setUint8(u++,0),u+=6;Z(u===l.#a,"FontInfo.write: DefaultVMetrics properties offset mismatch"),d.setUint32(l.#a,0),u+=4;for(const m of l.strings){const v=r[m],y=v.length;d.setUint32(u,y),c.set(v,u+4),u+=4+y}if(d.setUint32(l.#a,u-l.#a-4),s){const m=s.byteLength;d.setUint32(u,m),Z(u+4+m<=h.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(s),u+4),u+=4+m}else d.setUint32(u,0),u+=4;if(n){const m=n.byteLength;d.setUint32(u,m),Z(u+4+m<=h.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),u+4),u+=4+m}else d.setUint32(u,0),u+=4;return void 0===t.data?(d.setUint32(u,0),u+=4):(d.setUint32(u,t.data.length),c.set(t.data,u+4),u+=4+t.data.length),Z(u<=h.byteLength,"FontInfo.write: Buffer overflow"),h.transferToFixedLength(u)}}return l})();class gt{static#t=0;static#e=1;static#n=2;static#s=3;static#a=4;static#r=8;static#i=12;static#o=16;constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let t,s=null,n=[],i=[],r=[],a=[],o=null,h=null;switch(e[0]){case"RadialAxial":t="axial"===e[1]?1:2,s=e[2],r=e[3],1===t?n.push(...e[4],...e[5]):n.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":t=3,o=e[1],n=e[2],i=e[3],a=e[4]||[],s=e[6],h=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const c=Math.floor(n.length/2),d=Math.floor(i.length/3),u=r.length,f=a.length;let p=0;for(const A of a)p+=1,p=4*Math.ceil(p/4),p+=4+4*A.coords.length,p+=4+4*A.colors.length,void 0!==A.verticesPerRow&&(p+=4);const m=new ArrayBuffer(20+8*c+3*d+8*u+(s?16:0)+(h?3:0)+p),v=new DataView(m),y=new Uint8Array(m);v.setUint8(gt.#t,t),v.setUint8(gt.#e,s?1:0),v.setUint8(gt.#n,h?1:0),v.setUint8(gt.#s,o),v.setUint32(gt.#a,c,!0),v.setUint32(gt.#r,d,!0),v.setUint32(gt.#i,u,!0),v.setUint32(gt.#o,f,!0);let b=20;new Float32Array(m,b,2*c).set(n),b+=8*c,y.set(i,b),b+=3*d;for(const[A,w]of r)v.setFloat32(b,A,!0),b+=4,v.setUint32(b,parseInt(w.slice(1),16),!0),b+=4;if(s)for(const A of s)v.setFloat32(b,A,!0),b+=4;h&&(y.set(h,b),b+=3);for(let A=0;A<a.length;A++){const w=a[A];v.setUint8(b,w.type),b+=1,b=4*Math.ceil(b/4),v.setUint32(b,w.coords.length,!0),b+=4,new Int32Array(m,b,w.coords.length).set(w.coords),b+=4*w.coords.length,v.setUint32(b,w.colors.length,!0),b+=4,new Int32Array(m,b,w.colors.length).set(w.colors),b+=4*w.colors.length,void 0!==w.verticesPerRow&&(v.setUint32(b,w.verticesPerRow,!0),b+=4)}return m}getIR(){const e=this.view,t=this.data[gt.#t],s=!!this.data[gt.#e],n=!!this.data[gt.#n],i=e.getUint32(gt.#a,!0),r=e.getUint32(gt.#r,!0),a=e.getUint32(gt.#i,!0),o=e.getUint32(gt.#o,!0);let h=20;const c=new Float32Array(this.buffer,h,2*i);h+=8*i;const d=new Uint8Array(this.buffer,h,3*r);h+=3*r;const u=[];for(let m=0;m<a;++m){const v=e.getFloat32(h,!0);h+=4;const y=e.getUint32(h,!0);h+=4,u.push([v,`#${y.toString(16).padStart(6,"0")}`])}let f=null;if(s){f=[];for(let m=0;m<4;++m)f.push(e.getFloat32(h,!0)),h+=4}let p=null;n&&(p=new Uint8Array(this.buffer,h,3),h+=3);const g=[];for(let m=0;m<o;++m){const v=e.getUint8(h);h+=1,h=4*Math.ceil(h/4);const y=e.getUint32(h,!0);h+=4;const b=new Int32Array(this.buffer,h,y);h+=4*y;const E=e.getUint32(h,!0);h+=4;const A=new Int32Array(this.buffer,h,E);h+=4*E;const w={type:v,coords:b,colors:A};2===v&&(w.verticesPerRow=e.getUint32(h,!0),h+=4),g.push(w)}if(1===t)return["RadialAxial","axial",f,u,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(2===t)return["RadialAxial","radial",f,u,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(3===t){const m=this.data[gt.#s];let v=null;if(c.length>0){let y=c[0],b=c[0],E=c[1],A=c[1];for(let w=0;w<c.length;w+=2){const S=c[w],T=c[w+1];y=y>S?S:y,E=E>T?T:E,b=b<S?S:b,A=A<T?T:A}v=[y,E,b,A]}return["Mesh",m,c,d,g,v,f,p]}throw new Error(`Unsupported pattern kind: ${t}`)}}class Ii{static write(e){let t,s;return ut.isFloat16ArraySupported?(s=new ArrayBuffer(2*e.length),t=new Float16Array(s)):(s=new ArrayBuffer(4*e.length),t=new Float32Array(s)),t.set(e),s}#t;
vendor: 9,986 bytes, line 1
1constructor(e){this.#t=e}get path(){return ut.isFloat16ArraySupported?new Float16Array(this.#t):new Float32Array(this.#t)}}function $e(l){if("string"!=typeof l)return null;if(l.endsWith("/"))return l;throw new Error(`Invalid factory url: "${l}" must include trailing slash.`)}const ms=l=>"object"==typeof l&&Number.isInteger(l?.num)&&l.num>=0&&Number.isInteger(l?.gen)&&l.gen>=0,mn=function vi(l,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[s,n,...i]=t;if(!l(s)&&!Number.isInteger(s)||!e(n))return!1;const r=i.length;let a=!0;switch(n.name){case"XYZ":if(r<2||r>3)return!1;break;case"Fit":case"FitB":return 0===r;case"FitH":case"FitBH":case"FitV":case"FitBV":if(r>1)return!1;break;case"FitR":if(4!==r)return!1;a=!1;break;default:return!1}for(const o of i)if(!("number"==typeof o||a&&null===o))return!1;return!0}.bind(null,ms,l=>"object"==typeof l&&"string"==typeof l?.name);class Li{#t=new Map;#e=Promise.resolve();postMessage(e,t){const s={data:structuredClone(e,t?{transfer:t}:null)};this.#e.then(()=>{for(const[n]of this.#t)n.call(this,s)})}addEventListener(e,t,s=null){let n=null;if(s?.signal instanceof AbortSignal){const{signal:i}=s;if(i.aborted)return void G("LoopbackPort - cannot use an `aborted` signal.");const r=()=>this.removeEventListener(e,t);n=()=>i.removeEventListener("abort",r),i.addEventListener("abort",r)}this.#t.set(t,n)}removeEventListener(e,t){this.#t.get(t)?.(),this.#t.delete(t)}terminate(){for(const[,e]of this.#t)e?.();this.#t.clear()}}function vn(){}function Tt(l){if(l instanceof $t||l instanceof ke||l instanceof Vs||l instanceof ge||l instanceof rs)return l;switch(l instanceof Error||"object"==typeof l&&null!==l||nt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),l.name){case"AbortException":return new $t(l.message);case"InvalidPDFException":return new ke(l.message);case"PasswordException":return new Vs(l.message,l.code);case"ResponseException":return new ge(l.message,l.status,l.missing);case"UnknownErrorException":return new rs(l.message,l.details)}return new rs(l.message,l.toString())}class Se{#t=new AbortController;constructor(e,t,s){this.sourceName=e,this.targetName=t,this.comObj=s,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),s.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#s(e);if(e.callback){const s=e.callbackId,n=this.callbackCapabilities[s];if(!n)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],1===e.callback)n.resolve(e.data);else{if(2!==e.callback)throw new Error("Unexpected callback case");n.reject(Tt(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const s=this.sourceName,n=e.sourceName,i=this.comObj;return void Promise.try(t,e.data).then(function(r){i.postMessage({sourceName:s,targetName:n,callback:1,callbackId:e.callbackId,data:r})},function(r){i.postMessage({sourceName:s,targetName:n,callback:2,callbackId:e.callbackId,reason:Tt(r)})})}e.streamId?this.#n(e):t(e.data)}on(e,t){const s=this.actionHandler;if(s[e])throw new Error(`There is already an actionName called "${e}"`);s[e]=t}send(e,t,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},s)}sendWithPromise(e,t,s){const n=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},s)}catch(r){i.reject(r)}return i.promise}sendWithStream(e,t,s,n){const i=this.streamId++,r=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[i]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:r,targetName:a,action:e,streamId:i,data:t,desiredSize:h.desiredSize},n),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[i].pullCall=c,o.postMessage({sourceName:r,targetName:a,stream:6,streamId:i,desiredSize:h.desiredSize}),c.promise},cancel:h=>{Z(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[i].cancelCall=c,this.streamControllers[i].isClosed=!0,o.postMessage({sourceName:r,targetName:a,stream:1,streamId:i,reason:Tt(h)}),c.promise}},s)}#n(e){const t=e.streamId,s=this.sourceName,n=e.sourceName,i=this.comObj,r=this,a=this.actionHandler[e.action],o={enqueue(h,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:s,targetName:n,stream:4,streamId:t,chunk:h},d)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:s,targetName:n,stream:3,streamId:t}),delete r.streamSinks[t])},error(h){Z(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:s,targetName:n,stream:5,streamId:t,reason:Tt(h)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[t]=o,Promise.try(a,e.data,o).then(function(){i.postMessage({sourceName:s,targetName:n,stream:8,streamId:t,success:!0})},function(h){i.postMessage({sourceName:s,targetName:n,stream:8,streamId:t,reason:Tt(h)})})}#s(e){const t=e.streamId,s=this.sourceName,n=e.sourceName,i=this.comObj,r=this.streamControllers[t],a=this.streamSinks[t];switch(e.stream){case 8:e.success?r.startCall.resolve():r.startCall.reject(Tt(e.reason));break;case 7:e.success?r.pullCall.resolve():r.pullCall.reject(Tt(e.reason));break;case 6:if(!a){i.postMessage({sourceName:s,targetName:n,stream:7,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,Promise.try(a.onPull||vn).then(function(){i.postMessage({sourceName:s,targetName:n,stream:7,streamId:t,success:!0})},function(h){i.postMessage({sourceName:s,targetName:n,stream:7,streamId:t,reason:Tt(h)})});break;case 4:if(Z(r,"enqueue should have stream controller"),r.isClosed)break;r.controller.enqueue(e.chunk);break;case 3:if(Z(r,"close should have stream controller"),r.isClosed)break;r.isClosed=!0,r.controller.close(),this.#a(r,t);break;case 5:Z(r,"error should have stream controller"),r.controller.error(Tt(e.reason)),this.#a(r,t);break;case 2:e.success?r.cancelCall.resolve():r.cancelCall.reject(Tt(e.reason)),this.#a(r,t);break;case 1:if(!a)break;const o=Tt(e.reason);Promise.try(a.onCancel||vn,o).then(function(){i.postMessage({sourceName:s,targetName:n,stream:2,streamId:t,success:!0})},function(h){i.postMessage({sourceName:s,targetName:n,stream:2,streamId:t,reason:Tt(h)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}#a(e,t){var s=this;return(0,N.A)(function*(){yield Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete s.streamControllers[t]})()}destroy(){this.#t?.abort(),this.#t=null}}class yn{#t=!1;constructor({enableHWA:e=!1}){this.#t=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(e,t);return{canvas:s,context:s.getContext("2d",{willReadFrequently:!this.#t})}}reset(e,t,s){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||s<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=s}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){nt("Abstract method `_createCanvas` called.")}}class Fi extends yn{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const s=this._document.createElement("canvas");return s.width=e,s.height=t,s}}class bn{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}fetch(e){var t=this;return(0,N.A)(function*({name:s}){if(!t.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!s)throw new Error("CMap name must be specified.");const n=t.baseUrl+s+(t.isCompressed?".bcmap":"");return t._fetch(n).then(i=>({cMapData:i,isCompressed:t.isCompressed})).catch(i=>{throw new Error(`Unable to load ${t.isCompressed?"binary ":""}CMap at: ${n}`)})}).apply(this,arguments)}_fetch(e){return(0,N.A)(function*(){nt("Abstract method `_fetch` called.")})()}}class An extends bn{_fetch(e){var t=this;return(0,N.A)(function*(){const s=yield se(e,t.isCompressed?"arraybuffer":"text");return s instanceof ArrayBuffer?new Uint8Array(s):te(s)})()}}Y(2489);class wn{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,s,n,i){return"none"}destroy(e=!1){}}class ki extends wn{#t;#e;#n;#s;#a;#r;#i=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#s=e,this.#a=t}get#o(){return this.#e||=new Map}get#h(){return this.#r||=new Map}get#l(){if(!this.#n){const e=this.#a.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const s=this.#a.createElementNS(Gt,"svg");s.setAttribute("width",0),s.setAttribute("height",0),this.#n=this.#a.createElementNS(Gt,"defs"),e.append(s),s.append(this.#n),this.#a.body.append(e)}return this.#n}#u(e){if(1===e.length){const o=e[0],h=new Array(256);for(let d=0;d<256;d++)h[d]=o[d]/255;const c=h.join(",");return[c,c,c]}const[t,s,n]=e,i=new Array(256),r=new Array(256),a=new Array(256);for(let o=0;o<256;
vendor: 4,450 bytes, line 1
1o++)i[o]=t[o]/255,r[o]=s[o]/255,a[o]=n[o]/255;return[i.join(","),r.join(","),a.join(",")]}#d(e){if(void 0===this.#t){this.#t="";const t=this.#a.URL;t!==this.#a.baseURI&&(ye(t)?G('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=is(t,""))}return`url(${this.#t}#${e})`}addFilter(e){if(!e)return"none";let t=this.#o.get(e);if(t)return t;const[s,n,i]=this.#u(e),r=1===e.length?s:`${s}${n}${i}`;if(t=this.#o.get(r),t)return this.#o.set(e,t),t;const a=`g_${this.#s}_transfer_map_${this.#i++}`,o=this.#d(a);this.#o.set(e,o),this.#o.set(r,o);const h=this.#g(a);return this.#p(s,n,i,h),o}addHCMFilter(e,t){const s=`${e}-${t}`,n="base";let i=this.#h.get(n);if(i?.key===s||(i?(i.filter?.remove(),i.key=s,i.url="none",i.filter=null):(i={key:s,url:"none",filter:null},this.#h.set(n,i)),!e||!t))return i.url;const r=this.#b(e);e=B.makeHexColor(...r);const a=this.#b(t);if(t=B.makeHexColor(...a),this.#l.style.color="","#000000"===e&&"#ffffff"===t||e===t)return i.url;const o=new Array(256);for(let f=0;f<=255;f++){const p=f/255;o[f]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const h=o.join(","),c=`g_${this.#s}_hcm_filter`,d=i.filter=this.#g(c);this.#p(h,h,h,d),this.#m(d);const u=(f,p)=>{const g=r[f]/255,m=a[f]/255,v=new Array(p+1);for(let y=0;y<=p;y++)v[y]=g+y/p*(m-g);return v.join(",")};return this.#p(u(0,5),u(1,5),u(2,5),d),i.url=this.#d(c),i.url}addAlphaFilter(e){let t=this.#o.get(e);if(t)return t;const[s]=this.#u([e]),n=`alpha_${s}`;if(t=this.#o.get(n),t)return this.#o.set(e,t),t;const i=`g_${this.#s}_alpha_map_${this.#i++}`,r=this.#d(i);this.#o.set(e,r),this.#o.set(n,r);const a=this.#g(i);return this.#v(s,a),r}addLuminosityFilter(e){let s,n,t=this.#o.get(e||"luminosity");if(t)return t;if(e?([s]=this.#u([e]),n=`luminosity_${s}`):n="luminosity",t=this.#o.get(n),t)return this.#o.set(e,t),t;const i=`g_${this.#s}_luminosity_map_${this.#i++}`,r=this.#d(i);this.#o.set(e,r),this.#o.set(n,r);const a=this.#g(i);return this.#f(a),e&&this.#v(s,a),r}addHighlightHCMFilter(e,t,s,n,i){const r=`${t}-${s}-${n}-${i}`;let a=this.#h.get(e);if(a?.key===r||(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#h.set(e,a)),!t||!s))return a.url;const[o,h]=[t,s].map(this.#b.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),d=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[u,f]=[n,i].map(this.#b.bind(this));d<c&&([c,d,u,f]=[d,c,f,u]),this.#l.style.color="";const p=(v,y,b)=>{const E=new Array(256),A=(d-c)/b,w=v/255,S=(y-v)/(255*b);let T=0;for(let x=0;x<=b;x++){const R=Math.round(c+x*A),C=w+x*S;for(let L=T;L<=R;L++)E[L]=C;T=R+1}for(let x=T;x<256;x++)E[x]=E[T-1];return E.join(",")},g=`g_${this.#s}_hcm_${e}_filter`,m=a.filter=this.#g(g);return this.#m(m),this.#p(p(u[0],f[0],5),p(u[1],f[1],5),p(u[2],f[2],5),m),a.url=this.#d(g),a.url}destroy(e=!1){e&&this.#r?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#e?.clear(),this.#e=null,this.#r?.clear(),this.#r=null,this.#i=0)}#f(e){const t=this.#a.createElementNS(Gt,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(t)}#m(e){const t=this.#a.createElementNS(Gt,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}#g(e){const t=this.#a.createElementNS(Gt,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#l.append(t),t}#c(e,t,s){const n=this.#a.createElementNS(Gt,t);n.setAttribute("type","discrete"),n.setAttribute("tableValues",s),e.append(n)}#p(e,t,s,n){const i=this.#a.createElementNS(Gt,"feComponentTransfer");n.append(i),this.#c(i,"feFuncR",e),this.#c(i,"feFuncG",t),this.#c(i,"feFuncB",s)}#v(e,t){const s=this.#a.createElementNS(Gt,"feComponentTransfer");t.append(s),this.#c(s,"feFuncA",e)}#b(e){return this.#l.style.color=e,ne(getComputedStyle(this.#l).getPropertyValue("color"))}}class En{constructor({baseUrl:e=null}){this.baseUrl=e}fetch(e){var t=this;return(0,N.A)(function*({filename:s}){if(!t.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!s)throw new Error("Font filename must be specified.");const n=`${t.baseUrl}${s}`;return t._fetch(n).catch(i=>{throw new Error(`Unable to load font data at: ${n}`)})}).apply(this,arguments)}_fetch(e){return(0,N.A)(function*(){nt("Abstract method `_fetch` called.")})()}}
1class Sn extends En{_fetch(e){return(0,N.A)(function*(){const t=yield se(e,"arraybuffer");return new Uint8Array(t)})()}}class xn{constructor({baseUrl:e=null}){this.baseUrl=e}fetch(e){var t=this;return(0,N.A)(function*({filename:s}){if(!t.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!s)throw new Error("Wasm filename must be specified.");const n=`${t.baseUrl}${s}`;return t._fetch(n).catch(i=>{throw new Error(`Unable to load wasm data at: ${n}`)})}).apply(this,arguments)}_fetch(e){return(0,N.A)(function*(){nt("Abstract method `_fetch` called.")})()}}class Tn extends xn{_fetch(e){return(0,N.A)(function*(){const t=yield se(e,"arraybuffer");return new Uint8Array(t)})()}}if(St){let l;try{const e=Mt.getBuiltinModule("module").createRequire("file:///builds/GoREACT/GoREACT/frontend/node_modules/pdfjs-dist/legacy/build/pdf.mjs");try{l=e("@napi-rs/canvas")}catch(t){G(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(e){G(`Cannot access the \`require\` function: "${e}".`)}globalThis.DOMMatrix||(l?.DOMMatrix?globalThis.DOMMatrix=l.DOMMatrix:G("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(l?.ImageData?globalThis.ImageData=l.ImageData:G("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(l?.Path2D?globalThis.Path2D=l.Path2D:G("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}function vs(l){return ys.apply(this,arguments)}function ys(){return(ys=(0,N.A)(function*(l){const t=yield Mt.getBuiltinModule("fs").promises.readFile(l);return new Uint8Array(t)})).apply(this,arguments)}class Ni extends wn{}class Bi extends yn{_createCanvas(e,t){return Mt.getBuiltinModule("module").createRequire("file:///builds/GoREACT/GoREACT/frontend/node_modules/pdfjs-dist/legacy/build/pdf.mjs")("@napi-rs/canvas").createCanvas(e,t)}}class _i extends bn{_fetch(e){return(0,N.A)(function*(){return vs(e)})()}}
vendor: 10,077 bytes, line 1
1class Ui extends En{_fetch(e){return(0,N.A)(function*(){return vs(e)})()}}class Hi extends xn{_fetch(e){return(0,N.A)(function*(){return vs(e)})()}}Y(7588);const re="__forcedDependency",{floor:Cn,ceil:Rn}=Math;function ze(l,e,t,s,n,i){l[4*e+0]=Math.min(l[4*e+0],t),l[4*e+1]=Math.min(l[4*e+1],s),l[4*e+2]=Math.max(l[4*e+2],n),l[4*e+3]=Math.max(l[4*e+3],i)}const bs=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class ji{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get length(){return this.#t.length}isEmpty(e){return this.#t[e]===bs}minX(e){return this.#e[4*e+0]/256}minY(e){return this.#e[4*e+1]/256}maxX(e){return(this.#e[4*e+2]+1)/256}maxY(e){return(this.#e[4*e+3]+1)/256}}const Ve=(l,e)=>{if(!l)return;let t=l.get(e);return t||(t={dependencies:new Set,isRenderingOperation:!1},l.set(e,t)),t};class $i{#t={__proto__:null};#e={__proto__:null,transform:[],moveText:[],sameLineText:[],[re]:[]};#n=new Map;#s=[];#a=[];#r=[[1,0,0,1,0,0]];#i=[-1/0,-1/0,1/0,1/0];#o=new Float64Array([1/0,1/0,-1/0,-1/0]);#h=-1;#l=new Set;#u=new Map;#d=new Map;#f;#m;#g;#c;#p;constructor(e,t,s=!1){this.#f=e.width,this.#m=e.height,this.#v(t),s&&(this.#p=new Map)}growOperationsCount(e){e>=this.#c.length&&this.#v(e,this.#c)}#v(e,t){const s=new ArrayBuffer(4*e);this.#g=new Uint8ClampedArray(s),this.#c=new Uint32Array(s),t&&t.length>0?(this.#c.set(t),this.#c.fill(bs,t.length)):this.#c.fill(bs)}save(e){return this.#t={__proto__:this.#t},this.#e={__proto__:this.#e,transform:{__proto__:this.#e.transform},moveText:{__proto__:this.#e.moveText},sameLineText:{__proto__:this.#e.sameLineText},[re]:{__proto__:this.#e[re]}},this.#i={__proto__:this.#i},this.#s.push(e),this}restore(e){const t=Object.getPrototypeOf(this.#t);if(null===t)return this;this.#t=t,this.#e=Object.getPrototypeOf(this.#e),this.#i=Object.getPrototypeOf(this.#i);const s=this.#s.pop();return void 0!==s&&(Ve(this.#p,e)?.dependencies.add(s),this.#c[e]=this.#c[s]),this}recordOpenMarker(e){return this.#s.push(e),this}getOpenMarker(){return 0===this.#s.length?null:this.#s.at(-1)}recordCloseMarker(e){const t=this.#s.pop();return void 0!==t&&(Ve(this.#p,e)?.dependencies.add(t),this.#c[e]=this.#c[t]),this}beginMarkedContent(e){return this.#a.push(e),this}endMarkedContent(e){const t=this.#a.pop();return void 0!==t&&(Ve(this.#p,e)?.dependencies.add(t),this.#c[e]=this.#c[t]),this}pushBaseTransform(e){return this.#r.push(B.multiplyByDOMMatrix(this.#r.at(-1),e.getTransform())),this}popBaseTransform(){return this.#r.length>1&&this.#r.pop(),this}recordSimpleData(e,t){return this.#t[e]=t,this}recordIncrementalData(e,t){return this.#e[e].push(t),this}resetIncrementalData(e,t){return this.#e[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,s){this.#t[e]=this.#n.get(t)??s}recordFutureForcedDependency(e,t){return this.recordIncrementalData(re,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const t of e)t in this.#t&&this.recordFutureForcedDependency(t,this.#t[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of this.#l)this.recordFutureForcedDependency(re,e);return this}resetBBox(e){return this.#h!==e&&(this.#h=e,this.#o[0]=1/0,this.#o[1]=1/0,this.#o[2]=-1/0,this.#o[3]=-1/0),this}recordClipBox(e,t,s,n,i,r){const a=B.multiplyByDOMMatrix(this.#r.at(-1),t.getTransform()),o=[1/0,1/0,-1/0,-1/0];B.axialAlignedBoundingBox([s,i,n,r],a,o);const h=B.intersect(this.#i,o);return h?(this.#i[0]=h[0],this.#i[1]=h[1],this.#i[2]=h[2],this.#i[3]=h[3]):(this.#i[0]=this.#i[1]=1/0,this.#i[2]=this.#i[3]=-1/0),this}recordBBox(e,t,s,n,i,r){const a=this.#i;if(a[0]===1/0)return this;const o=B.multiplyByDOMMatrix(this.#r.at(-1),t.getTransform());if(a[0]===-1/0)return B.axialAlignedBoundingBox([s,i,n,r],o,this.#o),this;const h=[1/0,1/0,-1/0,-1/0];return B.axialAlignedBoundingBox([s,i,n,r],o,h),this.#o[0]=Math.min(this.#o[0],Math.max(h[0],a[0])),this.#o[1]=Math.min(this.#o[1],Math.max(h[1],a[1])),this.#o[2]=Math.max(this.#o[2],Math.min(h[2],a[2])),this.#o[3]=Math.max(this.#o[3],Math.min(h[3],a[3])),this}recordCharacterBBox(e,t,s,n=1,i=0,r=0,a){const o=s.bbox;let h,c;if(o&&(h=o[2]!==o[0]&&o[3]!==o[1]&&this.#d.get(s),!1!==h&&(c=[0,0,0,0],B.axialAlignedBoundingBox(o,s.fontMatrix,c),(1!==n||0!==i||0!==r)&&B.scaleMinMax([n,0,0,-n,i,r],c),h)))return this.recordBBox(e,t,c[0],c[2],c[1],c[3]);if(!a)return this.recordFullPageBBox(e);const d=a();return o&&c&&void 0===h&&(h=c[0]<=i-d.actualBoundingBoxLeft&&c[2]>=i+d.actualBoundingBoxRight&&c[1]<=r-d.actualBoundingBoxAscent&&c[3]>=r+d.actualBoundingBoxDescent,this.#d.set(s,h),h)?this.recordBBox(e,t,c[0],c[2],c[1],c[3]):this.recordBBox(e,t,i-d.actualBoundingBoxLeft,i+d.actualBoundingBoxRight,r-d.actualBoundingBoxAscent,r+d.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#o[0]=Math.max(0,this.#i[0]),this.#o[1]=Math.max(0,this.#i[1]),this.#o[2]=Math.min(this.#f,this.#i[2]),this.#o[3]=Math.min(this.#m,this.#i[3]),this}getSimpleIndex(e){return this.#t[e]}recordDependencies(e,t){const s=this.#l,n=this.#t,i=this.#e;for(const r of t)r in this.#t?s.add(n[r]):r in i&&i[r].forEach(s.add,s);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#l.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[re]),this.#p){const s=Ve(this.#p,e),{dependencies:n}=s;this.#l.forEach(n.add,n),this.#s.forEach(n.add,n),this.#a.forEach(n.add,n),n.delete(e),s.isRenderingOperation=!0}if(this.#h===e){const s=Cn(256*this.#o[0]/this.#f),n=Cn(256*this.#o[1]/this.#m),i=Rn(256*this.#o[2]/this.#f),r=Rn(256*this.#o[3]/this.#m);ze(this.#g,e,s,n,i,r);for(const a of this.#l)a!==e&&ze(this.#g,a,s,n,i,r);for(const a of this.#s)a!==e&&ze(this.#g,a,s,n,i,r);for(const a of this.#a)a!==e&&ze(this.#g,a,s,n,i,r);t||(this.#l.clear(),this.#h=-1)}return this}recordShowTextOperation(e,t=!1){const s=Array.from(this.#l);this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(const n of s)this.recordIncrementalData("sameLineText",n);return this}bboxToClipBoxDropOperation(e,t=!1){return this.#h===e&&(this.#h=-1,this.#i[0]=Math.max(this.#i[0],this.#o[0]),this.#i[1]=Math.max(this.#i[1],this.#o[1]),this.#i[2]=Math.min(this.#i[2],this.#o[2]),this.#i[3]=Math.min(this.#i[3],this.#o[3]),t||this.#l.clear()),this}_takePendingDependencies(){const e=this.#l;return this.#l=new Set,e}_extractOperation(e){const t=this.#u.get(e);return this.#u.delete(e),t}_pushPendingDependencies(e){for(const t of e)this.#l.add(t)}take(){return this.#d.clear(),new ji(this.#c,this.#g)}takeDebugMetadata(){return this.#p}}class We{#t;#e;#n;#s=0;#a=0;constructor(e,t,s){if(e instanceof We&&e.#n===!!s)return e;this.#t=e,this.#e=t,this.#n=!!s}growOperationsCount(){throw new Error("Unreachable")}save(e){return this.#a++,this.#t.save(this.#e),this}restore(e){return this.#a>0&&(this.#t.restore(this.#e),this.#a--),this}recordOpenMarker(e){return this.#s++,this}getOpenMarker(){return this.#s>0?this.#e:this.#t.getOpenMarker()}recordCloseMarker(e){return this.#s--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#t.pushBaseTransform(e),this}popBaseTransform(){return this.#t.popBaseTransform(),this}recordSimpleData(e,t){return this.#t.recordSimpleData(e,this.#e),this}recordIncrementalData(e,t){return this.#t.recordIncrementalData(e,this.#e),this}resetIncrementalData(e,t){return this.#t.resetIncrementalData(e,this.#e),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,s){return this.#t.recordSimpleDataFromNamed(e,t,this.#e),this}recordFutureForcedDependency(e,t){return this.#t.recordFutureForcedDependency(e,this.#e),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#t.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#t.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#t.resetBBox(this.#e),this}recordClipBox(e,t,s,n,i,r){return this.#n||this.#t.recordClipBox(this.#e,t,s,n,i,r),this}recordBBox(e,t,s,n,i,r){return this.#n||this.#t.recordBBox(this.#e,t,s,n,i,r),this}recordCharacterBBox(e,t,s,n,i,r,a){return this.#n||this.#t.recordCharacterBBox(this.#e,t,s,n,i,r,a),this}recordFullPageBBox(e){return this.#n||this.#t.recordFullPageBBox(this.#e),this}getSimpleIndex(e){return this.#t.getSimpleIndex(e)}recordDependencies(e,t){return this.#t.recordDependencies(this.#e,t),this}recordNamedDependency(e,t){return this.#t.recordNamedDependency(this.#e,t),this}recordOperation(e){return this.#t.recordOperation(this.#e,!0),this}recordShowTextOperation(e){return this.#t.recordShowTextOperation(this.#e,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#t.bboxToClipBoxDropOperation(this.#e,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Ft_stroke=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Ft_fill=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Ft_imageXObject=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Ft_rawFillPath=["filter","fillColor","fillAlpha"],Ft_showText=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Ft_transform=["transform"],Ft_transformAndFill=["transform","fillColor"];function As(l,e){if(!e)return;const t=e[2]-e[0],s=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],t,s),l.clip(n)}class ws{isModifyingCurrentTransform(){return!1}getPattern(){nt("Abstract method `getPattern` called.")}}class Gi extends ws{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return 0===this._p0[0]&&0===this._p0[1]&&(!this.isRadial()||0===this._p1[0]&&0===this._p1[1])}isRadial(){return"radial"===this._type}_createGradient(e,t=null){let s,n=this._p0,i=this._p1;
1if(t&&(n=n.slice(),i=i.slice(),B.applyTransform(n,t),B.applyTransform(i,t)),"axial"===this._type)s=e.createLinearGradient(n[0],n[1],i[0],i[1]);else if("radial"===this._type){let r=this._r0,a=this._r1;if(t){const o=new Float32Array(2);B.singularValueDecompose2dScale(t,o),r*=o[0],a*=o[0]}s=e.createRadialGradient(n[0],n[1],r,i[0],i[1],a)}for(const r of this._colorStops)s.addColorStop(r[0],r[1]);return s}getPattern(e,t,s,n){let i;if("Stroke"===n||"Fill"===n){if(this.isOriginBased()){let u=B.transform(s,t.baseTransform);this.matrix&&(u=B.transform(u,this.matrix));const f=.001,p=Math.hypot(u[0],u[1]),g=Math.hypot(u[2],u[3]);if(Math.abs((u[0]*u[2]+u[1]*u[3])/(p*g))<f){if(!this.isRadial())return this._createGradient(e,u);if(Math.abs(p-g)<f)return this._createGradient(e,u)}}const r=t.current.getClippedPathBoundingBox(n,lt(e))||[0,0,0,0],a=Math.ceil(r[2]-r[0])||1,o=Math.ceil(r[3]-r[1])||1,h=t.cachedCanvases.getCanvas("pattern",a,o),c=h.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-r[0],-r[1]),s=B.transform(s,[1,0,0,1,r[0],r[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),As(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),i=e.createPattern(h.canvas,"no-repeat");const d=new DOMMatrix(s);i.setTransform(d)}else As(e,this._bbox),i=this._createGradient(e);return i}}function Es(l,e,t,s,n,i,r,a){const o=e.coords,h=e.colors,c=l.data,d=4*l.width;let u;o[t+1]>o[s+1]&&(u=t,t=s,s=u,u=i,i=r,r=u),o[s+1]>o[n+1]&&(u=s,s=n,n=u,u=r,r=a,a=u),o[t+1]>o[s+1]&&(u=t,t=s,s=u,u=i,i=r,r=u);const f=(o[t]+e.offsetX)*e.scaleX,p=(o[t+1]+e.offsetY)*e.scaleY,g=(o[s]+e.offsetX)*e.scaleX,m=(o[s+1]+e.offsetY)*e.scaleY,v=(o[n]+e.offsetX)*e.scaleX,y=(o[n+1]+e.offsetY)*e.scaleY;if(p>=y)return;const b=h[i],E=h[i+1],A=h[i+2],w=h[r],S=h[r+1],T=h[r+2],x=h[a],R=h[a+1],C=h[a+2],L=Math.round(p),O=Math.round(y);let M,j,D,I,U,z,st,q;for(let K=L;K<=O;K++){if(K<m){const P=K<p?0:(p-K)/(p-m);M=f-(f-g)*P,j=b-(b-w)*P,D=E-(E-S)*P,I=A-(A-T)*P}else{let P;P=K>y?1:m===y?0:(m-K)/(m-y),M=g-(g-v)*P,j=w-(w-x)*P,D=S-(S-R)*P,I=T-(T-C)*P}let Q;Q=K<p?0:K>y?1:(p-K)/(p-y),U=f-(f-v)*Q,z=b-(b-x)*Q,st=E-(E-R)*Q,q=A-(A-C)*Q;const it=Math.round(Math.min(M,U)),bt=Math.round(Math.max(M,U));let F=d*K+4*it;for(let P=it;P<=bt;P++)Q=(M-P)/(M-U),Q<0?Q=0:Q>1&&(Q=1),c[F++]=j-(j-z)*Q|0,c[F++]=D-(D-st)*Q|0,c[F++]=I-(I-q)*Q|0,c[F++]=255}}function zi(l,e,t){const s=e.coords,n=e.colors;let i,r;switch(e.type){case 2:const a=e.verticesPerRow,o=Math.floor(s.length/a)-1,h=a-1;for(i=0;i<o;i++){let c=i*a;for(let d=0;d<h;d++,c++)Es(l,t,s[c],s[c+1],s[c+a],n[c],n[c+1],n[c+a]),Es(l,t,s[c+a+1],s[c+1],s[c+a],n[c+a+1],n[c+1],n[c+a])}break;case 1:for(i=0,r=s.length;i<r;i+=3)Es(l,t,s[i],s[i+1],s[i+2],n[i],n[i+1],n[i+2]);break;default:throw new Error("illegal figure")}}class Vi extends ws{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,s){const a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),h=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-o,d=Math.min(Math.ceil(Math.abs(h*e[0]*1.1)),3e3),u=Math.min(Math.ceil(Math.abs(c*e[1]*1.1)),3e3),f=h/d,p=c/u,g={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-o,scaleX:1/f,scaleY:1/p},y=s.getCanvas("mesh",d+4,u+4),b=y.context,E=b.createImageData(d,u);if(t){const w=E.data;for(let S=0,T=w.length;S<T;S+=4)w[S]=t[0],w[S+1]=t[1],w[S+2]=t[2],w[S+3]=255}for(const w of this._figures)zi(E,w,g);return b.putImageData(E,2,2),{canvas:y.canvas,offsetX:a-2*f,offsetY:o-2*p,scaleX:f,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,t,s,n){As(e,this._bbox);const i=new Float32Array(2);if("Shading"===n)B.singularValueDecompose2dScale(lt(e),i);else if(this.matrix){B.singularValueDecompose2dScale(this.matrix,i);const[a,o]=i;B.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=a,i[1]*=o}else B.singularValueDecompose2dScale(t.baseTransform,i);const r=this._createMeshCanvas(i,"Shading"===n?null:this._background,t.cachedCanvases);return"Shading"!==n&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix
1)),e.translate(r.offsetX,r.offsetY),e.scale(r.scaleX,r.scaleY),e.createPattern(r.canvas,"no-repeat")}}class Wi extends ws{getPattern(){return"hotpink"}}let Yi=(()=>{class l{static MAX_PATTERN_SIZE=3e3;constructor(t,s,n,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=s,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(t,s){const{bbox:n,operatorList:i,paintType:r,tilingType:a,color:o,canvasGraphicsFactory:h}=this;let{xstep:c,ystep:d}=this;c=Math.abs(c),d=Math.abs(d),Fe("TilingType: "+a);const u=n[0],f=n[1],p=n[2],g=n[3],m=p-u,v=g-f,y=new Float32Array(2);B.singularValueDecompose2dScale(this.matrix,y);const[b,E]=y;B.singularValueDecompose2dScale(this.baseTransform,y);const A=b*y[0],w=E*y[1];let S=m,T=v,x=!1,R=!1;const C=Math.ceil(c*A),L=Math.ceil(d*w);C>=Math.ceil(m*A)?S=c:x=!0,L>=Math.ceil(v*w)?T=d:R=!0;const j=this.getSizeAndScale(S,this.ctx.canvas.width,A),D=this.getSizeAndScale(T,this.ctx.canvas.height,w),I=t.cachedCanvases.getCanvas("pattern",j.size,D.size),U=I.context,z=h.createCanvasGraphics(U,s);if(z.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(z,r,o),U.translate(-j.scale*u,-D.scale*f),z.transform(0,j.scale,0,0,D.scale,0,0),U.save(),z.dependencyTracker?.save(),this.clipBbox(z,u,f,p,g),z.baseTransform=lt(z.ctx),z.executeOperatorList(i),z.endDrawing(),z.dependencyTracker?.restore(),U.restore(),x||R){const st=I.canvas;x&&(S=c),R&&(T=d);const q=this.getSizeAndScale(S,this.ctx.canvas.width,A),K=this.getSizeAndScale(T,this.ctx.canvas.height,w),Q=q.size,it=K.size,bt=t.cachedCanvases.getCanvas("pattern-workaround",Q,it),F=bt.context,P=x?Math.floor(m/c):0,k=R?Math.floor(v/d):0;for(let W=0;W<=P;W++)for(let et=0;et<=k;et++)F.drawImage(st,Q*W,it*et,Q,it,0,0,Q,it);return{canvas:bt.canvas,scaleX:q.scale,scaleY:K.scale,offsetX:u,offsetY:f}}return{canvas:I.canvas,scaleX:j.scale,scaleY:D.scale,offsetX:u,offsetY:f}}getSizeAndScale(t,s,n){const i=Math.max(l.MAX_PATTERN_SIZE,s);let r=Math.ceil(t*n);return r>=i?r=i:n=r/t,{scale:n,size:r}}clipBbox(t,s,n,i,r){t.ctx.rect(s,n,i-s,r-n),B.axialAlignedBoundingBox([s,n,i,r],lt(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,s,n){const i=t.ctx,r=t.current;switch(s){case 1:const{fillStyle:a,strokeStyle:o}=this.ctx;i.fillStyle=r.fillColor=a,i.strokeStyle=r.strokeColor=o;break;case 2:i.fillStyle=i.strokeStyle=n,r.fillColor=r.strokeColor=n;break;default:throw new di(`Unsupported paint type: ${s}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,s,n,i,r){let a=n;"Shading"!==i&&(a=B.transform(a,s.baseTransform),this.matrix&&(a=B.transform(a,this.matrix)));const o=this.createPatternCanvas(s,r);let h=new DOMMatrix(a);h=h.translate(o.offsetX,o.offsetY),h=h.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");return c.setTransform(h),c}}return l})();function In({src:l,srcPos:e=0,dest:t,width:s,height:n,nonBlackColor:i=4294967295,inverseDecode:r=!1}){const a=ut.isLittleEndian?4278190080:255,[o,h]=r?[i,a]:[a,i],c=s>>3,d=7&s,u=l.length;t=new Uint32Array(t.buffer);let f=0;for(let p=0;p<n;p++){for(const m=e+c;e<m;e++){const v=e<u?l[e]:255;t[f++]=128&v?h:o,t[f++]=64&v?h:o,t[f++]=32&v?h:o,t[f++]=16&v?h:o,t[f++]=8&v?h:o,t[f++]=4&v?h:o,t[f++]=2&v?h:o,t[f++]=1&v?h:o}if(0===d)continue;const g=e<u?l[e++]:255;for(let m=0;m<d;m++)t[f++]=g&1<<7-m?h:o}return{srcPos:e,destPos:f}}const Ss=new DOMMatrix,Dt=new Float32Array(2),ae=new Float32Array([1/0,1/0,-1/0,-1/0]);class Zi{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,s){let n;return void 0!==this.cache[e]?(n=this.cache[e],this.canvasFactory.reset(n,t,s)):(n=this.canvasFactory.create(t,s),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache)this.canvasFactory.destroy(this.cache[e]),delete this.cache[e]}}function Xe(l,e,t,s,n,i,r,a,o,h){const[c,d,u,f,p,g]=lt(l);if(0===d&&0===u){const b=Math.round(r*c+p),A=Math.round(a*f+g),S=Math.abs(Math.round((r+o)*c+p)-b)||1,x=Math.abs(Math.round((a+h)*f+g)-A)||1;return l.setTransform(Math.sign(c),0,0,Math.sign(f),b,A),l.drawImage(e,t,s,n,i,0,0,S,x),l.setTransform(c,d,u,f,p,g),[S,x]}if(0===c&&0===f){const b=Math.round(a*u+p),A=Math.round(r*d+g),S=Math.abs(Math.round((a+h)*u+p)-b)||1,x=Math.abs(Math.round((r+o)*d+g)-A)||1;return l.setTransform(0,Math.sign(d),Math.sign(u),0,b,A),l.drawImage(e,t,s,n,i,0,0,x,S),l.setTransform(c,d,u,f,p,g),[x,S]}return l.drawImage(e,t,s,n,i,r,a,o,h),[Math.hypot(c,d)*o,Math.hypot(u,f)*h]}class Ln{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=es;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=0;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,t,s){s?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=ae.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e="Fill",t=null){const s=this.minMax.slice();if("Stroke"===e){t||nt("Stroke bounding box must include transform."),B.singularValueDecompose2dScale(t,Dt);const n=Dt[0]*this.lineWidth/2,i=Dt[1]*this.lineWidth/2;s[0]-=n,s[1]-=i,s[2]+=n,s[3]+=i}return s}updateClipFromPath(){const e=B.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(ae,0)}getClippedPathBoundingBox(e="Fill",t=null){return B.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function Fn(l,e){if(e instanceof ImageData)return void l.putImageData(e,0,0);const t=e.height,s=e.width,n=t%16,i=(t-n)/16,r=0===n?i:i+1,a=l.createImageData(s,16);let h,o=0;const c=e.data,d=a.data;let u,f,p,g;if(e.kind===ue.GRAYSCALE_1BPP){const m=c.byteLength,v=new Uint32Array(d.buffer,0,d.byteLength>>2),y=v.length,b=s+7>>3,E=4294967295,A=ut.isLittleEndian?4278190080:255;for(u=0;
vendor: 10,349 bytes, line 1
1u<r;u++){for(p=u<i?16:n,h=0,f=0;f<p;f++){const w=m-o;let S=0;const T=w>b?s:8*w-7,x=-8&T;let R=0,C=0;for(;S<x;S+=8)C=c[o++],v[h++]=128&C?E:A,v[h++]=64&C?E:A,v[h++]=32&C?E:A,v[h++]=16&C?E:A,v[h++]=8&C?E:A,v[h++]=4&C?E:A,v[h++]=2&C?E:A,v[h++]=1&C?E:A;for(;S<T;S++)0===R&&(C=c[o++],R=128),v[h++]=C&R?E:A,R>>=1}for(;h<y;)v[h++]=0;l.putImageData(a,0,16*u)}}else if(e.kind===ue.RGBA_32BPP){for(f=0,g=16*s*4,u=0;u<i;u++)d.set(c.subarray(o,o+g)),o+=g,l.putImageData(a,0,f),f+=16;u<r&&(g=s*n*4,d.set(c.subarray(o,o+g)),l.putImageData(a,0,f))}else{if(e.kind!==ue.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(p=16,g=s*p,u=0;u<r;u++){for(u>=i&&(p=n,g=s*p),h=0,f=g;f--;)d[h++]=c[o++],d[h++]=c[o++],d[h++]=c[o++],d[h++]=255;l.putImageData(a,0,16*u)}}}function kn(l,e){if(e.bitmap)return void l.drawImage(e.bitmap,0,0);const t=e.height,s=e.width,n=t%16,i=(t-n)/16,r=0===n?i:i+1,a=l.createImageData(s,16);let o=0;const h=e.data,c=a.data;for(let d=0;d<r;d++){const u=d<i?16:n;({srcPos:o}=In({src:h,srcPos:o,dest:c,width:s,height:u,nonBlackColor:0})),l.putImageData(a,0,16*d)}}function xe(l,e){const t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of t)void 0!==l[s]&&(e[s]=l[s]);void 0!==l.setLineDash&&(e.setLineDash(l.getLineDash()),e.lineDashOffset=l.lineDashOffset)}function Ye(l){l.strokeStyle=l.fillStyle="#000000",l.fillRule="nonzero",l.globalAlpha=1,l.lineWidth=1,l.lineCap="butt",l.lineJoin="miter",l.miterLimit=10,l.globalCompositeOperation="source-over",l.font="10px sans-serif",void 0!==l.setLineDash&&(l.setLineDash([]),l.lineDashOffset=0);const{filter:e}=l;"none"!==e&&""!==e&&(l.filter="none")}function Nn(l,e){if(e)return!0;B.singularValueDecompose2dScale(l,Dt);const t=Math.fround(Bt.pixelRatio*Wt.PDF_TO_CSS_UNITS);return Dt[0]<=t&&Dt[1]<=t}const qi=["butt","round","square"],tr=["miter","round","bevel"],er={},Bn={};class oe{constructor(e,t,s,n,i,{optionalContentConfig:r,markedContentStack:a=null},o,h,c){this.ctx=e,this.current=new Ln(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=s,this.canvasFactory=n,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=r,this.cachedCanvases=new Zi(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=h,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null}getObject(e,t,s=null){return"string"==typeof t?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):s}beginDrawing({transform:e,viewport:t,transparency:s=!1,background:n=null}){const i=this.ctx.canvas.width,r=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,i,r),this.ctx.fillStyle=a,s){const o=this.cachedCanvases.getCanvas("transparent",i,r);this.compositeCtx=this.ctx,this.transparentCanvas=o.canvas,this.ctx=o.context,this.ctx.save(),this.ctx.transform(...lt(this.compositeCtx))}this.ctx.save(),Ye(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=lt(this.ctx)}executeOperatorList(e,t,s,n,i){const r=e.argsArray,a=e.fnArray;let o=t||0;const h=r.length;if(h===o)return o;const c=h-o>10&&"function"==typeof s,d=c?Date.now()+15:0;let u=0;const f=this.commonObjs,p=this.objs;let g,m;for(;;){if(void 0!==n&&o===n.nextBreakPoint)return n.breakIt(o,s),o;if(!i||i(o))if(g=a[o],m=r[o]??null,g!==qt.dependency)null===m?this[g](o):this[g](o,...m);else for(const v of m){this.dependencyTracker?.recordNamedData(v,o);const y=v.startsWith("g_")?f:p;if(!y.has(v))return y.get(v,s),o}if(o++,o===h)return o;if(c&&++u>10){if(Date.now()>d)return s(),o;u=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const s=e.width??e.displayWidth,n=e.height??e.displayHeight;let c,d,i=Math.max(Math.hypot(t[0],t[1]),1),r=Math.max(Math.hypot(t[2],t[3]),1),a=s,o=n,h="prescale1";for(;i>2&&a>1||r>2&&o>1;){let u=a,f=o;i>2&&a>1&&(u=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),i/=a/u),r>2&&o>1&&(f=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o)/2,r/=o/f),c=this.cachedCanvases.getCanvas(h,u,f),d=c.context,d.clearRect(0,0,u,f),d.drawImage(e,0,0,a,o,0,0,u,f),e=c.canvas,a=u,o=f,h="prescale1"===h?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:o}}_createMaskCanvas(e,t){const s=this.ctx,{width:n,height:i}=t,r=this.current.fillColor,a=this.current.patternFill,o=lt(s);let h,c,d,u;if((t.bitmap||t.data)&&t.count>1){const R=t.bitmap||t.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),r]),h=this._cachedBitmapsMap.get(R),h||(h=new Map,this._cachedBitmapsMap.set(R,h));const C=h.get(c);if(C&&!a){const L=Math.round(Math.min(o[0],o[2])+o[4]),O=Math.round(Math.min(o[1],o[3])+o[5]);return this.dependencyTracker?.recordDependencies(e,Ft_transformAndFill),{canvas:C,offsetX:L,offsetY:O}}d=C}d||(u=this.cachedCanvases.getCanvas("maskCanvas",n,i),kn(u.context,t));let f=B.transform(o,[1/n,0,0,-1/i,0,0]);f=B.transform(f,[1,0,0,1,0,-i]);const p=ae.slice();B.axialAlignedBoundingBox([0,0,n,i],f,p);const[g,m,v,y]=p,b=Math.round(v-g)||1,E=Math.round(y-m)||1,A=this.cachedCanvases.getCanvas("fillCanvas",b,E),w=A.context,S=g,T=m;w.translate(-S,-T),w.transform(...f),d||(d=this._scaleImage(u.canvas,_t(w)),d=d.img,h&&a&&h.set(c,d)),w.imageSmoothingEnabled=Nn(lt(w),t.interpolate),Xe(w,d,0,0,d.width,d.height,0,0,n,i),w.globalCompositeOperation="source-in";const x=B.transform(_t(w),[1,0,0,1,-S,-T]);return w.fillStyle=a?r.getPattern(s,this,x,"Fill",e):r,w.fillRect(0,0,n,i),h&&!a&&(this.cachedCanvases.delete("fillCanvas"),h.set(c,A.canvas)),this.dependencyTracker?.recordDependencies(e,Ft_transformAndFill),{canvas:A.canvas,offsetX:Math.round(S),offsetY:Math.round(T)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=qi[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=tr[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,s){this.dependencyTracker?.recordSimpleData("dash",e);const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=s)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(const[s,n]of t)switch(s){case"LW":this.setLineWidth(e,n);break;case"LC":this.setLineCap(e,n);break;case"LJ":this.setLineJoin(e,n);break;case"ML":this.setMiterLimit(e,n);break;case"D":this.setDash(e,n[0],n[1]);break;case"RI":this.setRenderingIntent(e,n);break;case"FL":this.setFlatness(e,n);break;case"Font":this.setFont(e,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const i=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height);this.suspendedCtx=this.ctx;const r=this.ctx=i.context;r.setTransform(this.suspendedCtx.getTransform()),xe(this.suspendedCtx,r),function Ji(l,e){if(l._removeMirroring)throw new Error("Context is already forwarding operations.");l.__originalSave=l.save,l.__originalRestore=l.restore,l.__originalRotate=l.rotate,l.__originalScale=l.scale,l.__originalTranslate=l.translate,l.__originalTransform=l.transform,l.__originalSetTransform=l.setTransform,l.__originalResetTransform=l.resetTransform,l.__originalClip=l.clip,l.__originalMoveTo=l.moveTo,l.__originalLineTo=l.lineTo,l.__originalBezierCurveTo=l.bezierCurveTo,l.__originalRect=l.rect,l.__originalClosePath=l.closePath,l.__originalBeginPath=l.beginPath,l._removeMirroring=()=>{l.save=l.__originalSave,l.restore=l.__originalRestore,l.rotate=l.__originalRotate,l.scale=l.__originalScale,l.translate=l.__originalTranslate,l.transform=l.__originalTransform,l.setTransform=l.__originalSetTransform,l.resetTransform=l.__originalResetTransform,l.clip=l.__originalClip,l.moveTo=l.__originalMoveTo,l.lineTo=l.__originalLineTo,l.bezierCurveTo=l.__originalBezierCurveTo,l.rect=l.__originalRect,l.closePath=l.__originalClosePath,l.beginPath=l.__originalBeginPath,delete l._removeMirroring},l.save=function(){e.save(),this.__originalSave()}
1,l.restore=function(){e.restore(),this.__originalRestore()},l.translate=function(t,s){e.translate(t,s),this.__originalTranslate(t,s)},l.scale=function(t,s){e.scale(t,s),this.__originalScale(t,s)},l.transform=function(t,s,n,i,r,a){e.transform(t,s,n,i,r,a),this.__originalTransform(t,s,n,i,r,a)},l.setTransform=function(t,s,n,i,r,a){e.setTransform(t,s,n,i,r,a),this.__originalSetTransform(t,s,n,i,r,a)},l.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},l.rotate=function(t){e.rotate(t),this.__originalRotate(t)},l.clip=function(t){e.clip(t),this.__originalClip(t)},l.moveTo=function(t,s){e.moveTo(t,s),this.__originalMoveTo(t,s)},l.lineTo=function(t,s){e.lineTo(t,s),this.__originalLineTo(t,s)},l.bezierCurveTo=function(t,s,n,i,r,a){e.bezierCurveTo(t,s,n,i,r,a),this.__originalBezierCurveTo(t,s,n,i,r,a)},l.rect=function(t,s,n,i){e.rect(t,s,n,i),this.__originalRect(t,s,n,i)},l.closePath=function(){e.closePath(),this.__originalClosePath()},l.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(r,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),xe(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){this.current.activeSMask&&(e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height],this.composeSMask(this.suspendedCtx,this.current.activeSMask,this.ctx,e),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())}composeSMask(e,t,s,n){const i=n[0],r=n[1],a=n[2]-i,o=n[3]-r;0===a||0===o||(this.genericComposeSMask(t.context,s,a,o,t.subtype,t.backdrop,t.transferMap,i,r,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(s.canvas,0,0),e.restore())}genericComposeSMask(e,t,s,n,i,r,a,o,h,c,d){let u=e.canvas,f=o-c,p=h-d;if(r)if(f<0||p<0||f+s>u.width||p+n>u.height){const m=this.cachedCanvases.getCanvas("maskExtension",s,n),v=m.context;v.drawImage(u,-f,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=r,v.fillRect(0,0,s,n),v.globalCompositeOperation="source-over",u=m.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(f,p,s,n),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=r,e.fillRect(f,p,s,n),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),"Alpha"===i&&a?t.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===i&&(t.filter=this.filterFactory.addLuminosityFilter(a));const g=new Path2D;g.rect(o,h,s,n),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(u,f,p,s,n,o,h,s,n),t.restore()}save(e){this.inSMaskMode&&xe(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){this.dependencyTracker?.restore(e),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&xe(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(e,t,s,n,i,r,a){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,s,n,i,r,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,s,n){let[i]=s;if(!n)return i||=s[0]=new Path2D,void this[t](e,i);if(null!==this.dependencyTracker){const r=t===qt.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,n[0]-r,n[2]+r,n[1]-r,n[3]+r).recordDependencies(e,["transform"])}i instanceof Path2D||(i=s[0]=ln(i)),B.axialAlignedBoundingBox(n,lt(this.ctx),this.current.minMax),this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,s=!0){const n=this.ctx,i=this.current.strokeColor;if(n.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof i&&i?.getPattern){const r=i.isModifyingCurrentTransform()?n.getTransform():null;if(n.save(),n.strokeStyle=i.getPattern(n,this,_t(n),"Stroke",e),r){const a=new Path2D;a.addPath(t,n.getTransform().invertSelf().multiplySelf(r)),t=a}
vendor: 4,686 bytes, line 1
1this.rescaleAndStroke(t,!1),n.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,Ft_stroke),s&&this.consumePath(e,t,this.current.getClippedPathBoundingBox("Stroke",lt(this.ctx))),n.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,s=!0){const n=this.ctx,i=this.current.fillColor;let a=!1;if(this.current.patternFill){const h=i.isModifyingCurrentTransform()?n.getTransform():null;if(this.dependencyTracker?.save(e),n.save(),n.fillStyle=i.getPattern(n,this,_t(n),"Fill",e),h){const c=new Path2D;c.addPath(t,n.getTransform().invertSelf().multiplySelf(h)),t=c}a=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(n.fill(t,"evenodd"),this.pendingEOFill=!1):n.fill(t)),this.dependencyTracker?.recordDependencies(e,Ft_fill),a&&(n.restore(),this.dependencyTracker?.restore(e)),s&&this.consumePath(e,t,o)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,Ft_rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=er}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=Bn}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const t=this.pendingTextPaths,s=this.ctx;if(this.dependencyTracker){const{dependencyTracker:n}=this;void 0!==t&&n.recordFutureForcedDependency("textClip",n.getOpenMarker()).recordFutureForcedDependency("textClip",e),n.recordCloseMarker(e)}if(void 0!==t){const n=new Path2D,i=s.getTransform().invertSelf();for(const{transform:r,x:a,y:o,fontSize:h,path:c}of t)c&&n.addPath(c,new DOMMatrix(r).preMultiplySelf(i).translate(a,o).scale(h,-h));s.clip(n)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,s){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);const n=this.commonObjs.get(t),i=this.current;if(!n)throw new Error(`Can't find font for ${t}`);if(i.fontMatrix=n.fontMatrix||es,(0===i.fontMatrix[0]||0===i.fontMatrix[3])&&G("Invalid font matrix for font "+t),s<0?(s=-s,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=s,n.isType3Font)return;const r=n.loadedName||"sans-serif",a=n.systemFontInfo?.css||`"${r}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const h=n.italic?"italic":"normal";let c=s;s<16?c=16:s>100&&(c=100),this.current.fontSizeScale=s/c,this.ctx.font=`${h} ${o} ${c}px ${a}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,s){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=s}setLeadingMoveText(e,t,s){this.setLeading(e,-s),this.moveText(e,t,s)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:s}=this;s.textMatrix=t,s.textMatrixScale=Math.hypot(t[0],t[1]),s.x=s.lineX=0,s.y=s.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#n(e,t,s){const n=new Path2D;return n.addPath(e,new DOMMatrix(s).invertSelf().multiplySelf(t)),n}paintChar(e,t,s,n,i,r){const a=this.ctx,o=this.current,h=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,u=3&c,f=!!(4&c),p=o.patternFill&&!h.missingFile,g=o.patternStroke&&!h.missingFile;let m;if((h.disableFontFace||f||p||g)&&!h.missingFile&&(m=h.getPathGenerator(this.commonObjs,t)),m&&(h.disableFontFace||p||g)){let v;
1if(a.save(),a.translate(s,n),a.scale(d,-d),this.dependencyTracker?.recordCharacterBBox(e,a,h),0===u||2===u)if(i){v=a.getTransform(),a.setTransform(...i);const y=this.#n(m,v,i);a.fill(y)}else a.fill(m);if(1===u||2===u)if(r){v||=a.getTransform(),a.setTransform(...r);const{a:y,b,c:E,d:A}=v,w=B.inverseTransform(r),S=B.transform([y,b,E,A,0,0],w);B.singularValueDecompose2dScale(S,Dt),a.lineWidth*=Math.max(Dt[0],Dt[1])/d,a.stroke(this.#n(m,v,r))}else a.lineWidth/=d,a.stroke(m);a.restore()}else(0===u||2===u)&&(a.fillText(t,s,n),this.dependencyTracker?.recordCharacterBBox(e,a,h,d,s,n,()=>a.measureText(t))),(1===u||2===u)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,h,d,s,n,()=>a.measureText(t)).recordDependencies(e,Ft_stroke),a.strokeText(t,s,n));f&&((this.pendingTextPaths||=[]).push({transform:lt(a),x:s,y:n,fontSize:d,path:m}),this.dependencyTracker?.recordCharacterBBox(e,a,h,d,s,n))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let s=!1;for(let n=3;n<t.length;n+=4)if(t[n]>0&&t[n]<255){s=!0;break}return V(this,"isFontSubpixelAAEnabled",s)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Ft_showText).resetBBox(e),4&this.current.textRenderingMode&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,n=s.font;if(n.isType3Font)return this.showType3Text(e,t),void this.dependencyTracker?.recordShowTextOperation(e);const i=s.fontSize;if(0===i)return void this.dependencyTracker?.recordOperation(e);const r=this.ctx,a=s.fontSizeScale,o=s.charSpacing,h=s.wordSpacing,c=s.fontDirection,d=s.textHScale*c,u=t.length,f=n.vertical,p=f?1:-1,g=n.defaultVMetrics,m=i*s.fontMatrix[0],v=0===s.textRenderingMode&&!n.disableFontFace&&!s.patternFill;let y,b;r.save(),s.textMatrix&&r.transform(...s.textMatrix),r.translate(s.x,s.y+s.textRise),r.scale(d,c>0?-1:1);const E=3&s.textRenderingMode,w=1===E||2===E;if((0===E||2===E)&&s.patternFill){r.save();const C=s.fillColor.getPattern(r,this,_t(r),"Fill",e);y=lt(r),r.restore(),r.fillStyle=C}if(w&&s.patternStroke){r.save();const C=s.strokeColor.getPattern(r,this,_t(r),"Stroke",e);b=lt(r),r.restore(),r.strokeStyle=C}let S=s.lineWidth;const T=s.textMatrixScale;if(0===T||0===S?w&&(S=this.getSinglePixelWidth()):S/=T,1!==a&&(r.scale(a,a),S/=a),r.lineWidth=S,n.isInvalidPDFjsFont){const C=[];let L=0;for(const M of t)C.push(M.unicode),L+=M.width;const O=C.join("");if(r.fillText(O,0,0),null!==this.dependencyTracker){const M=r.measureText(O);this.dependencyTracker.recordBBox(e,this.ctx,-M.actualBoundingBoxLeft,M.actualBoundingBoxRight,-M.actualBoundingBoxAscent,M.actualBoundingBoxDescent).recordShowTextOperation(e)}return s.x+=L*m*d,r.restore(),void this.compose()}let R,x=0;for(R=0;R<u;++R){const C=t[R];if("number"==typeof C){x+=p*C*i/1e3;continue}let L=!1;const O=(C.isSpace?h:0)+o,M=C.fontChar,j=C.accent;let D,I,z,U=C.width;if(f){const q=C.vmetric||g,K=-(C.vmetric?q[1]:.5*U)*m;U=q?-q[0]:U,D=K/a,I=(x+q[2]*m)/a}else D=x/a,I=0;if(n.remeasure&&U>0){z=r.measureText(M);const q=1e3*z.width/i*a;if(U<q&&this.isFontSubpixelAAEnabled){const K=U/q;L=!0,r.save(),r.scale(K,1),D/=K}else U!==q&&(D+=(U-q)/2e3*i/a)}this.contentVisible&&(C.isInFont||n.missingFile)&&(v&&!j?(r.fillText(M,D,I),this.dependencyTracker?.recordCharacterBBox(e,r,z?{bbox:null}:n,i/a,D,I,()=>z??r.measureText(M))):(this.paintChar(e,M,D,I,y,b),j&&this.paintChar(e,j.fontChar,D+i*j.offset.x/a,I-i*j.offset.y/a,y,b))),x+=f?U*m-O*c:U*m+O*c,L&&r.restore()}f?s.y-=x:s.x+=x*d,r.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){const s=this.ctx,n=this.current,i=n.font,r=n.fontSize,a=n.fontDirection,o=i.vertical?1:-1,h=n.charSpacing,c=n.wordSpacing,d=n.textHScale*a,u=n.fontMatrix||es,f=t.length;let g,m,v,y;if(3===n.textRenderingMode||0===r)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),n.textMatrix&&s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),s.scale(d,a);const b=this.dependencyTracker;for(this.dependencyTracker=b?new We(b,e):null,g=0;g<f;++g){if(m=t[g],"number"==typeof m){y=o*m*r/1e3,this.ctx.translate(y,0),n.x+=y*d;continue}const E=(m.isSpace?c:0)+h,A=i.charProcOperatorList[m.operatorListId];A?this.contentVisible&&(this.save(),s.scale(r,r),s.transform(...u),this.executeOperatorList(A),this.restore(
1)):G(`Type3 character "${m.operatorListId}" is not available.`);const w=[m.width,0];B.applyTransform(w,u),v=w[0]*r+E,s.translate(v,0),n.x+=v*d}s.restore(),b&&(this.dependencyTracker=b)}setCharWidth(e,t,s){}setCharWidthAndBounds(e,t,s,n,i,r,a){const o=new Path2D;o.rect(n,i,r-n,a-i),this.ctx.clip(o),this.dependencyTracker?.recordBBox(e,this.ctx,n,r,i,a).recordClipBox(e,this.ctx,n,r,i,a),this.endPath(e)}getColorN_Pattern(e,t){let s;if("TilingPattern"===t[0]){const n=this.baseTransform||lt(this.ctx);s=new Yi(t,this.ctx,{createCanvasGraphics:(r,a)=>new oe(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new We(this.dependencyTracker,a,!0):null)},n)}else s=this._getPattern(e,t[1],t[2]);return s}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}
vendor: 17,863 bytes, line 1
1setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,s=null){let n;return this.cachedPatterns.has(t)?n=this.cachedPatterns.get(t):(n=function Xi(l){switch(l[0]){case"RadialAxial":return new Gi(l);case"Mesh":return new Vi(l);case"Dummy":return new Wi}throw new Error(`Unknown IR type: ${l[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,n)),s&&(n.matrix=s),n}shadingFill(e,t){if(!this.contentVisible)return;const s=this.ctx;this.save(e);const n=this._getPattern(e,t);s.fillStyle=n.getPattern(s,this,_t(s),"Shading",e);const i=_t(s);if(i){const{width:r,height:a}=s.canvas,o=ae.slice();B.axialAlignedBoundingBox([0,0,r,a],i,o);const[h,c,d,u]=o;this.ctx.fillRect(h,c,d-h,u-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Ft_transform).recordDependencies(e,Ft_fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){nt("Should not call beginInlineImage")}beginImageData(){nt("Should not call beginImageData")}paintFormXObjectBegin(e,t,s){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=lt(this.ctx),s)){B.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[n,i,r,a]=s,o=new Path2D;o.rect(n,i,r-n,a-i),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,n,r,i,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const s=this.ctx;t.isolated||Fe("TODO: Support non-isolated groups."),t.knockout&&G("Knockout groups not supported.");const n=lt(s);if(t.matrix&&s.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let i=ae.slice();B.axialAlignedBoundingBox(t.bbox,lt(s),i),i=B.intersect(i,[0,0,s.canvas.width,s.canvas.height])||[0,0,0,0];const a=Math.floor(i[0]),o=Math.floor(i[1]),h=Math.max(Math.ceil(i[2])-a,1),c=Math.max(Math.ceil(i[3])-o,1);this.current.startNewPathAndClipBox([0,0,h,c]);let d="groupAt"+this.groupLevel;t.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,h,c),f=u.context;f.translate(-a,-o),f.transform(...n);let p=new Path2D;const[g,m,v,y]=t.bbox;if(p.rect(g,m,v-g,y-m),t.matrix){const b=new Path2D;b.addPath(p,new DOMMatrix(t.matrix)),p=b}f.clip(p),t.smask&&this.smaskStack.push({canvas:u.canvas,context:f,offsetX:a,offsetY:o,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),(!t.smask||this.dependencyTracker)&&(s.setTransform(1,0,0,1,0,0),s.translate(a,o),s.save()),xe(s,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(s),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(s),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;const s=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const i=lt(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...i);const r=ae.slice();B.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],i,r),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(e,t,s,n,i,r){if(this.#t(),Ye(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),s){const a=s[2]-s[0],o=s[3]-s[1];if(r&&this.annotationCanvasMap){(n=n.slice())[4]-=s[0],n[5]-=s[1],(s=s.slice())[0]=s[1]=0,s[2]=a,s[3]=o,B.singularValueDecompose2dScale(lt(this.ctx),Dt);const{viewportScale:h}=this,c=Math.ceil(a*this.outputScaleX*h),d=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,d);const{canvas:u,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(Dt[0],0,0,-Dt[1],0,o*Dt[1]),Ye(this.ctx)}else{Ye(this.ctx),this.endPath(e);const h=new Path2D;h.rect(s[0],s[1],a,o),this.ctx.clip(h)}}this.current=new Ln(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...n),this.transform(e,...i)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;const s=t.count;(t=this.getObject(e,t.data,t)).count=s;const n=this.ctx,i=this._createMaskCanvas(e,t),r=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(r,i.offsetX,i.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,i.offsetX,i.offsetX+r.width,i.offsetY,i.offsetY+r.height).recordOperation(e),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,s,n=0,i=0,r,a){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);const o=this.ctx;o.save();const h=lt(o);o.transform(s,n,i,r,0,0);const c=this._createMaskCanvas(e,t);o.setTransform(1,0,0,1,c.offsetX-h[4],c.offsetY-h[5]),this.dependencyTracker?.resetBBox(e);for(let d=0,u=a.length;d<u;d+=2){const f=B.transform(h,[s,n,i,r,a[d],a[d+1]]);o.drawImage(c.canvas,f[4],f[5]),this.dependencyTracker?.recordBBox(e,this.ctx,f[4],f[4]+c.canvas.width,f[5],f[5]+c.canvas.height)}o.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;const s=this.ctx,n=this.current.fillColor,i=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Ft_transformAndFill);for(const r of t){const{data:a,width:o,height:h,transform:c}=r,d=this.cachedCanvases.getCanvas("maskCanvas",o,h),u=d.context;u.save(),kn(u,this.getObject(e,a,r)),u.globalCompositeOperation="source-in",u.fillStyle=i?n.getPattern(u,this,_t(s),"Fill",e):n,u.fillRect(0,0,o,h),u.restore(),s.save(),s.transform(...c),s.scale(1,-1),Xe(s,d.canvas,0,0,o,h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,s,0,o,0,h),s.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;const s=this.getObject(e,t);s?this.paintInlineImageXObject(e,s):G("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,s,n,i){if(!this.contentVisible)return;const r=this.getObject(e,t);if(!r)return void G("Dependent image isn't ready yet");const a=r.width,o=r.height,h=[];for(let c=0,d=i.length;c<d;c+=2)h.push({transform:[s,0,0,n,i[c],i[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(e,r,h)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:s,height:n}=e,i=this.cachedCanvases.getCanvas("inlineImage",s,n),r=i.context;return r.filter=this.current.transferMaps,r.drawImage(t,0,0),r.filter="none",i.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;const s=t.width,n=t.height,i=this.ctx;this.save(e);const{filter:r}=i;let a;if("none"!==r&&""!==r&&(i.filter="none"),i.scale(1/s,-1/n),t.bitmap)a=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{const c=this.cachedCanvases.getCanvas("inlineImage",s,n).context;Fn(c,t),a=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(a,_t(i));i.imageSmoothingEnabled=Nn(lt(i),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,i,0,s,-n,0).recordDependencies(e,Ft_imageXObject).recordOperation(e),Xe(i,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,s,n),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,s){if(!this.contentVisible)return;const n=this.ctx;let i;if(t.bitmap)i=t.bitmap;else{const h=this.cachedCanvases.getCanvas("inlineImage",t.width,t.height).context;Fn(h,t),i=this.applyTransferMapsToCanvas(h)}this.dependencyTracker?.resetBBox(e);for(const r of s)n.save(),n.transform(...r.transform),n.scale(1,-1),Xe(n,i,r.x,r.y,r.w,r.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,1,-1,0),n.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Ft_fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,s){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,s){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push("OC"===t?{visible:this.optionalContentConfig.isVisible(s)}:{visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,s){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const i=this.ctx;this.pendingClip?(n||(this.pendingClip===Bn?i.clip(t,"evenodd"):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=lt(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),s=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(s,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:s,c:n,d:i}=this.ctx.getTransform();let r,a;if(0===s&&0===n){const o=Math.abs(t),h=Math.abs(i);if(o===h)if(0===e)r=a=1/o;else{const c=o*e;r=a=c<1?1/c:1}else if(0===e)r=1/o,a=1/h;else{const c=o*e,d=h*e;r=c<1?1/c:1,a=d<1?1/d:1}}else{const o=Math.abs(t*i-s*n),h=Math.hypot(t,s),c=Math.hypot(n,i);if(0===e)r=c/o,a=h/o;else{const d=e*o;r=c>d?c/d:1,a=h>d?h/d:1}}this._cachedScaleForStroking[0]=r,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:s,current:{lineWidth:n}}=this,[i,r]=this.getScaleForStroking();if(i===r)return s.lineWidth=(n||1)*i,void s.stroke(e);const a=s.getLineDash();t&&s.save(),s.scale(i,r),Ss.a=1/i,Ss.d=1/r;const o=new Path2D;if(o.addPath(e,Ss),a.length>0){const h=Math.max(i,r);s.setLineDash(a.map(c=>c/h)),s.lineDashOffset/=h}s.lineWidth=n||1,s.stroke(o),t&&s.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const l in qt)void 0!==oe.prototype[l]&&(oe.prototype[qt[l]]=oe.prototype[l]);class Xt{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");this.#t=e}static get workerSrc(){return this.#e}static set workerSrc(e){if("string"!=typeof e)throw new Error("Invalid `workerSrc` type.");this.#e=e}}class sr{#t;#e;constructor({parsedData:e,rawData:t}){this.#t=e,this.#e=t}getRaw(){return this.#e}get(e){return this.#t.get(e)??null}[Symbol.iterator](){return this.#t.entries()}}const le=Symbol("INTERNAL");class nr{#t=!1;#e=!1;#n=!1;#s=!0;constructor(e,{name:t,intent:s,usage:n,rbGroups:i}){this.#t=!!(2&e),this.#e=!!(4&e),this.name=t,this.intent=s,this.usage=n,this.rbGroups=i}get visible(){if(this.#n)return this.#s;if(!this.#s)return!1;const{print:e,view:t}=this.usage;return this.#t?"OFF"!==t?.viewState:!this.#e||"OFF"!==e?.printState}_setVisible(e,t,s=!1){e!==le&&nt("Internal method `_setVisible` called."),this.#n=s,this.#s=t}}class ir{#t=null;#e=new Map;#n=null;#s=null;constructor(e,t=2){if(this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#s=e.order;for(const s of e.groups)this.#e.set(s.id,new nr(t,s));if("OFF"===e.baseState)for(const s of this.#e.values())s._setVisible(le,!1);for(const s of e.on)this.#e.get(s)._setVisible(le,!0);for(const s of e.off)this.#e.get(s)._setVisible(le,!1);this.#n=this.getHash()}}#a(e){const t=e.length;if(t<2)return!0;const s=e[0];for(let n=1;n<t;n++){const i=e[n];let r;if(Array.isArray(i))r=this.#a(i);else{if(!this.#e.has(i))return G(`Optional content group not found: ${i}`),!0;r=this.#e.get(i).visible}switch(s){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===s}isVisible(e){if(0===this.#e.size)return!0;if(!e)return Fe("Optional content group not defined."),!0;if("OCG"===e.type)return this.#e.has(e.id)?this.#e.get(e.id).visible:(G(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#a(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#e.has(t))return G(`Optional content group not found: ${t}`),!0;if(this.#e.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#e.has(t))return G(`Optional content group not found: ${t}`),!0;if(!this.#e.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#e.has(t))return G(`Optional content group not found: ${t}`),!0;if(!this.#e.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#e.has(t))return G(`Optional content group not found: ${t}`),!0;if(this.#e.get(t).visible)return!1}return!0}return G(`Unknown optional content policy ${e.policy}.`),!0}return G(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,s=!0){const n=this.#e.get(e);if(n){if(s&&t&&n.rbGroups.length)for(const i of n.rbGroups)for(const r of i)r!==e&&this.#e.get(r)?._setVisible(le,!1,!0);n._setVisible(le,!!t,!0),this.#t=null}else G(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let s;for(const n of e){switch(n){case"ON":case"OFF":case"Toggle":s=n;continue}const i=this.#e.get(n);if(i)switch(s){case"ON":this.setVisibility(n,!0,t);break;case"OFF":this.setVisibility(n,!1,t);break;case"Toggle":this.setVisibility(n,!i.visible,t)}}this.#t=null}get hasInitialVisibility(){return null===this.#n||this.getHash()===this.#n}getOrder(){return this.#e.size?this.#s?this.#s.slice():[...this.#e.keys()]:null}getGroup(e){return this.#e.get(e)||null}getHash(){if(null!==this.#t)return this.#t;const e=new un;for(const[t,s]of this.#e)e.update(`${t}:${s.visible}`);return this.#t=e.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class rr{constructor(e,{disableRange:t=!1,disableStream:s=!1}){Z(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:i,progressiveDone:r,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=a,i?.length>0){const o=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(o)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!s,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((o,h)=>{this._onReceiveData({begin:o,chunk:h})}),e.addProgressListener((o,h)=>{this._onProgress({loaded:o,total:h})}),e.addProgressiveReadListener(o=>{this._onReceiveData({chunk:o})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const s=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;void 0===e?this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s):Z(this._rangeReaders.some(function(i){return i._begin===e&&(i._enqueue(s),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Z(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new ar(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new or(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(s),s}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class ar{constructor(e,t,s=!1,n=null){this._stream=e,this._done=s||!1,this._filename=_e(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;
1this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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}read(){var e=this;return(0,N.A)(function*(){if(e._queuedChunks.length>0)return{value:e._queuedChunks.shift(),done:!1};if(e._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return e._requests.push(t),t.promise})()}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class or{constructor(e,t,s){this._stream=e,this._begin=t,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){var e=this;return(0,N.A)(function*(){if(e._queuedChunk){const s=e._queuedChunk;return e._queuedChunk=null,{value:s,done:!1}}if(e._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return e._requests.push(t),t.promise})()}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function _n(l,e){const t=new Headers;if(!l||!e||"object"!=typeof e)return t;for(const s in e){const n=e[s];void 0!==n&&t.append(s,n)}return t}function Ke(l){return URL.parse(l)?.origin??null}function Un({responseHeaders:l,isHttp:e,rangeChunkSize:t,disableRange:s}){const n={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(l.get("Content-Length"),10);return!Number.isInteger(i)||(n.suggestedLength=i,i<=2*t)||s||!e||"bytes"!==l.get("Accept-Ranges")||"identity"!==(l.get("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n}function Hn(l){const e=l.get("Content-Disposition");if(e){let t=function lr(l){let e=!0,t=s("filename\\*","i").exec(l);if(t){t=t[1];let c=a(t);return c=unescape(c),c=o(c),c=h(c),i(c)}if(t=function r(c){const d=[];let u;const f=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(u=f.exec(c));){let[,g,m,v]=u;if(g=parseInt(g,10),g in d){if(0===g)break}else d[g]=[m,v]}const p=[];for(let g=0;g<d.length&&g in d;++g){let[m,v]=d[g];v=a(v),m&&(v=unescape(v),0===g&&(v=o(v))),p.push(v)}return p.join("")}(l),t)return i(h(t));if(t=s("filename","i").exec(l),t){t=t[1];let c=a(t);return c=h(c),i(c)}function s(c,d){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function n(c,d){if(c){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const u=new TextDecoder(c,{fatal:!0}),f=te(d);d=u.decode(f),e=!1}catch{}}return d}function i(c){return e&&/[\x80-\xff]/.test(c)&&(c=n("utf-8",c),e&&(c=n("iso-8859-1",c))),c}function a(c){if(c.startsWith('"')){const d=c.slice(1).split('\\"');for(let u=0;u<d.length;++u){const f=d[u].indexOf('"');-1!==f&&(d[u]=d[u].slice(0,f),d.length=u+1),d[u]=d[u].replaceAll(/\\(.)/g,"$1")}c=d.join('"')}return c}function o(c){const d=c.indexOf("'");return-1===d?c:n(c.slice(0,d),c.slice(d+1).replace(/^[^']*'/,""))}function h(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,u,f,p){if("q"===f||"Q"===f)return n(u,p=(p=p.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(g,m){return String.fromCharCode(parseInt(m,16))}));try{p=atob(p)}catch{}return n(u,p)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(_e(t))return t}return null}function Te(l,e){return new ge(`Unexpected server response (${l}) while retrieving PDF "${e}".`,l,404===l||0===l&&e.startsWith("file:"))}function jn(l){return 200===l||206===l}function $n(l,e,t){return{method:"GET",headers:l,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Gn(l){return l instanceof Uint8Array?l.buffer:l instanceof ArrayBuffer?l:(G(`getArrayBuffer - unexpected data format: ${l}`),new Uint8Array(l).buffer)}class hr{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=_n(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Z(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new cr(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new dr(this,e,t);return this._rangeRequestReaders.push(s),s}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class cr{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const s=new Headers(e.headers),n=t.url;fetch(n,$n(s,this._withCredentials,this._abortController)).then(i=>{if(e._responseOrigin=Ke(i.url),!jn(i.status))throw Te(i.status,n);this._reader=i.body.getReader(),this._headersCapability.resolve();const r=i.headers,{allowRangeRequests:a,suggestedLength:o}=Un({responseHeaders:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=Hn(r),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new $t("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}read(){var e=this;return(0,N.A)(function*(){yield e._headersCapability.promise;const{value:t,done:s}=yield e._reader.read();return s?{value:t,done:s}:(e._loaded+=t.byteLength,e.onProgress?.({loaded:e._loaded,total:e._contentLength}),{value:Gn(t),done:!1})})()}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class dr{constructor(e,t,s){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const i=new Headers(e.headers);i.append("Range",`bytes=${t}-${s-1}`);const r=n.url;fetch(r,$n(i,this._withCredentials,this._abortController)).then(a=>{const o=Ke(a.url);if(o!==e._responseOrigin)throw new Error(`Expected range response-origin "${o}" to match "${e._responseOrigin}".`);if(!jn(a.status))throw Te(a.status,r);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){var e=this;return(0,N.A)(function*(){yield e._readCapability.promise;const{value:t,done:s}=yield e._reader.read();return s?{value:t,done:s}:(e._loaded+=t.byteLength,e.onProgress?.({loaded:e._loaded}),{value:Gn(t),done:!1})})()}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class fr{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:s}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=_n(this.isHttp,t),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,s=this.currXhrId++,n=this.pendingRequests[s]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[i,r]of this.headers)t.setRequestHeader(i,r);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",Z(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,s),t.onprogress=this.onProgress.bind(this,s),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),s}onProgress(e,t){const s=this.pendingRequests[e];s&&s.onProgress?.(t)}onStateChange(e,t){const s=this.pendingRequests[e];if(!s)return;const n=s.xhr;if(n.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),4!==n.readyState||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===n.status&&this.isHttp)return void s.onError(n.status);const i=n.status||200;if((200!==i||206!==s.expectedStatus)&&i!==s.expectedStatus)return void s.onError(n.status);const a=function ur(l){const e=l.response;return"string"!=typeof e?e:te(e).buffer}(n);if(206===i){const o=n.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);h?s.onDone({begin:parseInt(h[1],10),chunk:a}):(G('Missing or invalid "Content-Range" header.'),s.onError(0))}else a?s.onDone({begin:0,chunk:a}):s.onError(n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}
1abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class pr{constructor(e){this._source=e,this._manager=new fr(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Z(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new gr(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const s=new mr(this._manager,e,t);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class gr{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=Ke(t.responseURL);const s=t.getAllResponseHeaders(),n=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[o,...h]=a.split(": ");return[o,h.join(": ")]}):[]),{allowRangeRequests:i,suggestedLength:r}=Un({responseHeaders:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=r||this._contentLength,this._filename=Hn(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Te(e,this._url),this._headersCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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._headersCapability.promise}read(){var e=this;return(0,N.A)(function*(){if(yield e._headersCapability.promise,e._storedError)throw e._storedError;if(e._cachedChunks.length>0)return{value:e._cachedChunks.shift(),done:!1};if(e._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return e._requests.push(t),t.promise})()}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class mr{constructor(e,t,s){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:s,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=Ke(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=Te(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}read(){var e=this;return(0,N.A)(function*(){if(e._storedError)throw e._storedError;if(null!==e._queuedChunk){const s=e._queuedChunk;return e._queuedChunk=null,{value:s,done:!1}}if(e._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return e._requests.push(t),t.promise})()}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
1(this._requestId),this._close()}}const vr=/^[a-z][a-z0-9\-+.]+:/i;class br{constructor(e){this.source=e,this.url=function yr(l){if(vr.test(l))return new URL(l);const e=Mt.getBuiltinModule("url");return new URL(e.pathToFileURL(l))}(e.url),Z("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Z(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Ar(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new wr(this,e,t);return this._rangeRequestReaders.push(s),s}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class Ar{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const s=Mt.getBuiltinModule("fs");s.promises.lstat(this._url).then(n=>{this._contentLength=n.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},n=>{"ENOENT"===n.code&&(n=Te(0,this._url.href)),this._storedError=n,this._headersCapability.reject(n)})}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}read(){var e=this;return(0,N.A)(function*(){if(yield e._readCapability.promise,e._done)return{value:void 0,done:!0};if(e._storedError)throw e._storedError;const t=e._readableStream.read();return null===t?(e._readCapability=Promise.withResolvers(),e.read()):(e._loaded+=t.length,e.onProgress?.({loaded:e._loaded,total:e._contentLength}),{value:new Uint8Array(t).buffer,done:!1})})()}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new $t("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class wr{constructor(e,t,s){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!e.source.disableStream;const i=Mt.getBuiltinModule("fs");this._setReadableStream(i.createReadStream(this._url,{start:t,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}read(){var e=this;return(0,N.A)(function*(){if(yield e._readCapability.promise,e._done)return{value:void 0,done:!0};if(e._storedError)throw e._storedError;const t=e._readableStream.read();return null===t?(e._readCapability=Promise.withResolvers(),e.read()):(e._loaded+=t.length,e.onProgress?.({loaded:e._loaded}),{value:new Uint8Array(t).buffer,done:!1})})()}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Ce=Symbol("INITIAL_DATA");class zn{#t=Object.create(null);#e(e){return this.#t[e]||={...Promise.withResolvers(),data:Ce}}get(e,t=null){if(t){const n=this.#e(e);return n.promise.then(()=>t(n.data)),null}const s=this.#t[e];
vendor: 3,261 bytes, line 1
1if(!s||s.data===Ce)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return s.data}has(e){const t=this.#t[e];return!!t&&t.data!==Ce}delete(e){const t=this.#t[e];return!(!t||t.data===Ce||(delete this.#t[e],0))}resolve(e,t=null){const s=this.#e(e);s.data=t,s.resolve()}clear(){for(const e in this.#t){const{data:t}=this.#t[e];t?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const e in this.#t){const{data:t}=this.#t[e];t!==Ce&&(yield[e,t])}}}class Rt{#t=Promise.withResolvers();#e=null;#n=!1;#s=!!globalThis.FontInspector?.enabled;#a=null;#r=null;#i=0;#o=0;#h=null;#l=null;#u=0;#d=0;#f=Object.create(null);#m=[];#g=null;#c=[];#p=new WeakMap;#v=null;static#b=new Map;static#y=new Map;static#T=new WeakMap;static#S=null;static#w=new Set;constructor({textContentSource:e,container:t,viewport:s}){if(e instanceof ReadableStream)this.#g=e;else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');this.#g=new ReadableStream({start(o){o.enqueue(e),o.close()}})}this.#e=this.#l=t,this.#d=s.scale*Bt.pixelRatio,this.#u=s.rotation,this.#r={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:i,pageX:r,pageY:a}=s.rawDims;this.#v=[1,0,0,-1,-r,a+i],this.#o=n,this.#i=i,Rt.#I(),t.style.setProperty("--min-font-size",Rt.#S),zt(t,s),this.#t.promise.finally(()=>{Rt.#w.delete(this),this.#r=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=ut.platform;return V(this,"fontFamilyMap",new Map([["sans-serif",(e&&t?"Calibri, ":"")+"sans-serif"],["monospace",(e&&t?"Lucida Console, ":"")+"monospace"]]))}render(){const e=()=>{this.#h.read().then(({value:t,done:s})=>{s?this.#t.resolve():(this.#a??=t.lang,Object.assign(this.#f,t.styles),this.#R(t.items),e())},this.#t.reject)};return this.#h=this.#g.getReader(),Rt.#w.add(this),e(),this.#t.promise}update({viewport:e,onBefore:t=null}){const s=e.scale*Bt.pixelRatio,n=e.rotation;if(n!==this.#u&&(t?.(),this.#u=n,zt(this.#l,{rotation:n})),s!==this.#d){t?.(),this.#d=s;const i={div:null,properties:null,ctx:Rt.#D(this.#a)};for(const r of this.#c)i.properties=this.#p.get(r),i.div=r,this.#x(i)}}cancel(){const e=new $t("TextLayer task cancelled.");this.#h?.cancel(e).catch(()=>{}),this.#h=null,this.#t.reject(e)}get textDivs(){return this.#c}get textContentItemsStr(){return this.#m}#R(e){if(this.#n)return;this.#r.ctx??=Rt.#D(this.#a);const t=this.#c,s=this.#m;for(const n of e){if(t.length>1e5)return G("Ignoring additional textDivs for performance reasons."),void(this.#n=!0);if(void 0!==n.str)s.push(n.str),this.#A(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const i=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),n.id&&this.#e.setAttribute("id",`${n.id}`),i.append(this.#e)}else"endMarkedContent"===n.type&&(this.#e=this.#e.parentNode)}}#A(e){const t=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};this.#c.push(t);const n=B.transform(this.#v,e.transform);let i=Math.atan2(n[1],n[0]);const r=this.#f[e.fontName];r.vertical&&(i+=Math.PI/2);let a=this.#s&&r.fontSubstitution||r.fontFamily;a=Rt.fontFamilyMap.get(a)||a;const o=Math.hypot(n[2],n[3]),h=o*Rt.#B(a,r,this.#a);let c,d;
vendor: 5,831 bytes, line 1
10===i?(c=n[4],d=n[5]-h):(c=n[4]+h*Math.sin(i),d=n[5]-h*Math.cos(i));const u=t.style;u.left=`${(100*c/this.#o).toFixed(2)}%`,u.top=`${(100*d/this.#i).toFixed(2)}%`,u.setProperty("--font-height",`${o.toFixed(2)}px`),u.fontFamily=a,s.fontSize=o,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#s&&(t.dataset.fontName=r.fontSubstitutionLoadedName||e.fontName),0!==i&&(s.angle=i*(180/Math.PI));let f=!1;if(e.str.length>1)f=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const p=Math.abs(e.transform[0]),g=Math.abs(e.transform[3]);p!==g&&Math.max(p,g)/Math.min(p,g)>1.5&&(f=!0)}if(f&&(s.canvasWidth=r.vertical?e.height:e.width),this.#p.set(t,s),this.#r.div=t,this.#r.properties=s,this.#x(this.#r),s.hasText&&this.#e.append(t),s.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),this.#e.append(p)}}#x(e){const{div:t,properties:s,ctx:n}=e,{style:i}=t;if(0!==s.canvasWidth&&s.hasText){const{fontFamily:r}=i,{canvasWidth:a,fontSize:o}=s;Rt.#P(n,o*this.#d,r);const{width:h}=n.measureText(t.textContent);h>0&&i.setProperty("--scale-x",a*this.#d/h)}0!==s.angle&&i.setProperty("--rotate",`${s.angle}deg`)}static cleanup(){if(!(this.#w.size>0)){this.#b.clear();for(const{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#D(e=null){let t=this.#y.get(e||="");if(!t){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=e,document.body.append(s),t=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(e,t),this.#T.set(t,{size:0,family:""})}return t}static#P(e,t,s){const n=this.#T.get(e);t===n.size&&s===n.family||(e.font=`${t}px ${s}`,n.size=t,n.family=s)}static#I(){if(null!==this.#S)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#B(e,t,s){const n=this.#b.get(e);if(n)return n;const i=this.#D(s);i.canvas.width=i.canvas.height=30,this.#P(i,30,e);const r=i.measureText(""),a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let h=.8;return a?h=a/(a+o):(ut.platform.isFirefox&&G("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?h=t.ascent:t.descent&&(h=1+t.descent)),this.#b.set(e,h),h}}function Wn(l={}){"string"==typeof l||l instanceof URL?l={url:l}:(l instanceof ArrayBuffer||ArrayBuffer.isView(l))&&(l={data:l});const e=new Cs,{docId:t}=e,s=l.url?function Di(l){if(l instanceof URL)return l.href;if("string"==typeof l){if(St)return l;const e=URL.parse(l,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(l.url):null,n=l.data?function Oi(l){if(St&&typeof Hs<"u"&&l instanceof Hs)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength)return l;if("string"==typeof l)return te(l);if(l instanceof ArrayBuffer||ArrayBuffer.isView(l)||"object"==typeof l&&!isNaN(l?.length))return new Uint8Array(l);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(l.data):null,i=l.httpHeaders||null,r=!0===l.withCredentials,a=l.password??null,o=l.range instanceof Rs?l.range:null,h=Number.isInteger(l.rangeChunkSize)&&l.rangeChunkSize>0?l.rangeChunkSize:65536;let c=l.worker instanceof mt?l.worker:null;const d=l.verbosity,u="string"!=typeof l.docBaseUrl||ye(l.docBaseUrl)?null:l.docBaseUrl,f=$e(l.cMapUrl),p=!1!==l.cMapPacked,g=l.CMapReaderFactory||(St?_i:An),m=$e(l.iccUrl),v=$e(l.standardFontDataUrl),y=l.StandardFontDataFactory||(St?Ui:Sn),b=$e(l.wasmUrl),E=l.WasmFactory||(St?Hi:Tn),A=!0!==l.stopAtErrors,w=Number.isInteger(l.maxImageSize)&&l.maxImageSize>-1?l.maxImageSize:-1,S=!1!==l.isEvalSupported,T="boolean"==typeof l.isOffscreenCanvasSupported?l.isOffscreenCanvasSupported:!St,x="boolean"==typeof l.isImageDecoderSupported?l.isImageDecoderSupported:!St&&(ut.platform.isFirefox||!globalThis.chrome),R=Number.isInteger(l.canvasMaxAreaInBytes)?l.canvasMaxAreaInBytes:-1,C="boolean"==typeof l.disableFontFace?l.disableFontFace:St,L=!0===l.fontExtraProperties,O=!0===l.enableXfa,M=l.ownerDocument||globalThis.document,j=!0===l.disableRange,D=!0===l.disableStream,I=!0===l.disableAutoFetch,U=!0===l.pdfBug,z=l.CanvasFactory||(St?Bi:Fi),st=l.FilterFactory||(St?Ni:ki),q=!0===l.enableHWA,K=!1!==l.useWasm,Q=o?o.length:l.length??NaN,it="boolean"==typeof l.useSystemFonts?l.useSystemFonts:!St&&!C,bt="boolean"==typeof l.useWorkerFetch?l.useWorkerFetch:!!(g===An&&y===Sn&&E===Tn&&f&&v&&b&&be(f,document.baseURI)&&be(v,document.baseURI)&&be(b,document.baseURI));!function li(l){Number.isInteger(l)&&(Le=l)}(d);const P={canvasFactory:new z({ownerDocument:M,enableHWA:q}),filterFactory:new st({docId:t,ownerDocument:M}),cMapReaderFactory:bt?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:bt?null:new y({baseUrl:v}),wasmFactory:bt?null:new E({baseUrl:b})};c||(c=mt.create({verbosity:d,port:Xt.workerPort}),e._worker=c);const k={docId:t,apiVersion:"5.4.530",data:n,password:a,disableAutoFetch:I,rangeChunkSize:h,length:Q,docBaseUrl:u,enableXfa:O,evaluatorOptions:{maxImageSize:w,disableFontFace:C,ignoreErrors:A,isEvalSupported:S,isOffscreenCanvasSupported:T,isImageDecoderSupported:x,canvasMaxAreaInBytes:R,fontExtraProperties:L,useSystemFonts:it,useWasm:K,useWorkerFetch:bt,cMapUrl:f,iccUrl:m,standardFontDataUrl:v,wasmUrl:b}},W={ownerDocument:M,pdfBug:U,styleElement:null,loadingParams:{disableAutoFetch:I,enableXfa:O}};return c.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");
1const et=c.messageHandler.sendWithPromise("GetDocRequest",k,n?[n.buffer]:null);let $;if(o)$=new rr(o,{disableRange:j,disableStream:D});else if(!n){if(!s)throw new Error("getDocument - no `url` parameter provided.");const rt=be(s)?hr:St?br:pr;$=new rt({url:s,length:Q,httpHeaders:i,withCredentials:r,rangeChunkSize:h,disableRange:j,disableStream:D})}return et.then(rt=>{if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const at=new Se(t,rt,c.port),kt=new Cr(at,e,$,W,P,q);e._transport=kt,at.send("Ready",null)})}).catch(e._capability.reject),e}class Cs{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Cs.#t++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}destroy(){var e=this;return(0,N.A)(function*(){e.destroyed=!0;try{e._worker?.port&&(e._worker._pendingDestroy=!0),yield e._transport?.destroy()}catch(t){throw e._worker?.port&&delete e._worker._pendingDestroy,t}e._transport=null,e._worker?.destroy(),e._worker=null})()}getData(){var e=this;return(0,N.A)(function*(){return e._transport.getData()})()}}class Rs{#t=Promise.withResolvers();#e=[];#n=[];#s=[];#a=[];constructor(e,t,s=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=s,this.contentDispositionFilename=n}addRangeListener(e){this.#a.push(e)}addProgressListener(e){this.#s.push(e)}addProgressiveReadListener(e){this.#n.push(e)}addProgressiveDoneListener(e){this.#e.push(e)}onDataRange(e,t){for(const s of this.#a)s(e,t)}onDataProgress(e,t){this.#t.promise.then(()=>{for(const s of this.#s)s(e,t)})}onDataProgressiveRead(e){this.#t.promise.then(()=>{for(const t of this.#n)t(e)})}onDataProgressiveDone(){this.#t.promise.then(()=>{for(const e of this.#e)e()})}transportReady(){this.#t.resolve()}requestDataRange(e,t){nt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class xr{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return V(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
1getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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()}}class Tr{#t=!1;constructor(e,t,s,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=s,this._stats=n?new Zs:null,this._pdfBug=n,this.commonObjs=s.commonObjs,this.objs=new zn,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}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:e,rotation:t=this.rotate,offsetX:s=0,offsetY:n=0,dontFlip:i=!1}={}){return new ve({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:s,offsetY:n,dontFlip:i})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return V(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){var e=this;return(0,N.A)(function*(){return e._transport._htmlForXfa?.children[e._pageIndex]||null})()}render({canvasContext:e,canvas:t=e.canvas,viewport:s,intent:n="display",annotationMode:i=jt.ENABLE,transform:r=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1,recordOperations:f=!1,operationsFilter:p=null}){this._stats?.time("Overall");const g=this._transport.getRenderingIntent(n,i,d,u),{renderingIntent:m,cacheKey:v}=g;this.#t=!1,o||=this._transport.getOptionalContentConfig(m);let y=this._intentStates.get(v);y||(y=Object.create(null),this._intentStates.set(v,y)),y.streamReaderCancelTimeout&&(clearTimeout(y.streamReaderCancelTimeout),y.streamReaderCancelTimeout=null);const b=!!(4&m);y.displayReadyCapability||(y.displayReadyCapability=Promise.withResolvers(),y.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(g));const E=!(!this._pdfBug||!globalThis.StepperManager?.enabled),A=!this.recordedBBoxes&&(f||E),w=x=>{if(y.renderTasks.delete(S),A){const R=S.gfx?.dependencyTracker.take();R&&(S.stepper&&S.stepper.setOperatorBBoxes(R,S.gfx.dependencyTracker.takeDebugMetadata()),f&&(this.recordedBBoxes=R))}b&&(this.#t=!0),this.#e(),x?(S.capability.reject(x),this._abortOperatorList({intentState:y,reason:x instanceof Error?x:new Error(x)})):S.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)
1)},S=new he({callback:w,params:{canvas:t,canvasContext:e,dependencyTracker:A?new $i(t,y.operatorList.length,E):null,viewport:s,transform:r,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:y.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:p});(y.renderTasks||=new Set).add(S);const T=S.task;return Promise.all([y.displayReadyCapability.promise,o]).then(([x,R])=>{if(this.destroyed)w();else{if(this._stats?.time("Rendering"),!(R.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:x,optionalContentConfig:R}),S.operatorListChanged()}}).catch(w),T}getOperatorList({intent:e="display",annotationMode:t=jt.ENABLE,printAnnotationStorage:s=null,isEditing:n=!1}={}){const r=this._transport.getRenderingIntent(e,t,s,n,!0);let o,a=this._intentStates.get(r.cacheKey);return a||(a=Object.create(null),this._intentStates.set(r.cacheKey,a)),a.opListReadCapability||(o=Object.create(null),o.operatorListChanged=function i(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(o))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(o),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:n=>n.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>me.textContent(s));const t=this.streamTextContent(e);return new Promise(function(s,n){const r=t.getReader(),a={items:[],styles:Object.create(null),lang:null};!function i(){r.read().then(function({value:o,done:h}){h?s(a):(a.lang??=o.lang,Object.assign(a.styles,o.styles),a.items.push(...o.items),i())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const s of t.renderTasks)e.push(s.completed),s.cancel();return this.objs.clear(),this.#t=!1,Promise.all(e)}cleanup(e=!1){this.#t=!0;const t=this.#e();return e&&t&&(this._stats&&=new Zs),t}#e(){if(!this.#t||this.destroyed)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}_startRenderPage(e,t){const s=this._intentStates.get(t);s&&(this._stats?.timeEnd("Page Request"),s.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let s=0,n=e.length;s<n;s++)t.operatorList.fnArray.push(e.fnArray[s]),t.operatorList.argsArray.push(e.argsArray[s]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const s of t.renderTasks)s.operatorListChanged();e.lastChunk&&this.#e()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:s,modifiedIds:n}){const{map:i,transfer:r}=s,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:n},r).getReader(),h=this._intentStates.get(t);h.streamReader=o;const c=()=>{o.read().then(({value:d,done:u})=>{u?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(d,h),c())},d=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const u of h.renderTasks)u.operatorListChanged();this.#e()}if(h.displayReadyCapability)h.displayReadyCapability.reject(d);else{if(!h.opListReadCapability)throw d;h.opListReadCapability.reject(d)}}})};c()}_abortOperatorList({intentState:e,reason:t,force:s=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!s){if(e.renderTasks.size>0)return;if(t instanceof Be){let n=100;return t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n))}}if(e.streamReader.cancel(new $t(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[n,i]of this._intentStates)if(i===e){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}}class mt{#t=Promise.withResolvers();#e=null;#n=null;#s=null;static#a=0;static#r=!1;static#i=(js=()=>{St&&(this.#r=!0,Xt.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{const s=URL.parse(e);if(!s?.origin||"null"===s.origin)return!1;const n=new URL(t,s);return s.origin===n.origin},this._createCDNWrapper=e=>URL.createObjectURL(new Blob([`await import("${e}");`],{type:"text/javascript"})),this.fromPort=e=>{if(function bi(l){console.log("Deprecated API usage: "+l)}("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.create(e)}},new WeakMap);constructor({name:e=null,port:t=null,verbosity:s=hi()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=s,t){if(mt.#i.has(t))throw new Error("Cannot use more than one PDFWorker per port.");mt.#i.set(t,this),this.#h(t)}else this.#l()}get promise(){return this.#t.promise}#o(){this.#t.resolve(),this.#e.send("configure",{verbosity:this.verbosity})}get port(){return this.#n}get messageHandler(){return this.#e}#h(e){this.#n=e,this.#e=new Se("main","worker",e),this.#e.on("ready",()=>{}),this.#o()}#l(){if(mt.#r||mt.#d)return void this.#u();let{workerSrc:e}=mt;try{mt._isSameOrigin(window.location,e)||(e=mt._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),s=new Se("main","worker",t),n=()=>{i.abort(),s.destroy(),t.terminate(),this.destroyed?this.#t.reject(new Error("Worker was destroyed")):this.#u()},i=new AbortController;t.addEventListener("error",()=>{this.#s||n()},{signal:i.signal}),s.on("test",a=>{i.abort(),!this.destroyed&&a?(this.#e=s,this.#n=t,this.#s=t,this.#o()):n()}),s.on("ready",a=>{if(i.abort(),this.destroyed)n();else try{r()}catch{this.#u()}});const r=()=>{const a=new Uint8Array;s.send("test",a,[a.buffer])};return void r()}catch{Fe("The worker has been disabled.")}this.#u()}#u(){mt.#r||(G("Setting up fake worker."),mt.#r=!0),mt._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#t.reject(new Error("Worker was destroyed"));const t=new Li;this.#n=t;const s="fake"+mt.#a++,n=new Se(s+"_worker",s,t);e.setup(n,t),this.#e=new Se(s,s+"_worker",t),this.#o()}).catch(e=>{this.#t.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#s?.terminate(),this.#s=null,mt.#i.delete(this.#n),this.#n=null,this.#e?.destroy(),this.#e=null}static create(e){const t=this.#i.get(e?.port);
1if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new mt(e)}static get workerSrc(){if(Xt.workerSrc)return Xt.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){var e=this;return V(this,"_setupFakeWorkerGlobal",function(){var s=(0,N.A)(function*(){return e.#d?e.#d:(yield import(e.workerSrc)).WorkerMessageHandler});return function(){return s.apply(this,arguments)}}()())}}js();class Cr{#t=new Map;#e=new Map;#n=new Map;#s=new Map;#a=null;constructor(e,t,s,n,i,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new zn,this.fontLoader=new Ci({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.wasmFactory=i.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=r,this.setupMessageHandler()}#r(e,t=null){const s=this.#t.get(e);if(s)return s;const n=this.messageHandler.sendWithPromise(e,t);return this.#t.set(e,n),n}get annotationStorage(){return V(this,"annotationStorage",new gs)}getRenderingIntent(e,t=jt.ENABLE,s=null,n=!1,i=!1){let r=2,a=ps;switch(e){case"any":r=1;break;case"display":break;case"print":r=4;break;default:G(`getRenderingIntent - invalid intent: ${e}`)}const o=4&r&&s instanceof fn?s:this.annotationStorage;switch(t){case jt.DISABLE:r+=64;break;case jt.ENABLE:break;case jt.ENABLE_FORMS:r+=16;break;case jt.ENABLE_STORAGE:r+=32,a=o.serializable;break;default:G(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(r+=128),i&&(r+=256);const{ids:h,hash:c}=o.modifiedIds;return{renderingIntent:r,cacheKey:[r,a.hash,c].join("_"),annotationStorageSerializable:a,modifiedIds:h}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#a?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of this.#e.values())e.push(s._destroy());this.#e.clear(),this.#n.clear(),this.#s.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),Rt.cleanup(),this._networkStream?.cancelAllRequests(new $t("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){var e=this;const{messageHandler:t,loadingTask:s}=this;t.on("GetReader",(n,i)=>{Z(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},i.onPull=()=>{this._fullReader.read().then(function({value:r,done:a}){a?i.close():(Z(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(r),1,[r]))}).catch(r=>{i.error(r)})},i.onCancel=r=>{this._fullReader.cancel(r),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",function(){var n=(0,N.A)(function*(i){yield e._fullReader.headersReady;const{isStreamingSupported:r,isRangeSupported:a,contentLength:o}=e._fullReader;return(!r||!a)&&(e._lastProgress&&s.onProgress?.(e._lastProgress),e._fullReader.onProgress=h=>{s.onProgress?.({loaded:h.loaded,total:h.total})}),{isStreamingSupported:r,isRangeSupported:a,contentLength:o}});return function(i){return n.apply(this,arguments)}}()),t.on("GetRangeReader",(n,i)=>{Z(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(n.begin,n.end);r?(i.onPull=()=>{r.read().then(function({value:a,done:o}){o?i.close():(Z(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a]))}).catch(a=>{i.error(a)})},i.onCancel=a=>{r.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}):i.close()}),t.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,s._capability.resolve(new xr(n,this))}),t.on("DocException",n=>{s._capability.reject(Tt(n))}),t.on("PasswordRequest",n=>{this.#a=Promise.withResolvers();try{if(!s.onPassword)throw Tt(n);s.onPassword(r=>{r instanceof Error?this.#a.reject(r):this.#a.resolve({password:r})},n.code)}catch(i){this.#a.reject(i)}return this.#a.promise}),t.on("DataLoaded",n=>{s.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),t.on("StartRenderPage",n=>{this.destroyed||this.#e.get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),t.on("commonobj",([n,i,r])=>
1{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in r){const u=r.error;G(`Error during font loading: ${u}`),this.commonObjs.resolve(n,u);break}const a=new Pi(r),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(u,f)=>globalThis.FontInspector.fontAdded(u,f):null,h=new Ri(a,o,r.extra,r.charProcOperatorList);this.fontLoader.bind(h).catch(()=>t.sendWithPromise("FontFallback",{id:n})).finally(()=>{!h.fontExtraProperties&&h.data&&h.clearData(),this.commonObjs.resolve(n,h)});break;case"CopyLocalImage":const{imageRef:c}=r;Z(c,"The imageRef must be defined.");for(const u of this.#e.values())for(const[,f]of u.objs)if(f?.ref===c)return f.dataLen?(this.commonObjs.resolve(n,structuredClone(f)),f.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new Ii(r));break;case"Image":this.commonObjs.resolve(n,r);break;case"Pattern":const d=new gt(r);this.commonObjs.resolve(n,d.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([n,i,r,a])=>{if(this.destroyed)return;const o=this.#e.get(i);if(!o.objs.has(n)){if(0===o._intentStates.size)return void a?.bitmap?.close();switch(r){case"Image":case"Pattern":o.objs.resolve(n,a);break;default:throw new Error(`Got unknown object type ${r}`)}}}),t.on("DocProgress",n=>{this.destroyed||s.onProgress?.({loaded:n.loaded,total:n.total})}),t.on("FetchBinaryData",function(){var n=(0,N.A)(function*(i){if(e.destroyed)throw new Error("Worker was destroyed.");const r=e[i.type];if(!r)throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);return r.fetch(i)});return function(i){return n.apply(this,arguments)}}())}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&G("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,s=this.#n.get(t);if(s)return s;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&this.#s.set(i.refStr,e);const r=new Tr(t,i,this,this._params.pdfBug);return this.#e.set(t,r),r});return this.#n.set(t,n),n}getPageIndex(e){return ms(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#r("GetFieldObjects")}hasJSActions(){return this.#r("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#r("GetDocJSActions")}
1getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#r("GetOptionalContentConfig").then(t=>new ir(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#t.get(e);if(t)return t;const s=this.messageHandler.sendWithPromise(e,null).then(n=>({info:n[0],metadata:n[1]?new sr(n[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:n[2]}));return this.#t.set(e,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(){var e=this;return(0,N.A)(function*(t=!1){if(!e.destroyed){yield e.messageHandler.sendWithPromise("Cleanup",null);for(const s of e.#e.values())if(!s.cleanup())throw new Error(`startCleanup: Page ${s.pageNumber} is currently rendering.`);e.commonObjs.clear(),t||e.fontLoader.clear(),e.#t.clear(),e.filterFactory.destroy(!0),Rt.cleanup()}}).apply(this,arguments)}cachedPageNumber(e){return ms(e)?this.#s.get(0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`)??null:null}}class Rr{#t=null;onContinue=null;onError=null;constructor(e){this.#t=e}get promise(){return this.#t.capability.promise}cancel(e=0){this.#t.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#t.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#t;return e.form||e.canvas&&t?.size>0}}class he{#t=null;static#e=new WeakSet;constructor({callback:e,params:t,objs:s,commonObjs:n,annotationCanvasMap:i,operatorList:r,pageIndex:a,canvasFactory:o,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=s,this.commonObjs=n,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Rr(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(he.#e.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.");he.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:n,background:i,dependencyTracker:r}=this.params,a=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new oe(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,r),this.gfx.beginDrawing({transform:n,viewport:s,transparency:e,background:i}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),he.#e.delete(this._canvas),e||=new Be(`Rendering cancelled, page ${this._pageIndex+1}`,t),this.callback(e),this.task.onError?.(e)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}
vendor: 8,816 bytes, line 1
1):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){var e=this;return(0,N.A)(function*(){e.cancelled||(e.operatorListIdx=e.gfx.executeOperatorList(e.operatorList,e.operatorListIdx,e._continueBound,e.stepper,e._operationsFilter),e.operatorListIdx===e.operatorList.argsArray.length&&(e.running=!1,e.operatorList.lastChunk&&(e.gfx.endDrawing(),he.#e.delete(e._canvas),e.callback())))})()}}const Xn="5.4.530",Yn="50cc4adac";class Ot{#t=null;#e=null;#n;#s=null;#a=!1;#r=!1;#i=null;#o;#h=null;#l=null;static#u=null;static get _keyboardManager(){return V(this,"_keyboardManager",new we([[["Escape","mac+Escape"],Ot.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ot.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ot.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ot.prototype._moveToPrevious],[["Home","mac+Home"],Ot.prototype._moveToBeginning],[["End","mac+End"],Ot.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#r=!1,this.#i=e):this.#r=!0,this.#l=e?._uiManager||t,this.#o=this.#l._eventBus,this.#n=e?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||"#FFFF98",Ot.#u||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#t=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#i&&(e.ariaControls=`${this.#i.id}_colorpicker_dropdown`);const t=this.#l._signal;e.addEventListener("click",this.#g.bind(this),{signal:t}),e.addEventListener("keydown",this.#m.bind(this),{signal:t});const s=this.#e=document.createElement("span");return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=this.#n,e.append(s),e}renderMainDropdown(){const e=this.#s=this.#d();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#d(){const e=document.createElement("div"),t=this.#l._signal;e.addEventListener("contextmenu",It,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#i&&(e.id=`${this.#i.id}_colorpicker_dropdown`);for(const[s,n]of this.#l.highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",n),i.title=s,i.setAttribute("data-l10n-id",Ot.#u[s]);const r=document.createElement("span");i.append(r),r.className="swatch",r.style.backgroundColor=n,i.ariaSelected=n===this.#n,i.addEventListener("click",this.#f.bind(this,n),{signal:t}),e.append(i)}return e.addEventListener("keydown",this.#m.bind(this),{signal:t}),e}#f(e,t){t.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:J.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#t)return void this.#g(e);const t=e.target.getAttribute("data-color");t&&this.#f(t,e)}_moveToNext(e){this.#p?e.target!==this.#t?e.target.nextSibling?.focus():this.#s.firstElementChild?.focus():this.#g(e)}_moveToPrevious(e){e.target!==this.#s?.firstElementChild&&e.target!==this.#t?(this.#p||this.#g(e),e.target.previousSibling?.focus()):this.#p&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#p?this.#s.firstElementChild?.focus():this.#g(e)}_moveToEnd(e){this.#p?this.#s.lastElementChild?.focus():this.#g(e)}#m(e){Ot._keyboardManager.exec(this,e)}#g(e){if(this.#p)return void this.hideDropdown();if(this.#a=0===e.detail,this.#h||(this.#h=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#l.combinedSignal(this.#h)})),this.#t.ariaExpanded="true",this.#s)return void this.#s.classList.remove("hidden");const t=this.#s=this.#d();this.#t.append(t)}#c(e){this.#s?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#s?.classList.add("hidden"),this.#t.ariaExpanded="false",this.#h?.abort(),this.#h=null}get#p(){return this.#s&&!this.#s.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#r){if(!this.#p)return void this.#i?.unselect();this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#a})}}updateColor(e){if(this.#e&&(this.#e.style.backgroundColor=e),!this.#s)return;const t=this.#l.highlightColors.values();for(const s of this.#s.children)s.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#s?.remove(),this.#s=null}}class Re{#t=null;#e=null;#n=null;static#s=null;constructor(e){this.#e=e,this.#n=e._uiManager,Re.#s||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#t)return this.#t;const{editorType:e,colorType:t,color:s}=this.#e,n=this.#t=document.createElement("input");return n.type="color",n.value=s||"#000000",n.className="basicColorPicker",n.tabIndex=0,n.setAttribute("data-l10n-id",Re.#s[e]),n.addEventListener("input",()=>{this.#n.updateParams(t,n.value)},{signal:this.#n._signal}),n}update(e){this.#t&&(this.#t.value=e)}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}function Kn(l){return Math.floor(255*Math.max(0,Math.min(1,l))).toString(16).padStart(2,"0")}function Pe(l){return Math.max(0,Math.min(255,255*l))}Y(116),Y(531);class Qn{static CMYK_G([e,t,s,n]){return["G",1-Math.min(1,.3*e+.59*s+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=Pe(e),e,e]}static G_HTML([e]){const t=Kn(e);return`#${t}${t}${t}`}static RGB_G([e,t,s]){return["G",.3*e+.59*t+.11*s]}static RGB_rgb(e){return e.map(Pe)}static RGB_HTML(e){return`#${e.map(Kn).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,s,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,s+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,s,n]){return[Pe(1-Math.min(1,e+n)),Pe(1-Math.min(1,s+n)),Pe(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,s]){const n=1-e,i=1-t,r=1-s;return["CMYK",n,i,r,Math.min(n,i,r)]}}class Pr{create(e,t,s=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),s||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){nt("Abstract method `_createSVG` called.")}}class Ie extends Pr{_createSVG(e){return document.createElementNS(Gt,e)}}const Yt=new WeakSet,Dr=60*(new Date).getTimezoneOffset()*1e3;class Ps{static create(e){switch(e.data.annotationType){case ct.LINK:return new Is(e);case ct.TEXT:return new Mr(e);case ct.WIDGET:switch(e.data.fieldType){case"Tx":return new Lr(e);case"Btn":return e.data.radioButton?new Jn(e):e.data.checkBox?new kr(e):new Nr(e);case"Ch":return new Br(e);case"Sig":return new Fr(e)}return new Kt(e);case ct.POPUP:return new Ds(e);case ct.FREETEXT:return new Zn(e);case ct.LINE:return new Ur(e);case ct.SQUARE:return new Hr(e);case ct.CIRCLE:return new jr(e);case ct.POLYLINE:return new qn(e);case ct.CARET:return new Gr(e);case ct.INK:return new Os(e);case ct.POLYGON:return new $r(e);case ct.HIGHLIGHT:return new ti(e);case ct.UNDERLINE:return new zr(e);case ct.SQUIGGLY:return new Vr(e);case ct.STRIKEOUT:return new Wr(e);case ct.STAMP:return new ei(e);case ct.FILEATTACHMENT:return new Xr(e);default:return new ht(e)}}}class ht{#t=null;#e=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:s=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(s)),n&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!(!e?.str&&!t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return ht._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}
vendor: 13,112 bytes, line 1
1get commentButtonPosition(){const e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:t,inkLists:s,rect:n}=this.data;let i=-1/0,r=-1/0;if(t?.length>=8){for(let a=0;a<t.length;a+=8)t[a+1]>r?(r=t[a+1],i=t[a+2]):t[a+1]===r&&(i=Math.max(i,t[a+2]));return[i,r]}if(s?.length>=1){for(const a of s)for(let o=0,h=a.length;o<h;o+=2)a[o+1]>r?(r=a[o+1],i=a[o]):a[o+1]===r&&(i=Math.max(i,a[o]));if(i!==1/0)return[i,r]}return n?[n[2],n[3]]:null}_normalizePoint(e){const{page:{view:t},viewport:{rawDims:{pageWidth:s,pageHeight:n,pageX:i,pageY:r}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/s,e[1]=100*(e[1]-r)/n,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${de}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){const{data:t}=this,s={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:s})||this.annotationStorage.setValue(`${de}${t.id}`,{id:t.id,annotationType:t.annotationType,pageIndex:this.parent.page._pageIndex,popup:s,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#t||={rect:this.data.rect.slice(0)});const{rect:t,popup:s}=e;t&&this.#s(t);let n=this.#n?.popup||this.popup;!n&&s?.text&&(this._createPopup(s),n=this.#n.popup),n&&(n.updateEdited(e),s?.deleted&&(n.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#t&&(this.#s(this.#t.rect),this.#n?.popup.resetEdited(),this.#t=null)}#s(e){const{container:{style:t},data:{rect:s,rotation:n},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:r,pageX:a,pageY:o}}}}=this;s?.splice(0,4,...e),t.left=100*(e[0]-a)/i+"%",t.top=100*(r-e[3]+o)/r+"%",0===n?(t.width=100*(e[2]-e[0])/i+"%",t.height=100*(e[3]-e[1])/r+"%"):this.setRotation(n)}_createContainer(e){const{data:t,parent:{page:s,viewport:n}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),!(this instanceof Kt)&&!(this instanceof Is)&&(i.tabIndex=0);const{style:r}=i;if(r.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add("norotate"),!t.rect||this instanceof Ds){const{rotation:g}=t;return!t.hasOwnCanvas&&0!==g&&this.setRotation(g,i),i}const{width:a,height:o}=this;if(!e&&t.borderStyle.width>0){r.borderWidth=`${t.borderStyle.width}px`;const g=t.borderStyle.horizontalCornerRadius,m=t.borderStyle.verticalCornerRadius;switch(g>0||m>0?r.borderRadius=`calc(${g}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`:this instanceof Jn&&(r.borderRadius=`calc(${a}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`),t.borderStyle.style){case 1:r.borderStyle="solid";break;case 2:r.borderStyle="dashed";break;case 3:G("Unimplemented border style: beveled");break;case 4:G("Unimplemented border style: inset");break;case 5:r.borderBottomStyle="solid"}const v=t.borderColor||null;v?(this.#e=!0,r.borderColor=B.makeHexColor(0|v[0],0|v[1],0|v[2])):r.borderWidth=0}const h=B.normalizeRect([t.rect[0],s.view[3]-t.rect[1]+s.view[1],t.rect[2],s.view[3]-t.rect[3]+s.view[1]]),{pageWidth:c,pageHeight:d,pageX:u,pageY:f}=n.rawDims;r.left=100*(h[0]-u)/c+"%",r.top=100*(h[1]-f)/d+"%";const{rotation:p}=t;return t.hasOwnCanvas||0===p?(r.width=100*a/c+"%",r.height=100*o/d+"%"):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:n}=this.parent.viewport.rawDims;let{width:i,height:r}=this;e%180!=0&&([i,r]=[r,i]),t.style.width=100*i/s+"%",t.style.height=100*r/n+"%",t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,s,n)=>{const i=n.detail[t],r=i[0],a=i.slice(1);n.target.style[s]=Qn[`${r}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[s]:Qn[`${r}_rgb`](a)})};return V(this,"_commonActions",{display:t=>{const{display:s}=t.detail,n=s%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===s||2===s})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:s}=t.detail;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:s,noView:s})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const s=t.detail.rotation;this.setRotation(s),this.annotationStorage.setValue(this.data.id,{rotation:s})}})}_dispatchEventFromSandbox(e,t){const s=this._commonActions;for(const n of Object.keys(t.detail))(e[n]||s[n])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const s=this._commonActions;for(const[n,i]of Object.entries(t)){const r=s[n];r&&(r({detail:{[n]:i},target:e}),delete t[n])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,s,n,i]=this.data.rect.map(g=>Math.fround(g));if(8===e.length){const[g,m,v,y]=e.subarray(2,6);if(n===g&&i===m&&t===v&&s===y)return}const{style:r}=this.container;let a;if(this.#e){const{borderColor:g,borderWidth:m}=r;r.borderWidth=0,a=["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="${g}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const o=n-t,h=i-s,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0),d.role="none";const u=c.createElement("defs");d.append(u);const f=c.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),u.append(f);for(let g=2,m=e.length;g<m;g+=8){const v=e[g],y=e[g+1],b=e[g+2],E=e[g+3],A=c.createElement("rect"),w=(b-t)/o,S=(i-y)/h,T=(v-b)/o,x=(y-E)/h;A.setAttribute("x",w),A.setAttribute("y",S),A.setAttribute("width",T),A.setAttribute("height",x),f.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${w}" y="${S}" width="${T}" height="${x}"/>`)}this.#e&&(a.push("</g></svg>')"),r.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){const{data:t}=this;let s,n;e?(s={str:e.text},n=e.date):(s=t.contentsObj,n=t.modificationDate),this.#n=new Ds({data:{color:t.color,titleObj:t.titleObj,modificationDate:n,contentsObj:s,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){nt("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const s=[];if(this._fieldObjects){const n=this._fieldObjects[e];if(n)for(const{page:i,id:r,exportValues:a}of n){if(-1===i||r===t)continue;const o="string"==typeof a?a:null,h=document.querySelector(`[data-element-id="${r}"]`);!h||Yt.has(h)?s.push({id:r,exportValue:o,domElement:h}):G(`_getElementsByName - element not allowed: ${r}`)}return s}for(const n of document.getElementsByName(e)){const{exportValue:i}=n,r=n.getAttribute("data-element-id");r!==t&&Yt.has(n)&&s.push({id:r,exportValue:i,domElement:n})}return s}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class Or extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}class Is extends ht{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,s=document.createElement("a");s.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(s,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(s,e.action,e.overlaidText),n=!0):e.attachment?(this.#e(s,e.attachment,e.overlaidText,e.attachmentDest),n=!0):e.setOCGState?(this.#n(s,e.setOCGState,e.overlaidText),n=!0):e.dest?(this._bindLink(s,e.dest,e.overlaidText),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,e),n=!0),e.resetForm?(this._bindResetFormAction(s,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(s,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&(this.contentElement=s,this.container.append(s)),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t,s=""){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#t(),s&&(e.title=s)}_bindNamedAction(e,t,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),s&&(e.title=s),this.#t()}#e(e,t,s="",n=null){e.href=this.linkService.getAnchorUrl(""),t.description?e.title=t.description:s&&(e.title=s),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#t()}#n(e,t,s=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),s&&(e.title=s),this.#t()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(t.actions)){const i=s.get(n);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}}),!1))}t.overlaidText&&(e.title=t.overlaidText),e.onclick||(e.onclick=()=>!1),this.#t()}_bindResetFormAction(e,t){const s=e.onclick;if(s||(e.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects)return G('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(s||(e.onclick=()=>!1));e.onclick=()=>{s?.();const{fields:n,refs:i,include:r}=t,a=[];if(0!==n.length||0!==i.length){const c=new Set(i);for(const d of n){const u=this._fieldObjects[d]||[];for(const{id:f}of u)c.add(f)}for(const d of Object.values(this._fieldObjects))for(const u of d)c.has(u.id)===r&&a.push(u)}else for(const c of Object.values(this._fieldObjects))a.push(...c);const o=this.annotationStorage,h=[];for(const c of a){const{id:d}=c;switch(h.push(d),c.type){case"text":case"combobox":case"listbox":o.setValue(d,{value:c.defaultValue||""});break;case"checkbox":case"radiobutton":o.setValue(d,{value:c.defaultValue===c.exportValues});break;default:continue}const u=document.querySelector(`[data-element-id="${d}"]`);u&&(Yt.has(u)?u.dispatchEvent(new Event("resetform")):G(`_bindResetFormAction - element not allowed: ${d}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}}class Mr extends ht{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}
1class Kt extends ht{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return ut.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,s,n,i){s.includes("mouse")?e.addEventListener(s,r=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(r),shift:r.shiftKey,modifier:this._getKeyModifier(r)}})}):e.addEventListener(s,r=>{if("blur"===s){if(!t.focused||!r.relatedTarget)return;t.focused=!1}else if("focus"===s){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(r)}})})}_setEventListeners(e,t,s,n){for(const[i,r]of s)("Action"===r||this.data.actions?.[r])&&(("Focus"===r||"Blur"===r)&&(t||={focused:!1}),this._setEventListener(e,t,i,r,n),"Focus"!==r||this.data.actions?.Blur?"Blur"===r&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":B.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:s}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,i=e.style;let r;const o=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-2),c=Math.round(h/(1.35*n))||1;r=Math.min(n,o(h/c/1.35))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-2);r=Math.min(n,o(h/1.35))}i.fontSize=`calc(${r}px * var(--total-scale-factor))`,i.color=B.makeHexColor(s[0],s[1],s[2]),null!==this.data.textAlignment&&(i.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class Lr extends Kt{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,s,n){const i=this.annotationStorage;
vendor: 4,257 bytes, line 1
1for(const r of this._getElementsByName(e.name,e.id))r.domElement&&(r.domElement[t]=s),i.setValue(r.id,{[n]:s})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const n=e.getValue(t,{value:this.data.fieldValue});let i=n.value||"";const r=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;r&&i.length>r&&(i=i.slice(0,r));let a=n.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:i,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=a??i,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",a??i),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),Yt.add(s),this.contentElement=s,s.setAttribute("data-element-id",t),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:h,datetimeType:c,timeStep:d}=this.data,u=!!c&&this.enableScripting;h&&(s.title=h),this._setRequired(s,this.data.required),r&&(s.maxLength=r),s.addEventListener("input",p=>{e.setValue(t,{value:p.target.value}),this.setPropertyOnSiblings(s,"value",p.target.value,"value"),o.formattedValue=null}),s.addEventListener("resetform",p=>{s.value=o.userValue=this.data.defaultFieldValue??"",o.formattedValue=null});let f=p=>{const{formattedValue:g}=o;null!=g&&(p.target.value=g),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",g=>{if(o.focused)return;const{target:m}=g;if(u&&(m.type=c,d&&(m.step=d)),o.userValue){const v=o.userValue;if(u)if("time"===c){const y=new Date(v),b=[y.getHours(),y.getMinutes(),y.getSeconds()];m.value=b.map(E=>E.toString().padStart(2,"0")).join(":")}else m.value=new Date(v-Dr).toISOString().split("date"===c?"T":".",1)[0];else m.value=v}o.lastCommittedValue=m.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),s.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target),this._dispatchEventFromSandbox({value(v){o.userValue=v.detail.value??"",u||e.setValue(t,{value:o.userValue.toString()}),v.target.value=o.userValue},formattedValue(v){const{formattedValue:y}=v.detail;o.formattedValue=y,null!=y&&v.target!==document.activeElement&&(v.target.value=y);const b={formattedValue:y};u&&(b.value=y),e.setValue(t,b)},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{const{charLimit:y}=v.detail,{target:b}=v;if(0===y)return void b.removeAttribute("maxLength");b.setAttribute("maxLength",y);let E=o.userValue;!E||E.length<=y||(E=E.slice(0,y),b.value=o.userValue=E,e.setValue(t,{value:E}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,willCommit:!0,commitKey:1,selStart:b.selectionStart,selEnd:b.selectionEnd}}))}},g)}),s.addEventListener("keydown",g=>{o.commitKey=1;let m=-1;if("Escape"===g.key?m=0:"Enter"!==g.key||this.data.multiLine?"Tab"===g.key&&(o.commitKey=3):m=2,-1===m)return;const{value:v}=g.target;o.lastCommittedValue!==v&&(o.lastCommittedValue=v,o.userValue=v,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:m,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const p=f;f=null,s.addEventListener("blur",g=>{if(!o.focused||!g.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{target:m}=g;let{value:v}=m;if(u){if(v&&"time"===c){const y=v.split(":").map(b=>parseInt(b,10));v=new Date(2e3,0,1,y[0],y[1],y[2]||0).valueOf(),m.step=""}else v.includes("T")||(v=`${v}T00:00`),v=new Date(v).valueOf();m.type="text"}o.userValue=v,o.lastCommittedValue!==v&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:o.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}),p(g)}),this.data.actions?.Keystroke&&s.addEventListener("beforeinput",g=>{o.lastCommittedValue=null;const{data:m,target:v}=g,{value:y,selectionStart:b,selectionEnd:E}=v;let A=b,w=E;
vendor: 4,231 bytes, line 1
1switch(g.inputType){case"deleteWordBackward":{const S=y.substring(0,b).match(/\w*[^\w]*$/);S&&(A-=S[0].length);break}case"deleteWordForward":{const S=y.substring(b).match(/^[^\w]*\w*/);S&&(w+=S[0].length);break}case"deleteContentBackward":b===E&&(A-=1);break;case"deleteContentForward":b===E&&(w+=1)}g.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:y,change:m||"",willCommit:!1,selStart:A,selEnd:w}})}),this._setEventListeners(s,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(f&&s.addEventListener("blur",f),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/r;s.classList.add("comb"),s.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Fr extends Kt{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class kr extends Kt{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,s=t.id;let n=e.getValue(s,{value:t.exportValue===t.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,e.setValue(s,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return Yt.add(i),i.setAttribute("data-element-id",s),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=0,i.addEventListener("change",r=>{const{name:a,checked:o}=r.target;for(const h of this._getElementsByName(a,s)){const c=o&&h.exportValue===t.exportValue;h.domElement&&(h.domElement.checked=c),e.setValue(h.id,{value:c})}e.setValue(s,{value:o})}),i.addEventListener("resetform",r=>{r.target.checked=(t.defaultFieldValue||"Off")===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({value(o){o.target.checked="Off"!==o.detail.value,e.setValue(s,{value:o.target.checked})}},r)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],r=>r.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Jn extends Kt{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,s=t.id;let n=e.getValue(s,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof n&&(n=n!==t.buttonValue,e.setValue(s,{value:n})),n)for(const r of this._getElementsByName(t.fieldName,s))e.setValue(r.id,{value:!1});const i=document.createElement("input");if(Yt.add(i),i.setAttribute("data-element-id",s),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.tabIndex=0,i.addEventListener("change",r=>{const{name:a,checked:o}=r.target;for(const h of this._getElementsByName(a,s))e.setValue(h.id,{value:!1});e.setValue(s,{value:o})}),i.addEventListener("resetform",r=>{const a=t.defaultFieldValue;r.target.checked=null!=a&&a===t.buttonValue}),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",a=>{this._dispatchEventFromSandbox({value:h=>{const c=r===h.detail.value;for(const d of this._getElementsByName(h.target.name)){const u=c&&d.id===s;d.domElement&&(d.domElement.checked=u),e.setValue(d.id,{value:u})}}},a)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}
vendor: 7,773 bytes, line 1
1return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Nr extends Is{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({},s)})),e}}class Br extends Kt{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,s=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");Yt.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",c=>{const d=this.data.defaultFieldValue;for(const u of n.options)u.selected=u.value===d});for(const c of this.data.options){const d=document.createElement("option");d.textContent=c.displayValue,d.value=c.exportValue,s.value.includes(c.exportValue)&&(d.setAttribute("selected",!0),i=!1),n.append(d)}let r=null;if(i){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),n.prepend(c),r=()=>{c.remove(),n.removeEventListener("input",r),r=null},n.addEventListener("input",r)}const a=c=>{const d=c?"value":"textContent",{options:u,multiple:f}=n;return f?Array.prototype.filter.call(u,p=>p.selected).map(p=>p[d]):-1===u.selectedIndex?null:u[u.selectedIndex][d]};let o=a(!1);const h=c=>Array.prototype.map.call(c.target.options,u=>({displayValue:u.textContent,exportValue:u.value}));return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",c=>{this._dispatchEventFromSandbox({value(u){r?.();const f=u.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(const g of n.options)g.selected=p.has(g.value);e.setValue(t,{value:a(!0)}),o=a(!1)},multipleSelection(u){n.multiple=!0},remove(u){const f=n.options,p=u.detail.remove;f[p].selected=!1,n.remove(p),f.length>0&&-1===Array.prototype.findIndex.call(f,m=>m.selected)&&(f[0].selected=!0),e.setValue(t,{value:a(!0),items:h(u)}),o=a(!1)},clear(u){for(;0!==n.length;)n.remove(0);e.setValue(t,{value:null,items:[]}),o=a(!1)},insert(u){const{index:f,displayValue:p,exportValue:g}=u.detail.insert,m=n.children[f],v=document.createElement("option");v.textContent=p,v.value=g,m?m.before(v):n.append(v),e.setValue(t,{value:a(!0),items:h(u)}),o=a(!1)},items(u){const{items:f}=u.detail;for(;0!==n.length;)n.remove(0);for(const p of f){const{displayValue:g,exportValue:m}=p,v=document.createElement("option");v.textContent=g,v.value=m,n.append(v)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:a(!0),items:h(u)}),o=a(!1)},indices(u){const f=new Set(u.detail.indices);for(const p of u.target.options)p.selected=f.has(p.index);e.setValue(t,{value:a(!0)}),o=a(!1)},editable(u){u.target.disabled=!u.detail.editable}},c)}),n.addEventListener("input",c=>{const d=a(!0),u=a(!1);e.setValue(t,{value:d}),c.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,change:u,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],c=>c.target.value)):n.addEventListener("input",function(c){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Ds extends ht{constructor(e){const{data:t,elements:s,parent:n}=e,i=!!n._commentManager;if(super(e,{isRenderable:!i&&ht._hasPopupData(t)}),this.elements=s,i&&ht._hasPopupData(t)){const r=this.popup=this.#t();for(const a of s)a.popup=r}else this.popup=null}#t(){return new _r({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const t=this.popup=this.#t(),s=[];for(const n of this.elements)n.popup=t,n.container.ariaHasPopup="dialog",s.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(n=>`${ee}${n}`).join(",")),this.container}}class _r{#t=null;#e=this.#z.bind(this);#n=this.#U.bind(this);#s=this.#L.bind(this);#a=this.#E.bind(this);#r=null;#i=null;#o=null;#h=null;#l=null;#u=null;#d=null;#f=!1;#m=null;#g=null;#c=null;#p=null;#v=null;#b=null;#y=null;#T=null;#S=null;#w=null;#R=!1;#A=null;#x=null;constructor({container:e,color:t,elements:s,titleObj:n,modificationDate:i,contentsObj:r,richText:a,parent:o,rect:h,parentRect:c,open:d,commentManager:u=null}){this.#i=e,this.#S=n,this.#o=r,this.#T=a,this.#u=o,this.#r=t,this.#y=h,this.#d=c,this.#l=s,this.#t=u,this.#A=s[0],this.#h=Ue.toDateObject(i),this.trigger=s.flatMap(f=>f.getElementsToTriggerPopup()),u||(this.#D(),this.#i.hidden=!0,d&&this.#E())}#D(){if(this.#g)return;this.#g=new AbortController;const{signal:e}=this.#g;for(const t of this.trigger)t.addEventListener("click",this.#a,{signal:e}),t.addEventListener("pointerenter",this.#s,{signal:e}),t.addEventListener("pointerleave",this.#n,{signal:e}),t.classList.add("popupTriggerArea");for(const t of this.#l)t.container?.addEventListener("keydown",this.#e,{signal:e})}#P(){const e=this.#l.find(t=>t.hasCommentButton);e&&(this.#v=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#p)return void(this.#p.parentNode||this.#A.container.after(this.#p));if(this.#v||this.#P(),!this.#v)return;const{signal:e}=this.#g=new AbortController,t=this.#A.hasOwnCommentButton,s=()=>{this.#t.toggleCommentPopup(this,!0,void 0,!t)},n=()=>{this.#t.toggleCommentPopup(this,!1,!0,!t)},i=()=>{this.#t.toggleCommentPopup(this,!1,!1)};if(t){this.#p=this.#A.container;for(const r of this.trigger)r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.addEventListener("keydown",this.#e,{signal:e}),r.addEventListener("click",s,{signal:e}),r.addEventListener("pointerenter",n,{signal:e}),r.addEventListener("pointerleave",i,{signal:e}),r.classList.add("popupTriggerArea")}else{const r=this.#p=document.createElement("button");r.className="annotationCommentButton";const a=this.#A.container;r.style.zIndex=a.style.zIndex+1,r.tabIndex=0,r.ariaHasPopup="dialog",r.ariaControls="commentPopup",r.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#B(),this.#I(),r.addEventListener("keydown",this.#e,{signal:e}),r.addEventListener("click",s,{signal:e}),r.addEventListener("pointerenter",n,{signal:e}),r.addEventListener("pointerleave",i,{signal:e}),a.after(r)}}#I(){if(this.#A.extraPopupElement&&!this.#A.editor)return;this.#p||this.renderCommentButton();const[e,t]=this.#v,{style:s}=this.#p;s.left=`calc(${e}%)`,s.top=`calc(${t}% - var(--comment-button-dim))`}#B(){this.#A.extraPopupElement||(this.#p||this.renderCommentButton(),this.#p.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:e,opacity:t}=this.#A.commentData;return e?this.#u._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#p?.focus()},0)}
vendor: 4,853 bytes, line 1
1getData(){const{richText:e,color:t,opacity:s,creationDate:n,modificationDate:i}=this.#A.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:s,creationDate:n,modificationDate:i}}get elementBeforePopup(){return this.#p}get comment(){return this.#x||=this.#A.commentText,this.#x}set comment(e){e!==this.comment&&(this.#A.commentText=this.#x=e)}focus(){this.#A.container?.focus()}get parentBoundingClientRect(){return this.#A.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#p&&(this.#p.classList.toggle("selected",e),this.#p.ariaExpanded=t)}setSelectedCommentButton(e){this.#p.classList.toggle("selected",e)}get commentPopupPosition(){if(this.#b)return this.#b;const{x:e,y:t,height:s}=this.#p.getBoundingClientRect(),{x:n,y:i,width:r,height:a}=this.#A.layer.getBoundingClientRect();return[(e-n)/r,(t+s-i)/a]}set commentPopupPosition(e){this.#b=e}hasDefaultPopupPosition(){return null===this.#b}get commentButtonPosition(){return this.#v}get commentButtonWidth(){return this.#p.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[t,s]=this.#b||this.commentButtonPosition.map(h=>h/100),n=this.parentBoundingClientRect,{x:i,y:r,width:a,height:o}=n;this.#t.showDialog(null,this,i+t*a,r+s*o,{...e,parentDimensions:n})}render(){if(this.#m)return;const e=this.#m=document.createElement("div");if(e.className="popup",this.#r){const s=e.style.outlineColor=B.makeHexColor(...this.#r);e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`}const t=document.createElement("span");if(t.className="header",this.#S?.str){const s=document.createElement("span");s.className="title",t.append(s),({dir:s.dir,str:s.textContent}=this.#S)}if(e.append(t),this.#h){const s=document.createElement("time");s.className="popupDate",s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#h.valueOf()})),s.dateTime=this.#h.toISOString(),t.append(s)}ds({html:this.#M||this.#o.str,dir:this.#o?.dir,className:"popupContent"},e),this.#i.append(e)}get#M(){const e=this.#T,t=this.#o;return e?.str&&(!t?.str||t.str===e.str)&&this.#T.html||null}get#F(){return this.#M?.attributes?.style?.fontSize||0}get#_(){return this.#M?.attributes?.style?.color||null}#k(e){const t=[],s={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:this.#_,fontSize:this.#F?`calc(${this.#F}px * var(--total-scale-factor))`:""}};for(const i of e.split("\n"))t.push({name:"span",value:i,attributes:n});return s}#z(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#f)&&this.#E()}updateEdited({rect:e,popup:t,deleted:s}){if(this.#t)return s?(this.remove(),this.#x=null):t&&(t.deleted?this.remove():(this.#B(),this.#x=t.text)),void(e&&(this.#v=null,this.#P(),this.#I()));s||t?.deleted?this.remove():(this.#D(),this.#w||={contentsObj:this.#o,richText:this.#T},e&&(this.#c=null),t&&t.text&&(this.#T=this.#k(t.text),this.#h=Ue.toDateObject(t.date),this.#o=null),this.#m?.remove(),this.#m=null)}resetEdited(){this.#w&&(({contentsObj:this.#o,richText:this.#T}=this.#w),this.#w=null,this.#m?.remove(),this.#m=null,this.#c=null)}remove(){if(this.#g?.abort(),this.#g=null,this.#m?.remove(),this.#m=null,this.#R=!1,this.#f=!1,this.#p?.remove(),this.#p=null,this.trigger)for(const e of this.trigger)e.classList.remove("popupTriggerArea")}#C(){if(null!==this.#c)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:s,pageX:n,pageY:i}}}=this.#u;let r=!!this.#d,a=r?this.#d:this.#y;for(const p of this.#l)if(!a||null!==B.intersect(p.data.rect,a)){a=p.data.rect,r=!0;break}const o=B.normalizeRect([a[0],e[3]-a[1]+e[1],a[2],e[3]-a[3]+e[1]]);this.#c=[100*(o[0]+(r?a[2]-a[0]+5:0)-n)/t,100*(o[1]-i)/s];const{style:f}=this.#i;f.left=`${this.#c[0]}%`,f.top=`${this.#c[1]}%`}#E(){this.#t?this.#t.toggleCommentPopup(this,!1):(this.#f=!this.#f,this.#f?(this.#L(),this.#i.addEventListener("click",this.#a),this.#i.addEventListener("keydown",this.#e)):(this.#U(),this.#i.removeEventListener("click",this.#a),this.#i.removeEventListener("keydown",this.#e)))}#L(){this.#m||this.render(),this.isVisible?this.#f&&this.#i.classList.add("focused"):(this.#C(),this.#i.hidden=!1,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)+1e3)}#U(){this.#i.classList.remove("focused"),!this.#f&&this.isVisible&&(this.#i.hidden=!0,this.#i.style.zIndex=parseInt(this.#i.style.zIndex)-1e3)}forceHide(){this.#R=this.isVisible,this.#R&&(this.#i.hidden=!0)}maybeShow(){this.#t||(this.#D(),this.#R&&(this.#m||this.#L(),this.#R=!1,this.#i.hidden=!1))}get isVisible(){return!this.#t&&!1===this.#i.hidden}}class Zn extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=X.FREETEXT}
vendor: 8,260 bytes, line 1
1render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const s=document.createElement("span");s.textContent=t,e.append(s)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}class Ur extends ht{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:s}=this,n=this.svgFactory.create(t,s,!0),i=this.#t=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),n.append(i),this.container.append(n),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Hr extends ht{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:s}=this,n=this.svgFactory.create(t,s,!0),i=e.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:rect");return r.setAttribute("x",i/2),r.setAttribute("y",i/2),r.setAttribute("width",t-i),r.setAttribute("height",s-i),r.setAttribute("stroke-width",i||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class jr extends ht{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:s}=this,n=this.svgFactory.create(t,s,!0),i=e.borderStyle.width,r=this.#t=this.svgFactory.createElement("svg:ellipse");return r.setAttribute("cx",t/2),r.setAttribute("cy",s/2),r.setAttribute("rx",t/2-i/2),r.setAttribute("ry",s/2-i/2),r.setAttribute("stroke-width",i||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),n.append(r),this.container.append(n),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class qn extends ht{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:t,borderStyle:s,popupRef:n},width:i,height:r}=this;if(!t)return this.container;const a=this.svgFactory.create(i,r,!0);let o=[];for(let c=0,d=t.length;c<d;c+=2)o.push(`${t[c]-e[0]},${e[3]-t[c+1]}`);o=o.join(" ");const h=this.#t=this.svgFactory.createElement(this.svgElementName);return h.setAttribute("points",o),h.setAttribute("stroke-width",s.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),a.append(h),this.container.append(a),!n&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class $r extends qn{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Gr extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}}class Os extends ht{#t=null;#e=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?X.HIGHLIGHT:X.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:t,inkLists:s,borderStyle:n,popupRef:i}}=this,{transform:r,width:a,height:o}=this.#n(t,e),h=this.svgFactory.create(a,o,!0),c=this.#t=this.svgFactory.createElement("svg:g");h.append(c),c.setAttribute("stroke-width",n.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",r);for(let d=0,u=s.length;d<u;d++){const f=this.svgFactory.createElement(this.svgElementName);this.#e.push(f),f.setAttribute("points",s[d].join(",")),c.append(f)}return!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(h),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:t,points:s,rect:n}=e,i=this.#t;if(t>=0&&i.setAttribute("stroke-width",t||1),s)for(let r=0,a=this.#e.length;r<a;r++)this.#e[r].setAttribute("points",s[r].join(","));if(n){const{transform:r,width:a,height:o}=this.#n(this.data.rotation,n);i.parentElement.setAttribute("viewBox",`0 0 ${a} ${o}`),i.setAttribute("transform",r)}}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class ti extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=X.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){const s=document.createElement("mark");s.classList.add("overlaidText"),s.textContent=e,this.container.append(s)}return this.container}}class zr extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=e,this.container.append(s)}return this.container}}class Vr extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=e,this.container.append(s)}return this.container}}class Wr extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){const s=document.createElement("s");s.classList.add("overlaidText"),s.textContent=e,this.container.append(s)}return this.container}}class ei extends ht{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=X.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}}
1class Xr extends ht{#t=null;constructor(e){super(e,{isRenderable:!0});const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let s;t.hasAppearance||0===t.fillAlpha?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),s.addEventListener("dblclick",this.#e.bind(this)),this.#t=s;const{isMac:n}=ut.platform;return e.addEventListener("keydown",i=>{"Enter"===i.key&&(n?i.metaKey:i.ctrlKey)&&this.#e()}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):s.classList.add("popupTriggerArea"),e.append(s),e}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}#e(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class Qe{#t=null;#e=null;#n=null;#s=new Map;#a=null;#r=null;#i=[];#o=!1;constructor({div:e,accessibilityManager:t,annotationCanvasMap:s,annotationEditorUIManager:n,page:i,viewport:r,structTreeLayer:a,commentManager:o,linkService:h,annotationStorage:c}){this.div=e,this.#t=t,this.#e=s,this.#a=a||null,this.#r=h||null,this.#n=c||new gs,this.page=i,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=n,this._commentManager=o||null}hasEditableAnnotations(){return this.#s.size>0}render(e){var t=this;return(0,N.A)(function*(){const{annotations:s}=e,n=t.div;zt(n,t.viewport);const i=new Map,r=[],a={data:null,layer:n,linkService:t.#r,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new Ie,annotationStorage:t.#n,enableComment:!0===e.enableComment,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:t,elements:null};for(const o of s){if(o.noHTML)continue;const h=o.annotationType===ct.POPUP;if(h){const u=i.get(o.id);if(!u)continue;if(!t._commentManager){r.push(o);continue}a.elements=u}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;a.data=o;const c=Ps.create(a);if(!c.isRenderable)continue;if(!h&&(t.#i.push(c),o.popupRef)){const u=i.get(o.popupRef);u?u.push(c):i.set(o.popupRef,[c])}const d=c.render();o.hidden&&(d.style.visibility="hidden"),c._isEditable&&(t.#s.set(c.data.id,c),t._annotationEditorUIManager?.renderAnnotationElement(c))}yield t.#h();for(const o of r){const h=a.elements=i.get(o.id);a.data=o;const c=Ps.create(a);if(!c.isRenderable)continue;const d=c.render();c.contentElement.id=`${ee}${o.id}`,o.hidden&&(d.style.visibility="hidden"),h.at(-1).container.after(d)}t.#l()})()}#h(){var e=this;return(0,N.A)(function*(){if(0===e.#i.length)return;e.div.replaceChildren();const t=[];if(!e.#o){e.#o=!0;for(const{contentElement:n,data:{id:i}}of e.#i){const r=n.id=`${ee}${i}`;t.push(e.#a?.getAriaAttributes(r).then(a=>{if(a)for(const[o,h]of a)n.setAttribute(o,h)}))}}e.#i.sort(({data:{rect:[n,i,r,a]}},{data:{rect:[o,h,c,d]}})=>{if(n===r&&i===a)return 1;if(o===c&&h===d)return-1;const p=(i+a)/2,v=(h+d)/2;return p>=d&&v<=i?-1:v>=a&&p<=h?1:(n+r)/2-(o+c)/2});const s=document.createDocumentFragment();for(const n of e.#i)s.append(n.container),e._commentManager?(n.extraPopupElement?.popup||n.popup)?.renderCommentButton():n.extraPopupElement&&s.append(n.extraPopupElement.render());if(e.div.append(s),yield Promise.all(t),e.#t)for(const n of e.#i)e.#t.addPointerInTextLayer(n.contentElement,!1)})()}addLinkAnnotations(e){var t=this;return(0,N.A)(function*(){const s={data:null,layer:t.div,linkService:t.#r,svgFactory:new Ie,parent:t};for(const n of e){n.borderStyle||=Qe._defaultBorderStyle,s.data=n;const i=Ps.create(s);i.isRenderable&&(i.render(),i.contentElement.id=`${ee}${n.id}`,t.#i.push(i))}yield t.#h()})()}update({viewport:e}){const t=this.div;this.viewport=e,zt(t,{rotation:e.rotation}),this.#l(),t.hidden=!1}#l(){if(!this.#e)return;const e=this.div;for(const[t,s]of this.#e){const n=e.querySelector(`[data-annotation-id="${t}"]`);if(!n)continue;s.className="annotationContent";const{firstChild:i}=n;
vendor: 5,959 bytes, line 1
1i?"CANVAS"===i.nodeName?i.replaceWith(s):i.classList.contains("annotationContent")?i.after(s):i.before(s):n.append(s);const r=this.#s.get(t);r&&(r._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,n.id,s),r._hasNoCanvas=!1):r.canvas=s)}this.#e.clear()}getEditableAnnotations(){return Array.from(this.#s.values())}getEditableAnnotation(e){return this.#s.get(e)}addFakeAnnotation(e){const{div:t}=this,{id:s,rotation:n}=e,i=new Or({data:{id:s,rect:e.getPDFRect(),rotation:n},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#r,annotationStorage:this.#n});return i.render(),i.contentElement.id=`${ee}${s}`,i.createOrUpdatePopup(),this.#i.push(i),i}removeAnnotation(e){const t=this.#i.findIndex(n=>n.data.id===e);if(t<0)return;const[s]=this.#i.splice(t,1);this.#t?.removePointerInTextLayer(s.contentElement)}updateFakeAnnotations(e){if(0!==e.length){for(const t of e)t.updateFakeAnnotationElement(this);this.#h()}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return V(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:1,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const Je=/\r\n?|\n/g;class vt extends H{#t="";#e=`${this.id}-editor`;#n=null;#s;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=vt.prototype,t=i=>i.isEmpty(),s=ie.TRANSLATE_SMALL,n=ie.TRANSLATE_BIG;return V(this,"_keyboardManager",new we([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-s,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[s,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,s],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}]]))}static _type="freetext";static _editorType=X.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.color=e.color||vt._defaultColor||H._defaultLineColor,this.#s=e.fontSize||vt._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static initialize(e,t){H.initialize(e,t);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case J.FREETEXT_SIZE:vt._defaultFontSize=t;break;case J.FREETEXT_COLOR:vt._defaultColor=t}}updateParams(e,t){switch(e){case J.FREETEXT_SIZE:this.#a(t);break;case J.FREETEXT_COLOR:this.#r(t)}}static get defaultPropertiesToUpdate(){return[[J.FREETEXT_SIZE,vt._defaultFontSize],[J.FREETEXT_COLOR,vt._defaultColor||H._defaultLineColor]]}get propertiesToUpdate(){return[[J.FREETEXT_SIZE,this.#s],[J.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new Re(this),[["colorPicker",this._colorPicker]]}get colorType(){return J.FREETEXT_COLOR}#a(e){const t=n=>{this.editorDiv.style.fontSize=`calc(${n}px * var(--total-scale-factor))`,this.translate(0,-(n-this.#s)*this.parentScale),this.#s=n,this.#o()},s=this.#s;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#r(e){const t=n=>{this.color=n,this.onUpdatedColor()},s=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-vt._internalPadding*e,-(vt._internalPadding+this.#s)*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#n=new AbortController;const e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return!!super.disableEditMode()&&(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#e),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0)}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#i(){const e=[];
vendor: 4,826 bytes, line 1
1this.editorDiv.normalize();let t=null;for(const s of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&"BR"===s.nodeName||(e.push(vt.#h(s)),t=s);return e.join("\n")}#o(){const[e,t]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:n,div:i}=this,r=i.style.display,a=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",n.div.append(this.div),s=i.getBoundingClientRect(),i.remove(),i.style.display=r,i.classList.toggle("hidden",a)}this.rotation%180==this.parentRotation%180?(this.width=s.width/e,this.height=s.height/t):(this.width=s.height/e,this.height=s.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#t,t=this.#t=this.#i().trimEnd();if(e===t)return;const s=n=>{this.#t=n,n?(this.#l(),this._uiManager.rebuild(this),this.#o()):this.remove()};this.addCommands({cmd:()=>{s(t)},undo:()=>{s(e)},mustExec:!1}),this.#o()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){vt._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#e),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,s.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[n,i]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);const[h,c]=this.pageDimensions,[d,u]=this.pageTranslation;let f,p;switch(this.rotation){case 0:f=e+(r[0]-d)/h,p=t+this.height-(r[1]-u)/c;break;case 90:f=e+(r[0]-d)/h,p=t-(r[1]-u)/c,[a,o]=[o,-a];break;case 180:f=e-this.width+(r[0]-d)/h,p=t-(r[1]-u)/c,[a,o]=[-a,-o];break;case 270:f=e+(r[0]-d-this.height*c)/h,p=t+(r[1]-u-this.width*h)/c,[a,o]=[-o,a]}this.setAt(f*n,p*i,a,o)}else this._moveAfterPaste(e,t);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#h(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Je,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:s}=t;if(1===s.length&&"text/plain"===s[0])return;e.preventDefault();const n=vt.#d(t.getData("text")||"").replaceAll(Je,"\n");if(!n)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const r=i.getRangeAt(0);if(!n.includes("\n"))return r.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void i.collapseToStart();const{startContainer:a,startOffset:o}=r,h=[],c=[];if(a.nodeType===Node.TEXT_NODE){const f=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(Je,"")),f!==this.editorDiv){let p=h;for(const g of this.editorDiv.childNodes)g!==f?p.push(vt.#h(g)):p=c}h.push(a.nodeValue.slice(0,o).replaceAll(Je,""))}else if(a===this.editorDiv){let f=h,p=0;for(const g of this.editorDiv.childNodes)p++===o&&(f=c),f.push(vt.#h(g))}this.#t=`${h.join("\n")}${n}${c.join("\n")}`,this.#l();const d=new Range;let u=Math.sumPrecise(h.map(f=>f.length));for(const{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){const p=f.nodeValue.length;if(u<=p){d.setStart(f,u),d.setEnd(f,u);break}u-=p}i.removeAllRanges(),i.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),this.#t)for(const e of this.#t.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#u(){return this.#t.replaceAll("\xa0"," ")}static#d(e){return e.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}getPDFRect(){const e=vt._internalPadding*this.parentScale;return this.getRect(e,e)}
vendor: 4,889 bytes, line 1
1static deserialize(e,t,s){var n=()=>super.deserialize,i=this;return(0,N.A)(function*(){let r=null;if(e instanceof Zn){const{data:{defaultAppearanceData:{fontSize:o,fontColor:h},rect:c,rotation:d,id:u,popupRef:f,richText:p,contentsObj:g,creationDate:m,modificationDate:v},textContent:y,textPosition:b,parent:{page:{pageNumber:E}}}=e;if(!y||0===y.length)return null;r=e={annotationType:X.FREETEXT,color:Array.from(h),fontSize:o,value:y.join("\n"),position:b,pageIndex:E-1,rect:c.slice(0),rotation:d,annotationElementId:u,id:u,deleted:!1,popupRef:f,comment:g?.str||null,richText:p,creationDate:m,modificationDate:v}}const a=yield n().call(i,e,t,s);return a.#s=e.fontSize,a.color=B.makeHexColor(...e.color),a.#t=vt.#d(e.value),a._initialData=r,e.comment&&a.setCommentData(e),a})()}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=H._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(e),{color:t,fontSize:this.#s,value:this.#u()});return this.addComment(s),e?(s.isCopy=!0,s):this.annotationElementId&&!this.#f(s)?null:(s.id=this.annotationElementId,s)}#f(e){const{value:t,fontSize:s,color:n,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==s||e.color.some((r,a)=>r!==n[a])||e.pageIndex!==i}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);if(!t)return null;const{style:s}=t;s.fontSize=`calc(${this.#s}px * var(--total-scale-factor))`,s.color=this.color,t.replaceChildren();for(const n of this.#t.split("\n")){const i=document.createElement("div");i.append(n?document.createTextNode(n):document.createElement("br")),t.append(i)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#t}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}let _=(()=>class l{static PRECISION=1e-4;toSVGPath(){nt("Abstract method `toSVGPath` must be implemented.")}get box(){nt("Abstract getter `box` must be implemented.")}serialize(t,s){nt("Abstract method `serialize` must be implemented.")}static _rescale(t,s,n,i,r,a){a||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)a[o]=s+t[o]*i,a[o+1]=n+t[o+1]*r;return a}static _rescaleAndSwap(t,s,n,i,r,a){a||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)a[o]=s+t[o+1]*i,a[o+1]=n+t[o]*r;return a}static _translate(t,s,n,i){i||=new Float32Array(t.length);for(let r=0,a=t.length;r<a;r+=2)i[r]=s+t[r],i[r+1]=n+t[r+1];return i}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,s,n,i,r){switch(r){case 90:return[1-s/n,t/i];case 180:return[1-t/n,1-s/i];case 270:return[s/n,1-t/i];default:return[t/n,s/i]}}static _normalizePagePoint(t,s,n){switch(n){case 90:return[1-s,t];case 180:return[1-t,1-s];case 270:return[s,1-t];default:return[t,s]}}static createBezierPoints(t,s,n,i,r,a){return[(t+5*n)/6,(s+5*i)/6,(5*n+r)/6,(5*i+a)/6,(n+r)/2,(i+a)/2]}})();class Qt{#t;#e=[];#n;#s;#a=[];#r=new Float32Array(18);#i;#o;#h;#l;#u;#d;#f=[];static#m=8;static#g=2;static#c=Qt.#m+Qt.#g;constructor({x:e,y:t},s,n,i,r,a=0){this.#t=s,this.#d=i*n,this.#s=r,this.#r.set([NaN,NaN,NaN,NaN,e,t],6),this.#n=a,this.#l=Qt.#m*n,this.#h=Qt.#c*n,this.#u=n,this.#f.push(e,t)}isEmpty(){return isNaN(this.#r[8])}#p(){const e=this.#r.subarray(4,6),t=this.#r.subarray(16,18),[s,n,i,r]=this.#t;return[(this.#i+(e[0]-t[0])/2-s)/i,(this.#o+(e[1]-t[1])/2-n)/r,(this.#i+(t[0]-e[0])/2-s)/i,(this.#o+(t[1]-e[1])/2-n)/r]}add({x:e,y:t}){this.#i=e,this.#o=t;const[s,n,i,r]=this.#t;let[a,o,h,c]=this.#r.subarray(8,12);const d=e-h,u=t-c,f=Math.hypot(d,u);if(f<this.#h)return!1;const p=f-this.#l,g=p/f,m=g*d,v=g*u;let y=a,b=o;a=h,o=c,h+=m,c+=v,this.#f?.push(e,t);const w=-v/p*this.#d,S=m/p*this.#d;return this.#r.set(this.#r.subarray(2,8),0),this.#r.set([h+w,c+S],4),this.#r.set(this.#r.subarray(14,18),12),this.#r.set([h-w,c-S],16),isNaN(this.#r[6])?(0===this.#a.length&&(this.#r.set([a+w,o+S],2),this.#a.push(NaN,NaN,NaN,NaN,(a+w-s)/i,(o+S-n)/r),this.#r.set([a-w,o-S],14),this.#e.push(NaN,NaN,NaN,NaN,(a-w-s)/i,(o-S-n)/r)),this.#r.set([y,b,a,o,h,c],6),!this.isEmpty()):(this.#r.set([y,b,a,o,h,c],6),Math.abs(Math.atan2(b-o,y-a)-Math.atan2(v,m))<Math.PI/2?([a,o,h,c]=this.#r.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((a+h)/2-s)/i,((o+c)/2-n)/r),[a,o,y,b]=this.#r.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((y+a)/2-s)/i,((b+o)/2-n)/r),!0):([y,b,a,o,h,c]=this.#r.subarray(0,6),this.#a.push(((y+5*a)/6-s)/i,((b+5*o)/6-n)/r,((5*a+h)/6-s)/i,((5*o+c)/6-n)/r,((a+h)/2-s)/i,((o+c)/2-n)/r),[h,c,a,o,y,b]=this.#r.subarray(12,18),this.#e.push(((y+5*a)/6-s)/i,((b+5*o)/6-n)/r,((5*a+h)/6-s)/i,((5*o+c)/6-n)/r,((a+h)/2-s)/i,((o+c)/2-n)/r),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#a,t=this.#e;if(isNaN(this.#r[6])&&!this.isEmpty())return this.#v();const s=[];
vendor: 8,833 bytes, line 1
1s.push(`M${e[4]} ${e[5]}`);for(let n=6;n<e.length;n+=6)isNaN(e[n])?s.push(`L${e[n+4]} ${e[n+5]}`):s.push(`C${e[n]} ${e[n+1]} ${e[n+2]} ${e[n+3]} ${e[n+4]} ${e[n+5]}`);this.#y(s);for(let n=t.length-6;n>=6;n-=6)isNaN(t[n])?s.push(`L${t[n+4]} ${t[n+5]}`):s.push(`C${t[n]} ${t[n+1]} ${t[n+2]} ${t[n+3]} ${t[n+4]} ${t[n+5]}`);return this.#b(s),s.join(" ")}#v(){const[e,t,s,n]=this.#t,[i,r,a,o]=this.#p();return`M${(this.#r[2]-e)/s} ${(this.#r[3]-t)/n} L${(this.#r[4]-e)/s} ${(this.#r[5]-t)/n} L${i} ${r} L${a} ${o} L${(this.#r[16]-e)/s} ${(this.#r[17]-t)/n} L${(this.#r[14]-e)/s} ${(this.#r[15]-t)/n} Z`}#b(e){const t=this.#e;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){const[t,s,n,i]=this.#t,r=this.#r.subarray(4,6),a=this.#r.subarray(16,18),[o,h,c,d]=this.#p();e.push(`L${(r[0]-t)/n} ${(r[1]-s)/i} L${o} ${h} L${c} ${d} L${(a[0]-t)/n} ${(a[1]-s)/i}`)}newFreeDrawOutline(e,t,s,n,i,r){return new si(e,t,s,n,i,r)}getOutlines(){const e=this.#a,t=this.#e,s=this.#r,[n,i,r,a]=this.#t,o=new Float32Array((this.#f?.length??0)+2);for(let d=0,u=o.length-2;d<u;d+=2)o[d]=(this.#f[d]-n)/r,o[d+1]=(this.#f[d+1]-i)/a;if(o[o.length-2]=(this.#i-n)/r,o[o.length-1]=(this.#o-i)/a,isNaN(s[6])&&!this.isEmpty())return this.#T(o);const h=new Float32Array(this.#a.length+24+this.#e.length);let c=e.length;for(let d=0;d<c;d+=2)isNaN(e[d])?h[d]=h[d+1]=NaN:(h[d]=e[d],h[d+1]=e[d+1]);c=this.#w(h,c);for(let d=t.length-6;d>=6;d-=6)for(let u=0;u<6;u+=2)isNaN(t[d+u])?(h[c]=h[c+1]=NaN,c+=2):(h[c]=t[d+u],h[c+1]=t[d+u+1],c+=2);return this.#S(h,c),this.newFreeDrawOutline(h,o,this.#t,this.#u,this.#n,this.#s)}#T(e){const t=this.#r,[s,n,i,r]=this.#t,[a,o,h,c]=this.#p(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-s)/i,(t[3]-n)/r,NaN,NaN,NaN,NaN,(t[4]-s)/i,(t[5]-n)/r,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,(t[16]-s)/i,(t[17]-n)/r,NaN,NaN,NaN,NaN,(t[14]-s)/i,(t[15]-n)/r],0),this.newFreeDrawOutline(d,e,this.#t,this.#u,this.#n,this.#s)}#S(e,t){const s=this.#e;return e.set([NaN,NaN,NaN,NaN,s[4],s[5]],t),t+6}#w(e,t){const s=this.#r.subarray(4,6),n=this.#r.subarray(16,18),[i,r,a,o]=this.#t,[h,c,d,u]=this.#p();return e.set([NaN,NaN,NaN,NaN,(s[0]-i)/a,(s[1]-r)/o,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,d,u,NaN,NaN,NaN,NaN,(n[0]-i)/a,(n[1]-r)/o],t),t+24}}class si extends _{#t;#e=new Float32Array(4);#n;#s;#a;#r;#i;constructor(e,t,s,n,i,r){super(),this.#i=e,this.#a=t,this.#t=s,this.#r=n,this.#n=i,this.#s=r,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#o(r);const[a,o,h,c]=this.#e;for(let d=0,u=e.length;d<u;d+=2)e[d]=(e[d]-a)/h,e[d+1]=(e[d+1]-o)/c;for(let d=0,u=t.length;d<u;d+=2)t[d]=(t[d]-a)/h,t[d+1]=(t[d+1]-o)/c}toSVGPath(){const e=[`M${this.#i[4]} ${this.#i[5]}`];for(let t=6,s=this.#i.length;t<s;t+=6)isNaN(this.#i[t])?e.push(`L${this.#i[t+4]} ${this.#i[t+5]}`):e.push(`C${this.#i[t]} ${this.#i[t+1]} ${this.#i[t+2]} ${this.#i[t+3]} ${this.#i[t+4]} ${this.#i[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,s,n],i){const r=s-e,a=n-t;let o,h;switch(i){case 0:o=_._rescale(this.#i,e,n,r,-a),h=_._rescale(this.#a,e,n,r,-a);break;case 90:o=_._rescaleAndSwap(this.#i,e,t,r,a),h=_._rescaleAndSwap(this.#a,e,t,r,a);break;case 180:o=_._rescale(this.#i,s,t,-r,a),h=_._rescale(this.#a,s,t,-r,a);break;case 270:o=_._rescaleAndSwap(this.#i,s,n,-r,-a),h=_._rescaleAndSwap(this.#a,s,n,-r,-a)}return{outline:Array.from(o),points:[Array.from(h)]}}#o(e){const t=this.#i;let s=t[4],n=t[5];const i=[s,n,s,n];let r=s,a=n,o=s,h=n;const c=e?Math.max:Math.min,d=new Float32Array(4);for(let f=6,p=t.length;f<p;f+=6){const g=t[f+4],m=t[f+5];isNaN(t[f])?(B.pointBoundingBox(g,m,i),a>m?(r=g,a=m):a===m&&(r=c(r,g)),h<m?(o=g,h=m):h===m&&(o=c(o,g))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,B.bezierBoundingBox(s,n,...t.slice(f,f+6),d),B.rectBoundingBox(d[0],d[1],d[2],d[3],i),a>d[1]?(r=d[0],a=d[1]):a===d[1]&&(r=c(r,d[0])),h<d[3]?(o=d[2],h=d[3]):h===d[3]&&(o=c(o,d[2]))),s=g,n=m}const u=this.#e;u[0]=i[0]-this.#n,u[1]=i[1]-this.#n,u[2]=i[2]-i[0]+2*this.#n,u[3]=i[3]-i[1]+2*this.#n,this.firstPoint=[r,a],this.lastPoint=[o,h]}get box(){return this.#e}newOutliner(e,t,s,n,i,r=0){return new Qt(e,t,s,n,i,r)}getNewOutline(e,t){const[s,n,i,r]=this.#e,[a,o,h,c]=this.#t,d=i*h,u=r*c,f=s*h+a,p=n*c+o,g=this.newOutliner({x:this.#a[0]*d+f,y:this.#a[1]*u+p},this.#t,this.#r,e,this.#s,t??this.#n);for(let m=2;m<this.#a.length;m+=2)g.add({x:this.#a[m]*d+f,y:this.#a[m+1]*u+p});return g.getOutlines()}}class Ms{#t;#e;#n;#s=[];#a=[];constructor(e,t=0,s=0,n=!0){const i=[1/0,1/0,-1/0,-1/0],a=10**-4;for(const{x:m,y:v,width:y,height:b}of e){const E=Math.floor((m-t)/a)*a,A=Math.ceil((m+y+t)/a)*a,w=Math.floor((v-t)/a)*a,S=Math.ceil((v+b+t)/a)*a;this.#s.push([E,w,S,!0],[A,w,S,!1]),B.rectBoundingBox(E,w,A,S,i)}const o=i[2]-i[0]+2*s,h=i[3]-i[1]+2*s,c=i[0]-s,d=i[1]-s;let u=n?-1/0:1/0,f=1/0;const p=this.#s.at(n?-1:-2),g=[p[0],p[2]];for(const m of this.#s){const[v,y,b,E]=m;!E&&n?y<f?(f=y,u=v):y===f&&(u=Math.max(u,v)):E&&!n&&(y<f?(f=y,u=v):y===f&&(u=Math.min(u,v))),m[0]=(v-c)/o,m[1]=(y-d)/h,m[2]=(b-d)/h}this.#t=new Float32Array([c,d,o,h]),this.#e=[u,f],this.#n=g}getOutlines(){this.#s.sort((t,s)=>t[0]-s[0]||t[1]-s[1]||t[2]-s[2]);const e=[];for(const t of this.#s)t[3]?(e.push(...this.#l(t)),this.#o(t)):(this.#h(t),e.push(...this.#l(t)));return this.#r(e)}#r(e){const t=[],s=new Set;for(const r of e){const[a,o,h]=r;t.push([a,o,r],[a,h,r])}t.sort((r,a)=>r[1]-a[1]||r[0]-a[0]);for(let r=0,a=t.length;r<a;r+=2){const o=t[r][2],h=t[r+1][2];o.push(h),h.push(o),s.add(o),s.add(h)}const n=[];let i;for(;s.size>0;){const r=s.values().next().value;let[a,o,h,c,d]=r;s.delete(r);let u=a,f=o;for(i=[a,h],n.push(i);;){let p;if(s.has(c))p=c;else{if(!s.has(d))break;p=d}s.delete(p),[a,o,h,c,d]=p,u!==a&&(i.push(u,f,a,f===o?o:h),u=a),f=f===o?h:o}i.push(u,f)}return new Yr(n,this.#t,this.#e,this.#n)}#i(e){const t=this.#a;let s=0,n=t.length-1;for(;s<=n;){const i=s+n>>1,r=t[i][0];if(r===e)return i;r<e?s=i+1:n=i-1}return n+1}#o([,e,t]){const s=this.#i(e);this.#a.splice(s,0,[e,t])}#h([,e,t]){const s=this.#i(e);for(let n=s;n<this.#a.length;n++){const[i,r]=this.#a[n];if(i!==e)break;if(i===e&&r===t)return void this.#a.splice(n,1)}for(let n=s-1;n>=0;n--){const[i,r]=this.#a[n];if(i!==e)break;if(i===e&&r===t)return void this.#a.splice(n,1)}}#l(e){const[t,s,n]=e,i=[[t,s,n]],r=this.#i(n);for(let a=0;a<r;a++){const[o,h]=this.#a[a];for(let c=0,d=i.length;c<d;c++){const[,u,f]=i[c];if(!(h<=u||f<=o)){if(u>=o){if(f>h)i[c][1]=h;else{if(1===d)return[];i.splice(c,1),c--,d--}continue}i[c][2]=o,f>h&&i.push([t,h,f])}}}return i}}class Yr extends _{#t;#e;constructor(e,t,s,n){super(),this.#e=e,this.#t=t,this.firstPoint=s,this.lastPoint=n}toSVGPath(){const e=[];for(const t of this.#e){let[s,n]=t;e.push(`M${s} ${n}`);for(let i=2;i<t.length;i+=2){const r=t[i],a=t[i+1];r===s?(e.push(`V${a}`),n=a):a===n&&(e.push(`H${r}`),s=r)}e.push("Z")}return e.join(" ")}serialize([e,t,s,n],i){const r=[],a=s-e,o=n-t;for(const h of this.#e){const c=new Array(h.length);for(let d=0;d<h.length;d+=2)c[d]=e+h[d]*a,c[d+1]=n-h[d+1]*o;r.push(c)}return r}get box(){return this.#t}get classNamesForOutlining(){return["highlightOutline"]}}class Ls extends Qt{newFreeDrawOutline(e,t,s,n,i,r){return new Kr(e,t,s,n,i,r)}}class Kr extends si{newOutliner(e,t,s,n,i,r=0){return new Ls(e,t,s,n,i,r)}}class dt extends H{#t=null;#e=0;#n;#s=null;#a=null;#r=null;#i=null;#o=0;#h=null;#l=null;#u=null;#d=!1;#f=null;#m=null;#g=null;#c="";#p;#v="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=X.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=dt.prototype;return V(this,"_keyboardManager",new we([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||dt._defaultColor,this.#p=e.thickness||dt._defaultThickness,this.opacity=e.opacity||dt._defaultOpacity,this.#n=e.boxes||null,this.#v=e.methodOfCreation||"",this.#c=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#d=!0,this.#y(e),this.#A()):this.#n&&(this.#t=e.anchorNode,this.#e=e.anchorOffset,this.#i=e.focusNode,this.#o=e.focusOffset,this.#b(),this.#A(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#d?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#p,methodOfCreation:this.#v}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("
1color").size}}#b(){const e=new Ms(this.#n,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;const t=new Ms(this.#n,.0025,.001,"ltr"===this._uiManager.direction);this.#r=t.getOutlines();const{firstPoint:s}=this.#l;this.#f=[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height];const{lastPoint:n}=this.#r;this.#m=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#y({highlightOutlines:e,highlightId:t,clipPathId:s}){if(this.#l=e,this.#r=e.getNewOutline(this.#p/2+1.5,.0025),t>=0)this.#u=t,this.#s=s,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#g=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},!0);else if(this.parent){const d=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:dt.#x(this.#l.box,(d-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#g,{bbox:dt.#x(this.#r.box,d),path:{d:this.#r.toSVGPath()}})}const[i,r,a,o]=e.box;switch(this.rotation){case 0:this.x=i,this.y=r,this.width=a,this.height=o;break;case 90:{const[d,u]=this.parentDimensions;this.x=r,this.y=1-i,this.width=a*u/d,this.height=o*d/u;break}case 180:this.x=1-i,this.y=1-r,this.width=a,this.height=o;break;case 270:{const[d,u]=this.parentDimensions;this.x=1-r,this.y=i,this.width=a*u/d,this.height=o*d/u;break}}const{firstPoint:h}=e;this.#f=[(h[0]-i)/a,(h[1]-r)/o];const{lastPoint:c}=this.#r;this.#m=[(c[0]-i)/a,(c[1]-r)/o]}static initialize(e,t){H.initialize(e,t),dt._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case J.HIGHLIGHT_COLOR:dt._defaultColor=t;break;case J.HIGHLIGHT_THICKNESS:dt._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#m}get commentButtonPosition(){return this.#f}updateParams(e,t){switch(e){case J.HIGHLIGHT_COLOR:this.#T(t);break;case J.HIGHLIGHT_THICKNESS:this.#S(t)}}static get defaultPropertiesToUpdate(){return[[J.HIGHLIGHT_COLOR,dt._defaultColor],[J.HIGHLIGHT_THICKNESS,dt._defaultThickness]]}get propertiesToUpdate(){return[[J.HIGHLIGHT_COLOR,this.color||dt._defaultColor],[J.HIGHLIGHT_THICKNESS,this.#p||dt._defaultThickness],[J.HIGHLIGHT_FREE,this.#d]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#a?.updateColor(this.color),super.onUpdatedColor()}#T(e){const t=(i,r)=>{this.color=i,this.opacity=r,this.onUpdatedColor()},s=this.color,n=this.opacity;this.addCommands({cmd:t.bind(this,e,dt._defaultOpacity),undo:t.bind(this,s,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#S(e){const t=this.#p,s=n=>{this.#p=n,this.#w(n)};this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:J.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#a=new Ot({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#I())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#I())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#R(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#A(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#R():e&&(this.#A(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#w(e){this.#d&&(this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())}#R(){null===this.#u||!this.parent||(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#g),this.#g=null)}#A(e=this.parent){null===this.#u&&(({id:this.#u,clipPathId:this.#s}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0)),this.#g=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},this.#d),this.#h&&(this.#h.style.clipPath=this.#s))}static#x([e,t,s,n],i){switch(i){case 90:return[1-t-n,e,n,s];case 180:return[1-e-s,1-t-n,s,n];case 270:return[t,1-e-s,n,s]}return[e,t,s,n]}rotate(e){const{drawLayer:t}=this.parent;let s;s=this.#d?dt.#x(this.#l.box,e=(e-this.rotation+360)%360):dt.#x([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#u,{bbox:s,root:{"data-main-rotation":e}}),t.updateProperties(this.#g,{bbox:dt.#x(this.#r.box,e),root:{"data-main-rotation":e}})}
vendor: 11,941 bytes, line 1
1render(){if(this.div)return this.div;const e=super.render();this.#c&&(e.setAttribute("aria-label",this.#c),e.setAttribute("role","mark")),this.#d?e.classList.add("free"):this.div.addEventListener("keydown",this.#D.bind(this),{signal:this._uiManager._signal});const t=this.#h=document.createElement("div");return e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#s,this.setDims(),hn(this,this.#h,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1}})}#D(e){dt._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#P(!0);break;case 1:case 3:this.#P(!1)}}#P(e){if(!this.#t)return;const t=window.getSelection();e?t.setPosition(this.#t,this.#e):t.setPosition(this.#i,this.#o)}select(){super.select(),this.#g&&this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#g&&(this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{selected:!1}}),this.#d||this.#P(!1))}get _mustFixPosition(){return!this.#d}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#g,{rootClass:{hidden:!e}}))}#I(){return this.#d?this.rotation:0}#B(){if(this.#d)return null;const[e,t]=this.pageDimensions,[s,n]=this.pageTranslation,i=this.#n,r=new Float32Array(8*i.length);let a=0;for(const{x:o,y:h,width:c,height:d}of i){const u=o*e+s,f=(1-h)*t+n;r[a]=r[a+4]=u,r[a+1]=r[a+3]=f,r[a+2]=r[a+6]=u+c*e,r[a+5]=r[a+7]=f-d*t,a+=8}return r}#M(e){return this.#l.serialize(e,this.#I())}static startHighlighting(e,t,{target:s,x:n,y:i}){const{x:r,y:a,width:o,height:h}=s.getBoundingClientRect(),c=new AbortController,d=e.combinedSignal(c),u=f=>{c.abort(),this.#_(e,f)};window.addEventListener("blur",u,{signal:d}),window.addEventListener("pointerup",u,{signal:d}),window.addEventListener("pointerdown",ot,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",It,{signal:d}),s.addEventListener("pointermove",this.#F.bind(this,e),{signal:d}),this._freeHighlight=new Ls({x:n,y:i},[r,a,o,h],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#F(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#_(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(e,t,s){var n=()=>super.deserialize,i=this;return(0,N.A)(function*(){let r=null;if(e instanceof ti){const{data:{quadPoints:m,rect:v,rotation:y,id:b,color:E,opacity:A,popupRef:w,richText:S,contentsObj:T,creationDate:x,modificationDate:R},parent:{page:{pageNumber:C}}}=e;r=e={annotationType:X.HIGHLIGHT,color:Array.from(E),opacity:A,quadPoints:m,boxes:null,pageIndex:C-1,rect:v.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,popupRef:w,richText:S,comment:T?.str||null,creationDate:x,modificationDate:R}}else if(e instanceof Os){const{data:{inkLists:m,rect:v,rotation:y,id:b,color:E,borderStyle:{rawWidth:A},popupRef:w,richText:S,contentsObj:T,creationDate:x,modificationDate:R},parent:{page:{pageNumber:C}}}=e;r=e={annotationType:X.HIGHLIGHT,color:Array.from(E),thickness:A,inkLists:m,boxes:null,pageIndex:C-1,rect:v.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,popupRef:w,richText:S,comment:T?.str||null,creationDate:x,modificationDate:R}}const{color:a,quadPoints:o,inkLists:h,opacity:c}=e,d=yield n().call(i,e,t,s);d.color=B.makeHexColor(...a),d.opacity=c||1,h&&(d.#p=e.thickness),d._initialData=r,e.comment&&d.setCommentData(e);const[u,f]=d.pageDimensions,[p,g]=d.pageTranslation;if(o){const m=d.#n=[];for(let v=0;v<o.length;v+=8)m.push({x:(o[v]-p)/u,y:1-(o[v+1]-g)/f,width:(o[v+2]-o[v])/u,height:(o[v+1]-o[v+5])/f});d.#b(),d.#A(),d.rotate(d.rotation)}else if(h){d.#d=!0;const m=h[0],v={x:m[0]-p,y:f-(m[1]-g)},y=new Ls(v,[0,0,u,f],1,d.#p/2,!0,.001);for(let A=0,w=m.length;A<w;A+=2)v.x=m[A]-p,v.y=f-(m[A+1]-g),y.add(v);const{id:b,clipPathId:E}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:d.color,"fill-opacity":d._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:y.toSVGPath()}},!0,!0);d.#y({highlightOutlines:y.getOutlines(),highlightId:b,clipPathId:E}),d.#A(),d.rotate(d.parentRotation)}return d})()}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=H._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),s=super.serialize(e);return Object.assign(s,{color:t,opacity:this.opacity,thickness:this.#p,quadPoints:this.#B(),outlines:this.#M(s.rect)}),this.addComment(s),this.annotationElementId&&!this.#k(s)?null:(s.id=this.annotationElementId,s)}#k(e){const{color:t}=this._initialData;return this.hasEditedComment||e.color.some((s,n)=>s!==t[n])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class ni{#t=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,s]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,s)}updateSVGProperty(e,t){this.#t[e]=t}toSVGProperties(){const e=this.#t;return this.#t=Object.create(null),{root:e}}reset(){this.#t=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){nt("Not implemented")}}let ii=(()=>{class l extends H{#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#s=null;static#a=null;static _INNER_MARGIN=3;constructor(t){super(t),this.#e=t.mustBeCommitted||!1,this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(this.#r(t),this.#h())}#r({drawOutlines:t,drawId:s,drawingOptions:n}){this.#t=t,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),s>=0?(this._drawId=s,this.parent.drawLayer.finalizeDraw(s,t.defaultProperties)):this._drawId=this.#i(t,this.parent),this.#d(t.box)}#i(t,s){const{id:n}=s.drawLayer.draw(l._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return n}static _mergeSVGProperties(t,s){const n=new Set(Object.keys(t));for(const[i,r]of Object.entries(s))n.has(i)?Object.assign(t[i],r):t[i]=r;return t}static getDefaultDrawingOptions(t){nt("Not implemented")}static get typesMap(){nt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,s){const n=this.typesMap.get(t);n&&this._defaultDrawingOptions.updateProperty(n,s),this._currentParent&&(l.#n.updateProperty(n,s),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,s){const n=this.constructor.typesMap.get(t);n&&this._updateProperty(t,n,s)}static get defaultPropertiesToUpdate(){const t=[],s=this._defaultDrawingOptions;for(const[n,i]of this.typesMap)t.push([n,s[i]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:s}=this;for(const[n,i]of this.constructor.typesMap)t.push([n,s[i]]);return t}_updateProperty(t,s,n){const i=this._drawingOptions,r=i[s],a=o=>{i.updateProperty(s,o);const h=this.#t.updateProperty(s,o);h&&this.#d(h),this.parent?.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#u()),{bbox:this.#f()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#u()),{bbox:this.#f()}))}_onTranslating(t,s){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#f()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#u(),this.parentDimensions),{bbox:this.#f()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#e&&(this.#e=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#o(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#h(),this.#d(this.#t.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let s=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#o()):t&&(this._uiManager.addShouldRescale(this),this.#h(t),s=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),s&&this.select()}#o(){null===this._drawId||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#h(t=this.parent){if(null===this._drawId||this.parent!==t){if(null!==this._drawId)return void this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);this._drawingOptions.updateAll(),this._drawId=this.#i(this.#t,t)}}#l([t,s,n,i]){const{parentDimensions:[r,a],rotation:o}=this;switch(o){case 90:return[s,1-t,n*(a/r),i*(r/a)];case 180:return[1-t,1-s,n,i];case 270:return[1-s,t,n*(a/r),i*(r/a)];default:return[t,s,n,i]}}#u(){const{x:t,y:s,width:n,height:i,parentDimensions:[r,a],rotation:o}=this;switch(o){case 90:return[1-s,t,n*(r/a),i*(a/r)];case 180:return[1-t,1-s,n,i];case 270:return[s,1-t,n*(r/a),i*(a/r)];default:return[t,s,n,i]}}#d(t){[this.x,this.y,this.width,this.height]=this.#l(t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#f(){const{x:t,y:s,width:n,height:i,rotation:r,parentRotation:a,parentDimensions:[o,h]}=this;switch((4*r+a)/90){case 1:return[1-s-i,t,i,n];case 2:return[1-t-n,1-s-i,n,i];case 3:return[s,1-t-n,i,n];case 4:return[t,s-n*(o/h),i*(h/o),n*(o/h)];case 5:return[1-s,t,n*(o/h),i*(h/o)];case 6:return[1-t-i*(h/o),1-s,i*(h/o),n*(o/h)];case 7:return[s-n*(o/h),1-t-i*(h/o),n*(o/h),i*(h/o)];case 8:return[t-n,s-i,n,i];case 9:return[1-s,t-n,i,n];case 10:return[1-t,1-s,n,i];case 11:return[s-i,1-t,i,n];case 12:return[t-i*(h/o),s,i*(h/o),n*(o/h)];case 13:return[1-s-n*(o/h),t-i*(h/o),n*(o/h),i*(h/o)];case 14:return[1-t,1-s-n*(o/h),i*(h/o),n*(o/h)];case 15:return[s,1-t,n*(o/h),i*(h/o)];default:return[t,s,n,i]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties({bbox:this.#f()},this.#t.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#d(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
vendor: 8,499 bytes, line 1
1render(){if(this.div)return this.div;let t,s;this._isCopy&&(t=this.x,s=this.y);const n=super.render();n.classList.add("draw");const i=document.createElement("div");return n.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,s),n}static createDrawerInstance(t,s,n,i,r){nt("Not implemented")}static startDrawing(t,s,n,i){const{target:r,offsetX:a,offsetY:o,pointerId:h,pointerType:c}=i;if(tt.isInitializedAndDifferentPointerType(c))return;const{viewport:{rotation:d}}=t,{width:u,height:f}=r.getBoundingClientRect(),p=l.#s=new AbortController,g=t.combinedSignal(p);tt.setPointer(c,h),window.addEventListener("pointerup",m=>{tt.isSamePointerIdOrRemove(m.pointerId)&&this._endDraw(m)},{signal:g}),window.addEventListener("pointercancel",m=>{tt.isSamePointerIdOrRemove(m.pointerId)&&this._currentParent.endDrawingSession()},{signal:g}),window.addEventListener("pointerdown",m=>{tt.isSamePointerType(m.pointerType)&&(tt.initializeAndAddPointerId(m.pointerId),l.#n.isCancellable()&&(l.#n.removeLastElement(),l.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",It,{signal:g}),r.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),r.addEventListener("touchmove",m=>{tt.isSameTimeStamp(m.timeStamp)&&ot(m)},{signal:g}),t.toggleDrawing(),s._editorUndoBar?.hide(),l.#n?t.drawLayer.updateProperties(this._currentDrawId,l.#n.startNew(a,o,u,f,d)):(s.updateUIForDefaultProperties(this),l.#n=this.createDrawerInstance(a,o,u,f,d),l.#a=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(l.#a.toSVGProperties(),l.#n.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(tt.isSameTimeStamp(t.timeStamp),!l.#n)return;const{offsetX:s,offsetY:n,pointerId:i}=t;if(tt.isSamePointerId(i)){if(tt.isUsingMultiplePointers())return void this._endDraw(t);this._currentParent.drawLayer.updateProperties(this._currentDrawId,l.#n.add(s,n)),tt.setTimeStamp(t.timeStamp),ot(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,l.#n=null,l.#a=null,tt.clearTimeStamp()),l.#s&&(l.#s.abort(),l.#s=null,tt.clearPointerIds())}static _endDraw(t){const s=this._currentParent;if(s){if(s.toggleDrawing(!0),this._cleanup(!1),t?.target===s.div&&s.drawLayer.updateProperties(this._currentDrawId,l.#n.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const n=l.#n,i=this._currentDrawId,r=n.getLastElement();return void s.addCommands({cmd:()=>{s.drawLayer.updateProperties(i,n.setLastElement(r))},undo:()=>{s.drawLayer.updateProperties(i,n.removeLastElement())},mustExec:!1,type:J.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const s=this._currentParent;if(!s)return null;if(s.toggleDrawing(!0),s.cleanUndoStack(J.DRAW_STEP),!l.#n.isEmpty()){const{pageDimensions:[n,i],scale:r}=s,a=s.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l.#n.getOutlines(n*r,i*r,r,this._INNER_MARGIN),drawingOptions:l.#a,mustBeCommitted:!t});return this._cleanup(!0),a}return s.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,s,n,i,r,a){nt("Not implemented")}static deserialize(t,s,n){var i=()=>super.deserialize,r=this;return(0,N.A)(function*(){const{rawDims:{pageWidth:a,pageHeight:o,pageX:h,pageY:c}}=s.viewport,d=r.deserializeDraw(h,c,a,o,r._INNER_MARGIN,t),u=yield i().call(r,t,s,n);return u.createDrawingOptions(t),u.#r({drawOutlines:d}),u.#h(),u.onScaleChanging(),u.rotate(),u})()}serializeDraw(t){const[s,n]=this.pageTranslation,[i,r]=this.pageDimensions;return this.#t.serialize([s,n,i,r],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}return l})();class Qr{#t=new Float64Array(6);#e;#n;#s;#a;#r;#i="";#o=0;#h=new De;#l;#u;constructor(e,t,s,n,i,r){this.#l=s,this.#u=n,this.#s=i,this.#a=r,[e,t]=this.#d(e,t);const a=this.#e=[NaN,NaN,NaN,NaN,e,t];this.#r=[e,t],this.#n=[{line:a,points:this.#r}],this.#t.set(a,0)}updateProperty(e,t){"stroke-width"===e&&(this.#a=t)}#d(e,t){return _._normalizePoint(e,t,this.#l,this.#u,this.#s)}isEmpty(){return!this.#n||0===this.#n.length}isCancellable(){return this.#r.length<=10}add(e,t){[e,t]=this.#d(e,t);const[s,n,i,r]=this.#t.subarray(2,6);return Math.hypot(this.#l*(e-i),this.#u*(t-r))<=2?null:(this.#r.push(e,t),isNaN(s)?(this.#t.set([i,r,e,t],2),this.#e.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#t[0])&&this.#e.splice(6,6),this.#t.set([s,n,i,r,e,t],0),this.#e.push(..._.createBezierPoints(s,n,i,r,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(2===this.#r.length?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,s,n,i){this.#l=s,this.#u=n,this.#s=i,[e,t]=this.#d(e,t);const r=this.#e=[NaN,NaN,NaN,NaN,e,t];this.#r=[e,t];const a=this.#n.at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),this.#n.push({line:r,points:this.#r}),this.#t.set(r,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#e=e.line,this.#r=e.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#h.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#h.removeLastElement();this.#n.pop(),this.#i="";for(let e=0,t=this.#n.length;e<t;e++){const{line:s,points:n}=this.#n[e];this.#e=s,this.#r=n,this.#o=0,this.toSVGPath()}return{path:{d:this.#i}}}toSVGPath(){const e=_.svgRound(this.#e[4]),t=_.svgRound(this.#e[5]);if(2===this.#r.length)return this.#i=`${this.#i} M ${e} ${t} Z`,this.#i;if(this.#r.length<=6){const n=this.#i.lastIndexOf("M");this.#i=`${this.#i.slice(0,n)} M ${e} ${t}`,this.#o=6}if(4===this.#r.length){const n=_.svgRound(this.#e[10]),i=_.svgRound(this.#e[11]);return this.#i=`${this.#i} L ${n} ${i}`,this.#o=12,this.#i}const s=[];0===this.#o&&(s.push(`M ${e} ${t}`),this.#o=6);for(let n=this.#o,i=this.#e.length;n<i;n+=6){const[r,a,o,h,c,d]=this.#e.slice(n,n+6).map(_.svgRound);s.push(`C${r} ${a} ${o} ${h} ${c} ${d}`)}return this.#i+=s.join(" "),this.#o=this.#e.length,this.#i}getOutlines(e,t,s,n){const i=this.#n.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#h.build(this.#n,e,t,s,this.#s,this.#a,n),this.#t=null,this.#e=null,this.#n=null,this.#i=null,this.#h}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class De extends _{#t;#e=0;#n;#s;#a;#r;#i;#o;#h;build(e,t,s,n,i,r,a){this.#a=t,this.#r=s,this.#i=n,this.#o=i,this.#h=r,this.#n=a??0,this.#s=e,this.#d()}get thickness(){return this.#h}setLastElement(e){return this.#s.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#s.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:t}of this.#s)if(e.push(`M${_.svgRound(t[4])} ${_.svgRound(t[5])}`),6!==t.length)if(12===t.length&&isNaN(t[6]))e.push(`L${_.svgRound(t[10])} ${_.svgRound(t[11])}`);else for(let s=6,n=t.length;s<n;s+=6){const[i,r,a,o,h,c]=t.subarray(s,s+6).map(_.svgRound);e.push(`C${i} ${r} ${a} ${o} ${h} ${c}`)}else e.push("Z");return e.join("")}serialize([e,t,s,n],i){const r=[],a=[],[o,h,c,d]=this.#u();let u,f,p,g,m,v,y,b,E;switch(this.#o){case 0:E=_._rescale,u=e,f=t+n,p=s,g=-n,m=e+o*s,v=t+(1-h-d)*n,y=e+(o+c)*s,b=t+(1-h)*n;break;case 90:E=_._rescaleAndSwap,u=e,f=t,p=s,g=n,m=e+h*s,v=t+o*n,y=e+(h+d)*s,b=t+(o+c)*n;break;case 180:E=_._rescale,u=e+s,f=t,p=-s,g=n,m=e+(1-o-c)*s,v=t+h*n,y=e+(1-o)*s,b=t+(h+d)*n;break;case 270:E=_._rescaleAndSwap,u=e+s,f=t+n,p=-s,g=-n,m=e+(1-h-d)*s,v=t+(1-o-c)*n,y=e+(1-h)*s,b=t+(1-o)*n}for(const{line:A,points:w}of this.#s)r.push(E(A,u,f,p,g,i?new Array(A.length):null)),a.push(E(w,u,f,p,g,i?new Array(w.length):null));return{lines:r,points:a,rect:[m,v,y,b]}}static deserialize(e,t,s,n,i,{paths:{lines:r,points:a},rotation:o,thickness:h}){const c=[];let d,u,f,p,g;switch(o){case 0:g=_._rescale,d=-e/s,u=t/n+1,f=1/s,p=-1/n;break;case 90:g=_._rescaleAndSwap,d=-t/n,u=-e/s,f=1/n,p=1/s;break;case 180:g=_._rescale,d=e/s+1,u=-t/n,f=-1/s,p=1/n;break;case 270:g=_._rescaleAndSwap,d=t/n+1,u=e/s+1,f=-1/n,p=-1/s}if(!r){r=[];for(const v of a){const y=v.length;if(2===y){r.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1]]));continue}if(4===y){r.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1],NaN,NaN,NaN,NaN,v[2],v[3]]));continue}const b=new Float32Array(3*(y-2));
vendor: 5,256 bytes, line 1
1r.push(b);let[E,A,w,S]=v.subarray(0,4);b.set([NaN,NaN,NaN,NaN,E,A],0);for(let T=4;T<y;T+=2){const x=v[T],R=v[T+1];b.set(_.createBezierPoints(E,A,w,S,x,R),3*(T-2)),[E,A,w,S]=[w,S,x,R]}}}for(let v=0,y=r.length;v<y;v++)c.push({line:g(r[v].map(b=>b??NaN),d,u,f,p),points:g(a[v].map(b=>b??NaN),d,u,f,p)});const m=new this.prototype.constructor;return m.build(c,s,n,1,o,h,i),m}#l(e=this.#h){const t=this.#n+e/2*this.#i;return this.#o%180==0?[t/this.#a,t/this.#r]:[t/this.#r,t/this.#a]}#u(){const[e,t,s,n]=this.#t,[i,r]=this.#l(0);return[e+i,t+r,s-2*i,n-2*r]}#d(){const e=this.#t=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:n}of this.#s){if(n.length<=12){for(let a=4,o=n.length;a<o;a+=6)B.pointBoundingBox(n[a],n[a+1],e);continue}let i=n[4],r=n[5];for(let a=6,o=n.length;a<o;a+=6){const[h,c,d,u,f,p]=n.subarray(a,a+6);B.bezierBoundingBox(i,r,h,c,d,u,f,p,e),i=f,r=p}}const[t,s]=this.#l();e[0]=Et(e[0]-t,0,1),e[1]=Et(e[1]-s,0,1),e[2]=Et(e[2]+t,0,1),e[3]=Et(e[3]+s,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#t}updateProperty(e,t){return"stroke-width"===e?this.#f(t):null}#f(e){const[t,s]=this.#l();this.#h=e;const[n,i]=this.#l(),[r,a]=[n-t,i-s],o=this.#t;return o[0]-=r,o[1]-=a,o[2]+=2*r,o[3]+=2*a,o}updateParentDimensions([e,t],s){const[n,i]=this.#l();this.#a=e,this.#r=t,this.#i=s;const[r,a]=this.#l(),o=r-n,h=a-i,c=this.#t;return c[0]-=o,c[1]-=h,c[2]+=2*o,c[3]+=2*h,c}updateRotation(e){return this.#e=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#t.map(_.svgRound).join(" ")}get defaultProperties(){const[e,t]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_.svgRound(e)} ${_.svgRound(t)}`}}}get rotationTransform(){const[,,e,t]=this.#t;let s=0,n=0,i=0,r=0,a=0,o=0;switch(this.#e){case 90:n=t/e,i=-e/t,a=e;break;case 180:s=-1,r=-1,a=e,o=t;break;case 270:n=-t/e,i=e/t,o=t;break;default:return""}return`matrix(${s} ${n} ${i} ${r} ${_.svgRound(a)} ${_.svgRound(o)})`}getPathResizingSVGProperties([e,t,s,n]){const[i,r]=this.#l(),[a,o,h,c]=this.#t;if(Math.abs(h-i)<=_.PRECISION||Math.abs(c-r)<=_.PRECISION){const g=e+s/2-(a+h/2),m=t+n/2-(o+c/2);return{path:{"transform-origin":`${_.svgRound(e)} ${_.svgRound(t)}`,transform:`${this.rotationTransform} translate(${g} ${m})`}}}const d=(s-2*i)/(h-2*i),u=(n-2*r)/(c-2*r),f=h/s,p=c/n;return{path:{"transform-origin":`${_.svgRound(a)} ${_.svgRound(o)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${_.svgRound(i)} ${_.svgRound(r)}) scale(${d} ${u}) translate(${_.svgRound(-i)} ${_.svgRound(-r)})`}}}getPathResizedSVGProperties([e,t,s,n]){const[i,r]=this.#l(),a=this.#t,[o,h,c,d]=a;if(a[0]=e,a[1]=t,a[2]=s,a[3]=n,Math.abs(c-i)<=_.PRECISION||Math.abs(d-r)<=_.PRECISION){const m=e+s/2-(o+c/2),v=t+n/2-(h+d/2);for(const{line:y,points:b}of this.#s)_._translate(y,m,v,y),_._translate(b,m,v,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_.svgRound(e)} ${_.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const u=(s-2*i)/(c-2*i),f=(n-2*r)/(d-2*r),p=-u*(o+i)+e+i,g=-f*(h+r)+t+r;if(1!==u||1!==f||0!==p||0!==g)for(const{line:m,points:v}of this.#s)_._rescale(m,p,g,u,f,m),_._rescale(v,p,g,u,f,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_.svgRound(e)} ${_.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],s){const[n,i]=s,r=this.#t,a=e-r[0],o=t-r[1];if(this.#a===n&&this.#r===i)for(const{line:h,points:c}of this.#s)_._translate(h,a,o,h),_._translate(c,a,o,c);else{const h=this.#a/n,c=this.#r/i;this.#a=n,this.#r=i;for(const{line:d,points:u}of this.#s)_._rescale(d,a,o,h,c,d),_._rescale(u,a,o,h,c,u);r[2]*=h,r[3]*=c}return r[0]=e,r[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${_.svgRound(e)} ${_.svgRound(t)}`}}}get defaultSVGProperties(){const e=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${_.svgRound(e[0])} ${_.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class Ze extends ni{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:H._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){"stroke-width"===e&&(t??=this["stroke-width"],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){const e=new Ze(this._viewParameters);return e.updateAll(this),e}}class Fs extends ii{static _type="ink";static _editorType=X.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,t){H.initialize(e,t),this._defaultDrawingOptions=new Ze(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return V(this,"typesMap",new Map([[J.INK_THICKNESS,"stroke-width"],[J.INK_COLOR,"stroke"],[J.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,s,n,i){return new Qr(e,t,s,n,i,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,s,n,i,r){return De.deserialize(e,t,s,n,i,r)}
vendor: 4,523 bytes, line 1
1static deserialize(e,t,s){var n=()=>super.deserialize,i=this;return(0,N.A)(function*(){let r=null;if(e instanceof Os){const{data:{inkLists:o,rect:h,rotation:c,id:d,color:u,opacity:f,borderStyle:{rawWidth:p},popupRef:g,richText:m,contentsObj:v,creationDate:y,modificationDate:b},parent:{page:{pageNumber:E}}}=e;r=e={annotationType:X.INK,color:Array.from(u),thickness:p,opacity:f,paths:{points:o},boxes:null,pageIndex:E-1,rect:h.slice(0),rotation:c,annotationElementId:d,id:d,deleted:!1,popupRef:g,richText:m,comment:v?.str||null,creationDate:y,modificationDate:b}}const a=yield n().call(i,e,t,s);return a._initialData=r,e.comment&&a.setCommentData(e),a})()}get toolbarButtons(){return this._colorPicker||=new Re(this),[["colorPicker",this._colorPicker]]}get colorType(){return J.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:t,parent:s}=this;t.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:s}){this._drawingOptions=Fs.getDefaultDrawingOptions({stroke:B.makeHexColor(...e),"stroke-width":t,"stroke-opacity":s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:t,points:s}=this.serializeDraw(e),{_drawingOptions:{stroke:n,"stroke-opacity":i,"stroke-width":r}}=this,a=Object.assign(super.serialize(e),{color:H._colorManager.convert(n),opacity:i,thickness:r,paths:{lines:t,points:s}});return this.addComment(a),e?(a.isCopy=!0,a):this.annotationElementId&&!this.#t(a)?null:(a.id=this.annotationElementId,a)}#t(e){const{color:t,thickness:s,opacity:n,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((r,a)=>r!==t[a])||e.thickness!==s||e.opacity!==n||e.pageIndex!==i}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const{points:t,rect:s}=this.serializeDraw(!1);return e.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:t,popup:this.comment}),null}}class ks extends De{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}class Jt{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(e,t,s,n){return n-=t,0===(s-=e)?n>0?0:4:1===s?n+6:2-n}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#s(e,t,s,n,i,r,a){const o=this.#e(s,n,i,r);for(let h=0;h<8;h++){const c=(-h+o-a+16)%8;if(0!==e[(s+this.#n[2*c])*t+(n+this.#n[2*c+1])])return c}return-1}static#a(e,t,s,n,i,r,a){const o=this.#e(s,n,i,r);for(let h=0;h<8;h++){const c=(h+o+a+16)%8;if(0!==e[(s+this.#n[2*c])*t+(n+this.#n[2*c+1])])return c}return-1}static#r(e,t,s,n){const i=e.length,r=new Int32Array(i);for(let c=0;c<i;c++)r[c]=e[c]<=n?1:0;for(let c=1;c<s-1;c++)r[c*t]=r[c*t+t-1]=0;for(let c=0;c<t;c++)r[c]=r[t*s-1-c]=0;let o,a=1;const h=[];for(let c=1;c<s-1;c++){o=1;for(let d=1;d<t-1;d++){const u=c*t+d,f=r[u];if(0===f)continue;let p=c,g=d;if(1===f&&0===r[u-1])a+=1,g-=1;else{if(!(f>=1&&0===r[u+1])){1!==f&&(o=Math.abs(f));continue}a+=1,g+=1,f>1&&(o=f)}const m=[d,c],v=g===d+1,y={isHole:v,points:m,id:a,parent:0};let b;h.push(y);for(const C of h)if(C.id===o){b=C;break}y.parent=b?b.isHole?v?b.parent:o:v?o:b.parent:v?o:0;const E=this.#s(r,t,c,d,p,g,0);if(-1===E){r[u]=-a,1!==r[u]&&(o=Math.abs(r[u]));continue}let A=this.#n[2*E],w=this.#n[2*E+1];const S=c+A,T=d+w;p=S,g=T;let x=c,R=d;for(;;){const C=this.#a(r,t,x,R,p,g,1);A=this.#n[2*C],w=this.#n[2*C+1];const L=x+A,O=R+w;m.push(O,L);const M=x*t+R;if(0===r[M+1]?r[M]=-a:1===r[M]&&(r[M]=a),L===c&&O===d&&x===S&&R===T){1!==r[u]&&(o=Math.abs(r[u]));break}p=x,g=R,x=L,R=O}}}return h}static#i(e,t,s,n){if(s-t<=4){for(let S=t;S<s-2;S+=2)n.push(e[S],e[S+1]);return}const i=e[t],r=e[t+1],a=e[s-4]-i,o=e[s-3]-r,h=Math.hypot(a,o),c=a/h,d=o/h,u=c*r-d*i,p=1/h,g=Math.atan(o/a),m=Math.cos(g),v=Math.sin(g),y=p*(Math.abs(m)+Math.abs(v)),b=p*(1-y+y**2),E=Math.max(Math.atan(Math.abs(v+m)*b),Math.atan(Math.abs(v-m)*b));let A=0,w=t;for(let S=t+2;S<s-2;S+=2){const T=Math.abs(u-c*e[S+1]+d*e[S]);T>A&&(w=S,A=T)}A>(h*E)**2?(this.#i(e,t,w+2,n),this.#i(e,w,s,n)):n.push(i,r)}static#o(e){const t=[],s=e.length;
1return this.#i(e,0,s,t),t.push(e[s-2],e[s-1]),t.length<=4?null:t}static#h(e,t,s,n,i,r){const a=new Float32Array(r**2),o=-2*n**2,h=r>>1;for(let g=0;g<r;g++){const m=(g-h)**2;for(let v=0;v<r;v++)a[g*r+v]=Math.exp((m+(v-h)**2)/o)}const c=new Float32Array(256),d=-2*i**2;for(let g=0;g<256;g++)c[g]=Math.exp(g**2/d);const f=new Uint8Array(e.length),p=new Uint32Array(256);for(let g=0;g<s;g++)for(let m=0;m<t;m++){const v=g*t+m,y=e[v];let b=0,E=0;for(let w=0;w<r;w++){const S=g+w-h;if(!(S<0||S>=s))for(let T=0;T<r;T++){const x=m+T-h;if(x<0||x>=t)continue;const R=e[S*t+x],C=a[w*r+T]*c[Math.abs(R-y)];b+=R*C,E+=C}}p[f[v]=Math.round(b/E)]++}return[f,p]}static#l(e){const t=new Uint32Array(256);for(const s of e)t[s]++;return t}static#u(e){const s=new Uint8ClampedArray(e.length>>2);let n=-1/0,i=1/0;for(let a=0,o=s.length;a<o;a++){const h=s[a]=e[a<<2];n=Math.max(n,h),i=Math.min(i,h)}const r=255/(n-i);for(let a=0,o=s.length;a<o;a++)s[a]=(s[a]-i)*r;return s}static#d(e){let t,s=-1/0,n=-1/0;const i=e.findIndex(o=>0!==o);let r=i,a=i;for(t=i;t<256;t++){const o=e[t];o>s&&(t-r>n&&(n=t-r,a=t-1),s=o,r=t)}for(t=a-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){const t=e,{width:s,height:n}=e,{maxDim:i}=this.#t;let r=s,a=n;if(s>i||n>i){let u=s,f=n,p=Math.log2(Math.max(s,n)/i);const g=Math.floor(p);p=p===g?g-1:g;for(let v=0;v<p;v++){r=Math.ceil(u/2),a=Math.ceil(f/2);const y=new OffscreenCanvas(r,a);y.getContext("2d").drawImage(e,0,0,u,f,0,0,r,a),u=r,f=a,e!==t&&e.close(),e=y.transferToImageBitmap()}const m=Math.min(i/r,i/a);r=Math.round(r*m),a=Math.round(a*m)}const h=new OffscreenCanvas(r,a).getContext("2d",{willReadFrequently:!0});h.fillStyle="white",h.fillRect(0,0,r,a),h.filter="grayscale(1)",h.drawImage(e,0,0,e.width,e.height,0,0,r,a);const c=h.getImageData(0,0,r,a).data;return[this.#u(c),r,a]}static extractContoursFromText(e,{fontFamily:t,fontStyle:s,fontWeight:n},i,r,a,o){let h=new OffscreenCanvas(1,1),c=h.getContext("2d",{alpha:!1});const u=c.font=`${s} ${n} 200px ${t}`,{actualBoundingBoxLeft:f,actualBoundingBoxRight:p,actualBoundingBoxAscent:g,actualBoundingBoxDescent:m,fontBoundingBoxAscent:v,fontBoundingBoxDescent:y,width:b}=c.measureText(e),A=Math.ceil(1.5*Math.max(Math.abs(f)+Math.abs(p)||0,b)),w=Math.ceil(1.5*Math.max(Math.abs(g)+Math.abs(m)||200,Math.abs(v)+Math.abs(y)||200));h=new OffscreenCanvas(A,w),c=h.getContext("2d",{alpha:!0,willReadFrequently:!0}),c.font=u,c.filter="grayscale(1)",c.fillStyle="white",c.fillRect(0,0,A,w),c.fillStyle="black",c.fillText(e,.5*A/2,1.5*w/2);const S=this.#u(c.getImageData(0,0,A,w).data),T=this.#l(S),x=this.#d(T),R=this.#r(S,A,w,x);return this.processDrawnLines({lines:{curves:R,width:A,height:w},pageWidth:i,pageHeight:r,rotation:a,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(e,t,s,n,i){const[r,a,o]=this.#f(e),[h,c]=this.#h(r,a,o,Math.hypot(a,o)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),d=this.#d(c),u=this.#r(h,a,o,d);return this.processDrawnLines({lines:{curves:u,width:a,height:o},pageWidth:t,pageHeight:s,rotation:n,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:s,rotation:n,innerMargin:i,mustSmooth:r,areContours:a}){n%180!=0&&([t,s]=[s,t]);const{curves:o,width:h,height:c}=e,d=e.thickness??0,u=[],f=Math.min(t/h,s/c),p=f/t,g=f/s,m=[];for(const{points:y}of o){const b=r?this.#o(y):y;if(!b)continue;m.push(b);const E=b.length,A=new Float32Array(E),w=new Float32Array(3*(2===E?2:E-2));if(u.push({line:w,points:A}),2===E){A[0]=b[0]*p,A[1]=b[1]*g,w.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[S,T,x,R]=b;S*=p,T*=g,x*=p,R*=g,A.set([S,T,x,R],0),w.set([NaN,NaN,NaN,NaN,S,T],0);for(let C=4;C<E;C+=2){const L=A[C]=b[C]*p,O=A[C+1]=b[C+1]*g;w.set(_.createBezierPoints(S,T,x,R,L,O),3*(C-2)),[S,T,x,R]=[x,R,L,O]}}if(0===u.length)return null;const v=a?new ks:new De;return v.build(u,t,s,1,n,a?0:d,i),{outline:v,newCurves:m,areContours:a,thickness:d,width:h,height:c}}static compressSignature(e){return(0,N.A)(function*({outlines:t,areContours:s,thickness:n,width:i,height:r}){let c,a=1/0,o=-1/0,h=0;for(const E of t){h+=E.length;for(let A=2,w=E.length;A<w;A++){const S=E[A]-E[A-2];a=Math.min(a,S),o=Math.max(o,S)}}c=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;const d=t.length,u=8+3*d,f=new Uint32Array(u);let p=0;f[p++]=u*Uint32Array.BYTES_PER_ELEMENT+(h-2*d)*c.BYTES_PER_ELEMENT,f[p++]=0,f[p++]=i,f[p++]=r,f[p++]=s?0:1,f[p++]=Math.max(0,Math.floor(n??0)),f[p++]=d,f[p++]=c.BYTES_PER_ELEMENT;for(const E of t)f[p++]=E.length-2,f[p++]=E[0],f[p++]=E[1];const g=new CompressionStream("deflate-raw"),m=g.writable.getWriter();yield m.ready,m.write(f);const v=c.prototype.constructor;for(const E of t){const A=new v(E.length-2);for(let w=2,S=E.length;w<S;w++)A[w-2]=E[w]-E[w-2];m.write(A)}m.close();const y=yield new Response(g.readable).arrayBuffer();return Ks(new Uint8Array(y))}).apply(this,arguments)}static decompressSignature(e){return(0,N.A)(function*(){try{const a=function yi(l){return Uint8Array.fromBase64?Uint8Array.fromBase64(l):te(atob(l))}(e),{readable:o,writable:h}=new DecompressionStream("deflate-raw"),c=h.getWriter();yield c.ready,c.write(a).then((0,N.A)(function*(){yield c.ready,yield c.close()})).catch(()=>{});let d=null,u=0;var n,t=!1,s=!1;try{for(var r,i=(0,ai.A)(o);t=!(r=yield i.next()).done;t=!1){const T=r.value;d||=new Uint8Array(new Uint32Array(T.buffer,0,4)[0]),d.set(T,u),u+=T.length}}catch(T){s=!0,n=T}
vendor: 5,563 bytes, line 1
1finally{try{t&&null!=i.return&&(yield i.return())}finally{if(s)throw n}}const f=new Uint32Array(d.buffer,0,d.length>>2),p=f[1];if(0!==p)throw new Error(`Invalid version: ${p}`);const g=f[2],m=f[3],v=0===f[4],y=f[5],b=f[6],A=[],w=(8+3*b)*Uint32Array.BYTES_PER_ELEMENT;let S;switch(f[7]){case Int8Array.BYTES_PER_ELEMENT:S=new Int8Array(d.buffer,w);break;case Int16Array.BYTES_PER_ELEMENT:S=new Int16Array(d.buffer,w);break;case Int32Array.BYTES_PER_ELEMENT:S=new Int32Array(d.buffer,w)}u=0;for(let T=0;T<b;T++){const x=f[3*T+8],R=new Float32Array(x+2);A.push(R);for(let C=0;C<2;C++)R[C]=f[3*T+8+C+1];for(let C=0;C<x;C++)R[C+2]=R[C]+S[u++]}return{areContours:v,thickness:y,outlines:A,width:g,height:m}}catch(a){return G(`decompressSignature: ${a}`),null}})()}}class Ns extends ni{constructor(){super(),super.updateProperties({fill:H._defaultLineColor,"stroke-width":0})}clone(){const e=new Ns;return e.updateAll(this),e}}class Bs extends Ze{constructor(e){super(e),super.updateProperties({stroke:H._defaultLineColor,"stroke-width":1})}clone(){const e=new Bs(this._viewParameters);return e.updateAll(this),e}}class Ht extends ii{#t=!1;#e=null;#n=null;#s=null;static _type="signature";static _editorType=X.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,t){H.initialize(e,t),this._defaultDrawingOptions=new Ns,this._defaultDrawnSignatureOptions=new Bs(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return V(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#e}}static computeTelemetryFinalData(e){const t=e.get("hasDescription");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){null!==this._drawId&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,t;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,e=this.x,t=this.y),super.render(),null===this._drawId)if(this.#n){const{lines:n,mustSmooth:i,areContours:r,description:a,uuid:o,heightInPage:h}=this.#n,{rawDims:{pageWidth:c,pageHeight:d},rotation:u}=this.parent.viewport,f=Jt.processDrawnLines({lines:n,pageWidth:c,pageHeight:d,rotation:u,innerMargin:Ht._INNER_MARGIN,mustSmooth:i,areContours:r});this.addSignature(f,h,a,o)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#e||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(e,t)),this.div}setUuid(e){this.#s=e,this.addEditToolbar()}getUuid(){return this.#s}get description(){return this.#e}set description(e){this.#e=e,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:t,thickness:s,width:n,height:i}=this.#n,r=Math.max(n,i);return{areContours:t,outline:Jt.processDrawnLines({lines:{curves:e.map(o=>({points:o})),thickness:s,width:n,height:i},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,t,s,n){const{x:i,y:r}=this,{outline:a}=this.#n=e;let o;this.#t=a instanceof ks,this.description=s,this.#t?o=Ht.getDefaultDrawingOptions():(o=Ht._defaultDrawnSignatureOptions.clone(),o.updateProperties({"stroke-width":a.thickness})),this._addOutlines({drawOutlines:a,drawingOptions:o});const[,h]=this.pageDimensions;let c=t/h;c=c>=1?.5:c,this.width*=c/this.height,this.width>=1&&(c*=.9/this.width,this.width=.9),this.height=c,this.setDims(),this.x=i,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(n),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!n,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:t,pageHeight:s},rotation:n}=this.parent.viewport;return Jt.process(e,t,s,n,Ht._INNER_MARGIN)}getFromText(e,t){const{rawDims:{pageWidth:s,pageHeight:n},rotation:i}=this.parent.viewport;return Jt.extractContoursFromText(e,t,s,n,i,Ht._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:t,pageHeight:s},rotation:n}=this.parent.viewport;return Jt.processDrawnLines({lines:e,pageWidth:t,pageHeight:s,rotation:n,innerMargin:Ht._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:t}){e?this._drawingOptions=Ht.getDefaultDrawingOptions():(this._drawingOptions=Ht._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":t}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:t,points:s}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":n}}=this,i=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:n});return this.addComment(i),e?(i.paths={lines:t,points:s},i.uuid=this.#s,i.isCopy=!0):i.lines=t,this.#e&&(i.accessibilityData={type:"Figure",alt:this.#e}),i}static deserializeDraw(e,t,s,n,i,r){return r.areContours?ks.deserialize(e,t,s,n,i,r):De.deserialize(e,t,s,n,i,r)}
1static deserialize(e,t,s){var n=()=>super.deserialize,i=this;return(0,N.A)(function*(){const r=yield n().call(i,e,t,s);return r.#t=e.areContours,r.description=e.accessibilityData?.alt||"",r.#s=e.uuid,r})()}}class Jr extends H{#t=null;#e=null;#n=null;#s=null;#a=null;#r="";#i=null;#o=!1;#h=null;#l=!1;#u=!1;static _type="stamp";static _editorType=X.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#s=e.bitmapUrl,this.#a=e.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,t){H.initialize(e,t)}static isHandlingMimeForPasting(e){return He.includes(e)}static paste(e,t){t.pasteEditor({mode:X.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#d(e,t=!1){e?(this.#t=e.bitmap,t||(this.#e=e.id,this.#l=e.isSvg),e.file&&(this.#r=e.file.name),this.#g()):this.remove()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#i){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t)return void this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}mlGuessAltText(){var e=this;return(0,N.A)(function*(t=null,s=!0){if(e.hasAltTextData())return null;const{mlManager:n}=e._uiManager;if(!n)throw new Error("No ML.");if(!(yield n.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");const{data:i,width:r,height:a}=t||e.copyCanvas(null,null,!0).imageData,o=yield n.guess({name:"altText",request:{data:i,width:r,height:a,channels:i.length/(r*a)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");const h=o.output;return yield e.setGuessedAltText(h),s&&!e.hasAltTextData()&&(e.altTextData={alt:h,decorative:!1}),h}).apply(this,arguments)}#m(){var e=this;if(this.#e)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#e).then(n=>this.#d(n,!0)).finally(()=>this.#f());if(this.#s){const n=this.#s;return this.#s=null,this._uiManager.enableWaiting(!0),void(this.#n=this._uiManager.imageManager.getFromUrl(n).then(i=>this.#d(i)).finally(()=>this.#f()))}if(this.#a){const n=this.#a;return this.#a=null,this._uiManager.enableWaiting(!0),void(this.#n=this._uiManager.imageManager.getFromFile(n).then(i=>this.#d(i)).finally(()=>this.#f()))}const t=document.createElement("input");t.type="file",t.accept=He.join(",");const s=this._uiManager._signal;this.#n=new Promise(n=>{t.addEventListener("change",(0,N.A)(function*(){if(t.files&&0!==t.files.length){e._uiManager.enableWaiting(!0);const i=yield e._uiManager.imageManager.getFromFile(t.files[0]);e._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:e._uiManager.useNewAltTextFlow}}),e.#d(i)}else e.remove();n()}),{signal:s}),t.addEventListener("cancel",()=>{this.remove(),n()},{signal:s})}).finally(()=>this.#f()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#i?.remove(),this.#i=null,this.#h&&(clearTimeout(this.#h),this.#h=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#e&&null===this.#i&&this.#m(),this.isAttachedToDOM||this.parent.add(this))):this.#e&&this.#m()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#t||this.#s||this.#a||this.#e||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#t?this.#g():this.#m()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){const{id:s,bitmap:n}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(this.#e=s,n&&(this.#t=n),this.#o=!1,this.#g())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(null!==this.#h&&clearTimeout(this.#h),this.#h=setTimeout(()=>{this.#h=null,this.#p()},200))}#g(){const{div:e}=this;let{width:t,height:s}=this.#t;const[n,i]=this.pageDimensions,r=.75;if(this.width)t=this.width*n,s=this.height*i;else if(t>r*n||s>r*i){const o=Math.min(r*n/t,r*i/s);t*=o,s*=o}this._uiManager.enableWaiting(!1);const a=this.#i=document.createElement("canvas");a.setAttribute("role","img"),this.addContainer(a),this.width=t/n,this.height=s/i,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#p(),this.#u||(this.parent.addUndoableEditor(this),this.#u=!0),this._reportTelemetry({action:"inserted_image"}),this.#r&&this.div.setAttribute("aria-description",this.#r),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,t,s=!1){e||(e=224);const{width:n,height:i}=this.#t,r=new Bt;let a=this.#t,o=n,h=i,c=null;if(t){if(n>t||i>t){const w=Math.min(t/n,t/i);o=Math.floor(n*w),h=Math.floor(i*w)}c=document.createElement("canvas");const u=c.width=Math.ceil(o*r.sx),f=c.height=Math.ceil(h*r.sy);this.#l||(a=this.#c(u,f));const p=c.getContext("2d");p.filter=this._uiManager.hcmFilter;let g="white",m="#cfcfd8";"none"!==this._uiManager.hcmFilter?m="black":wi.isDarkMode&&(g="#8f8f9d",m="#42414d");const v=15,y=v*r.sx,b=v*r.sy,E=new OffscreenCanvas(2*y,2*b),A=E.getContext("2d");A.fillStyle=g,A.fillRect(0,0,2*y,2*b),A.fillStyle=m,A.fillRect(0,0,y,b),A.fillRect(y,b,y,b),p.fillStyle=p.createPattern(E,"repeat"),p.fillRect(0,0,u,f),p.drawImage(a,0,0,a.width,a.height,0,0,u,f)}let d=null;if(s){let u,f;if(r.symmetric&&a.width<e&&a.height<e)u=a.width,f=a.height;else if(a=this.#t,n>e||i>e){const m=Math.min(e/n,e/i);u=Math.floor(n*m),f=Math.floor(i*m),this.#l||(a=this.#c(u,f))}const g=new OffscreenCanvas(u,f).getContext("2d",{willReadFrequently:!0});g.drawImage(a,0,0,a.width,a.height,0,0,u,f),d={width:u,height:f,data:g.getImageData(0,0,u,f).data}}return{canvas:c,width:o,height:h,imageData:d}}#c(e,t){const{width:s,height:n}=this.#t;let i=s,r=n,a=this.#t;for(;i>2*e||r>2*t;){const o=i,h=r;i>2*e&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),r>2*t&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));const c=new OffscreenCanvas(i,r);c.getContext("2d").drawImage(a,0,0,o,h,0,0,i,r),a=c.transferToImageBitmap()}return a}#p(){const[e,t]=this.parentDimensions,{width:s,height:n}=this,i=new Bt,r=Math.ceil(s*e*i.sx),a=Math.ceil(n*t*i.sy),o=this.#i;if(!o||o.width===r&&o.height===a)return;o.width=r,o.height=a;const h=this.#l?this.#t:this.#c(r,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(h,0,0,h.width,h.height,0,0,r,a)}#v(e){if(e){if(this.#l){const n=this._uiManager.imageManager.getSvgUrl(this.#e);if(n)return n}const t=document.createElement("canvas");return({width:t.width,height:t.height}=this.#t),t.getContext("2d").drawImage(this.#t,0,0),t.toDataURL()}if(this.#l){const[t,s]=this.pageDimensions,n=Math.round(this.width*t*Wt.PDF_TO_CSS_UNITS),i=Math.round(this.height*s*Wt.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(n,i);return r.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.he
1ight,0,0,n,i),r.transferToImageBitmap()}return structuredClone(this.#t)}static deserialize(e,t,s){var n=()=>super.deserialize,i=this;return(0,N.A)(function*(){let r=null,a=!1;if(e instanceof ei){const{data:{rect:v,rotation:y,id:b,structParent:E,popupRef:A,richText:w,contentsObj:S,creationDate:T,modificationDate:x},container:R,parent:{page:{pageNumber:C}},canvas:L}=e;let O,M;L?(delete e.canvas,({id:O,bitmap:M}=s.imageManager.getFromCanvas(R.id,L)),L.remove()):(a=!0,e._hasNoCanvas=!0);const j=(yield t._structTree.getAriaAttributes(`${ee}${b}`))?.get("aria-label")||"";r=e={annotationType:X.STAMP,bitmapId:O,bitmap:M,pageIndex:C-1,rect:v.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,accessibilityData:{decorative:!1,altText:j},isSvg:!1,structParent:E,popupRef:A,richText:w,comment:S?.str||null,creationDate:T,modificationDate:x}}const o=yield n().call(i,e,t,s),{rect:h,bitmap:c,bitmapUrl:d,bitmapId:u,isSvg:f,accessibilityData:p}=e;a?(s.addMissingCanvas(e.id,o),o.#o=!0):u&&s.imageManager.isValidId(u)?(o.#e=u,c&&(o.#t=c)):o.#s=d,o.#l=f;const[g,m]=o.pageDimensions;return o.width=(h[2]-h[0])/g,o.height=(h[3]-h[1])/m,p&&(o.altTextData=p),o._initialData=r,e.comment&&o.setCommentData(e),o.#u=!!r,o})()}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Object.assign(super.serialize(e),{bitmapId:this.#e,isSvg:this.#l});if(this.addComment(s),e)return s.bitmapUrl=this.#v(!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:n,altText:i}=this.serializeAltText(!1);if(!n&&i&&(s.accessibilityData={type:"Figure",alt:i}),this.annotationElementId){const a=this.#b(s);return a.isSame?null:(a.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1,s.id=this.annotationElementId,delete s.bitmapId,s)}if(null===t)return s;t.stamps||=new Map;const r=this.#l?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(t.stamps.has(this.#e)){if(this.#l){const a=t.stamps.get(this.#e);r>a.area&&(a.area=r,a.serialized.bitmap.close(),a.serialized.bitmap=this.#v(!1))}}else t.stamps.set(this.#e,{area:r,serialized:s}),s.bitmap=this.#v(!1);return s}#b(e){const{pageIndex:t,accessibilityData:{altText:s}}=this._initialData,n=e.pageIndex===t,i=(e.accessibilityData?.alt||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&n&&i,isSameAltText:i}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}let ri=(()=>{class l{#t;#e=!1;#n=null;#s=null;#a=null;#r=new Map;#i=!1;#o=!1;#h=!1;#l=null;#u=null;#d=null;#f=null;#m=null;#g=-1;#c;static _initialized=!1;static#p=new Map([vt,Fs,Jr,dt,Ht].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:s,div:n,structTreeLayer:i,accessibilityManager:r,annotationLayer:a,drawLayer:o,textLayer:h,viewport:c,l10n:d}){const u=[...l.#p.values()];if(!l._initialized){l._initialized=!0;for(const f of u)f.initialize(d,t)}t.registerEditorTypes(u),this.#c=t,this.pageIndex=s,this.div=n,this.#t=r,this.#n=a,this.viewport=c,this.#d=h,this.drawLayer=o,this._structTree=i,this.#c.addLayer(this)}get isEmpty(){return 0===this.#r.size}get isInvisible(){return this.isEmpty&&this.#c.getMode()===X.NONE}updateToolbar(t){this.#c.updateToolbar(t)}updateMode(t=this.#c.getMode()){switch(this.#w(),t){case X.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case X.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case X.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:s}=this.div;if(s.toggle("nonEditing",!1),t===X.POPUP)s.toggle("commentEditing",!0);else{s.toggle("commentEditing",!1);for(const n of l.#p.values())s.toggle(`${n._type}Editing`,t===n._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#d?.div}setEditingState(t){this.#c.setEditingState(t)}addCommands(t){this.#c.addCommands(t)}cleanUndoStack(t){this.#c.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#n?.togglePointerEvents(t)}get#v(){return 0!==this.#r.size?this.#r.values():this.#c.getEditors(this.pageIndex)}enable(){var t=this;return(0,N.A)(function*(){t.#h=!0,t.div.tabIndex=0,t.togglePointerEvents(!0),t.div.classList.toggle("nonEditing",!1),t.#m?.abort(),t.#m=null;const s=new Set;for(const i of t.#v)i.enableEditing(),i.show(!0),i.annotationElementId&&(t.#c.removeChangedExistingAnnotation(i),s.add(i.annotationElementId));const n=t.#n;if(n)for(const i of n.getEditableAnnotations()){if(i.hide(),t.#c.isDeletedAnnotationElement(i.data.id)||s.has(i.data.id))continue;const r=yield t.deserialize(i);r&&(t.addOrRebuild(r),r.enableEditing())}t.#h=!1,t.#c._eventBus.dispatch("editorsrendered",{source:t,pageNumber:t.pageIndex+1})})()}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#d&&!this.#m){this.#m=new AbortController;const i=this.#c.combinedSignal(this.#m);this.#d.div.addEventListener("pointerdown",r=>{const{clientX:o,clientY:h,timeStamp:c}=r;if(c-this.#g>500)return void(this.#g=c);this.#g=-1;const{classList:u}=this.div;u.toggle("getElements",!0);const f=document.elementsFromPoint(o,h);if(u.toggle("getElements",!1),!this.div.contains(f[0]))return;let p;const g=new RegExp(`^${de}[0-9]+$`);for(const v of f)if(g.test(v.id)){p=v.id;break}if(!p)return;const m=this.#r.get(p);null===m?.annotationElementId&&(r.stopPropagation(),r.preventDefault(),m.dblclick(r))},{signal:i,capture:!0})}const t=this.#n,s=[];if(t){const i=new Map,r=new Map;for(const o of this.#v)o.disableEditing(),o.annotationElementId?null===o.serialize()?(r.set(o.annotationElementId,o),this.getEditableAnnotation(o.annotationElementId)?.show(),o.remove()):i.set(o.annotationElementId,o):s.push(o);const a=t.getEditableAnnotations();for(const o of a){const{id:h}=o.data;if(this.#c.isDeletedAnnotationElement(h)){o.updateEdited({deleted:!0}
vendor: 10,077 bytes, line 1
1);continue}let c=r.get(h);c?(c.resetAnnotationElement(o),c.show(!1),o.show()):(c=i.get(h),c&&(this.#c.addChangedExistingAnnotation(c),c.renderAnnotationElement(o)&&c.show(!1)),o.show())}}this.#w(),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const i of l.#p.values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(s),this.#o=!1}getEditableAnnotation(t){return this.#n?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#c.getActive()!==t&&this.#c.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;const t=this.#c.combinedSignal(this.#f);this.#d.div.addEventListener("pointerdown",this.#b.bind(this),{signal:t}),this.#d.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove("highlighting"))}#b(t){this.#c.unselectAll();const{target:s}=t;if(s===this.#d.div||("img"===s.getAttribute("role")||s.classList.contains("endOfContent"))&&this.#d.div.contains(s)){const{isMac:n}=ut.platform;if(0!==t.button||t.ctrlKey&&n)return;this.#c.showAllEditors("highlight",!0,!0),this.#d.div.classList.add("free"),this.toggleDrawing(),dt.startHighlighting(this,"ltr"===this.#c.direction,{target:this.#d.div,x:t.x,y:t.y}),this.#d.div.addEventListener("pointerup",()=>{this.#d.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#c._signal}),t.preventDefault()}}enableClick(){if(this.#s)return;this.#s=new AbortController;const t=this.#c.combinedSignal(this.#s);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const s=this.pointerup.bind(this);this.div.addEventListener("pointerup",s,{signal:t}),this.div.addEventListener("pointercancel",s,{signal:t})}disableClick(){this.#s?.abort(),this.#s=null}attach(t){this.#r.set(t.id,t);const{annotationElementId:s}=t;s&&this.#c.isDeletedAnnotationElement(s)&&this.#c.removeDeletedAnnotationElement(t)}detach(t){this.#r.delete(t.id),this.#t?.removePointerInTextLayer(t.contentDiv),!this.#o&&t.annotationElementId&&this.#c.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#c.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#c.addDeletedAnnotationElement(t),H.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),this.#c.addEditor(t),this.attach(t),!t.isAttachedToDOM){const s=t.render();this.div.append(s),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#h),this.#c.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:s}=document;t.div.contains(s)&&!this.#a&&(t._focusEventsAllowed=!1,this.#a=setTimeout(()=>{this.#a=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#c._signal}),s.focus())},0)),t._structTreeParentId=this.#t?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getEditorByUID(t){for(const s of this.#r.values())if(s.uid===t)return s;return null}getNextId(){return this.#c.getId()}get#y(){return l.#p.get(this.#c.getMode())}combinedSignal(t){return this.#c.combinedSignal(t)}#T(t){const s=this.#y;return s?new s.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}pasteEditor(t,s){var n=this;return(0,N.A)(function*(){n.updateToolbar(t),yield n.#c.updateMode(t.mode);const{offsetX:i,offsetY:r}=n.#S(),a=n.getNextId(),o=n.#T({parent:n,id:a,x:i,y:r,uiManager:n.#c,isCentered:!0,...s});o&&n.add(o)})()}deserialize(t){var s=this;return(0,N.A)(function*(){return(yield l.#p.get(t.annotationType??t.annotationEditorType)?.deserialize(t,s,s.#c))||null})()}createAndAddNewEditor(t,s,n={}){const i=this.getNextId(),r=this.#T({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:this.#c,isCentered:s,...n});return r&&this.add(r),r}get boundingClientRect(){return this.div.getBoundingClientRect()}#S(){const{x:t,y:s,width:n,height:i}=this.boundingClientRect,r=Math.max(0,t),a=Math.max(0,s),c=(r+Math.min(window.innerWidth,t+n))/2-t,d=(a+Math.min(window.innerHeight,s+i))/2-s,[u,f]=this.viewport.rotation%180==0?[c,d]:[d,c];return{offsetX:u,offsetY:f}}addNewEditor(t={}){this.createAndAddNewEditor(this.#S(),!0,t)}setSelected(t){this.#c.setSelected(t)}toggleSelected(t){this.#c.toggleSelected(t)}unselect(t){this.#c.unselect(t)}pointerup(t){const{isMac:s}=ut.platform;if(0!==t.button||t.ctrlKey&&s||t.target!==this.div||!this.#i||(this.#i=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#e)return void(this.#e=!0);const n=this.#c.getMode();n!==X.STAMP&&n!==X.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#c.unselectAll()}pointerdown(t){if(this.#c.getMode()===X.HIGHLIGHT&&this.enableTextSelection(),this.#i)return void(this.#i=!1);const{isMac:s}=ut.platform;if(0!==t.button||t.ctrlKey&&s||t.target!==this.div)return;if(this.#i=!0,this.#y?.isDrawer)return void this.startDrawingSession(t);const n=this.#c.getActive();this.#e=!n||n.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#l)return void this.#y.startDrawing(this,this.#c,!1,t);this.#c.setCurrentDrawingSession(this),this.#l=new AbortController;const s=this.#c.combinedSignal(this.#l);this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(this.#u=null,this.commitOrRemove())},{signal:s}),this.#y.startDrawing(this,this.#c,!1,t)}pause(t){if(t){const{activeElement:s}=document;return void(this.div.contains(s)&&(this.#u=s))}this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(t=!1){return this.#l?(this.#c.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#y.endDrawing(t)):null}findNewParent(t,s,n){const i=this.#c.findParent(s,n);return null!==i&&i!==this&&(i.changeParent(t),!0)}commitOrRemove(){return!!this.#l&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#c.getActive()?.parent===this&&(this.#c.commitOrRemove(),this.#c.setActiveEditor(null)),this.#a&&(clearTimeout(this.#a),this.#a=null);for(const t of this.#r.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#r.clear(),this.#c.removeLayer(this)}#w(){for(const t of this.#r.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,zt(this.div,t);for(const s of this.#c.getEditors(this.pageIndex))this.add(s),s.rebuild();this.updateMode()}update({viewport:t}){this.#c.commitOrRemove(),this.#w();const s=this.viewport.rotation,n=t.rotation;if(this.viewport=t,zt(this.div,{rotation:n}),s!==n)for(const i of this.#r.values())i.rotate(n)}get pageDimensions(){const{pageWidth:t,pageHeight:s}=this.viewport.rawDims;return[t,s]}get scale(){return this.#c.viewParameters.realScale}}return l})();class yt{#t=null;#e=new Map;#n=new Map;static#s=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#t){if(this.#t!==e){if(this.#e.size>0)for(const t of this.#e.values())t.remove(),e.append(t);this.#t=e}}else this.#t=e}static get _svgFactory(){return V(this,"_svgFactory",new Ie)}static#a(e,[t,s,n,i]){const{style:r}=e;r.top=100*s+"%",r.left=100*t+"%",r.width=100*n+"%",r.height=100*i+"%"}#r(){const e=yt._svgFactory.create(1,1,!0);return this.#t.append(e),e.setAttribute("aria-hidden",!0),e}#i(e,t){const s=yt._svgFactory.createElement("clipPath");e.append(s);const n=`clip_${t}`;s.setAttribute("id",n),s.setAttribute("clipPathUnits","objectBoundingBox");const i=yt._svgFactory.createElement("use");return s.append(i),i.setAttribute("href",`#${t}`),i.classList.add("clip"),n}#o(e,t){for(const[s,n]of Object.entries(t))null===n?e.removeAttribute(s):e.setAttribute(s,n)}draw(e,t=!1,s=!1){const n=yt.#s++,i=this.#r(),r=yt._svgFactory.createElement("defs");i.append(r);const a=yt._svgFactory.createElement("path");r.append(a);const o=`path_p${this.pageIndex}_${n}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#n.set(n,a);const h=s?this.#i(r,o):null,c=yt._svgFactory.createElement("use");return i.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(i,e),this.#e.set(n,i),{id:n,clipPathId:`url(#${h})`}}drawOutline(e,t){const s=yt.#s++,n=this.#r(),i=yt._svgFactory.createElement("defs");n.append(i);const r=yt._svgFactory.createElement("path");i.append(r);const a=`path_p${this.pageIndex}_${s}`;let o;if(r.setAttribute("id",a),r.setAttribute("vector-effect","non-scaling-stroke"),t){const d=yt._svgFactory.createElement("mask");i.append(d),o=`mask_p${this.pageIndex}_${s}`,d.setAttribute("id",o),d.setAttribute("maskUnits","objectBoundingBox");const u=yt._svgFactory.createElement("rect");d.append(u),u.setAttribute("width","1"),u.setAttribute("height","1"),u.setAttribute("fill","white");const f=yt._svgFactory.createElement("use");d.append(f),f.setAttribute("href",`#${a}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const h=yt._svgFactory.createElement("use");n.append(h),h.setAttribute("href",`#${a}`),o&&h.setAttribute("mask",`url(#${o})`);const c=h.cloneNode();return n.append(c),h.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(n,e),this.#e.set(s,n),s}finalizeDraw(e,t){this.#n.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;const{root:s,bbox:n,rootClass:i,path:r}=t,a="number"==typeof e?this.#e.get(e):e;if(a){if(s&&this.#o(a,s),n&&yt.#a(a,n),i){const{classList:o}=a;
1for(const[h,c]of Object.entries(i))o.toggle(h,c)}r&&this.#o(a.firstElementChild.firstElementChild,r)}}updateParent(e,t){if(t===this)return;const s=this.#e.get(e);s&&(t.#t.append(s),this.#e.delete(e),t.#e.set(e,s))}remove(e){this.#n.delete(e),null!==this.#t&&(this.#e.get(e).remove(),this.#e.delete(e))}destroy(){this.#t=null;for(const e of this.#e.values())e.remove();this.#e.clear(),this.#n.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:Ms},globalThis.pdfjsLib={AbortException:$t,AnnotationEditorLayer:ri,AnnotationEditorParamsType:J,AnnotationEditorType:X,AnnotationEditorUIManager:ie,AnnotationLayer:Qe,AnnotationMode:jt,AnnotationType:ct,applyOpacity:en,build:Yn,ColorPicker:Ot,createValidAbsoluteUrl:ns,CSSConstants:tn,DOMSVGFactory:Ie,DrawLayer:yt,FeatureTest:ut,fetchData:se,findContrastColor:on,getDocument:Wn,getFilenameFromUrl:Qs,getPdfFilenameFromUrl:Js,getRGB:ne,getUuid:os,getXfaPageViewport:qs,GlobalWorkerOptions:Xt,ImageKind:ue,InvalidPDFException:ke,isDataScheme:ye,isPdfFile:_e,isValidExplicitDest:mn,MathClamp:Et,noContextMenu:It,normalizeUnicode:Ys,OPS:qt,OutputScale:Bt,PasswordResponses:zs,PDFDataRangeTransport:Rs,PDFDateString:Ue,PDFWorker:mt,PermissionFlag:Gs,PixelsPerInch:Wt,RenderingCancelledException:Be,renderRichText:ds,ResponseException:ge,setLayerDimensions:zt,shadow:V,SignatureExtractor:Jt,stopEvent:ot,SupportedImageMimeTypes:He,TextLayer:Rt,TouchManager:Ee,updateUrlHash:is,Util:B,VerbosityLevel:fe,version:Xn,XfaLayer:ls},Xt.workerPort=new Worker(Nt.tu(new URL("/"+Nt.u("pdfjs-worker"),Nt.b)),{type:void 0})}}]);
2//# sourceMappingURL=pdfjs.f3146f0bf263a772.js.map

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.