1"use strict";(self.webpackChunknfj=self.webpackChunknfj||[]).push([[2053],{82053(Jn,qe,ts){var js;function $s(l,e,t,s,i,r,n){try{var a=l[r](n),o=a.value}catch(h){return void t(h)}a.done?e(o):Promise.resolve(o).then(s,i)}function N(l){return function(){var e=this,t=arguments;return new Promise(function(s,i){var r=l.apply(e,t);function n(o){$s(r,s,i,n,a,"next",o)}function a(o){$s(r,s,i,n,a,"throw",o)}n(void 0)})}}function De(l){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var s=t.done;return Promise.resolve(t.value).then(function(i){return{value:i,done:s}})}return(De=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var s=this.s.return;return void 0===s?Promise.resolve({value:t,done:!0}):e(s.apply(this.s,arguments))},throw:function(t){var s=this.s.return;return void 0===s?Promise.reject(t):e(s.apply(this.s,arguments))}},new De(l)}ts.r(qe),ts.d(qe,{AbortException:()=>jt,AnnotationEditorLayer:()=>rr,AnnotationEditorUIManager:()=>ee,AnnotationLayer:()=>Ke,CSSConstants:()=>ti,ColorPicker:()=>Ot,DOMSVGFactory:()=>Re,DrawLayer:()=>vt,FeatureTest:()=>ft,GlobalWorkerOptions:()=>ne,InvalidPDFException:()=>Le,MathClamp:()=>Et,OutputScale:()=>kt,PDFDataRangeTransport:()=>Ps,PDFDateString:()=>Be,PDFWorker:()=>gt,PixelsPerInch:()=>Vt,RenderingCancelledException:()=>ke,ResponseException:()=>fe,SignatureExtractor:()=>Kt,TextLayer:()=>St,TouchManager:()=>Ae,Util:()=>B,XfaLayer:()=>hs,applyOpacity:()=>ei,createValidAbsoluteUrl:()=>rs,fetchData:()=>qt,findContrastColor:()=>ai,getDocument:()=>Wi,getFilenameFromUrl:()=>Qs,getPdfFilenameFromUrl:()=>Js,getRGB:()=>te,getUuid:()=>ls,getXfaPageViewport:()=>qs,isDataScheme:()=>me,isPdfFile:()=>Ne,noContextMenu:()=>It,normalizeUnicode:()=>Ks,renderRichText:()=>ds,setLayerDimensions:()=>Gt,shadow:()=>W,stopEvent:()=>at,updateUrlHash:()=>ns});var ar={34:(l,e,t)=>{var s=t(4901);l.exports=function(i){return"object"==typeof i?null!==i:s(i)}},81:(l,e,t)=>{var s=t(9565),i=t(9306),r=t(8551),n=t(6823),a=t(851),o=TypeError;
vendor: 54,345 bytes, line 1
1l.exports=function(h,c){var u=arguments.length<2?a(h):c;if(i(u))return r(s(u,h));throw new o(n(h)+" is not iterable")}},116:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(2652),n=t(9306),a=t(8551),o=t(1767),h=t(9539),u=t(4549)("find",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(f){a(this);try{n(f)}catch(m){h(this,"throw",m)}if(u)return i(u,this,f);var p=o(this),g=0;return r(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),i=t(9039),r=t(4901),n=t(9297),a=t(3724),o=t(350).CONFIGURABLE,h=t(3706),c=t(1181),u=c.enforce,d=c.get,f=String,p=Object.defineProperty,g=s("".slice),m=s("".replace),v=s([].join),y=a&&!i(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),(!n(A,"name")||o&&A.name!==w)&&(a?p(A,"name",{value:w,configurable:!0}):A.name=w),y&&S&&n(S,"arity")&&A.length!==S.arity&&p(A,"length",{value:S.arity});try{S&&n(S,"constructor")&&S.constructor?a&&p(A,"prototype",{writable:!1}):A.prototype&&(A.prototype=void 0)}catch{}var x=u(A);return n(x,"source")||(x.source=v(b,"string"==typeof w?w:"")),A};Function.prototype.toString=E(function(){return r(this)&&d(this).source||h(this)},"toString")},350:(l,e,t)=>{var s=t(3724),i=t(9297),r=Function.prototype,n=s&&Object.getOwnPropertyDescriptor,a=i(r,"name"),o=a&&"something"===function(){}.name,h=a&&(!s||s&&n(r,"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),i=t(4576),r=t(9504),n=t(4154),a=t(5169),o=r(1.1.toString),h=i.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(){n(this),a(this.buffer);for(var d="",f=0,p=this.length;f<p;f++){var g=o(this[f],16);d+=1===g.length?"0"+g:g}return d}})},507:(l,e,t)=>{var s=t(9565);l.exports=function(i,r,n){for(var h,c,a=n?i:i.iterator,o=i.next;!(h=s(o,a)).done;)if(void 0!==(c=r(h.value)))return c}},531:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(9306),n=t(8551),a=t(1767),o=t(8646),h=t(9462),c=t(9539),u=t(6395),d=t(684),f=t(4549),p=!u&&!d("flatMap",function(){}),g=!u&&!p&&f("flatMap",TypeError),m=u||p||g,v=h(function(){for(var E,A,y=this.iterator,b=this.mapper;;){if(A=this.inner)try{if(!(E=n(i(A.next,A.iterator))).done)return E.value;this.inner=null}catch(w){c(y,"throw",w)}if(E=n(i(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){n(this);try{r(b)}catch(E){c(this,"throw",E)}return g?i(g,this,b):new v(a(this),{mapper:b,inner:null})}})},616:(l,e,t)=>{var s=t(9039);l.exports=!s(function(){var i=function(){}.bind();return"function"!=typeof i||i.hasOwnProperty("prototype")})},655:(l,e,t)=>{var s=t(6955),i=String;l.exports=function(r){if("Symbol"===s(r))throw new TypeError("Cannot convert a Symbol value to a string");return i(r)}},679:(l,e,t)=>{var s=t(1625),i=TypeError;l.exports=function(r,n){if(s(n,r))return r;throw new i("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(i){var r=+i;return(r>0?t:e)(r)}},757:(l,e,t)=>{var s=t(7751),i=t(4901),r=t(1625),n=t(7040),a=Object;l.exports=n?function(o){return"symbol"==typeof o}:function(o){var h=s("Symbol");return i(h)&&r(h.prototype,a(o))}},851:(l,e,t)=>{var s=t(6955),i=t(5966),r=t(4117),n=t(6269),o=t(8227)("iterator");l.exports=function(h){if(!r(h))return i(h,o)||i(h,"@@iterator")||n[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),i=t(8727);l.exports=Object.keys||function(n){return s(n,i)}},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(i){var r=s(i);return"BigInt64Array"===r||"BigUint64Array"===r}},1148:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(2652),n=t(9306),a=t(8551),o=t(1767),h=t(9539),u=t(4549)("every",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(f){a(this);try{n(f)}catch(m){h(this,"throw",m)}if(u)return i(u,this,f);var p=o(this),g=0;return!r(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),i=t(4576),r=t(34),n=t(6699),a=t(9297),o=t(7629),h=t(6119),c=t(421),u="Object already initialized",d=i.TypeError;if(s||o.state){var b=o.state||(o.state=new(0,i.WeakMap));b.get=b.get,b.has=b.has,b.set=b.set,p=function(A,w){if(b.has(A))throw new d(u);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 d(u);return w.facade=A,n(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(!r(w)||(S=g(w)).type!==A)throw new d("Incompatible receiver, "+A+" required");return S}}}},1291:(l,e,t)=>{var s=t(741);l.exports=function(i){var r=+i;return r!=r||0===r?0:s(r)}},1385:(l,e,t)=>{var s=t(9539);l.exports=function(i,r,n){for(var a=i.length-1;a>=0;a--)if(void 0!==i[a])try{n=s(i[a].iterator,r,n)}catch(o){r="throw",n=o}if("throw"===r)throw n;return n}},1548:(l,e,t)=>{var s=t(4576),i=t(9039),r=t(9519),n=t(4215),a=s.structuredClone;l.exports=!!a&&!i(function(){if("DENO"===n&&r>92||"NODE"===n&&r>94||"BROWSER"===n&&r>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),i=t(4576),r=t(8745),n=t(7680),a=t(6043),o=t(9306),h=t(1103),c=i.Promise,u=!1;s({target:"Promise",stat:!0,forced:!c||!c.try||h(function(){c.try(function(f){u=8===f},8)}).error||!u},{try:function(f){var p=arguments.length>1?n(arguments,1):[],g=a.f(this),m=h(function(){return r(o(f),void 0,p)});return(m.error?g.reject:g.resolve)(m.value),g.promise}})},1698:(l,e,t)=>{var s=t(6518),i=t(4204),r=t(9835);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("union")||!r("union")},{union:i})},1701:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(9306),n=t(8551),a=t(1767),o=t(9462),h=t(6319),c=t(9539),u=t(684),d=t(4549),f=t(6395),p=!f&&!u("map",function(){}),g=!f&&!p&&d("map",TypeError),m=f||p||g,v=o(function(){var y=this.iterator,b=n(i(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){n(this);try{r(b)}catch(E){c(this,"throw",E)}return g?i(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),i=t(9297),r=t(5397),n=t(9617).indexOf,a=t(421),o=s([].push);l.exports=function(h,c){var p,u=r(h),d=0,f=[];for(p in u)!i(a,p)&&i(u,p)&&o(f,p);for(;c.length>d;)i(u,p=c[d++])&&(~n(f,p)||o(f,p));return f}},2106:(l,e,t)=>{var s=t(283),i=t(4913);l.exports=function(r,n,a){return a.get&&s(a.get,n,{getter:!0}),a.set&&s(a.set,n,{setter:!0}),i.f(r,n,a)}},2140:(l,e,t)=>{var r={};r[t(8227)("toStringTag")]="z",l.exports="[object z]"===String(r)},2195:(l,e,t)=>{var s=t(9504),i=s({}.toString),r=s("".slice);l.exports=function(n){return r(i(n),8,-1)}},2211:(l,e,t)=>{var s=t(9039);l.exports=!s(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})},2303:(l,e,t)=>{var s=t(4576),i=t(9504),r=s.Uint8Array,n=s.SyntaxError,a=s.parseInt,o=Math.min,h=/[^\da-f]/i,c=i(h.exec),u=i("".slice);l.exports=function(d,f){var p=d.length;if(p%2!=0)throw new n("String should be an even number of characters");for(var g=f?o(f.length,p/2):p/2,m=f||new r(g),v=0,y=0;y<g;){var b=u(d,v,v+=2);if(c(h,b))throw new n("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),i=t(6801),r=t(8727),n=t(421),a=t(397),o=t(4055),h=t(6119),d="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=r.length;A--;)delete E[d][r[A]];return E()};n[p]=!0,l.exports=Object.create||function(w,S){var x;return null!==w?(g[d]=s(w),x=new g,g[d]=null,x[p]=w):x=E(),void 0===S?x:i.f(x,S)}},2475:(l,e,t)=>{var s=t(6518),i=t(8527);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isSupersetOf",function(a){return!a})},{isSupersetOf:i})},2489:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(9306),n=t(8551),a=t(1767),o=t(9462),h=t(6319),c=t(6395),u=t(9539),d=t(684),f=t(4549),p=!c&&!d("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=n(i(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){n(this);try{r(b)}catch(E){u(this,"throw",E)}return g?i(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(i,r){return void 0===i?arguments.length<2?"":r:s(i)}},2652:(l,e,t)=>{var s=t(6080),i=t(9565),r=t(8551),n=t(6823),a=t(4209),o=t(6198),h=t(1625),c=t(81),u=t(851),d=t(9539),f=TypeError,p=function(m,v){this.stopped=m,this.result=v},g=p.prototype;l.exports=function(m,v,y){var T,C,R,M,O,F,j,E=!(!y||!y.AS_ENTRIES),A=!(!y||!y.IS_RECORD),w=!(!y||!y.IS_ITERATOR),S=!(!y||!y.INTERRUPTED),x=s(v,y&&y.that),D=function(H){return T&&d(T,"normal"),new p(!0,H)},I=function(H){return E?(r(H),S?x(H[0],H[1],D):x(H[0],H[1])):S?x(H,D):x(H)};if(A)T=m.iterator;else if(w)T=m;else{if(!(C=u(m)))throw new f(n(m)+" is not iterable");if(a(C)){for(R=0,M=o(m);M>R;R++)if((O=I(m[R]))&&h(g,O))return O;return new p(!1)}T=c(m,C)}for(F=A?m.next:T.next;!(j=i(F,T)).done;){try{O=I(j.value)}catch(H){d(T,"throw",H)}if("object"==typeof O&&O&&h(g,O))return O}return new p(!1)}},2777:(l,e,t)=>{var s=t(9565),i=t(34),r=t(757),n=t(5966),a=t(4270),o=t(8227),h=TypeError,c=o("toPrimitive");l.exports=function(u,d){if(!i(u)||r(u))return u;var p,f=n(u,c);if(f){if(void 0===d&&(d="default"),p=s(f,u,d),!i(p)||r(p))return p;throw new h("Can't convert object to primitive value")}return void 0===d&&(d="number"),a(u,d)}},2787:(l,e,t)=>{var s=t(9297),i=t(4901),r=t(8981),n=t(6119),a=t(2211),o=n("IE_PROTO"),h=Object,c=h.prototype;l.exports=a?h.getPrototypeOf:function(u){var d=r(u);if(s(d,o))return d[o];var f=d.constructor;return i(f)&&d instanceof f?f.prototype:d instanceof h?c:null}},2796:(l,e,t)=>{var s=t(9039),i=t(4901),r=/#|\.prototype\./,n=function(u,d){var f=o[a(u)];return f===c||f!==h&&(i(d)?s(d):!!d)},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},o=n.data={},h=n.NATIVE="N",c=n.POLYFILL="P";l.exports=n},2804:l=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=e+"+/",s=e+"-_",i=function(r){for(var n={},a=0;a<64;a++)n[r.charAt(a)]=a;return n};l.exports={i2c:t,c2i:i(t),i2cUrl:s,c2iUrl:i(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 i=t(4576).navigator,r=i&&i.userAgent;l.exports=r?String(r):""},2967:(l,e,t)=>{var s=t(6706),i=t(34),r=t(7750),n=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(u,d){return r(u),n(d),i(u)&&(a?h(u,d):u.__proto__=d),u}}():void 0)},3068:(l,e,t)=>{var s=t(6518),i=t(9504),r=t(2652),n=RangeError,a=TypeError,o=1/0,c=Math.abs,u=Math.pow,d=i([].push),f=u(2,1023),p=u(2,53)-1,g=Number.MAX_VALUE,m=u(2,971),v={},y={},b={},E={},A={},w=function(S,x){var T=S+x;return{hi:T,lo:x-(T-S)}};s({target:"Math",stat:!0},{sumPrecise:function(x){var T=[],C=0,R=E;switch(r(x,function(L){if(++C>=p)throw new n("Maximum allowed index exceeded");if("number"!=typeof L)throw new a("Value is not a number");R!==v&&(L!=L?R=v:L===o?R=R===y?v:b:L===-o?R=R===b?v:y:(0!==L||1/L===o)&&(R===E||R===A)&&(R=A,d(T,L)))}),R){case v:return NaN;case y:return-o;case b:return o;case E:return-0}for(var F,j,D,I,H,z,M=[],O=0,et=0;et<T.length;et++){F=T[et];for(var ut=0,Z=0;Z<M.length;Z++){if(j=M[Z],c(F)<c(j)&&(z=F,F=j,j=z),H=(D=w(F,j)).lo,c(I=D.hi)===o){var J=I===o?1:-1;O+=J,c(F=F-J*f-J*f)<c(j)&&(z=F,F=j,j=z),I=(D=w(F,j)).hi,H=D.lo}0!==H&&(M[ut++]=H),F=I}M.length=ut,0!==F&&d(M,F)}var it=M.length-1;if(I=0,H=0,0!==O){var yt=it>=0?M[it]:0;if(it--,c(O)>1||O>0&&yt>0||O<0&&yt<0)return O>0?o:-o;if(H=(D=w(O*f,yt/2)).lo,H*=2,c(2*(I=D.hi))===o)return I>0?I===f&&H===-m/2&&it>=0&&M[it]<0?g:o:I===-f&&H===m/2&&it>=0&&M[it]>0?-g:-o;0!==H&&(M[++it]=H,H=0),I*=2}for(;it>=0&&(I=(D=w(I,M[it--])).hi,0===(H=D.lo)););return it>=0&&(H<0&&M[it]<0||H>0&&M[it]>0)&&(j=2*H)===(F=I+j)-I&&(I=F),I}})},3167:(l,e,t)=>{var s=t(4901),i=t(34),r=t(2967);l.exports=function(n,a,o){var h,c;return r&&s(h=a.constructor)&&h!==o&&i(c=h.prototype)&&c!==o.prototype&&r(n,c),n}},3238:(l,e,t)=>{var s=t(4576),i=t(7811),r=t(7394),n=s.DataView;l.exports=function(a){if(!i||0!==r(a))return!1;try{return new n(a),!1}catch{return!0}}},3392:(l,e,t)=>{var s=t(9504),i=0,r=Math.random(),n=s(1.1.toString);l.exports=function(a){return"Symbol("+(void 0===a?"":a)+")_"+n(++i+r,36)}},3440:(l,e,t)=>{var s=t(7080),i=t(4402),r=t(9286),n=t(5170),a=t(3789),o=t(8469),h=t(507),c=i.has,u=i.remove;l.exports=function(f){var p=s(this),g=a(f),m=r(p);return n(p)<=g.size?o(p,function(v){g.includes(v)&&u(m,v)}):h(g.getIterator(),function(v){c(m,v)&&u(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),i=String,r=TypeError;l.exports=function(n){if(s(n))return n;throw new r("Can't set "+i(n)+" as a prototype")}},3579:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(2652),n=t(9306),a=t(8551),o=t(1767),h=t(9539),u=t(4549)("some",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(f){a(this);try{n(f)}catch(m){h(this,"throw",m)}if(u)return i(u,this,f);var p=o(this),g=0;return r(p,function(m,v){if(f(m,g++))return v()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(l,e,t)=>{var s=t(7080),i=t(4402),r=t(9286),n=t(3789),a=t(507),o=i.add,h=i.has,c=i.remove;l.exports=function(d){var f=s(this),p=n(d).getIterator(),g=r(f);return a(p,function(m){h(f,m)?c(g,m):o(g,m)}),g}},3706:(l,e,t)=>{var s=t(9504),i=t(4901),r=t(7629),n=s(Function.toString);i(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),l.exports=r.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),i=t(8551),r=t(9565),n=t(1291),a=t(1767),o="Invalid size",h=RangeError,c=TypeError,u=Math.max,d=function(f,p){this.set=f,this.size=u(p,0),this.has=s(f.has),this.keys=s(f.keys)};d.prototype={getIterator:function(){return a(i(r(this.keys,this.set)))},includes:function(f){return r(this.has,this.set,f)}},l.exports=function(f){i(f);var p=+f.size;if(p!=p)throw new c(o);var g=n(p);if(g<0)throw new h(o);return new d(f,g)}},3838:(l,e,t)=>{var s=t(7080),i=t(5170),r=t(8469),n=t(3789);l.exports=function(o){var h=s(this),c=n(o);return!(i(h)>c.size)&&!1!==r(h,function(u){if(!c.includes(u))return!1},!0)}},3853:(l,e,t)=>{var s=t(6518),i=t(4449);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isDisjointFrom",function(a){return!a})},{isDisjointFrom:i})},3925:(l,e,t)=>{var s=t(34);l.exports=function(i){return s(i)||null===i}},3972:(l,e,t)=>{var s=t(34),i=String,r=TypeError;l.exports=function(n){if(void 0===n||s(n))return n;throw new r(i(n)+" is not an object or undefined")}},4055:(l,e,t)=>{var s=t(4576),i=t(34),r=s.document,n=i(r)&&i(r.createElement);l.exports=function(a){return n?r.createElement(a):{}}},4114:(l,e,t)=>{var s=t(6518),i=t(8981),r=t(6198),n=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(d){return d instanceof TypeError}}()},{push:function(f){var p=i(this),g=r(p),m=arguments.length;a(g+m);for(var v=0;v<m;v++)p[g]=arguments[v],g++;return n(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),i=TypeError;l.exports=function(r){if("Uint8Array"===s(r))return r;throw new i("Argument is not an Uint8Array")}},4204:(l,e,t)=>{var s=t(7080),i=t(4402).add,r=t(9286),n=t(3789),a=t(507);l.exports=function(h){var c=s(this),u=n(h).getIterator(),d=r(c);return a(u,function(f){i(d,f)}),d}},4209:(l,e,t)=>{var s=t(8227),i=t(6269),r=s("iterator"),n=Array.prototype;l.exports=function(a){return void 0!==a&&(i.Array===a||n[r]===a)}},4215:(l,e,t)=>{var s=t(4576),i=t(2839),r=t(2195),n=function(a){return i.slice(0,a.length)===a};l.exports=n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":s.Bun&&"string"==typeof Bun.version?"BUN":s.Deno&&"object"==typeof Deno.version?"DENO":"process"===r(s.process)?"NODE":s.window&&s.document?"BROWSER":"REST"},4226:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(3463),n=t(4154),a=t(5169),o=t(2303);i.Uint8Array&&s({target:"Uint8Array",proto:!0},{setFromHex:function(c){n(this),r(c),a(this.buffer);var u=o(c,this).read;return{read:u,written:u/2}}})},4235:(l,e,t)=>{t(3068)},4270:(l,e,t)=>{var s=t(9565),i=t(4901),r=t(34),n=TypeError;l.exports=function(a,o){var h,c;if("string"===o&&i(h=a.toString)&&!r(c=s(h,a))||i(h=a.valueOf)&&!r(c=s(h,a))||"string"!==o&&i(h=a.toString)&&!r(c=s(h,a)))return c;throw new n("Can't convert object to primitive value")}},4376:(l,e,t)=>{var s=t(2195);l.exports=Array.isArray||function(r){return"Array"===s(r)}},4402:(l,e,t)=>{var s=t(9504),i=Set.prototype;l.exports={Set,add:s(i.add),has:s(i.has),remove:s(i.delete),proto:i}},4449:(l,e,t)=>{var s=t(7080),i=t(4402).has,r=t(5170),n=t(3789),a=t(8469),o=t(507),h=t(9539);l.exports=function(u){var d=s(this),f=n(u);if(r(d)<=f.size)return!1!==a(d,function(g){if(f.includes(g))return!1},!0);var p=f.getIterator();return!1!==o(p,function(g){if(i(d,g))return h(p,"normal",!1)})}},4483:(l,e,t)=>{var c,u,d,f,s=t(4576),i=t(9429),r=t(1548),n=s.structuredClone,a=s.ArrayBuffer,o=s.MessageChannel,h=!1;if(r)h=function(p){n(p,{transfer:[p]})};else if(a)try{o||(c=i("worker_threads"))&&(o=c.MessageChannel),o&&(u=new o,d=new a(2),f=function(p){u.port1.postMessage(null,[p])},2===d.byteLength&&(f(d),0===d.byteLength&&(h=f)))}catch{}l.exports=h},4495:(l,e,t)=>{var s=t(9519),i=t(9039),n=t(4576).String;l.exports=!!Object.getOwnPropertySymbols&&!i(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&s&&s<41})},4527:(l,e,t)=>{var s=t(3724),i=t(4376),r=TypeError,n=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(i(o)&&!n(o,"length").writable)throw new r("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(i,r){var n=s.Iterator,a=n&&n.prototype,o=a&&a[i],h=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){h=!0}},-1)}catch(c){c instanceof r||(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 global&&global)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4603:(l,e,t)=>{var s=t(6840),i=t(9504),r=t(655),n=t(2812),a=URLSearchParams,o=a.prototype,h=i(o.append),c=i(o.delete),u=i(o.forEach),d=i([].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=[];u(this,function(T,C){d(v,{key:C,value:T})}),n(g,1);for(var x,y=r(p),b=r(m),E=0,A=0,w=!1,S=v.length;E<S;)x=v[E++],w||x.key===y?(w=!0,c(this,x.key)):A++;for(;A<S;)(x=v[A++]).key===y&&x.value===b||h(this,x.key,x.value)},{enumerable:!0,unsafe:!0})},4628:(l,e,t)=>{var s=t(6518),i=t(6043);s({target:"Promise",stat:!0},{withResolvers:function(){var n=i.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}})},4644:(l,e,t)=>{var z,et,ut,s=t(7811),i=t(3724),r=t(4576),n=t(4901),a=t(34),o=t(9297),h=t(6955),c=t(6823),u=t(6699),d=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=r.Int8Array,S=w&&w.prototype,x=r.Uint8ClampedArray,T=x&&x.prototype,C=w&&g(w),R=S&&g(S),M=Object.prototype,O=r.TypeError,F=v("toStringTag"),j=y("TYPED_ARRAY_TAG"),D="TypedArrayConstructor",I=s&&!!m&&"Opera"!==h(r.opera),H=!1,Z={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},J={BigInt64Array:8,BigUint64Array:8},yt=function(G){var rt=g(G);if(a(rt)){var nt=A(rt);return nt&&o(nt,D)?nt[D]:yt(rt)}},L=function(G){if(!a(G))return!1;var rt=h(G);return o(Z,rt)||o(J,rt)};for(z in Z)(ut=(et=r[z])&&et.prototype)?E(ut)[D]=et:I=!1;for(z in J)(ut=(et=r[z])&&et.prototype)&&(E(ut)[D]=et);if((!I||!n(C)||C===Function.prototype)&&(C=function(){throw new O("Incorrect invocation")},I))for(z in Z)r[z]&&m(r[z],C);if((!I||!R||R===M)&&(R=C.prototype,I))for(z in Z)r[z]&&m(r[z].prototype,R);if(I&&g(T)!==R&&m(T,R),i&&!o(R,F))for(z in H=!0,f(R,F,{configurable:!0,get:function(){return a(this)?this[j]:void 0}}),Z)r[z]&&u(r[z],j,z);l.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:H&&j,aTypedArray:function(G){if(L(G))return G;throw new O("Target is not a typed array")},aTypedArrayConstructor:function(G){if(n(G)&&(!m||p(C,G)))return G;throw new O(c(G)+" is not a typed array constructor")},exportTypedArrayMethod:function(G,rt,nt,Ft){if(i){if(nt)for(var Tt in Z){var bt=r[Tt];if(bt&&o(bt.prototype,G))try{delete bt.prototype[G]}catch{try{bt.prototype[G]=rt}catch{}}}(!R[G]||nt)&&d(R,G,nt?rt:I&&S[G]||rt,Ft)}},exportTypedArrayStaticMethod:function(G,rt,nt){var Ft,Tt;if(i){if(m){if(nt)for(Ft in Z)if((Tt=r[Ft])&&o(Tt,G))try{delete Tt[G]}catch{}if(C[G]&&!nt)return;try{return d(C,G,nt?rt:I&&C[G]||rt)}catch{}}for(Ft in Z)(Tt=r[Ft])&&(!Tt[G]||nt)&&d(Tt,G,rt)}},getTypedArrayConstructor:yt,isView:function(rt){if(!a(rt))return!1;var nt=h(rt);return"DataView"===nt||o(Z,nt)||o(J,nt)},isTypedArray:L,TypedArray:C,TypedArrayPrototype:R}},4659:(l,e,t)=>{var s=t(3724),i=t(4913),r=t(6980);l.exports=function(n,a,o){s?i.f(n,a,r(0,o)):n[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),i=t(5917),r=t(8686),n=t(8551),a=t(6969),o=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",f="writable";e.f=s?r?function(g,m,v){if(n(g),m=a(m),n(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:d in v?v[d]:y[d],enumerable:u in v?v[u]:y[u],writable:!1})}return h(g,m,v)}:h:function(g,m,v){if(n(g),m=a(m),n(v),i)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),i=function(n){return{size:n,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},r=function(n){return{size:n,has:function(){return!0},keys:function(){throw new Error("e")}}};l.exports=function(n,a){var o=s("Set");try{(new o)[n](i(0));try{return(new o)[n](i(-1)),!1}catch{if(!a)return!0;try{return(new o)[n](r(-1/0)),!1}catch{var h=new o;return h.add(1),h.add(2),a(h[n](r(1/0)))}}}catch{return!1}}},4972:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(8551),n=t(1767),a=t(4149),o=t(9590),h=t(9462),c=t(9539),u=t(4549),d=t(6395),f=!d&&u("take",RangeError),p=h(function(){var g=this.iterator;if(!this.remaining--)return this.done=!0,c(g,"normal",void 0);var m=r(i(this.next,g));return(this.done=!!m.done)?void 0:m.value});s({target:"Iterator",proto:!0,real:!0,forced:d||f},{take:function(m){var v;r(this);try{v=o(a(+m))}catch(y){c(this,"throw",y)}return f?i(f,this,v):new p(n(this),{remaining:v})}})},4979:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(7751),n=t(6980),a=t(4913).f,o=t(9297),h=t(679),c=t(3167),u=t(2603),d=t(5002),f=t(8574),p=t(3724),g=t(6395),m="DOMException",v=r("Error"),y=r(m),b=function(){h(this,E);var D=arguments.length,I=u(D<1?void 0:arguments[0]),H=u(D<2?void 0:arguments[1],"Error"),z=new y(I,H),et=new v(I);return et.name=m,a(z,"stack",n(1,f(et.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(i,m),T=A&&!!(!S||S.writable&&S.configurable)&&!w;s({global:!0,constructor:!0,forced:g||T},{DOMException:T?b:y});var C=r(m),R=C.prototype;if(R.constructor!==C)for(var M in g||a(R,"constructor",n(1,C)),d)if(o(d,M)){var O=d[M],F=O.s;o(C,F)||a(C,F,n(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},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),i=t(3650),r=t(9835);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("symmetricDifference")||!r("symmetricDifference")},{symmetricDifference:i})},5031:(l,e,t)=>{var s=t(7751),i=t(9504),r=t(8480),n=t(3717),a=t(8551),o=i([].concat);l.exports=s("Reflect","ownKeys")||function(c){var u=r.f(a(c)),d=n.f;return d?o(u,d(c)):u}},5169:(l,e,t)=>{var s=t(3238),i=TypeError;l.exports=function(r){if(s(r))throw new i("ArrayBuffer is detached");return r}},5170:(l,e,t)=>{var s=t(6706),i=t(4402);l.exports=s(i.proto,"size","get")||function(r){return r.size}},5213:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(5370),n=t(9143),a=i.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 u=n(c,arguments.length>1?arguments[1]:void 0,null,9007199254740991);return r(a,u.bytes)}})},5370:(l,e,t)=>{var s=t(6198);l.exports=function(i,r,n){for(var a=0,o=arguments.length>2?n:s(r),h=new i(o);o>a;)h[a]=r[a++];return h}},5397:(l,e,t)=>{var s=t(7055),i=t(7750);l.exports=function(r){return s(i(r))}},5610:(l,e,t)=>{var s=t(1291),i=Math.max,r=Math.min;l.exports=function(n,a){var o=s(n);return o<0?i(o+a,0):r(o,a)}},5623:(l,e,t)=>{t(456)},5636:(l,e,t)=>{var s=t(4576),i=t(9504),r=t(6706),n=t(7696),a=t(5169),o=t(7394),h=t(4483),c=t(1548),u=s.structuredClone,d=s.ArrayBuffer,f=s.DataView,p=Math.min,g=d.prototype,m=f.prototype,v=i(g.slice),y=r(g,"resizable","get"),b=r(g,"maxByteLength","get"),E=i(m.getInt8),A=i(m.setInt8);l.exports=(c||h)&&function(w,S,x){var M,T=o(w),C=void 0===S?T:n(S),R=!y||!y(w);if(a(w),c&&(w=u(w,{transfer:[w]}),T===C&&(x||R)))return w;if(T>=C&&(!x||R))M=v(w,0,C);else{var O=x&&!R&&b?{maxByteLength:b(w)}:void 0;M=new d(C,O);for(var F=new f(w),j=new f(M),D=p(C,T),I=0;I<D;I++)A(j,I,E(F,I))}return c||h(w),M}},5745:(l,e,t)=>{var s=t(7629);l.exports=function(i,r){return s[i]||(s[i]=r||{})}},5781:(l,e,t)=>{var s=t(6518),i=t(7751),r=t(2812),n=t(655),a=t(7416),o=i("URL");s({target:"URL",stat:!0,forced:!a},{parse:function(c){var u=r(arguments.length,1),d=n(c),f=u<2||void 0===arguments[1]?void 0:n(arguments[1]);try{return new o(d,f)}catch{return null}}})},5854:(l,e,t)=>{var s=t(2777),i=TypeError;l.exports=function(r){var n=s(r,"number");if("number"==typeof n)throw new i("Can't convert number to bigint");return BigInt(n)}},5876:(l,e,t)=>{var s=t(6518),i=t(3838);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("isSubsetOf",function(a){return a})},{isSubsetOf:i})},5917:(l,e,t)=>{var s=t(3724),i=t(9039),r=t(4055);l.exports=!s&&!i(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})},5966:(l,e,t)=>{var s=t(9306),i=t(4117);l.exports=function(r,n){var a=r[n];return i(a)?void 0:s(a)}},6043:(l,e,t)=>{var s=t(9306),i=TypeError,r=function(n){var a,o;this.promise=new n(function(h,c){if(void 0!==a||void 0!==o)throw new i("Bad Promise constructor");a=h,o=c}),this.resolve=s(a),this.reject=s(o)};l.exports.f=function(n){return new r(n)}},6080:(l,e,t)=>{var s=t(7476),i=t(9306),r=t(616),n=s(s.bind);l.exports=function(a,o){return i(a),void 0===o?a:r?n(a,o):function(){return a.apply(o,arguments)}}},6119:(l,e,t)=>{var s=t(5745),i=t(3392),r=s("keys");l.exports=function(n){return r[n]||(r[n]=i(n))}},6193:(l,e,t)=>{var s=t(4215);l.exports="NODE"===s},6198:(l,e,t)=>{var s=t(8014);l.exports=function(i){return s(i.length)}},6269:l=>{l.exports={}},6279:(l,e,t)=>{var s=t(6840);l.exports=function(i,r,n){for(var a in r)s(i,a,r[a],n);return i}},6319:(l,e,t)=>{var s=t(8551),i=t(9539);l.exports=function(r,n,a,o){try{return o?n(s(a)[0],a[1]):n(a)}catch(h){i(r,"throw",h)}}},6395:l=>{l.exports=!1},6518:(l,e,t)=>{var s=t(4576),i=t(7347).f,r=t(6699),n=t(6840),a=t(9433),o=t(7740),h=t(2796);l.exports=function(c,u){var m,v,y,b,E,d=c.target,f=c.global,p=c.stat;if(m=f?s:p?s[d]||a(d,{}):s[d]&&s[d].prototype)for(v in u){if(b=u[v],y=c.dontCallGetSet?(E=i(m,v))&&E.value:m[v],!h(f?v:d+(p?".":"#")+v,c.forced)&&void 0!==y){if(typeof b==typeof y)continue;o(b,y)}(c.sham||y&&y.sham)&&r(b,"sham",!0),n(m,v,b,c)}}},6573:(l,e,t)=>{var s=t(3724),i=t(2106),r=t(3238),n=ArrayBuffer.prototype;s&&!("detached"in n)&&i(n,"detached",{configurable:!0,get:function(){return r(this)}})},6632:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(9143),n=t(4154),a=i.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){n(this);var u=r(c,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:u.read,written:u.written}}})},6699:(l,e,t)=>{var s=t(3724),i=t(4913),r=t(6980);l.exports=s?function(n,a,o){return i.f(n,a,r(1,o))}:function(n,a,o){return n[a]=o,n}},6706:(l,e,t)=>{var s=t(9504),i=t(9306);l.exports=function(r,n,a){try{return s(i(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}}},6801:(l,e,t)=>{var s=t(3724),i=t(8686),r=t(4913),n=t(8551),a=t(5397),o=t(1072);e.f=s&&!i?Object.defineProperties:function(c,u){n(c);for(var m,d=a(u),f=o(u),p=f.length,g=0;p>g;)r.f(c,m=f[g++],d[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),i=t(4913),r=t(283),n=t(9433);l.exports=function(a,o,h,c){c||(c={});var u=c.enumerable,d=void 0!==c.name?c.name:o;if(s(h)&&r(h,d,c),c.global)u?a[o]=h:n(o,h);else{try{c.unsafe?a[o]&&(u=!0):delete a[o]}catch{}u?a[o]=h:i.f(a,o,{value:h,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return a}},6955:(l,e,t)=>{var s=t(2140),i=t(4901),r=t(2195),a=t(8227)("toStringTag"),o=Object,h="Arguments"===r(function(){return arguments}());l.exports=s?r:function(u){var d,f,p;return void 0===u?"Undefined":null===u?"Null":"string"==typeof(f=function(u,d){try{return u[d]}catch{}}(d=o(u),a))?f:h?r(d):"Object"===(p=r(d))&&i(d.callee)?"Arguments":p}},6969:(l,e,t)=>{var s=t(2777),i=t(757);l.exports=function(r){var n=s(r,"string");return i(n)?n:n+""}},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),i=t(9039),r=t(2195),n=Object,a=s("".split);l.exports=i(function(){return!n("z").propertyIsEnumerable(0)})?function(o){return"String"===r(o)?a(o,""):n(o)}:n},7080:(l,e,t)=>{var s=t(4402).has;l.exports=function(i){return s(i),i}},7347:(l,e,t)=>{var s=t(3724),i=t(9565),r=t(8773),n=t(6980),a=t(5397),o=t(6969),h=t(9297),c=t(5917),u=Object.getOwnPropertyDescriptor;e.f=s?u:function(f,p){if(f=a(f),p=o(p),c)try{return u(f,p)}catch{}if(h(f,p))return n(!i(r.f,f,p),f[p])}},7394:(l,e,t)=>{var s=t(4576),i=t(6706),r=t(2195),n=s.ArrayBuffer,a=s.TypeError;l.exports=n&&i(n.prototype,"byteLength","get")||function(o){if("ArrayBuffer"!==r(o))throw new a("ArrayBuffer expected");return o.byteLength}},7416:(l,e,t)=>{var s=t(9039),i=t(8227),r=t(3724),n=t(6395),a=i("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"),u="";return o.pathname="c%20d",h.forEach(function(d,f){h.delete("b"),u+=f+d}),c.delete("a",2),c.delete("b",void 0),n&&(!o.toJSON||!c.has("a",1)||c.has("a",2)||!c.has("a",void 0)||c.has("b"))||!h.size&&(n||!r)||!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"!==u||"x"!==new URL("https://x",void 0).host})},7476:(l,e,t)=>{var s=t(2195),i=t(9504);l.exports=function(r){if("Function"===s(r))return i(r)}},7566:(l,e,t)=>{var s=t(6840),i=t(9504),r=t(655),n=t(2812),a=URLSearchParams,o=a.prototype,h=i(o.getAll),c=i(o.has),u=new a("a=1");(u.has("a",2)||!u.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);n(p,1);for(var v=r(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),i=t(9565),r=t(2652),n=t(9306),a=t(8551),o=t(1767),h=t(9539),u=t(4549)("forEach",TypeError);s({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(f){a(this);try{n(f)}catch(m){h(this,"throw",m)}if(u)return i(u,this,f);var p=o(this),g=0;r(p,function(m){f(m,g++)},{IS_RECORD:!0})}})},7629:(l,e,t)=>{var s=t(6395),i=t(4576),r=t(9433),n="__core-js_shared__",a=l.exports=i[n]||r(n,{});(a.versions||(a.versions=[])).push({version:"3.46.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.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(l,e,t)=>{var s=t(6518),i=t(3440),r=t(9039);s({target:"Set",proto:!0,real:!0,forced:!t(4916)("difference",function(h){return 0===h.size})||r(function(){var h={size:1,has:function(){return!0},keys:function(){var u=0;return{next:function(){var d=u++>1;return c.has(1)&&c.clear(),{done:d,value:2}}}}},c=new Set([1,2,3,4]);return 3!==c.difference(h).size})},{difference:i})},7657:(l,e,t)=>{var f,p,g,s=t(9039),i=t(4901),r=t(34),n=t(2360),a=t(2787),o=t(6840),h=t(8227),c=t(6395),u=h("iterator"),d=!1;[].keys&&("next"in(g=[].keys())?(p=a(a(g)))!==Object.prototype&&(f=p):d=!0),!r(f)||s(function(){var v={};return f[u].call(v)!==v})?f={}:c&&(f=n(f)),i(f[u])||o(f,u,function(){return this}),l.exports={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:d}},7680:(l,e,t)=>{var s=t(9504);l.exports=s([].slice)},7696:(l,e,t)=>{var s=t(1291),i=t(8014),r=RangeError;l.exports=function(n){if(void 0===n)return 0;var a=s(n),o=i(a);if(a!==o)throw new r("Wrong length or index");return o}},7740:(l,e,t)=>{var s=t(9297),i=t(5031),r=t(7347),n=t(4913);l.exports=function(a,o,h){for(var c=i(o),u=n.f,d=r.f,f=0;f<c.length;f++){var p=c[f];!s(a,p)&&(!h||!s(h,p))&&u(a,p,d(o,p))}}},7750:(l,e,t)=>{var s=t(4117),i=TypeError;l.exports=function(r){if(s(r))throw new i("Can't call method on "+r);return r}},7751:(l,e,t)=>{var s=t(4576),i=t(4901);l.exports=function(n,a){return arguments.length<2?function(n){return i(n)?n:void 0}(s[n]):s[n]&&s[n][a]}},7811:l=>{l.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},7936:(l,e,t)=>{var s=t(6518),i=t(5636);i&&s({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},8004:(l,e,t)=>{var s=t(6518),i=t(9039),r=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)})||i(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:r})},8014:(l,e,t)=>{var s=t(1291),i=Math.min;l.exports=function(r){var n=s(r);return n>0?i(n,9007199254740991):0}},8100:(l,e,t)=>{var s=t(6518),i=t(5636);i&&s({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},8111:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(679),n=t(8551),a=t(4901),o=t(2787),h=t(2106),c=t(4659),u=t(9039),d=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=i[y],w=m||!a(A)||A.prototype!==p||!u(function(){A({})}),S=function(){if(r(this,p),o(this)===p)throw new E("Abstract class Iterator not directly constructable")},x=function(T,C){g?h(p,T,{configurable:!0,get:function(){return C},set:function(R){if(n(this),this===p)throw new E("You can't redefine this property");d(this,T)?this[T]=R:c(this,T,R)}}):p[T]=C};d(p,b)||x(b,y),(w||!d(p,v)||p[v]===Object)&&x(v,S),S.prototype=p,s({global:!0,constructor:!0,forced:w},{Iterator:S})},8227:(l,e,t)=>{var s=t(4576),i=t(5745),r=t(9297),n=t(3392),a=t(4495),o=t(7040),h=s.Symbol,c=i("wks"),u=o?h.for||h:h&&h.withoutSetter||n;l.exports=function(d){return r(c,d)||(c[d]=a&&r(h,d)?h[d]:u("Symbol."+d)),c[d]}},8235:(l,e,t)=>{var s=t(9504),i=t(9297),r=SyntaxError,n=parseInt,a=String.fromCharCode,o=s("".charAt),h=s("".slice),c=s(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\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(i(u,b))v+=u[b],g+=2;else{if("\\u"!==b)throw new r('Unknown escape sequence: "'+b+'"');var E=h(p,g+=2,g+4);if(!c(d,E))throw new r("Bad Unicode escape at: "+g);v+=a(n(E,16)),g+=4}}else{if('"'===y){m=!1,g++;break}if(c(f,y))throw new r("Bad control character in string literal at: "+g);v+=y,g++}}if(m)throw new r("Unterminated string at: "+g);return{value:v,end:g}}},8237:(l,e,t)=>{var s=t(6518),i=t(2652),r=t(9306),n=t(8551),a=t(1767),o=t(9539),h=t(4549),c=t(8745),u=t(9039),d=TypeError,f=u(function(){[].keys().reduce(function(){},void 0)}),p=!f&&h("reduce",d);s({target:"Iterator",proto:!0,real:!0,forced:f||p},{reduce:function(m){n(this);try{r(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(i(b,function(A){v?(v=!1,y=A):y=m(y,A,E),E++},{IS_RECORD:!0}),v)throw new d("Reduce of empty iterator with no initial value");return y}})},8335:(l,e,t)=>{var s=t(6518),i=t(3724),r=t(4576),n=t(7751),a=t(9504),o=t(9565),h=t(4901),c=t(34),u=t(4376),d=t(9297),f=t(655),p=t(6198),g=t(4659),m=t(9039),v=t(8235),y=t(4495),b=r.JSON,E=r.Number,A=r.SyntaxError,w=b&&b.parse,S=n("Object","keys"),x=Object.getOwnPropertyDescriptor,T=a("".charAt),C=a("".slice),R=a(/./.exec),M=a([].push),O=/^\d$/,F=/^[1-9]$/,j=/^[\d-]$/,D=/^[\t\n\r ]$/,et=function(L,P,k,X){var nt,Ft,Tt,bt,le,tt=L[P],G=X&&tt===X.value,rt=G&&"string"==typeof X.source?{source:X.source}:{};if(c(tt)){var Hs=u(tt),Ze=G?X.nodes:Hs?[]:{};if(Hs)for(nt=Ze.length,Tt=p(tt),bt=0;bt<Tt;bt++)ut(tt,bt,et(tt,""+bt,k,bt<nt?Ze[bt]:void 0));else for(Ft=S(tt),Tt=p(Ft),bt=0;bt<Tt;bt++)ut(tt,le=Ft[bt],et(tt,le,k,d(Ze,le)?Ze[le]:void 0))}return o(k,L,P,tt,rt)},ut=function(L,P,k){if(i){var X=x(L,P);if(X&&!X.configurable)return}void 0===k?delete L[P]:g(L,P,k)},Z=function(L,P,k,X){this.value=L,this.end=P,this.source=k,this.nodes=X},J=function(L,P){this.source=L,this.index=P};J.prototype={fork:function(L){return new J(this.source,L)},parse:function(){var L=this.source,P=this.skip(D,this.index),k=this.fork(P),X=T(L,P);if(R(j,X))return k.number();switch(X){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: "'+X+'" at: '+P)},node:function(L,P,k,X,tt){return new Z(P,X,L?null:C(this.source,k,X),tt)},object:function(){for(var L=this.source,P=this.index+1,k=!1,X={},tt={};P<L.length;){if(P=this.until(['"',"}"],P),"}"===T(L,P)&&!k){P++;break}var G=this.fork(P).string(),rt=G.value;P=this.until([":"],P=G.end)+1,P=this.skip(D,P),G=this.fork(P).parse(),g(tt,rt,G),g(X,rt,G.value),P=this.until([",","}"],G.end);var nt=T(L,P);if(","===nt)k=!0,P++;else if("}"===nt){P++;break}}return this.node(1,X,this.index,P,tt)},array:function(){for(var L=this.source,P=this.index+1,k=!1,X=[],tt=[];P<L.length;){if(P=this.skip(D,P),"]"===T(L,P)&&!k){P++;break}var G=this.fork(P).parse();if(M(tt,G),M(X,G.value),P=this.until([",","]"],G.end),","===T(L,P))k=!0,P++;else if("]"===T(L,P)){P++;break}}return this.node(1,X,this.index,P,tt)},string:function(){var L=this.index,P=v(this.source,this.index+1);return this.node(0,P.value,L,P.end)},number:function(){var L=this.source,P=this.index,k=P;if("-"===T(L,k)&&k++,"0"===T(L,k))k++;else{if(!R(F,T(L,k)))throw new A("Failed to parse number at: "+k);k=this.skip(O,k+1)}if(!("."===T(L,k)&&(k=this.skip(O,k+1)),"e"!==T(L,k)&&"E"!==T(L,k)||(k++,("+"===T(L,k)||"-"===T(L,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(C(L,P,k)),P,k)},keyword:function(L){var P=""+L,k=this.index,X=k+P.length;if(C(this.source,k,X)!==P)throw new A("Failed to parse value at: "+k);return this.node(0,L,k,X)},skip:function(L,P){for(var k=this.source;P<k.length&&R(L,T(k,P));P++);return P},until:function(L,P){P=this.skip(D,P);for(var k=T(this.source,P),X=0;X<L.length;X++)if(L[X]===k)return P;throw new A('Unexpected character: "'+k+'" at: '+P)}};var it=m(function(){var P,L="9007199254740993";return w(L,function(k,X,tt){P=tt.source}),P!==L}),yt=y&&!m(function(){return 1/w("-0 \t")!=-1/0});s({target:"JSON",stat:!0,forced:it},{parse:function(P,k){return yt&&!h(k)?w(P):function(L,P){L=f(L);var k=new J(L,0,""),X=k.parse(),tt=X.value,G=k.skip(D,X.end);if(G<L.length)throw new A('Unexpected extra character: "'+T(L,G)+'" after the parsed data at: '+G);return h(P)?et({"":tt},"",P,X):tt}(P,k)}})},8469:(l,e,t)=>{var s=t(9504),i=t(507),r=t(4402),n=r.Set,a=r.proto,o=s(a.forEach),h=s(a.keys),c=h(new n).next;l.exports=function(u,d,f){return f?i({iterator:h(u),next:c},d):o(u,d)}},8480:(l,e,t)=>{var s=t(1828),r=t(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(a){return s(a,r)}},8527:(l,e,t)=>{var s=t(7080),i=t(4402).has,r=t(5170),n=t(3789),a=t(507),o=t(9539);l.exports=function(c){var u=s(this),d=n(c);if(r(u)<d.size)return!1;var f=d.getIterator();return!1!==a(f,function(p){if(!i(u,p))return o(f,"normal",!1)})}},8551:(l,e,t)=>{var s=t(34),i=String,r=TypeError;l.exports=function(n){if(s(n))return n;throw new r(i(n)+" is not an object")}},8574:(l,e,t)=>{var s=t(9504),i=Error,r=s("".replace),n=String(new i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,o=a.test(n);l.exports=function(h,c){if(o&&"string"==typeof h&&!i.prepareStackTrace)for(;c--;)h=r(h,a,"");return h}},8622:(l,e,t)=>{var s=t(4576),i=t(4901),r=s.WeakMap;l.exports=i(r)&&/native code/.test(String(r))},8646:(l,e,t)=>{var s=t(9565),i=t(8551),r=t(1767),n=t(851);l.exports=function(a,o){(!o||"string"!=typeof a)&&i(a);var h=n(a);return r(i(void 0!==h?s(h,a):a))}},8686:(l,e,t)=>{var s=t(3724),i=t(9039);l.exports=s&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8721:(l,e,t)=>{var s=t(3724),i=t(9504),r=t(2106),n=URLSearchParams.prototype,a=i(n.forEach);s&&!("size"in n)&&r(n,"size",{get:function(){var h=0;return a(this,function(){h++}),h},configurable:!0,enumerable:!0})},8727:l=>{l.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(l,e,t)=>{var s=t(616),i=Function.prototype,r=i.apply,n=i.call;l.exports="object"==typeof Reflect&&Reflect.apply||(s?n.bind(r):function(){return n.apply(r,arguments)})},8750:(l,e,t)=>{var s=t(7080),i=t(4402),r=t(5170),n=t(3789),a=t(8469),o=t(507),h=i.Set,c=i.add,u=i.has;l.exports=function(f){var p=s(this),g=n(f),m=new h;return r(p)>g.size?o(g.getIterator(),function(v){u(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,i=s&&!t.call({1:2},1);e.f=i?function(n){var a=s(this,n);return!!a&&a.enumerable}:t},8981:(l,e,t)=>{var s=t(7750),i=Object;l.exports=function(r){return i(s(r))}},9039:l=>{l.exports=function(e){try{return!!e()}catch{return!0}}},9143:(l,e,t)=>{var s=t(4576),i=t(9504),r=t(3972),n=t(3463),a=t(9297),o=t(2804),h=t(944),c=t(5169),u=o.c2i,d=o.c2iUrl,f=s.SyntaxError,p=s.TypeError,g=i("".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)],x=[S>>16&255,S>>8&255,255&S];if(2===w){if(A&&0!==x[1])throw new f("Extra bits");return[x[0]]}if(3===w){if(A&&0!==x[2])throw new f("Extra bits");return[x[0],x[1]]}return x},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){n(b),r(E);var S="base64"===h(E)?u:d,x=E?E.lastChunkHandling:void 0;if(void 0===x&&(x="loose"),"loose"!==x&&"strict"!==x&&"stop-before-partial"!==x)throw new p("Incorrect `lastChunkHandling` option");A&&c(A.buffer);var T=b.length,C=A||[],R=0,M=0,O="",F=0;if(w)for(;;){if((F=m(b,F))===T){if(O.length>0){if("stop-before-partial"===x)break;if("loose"!==x)throw new f("Missing padding");if(1===O.length)throw new f("Malformed padding: exactly one additional character");R=y(C,v(O,S,!1),R)}M=T;break}var j=g(b,F);if(++F,"="===j){if(O.length<2)throw new f("Padding is too early");if(F=m(b,F),2===O.length){if(F===T){if("stop-before-partial"===x)break;throw new f("Malformed padding: only one =")}"="===g(b,F)&&(++F,F=m(b,F))}if(F<T)throw new f("Unexpected character after padding");R=y(C,v(O,S,"strict"===x),R),M=T;break}if(!a(S,j))throw new f("Unexpected character");var D=w-R;if(1===D&&2===O.length||2===D&&3===O.length||4===(O+=j).length&&(R=y(C,v(O,S,!1),R),O="",M=F,R===w))break}return{bytes:C,read:M,written:R}}},9286:(l,e,t)=>{var s=t(4402),i=t(8469),r=s.Set,n=s.add;l.exports=function(a){var o=new r;return i(a,function(h){n(o,h)}),o}},9297:(l,e,t)=>{var s=t(9504),i=t(8981),r=s({}.hasOwnProperty);l.exports=Object.hasOwn||function(a,o){return r(i(a),o)}},9306:(l,e,t)=>{var s=t(4901),i=t(6823),r=TypeError;l.exports=function(n){if(s(n))return n;throw new r(i(n)+" is not a function")}},9314:(l,e,t)=>{var s=t(6518),i=t(9565),r=t(8551),n=t(1767),a=t(4149),o=t(9590),h=t(9539),c=t(9462),u=t(684),d=t(4549),f=t(6395),p=!f&&!u("drop",0),g=!f&&!p&&d("drop",RangeError),m=f||p||g,v=c(function(){for(var E,y=this.iterator,b=this.next;this.remaining;)if(this.remaining--,E=r(i(b,y)),this.done=!!E.done)return;if(E=r(i(b,y)),!(this.done=!!E.done))return E.value});s({target:"Iterator",proto:!0,real:!0,forced:m},{drop:function(b){var E;r(this);try{E=o(a(+b))}catch(A){h(this,"throw",A)}return g?i(g,this,E):new v(n(this),{remaining:E})}})},9429:(l,e,t)=>{var s=t(4576),i=t(6193);l.exports=function(r){if(i){try{return s.process.getBuiltinModule(r)}catch{}try{return Function('return require("'+r+'")')()}catch{}}}},9432:(l,e,t)=>{t(5213)},9433:(l,e,t)=>{var s=t(4576),i=Object.defineProperty;l.exports=function(r,n){try{i(s,r,{value:n,configurable:!0,writable:!0})}catch{s[r]=n}return n}},9462:(l,e,t)=>{var s=t(9565),i=t(2360),r=t(6699),n=t(6279),a=t(8227),o=t(1181),h=t(5966),c=t(7657).IteratorPrototype,u=t(2529),d=t(9539),f=t(1385),p=a("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",b=o.set,E=function(S){var x=o.getterFor(S?m:g);return n(i(c),{next:function(){var C=x(this);if(S)return C.nextHandler();if(C.done)return u(void 0,!0);try{var R=C.nextHandler();return C.returnHandlerResult?R:u(R,C.done)}catch(M){throw C.done=!0,M}},return:function(){var T=x(this),C=T.iterator;if(T.done=!0,S){var R=h(C,"return");return R?s(R,C):u(void 0,!0)}if(T.inner)try{d(T.inner.iterator,v)}catch(M){return d(C,y,M)}if(T.openIters)try{f(T.openIters,v)}catch(M){return d(C,y,M)}return C&&d(C,v),u(void 0,!0)}})},A=E(!0),w=E(!1);r(w,p,"Iterator Helper"),l.exports=function(S,x,T){var C=function(M,O){O?(O.iterator=M.iterator,O.next=M.next):O=M,O.type=x?m:g,O.returnHandlerResult=!!T,O.nextHandler=S,O.counter=0,O.done=!1,b(this,O)};return C.prototype=x?A:w,C}},9486:(l,e,t)=>{var s=t(6518),i=t(4576),r=t(9504),n=t(3972),a=t(4154),o=t(5169),h=t(2804),c=t(944),u=h.i2c,d=h.i2cUrl,f=r("".charAt),p=i.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?n(arguments[0]):void 0,b="base64"===c(y)?u:d,E=!!y&&!!y.omitPadding;o(this.buffer);for(var x,A="",w=0,S=v.length,T=function(C){return f(b,x>>6*C&63)};w+2<S;w+=3)x=(v[w]<<16)+(v[w+1]<<8)+v[w+2],A+=T(3)+T(2)+T(1)+T(0);return w+2===S?(x=(v[w]<<16)+(v[w+1]<<8),A+=T(3)+T(2)+T(1)+(E?"":"=")):w+1===S&&(x=v[w]<<16,A+=T(3)+T(2)+(E?"":"==")),A}})},9504:(l,e,t)=>{var s=t(616),i=Function.prototype,r=i.call,n=s&&i.bind.bind(r,r);l.exports=s?n:function(a){return function(){return r.apply(a,arguments)}}},9519:(l,e,t)=>{var h,c,s=t(4576),i=t(2839),r=s.process,n=s.Deno,a=r&&r.versions||n&&n.version,o=a&&a.v8;o&&(c=(h=o.split("."))[0]>0&&h[0]<4?1:+(h[0]+h[1])),!c&&i&&(!(h=i.match(/Edge\/(\d+)/))||h[1]>=74)&&(h=i.match(/Chrome\/(\d+)/))&&(c=+h[1]),l.exports=c},9539:(l,e,t)=>{var s=t(9565),i=t(8551),r=t(5966);l.exports=function(n,a,o){var h,c;i(n);try{if(!(h=r(n,"return"))){if("throw"===a)throw o;return o}h=s(h,n)}catch(u){c=!0,h=u}if("throw"===a)throw o;if(c)throw h;return i(h),o}},9565:(l,e,t)=>{var s=t(616),i=Function.prototype.call;l.exports=s?i.bind(i):function(){return i.apply(i,arguments)}},9577:(l,e,t)=>{var s=t(9928),i=t(4644),r=t(1108),n=t(1291),a=t(5854),o=i.aTypedArray,h=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,u=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(f){return 8===f}}(),d=u&&function(){try{new Int8Array(1).with(-.5,1)}catch{return!0}}();c("with",function(f,p){var g=o(this),m=n(f),v=r(g)?a(p):+p;return s(g,h(g),m,v)},!u||d)},9590:(l,e,t)=>{var s=t(1291),i=RangeError;l.exports=function(r){var n=s(r);if(n<0)throw new i("The argument can't be less than 0");return n}},9617:(l,e,t)=>{var s=t(5397),i=t(5610),r=t(6198),n=function(a){return function(o,h,c){var u=s(o),d=r(u);if(0===d)return!a&&-1;var p,f=i(c,d);if(a&&h!=h){for(;d>f;)if((p=u[f++])!=p)return!0}else for(;d>f;f++)if((a||f in u)&&u[f]===h)return a||f||0;return!a&&-1}};l.exports={includes:n(!0),indexOf:n(!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}}}})}},i=t[e](s);return 1===i.size&&4===i.values().next().value}catch{return!1}}},9928:(l,e,t)=>{var s=t(6198),i=t(1291),r=RangeError;l.exports=function(n,a,o,h){var c=s(n),u=i(o),d=u<0?c+u:u;if(d>=c||d<0)throw new r("Incorrect index");for(var f=new a(c),p=0;p<c;p++)f[p]=p===d?h:n[p];return f}}},Gs={};function K(l){var e=Gs[l];if(void 0!==e)return e.exports;var t=Gs[l]={exports:{}};return ar[l].call(t.exports,t,t.exports,K),t.exports}K.d=(l,e)=>{for(var t in e)K.o(e,t)&&!K.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:e[t]})},K.o=(l,e)=>Object.prototype.hasOwnProperty.call(l,e),K(4114),K(6573),K(8100),K(7936),K(8111),K(8237),K(1689),K(9577),K(4235),K(9432),K(1549),K(9797),K(9631),K(5623),K(4979),K(5781);const xt=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),es=[.001,0,0,.001,0,0],Ht={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},he="pdfjs_internal_editor_",Y={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102}
1,_={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},zs={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ce={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ht={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},ue={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},Vs={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Oe=ue.WARNINGS;function lr(){return Oe}function Me(l){Oe>=ue.INFOS&&console.info(`Info: ${l}`)}function V(l){Oe>=ue.WARNINGS&&console.warn(`Warning: ${l}`)}function st(l){throw new Error(l)}function Q(l,e){l||st(e)}function rs(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 gr(l){return decodeURIComponent(escape(l))}(l)}catch{}const s=e?URL.parse(l,e):URL.parse(l);return function hr(l){switch(l?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s)?s:null}function ns(l,e,t=!1){const s=URL.parse(l);return s?(s.hash=e,s.href):t&&rs(l,"http://example.com")?l.split("#",1)[0]+""+(e?`#${e}`:""):""}function W(l,e,t,s=!1){return Object.defineProperty(l,e,{value:t,enumerable:!s,configurable:!0,writable:!1}),t}const zt=function(){function e(t,s){this.message=t,this.name=s}return e.prototype=new Error,e.constructor=e,e}();class Ws extends zt{constructor(e,t){super(e,"PasswordException"),this.code=t}}class as extends zt{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Le extends zt{constructor(e){super(e,"InvalidPDFException")}}class fe extends zt{constructor(e,t,s){super(e,"ResponseException"),this.status=t,this.missing=s}}class cr extends zt{constructor(e){super(e,"FormatError")}}class jt extends zt{constructor(e){super(e,"AbortException")}}function Xs(l){("object"!=typeof l||void 0===l?.length)&&st("Invalid argument for bytesToString");const e=l.length,t=8192;if(e<t)return String.fromCharCode.apply(null,l);const s=[];for(let i=0;i<e;i+=t){const r=Math.min(i+t,e),n=l.subarray(i,r);s.push(String.fromCharCode.apply(null,n))}return s.join("")}function Jt(l){"string"!=typeof l&&st("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 ft{static get isLittleEndian(){return W(this,"isLittleEndian",function dr(){const l=new Uint8Array(4);return l[0]=1,1===new Uint32Array(l.buffer,0,1)[0]}())}static get isEvalSupported(){return W(this,"isEvalSupported",function fr(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return W(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return W(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return W(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return W(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:t}=navigator;return W(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 W(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Fe=Array.from(Array(256).keys(),l=>l.toString(16).padStart(2,"0"));class B{static makeHexColor(e,t,s){return`#${Fe[e]}${Fe[t]}${Fe[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 i=e[s],r=e[s+1];e[s]=i*t[0]+r*t[2]+t[4],e[s+1]=i*t[1]+r*t[3]+t[5]}static applyTransformToBezier(e,t,s=0){const i=t[0],r=t[1],n=t[2],a=t[3],o=t[4],h=t[5];for(let c=0;c<6;c+=2){const u=e[s+c],d=e[s+c+1];e[s+c]=u*i+d*n+o,e[s+c+1]=u*r+d*a+h}}static applyInverseTransform(e,t){const s=e[0],i=e[1],r=t[0]*t[3]-t[1]*t[2];e[0]=(s*t[3]-i*t[2]+t[2]*t[5]-t[4]*t[3])/r,e[1]=(-s*t[1]+i*t[0]+t[4]*t[1]-t[5]*t[0])/r}static axialAlignedBoundingBox(e,t,s){const i=t[0],r=t[1],n=t[2],a=t[3],o=t[4],h=t[5],c=e[0],u=e[1],d=e[2],f=e[3];let p=i*c+o,g=p,m=i*d+o,v=m,y=a*u+h,b=y,E=a*f+h,A=E;if(0!==r||0!==n){const w=r*c,S=r*d,x=n*u,T=n*f;
vendor: 17,735 bytes, line 1
1p+=x,v+=x,m+=T,g+=T,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],i=e[1],r=e[2],n=e[3],a=s**2+i**2,h=r**2+n**2,c=(a+h)/2,u=Math.sqrt(c**2-(a*h-(s*r+i*n)**2));t[0]=Math.sqrt(c+u||1),t[1]=Math.sqrt(c-u||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])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(s>i)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),n=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>n?null:[s,r,i,n]}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,i,r){r[0]=Math.min(r[0],e,s),r[1]=Math.min(r[1],t,i),r[2]=Math.max(r[2],e,s),r[3]=Math.max(r[3],t,i)}static#t(e,t,s,i,r,n,a,o,h,c){if(h<=0||h>=1)return;const u=1-h,d=h*h,f=d*h,p=u*(u*(u*e+3*h*t)+3*d*s)+f*i,g=u*(u*(u*r+3*h*n)+3*d*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,i,r,n,a,o,h,c,u,d){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&this.#t(e,t,s,i,r,n,a,o,-u/c,d));const f=c**2-4*u*h;if(f<0)return;const p=Math.sqrt(f),g=2*h;this.#t(e,t,s,i,r,n,a,o,(-c+p)/g,d),this.#t(e,t,s,i,r,n,a,o,(-c-p)/g,d)}static bezierBoundingBox(e,t,s,i,r,n,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,r,a,t,i,n,o,3*(3*(s-r)-e+a),6*(e-2*s+r),3*(s-e),h),this.#e(e,s,r,a,t,i,n,o,3*(3*(i-n)-t+o),6*(t-2*i+n),3*(i-t),h)}}let os=null,Ys=null;function Ks(l){return os||(os=/([\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,Ys=new Map([["\ufb05","\u017ft"]])),l.replaceAll(os,(e,t,s)=>t?t.normalize("NFKC"):Ys.get(s))}function ls(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const l=new Uint8Array(32);return crypto.getRandomValues(l),Xs(l)}const Zt="pdfjs_internal_id_";function Et(l,e,t){return Math.min(Math.max(l,e),t)}function _s(l){return Uint8Array.prototype.toBase64?l.toBase64():btoa(Xs(l))}"function"!=typeof Math.sumPrecise&&(Math.sumPrecise=function(l){return l.reduce((e,t)=>e+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}),K(1701),K(4603),K(7566),K(8721);class pe{static textContent(e){const t=[],s={items:t,styles:Object.create(null)};return function i(r){if(!r)return;let n=null;const a=r.name;if("#text"===a)n=r.value;else{if(!pe.shouldBuildText(a))return;r?.attributes?.textContent?n=r.attributes.textContent:r.value&&(n=r.value)}if(null!==n&&t.push({str:n}),r.children)for(const o of r.children)i(o)}(e),s}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}class hs{static setupStorage(e,t,s,i,r){const n=i.getValue(t,{value:null});switch(s.name){case"textarea":if(null!==n.value&&(e.textContent=n.value),"print"===r)break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})});break;case"input":if("radio"===s.attributes.type||"checkbox"===s.attributes.type){if(n.value===s.attributes.xfaOn?e.setAttribute("checked",!0):n.value===s.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",a=>{i.setValue(t,{value:a.target.getAttribute(a.target.checked?"xfaOn":"xfaOff")})})}else{if(null!==n.value&&e.setAttribute("value",n.value),"print"===r)break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})})}break;case"select":if(null!==n.value){e.setAttribute("value",n.value);for(const a of s.children)a.attributes.value===n.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const o=a.target.options;i.setValue(t,{value:-1===o.selectedIndex?"":o[o.selectedIndex].value})})}}static setAttributes({html:e,element:t,storage:s=null,intent:i,linkService:r}){const{attributes:n}=t,a=e instanceof HTMLAnchorElement;"radio"===n.type&&(n.name=`${n.name}-${i}`);for(const[o,h]of Object.entries(n))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&&r.addLinkAttributes(e,n.href,n.newWindow),s&&n.dataId&&this.setupStorage(e,n.dataId,t,s)}static render(e){const t=e.annotationStorage,s=e.linkService,i=e.xfaHtml,r=e.intent||"display",n=document.createElement(i.name);i.attributes&&this.setAttributes({html:n,element:i,intent:r,linkService:s});const a="richText"!==r,o=e.div;if(o.append(n),e.viewport){const u=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=u}a&&o.setAttribute("class","xfaLayer xfaFont");const h=[];if(0===i.children.length){if(i.value){const u=document.createTextNode(i.value);n.append(u),a&&pe.shouldBuildText(i.name)&&h.push(u)}return{textDivs:h}}const c=[[i,-1,n]];for(;c.length>0;){const[u,d,f]=c.at(-1);if(d+1===u.children.length){c.pop();continue}const p=u.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:r,linkService:s}),p.children?.length>0)c.push([p,-1,m]);else if(p.value){const v=document.createTextNode(p.value);a&&pe.shouldBuildText(g)&&h.push(v),m.append(v)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.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 $t="http://www.w3.org/2000/svg";class Vt{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}function qt(l){return cs.apply(this,arguments)}function cs(){return(cs=N(function*(l,e="text"){if(ve(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 i=new XMLHttpRequest;i.open("GET",l,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(200===i.status||0===i.status){switch(e){case"arraybuffer":case"blob":case"json":return void t(i.response)}return void t(i.responseText)}s(new Error(i.statusText))}},i.send(null)})})).apply(this,arguments)}class ge{constructor({viewBox:e,userUnit:t,scale:s,rotation:i,offsetX:r=0,offsetY:n=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=t,this.scale=s,this.rotation=i,this.offsetX=r,this.offsetY=n,s*=t;const o=(e[2]+e[0])/2,h=(e[3]+e[1])/2;let c,u,d,f,p,g,m,v;switch((i%=360)<0&&(i+=360),i){case 180:c=-1,u=0,d=0,f=1;break;case 90:c=0,u=1,d=1,f=0;break;case 270:c=0,u=-1,d=-1,f=0;break;case 0:c=1,u=0,d=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,f=-f),0===c?(p=Math.abs(h-e[1])*s+r,g=Math.abs(o-e[0])*s+n,m=(e[3]-e[1])*s,v=(e[2]-e[0])*s):(p=Math.abs(o-e[0])*s+r,g=Math.abs(h-e[1])*s+n,m=(e[2]-e[0])*s,v=(e[3]-e[1])*s),this.transform=[c*s,u*s,d*s,f*s,p-c*s*o-d*s*h,g-u*s*o-f*s*h],this.width=m,this.height=v}get rawDims(){const e=this.viewBox;return W(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:i=this.offsetY,dontFlip:r=!1}={}){return new ge({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:s,offsetY:i,dontFlip:r})}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 ke extends zt{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function me(l){const e=l.length;let t=0;for(;t<e&&""===l[t].trim();)t++;return"data:"===l.substring(t,t+5).toLowerCase()}function Ne(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(me(l))return V('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 i=a=>{try{let o=decodeURIComponent(a);return o.includes("/")?(o=o.split("/").at(-1),o.test(/^\.pdf$/i)?o:a):o}catch{return a}},r=/\.pdf$/i,n=s.pathname.split("/").at(-1);if(r.test(n))return i(n);if(s.searchParams.size>0){const a=Array.from(s.searchParams.values()).reverse();for(const h of a)if(r.test(h))return i(h);const o=Array.from(s.searchParams.keys()).reverse();for(const h of o)if(r.test(h))return i(h)}if(s.hash){const o=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(o)return i(o[0])}return e}class Zs{started=Object.create(null);times=[];time(e){e in this.started&&V(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||V(`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:i,end:r}of this.times)e.push(`${s.padEnd(t)} ${r-i}ms\n`);return e.join("")}}function ve(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 at(l){l.preventDefault(),l.stopPropagation()}class Be{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 i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r:1;let n=parseInt(t[4],10);n=n>=0&&n<=23?n: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 u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===h?(n+=c,a+=u):"+"===h&&(n-=c,a-=u),new Date(Date.UTC(s,i,r,n,a,o))}}function qs(l,{scale:e=1,rotation:t=0}){const{width:s,height:i}=l.attributes.style,r=[0,0,parseInt(s),parseInt(i)];return new ge({viewBox:r,userUnit:1,scale:e,rotation:t})}function te(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):(V(`Not a valid color format: "${l}"`),[0,0,0])}function ot(l){const{a:e,b:t,c:s,d:i,e:r,f:n}=l.getTransform();return[e,t,s,i,r,n]}function Nt(l){const{a:e,b:t,c:s,d:i,e:r,f:n}=l.getTransform().invertSelf();return[e,t,s,i,r,n]}function Gt(l,e,t=!1,s=!0){if(e instanceof ge){const{pageWidth:i,pageHeight:r}=e.rawDims,{style:n}=l,a=ft.isCSSRoundSupported,o=`var(--total-scale-factor) * ${i}px`,h=`var(--total-scale-factor) * ${r}px`,c=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,u=a?`round(down, ${h}, var(--scale-round-y))`:`calc(${h})`;t&&e.rotation%180!=0?(n.width=u,n.height=c):(n.width=c,n.height=u)}s&&l.setAttribute("data-main-rotation",e.rotation)}class kt{constructor(){const{pixelRatio:e}=kt;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,i,r=-1){let n=1/0,a=1/0,o=1/0;(s=kt.capPixels(s,r))>0&&(n=Math.sqrt(s/(e*t))),-1!==i&&(a=i/e,o=i/t);const h=Math.min(n,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 Ue=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Ar{static get isDarkMode(){return W(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class ti{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(),W(this,"commentForegroundColor",te(s))}}function ei(l,e,t,s){const i=255*(1-(s=Math.min(Math.max(s??1,0),1)));return[l=Math.round(l*s+i),e=Math.round(e*s+i),t=Math.round(t*s+i)]}function si(l,e){const t=l[0]/255,s=l[1]/255,i=l[2]/255,r=Math.max(t,s,i),n=Math.min(t,s,i),a=(r+n)/2;if(r===n)e[0]=e[1]=0;else{const o=r-n;switch(e[1]=a<.5?o/(r+n):o/(2-r-n),r){case t:e[0]=60*((s-i)/o+(s<i?6:0));break;case s:e[0]=60*((i-t)/o+2);break;case i:e[0]=60*((t-s)/o+4)}}e[2]=a}function us(l,e){const t=l[0],s=l[1],i=l[2],r=(1-Math.abs(2*i-1))*s,n=r*(1-Math.abs(t/60%2-1)),a=i-r/2;switch(Math.floor(t/60)){case 0:e[0]=r+a,e[1]=n+a,e[2]=a;break;case 1:e[0]=n+a,e[1]=r+a,e[2]=a;break;case 2:e[0]=a,e[1]=r+a,e[2]=n+a;break;case 3:e[0]=a,e[1]=n+a,e[2]=r+a;break;case 4:e[0]=n+a,e[1]=a,e[2]=r+a;break;case 5:case 6:e[0]=r+a,e[1]=a,e[2]=n+a}}function ii(l){return l<=.03928?l/12.92:((l+.055)/1.055)**2.4}function ri(l,e,t){us(l,t),t.map(ii);const s=.2126*t[0]+.7152*t[1]+.0722*t[2];us(e,t),t.map(ii);const i=.2126*t[0]+.7152*t[1]+.0722*t[2];return s>i?(s+.05)/(i+.05):(i+.05)/(s+.05)}const ni=new Map;function ai(l,e){const t=l[0]+256*l[1]+65536*l[2]+16777216*e[0]+4294967296*e[1]+1099511627776*e[2];let s=ni.get(t);if(s)return s;const i=new Float32Array(9),r=i.subarray(0,3),n=i.subarray(3,6);si(l,n);const a=i.subarray(6,9);si(e,a);const o=a[2]<.5,h=o?12:4.5;if(n[2]=o?Math.sqrt(n[2]):1-Math.sqrt(1-n[2]),ri(n,a,r)<h){let c,u;o?(c=n[2],u=1):(c=0,u=n[2]);const d=.005;for(;u-c>d;){const f=n[2]=(c+u)/2;o===ri(n,a,r)<h?c=f:u=f}n[2]=o?u:c}return us(n,r),s=B.makeHexColor(Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])),ni.set(t,s),s}function ds({html:l,dir:e,className:t},s){const i=document.createDocumentFragment();if("string"==typeof l){const r=document.createElement("p");r.dir=e||"auto";const n=l.split(/(?:\r\n?|\n)/);for(let a=0,o=n.length;a<o;++a)r.append(document.createTextNode(n[a])),a<o-1&&r.append(document.createElement("br"));i.append(r)}else hs.render({xfaHtml:l,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",t),s.append(i)}function oi(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:V(`Unrecognized drawing path operator: ${l[t-1]}`)}return e}K(4972),K(4628),K(7642),K(8004),K(3853),K(5876),K(2475),K(5024),K(1698),K(9314),K(1148),K(3579),K(8335);class ye{#t=null;#e=null;#i;#s=null;#a=null;#n=null;#r=null;#o=null;static#h=null;constructor(e){this.#i=e,ye.#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.#i._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",It,{signal:t}),e.addEventListener("pointerdown",ye.#l,{signal:t}));const s=this.#s=document.createElement("div");s.className="buttons",e.append(s);const i=this.#i.toolbarPosition;if(i){const{style:r}=e,n="ltr"===this.#i._uiManager.direction?1-i[0]:i[0];r.insetInlineEnd=100*n+"%",r.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#t}static#l(e){e.stopPropagation()}#d(e){this.#i._focusEventsAllowed=!1,at(e)}#u(e){this.#i._focusEventsAllowed=!0,at(e)}#f(e){const t=this.#i._uiManager._signal;return t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#u.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.#n?.shown()}
1addDeleteButton(){const{editorType:e,_uiManager:t}=this.#i,s=document.createElement("button");s.classList.add("basic","deleteButton"),s.tabIndex=0,s.setAttribute("data-l10n-id",ye.#h[e]),this.#f(s)&&s.addEventListener("click",i=>{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 N(function*(){const s=yield e.render();t.#f(s),t.#s.append(s,t.#m),t.#a=e})()}addComment(e,t=null){if(this.#n)return;const s=e.renderForToolbar();if(!s)return;this.#f(s);const i=this.#r=this.#m;t?(this.#s.insertBefore(s,t),this.#s.insertBefore(i,t)):this.#s.append(s,i),this.#n=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 N(function*(){const s=t.#o=yield e.renderEditButton(t.#i);t.#f(s),t.#s.append(s,t.#m)})()}removeButton(e){"comment"===e&&(this.#n?.removeToolbarCommentButton(),this.#n=null,this.#r?.remove(),this.#r=null)}addButton(e,t){var s=this;return N(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 i=this;return N(function*(){if(!t&&"comment"===e)return;const r=i.#s.querySelector(s);r&&"comment"===e&&i.addComment(t,r)})()}updateEditSignatureButton(e){this.#o&&(this.#o.title=e)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class wr{#t=null;#e=null;#i;constructor(e){this.#i=e}#s(){const e=this.#e=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const t=this.#i._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.#i.hasCommentManager()&&this.#n("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#i.commentSelection("floating_button")}),this.#n("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#i.highlightSelection("floating_button")}),e}#a(e,t){let s=0,i=0;for(const r of e){const n=r.y+r.height;if(n<s)continue;const a=r.x+(t?r.width:0);n>s?(i=a,s=n):t?a>i&&(i=a):a<i&&(i=a)}return[t?1-i:i,s]}show(e,t,s){const[i,r]=this.#a(t,s),{style:n}=this.#e||=this.#s();e.append(this.#e),n.insetInlineEnd=100*i+"%",n.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#n(e,t,s,i){const r=document.createElement("button");r.classList.add("basic",e),r.tabIndex=0,r.setAttribute("data-l10n-id",t);const n=document.createElement("span");r.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id",s);const a=this.#i._signal;a instanceof AbortSignal&&!a.aborted&&(r.addEventListener("contextmenu",It,{signal:a}),r.addEventListener("click",i,{signal:a})),this.#t.append(r)}}function li(l,e,t){for(const s of t)e.addEventListener(s,l[s].bind(l))}class q{static#t=NaN;static#e=null;static#i=NaN;static#s=null;static initializeAndAddPointerId(e){(q.#e||=new Set).add(e)}static setPointer(e,t){q.#t||=t,q.#s??=e}static setTimeStamp(e){q.#i=e}static isSamePointerId(e){return q.#t===e}static isSamePointerIdOrRemove(e){return q.#t===e||(q.#e?.delete(e),!1)}static isSamePointerType(e){return q.#s===e}static isInitializedAndDifferentPointerType(e){return null!==q.#s&&!q.isSamePointerType(e)}static isSameTimeStamp(e){return q.#i===e}static isUsingMultiplePointers(){return q.#e?.size>=1}static clearPointerType(){q.#s=null}static clearPointerIds(){q.#t=NaN,q.#e=null}static clearTimeStamp(){q.#i=NaN}}class Er{#t=0;get id(){return`${he}${this.#t++}`}}class fs{#t=ls();#e=0;#i=null;static get _isSVGFittingCanvas(){const s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;return i.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>',W(this,"_isSVGFittingCanvas",i.decode().then(()=>(s.drawImage(i,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 N(function*(){s.#i||=new Map;let i=s.#i.get(e);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let r;if(i||={bitmap:null,id:`image_${s.#t}_${s.#e++}`,refCounter:0,isSvg:!1},"string"==typeof t?(i.url=t,r=yield qt(t,"blob")):t instanceof File?r=i.file=t:t instanceof Blob&&(r=t),"image/svg+xml"===r.type){const n=fs._isSVGFittingCanvas,a=new FileReader,o=new Image,h=new Promise((c,u)=>{o.onload=()=>
1{i.bitmap=o,i.isSvg=!0,c()},a.onload=N(function*(){const d=i.svgUrl=a.result;o.src=(yield n)?`${d}#svgView(preserveAspectRatio(none))`:d}),o.onerror=a.onerror=u});a.readAsDataURL(r),yield h}else i.bitmap=yield createImageBitmap(r);i.refCounter=1}catch(r){V(r),i=null}return s.#i.set(e,i),i&&s.#i.set(i.id,i),i})()}getFromFile(e){var t=this;return N(function*(){const{lastModified:s,name:i,size:r,type:n}=e;return t.#s(`${s}_${i}_${r}_${n}`,e)})()}getFromUrl(e){var t=this;return N(function*(){return t.#s(e,e)})()}getFromBlob(e,t){var s=this;return N(function*(){const i=yield t;return s.#s(e,i)})()}getFromId(e){var t=this;return N(function*(){t.#i||=new Map;const s=t.#i.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:i}=s;return delete s.blobPromise,t.getFromBlob(s.id,i)}return t.getFromUrl(s.url)})()}getFromCanvas(e,t){this.#i||=new Map;let s=this.#i.get(e);if(s?.bitmap)return s.refCounter+=1,s;const i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),s={bitmap:i.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#i.set(e,s),this.#i.set(s.id,s),s}getSvgUrl(e){const t=this.#i.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#i||=new Map;const t=this.#i.get(e);if(!t||(t.refCounter-=1,0!==t.refCounter))return;const{bitmap:s}=t;if(!t.url&&!t.file){const i=new OffscreenCanvas(s.width,s.height);i.getContext("bitmaprenderer").transferFromImageBitmap(s),t.blobPromise=i.convertToBlob()}s.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#t}_`)}}class Sr{#t=[];#e=!1;#i;#s=-1;constructor(e=128){this.#i=e}add({cmd:e,undo:t,post:s,mustExec:i,type:r=NaN,overwriteIfSameType:n=!1,keepUndo:a=!1}){if(i&&e(),this.#e)return;const o={cmd:e,undo:t,post:s,type:r};if(-1===this.#s)return this.#t.length>0&&(this.#t.length=0),this.#s=0,void this.#t.push(o);if(n&&this.#t[this.#s].type===r)return a&&(o.undo=this.#t[this.#s].undo),void(this.#t[this.#s]=o);const h=this.#s+1;h===this.#i?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 be{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=ft.platform;for(const[s,i,r={}]of e)for(const n of s){const a=n.startsWith("mac+");t&&a?(this.callbacks.set(n.slice(4),{callback:i,options:r}),this.allKeys.add(n.split("+").at(-1))):!t&&!a&&(this.callbacks.set(n,{callback:i,options:r}),this.allKeys.add(n.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:i,options:{bubbles:r=!1,args:n=[],checker:a=null}}=s;a&&!a(e,t)||(i.bind(e,...n,t)(),r||at(t))}}class ps{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return function br(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;const s=window.getComputedStyle(e).color;l.set(t,te(s))}e.remove()}(e),W(this,"_colors",e)}convert(e){const t=te(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[s,i]of this._colors)if(i.every((r,n)=>r===t[n]))return ps._colorsMapping.get(s);return t}getHexCode(e){const t=this._colors.get(e);return t?B.makeHexColor(...t):e}}let ee=(()=>{class l{#t=new AbortController;#e=null;#i=null;#s=new Map;#a=new Map;#n=null;#r=null;#o=null;#h=new Sr;#l=null;#d=null;#u=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 Er;#P=!1;#I=!1;#B=!1;#M=null;#F=null;#U=null;#k=null;#V=null;#C=Y.NONE;#E=new Set;#L=null;#H=null;#$=null;#Y=null;#X=null;#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#G=[0,0];#N=null;#W=null;#Z=null;#q=null;#j=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=l.prototype,s=a=>a.#W.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&a.hasSomethingToControl(),i=(a,{target:o})=>{if(o instanceof HTMLInputElement){const{type:h}=o;return"text"!==h&&"number"!==h}return!0},r=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return W(this,"_keyboardManager",new be([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["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:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#W.contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&a.#W.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:s}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:s}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:s}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:s}]]))}constructor(t,s,i,r,n,a,o,h,c,u,d,f,p,g,m,v){const y=this._signal=this.#t.signal;this.#W=t,this.#Z=s,this.#q=i,this.#n=r,this.#l=n,this.#H=a,this.#X=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.#dt(),this.#et(),this.#r=h.annotationStorage,this.#T=h.filterFactory,this.#$=c,this.#R=u||null,this.#v=d,this.#b=f,this.#y=p,this.#V=g||null,this.viewParameters={realScale:Vt.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=!1!==v,n?.setSidebarUiManager(this)}destroy(){this.#j?.resolve(),this.#j=null,this.#t?.abort(),this.#t=null,this._signal=null;
vendor: 8,073 bytes, line 1
1for(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.#n?.destroy(),this.#l?.destroy(),this.#H?.destroy(),this.#x?.hide(),this.#x=null,this.#U?.destroy(),this.#U=null,this.#i=null,this.#S&&(clearTimeout(this.#S),this.#S=null),this.#N&&(clearTimeout(this.#N),this.#N=null),this._editorUndoBar?.destroy(),this.#X=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#V}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return W(this,"hcmFilter",this.#$?this.#T.addHCMFilter(this.#$.foreground,this.#$.background):"none")}get direction(){return W(this,"direction",getComputedStyle(this.#W).direction)}get _highlightColors(){return W(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 W(this,"highlightColors",null);const s=new Map,i=!!this.#$;for(const[r,n]of t){const a=r.endsWith("_HCM");i&&a?s.set(r.replace("_HCM",""),n):!i&&!a&&s.set(r,n)}return W(this,"highlightColors",s)}get highlightColorNames(){return W(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.#u=t}setMainHighlightColorPicker(t){this.#U=t}editAltText(t,s=!1){this.#n?.editAltText(this,t,s)}hasCommentManager(){return!!this.#l}editComment(t,s,i,r){this.#l?.showDialog(this,t,s,i,r)}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)}removeComment(t){this.#l?.removeComments([t.uid])}toggleComment(t,s,i=void 0){this.#l?.toggleCommentPopup(t,s,i)}makeCommentColor(t,s){return t&&this.#l?.makeCommentColor(t,s)||null}getCommentDialogElement(){return this.#l?.dialogElement||null}waitForEditorsRendered(t){var s=this;return N(function*(){if(s.#a.has(t-1))return;const{resolve:i,promise:r}=Promise.withResolvers(),n=a=>{a.pageNumber===t&&(s._eventBus._off("editorsrendered",n),i())};s._eventBus.on("editorsrendered",n),yield r})()}getSignature(t){this.#H?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#H}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.#W.focus()}findParent(t,s){for(const i of this.#a.values()){const{x:r,y:n,width:a,height:o}=i.div.getBoundingClientRect();if(t>=r&&t<=r+a&&s>=n&&s<=n+o)return i}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*Vt.PDF_TO_CSS_UNITS;for(const s of this.#p)s.onScaleChanging();this.#u?.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 i of this.#a.values())if(i.hasTextLayer(t))return i;return null}highlightSelection(t="",s=!1){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:n,focusNode:a,focusOffset:o}=i,h=i.toString(),u=this.#J(i).closest(".textLayer"),d=this.getSelectionBoxes(u);if(!d)return;i.empty();const f=this.#tt(u),p=this.#C===Y.NONE,g=()=>{const m=f?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:r,anchorOffset:n,focusNode:a,focusOffset:o,text:h});p&&this.showAllEditors("highlight",!0,!0),s&&m?.editComment()};p?this.switchToMode(Y.HIGHLIGHT,g):g()}commentSelection(t=""){this.highlightSelection(t,!0)}#rt(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=this.#J(t).closest(".textLayer"),r=this.getSelectionBoxes(i);r&&(this.#x||=new wr(this),this.#x.show(i,r,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#r)return null;const s=`${he}${t}`,i=this.#r.getRawValue(s);return i&&this.#r.remove(s),i}addToAnnotationStorage(t){!t.isEmpty()&&this.#r&&!this.#r.has(t.id)&&this.#r.setValue(t.id,t)}a11yAlert(t,s=null){const i=this.#q;i&&(i.setAttribute("data-l10n-id",t),s?i.setAttribute("data-l10n-args",JSON.stringify(s)):i.removeAttribute("data-l10n-args"))}#nt(){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 r=this.#J(t).closest(".textLayer");if(r){if(this.#x?.hide(),this.#L=s,this.#O({hasSelectedText:!0}),(this.#C===Y.HIGHLIGHT||this.#C===Y.NONE)&&(this.#C===Y.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#A=this.isShiftKeyDown,!this.isShiftKeyDown)){const n=this.#C===Y.HIGHLIGHT?this.#tt(r):null;if(n?.toggleDrawing(),this.#I){const a=new AbortController,o=this.combinedSignal(a),h=c=>{"pointerup"===c.type&&0!==c.button||(a.abort(),n?.toggleDrawing(!0),"pointerup"===c.type&&this.#_("main_toolbar"))};window.addEventListener("pointerup",h,{signal:o}),window.addEventListener("blur",h,{signal:o})}else n?.toggleDrawing(!0),this.#_("main_toolbar")}}else this.#L&&(this.#x?.hide(),this.#L=null,this.#O({hasSelectedText:!1}))}#_(t=""){this.#C===Y.HIGHLIGHT?this.highlightSelection(t):this.#v&&this.#rt()}#at(){document.addEventListener("selectionchange",this.#nt.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.#_("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.#d)return;this.#d=new AbortController;const t=this.combinedSignal(this.#d);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})}#ut(){this.#d?.abort(),this.#d=null}#dt(){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 i of this.#c)if(i.isHandlingMimeForPasting(s))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const s of t.dataTransfer.items)for(const i of this.#c)if(i.isHandlingMimeForPasting(s.type))return i.paste(s,this.currentLayer),void t.preventDefault()}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const s=[];
1for(const i of this.#E){const r=i.serialize(!0);r&&s.push(r)}0!==s.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(s))}cut(t){this.copy(t),this.delete()}paste(t){var s=this;return N(function*(){t.preventDefault();const{clipboardData:i}=t;for(const a of i.items)for(const o of s.#c)if(o.isHandlingMimeForPasting(a.type))return void o.paste(a,s.currentLayer);let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(a){return void V(`paste: "${a.message}".`)}if(!Array.isArray(r))return;s.unselectAll();const n=s.currentLayer;try{const a=[];for(const c of r){const u=yield n.deserialize(c);if(!u)return;a.push(u)}const o=()=>{for(const c of a)s.#st(c);s.#it(a)};s.addCommands({cmd:o,undo:()=>{for(const c of a)c.remove()},mustExec:!0})}catch(a){V(`paste: "${a.message}".`)}})()}keydown(t){!this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!0),this.#C!==Y.NONE&&!this.isEditorHandlingKeyboard&&l._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#A&&(this.#A=!1,this.#_("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(([i,r])=>this.#K[i]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,t)}),this.#C===Y.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#z([[_.HIGHLIGHT_FREE,!0]]))}#z(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ot(),this.#ct(),this.#O({isEditing:this.#C!==Y.NONE,isEmpty:this.#Q(),hasSomethingToUndo:this.#h.hasSomethingToUndo(),hasSomethingToRedo:this.#h.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#lt(),this.#ut(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const s of this.#c)this.#z(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 N(function*(i,r=null,n=!1,a=!1,o=!1){if(s.#C!==i&&(!s.#j||(yield s.#j.promise,s.#j))){if(s.#j=Promise.withResolvers(),s.#u?.commitOrRemove(),s.#C===Y.POPUP&&s.#l?.hideSidebar(),s.#l?.destroyPopup(),s.#C=i,i===Y.NONE){s.setEditingState(!1),s.#pt();for(const h of s.#s.values())h.hideStandaloneCommentButton();return s._editorUndoBar?.hide(),s.toggleComment(null),void s.#j.resolve()}for(const h of s.#s.values())h.addStandaloneCommentButton();i===Y.SIGNATURE&&(yield s.#H?.loadSignatures()),s.setEditingState(!0),yield s.#ft(),s.unselectAll();for(const h of s.#a.values())h.updateMode(i);if(i===Y.POPUP){s.#i||=(yield s.#X.getAnnotationsByType(new Set(s.#c.map(u=>u._editorType))));const h=new Set,c=[];for(const u of s.#s.values()){const{annotationElementId:d,hasComment:f,deleted:p}=u;d&&h.add(d),f&&!p&&c.push(u.getData())}for(const u of s.#i){const{id:d,popupRef:f,contentsObj:p}=u;f&&p?.str&&!h.has(d)&&!s.#m.has(d)&&c.push(u)}s.#l?.showSidebar(c)}if(!r)return n&&s.addNewEditorFromKeyboard(),void s.#j.resolve();for(const h of s.#s.values())h.uid===r?(s.setSelected(h),o?h.editComment():a?h.enterInEditMode():h.focus()):h.unselect();s.#j.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 _.CREATE:return void this.currentLayer.addNewEditor(s);case _.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#Y||=new Map).set(t,s),this.showAllEditors("highlight",s)}if(this.hasSelection)for(const i of this.#E)i.updateParams(t,s);else for(const i of this.#c)i.updateDefaultParams(t,s)}}showAllEditors(t,s,i=!1){for(const n of this.#s.values())n.editorType===t&&n.show(s);(this.#Y?.get(_.HIGHLIGHT_SHOW_ALL)??!0)!==s&&this.#z([[_.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 N(function*(){if(!t.#P){t.#P=!0;const s=[];for(const i of t.#a.values())s.push(i.enable());yield Promise.all(s);for(const i of t.#s.values())i.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.#r?.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.#z(t.propertiesToUpdate))}get#gt(){let t=null;for(t of this.#E);return t}updateUI(t){this.#gt===t&&this.#z(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#z(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.#z(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.uid}),this.#u?.commitOrRemove();for(const s of this.#E)s!==t&&s.unselect();this.#E.clear(),this.#E.add(t),t.select(),this.#z(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],r=()=>{for(const n of s)this.#st(n)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(r,1===s.length?s[0].editorType:s.length);for(const n of s)n.remove()},undo:r,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#it(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.#it(this.#s.values())}unselectAll(){if((!this.#e||(this.#e.commitOrRemove(),this.#C===Y.NONE))&&!this.#u?.commitOrRemove()&&this.hasSelection){for(const t of this.#E)t.unselect();this.#E.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(t,s,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#G[0]+=t,this.#G[1]+=s;const[r,n]=this.#G,a=[...this.#E];this.#N&&clearTimeout(this.#N),this.#N=setTimeout(()=>{this.#N=null,this.#G[0]=this.#G[1]=0,this.addCommands({cmd:()=>{for(const h of a)this.#s.has(h.id)&&(h.translateInPage(r,n),h.translationDone())},undo:()=>{for(const h of a)this.#s.has(h.id)&&(h.translateInPage(-r,-n),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:r,y:n,pageIndex:a},o]of t)o.newX=r,o.newY=n,o.newPageIndex=a,s||=r!==o.savedX||n!==o.savedY||a!==o.savedPageIndex;if(!s)return!1;const i=(r,n,a,o)=>{if(this.#s.has(r.id)){const h=this.#a.get(o);h?r._setParentAndPosition(h,n,a):(r.pageIndex=o,r.x=n,r.y=a)}};return this.addCommands({cmd:()=>{for(const[r,{newX:n,newY:a,newPageIndex:o}]of t)i(r,n,a,o)},undo:()=>{for(const[r,{savedX:n,savedY:a,savedPageIndex:o}]of t)i(r,n,a,o)},mustExec:!0}),!0}dragSelectedEditors(t,s){if(this.#g)for(const i of this.#g.keys())i.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!==Y.NONE}get imageManager(){return W(this,"imageManager",new fs)}getSelectionBoxes(t){if(!t)return null;const s=document.getSelection();for(let c=0,u=s.rangeCount;c<u;c++)if(!t.contains(s.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:r,width:n,height:a}=t.getBoundingClientRect();let o;switch(t.getAttribute("data-main-rotation")){case"90":o=(c,u,d,f)=>({x:(u-r)/a,y:1-(c+d-i)/n,width:f/a,height:d/n});break;case"180":o=(c,u,d,f)=>({x:1-(c+d-i)/n,y:1-(u+f-r)/a,width:d/n,height:f/a});break;case"270":o=(c,u,d,f)=>({x:1-(u+f-r)/a,y:(c-i)/n,width:f/a,height:d/n});break;default:o=(c,u,d,f)=>({x:(c-i)/n,y:(u-r)/a,width:d/n,height:f/a})}const h=[];for(let c=0,u=s.rangeCount;c<u;c++){const d=s.getRangeAt(c);if(!d.collapsed)for(const{x:f,y:p,width:g,height:m}of d.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 i=this.#r.getRawValue(s);i&&(this.#C===Y.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}setMissingCanvas(t,s,i){const r=this.#k?.get(t);r&&(r.setCanvas(s,i),this.#k.delete(t))}
1addMissingCanvas(t,s){(this.#k||=new Map).set(t,s)}}return l})(),hi=(()=>{class l{#t=null;#e=!1;#i=null;#s=null;#a=null;#n=null;#r=!1;#o=null;#h=null;#l=null;#d=null;#u=!1;static#f=null;static _l10n=null;constructor(t){this.#h=t,this.#u=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 N(function*(){const s=t.#i=document.createElement("button");s.className="altText",s.tabIndex="0";const i=t.#s=document.createElement("span");s.append(i),t.#u?(s.classList.add("new"),s.setAttribute("data-l10n-id",l.#f.missing),i.setAttribute("data-l10n-id",l.#f["missing-label"])):(s.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=t.#h._uiManager._signal;s.addEventListener("contextmenu",It,{signal:r}),s.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:r});const n=a=>{a.preventDefault(),t.#h._uiManager.editAltText(t.#h),t.#u&&t.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:t.#m}})};return s.addEventListener("click",n,{capture:!0,signal:r}),s.addEventListener("keydown",a=>{a.target===s&&"Enter"===a.key&&(t.#r=!0,n(a))},{signal:r}),yield t.#g(),s})()}get#m(){return(this.#t?"added":null===this.#t&&this.guessedText&&"review")||"missing"}finish(){this.#i&&(this.#i.focus({focusVisible:this.#r}),this.#r=!1)}isEmpty(){return this.#u?null===this.#t:!this.#t&&!this.#e}hasData(){return this.#u?null!==this.#t||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}setGuessedText(t){var s=this;return N(function*(){null===s.#t&&(s.#l=t,s.#d=yield l._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),s.#g())})()}toggleAltTextBadge(t=!1){if(!this.#u||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.#d),{altText:s,decorative:this.#e,guessedText:this.#l,textWithDisclaimer:this.#d}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:s,guessedText:i,textWithDisclaimer:r,cancel:n=!1}){i&&(this.#l=i,this.#d=r),(this.#t!==t||this.#e!==s)&&(n||(this.#t=t,this.#e=s),this.#g())}toggle(t=!1){this.#i&&(!t&&this.#n&&(clearTimeout(this.#n),this.#n=null),this.#i.disabled=!t)}shown(){this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#m}})}destroy(){this.#i?.remove(),this.#i=null,this.#s=null,this.#a=null,this.#o?.remove(),this.#o=null}#g(){var t=this;return N(function*(){const s=t.#i;if(!s)return;if(t.#u){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 i=t.#a;if(!i){t.#a=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${t.#h.id}`;const n=100,a=t.#h._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(t.#n),t.#n=null},{once:!0}),s.addEventListener("mouseenter",()=>{t.#n=setTimeout(()=>{t.#n=null,t.#a.classList.add("show"),t.#h._reportTelemetry({action:"alt_text_tooltip"})},n)},{signal:a}),s.addEventListener("mouseleave",()=>{t.#n&&(clearTimeout(t.#n),t.#n=null),t.#a?.classList.remove("show")},{signal:a})}t.#e?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=t.#t),i.parentNode||s.append(i),t.#h.getElementForAltText()?.setAttribute("aria-describedby",i.id)})()}}return l})();class He{#t=null;#e=null;#i=!1;#s=null;#a=null;#n=null;#r=null;#o=null;#h=!1;#l=null;constructor(e){this.#s=e}renderForToolbar(){const e=this.#e=document.createElement("button");
vendor: 5,542 bytes, line 1
1return e.className="comment",this.#d(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 i=this.#s.commentButtonColor;i&&(s.backgroundColor=i)}return this.#d(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:i,y:r,width:n,height:a}=this.#s.parent.boundingClientRect;return[(e-i)/n,(t+s-r)/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)}#d(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",r=>{this.#s._focusEventsAllowed=!1,at(r)},{capture:!0,signal:s}),e.addEventListener("focusout",r=>{this.#s._focusEventsAllowed=!0,at(r)},{capture:!0,signal:s})),e.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:s});const i=r=>{r.preventDefault(),e===this.#e?this.edit():this.#s.toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:s}),e.addEventListener("keydown",r=>{r.target===e&&"Enter"===r.key&&(this.#i=!0,i(r))},{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,i;if(t)[s,i]=t;else{[s,i]=this.#s.commentButtonPosition;const{width:c,height:u,x:d,y:f}=this.#s;s=d+s*c,i=f+i*u}const r=this.#s.parent.boundingClientRect,{x:n,y:a,width:o,height:h}=r;this.#s._uiManager.editComment(this.#s,n+s*o,a+i*h,{...e,parentDimensions:r})}finish(){this.#e&&(this.#e.focus({focusVisible:this.#i}),this.#i=!1)}isDeleted(){return this.#h||""===this.#r}isEmpty(){return null===this.#r}hasBeenEdited(){return this.isDeleted()||this.#r!==this.#a}serialize(){return this.data}get data(){return{text:this.#r,richText:this.#n,date:this.#o,deleted:this.isDeleted()}}set data(e){if(e!==this.#r&&(this.#n=null),null===e)return this.#r="",void(this.#h=!0);this.#r=e,this.#o=new Date,this.#h=!1}setInitialText(e,t=null){this.#a=e,this.data=e,this.#o=null,this.#n=t}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#t?.remove(),this.#t=null,this.#r="",this.#n=null,this.#o=null,this.#s=null,this.#i=!1,this.#h=!1}}class Ae{#t;#e=!1;#i=null;#s;#a;#n;#r;#o=null;#h;#l=null;#d;#u=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:s=null,onPinchStart:i=null,onPinching:r=null,onPinchEnd:n=null,signal:a}){this.#t=e,this.#i=s,this.#s=t,this.#a=i,this.#n=r,this.#r=n,this.#d=new AbortController,this.#h=AbortSignal.any([a,this.#d.signal]),e.addEventListener("touchstart",this.#f.bind(this),{passive:!1,signal:this.#h})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/kt.pixelRatio}#f(e){if(this.#s?.())return;if(1===e.touches.length){if(this.#o)return;const i=this.#o=new AbortController,r=AbortSignal.any([this.#h,i.signal]),n=this.#t,a={capture:!0,signal:r,passive:!1},o=h=>{"touch"===h.pointerType&&(this.#o?.abort(),this.#o=null)};return n.addEventListener("pointerdown",h=>{"touch"===h.pointerType&&(at(h),o(h))},a),n.addEventListener("pointerup",o,a),void n.addEventListener("pointercancel",o,a)}if(!this.#u){this.#u=new AbortController;const i=AbortSignal.any([this.#h,this.#u.signal]),r=this.#t,n={signal:i,capture:!1,passive:!1};r.addEventListener("touchmove",this.#m.bind(this),n);const a=this.#g.bind(this);r.addEventListener("touchend",a,n),r.addEventListener("touchcancel",a,n),n.capture=!0,r.addEventListener("pointerdown",at,n),r.addEventListener("pointermove",at,n),r.addEventListener("pointercancel",at,n),r.addEventListener("pointerup",at,n),this.#a?.()}if(at(e),2!==e.touches.length||this.#i?.())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;at(e);let[t,s]=e.touches;t.identifier>s.identifier&&([t,s]=[s,t]);const{screenX:i,screenY:r}=t,{screenX:n,screenY:a}=s,o=this.#l,{touch0X:h,touch0Y:c,touch1X:u,touch1Y:d}=o,f=u-h,p=d-c,v=Math.hypot(n-i,a-r)||1,y=Math.hypot(f,p)||1;if(!this.#e&&Math.abs(y-v)<=Ae.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=i,o.touch0Y=r,o.touch1X=n,o.touch1Y=a,!this.#e)return void(this.#e=!0);const b=[(i+n)/2,(r+a)/2];this.#n?.(b,y,v)}#g(e){e.touches.length>
vendor: 9,406 bytes, line 1
1=2||(this.#u&&(this.#u.abort(),this.#u=null,this.#r?.()),this.#l&&(at(e),this.#l=null,this.#e=!1))}destroy(){this.#d?.abort(),this.#d=null,this.#o?.abort(),this.#o=null}}class ${#t=null;#e=null;#i=null;#s=null;#a=null;#n=!1;#r=null;#o="";#h=null;#l=null;#d=null;#u=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=$._zIndex++;static _borderLineWidth=-1;static _colorManager=new ps;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=$.prototype._resizeWithKeyboard,t=ee.TRANSLATE_SMALL,s=ee.TRANSLATE_BIG;return W(this,"_resizerKeyboardManager",new be([[["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"],$.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:i,pageX:r,pageY:n}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,i],this.pageTranslation=[r,n];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 W(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new xr({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if($._l10n??=e,$._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!==$._borderLineWidth)return;const s=getComputedStyle(document.documentElement);$._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){st("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.#u?.remove(),this.#u=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,i){const[r,n]=this.parentDimensions;[s,i]=this.screenToPageTranslation(s,i),this.x=(e+s)/r,this.y=(t+i)/n,this.fixAndSetPosition()}_moveAfterPaste(e,t){const[s,i]=this.parentDimensions;this.setAt(e*s,t*i,this.width*s,this.height*i),this._onTranslated()}#D([e,t],s,i){[s,i]=this.screenToPageTranslation(s,i),this.x+=s/e,this.y+=i/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:[i,r]}=this;if(this.x+=e/i,this.y+=t/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,d)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:n,y:a}=this;const[o,h]=this.getBaseTranslation();n+=o,a+=h;const{style:c}=s;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*a).toFixed(2)}%`,this._onTranslating(n,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}=$,i=s/e,r=s/t;switch(this.rotation){case 90:return[-i,r];case 180:return[i,r];case 270:return[i,-r];default:return[-i,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[s,i]}=this;let{x:r,y:n,width:a,height:o}=this;if(a*=s,o*=i,r*=s,n*=i,this._mustFixPosition)switch(e){case 0:r=Et(r,0,s-a),n=Et(n,0,i-o);break;case 90:r=Et(r,0,s-o),n=Et(n,a,i);break;case 180:r=Et(r,a,s),n=Et(n,o,i);break;case 270:r=Et(r,o,s),n=Et(n,0,i-a)}this.x=r/=s,this.y=n/=i;const[h,c]=this.getBaseTranslation();r+=h,n+=c,t.left=`${(100*r).toFixed(2)}%`,t.top=`${(100*n).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 $.#P(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return $.#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 i=document.createElement("div");this.#h.append(i),i.classList.add("resizer",s),i.setAttribute("data-resizer-name",s),i.addEventListener("pointerdown",this.#M.bind(this,s),{signal:t}),i.addEventListener("contextmenu",It,{signal:t}),i.tabIndex=-1}this.div.prepend(this.#h)}#M(e,t){t.preventDefault();const{isMac:s}=ft.platform;if(0!==t.button||t.ctrlKey&&s)return;this.#i?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];const r=new AbortController,n=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#k.bind(this,e),{passive:!0,capture:!0,signal:n}),window.addEventListener("touchmove",at,{passive:!1,signal:n}),window.addEventListener("contextmenu",It,{signal:n}),this.#d={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=()=>{r.abort(),this.parent.togglePointerEvents(!0),this.#i?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#U()};window.addEventListener("pointerup",h,{signal:n}),window.addEventListener("blur",h,{signal:n})}#F(e,t,s,i){this.width=s,this.height=i,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#U(){if(!this.#d)return;
1const{savedX:e,savedY:t,savedWidth:s,savedHeight:i}=this.#d;this.#d=null;const r=this.x,n=this.y,a=this.width,o=this.height;r===e&&n===t&&a===s&&o===i||this.addCommands({cmd:this.#F.bind(this,r,n,a,o),undo:this.#F.bind(this,e,t,s,i),mustExec:!0})}static _round(e){return Math.round(1e4*e)/1e4}#k(e,t){const[s,i]=this.parentDimensions,r=this.x,n=this.y,a=this.width,o=this.height,h=$.MIN_SIZE/s,c=$.MIN_SIZE/i,u=this.#I(this.rotation),d=(D,I)=>[u[0]*D+u[2]*I,u[1]*D+u[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=d(...E);const w=$._round(r+A[0]),S=$._round(n+A[1]);let C,R,x=1,T=1;if(t.fromKeyboard)({deltaX:C,deltaY:R}=t);else{const{screenX:D,screenY:I}=t,[H,z]=this.#l;[C,R]=this.screenToPageTranslation(D-H,I-z),this.#l[0]=D,this.#l[1]=I}if([C,R]=[f[0]*(D=C/s)+f[2]*(I=R/i),f[1]*D+f[3]*I],v){const D=Math.hypot(a,o);x=T=Math.max(Math.min(Math.hypot(E[0]-b[0]-C,E[1]-b[1]-R)/D,1/a,1/o),h/a,c/o)}else y?x=Et(Math.abs(E[0]-b[0]-C),h,1)/a:T=Et(Math.abs(E[1]-b[1]-R),c,1)/o;var D,I;const M=$._round(a*x),O=$._round(o*T);A=d(...m(M,O));const F=w-A[0],j=S-A[1];this.#c||=[this.x,this.y,this.width,this.height],this.width=M,this.height=O,this.x=F,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#i?.finish()}get toolbarButtons(){return null}addEditToolbar(){var e=this;return N(function*(){if(e._editToolbar||e.#v)return e._editToolbar;e._editToolbar=new ye(e),e.div.append(e._editToolbar.render());const{toolbarButtons:t}=e;if(t)for(const[s,i]of t)yield e._editToolbar.addButton(s,i);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.#i?.destroy()}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#i||(hi.initialize($._l10n),this.#i=new hi(this),this.#t&&(this.#i.data=this.#t,this.#t=null)),this.#i}get altTextData(){return this.#i?.data}set altTextData(e){this.#i&&(this.#i.data=e)}get guessedAltText(){return this.#i?.guessedText}setGuessedAltText(e){var t=this;return N(function*(){yield t.#i?.setGuessedText(e)})()}serializeAltText(e){return this.#i?.serialize(e)}hasAltText(){return!!this.#i&&!this.#i.isEmpty()}hasAltTextData(){return this.#i?.hasData()??!1}focusCommentButton(){this.#s?.focusButton()}addCommentButton(){return this.canAddComment?this.#s||=new He(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:i}}=this.#s;return{text:t,richText:e,date:s,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#s||=new He(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 He(this),this.#s.setInitialText(e,s),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}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 N(function*(){t.#s||=new He(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[,,,i]=e.rect,[r]=this.pageDimensions,[n]=this.pageTranslation,a=n+r+1;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,i-100,a+180,i]}}}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.#n?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#$();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[i,r]=this.getInitialTranslation();return this.translate(i,r),li(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#R||=new Ae({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#V.bind(this),onPinching:this.#C.bind(this),onPinchEnd:this.#E.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#V(){this.#d={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#i?.toggle(!1),this.parent.togglePointerEvents(!1)}#C(e,t,s){let r=s/t*.7+1-.7;if(1===r)return;const n=this.#I(this.rotation),a=(w,S)=>[n[0]*w+n[2]*S,n[1]*w+n[3]*S],[o,h]=this.parentDimensions,c=this.x,u=this.y,d=this.width,f=this.height,p=$.MIN_SIZE/o,g=$.MIN_SIZE/h;r=Math.max(Math.min(r,1/d,1/f),p/d,g/f);const m=$._round(d*r),v=$._round(f*r);if(m===d&&v===f)return;this.#c||=[c,u,d,f];const y=a(d/2,f/2),b=$._round(c+y[0]),E=$._round(u+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.#i?.toggle(!0),this.parent.togglePointerEvents(!0),this.#U()}pointerdown(e){const{isMac:t}=ft.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#g=!0,this._isDraggable?this.#H(e):this.#L(e))}#L(e){const{isMac:t}=ft.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#H(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let s=!1;const i=new AbortController,r=this._uiManager.combinedSignal(i),n={capture:!0,passive:!1,signal:r},a=h=>{i.abort(),this.#r=null,this.#g=!1,this._uiManager.endDragSession()||this.#L(h),s&&this._onStopDragging()};t&&(this.#T=e.clientX,this.#S=e.clientY,this.#r=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:u,pointerId:d}=h;if(d!==this.#r)return void at(h);const[f,p]=this.screenToPageTranslation(c-this.#T,u-this.#S);this.#T=c,this.#S=u,this._uiManager.dragSelectedEditors(f,p)},n),window.addEventListener("touchmove",at,n),window.addEventListener("pointerdown",h=>{h.pointerType===this.#o&&(this.#R||h.isPrimary)&&a(h),at(h)},n));const o=h=>{this.#r&&this.#r!==h.pointerId?at(h):a(h)};window.addEventListener("pointerup",o,{signal:r}),window.addEventListener("blur",o,{signal:r})}_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 i=this.parentScale,[r,n]=this.pageDimensions,[a,o]=this.pageTranslation,h=e/i,c=t/i,u=this.x*r,d=this.y*n,f=this.width*r,p=this.height*n;switch(s){case 0:return[u+h+a,n-d-c-p+o,u+h+f+a,n-d-c+o];case 90:return[u+c+a,n-d+h+o,u+c+p+a,n-d+h+f+o];case 180:return[u-h-f+a,n-d+c+o,u-h+a,n-d+c+p+o];case 270:return[u-c-p+a,n-d-h-f+o,u-c+a,n-d-h+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[s,i,r,n]=e,a=r-s,o=n-i;switch(this.rotation){case 0:return[s,t-n,a,o];case 90:return[s,t-i,o,a];case 180:return[r,t-i,a,o];case 270:return[r,t-n,o,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&$._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#s?.onUpdatedColor()}getData(){const{comment:{text:e,color:t,date:s,opacity:i,deleted:r,richText:n},uid:a,pageIndex:o,creationDate:h,modificationDate:c}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:n,contentsObj:{str:e}
vendor: 7,066 bytes, line 1
1,creationDate:h,modificationDate:s||c,popupRef:!r,color:t,opacity:i}}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:i}=this.getClientDimensions(),{innerHeight:r,innerWidth:n}=window;return t<n&&i>0&&e<r&&s>0}#$(){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.#$()}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 i=this;return N(function*(){const r=new i.prototype.constructor({parent:t,id:t.getNextId(),uiManager:s,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#t=e.accessibilityData,r._isCopy=e.isCopy||!1;const[n,a]=r.pageDimensions,[o,h,c,u]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/n,r.y=h/a,r.width=c/n,r.height=u/a,r})()}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.#u?.remove(),this.#u=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,i,r,n]=this.getPDFRect();return[$._round(s+(r-s)*e),$._round(i+(n-i)*(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.#d={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 n=this.#Y.bind(this),a=this.#X.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",n,{signal:o}),h.addEventListener("blur",a,{signal:o}),h.addEventListener("focus",this.#K.bind(this,c),{signal:o}),h.setAttribute("data-l10n-id",$._l10nResizer[c])}}const s=this.#e[0];let i=0;for(const n of t){if(n===s)break;i++}const r=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(r!==i){if(r<i)for(let a=0;a<i-r;a++)this.#h.append(this.#h.firstElementChild);else if(r>i)for(let a=0;a<r-i;a++)this.#h.firstElementChild.before(this.#h.lastElementChild);let n=0;for(const a of t){const h=this.#e[n++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",$._l10nResizer[h])}}this.#G(0),this.#b=!0,this.#h.firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#Y(e){$._resizerKeyboardManager.exec(this,e)}#X(e){this.#b&&e.relatedTarget?.parentNode!==this.#h&&this.#N()}#K(e){this.#m=this.#b?e:""}#G(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.#G(-1),this.#U()}_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.#i?.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.#i?.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 i=this.#w.get(s);return i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),this.#w.delete(s),0===this.#w.size&&(this.#w=null)},$._telemetryTimeout),void this.#w.set(s,i)}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.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}updateFakeAnnotationElement(e){if(this.#u||this.deleted)return this.deleted?(this.#u.remove(),void(this.#u=null)):void((this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#u.updateEdited({rect:this.getPDFRect(),popup:this.comment}));this.#u=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 xr extends ${constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const ci=3285377520,Mt=4294901760,Bt=65535;class ui{constructor(e){this.h1=e?4294967295&e:ci,this.h2=e?4294967295&e:ci}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 i=s>>2,r=s-4*i,n=new Uint32Array(t.buffer,0,i);let a=0,o=0,h=this.h1,c=this.h2;const u=3432918353,d=461845907,f=u&Bt,p=d&Bt;for(let g=0;g<i;g++)1&g?(a=n[g],a=a*u&Mt|a*f&Bt,a=a<<15|a>>>17,a=a*d&Mt|a*p&Bt,h^=a,h=h<<13|h>>>19,h=5*h+3864292196):(o=n[g],o=o*u&Mt|o*f&Bt,o=o<<15|o>>>17,o=o*d&Mt|o*p&Bt,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(a=0,r){case 3:a^=t[4*i+2]<<16;case 2:a^=t[4*i+1]<<8;case 1:a^=t[4*i],a=a*u&Mt|a*f&Bt,a=a<<15|a>>>17,a=a*d&Mt|a*p&Bt,1&i?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&Mt|36045*e&Bt,t=4283543511*t&Mt|(2950163797*(t<<16|e>>>16)&Mt)>>>16,e^=t>>>1,e=444984403*e&Mt|60499*e&Bt,t=3301882366*t&Mt|(3120437893*(t<<16|e>>>16)&Mt)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const gs=Object.freeze({map:null,hash:"",transfer:void 0});class ms{#t=!1;#e=null;#i=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 $&&this.#i.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 $)return;this.onAnnotationEditor(null)}}setValue(e,t){const s=this.#s.get(e);let i=!1;if(void 0!==s)for(const[r,n]of Object.entries(t))s[r]!==n&&(i=!0,s[r]=n);else i=!0,this.#s.set(e,t);i&&this.#a(),t instanceof $&&((this.#i||=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 di(this)}get serializable(){if(0===this.#s.size)return gs;const e=new Map,t=new ui,s=[],i=Object.create(null);let r=!1;for(const[n,a]of this.#s){const o=a instanceof $?a.serialize(!1,i):a;o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),r||=!!o.bitmap)}if(r)for(const n of e.values())n.bitmap&&s.push(n.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:s}:gs}get editorStats(){let e=null;const t=new Map;let s=0,i=0;for(const r of this.#s.values()){if(!(r instanceof $)){r.popup&&(r.popup.deleted?i+=1:s+=1);continue}r.isCommentDeleted?i+=1:r.hasEditedComment&&(s+=1);const n=r.telemetryFinalData;if(!n)continue;const{type:a}=n;t.has(a)||t.set(a,Object.getPrototypeOf(r).constructor),e||=Object.create(null);const o=e[a]||=new Map;for(const[h,c]of Object.entries(n)){if("type"===h)continue;let u=o.get(h);u||(u=new Map,o.set(h,u));const d=u.get(c)??0;u.set(c,d+1)}}if((i>0||s>0)&&(e||=Object.create(null),e.comments={deleted:i,edited:s}),!e)return null;for(const[r,n]of t)e[r]=n.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){this.#e=null}updateEditor(e,t){const s=this.#i?.get(e);return!!s&&(s.updateFromAnnotationLayer(t),!0)}getEditor(e){return this.#i?.get(e)||null}get modifiedIds(){if(this.#e)return this.#e;
1const e=[];if(this.#i)for(const t of this.#i.values())t.serialize()&&e.push(t.annotationElementId);return this.#e={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#s.entries()}}class di extends ms{#t;constructor(e){super();const{map:t,hash:s,transfer:i}=e.serializable,r=structuredClone(t,i?{transfer:i}:null);this.#t={map:r,hash:s,transfer:i}}get print(){st("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return W(this,"modifiedIds",{ids:new Set,hash:""})}}class Tr{#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 N(function*({systemFontInfo:s,disableFontFace:i,_inspectFont:r}){if(s&&!t.#t.has(s.loadedName)){if(Q(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),t.isFontLoadingAPISupported){const{loadedName:n,src:a,style:o}=s,h=new FontFace(n,a,o);t.addNativeFontFace(h);try{yield h.load(),t.#t.add(n),r?.(s)}catch{V(`Cannot load system font: ${s.baseFontName}, installing it could help to improve PDF rendering.`),t.removeNativeFontFace(h)}return}st("Not implemented: loadSystemFont without the Font Loading API.")}}).apply(this,arguments)}bind(e){var t=this;return N(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 i=e.createNativeFontFace();if(i){t.addNativeFontFace(i);try{yield i.loaded}catch(r){throw V(`Failed to load font '${i.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const s=e.createFontFaceRule();if(s){if(t.insertRule(s),t.isSyncFontLoadingSupported)return;yield new Promise(i=>{const r=t._queueLoadingCallback(i);t._prepareFontLoadEvent(e,r)})}})()}get isFontLoadingAPISupported(){return W(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return W(this,"isSyncFontLoadingSupported",xt||ft.platform.isFirefox)}_queueLoadingCallback(e){const{loadingRequests:s}=this,i={done:!1,complete:function t(){for(Q(!i.done,"completeRequest() cannot be called twice."),i.done=!0;s.length>0&&s[0].done;){const r=s.shift();setTimeout(r.callback,0)}},callback:e};return s.push(i),i}get _loadTestFont(){return W(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 i(E,A,w,S){return E.substring(0,A)+S+E.substring(A+w)}let r,n;const a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let h=0;const u=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=i(d,976,u.length,u);const g=1482184792;let m=s(d,16);for(r=0,n=u.length-3;r<n;r+=4)m=m-g+s(u,r)|0;r<u.length&&(m=m-g+s(u+"XXX",r)|0),d=i(d,16,4,function ur(l){return String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,255&l)}(m));const v=`url(data:font/opentype;base64,${btoa(d)});`;this.insertRule(`@font-face {font-family:"${u}";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,u]){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 V("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))}(u,()=>{b.remove(),t.complete()})}}class Cr{#t;constructor(e,t=null,s,i){this.compiledGlyphs=Object.create(null),this.#t=e,this._inspectFont=t,s&&Object.assign(this,s),i&&(this.charProcOperatorList=i)}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,${_s(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 i;try{i=e.get(s)}catch(n){V(`getPathGenerator - ignoring character: "${n}".`)}const r=oi(i);return this.fontExtraProperties||e.delete(s),this.compiledGlyphs[t]=r}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace??!1}set disableFontFace(e){W(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){W(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 fi=(()=>{class l{#t;#e;#i;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const s=new TextEncoder,i={};let r=0;for(const c of l.strings){const u=s.encode(t[c]);i[c]=u,r+=4+u.length}const n=new ArrayBuffer(r),a=new Uint8Array(n),o=new DataView(n);let h=0;for(const c of l.strings){const u=i[c],d=u.length;o.setUint32(h,d),a.set(u,h+4),h+=4+d}return Q(h===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}#s(t){Q(t<l.strings.length,"Invalid string index");let s=0;for(let r=0;r<t;r++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}get fontFamily(){return this.#s(0)}get fontWeight(){return this.#s(1)}get italicAngle(){return this.#s(2)}}return l})(),pi=(()=>{class l{#t;#e;#i;static strings=["css","loadedName","baseFontName","src"];static write(t){const s=new TextEncoder,i={};let r=0;for(const f of l.strings){const p=s.encode(t[f]);i[f]=p,r+=4+p.length}r+=4;let n,a,o=1+r;t.style&&(n=s.encode(t.style.style),a=s.encode(t.style.weight),o+=4+n.length+4+a.length);
vendor: 4,151 bytes, line 1
1const h=new ArrayBuffer(o),c=new Uint8Array(h),u=new DataView(h);let d=0;u.setUint8(d++,t.guessFallback?1:0),u.setUint32(d,0),d+=4,r=0;for(const f of l.strings){const p=i[f],g=p.length;r+=4+g,u.setUint32(d,g),c.set(p,d+4),d+=4+g}return u.setUint32(d-r-4,r),t.style&&(u.setUint32(d,n.length),c.set(n,d+4),d+=4+n.length,u.setUint32(d,a.length),c.set(a,d+4),d+=4+a.length),Q(d<=h.byteLength,"SubstitionInfo.write: Buffer overflow"),h.transferToFixedLength(d)}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#i=new TextDecoder}get guessFallback(){return 0!==this.#e.getUint8(0)}#s(t){Q(t<l.strings.length,"Invalid string index");let s=5;for(let r=0;r<t;r++)s+=this.#e.getUint32(s)+4;const i=this.#e.getUint32(s);return this.#i.decode(new Uint8Array(this.#t,s+4,i))}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),i=this.#i.decode(new Uint8Array(this.#t,t+4,s));t+=4+s;const r=this.#e.getUint32(t);return{style:i,weight:this.#i.decode(new Uint8Array(this.#t,t+4,r))}}}return l})(),Rr=(()=>{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#i=this.#e+1+8;static#s=this.#i+1+48;static#a=this.#s+1+6;#n;#r;#o;constructor({data:t,extra:s}){this.#n=t,this.#r=new TextDecoder,this.#o=new DataView(this.#n),s&&Object.assign(this,s)}#h(t){Q(t<l.bools.length,"Invalid boolean index");const s=Math.floor(t/4),i=2*t%8,r=this.#o.getUint8(s)>>i&3;return 0===r?void 0:2===r}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 Q(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 i=[];for(let r=0;r<4;r++)i.push(this.#o.getInt16(t,!0)),t+=2;return i}get fontMatrix(){let t=l.#i;if(0===this.#o.getUint8(t))return;t+=1;const i=[];for(let r=0;r<6;r++)i.push(this.#o.getFloat64(t,!0)),t+=8;return i}get defaultVMetrics(){let t=l.#s;if(0===this.#o.getUint8(t))return;t+=1;const i=[];for(let r=0;r<3;r++)i.push(this.#o.getInt16(t,!0)),t+=2;return i}#d(t){Q(t<l.strings.length,"Invalid string index");let s=l.#a+4;for(let n=0;n<t;n++)s+=this.#o.getUint32(s)+4;const i=this.#o.getUint32(s),r=new Uint8Array(i);return r.set(new Uint8Array(this.#n,s+4,i)),this.#r.decode(r)}get fallbackName(){return this.#d(0)}get loadedName(){return this.#d(1)}get mimetype(){return this.#d(2)}get name(){return this.#d(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 n=this.#o.getUint32(t);if(0!==n)return new Uint8Array(this.#n,t+4,n)}clearData(){let t=l.#a;t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t),t+=4+this.#o.getUint32(t);const n=this.#o.getUint32(t);new Uint8Array(this.#n,t+4,n).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 r=this.#o.getUint32(t);if(0===r)return null;const n=new Uint8Array(r);return n.set(new Uint8Array(this.#n,t+4,r)),new fi(n.buffer)}get systemFontInfo(){let t=l.#a;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.#n,t+4,i)),new pi(r.buffer)}static write(t){const s=t.systemFontInfo?pi.write(t.systemFontInfo):null,i=t.cssFontInfo?fi.write(t.cssFontInfo):null,r=new TextEncoder,n={};let a=0;for(const m of l.strings)n[m]=r.encode(t[m]),a+=4+n[m].length;
1const o=l.#a+4+a+4+(s?s.byteLength:0)+4+(i?i.byteLength:0)+4+(t.data?t.data.length:0),h=new ArrayBuffer(o),c=new Uint8Array(h),u=new DataView(h);let d=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)&&(u.setUint8(d++,p),p=0,g=0)}Q(d===l.#t,"FontInfo.write: Boolean properties offset mismatch");for(const m of l.numbers)u.setFloat64(d,t[m]),d+=8;if(Q(d===l.#e,"FontInfo.write: Number properties offset mismatch"),t.bbox){u.setUint8(d++,4);for(const m of t.bbox)u.setInt16(d,m,!0),d+=2}else u.setUint8(d++,0),d+=8;if(Q(d===l.#i,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){u.setUint8(d++,6);for(const m of t.fontMatrix)u.setFloat64(d,m,!0),d+=8}else u.setUint8(d++,0),d+=48;if(Q(d===l.#s,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){u.setUint8(d++,1);for(const m of t.defaultVMetrics)u.setInt16(d,m,!0),d+=2}else u.setUint8(d++,0),d+=6;Q(d===l.#a,"FontInfo.write: DefaultVMetrics properties offset mismatch"),u.setUint32(l.#a,0),d+=4;for(const m of l.strings){const v=n[m],y=v.length;u.setUint32(d,y),c.set(v,d+4),d+=4+y}if(u.setUint32(l.#a,d-l.#a-4),s){const m=s.byteLength;u.setUint32(d,m),Q(d+4+m<=h.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(s),d+4),d+=4+m}else u.setUint32(d,0),d+=4;if(i){const m=i.byteLength;u.setUint32(d,m),Q(d+4+m<=h.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(i),d+4),d+=4+m}else u.setUint32(d,0),d+=4;return void 0===t.data?(u.setUint32(d,0),d+=4):(u.setUint32(d,t.data.length),c.set(t.data,d+4),d+=4+t.data.length),Q(d<=h.byteLength,"FontInfo.write: Buffer overflow"),h.transferToFixedLength(d)}}return l})();class pt{static#t=0;static#e=1;static#i=2;static#s=3;static#a=4;static#n=8;static#r=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,i=[],r=[],n=[],a=[],o=null,h=null;switch(e[0]){case"RadialAxial":t="axial"===e[1]?1:2,s=e[2],n=e[3],1===t?i.push(...e[4],...e[5]):i.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],i=e[2],r=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(i.length/2),u=Math.floor(r.length/3),d=n.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*u+8*d+(s?16:0)+(h?3:0)+p),v=new DataView(m),y=new Uint8Array(m);v.setUint8(pt.#t,t),v.setUint8(pt.#e,s?1:0),v.setUint8(pt.#i,h?1:0),v.setUint8(pt.#s,o),v.setUint32(pt.#a,c,!0),v.setUint32(pt.#n,u,!0),v.setUint32(pt.#r,d,!0),v.setUint32(pt.#o,f,!0);let b=20;new Float32Array(m,b,2*c).set(i),b+=8*c,y.set(r,b),b+=3*u;for(const[A,w]of n)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[pt.#t],s=!!this.data[pt.#e],i=!!this.data[pt.#i],r=e.getUint32(pt.#a,!0),n=e.getUint32(pt.#n,!0),a=e.getUint32(pt.#r,!0),o=e.getUint32(pt.#o,!0);let h=20;const c=new Float32Array(this.buffer,h,2*r);h+=8*r;const u=new Uint8Array(this.buffer,h,3*n);h+=3*n;const d=[];for(let m=0;m<a;++m){const v=e.getFloat32(h,!0);h+=4;const y=e.getUint32(h,!0);h+=4,d.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;i&&(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,d,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(2===t)return["RadialAxial","radial",f,d,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(3===t){const m=this.data[pt.#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],x=c[w+1];y=y>S?S:y,E=E>x?x:E,b=b<S?S:b,A=A<x?x:A}v=[y,E,b,A]}return["Mesh",m,c,u,g,v,f,p]}throw new Error(`Unsupported pattern kind: ${t}`)}}function je(l){if("string"!=typeof l)return null;if(l.endsWith("/"))return l;throw new Error(`Invalid factory url: "${l}" must include trailing slash.`)}const vs=l=>"object"==typeof l&&Number.isInteger(l?.num)&&l.num>=0&&Number.isInteger(l?.gen)&&l.gen>=0,gi=function mr(l,e,t){if(!Array.isArray(t)||t.length<2)return!1;const[s,i,...r]=t;if(!l(s)&&!Number.isInteger(s)||!e(i))return!1;const n=r.length;let a=!0;switch(i.name){case"XYZ":if(n<2||n>3)return!1;break;case"Fit":case"FitB":return 0===n;case"FitH":case"FitBH":case"FitV":case"FitBV":if(n>1)return!1;break;case"FitR":if(4!==n)return!1;a=!1;break;default:return!1}for(const o of r)if(!("number"==typeof o||a&&null===o))return!1;return!0}.bind(null,vs,l=>"object"==typeof l&&"string"==typeof l?.name);class Or{#t=new Map;#e=Promise.resolve();postMessage(e,t){const s={data:structuredClone(e,t?{transfer:t}:null)};this.#e.then(()=>{for(const[i]of this.#t)i.call(this,s)})}addEventListener(e,t,s=null){let i=null;if(s?.signal instanceof AbortSignal){const{signal:r}=s;if(r.aborted)return void V("LoopbackPort - cannot use an `aborted` signal.");const n=()=>this.removeEventListener(e,t);i=()=>r.removeEventListener("abort",n),r.addEventListener("abort",n)}this.#t.set(t,i)}removeEventListener(e,t){this.#t.get(t)?.(),this.#t.delete(t)}terminate(){for(const[,e]of this.#t)e?.();this.#t.clear()}}function mi(){}function Ct(l){if(l instanceof jt||l instanceof Le||l instanceof Ws||l instanceof fe||l instanceof as)return l;switch(l instanceof Error||"object"==typeof l&&null!==l||st('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),l.name){case"AbortException":return new jt(l.message);case"InvalidPDFException":return new Le(l.message);case"PasswordException":return new Ws(l.message,l.code);case"ResponseException":return new fe(l.message,l.status,l.missing);case"UnknownErrorException":return new as(l.message,l.details)}return new as(l.message,l.toString())}class we{#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,i=this.callbackCapabilities[s];if(!i)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],1===e.callback)i.resolve(e.data);else{if(2!==e.callback)throw new Error("Unexpected callback case");i.reject(Ct(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,i=e.sourceName,r=this.comObj;return void Promise.try(t,e.data).then(function(n){r.postMessage({sourceName:s,targetName:i,callback:1,callbackId:e.callbackId,data:n})},function(n){r.postMessage({sourceName:s,targetName:i,callback:2,callbackId:e.callbackId,reason:Ct(n)})})}e.streamId?this.#i(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)}
1sendWithPromise(e,t,s){const i=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[i]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},s)}catch(n){r.reject(n)}return r.promise}sendWithStream(e,t,s,i){const r=this.streamId++,n=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[r]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:n,targetName:a,action:e,streamId:r,data:t,desiredSize:h.desiredSize},i),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[r].pullCall=c,o.postMessage({sourceName:n,targetName:a,stream:6,streamId:r,desiredSize:h.desiredSize}),c.promise},cancel:h=>{Q(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[r].cancelCall=c,this.streamControllers[r].isClosed=!0,o.postMessage({sourceName:n,targetName:a,stream:1,streamId:r,reason:Ct(h)}),c.promise}},s)}#i(e){const t=e.streamId,s=this.sourceName,i=e.sourceName,r=this.comObj,n=this,a=this.actionHandler[e.action],o={enqueue(h,c=1,u){if(this.isCancelled)return;const d=this.desiredSize;this.desiredSize-=c,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:s,targetName:i,stream:4,streamId:t,chunk:h},u)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:s,targetName:i,stream:3,streamId:t}),delete n.streamSinks[t])},error(h){Q(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:s,targetName:i,stream:5,streamId:t,reason:Ct(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(){r.postMessage({sourceName:s,targetName:i,stream:8,streamId:t,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:8,streamId:t,reason:Ct(h)})})}#s(e){const t=e.streamId,s=this.sourceName,i=e.sourceName,r=this.comObj,n=this.streamControllers[t],a=this.streamSinks[t];switch(e.stream){case 8:e.success?n.startCall.resolve():n.startCall.reject(Ct(e.reason));break;case 7:e.success?n.pullCall.resolve():n.pullCall.reject(Ct(e.reason));break;case 6:if(!a){r.postMessage({sourceName:s,targetName:i,stream:7,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,Promise.try(a.onPull||mi).then(function(){r.postMessage({sourceName:s,targetName:i,stream:7,streamId:t,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:7,streamId:t,reason:Ct(h)})});break;case 4:if(Q(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(e.chunk);break;case 3:if(Q(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#a(n,t);break;case 5:Q(n,"error should have stream controller"),n.controller.error(Ct(e.reason)),this.#a(n,t);break;case 2:e.success?n.cancelCall.resolve():n.cancelCall.reject(Ct(e.reason)),this.#a(n,t);break;case 1:if(!a)break;const o=Ct(e.reason);Promise.try(a.onCancel||mi,o).then(function(){r.postMessage({sourceName:s,targetName:i,stream:2,streamId:t,success:!0})},function(h){r.postMessage({sourceName:s,targetName:i,stream:2,streamId:t,reason:Ct(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 N(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 vi{#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){st("Abstract method `_createCanvas` called.")}}class Mr extends vi{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 yi{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}fetch(e){var t=this;return N(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 i=t.baseUrl+s+(t.isCompressed?".bcmap":"");return t._fetch(i).then(r=>({cMapData:r,isCompressed:t.isCompressed})).catch(r=>{throw new Error(`Unable to load ${t.isCompressed?"binary ":""}CMap at: ${i}`)})}).apply(this,arguments)}_fetch(e){return N(function*(){st("Abstract method `_fetch` called.")})()}}class bi extends yi{_fetch(e){var t=this;return N(function*(){const s=yield qt(e,t.isCompressed?"arraybuffer":"text");return s instanceof ArrayBuffer?new Uint8Array(s):Jt(s)})()}}K(2489);class Ai{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,s,i,r){return"none"}destroy(e=!1){}}class Lr extends Ai{#t;#e;#i;#s;#a;#n;#r=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.#n||=new Map}get#l(){if(!this.#i){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($t,"svg");s.setAttribute("width",0),s.setAttribute("height",0),this.#i=this.#a.createElementNS($t,"defs"),e.append(s),s.append(this.#i),this.#a.body.append(e)}return this.#i}#d(e){if(1===e.length){const o=e[0],h=new Array(256);for(let u=0;u<256;u++)h[u]=o[u]/255;const c=h.join(",");return[c,c,c]}const[t,s,i]=e,r=new Array(256),n=new Array(256),a=new Array(256);for(let o=0;o<256;o++)r[o]=t[o]/255,n[o]=s[o]/255,a[o]=i[o]/255;return[r.join(","),n.join(","),a.join(",")]}#u(e){if(void 0===this.#t){this.#t="";const t=this.#a.URL;t!==this.#a.baseURI&&(me(t)?V('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=ns(t,""))}return`url(${this.#t}#${e})`}addFilter(e){if(!e)return"none";let t=this.#o.get(e);if(t)return t;const[s,i,r]=this.#d(e),n=1===e.length?s:`${s}${i}${r}`;if(t=this.#o.get(n),t)return this.#o.set(e,t),t;const a=`g_${this.#s}_transfer_map_${this.#r++}`,o=this.#u(a);this.#o.set(e,o),this.#o.set(n,o);
1const h=this.#g(a);return this.#p(s,i,r,h),o}addHCMFilter(e,t){const s=`${e}-${t}`,i="base";let r=this.#h.get(i);if(r?.key===s||(r?(r.filter?.remove(),r.key=s,r.url="none",r.filter=null):(r={key:s,url:"none",filter:null},this.#h.set(i,r)),!e||!t))return r.url;const n=this.#b(e);e=B.makeHexColor(...n);const a=this.#b(t);if(t=B.makeHexColor(...a),this.#l.style.color="","#000000"===e&&"#ffffff"===t||e===t)return r.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`,u=r.filter=this.#g(c);this.#p(h,h,h,u),this.#m(u);const d=(f,p)=>{const g=n[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(d(0,5),d(1,5),d(2,5),u),r.url=this.#u(c),r.url}addAlphaFilter(e){let t=this.#o.get(e);if(t)return t;const[s]=this.#d([e]),i=`alpha_${s}`;if(t=this.#o.get(i),t)return this.#o.set(e,t),t;const r=`g_${this.#s}_alpha_map_${this.#r++}`,n=this.#u(r);this.#o.set(e,n),this.#o.set(i,n);const a=this.#g(r);return this.#v(s,a),n}addLuminosityFilter(e){let s,i,t=this.#o.get(e||"luminosity");if(t)return t;if(e?([s]=this.#d([e]),i=`luminosity_${s}`):i="luminosity",t=this.#o.get(i),t)return this.#o.set(e,t),t;const r=`g_${this.#s}_luminosity_map_${this.#r++}`,n=this.#u(r);this.#o.set(e,n),this.#o.set(i,n);const a=this.#g(r);return this.#f(a),e&&this.#v(s,a),n}addHighlightHCMFilter(e,t,s,i,r){const n=`${t}-${s}-${i}-${r}`;let a=this.#h.get(e);if(a?.key===n||(a?(a.filter?.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,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]),u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[d,f]=[i,r].map(this.#b.bind(this));u<c&&([c,u,d,f]=[u,c,f,d]),this.#l.style.color="";const p=(v,y,b)=>{const E=new Array(256),A=(u-c)/b,w=v/255,S=(y-v)/(255*b);let x=0;for(let T=0;T<=b;T++){const C=Math.round(c+T*A),R=w+T*S;for(let M=x;M<=C;M++)E[M]=R;x=C+1}for(let T=x;T<256;T++)E[T]=E[x-1];return E.join(",")},g=`g_${this.#s}_hcm_${e}_filter`,m=a.filter=this.#g(g);return this.#m(m),this.#p(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),m),a.url=this.#u(g),a.url}destroy(e=!1){e&&this.#n?.size||(this.#i?.parentNode.parentNode.remove(),this.#i=null,this.#e?.clear(),this.#e=null,this.#n?.clear(),this.#n=null,this.#r=0)}#f(e){const t=this.#a.createElementNS($t,"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($t,"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($t,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#l.append(t),t}#c(e,t,s){const i=this.#a.createElementNS($t,t);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),e.append(i)}#p(e,t,s,i){const r=this.#a.createElementNS($t,"feComponentTransfer");i.append(r),this.#c(r,"feFuncR",e),this.#c(r,"feFuncG",t),this.#c(r,"feFuncB",s)}#v(e,t){const s=this.#a.createElementNS($t,"feComponentTransfer");t.append(s),this.#c(s,"feFuncA",e)}#b(e){return this.#l.style.color=e,te(getComputedStyle(this.#l).getPropertyValue("color"))}}class wi{constructor({baseUrl:e=null}){this.baseUrl=e}fetch(e){var t=this;return N(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 i=`${t.baseUrl}${s}`;return t._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})}).apply(this,arguments)}_fetch(e){return N(function*(){st("Abstract method `_fetch` called.")})()}}class Ei extends wi{_fetch(e){return N(function*(){const t=yield qt(e,"arraybuffer");return new Uint8Array(t)})()}}class Si{constructor({baseUrl:e=null}){this.baseUrl=e}fetch(e){var t=this;return N(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 i=`${t.baseUrl}${s}`;return t._fetch(i).catch(r=>{throw new Error(`Unable to load wasm data at: ${i}`)})}).apply(this,arguments)}_fetch(e){return N(function*(){st("Abstract method `_fetch` called.")})()}}class xi extends Si{_fetch(e){return N(function*(){const t=yield qt(e,"arraybuffer");return new Uint8Array(t)})()}}if(xt){let l;try{const e=process.getBuiltinModule("module").createRequire("file:///home/ec2-user/wor
1kspace/ui_test_master/node_modules/pdfjs-dist/legacy/build/pdf.mjs");try{l=e("@napi-rs/canvas")}catch(t){V(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(e){V(`Cannot access the \`require\` function: "${e}".`)}globalThis.DOMMatrix||(l?.DOMMatrix?globalThis.DOMMatrix=l.DOMMatrix:V("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(l?.ImageData?globalThis.ImageData=l.ImageData:V("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(l?.Path2D?globalThis.Path2D=l.Path2D:V("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}function ys(l){return bs.apply(this,arguments)}function bs(){return(bs=N(function*(l){const t=yield process.getBuiltinModule("fs").promises.readFile(l);return new Uint8Array(t)})).apply(this,arguments)}class Fr extends Ai{}class kr extends vi{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire("file:///home/ec2-user/workspace/ui_test_master/node_modules/pdfjs-dist/legacy/build/pdf.mjs")("@napi-rs/canvas").createCanvas(e,t)}}class Nr extends yi{_fetch(e){return N(function*(){return ys(e)})()}}class Br extends wi{_fetch(e){return N(function*(){return ys(e)})()}}class Ur extends Si{_fetch(e){return N(function*(){return ys(e)})()}}K(7588);const se="__forcedDependency",{floor:Ti,ceil:Ci}=Math;function Ge(l,e,t,s,i,r){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],i),l[4*e+3]=Math.max(l[4*e+3],r)}const As=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class Hr{#t;#e;constructor(e,t){this.#t=e,this.#e=t}get length(){return this.#t.length}isEmpty(e){return this.#t[e]===As}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 ze=(l,e)=>{if(!l)return;let t=l.get(e);return t||(t={dependencies:new Set,isRenderingOperation:!1},l.set(e,t)),t};class jr{#t={__proto__:null};#e={__proto__:null,transform:[],moveText:[],sameLineText:[],[se]:[]};#i=new Map;#s=[];#a=[];#n=[[1,0,0,1,0,0]];#r=[-1/0,-1/0,1/0,1/0];#o=new Float64Array([1/0,1/0,-1/0,-1/0]);#h=-1;#l=new Set;#d=new Map;#u=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(As,t.length)):this.#c.fill(As)}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},[se]:{__proto__:this.#e[se]}},this.#r={__proto__:this.#r},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.#r=Object.getPrototypeOf(this.#r);const s=this.#s.pop();return void 0!==s&&(ze(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&&(ze(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&&(ze(this.#p,e)?.dependencies.add(t),this.#c[e]=this.#c[t]),this}pushBaseTransform(e){return this.#n.push(B.multiplyByDOMMatrix(this.#n.at(-1),e.getTransform())),this}popBaseTransform(){return this.#n.length>1&&this.#n.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.#i.set(e,t),this}recordSimpleDataFromNamed(e,t,s){this.#t[e]=this.#i.get(t)??s}recordFutureForcedDependency(e,t){return this.recordIncrementalData(se,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(se,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,i,r,n){const a=B.multiplyByDOMMatrix(this.#n.at(-1),t.getTransform()),o=[1/0,1/0,-1/0,-1/0];B.axialAlignedBoundingBox([s,r,i,n],a,o);const h=B.intersect(this.#r,o);return h?(this.#r[0]=h[0],this.#r[1]=h[1],this.#r[2]=h[2],this.#r[3]=h[3]):(this.#r[0]=this.#r[1]=1/0,this.#r[2]=this.#r[3]=-1/0),this}recordBBox(e,t,s,i,r,n){const a=this.#r;if(a[0]===1/0)return this;const o=B.multiplyByDOMMatrix(this.#n.at(-1),t.getTransform());if(a[0]===-1/0)return B.axialAlignedBoundingBox([s,r,i,n],o,this.#o),this;const h=[1/0,1/0,-1/0,-1/0];return B.axialAlignedBoundingBox([s,r,i,n],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,i=1,r=0,n=0,a){const o=s.bbox;let h,c;if(o&&(h=o[2]!==o[0]&&o[3]!==o[1]&&this.#u.get(s),!1!==h&&(c=[0,0,0,0],B.axialAlignedBoundingBox(o,s.fontMatrix,c),(1!==i||0!==r||0!==n)&&B.scaleMinMax([i,0,0,-i,r,n],c),h)))return this.recordBBox(e,t,c[0],c[2],c[1],c[3]);if(!a)return this.recordFullPageBBox(e);const u=a();return o&&c&&void 0===h&&(h=c[0]<=r-u.actualBoundingBoxLeft&&c[2]>=r+u.actualBoundingBoxRight&&c[1]<=n-u.actualBoundingBoxAscent&&c[3]>=n+u.actualBoundingBoxDescent,this.#u.set(s,h),h)?this.recordBBox(e,t,c[0],c[2],c[1],c[3]):this.recordBBox(e,t,r-u.actualBoundingBoxLeft,r+u.actualBoundingBoxRight,n-u.actualBoundingBoxAscent,n+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#o[0]=Math.max(0,this.#r[0]),this.#o[1]=Math.max(0,this.#r[1]),this.#o[2]=Math.min(this.#f,this.#r[2]),this.#o[3]=Math.min(this.#m,this.#r[3]),this}getSimpleIndex(e){return this.#t[e]}recordDependencies(e,t){const s=this.#l,i=this.#t,r=this.#e;
vendor: 4,131 bytes, line 1
1for(const n of t)n in this.#t?s.add(i[n]):n in r&&r[n].forEach(s.add,s);return this}recordNamedDependency(e,t){return this.#i.has(t)&&this.#l.add(this.#i.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[se]),this.#p){const s=ze(this.#p,e),{dependencies:i}=s;this.#l.forEach(i.add,i),this.#s.forEach(i.add,i),this.#a.forEach(i.add,i),i.delete(e),s.isRenderingOperation=!0}if(this.#h===e){const s=Ti(256*this.#o[0]/this.#f),i=Ti(256*this.#o[1]/this.#m),r=Ci(256*this.#o[2]/this.#f),n=Ci(256*this.#o[3]/this.#m);Ge(this.#g,e,s,i,r,n);for(const a of this.#l)a!==e&&Ge(this.#g,a,s,i,r,n);for(const a of this.#s)a!==e&&Ge(this.#g,a,s,i,r,n);for(const a of this.#a)a!==e&&Ge(this.#g,a,s,i,r,n);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 i of s)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,t=!1){return this.#h===e&&(this.#h=-1,this.#r[0]=Math.max(this.#r[0],this.#o[0]),this.#r[1]=Math.max(this.#r[1],this.#o[1]),this.#r[2]=Math.min(this.#r[2],this.#o[2]),this.#r[3]=Math.min(this.#r[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.#d.get(e);return this.#d.delete(e),t}_pushPendingDependencies(e){for(const t of e)this.#l.add(t)}take(){return this.#u.clear(),new Hr(this.#c,this.#g)}takeDebugMetadata(){return this.#p}}class Ve{#t;#e;#i;#s=0;#a=0;constructor(e,t,s){if(e instanceof Ve&&e.#i===!!s)return e;this.#t=e,this.#e=t,this.#i=!!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.#i||this.#t.resetBBox(this.#e),this}recordClipBox(e,t,s,i,r,n){return this.#i||this.#t.recordClipBox(this.#e,t,s,i,r,n),this}recordBBox(e,t,s,i,r,n){return this.#i||this.#t.recordBBox(this.#e,t,s,i,r,n),this}recordCharacterBBox(e,t,s,i,r,n,a){return this.#i||this.#t.recordCharacterBBox(this.#e,t,s,i,r,n,a),this}recordFullPageBBox(e){return this.#i||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.#i||this.#t.bboxToClipBoxDropOperation(this.#e,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Lt_stroke=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Lt_fill=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Lt_imageXObject=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Lt_rawFillPath=["f
1ilter","fillColor","fillAlpha"],Lt_showText=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Lt_transform=["transform"],Lt_transformAndFill=["transform","fillColor"];function ws(l,e){if(!e)return;const t=e[2]-e[0],s=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,s),l.clip(i)}class Es{isModifyingCurrentTransform(){return!1}getPattern(){st("Abstract method `getPattern` called.")}}class $r extends Es{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)t.addColorStop(s[0],s[1]);return t}getPattern(e,t,s,i){let r;if("Stroke"===i||"Fill"===i){const n=t.current.getClippedPathBoundingBox(i,ot(e))||[0,0,0,0],a=Math.ceil(n[2]-n[0])||1,o=Math.ceil(n[3]-n[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(-n[0],-n[1]),s=B.transform(s,[1,0,0,1,n[0],n[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),ws(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),r=e.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(s);r.setTransform(u)}else ws(e,this._bbox),r=this._createGradient(e);return r}}function Ss(l,e,t,s,i,r,n,a){const o=e.coords,h=e.colors,c=l.data,u=4*l.width;let d;o[t+1]>o[s+1]&&(d=t,t=s,s=d,d=r,r=n,n=d),o[s+1]>o[i+1]&&(d=s,s=i,i=d,d=n,n=a,a=d),o[t+1]>o[s+1]&&(d=t,t=s,s=d,d=r,r=n,n=d);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[i]+e.offsetX)*e.scaleX,y=(o[i+1]+e.offsetY)*e.scaleY;if(p>=y)return;const b=h[r],E=h[r+1],A=h[r+2],w=h[n],S=h[n+1],x=h[n+2],T=h[a],C=h[a+1],R=h[a+2],M=Math.round(p),O=Math.round(y);let F,j,D,I,H,z,et,ut;for(let Z=M;Z<=O;Z++){if(Z<m){const P=Z<p?0:(p-Z)/(p-m);F=f-(f-g)*P,j=b-(b-w)*P,D=E-(E-S)*P,I=A-(A-x)*P}else{let P;P=Z>y?1:m===y?0:(m-Z)/(m-y),F=g-(g-v)*P,j=w-(w-T)*P,D=S-(S-C)*P,I=x-(x-R)*P}let J;J=Z<p?0:Z>y?1:(p-Z)/(p-y),H=f-(f-v)*J,z=b-(b-T)*J,et=E-(E-C)*J,ut=A-(A-R)*J;const it=Math.round(Math.min(F,H)),yt=Math.round(Math.max(F,H));let L=u*Z+4*it;for(let P=it;P<=yt;P++)J=(F-P)/(F-H),J<0?J=0:J>1&&(J=1),c[L++]=j-(j-z)*J|0,c[L++]=D-(D-et)*J|0,c[L++]=I-(I-ut)*J|0,c[L++]=255}}function Gr(l,e,t){const s=e.coords,i=e.colors;let r,n;switch(e.type){case 2:const a=e.verticesPerRow,o=Math.floor(s.length/a)-1,h=a-1;for(r=0;r<o;r++){let c=r*a;for(let u=0;u<h;u++,c++)Ss(l,t,s[c],s[c+1],s[c+a],i[c],i[c+1],i[c+a]),Ss(l,t,s[c+a+1],s[c+1],s[c+a],i[c+a+1],i[c+1],i[c+a])}break;case 1:for(r=0,n=s.length;r<n;r+=3)Ss(l,t,s[r],s[r+1],s[r+2],i[r],i[r+1],i[r+2]);break;default:throw new Error("illegal figure")}}class zr extends Es{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,u=Math.min(Math.ceil(Math.abs(h*e[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(c*e[1]*1.1)),3e3),f=h/u,p=c/d,g={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-o,scaleX:1/f,scaleY:1/p},y=s.getCanvas("mesh",u+4,d+4),b=y.context,E=b.createImageData(u,d);if(t){const w=E.data;for(let S=0,x=w.length;S<x;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)Gr(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,i){ws(e,this._bbox);const r=new Float32Array(2);if("Shading"===i)B.singularValueDecompose2dScale(ot(e),r);
1else if(this.matrix){B.singularValueDecompose2dScale(this.matrix,r);const[a,o]=r;B.singularValueDecompose2dScale(t.baseTransform,r),r[0]*=a,r[1]*=o}else B.singularValueDecompose2dScale(t.baseTransform,r);const n=this._createMeshCanvas(r,"Shading"===i?null:this._background,t.cachedCanvases);return"Shading"!==i&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(n.offsetX,n.offsetY),e.scale(n.scaleX,n.scaleY),e.createPattern(n.canvas,"no-repeat")}}class Vr extends Es{getPattern(){return"hotpink"}}let Xr=(()=>{class l{static MAX_PATTERN_SIZE=3e3;constructor(t,s,i,r){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=i,this.baseTransform=r}createPatternCanvas(t,s){const{bbox:i,operatorList:r,paintType:n,tilingType:a,color:o,canvasGraphicsFactory:h}=this;let{xstep:c,ystep:u}=this;c=Math.abs(c),u=Math.abs(u),Me("TilingType: "+a);const d=i[0],f=i[1],p=i[2],g=i[3],m=p-d,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,x=v,T=!1,C=!1;const R=Math.ceil(c*A),M=Math.ceil(u*w);R>=Math.ceil(m*A)?S=c:T=!0,M>=Math.ceil(v*w)?x=u:C=!0;const j=this.getSizeAndScale(S,this.ctx.canvas.width,A),D=this.getSizeAndScale(x,this.ctx.canvas.height,w),I=t.cachedCanvases.getCanvas("pattern",j.size,D.size),H=I.context,z=h.createCanvasGraphics(H,s);if(z.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(z,n,o),H.translate(-j.scale*d,-D.scale*f),z.transform(0,j.scale,0,0,D.scale,0,0),H.save(),z.dependencyTracker?.save(),this.clipBbox(z,d,f,p,g),z.baseTransform=ot(z.ctx),z.executeOperatorList(r),z.endDrawing(),z.dependencyTracker?.restore(),H.restore(),T||C){const et=I.canvas;T&&(S=c),C&&(x=u);const ut=this.getSizeAndScale(S,this.ctx.canvas.width,A),Z=this.getSizeAndScale(x,this.ctx.canvas.height,w),J=ut.size,it=Z.size,yt=t.cachedCanvases.getCanvas("pattern-workaround",J,it),L=yt.context,P=T?Math.floor(m/c):0,k=C?Math.floor(v/u):0;for(let X=0;X<=P;X++)for(let tt=0;tt<=k;tt++)L.drawImage(et,J*X,it*tt,J,it,0,0,J,it);return{canvas:yt.canvas,scaleX:ut.scale,scaleY:Z.scale,offsetX:d,offsetY:f}}return{canvas:I.canvas,scaleX:j.scale,scaleY:D.scale,offsetX:d,offsetY:f}}getSizeAndScale(t,s,i){const r=Math.max(l.MAX_PATTERN_SIZE,s);let n=Math.ceil(t*i);return n>=r?n=r:i=n/t,{scale:i,size:n}}clipBbox(t,s,i,r,n){t.ctx.rect(s,i,r-s,n-i),B.axialAlignedBoundingBox([s,i,r,n],ot(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,s,i){const r=t.ctx,n=t.current;switch(s){case 1:const{fillStyle:a,strokeStyle:o}=this.ctx;r.fillStyle=n.fillColor=a,r.strokeStyle=n.strokeColor=o;break;case 2:r.fillStyle=r.strokeStyle=i,n.fillColor=n.strokeColor=i;break;default:throw new cr(`Unsupported paint type: ${s}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,s,i,r,n){let a=i;"Shading"!==r&&(a=B.transform(a,s.baseTransform),this.matrix&&(a=B.transform(a,this.matrix)));const o=this.createPatternCanvas(s,n);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 Pi({src:l,srcPos:e=0,dest:t,width:s,height:i,nonBlackColor:r=4294967295,inverseDecode:n=!1}){const a=ft.isLittleEndian?4278190080:255,[o,h]=n?[r,a]:[a,r],c=s>>3,u=7&s,d=l.length;t=new Uint32Array(t.buffer);let f=0;for(let p=0;p<i;p++){for(const m=e+c;e<m;e++){const v=e<d?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===u)continue;const g=e<d?l[e++]:255;for(let m=0;m<u;m++)t[f++]=g&1<<7-m?h:o}return{srcPos:e,destPos:f}}const xs=new DOMMatrix,Dt=new Float32Array(2),ie=new Float32Array([1/0,1/0,-1/0,-1/0]);class Qr{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,s){let i;return void 0!==this.cache[e]?(i=this.cache[e],this.canvasFactory.reset(i,t,s)):(i=this.canvasFactory.create(t,s),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(const e in this.cache)this.canvasFactory.destroy(this.cache[e]),delete this.cache[e]}}function We(l,e,t,s,i,r,n,a,o,h){const[c,u,d,f,p,g]=ot(l);
1if(0===u&&0===d){const b=Math.round(n*c+p),A=Math.round(a*f+g),S=Math.abs(Math.round((n+o)*c+p)-b)||1,T=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,i,r,0,0,S,T),l.setTransform(c,u,d,f,p,g),[S,T]}if(0===c&&0===f){const b=Math.round(a*d+p),A=Math.round(n*u+g),S=Math.abs(Math.round((a+h)*d+p)-b)||1,T=Math.abs(Math.round((n+o)*u+g)-A)||1;return l.setTransform(0,Math.sign(u),Math.sign(d),0,b,A),l.drawImage(e,t,s,i,r,0,0,T,S),l.setTransform(c,u,d,f,p,g),[T,S]}return l.drawImage(e,t,s,i,r,n,a,o,h),[Math.hypot(c,u)*o,Math.hypot(d,f)*h]}class Mi{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=ie.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||st("Stroke bounding box must include transform."),B.singularValueDecompose2dScale(t,Dt);const i=Dt[0]*this.lineWidth/2,r=Dt[1]*this.lineWidth/2;s[0]-=i,s[1]-=r,s[2]+=i,s[3]+=r}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(ie,0)}getClippedPathBoundingBox(e="Fill",t=null){return B.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function Li(l,e){if(e instanceof ImageData)return void l.putImageData(e,0,0);const t=e.height,s=e.width,i=t%16,r=(t-i)/16,n=0===i?r:r+1,a=l.createImageData(s,16);let h,o=0;const c=e.data,u=a.data;let d,f,p,g;if(e.kind===ce.GRAYSCALE_1BPP){const m=c.byteLength,v=new Uint32Array(u.buffer,0,u.byteLength>>2),y=v.length,b=s+7>>3,E=4294967295,A=ft.isLittleEndian?4278190080:255;for(d=0;d<n;d++){for(p=d<r?16:i,h=0,f=0;f<p;f++){const w=m-o;let S=0;const x=w>b?s:8*w-7,T=-8&x;let C=0,R=0;for(;S<T;S+=8)R=c[o++],v[h++]=128&R?E:A,v[h++]=64&R?E:A,v[h++]=32&R?E:A,v[h++]=16&R?E:A,v[h++]=8&R?E:A,v[h++]=4&R?E:A,v[h++]=2&R?E:A,v[h++]=1&R?E:A;for(;S<x;S++)0===C&&(R=c[o++],C=128),v[h++]=R&C?E:A,C>>=1}for(;h<y;)v[h++]=0;l.putImageData(a,0,16*d)}}else if(e.kind===ce.RGBA_32BPP){for(f=0,g=16*s*4,d=0;d<r;d++)u.set(c.subarray(o,o+g)),o+=g,l.putImageData(a,0,f),f+=16;d<n&&(g=s*i*4,u.set(c.subarray(o,o+g)),l.putImageData(a,0,f))}else{if(e.kind!==ce.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);for(p=16,g=s*p,d=0;d<n;d++){for(d>=r&&(p=i,g=s*p),h=0,f=g;f--;)u[h++]=c[o++],u[h++]=c[o++],u[h++]=c[o++],u[h++]=255;l.putImageData(a,0,16*d)}}}function Fi(l,e){if(e.bitmap)return void l.drawImage(e.bitmap,0,0);const t=e.height,s=e.width,i=t%16,r=(t-i)/16,n=0===i?r:r+1,a=l.createImageData(s,16);let o=0;const h=e.data,c=a.data;for(let u=0;u<n;u++){const d=u<r?16:i;({srcPos:o}=Pi({src:h,srcPos:o,dest:c,width:s,height:d,nonBlackColor:0})),l.putImageData(a,0,16*u)}}function Ee(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 Xe(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 ki(l,e){if(e)return!0;B.singularValueDecompose2dScale(l,Dt);const t=Math.fround(kt.pixelRatio*Vt.PDF_TO_CSS_UNITS);return Dt[0]<=t&&Dt[1]<=t}const Jr=["butt","round","square"],Zr=["miter","round","bevel"],qr={},Ni={};class re{constructor(e,t,s,i,r,{optionalContentConfig:n,markedContentStack:a=null}
vendor: 5,606 bytes, line 1
1,o,h,c){this.ctx=e,this.current=new Mi(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=i,this.filterFactory=r,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=n,this.cachedCanvases=new Qr(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:i=null}){const r=this.ctx.canvas.width,n=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,r,n),this.ctx.fillStyle=a,s){const o=this.cachedCanvases.getCanvas("transparent",r,n);this.compositeCtx=this.ctx,this.transparentCanvas=o.canvas,this.ctx=o.context,this.ctx.save(),this.ctx.transform(...ot(this.compositeCtx))}this.ctx.save(),Xe(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=ot(this.ctx)}executeOperatorList(e,t,s,i,r){const n=e.argsArray,a=e.fnArray;let o=t||0;const h=n.length;if(h===o)return o;const c=h-o>10&&"function"==typeof s,u=c?Date.now()+15:0;let d=0;const f=this.commonObjs,p=this.objs;let g,m;for(;;){if(void 0!==i&&o===i.nextBreakPoint)return i.breakIt(o,s),o;if(!r||r(o))if(g=a[o],m=n[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&&++d>10){if(Date.now()>u)return s(),o;d=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,i=e.height??e.displayHeight;let c,u,r=Math.max(Math.hypot(t[0],t[1]),1),n=Math.max(Math.hypot(t[2],t[3]),1),a=s,o=i,h="prescale1";for(;r>2&&a>1||n>2&&o>1;){let d=a,f=o;r>2&&a>1&&(d=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),r/=a/d),n>2&&o>1&&(f=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o)/2,n/=o/f),c=this.cachedCanvases.getCanvas(h,d,f),u=c.context,u.clearRect(0,0,d,f),u.drawImage(e,0,0,a,o,0,0,d,f),e=c.canvas,a=d,o=f,h="prescale1"===h?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:o}}_createMaskCanvas(e,t){const s=this.ctx,{width:i,height:r}=t,n=this.current.fillColor,a=this.current.patternFill,o=ot(s);let h,c,u,d;if((t.bitmap||t.data)&&t.count>1){const C=t.bitmap||t.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),n]),h=this._cachedBitmapsMap.get(C),h||(h=new Map,this._cachedBitmapsMap.set(C,h));const R=h.get(c);if(R&&!a){const M=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,Lt_transformAndFill),{canvas:R,offsetX:M,offsetY:O}}u=R}u||(d=this.cachedCanvases.getCanvas("maskCanvas",i,r),Fi(d.context,t));let f=B.transform(o,[1/i,0,0,-1/r,0,0]);f=B.transform(f,[1,0,0,1,0,-r]);const p=ie.slice();B.axialAlignedBoundingBox([0,0,i,r],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,x=m;w.translate(-S,-x),w.transform(...f),u||(u=this._scaleImage(d.canvas,Nt(w)),u=u.img,h&&a&&h.set(c,u)),w.imageSmoothingEnabled=ki(ot(w),t.interpolate),We(w,u,0,0,u.width,u.height,0,0,i,r),w.globalCompositeOperation="source-in";const T=B.transform(Nt(w),[1,0,0,1,-S,-x]);return w.fillStyle=a?n.getPattern(s,this,T,"Fill",e):n,w.fillRect(0,0,i,r),h&&!a&&(this.cachedCanvases.delete("fillCanvas"),h.set(c,A.canvas)),this.dependencyTracker?.recordDependencies(e,Lt_transformAndFill),{canvas:A.canvas,offsetX:Math.round(S),offsetY:Math.round(x)}}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=Jr[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=Zr[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,s){this.dependencyTracker?.recordSimpleData("dash",e);const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=s)}
1setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(const[s,i]of t)switch(s){case"LW":this.setLineWidth(e,i);break;case"LC":this.setLineCap(e,i);break;case"LJ":this.setLineJoin(e,i);break;case"ML":this.setMiterLimit(e,i);break;case"D":this.setDash(e,i[0],i[1]);break;case"RI":this.setRenderingIntent(e,i);break;case"FL":this.setFlatness(e,i);break;case"Font":this.setFont(e,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=i?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(i)}}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 r=this.cachedCanvases.getCanvas("smaskGroupAt"+this.groupLevel,this.ctx.canvas.width,this.ctx.canvas.height);this.suspendedCtx=this.ctx;const n=this.ctx=r.context;n.setTransform(this.suspendedCtx.getTransform()),Ee(this.suspendedCtx,n),function _r(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()},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,i,r,n,a){e.transform(t,s,i,r,n,a),this.__originalTransform(t,s,i,r,n,a)},l.setTransform=function(t,s,i,r,n,a){e.setTransform(t,s,i,r,n,a),this.__originalSetTransform(t,s,i,r,n,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,i,r,n,a){e.bezierCurveTo(t,s,i,r,n,a),this.__originalBezierCurveTo(t,s,i,r,n,a)},l.rect=function(t,s,i,r){e.rect(t,s,i,r),this.__originalRect(t,s,i,r)},l.closePath=function(){e.closePath(),this.__originalClosePath()},l.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(n,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(),Ee(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(
vendor: 5,391 bytes, line 1
1))}composeSMask(e,t,s,i){const r=i[0],n=i[1],a=i[2]-r,o=i[3]-n;0===a||0===o||(this.genericComposeSMask(t.context,s,a,o,t.subtype,t.backdrop,t.transferMap,r,n,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,i,r,n,a,o,h,c,u){let d=e.canvas,f=o-c,p=h-u;if(n)if(f<0||p<0||f+s>d.width||p+i>d.height){const m=this.cachedCanvases.getCanvas("maskExtension",s,i),v=m.context;v.drawImage(d,-f,-p),v.globalCompositeOperation="destination-atop",v.fillStyle=n,v.fillRect(0,0,s,i),v.globalCompositeOperation="source-over",d=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,i),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=n,e.fillRect(f,p,s,i),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),"Alpha"===r&&a?t.filter=this.filterFactory.addAlphaFilter(a):"Luminosity"===r&&(t.filter=this.filterFactory.addLuminosityFilter(a));const g=new Path2D;g.rect(o,h,s,i),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(d,f,p,s,i,o,h,s,i),t.restore()}save(e){this.inSMaskMode&&Ee(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&&Ee(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null):this.inSMaskMode&&this.endSMaskMode()}transform(e,t,s,i,r,n,a){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,s,i,r,n,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,s,i){let[r]=s;if(!i)return r||=s[0]=new Path2D,void this[t](e,r);if(null!==this.dependencyTracker){const n=t===Qt.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-n,i[2]+n,i[1]-n,i[3]+n).recordDependencies(e,["transform"])}r instanceof Path2D||(r=s[0]=oi(r)),B.axialAlignedBoundingBox(i,ot(this.ctx),this.current.minMax),this[t](e,r),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,s=!0){const i=this.ctx,r=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof r&&r?.getPattern){const n=r.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=r.getPattern(i,this,Nt(i),"Stroke",e),n){const a=new Path2D;a.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=a}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,Lt_stroke),s&&this.consumePath(e,t,this.current.getClippedPathBoundingBox("Stroke",ot(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,s=!0){const i=this.ctx,r=this.current.fillColor;let a=!1;if(this.current.patternFill){const h=r.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=r.getPattern(i,this,Nt(i),"Fill",e),h){const c=new Path2D;c.addPath(t,i.getTransform().invertSelf().multiplySelf(h)),t=c}a=!0}const o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),this.dependencyTracker?.recordDependencies(e,Lt_fill),a&&(i.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,Lt_rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=qr}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=Ni}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:i}=this;void 0!==t&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(void 0!==t){const i=new Path2D,r=s.getTransform().invertSelf();for(const{transform:n,x:a,y:o,fontSize:h,path:c}of t)c&&i.addPath(c,new DOMMatrix(n).preMultiplySelf(r).translate(a,o).scale(h,-h));s.clip(i)}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}
1setFont(e,t,s){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);const i=this.commonObjs.get(t),r=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(r.fontMatrix=i.fontMatrix||es,(0===r.fontMatrix[0]||0===r.fontMatrix[3])&&V("Invalid font matrix for font "+t),s<0?(s=-s,r.fontDirection=-1):r.fontDirection=1,this.current.font=i,this.current.fontSize=s,i.isType3Font)return;const n=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${n}", ${i.fallbackName}`;let o="normal";i.black?o="900":i.bold&&(o="bold");const h=i.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)}#i(e,t,s){const i=new Path2D;return i.addPath(e,new DOMMatrix(s).invertSelf().multiplySelf(t)),i}paintChar(e,t,s,i,r,n){const a=this.ctx,o=this.current,h=o.font,c=o.textRenderingMode,u=o.fontSize/o.fontSizeScale,d=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;if(a.save(),a.translate(s,i),a.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,a,h),0===d||2===d)if(r){v=a.getTransform(),a.setTransform(...r);const y=this.#i(m,v,r);a.fill(y)}else a.fill(m);if(1===d||2===d)if(n){v||=a.getTransform(),a.setTransform(...n);const{a:y,b,c:E,d:A}=v,w=B.inverseTransform(n),S=B.transform([y,b,E,A,0,0],w);B.singularValueDecompose2dScale(S,Dt),a.lineWidth*=Math.max(Dt[0],Dt[1])/u,a.stroke(this.#i(m,v,n))}else a.lineWidth/=u,a.stroke(m);a.restore()}else(0===d||2===d)&&(a.fillText(t,s,i),this.dependencyTracker?.recordCharacterBBox(e,a,h,u,s,i,()=>a.measureText(t))),(1===d||2===d)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,h,u,s,i,()=>a.measureText(t)).recordDependencies(e,Lt_stroke),a.strokeText(t,s,i));f&&((this.pendingTextPaths||=[]).push({transform:ot(a),x:s,y:i,fontSize:u,path:m}),this.dependencyTracker?.recordCharacterBBox(e,a,h,u,s,i))}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 i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){s=!0;break}return W(this,"isFontSubpixelAAEnabled",s)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Lt_showText).resetBBox(e),4&this.current.textRenderingMode&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const s=this.current,i=s.font;if(i.isType3Font)return this.showType3Text(e,t),void this.dependencyTracker?.recordShowTextOperation(e);const r=s.fontSize;if(0===r)return void this.dependencyTracker?.recordOperation(e);const n=this.ctx,a=s.fontSizeScale,o=s.charSpacing,h=s.wordSpacing,c=s.fontDirection,u=s.textHScale*c,d=t.length,f=i.vertical,p=f?1:-1,g=i.defaultVMetrics,m=r*s.fontMatrix[0],v=0===s.textRenderingMode&&!i.disableFontFace&&!s.patternFill;let y,b;if(n.save(),s.textMatrix&&n.transform(...s.textMatrix),n.translate(s.x,s.y+s.textRise),n.scale(u,c>0?-1:1),s.patternFill){n.save();const x=s.fillColor.getPattern(n,this,Nt(n),"Fill",e);
1y=ot(n),n.restore(),n.fillStyle=x}if(s.patternStroke){n.save();const x=s.strokeColor.getPattern(n,this,Nt(n),"Stroke",e);b=ot(n),n.restore(),n.strokeStyle=x}let E=s.lineWidth;const A=s.textMatrixScale;if(0===A||0===E){const x=3&s.textRenderingMode;(1===x||2===x)&&(E=this.getSinglePixelWidth())}else E/=A;if(1!==a&&(n.scale(a,a),E/=a),n.lineWidth=E,i.isInvalidPDFjsFont){const x=[];let T=0;for(const R of t)x.push(R.unicode),T+=R.width;const C=x.join("");if(n.fillText(C,0,0),null!==this.dependencyTracker){const R=n.measureText(C);this.dependencyTracker.recordBBox(e,this.ctx,-R.actualBoundingBoxLeft,R.actualBoundingBoxRight,-R.actualBoundingBoxAscent,R.actualBoundingBoxDescent).recordShowTextOperation(e)}return s.x+=T*m*u,n.restore(),void this.compose()}let S,w=0;for(S=0;S<d;++S){const x=t[S];if("number"==typeof x){w+=p*x*r/1e3;continue}let T=!1;const C=(x.isSpace?h:0)+o,R=x.fontChar,M=x.accent;let O,F,D,j=x.width;if(f){const H=x.vmetric||g,z=-(x.vmetric?H[1]:.5*j)*m;j=H?-H[0]:j,O=z/a,F=(w+H[2]*m)/a}else O=w/a,F=0;if(i.remeasure&&j>0){D=n.measureText(R);const H=1e3*D.width/r*a;if(j<H&&this.isFontSubpixelAAEnabled){const z=j/H;T=!0,n.save(),n.scale(z,1),O/=z}else j!==H&&(O+=(j-H)/2e3*r/a)}this.contentVisible&&(x.isInFont||i.missingFile)&&(v&&!M?(n.fillText(R,O,F),this.dependencyTracker?.recordCharacterBBox(e,n,D?{bbox:null}:i,r/a,O,F,()=>D??n.measureText(R))):(this.paintChar(e,R,O,F,y,b),M&&this.paintChar(e,M.fontChar,O+r*M.offset.x/a,F-r*M.offset.y/a,y,b))),w+=f?j*m-C*c:j*m+C*c,T&&n.restore()}f?s.y-=w:s.x+=w*u,n.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){const s=this.ctx,i=this.current,r=i.font,n=i.fontSize,a=i.fontDirection,o=r.vertical?1:-1,h=i.charSpacing,c=i.wordSpacing,u=i.textHScale*a,d=i.fontMatrix||es,f=t.length;let g,m,v,y;if(3===i.textRenderingMode||0===n)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,s.save(),i.textMatrix&&s.transform(...i.textMatrix),s.translate(i.x,i.y+i.textRise),s.scale(u,a);const b=this.dependencyTracker;for(this.dependencyTracker=b?new Ve(b,e):null,g=0;g<f;++g){if(m=t[g],"number"==typeof m){y=o*m*n/1e3,this.ctx.translate(y,0),i.x+=y*u;continue}const E=(m.isSpace?c:0)+h,A=r.charProcOperatorList[m.operatorListId];A?this.contentVisible&&(this.save(),s.scale(n,n),s.transform(...d),this.executeOperatorList(A),this.restore()):V(`Type3 character "${m.operatorListId}" is not available.`);const w=[m.width,0];B.applyTransform(w,d),v=w[0]*n+E,s.translate(v,0),i.x+=v*u}
1s.restore(),b&&(this.dependencyTracker=b)}setCharWidth(e,t,s){}setCharWidthAndBounds(e,t,s,i,r,n,a){const o=new Path2D;o.rect(i,r,n-i,a-r),this.ctx.clip(o),this.dependencyTracker?.recordBBox(e,this.ctx,i,n,r,a).recordClipBox(e,this.ctx,i,n,r,a),this.endPath(e)}getColorN_Pattern(e,t){let s;if("TilingPattern"===t[0]){const i=this.baseTransform||ot(this.ctx);s=new Xr(t,this.ctx,{createCanvasGraphics:(n,a)=>new re(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Ve(this.dependencyTracker,a,!0):null)},i)}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 i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function Wr(l){switch(l[0]){case"RadialAxial":return new $r(l);case"Mesh":return new zr(l);case"Dummy":return new Vr}throw new Error(`Unknown IR type: ${l[0]}`)}(this.getObject(e,t)),this.cachedPatterns.set(t,i)),s&&(i.matrix=s),i}shadingFill(e,t){if(!this.contentVisible)return;const s=this.ctx;this.save(e);const i=this._getPattern(e,t);s.fillStyle=i.getPattern(s,this,Nt(s),"Shading",e);const r=Nt(s);if(r){const{width:n,height:a}=s.canvas,o=ie.slice();B.axialAlignedBoundingBox([0,0,n,a],r,o);const[h,c,u,d]=o;this.ctx.fillRect(h,c,u-h,d-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Lt_transform).recordDependencies(e,Lt_fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){st("Should not call beginInlineImage")}beginImageData(){st("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=ot(this.ctx),s)){B.axialAlignedBoundingBox(s,this.baseTransform,this.current.minMax);const[i,r,n,a]=s,o=new Path2D;o.rect(i,r,n-i,a-r),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,i,n,r,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||Me("TODO: Support non-isolated groups."),t.knockout&&V("Knockout groups not supported.");const i=ot(s);if(t.matrix&&s.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let r=ie.slice();B.axialAlignedBoundingBox(t.bbox,ot(s),r),r=B.intersect(r,[0,0,s.canvas.width,s.canvas.height])||[0,0,0,0];const a=Math.floor(r[0]),o=Math.floor(r[1]),h=Math.max(Math.ceil(r[2])-a,1),c=Math.max(Math.ceil(r[3])-o,1);this.current.startNewPathAndClipBox([0,0,h,c]);let u="groupAt"+this.groupLevel;t.smask&&(u+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(u,h,c),f=d.context;f.translate(-a,-o),f.transform(...i);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:d.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()),Ee(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,i=this.groupStack.pop();if(this.ctx=i,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 r=ot(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...r);const n=ie.slice();B.axialAlignedBoundingBox([0,0,s.canvas.width,s.canvas.height],r,n),this.ctx.drawImage(s.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,s,i,r,n){if(this.#t(),Xe(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(n&&this.annotationCanvasMap){(i=i.slice())[4]-=s[0],i[5]-=s[1],(s=s.slice())[0]=s[1]=0,s[2]=a,s[3]=o,B.singularValueDecompose2dScale(ot(this.ctx),Dt);const{viewportScale:h}=this,c=Math.ceil(a*this.outputScaleX*h),u=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,u);const{canvas:d,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(t,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(Dt[0],0,0,-Dt[1],0,o*Dt[1]),Xe(this.ctx)}else{Xe(this.ctx),this.endPath(e);const h=new Path2D;h.rect(s[0],s[1],a,o),this.ctx.clip(h)}}this.current=new Mi(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...r)}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 i=this.ctx,r=this._createMaskCanvas(e,t),n=r.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(n,r.offsetX,r.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,r.offsetX,r.offsetX+n.width,r.offsetY,r.offsetY+n.height).recordOperation(e),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,s,i=0,r=0,n,a){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);const o=this.ctx;o.save();const h=ot(o);o.transform(s,i,r,n,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 u=0,d=a.length;u<d;u+=2){const f=B.transform(h,[s,i,r,n,a[u],a[u+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,i=this.current.fillColor,r=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Lt_transformAndFill);for(const n of t){const{data:a,width:o,height:h,transform:c}=n,u=this.cachedCanvases.getCanvas("maskCanvas",o,h),d=u.context;d.save(),Fi(d,this.getObject(e,a,n)),d.globalCompositeOperation="source-in",d.fillStyle=r?i.getPattern(d,this,Nt(s),"Fill",e):i,d.fillRect(0,0,o,h),d.restore(),s.save(),s.transform(...c),s.scale(1,-1),We(s,u.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):V("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,s,i,r){if(!this.contentVisible)return;const n=this.getObject(e,t);if(!n)return void V("Dependent image isn't ready yet");const a=n.width,o=n.height,h=[];for(let c=0,u=r.length;c<u;c+=2)h.push({transform:[s,0,0,i,r[c],r[c+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(e,n,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:i}=e,r=this.cachedCanvases.getCanvas("inlineImage",s,i),n=r.context;return n.filter=this.current.transferMaps,n.drawImage(t,0,0),n.filter="none",r.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;const s=t.width,i=t.height,r=this.ctx;this.save(e);const{filter:n}=r;let a;if("none"!==n&&""!==n&&(r.filter="none"),r.scale(1/s,-1/i),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,i).context;Li(c,t),a=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(a,Nt(r));r.imageSmoothingEnabled=ki(ot(r),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,r,0,s,-i,0).recordDependencies(e,Lt_imageXObject).recordOperation(e),We(r,o.img,0,0,o.paintWidth,o.paintHeight,0,-i,s,i),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,s){if(!this.contentVisible)return;const i=this.ctx;let r;if(t.bitmap)r=t.bitmap;else{const h=this.cachedCanvases.getCanvas("inlineImage",t.width,t.height).context;Li(h,t),r=this.applyTransferMapsToCanvas(h)}this.dependencyTracker?.resetBBox(e);for(const n of s)i.save(),i.transform(...n.transform),i.scale(1,-1),We(i,r,n.x,n.y,n.w,n.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.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,Lt_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 i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(s);const r=this.ctx;this.pendingClip?(i||(this.pendingClip===Ni?r.clip(t,"evenodd"):r.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=ot(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]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(s,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:s,c:i,d:r}=this.ctx.getTransform();let n,a;if(0===s&&0===i){const o=Math.abs(t),h=Math.abs(r);if(o===h)if(0===e)n=a=1/o;else{const c=o*e;n=a=c<1?1/c:1}else if(0===e)n=1/o,a=1/h;else{const c=o*e,u=h*e;n=c<1?1/c:1,a=u<1?1/u:1}}else{const o=Math.abs(t*r-s*i),h=Math.hypot(t,s),c=Math.hypot(i,r);if(0===e)n=c/o,a=h/o;else{const u=e*o;n=c>u?c/u:1,a=h>u?h/u:1}}this._cachedScaleForStroking[0]=n,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,t){const{ctx:s,current:{lineWidth:i}}=this,[r,n]=this.getScaleForStroking();if(r===n)return s.lineWidth=(i||1)*r,void s.stroke(e);const a=s.getLineDash();t&&s.save(),s.scale(r,n),xs.a=1/r,xs.d=1/n;const o=new Path2D;if(o.addPath(e,xs),a.length>0){const h=Math.max(r,n);s.setLineDash(a.map(c=>c/h)),s.lineDashOffset/=h}s.lineWidth=i||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!==re.prototype[l]&&(re.prototype[Qt[l]]=re.prototype[l]);class ne{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 tn{#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 ae=Symbol("INTERNAL");class en{#t=!1;#e=!1;#i=!1;#s=!0;constructor(e,{name:t,intent:s,usage:i,rbGroups:r}){this.#t=!!(2&e),this.#e=!!(4&e),this.name=t,this.intent=s,this.usage=i,this.rbGroups=r}get visible(){if(this.#i)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!==ae&&st("Internal method `_setVisible` called."),this.#i=s,this.#s=t}}class sn{#t=null;#e=new Map;#i=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 en(t,s));if("OFF"===e.baseState)for(const s of this.#e.values())s._setVisible(ae,!1);for(const s of e.on)this.#e.get(s)._setVisible(ae,!0);for(const s of e.off)this.#e.get(s)._setVisible(ae,!1);this.#i=this.getHash()}}#a(e){const t=e.length;if(t<2)return!0;const s=e[0];for(let i=1;i<t;i++){const r=e[i];let n;if(Array.isArray(r))n=this.#a(r);else{if(!this.#e.has(r))return V(`Optional content group not found: ${r}`),!0;n=this.#e.get(r).visible}switch(s){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return"And"===s}isVisible(e){if(0===this.#e.size)return!0;if(!e)return Me("Optional content group not defined."),!0;if("OCG"===e.type)return this.#e.has(e.id)?this.#e.get(e.id).visible:(V(`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 V(`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 V(`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 V(`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 V(`Optional content group not found: ${t}`),!0;if(this.#e.get(t).visible)return!1}return!0}return V(`Unknown optional content policy ${e.policy}.`),!0}return V(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,s=!0){const i=this.#e.get(e);if(i){if(s&&t&&i.rbGroups.length)for(const r of i.rbGroups)for(const n of r)n!==e&&this.#e.get(n)?._setVisible(ae,!1,!0);i._setVisible(ae,!!t,!0),this.#t=null}else V(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let s;for(const i of e){switch(i){case"ON":case"OFF":case"Toggle":s=i;continue}const r=this.#e.get(i);if(r)switch(s){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!r.visible,t)}}this.#t=null}get hasInitialVisibility(){return null===this.#i||this.getHash()===this.#i}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 ui;for(const[t,s]of this.#e)e.update(`${t}:${s.visible}`);return this.#t=e.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class rn{constructor(e,{disableRange:t=!1,disableStream:s=!1}){Q(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:r,progressiveDone:n,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=a,r?.length>0){const o=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(o)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!s,this._isRangeSupported=!t,this._contentLength=i,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):Q(this._rangeReaders.some(function(r){return r._begin===e&&(r._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(){Q(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new nn(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new an(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 nn{constructor(e,t,s=!1,i=null){this._stream=e,this._done=s||!1,this._filename=Ne(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.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 N(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 an{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 N(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 Bi(l,e){const t=new Headers;if(!l||!e||"object"!=typeof e)return t;for(const s in e){const i=e[s];void 0!==i&&t.append(s,i)}return t}function Ye(l){return URL.parse(l)?.origin??null}function Ui({responseHeaders:l,isHttp:e,rangeChunkSize:t,disableRange:s}){const i={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(l.get("Content-Length"),10);return!Number.isInteger(r)||(i.suggestedLength=r,r<=2*t)||s||!e||"bytes"!==l.get("Accept-Ranges")||"identity"!==(l.get("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i}function Hi(l){const e=l.get("Content-Disposition");if(e){let t=function on(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),r(c)}if(t=function n(c){const u=[];let d;const f=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(d=f.exec(c));){let[,g,m,v]=d;if(g=parseInt(g,10),g in u){if(0===g)break}else u[g]=[m,v]}const p=[];for(let g=0;g<u.length&&g in u;++g){let[m,v]=u[g];v=a(v),m&&(v=unescape(v),0===g&&(v=o(v))),p.push(v)}return p.join("")}(l),t)return r(h(t));if(t=s("filename","i").exec(l),t){t=t[1];let c=a(t);return c=h(c),r(c)}function s(c,u){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function i(c,u){if(c){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const d=new TextDecoder(c,{fatal:!0}),f=Jt(u);u=d.decode(f),e=!1}catch{}}return u}function r(c){return e&&/[\x80-\xff]/.test(c)&&(c=i("utf-8",c),e&&(c=i("iso-8859-1",c))),c}function a(c){if(c.startsWith('"')){const u=c.slice(1).split('\\"');for(let d=0;d<u.length;++d){const f=u[d].indexOf('"');-1!==f&&(u[d]=u[d].slice(0,f),u.length=d+1),u[d]=u[d].replaceAll(/\\(.)/g,"$1")}c=u.join('"')}return c}function o(c){const u=c.indexOf("'");return-1===u?c:i(c.slice(0,u),c.slice(u+1).replace(/^[^']*'/,""))}function h(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,d,f,p){if("q"===f||"Q"===f)return i(d,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 i(d,p)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(Ne(t))return t}return null}function Se(l,e){return new fe(`Unexpected server response (${l}) while retrieving PDF "${e}".`,l,404===l||0===l&&e.startsWith("file:"))}function ji(l){return 200===l||206===l}function $i(l,e,t){return{method:"GET",headers:l,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Gi(l){return l instanceof Uint8Array?l.buffer:l instanceof ArrayBuffer?l:(V(`getArrayBuffer - unexpected data format: ${l}`),new Uint8Array(l).buffer)}class ln{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Bi(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Q(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new hn(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new cn(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 hn{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),i=t.url;fetch(i,$i(s,this._withCredentials,this._abortController)).then(r=>{if(e._responseOrigin=Ye(r.url),!ji(r.status))throw Se(r.status,i);this._reader=r.body.getReader(),this._headersCapability.resolve();const n=r.headers,{allowRangeRequests:a,suggestedLength:o}=Ui({responseHeaders:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=Hi(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new jt("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 N(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:Gi(t),done:!1})})()}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class cn{constructor(e,t,s){this._stream=e,this._reader=null,this._loaded=0;const i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const r=new Headers(e.headers);r.append("Range",`bytes=${t}-${s-1}`);const n=i.url;fetch(n,$i(r,this._withCredentials,this._abortController)).then(a=>{const o=Ye(a.url);if(o!==e._responseOrigin)throw new Error(`Expected range response-origin "${o}" to match "${e._responseOrigin}".`);if(!ji(a.status))throw Se(a.status,n);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 N(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:Gi(t),done:!1})})()}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class dn{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:s}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Bi(this.isHttp,t),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,s=this.currXhrId++,i=this.pendingRequests[s]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[r,n]of this.headers)t.setRequestHeader(r,n);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=206):i.expectedStatus=200,t.responseType="arraybuffer",Q(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),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.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 i=s.xhr;if(i.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),4!==i.readyState||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void s.onError(i.status);const r=i.status||200;if((200!==r||206!==s.expectedStatus)&&r!==s.expectedStatus)return void s.onError(i.status);const a=function un(l){const e=l.response;return"string"!=typeof e?e:Jt(e).buffer}(i);if(206===r){const o=i.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);h?s.onDone({begin:parseInt(h[1],10),chunk:a}):(V('Missing or invalid "Content-Range" header.'),s.onError(0))}else a?s.onDone({begin:0,chunk:a}):s.onError(i.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 fn{constructor(e){this._source=e,this._manager=new dn(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 Q(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new pn(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const s=new gn(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 pn{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=Ye(t.responseURL);const s=t.getAllResponseHeaders(),i=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[o,...h]=a.split(": ");return[o,h.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:n}=Ui({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=n||this._contentLength,this._filename=Hi(i),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=Se(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 N(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 gn{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=Ye(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??=Se(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 N(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 mn=/^[a-z][a-z0-9\-+.]+:/i;class yn{constructor(e){this.source=e,this.url=function vn(l){if(mn.test(l))return new URL(l);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(l))}(e.url),Q("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Q(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new bn(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const s=new An(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 bn{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=process.getBuiltinModule("fs");s.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},i=>{"ENOENT"===i.code&&(i=Se(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}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 N(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 jt("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class An{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 r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:t,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}read(){var e=this;return N(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 xe=Symbol("INITIAL_DATA");class zi{#t=Object.create(null);#e(e){return this.#t[e]||={...Promise.withResolvers(),data:xe}}get(e,t=null){if(t){const i=this.#e(e);return i.promise.then(()=>t(i.data)),null}const s=this.#t[e];
vendor: 9,228 bytes, line 1
1if(!s||s.data===xe)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!==xe}delete(e){const t=this.#t[e];return!(!t||t.data===xe||(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!==xe&&(yield[e,t])}}}class St{#t=Promise.withResolvers();#e=null;#i=!1;#s=!!globalThis.FontInspector?.enabled;#a=null;#n=null;#r=0;#o=0;#h=null;#l=null;#d=0;#u=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.#u=s.scale*kt.pixelRatio,this.#d=s.rotation,this.#n={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:r,pageX:n,pageY:a}=s.rawDims;this.#v=[1,0,0,-1,-n,a+r],this.#o=i,this.#r=r,St.#I(),Gt(t,s),this.#t.promise.finally(()=>{St.#w.delete(this),this.#n=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=ft.platform;return W(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(),St.#w.add(this),e(),this.#t.promise}update({viewport:e,onBefore:t=null}){const s=e.scale*kt.pixelRatio,i=e.rotation;if(i!==this.#d&&(t?.(),this.#d=i,Gt(this.#l,{rotation:i})),s!==this.#u){t?.(),this.#u=s;const r={div:null,properties:null,ctx:St.#D(this.#a)};for(const n of this.#c)r.properties=this.#p.get(n),r.div=n,this.#x(r)}}cancel(){const e=new jt("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.#i)return;this.#n.ctx??=St.#D(this.#a);const t=this.#c,s=this.#m;for(const i of e){if(t.length>1e5)return V("Ignoring additional textDivs for performance reasons."),void(this.#i=!0);if(void 0!==i.str)s.push(i.str),this.#A(i);else if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){const r=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),i.id&&this.#e.setAttribute("id",`${i.id}`),r.append(this.#e)}else"endMarkedContent"===i.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 i=B.transform(this.#v,e.transform);let r=Math.atan2(i[1],i[0]);const n=this.#f[e.fontName];n.vertical&&(r+=Math.PI/2);let a=this.#s&&n.fontSubstitution||n.fontFamily;a=St.fontFamilyMap.get(a)||a;const o=Math.hypot(i[2],i[3]),h=o*St.#B(a,n,this.#a);let c,u;0===r?(c=i[4],u=i[5]-h):(c=i[4]+h*Math.sin(r),u=i[5]-h*Math.cos(r));const d="calc(var(--total-scale-factor) *",f=t.style;this.#e===this.#l?(f.left=`${(100*c/this.#o).toFixed(2)}%`,f.top=`${(100*u/this.#r).toFixed(2)}%`):(f.left=`${d}${c.toFixed(2)}px)`,f.top=`${d}${u.toFixed(2)}px)`),f.fontSize=`${d}${(St.#S*o).toFixed(2)}px)`,f.fontFamily=a,s.fontSize=o,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#s&&(t.dataset.fontName=n.fontSubstitutionLoadedName||e.fontName),0!==r&&(s.angle=r*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const g=Math.abs(e.transform[0]),m=Math.abs(e.transform[3]);g!==m&&Math.max(g,m)/Math.min(g,m)>1.5&&(p=!0)}if(p&&(s.canvasWidth=n.vertical?e.height:e.width),this.#p.set(t,s),this.#n.div=t,this.#n.properties=s,this.#x(this.#n),s.hasText&&this.#e.append(t),s.hasEOL){const g=document.createElement("br");g.setAttribute("role","presentation"),this.#e.append(g)}}#x(e){const{div:t,properties:s,ctx:i}=e,{style:r}=t;let n="";if(St.#S>1&&(n=`scale(${1/St.#S})`),0!==s.canvasWidth&&s.hasText){const{fontFamily:a}=r,{canvasWidth:o,fontSize:h}=s;St.#P(i,h*this.#u,a);const{width:c}=i.measureText(t.textContent);c>0&&(n=`scaleX(${o*this.#u/c}) ${n}`)}0!==s.angle&&(n=`rotate(${s.angle}deg) ${n}`),n.length>0&&(r.transform=n)}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 i=this.#T.get(e);t===i.size&&s===i.family||(e.font=`${t}px ${s}`,i.size=t,i.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 i=this.#b.get(e);if(i)return i;const r=this.#D(s);r.canvas.width=r.canvas.height=30,this.#P(r,30,e);const n=r.measureText(""),a=n.fontBoundingBoxAscent,o=Math.abs(n.fontBoundingBoxDescent);r.canvas.width=r.canvas.height=0;let h=.8;return a?h=a/(a+o):(ft.platform.isFirefox&&V("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 Wi(l={}){"string"==typeof l||l instanceof URL?l={url:l}:(l instanceof ArrayBuffer||ArrayBuffer.isView(l))&&(l={data:l});const e=new Rs,{docId:t}=e,s=l.url?function Pr(l){if(l instanceof URL)return l.href;if("string"==typeof l){if(xt)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,i=l.data?function Ir(l){if(xt&&typeof Buffer<"u"&&l instanceof Buffer)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 Jt(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,r=l.httpHeaders||null,n=!0===l.withCredentials,a=l.password??null,o=l.range instanceof Ps?l.range:null,h=Number.isInteger(l.rangeChunkSize)&&l.rangeChunkSize>0?l.rangeChunkSize:65536;let c=l.worker instanceof gt?l.worker:null;const u=l.verbosity,d="string"!=typeof l.docBaseUrl||me(l.docBaseUrl)?null:l.docBaseUrl,f=je(l.cMapUrl),p=!1!==l.cMapPacked,g=l.CMapReaderFactory||(xt?Nr:bi),m=je(l.iccUrl),v=je(l.standardFontDataUrl),y=l.StandardFontDataFactory||(xt?Br:Ei),b=je(l.wasmUrl),E=l.WasmFactory||(xt?Ur:xi),A=!0!==l.stopAtErrors,w=Number.isInteger(l.maxImageSize)&&l.maxImageSize>-1?l.maxImageSize:-1,S=!1!==l.isEvalSupported,x="boolean"==typeof l.isOffscreenCanvasSupported?l.isOffscreenCanvasSupported:!xt,T="boolean"==typeof l.isImageDecoderSupported?l.isImageDecoderSupported:!xt&&(ft.platform.isFirefox||!globalThis.chrome),C=Number.isInteger(l.canvasMaxAreaInBytes)?l.canvasMaxAreaInBytes:-1,R="boolean"==typeof l.disableFontFace?l.disableFontFace:xt,M=!0===l.fontExtraProperties,O=!0===l.enableXfa,F=l.ownerDocument||globalThis.document,j=!0===l.disableRange,D=!0===l.disableStream,I=!0===l.disableAutoFetch,H=!0===l.pdfBug,z=l.CanvasFactory||(xt?kr:Mr),et=l.FilterFactory||(xt?Fr:Lr),ut=!0===l.enableHWA,Z=!1!==l.useWasm,J=o?o.length:l.length??NaN,it="boolean"==typeof l.useSystemFonts?l.useSystemFonts:!xt&&!R,yt="boolean"==typeof l.useWorkerFetch?l.useWorkerFetch:!!(g===bi&&y===Ei&&E===xi&&f&&v&&b&&ve(f,document.baseURI)&&ve(v,document.baseURI)&&ve(b,document.baseURI));!function or(l){Number.isInteger(l)&&(Oe=l)}(u);const P={canvasFactory:new z({ownerDocument:F,enableHWA:ut}),filterFactory:new et({docId:t,ownerDocument:F}),cMapReaderFactory:yt?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:yt?null:new y({baseUrl:v}),wasmFactory:yt?null:new E({baseUrl:b})};c||(c=gt.create({verbosity:u,port:ne.workerPort}),e._worker=c);const k={docId:t,apiVersion:"5.4.449",data:i,password:a,disableAutoFetch:I,rangeChunkSize:h,length:J,docBaseUrl:d,enableXfa:O,evaluatorOptions:{maxImageSize:w,disableFontFace:R,ignoreErrors:A,isEvalSupported:S,isOffscreenCanvasSupported:x,isImageDecoderSupported:T,canvasMaxAreaInBytes:C,fontExtraProperties:M,useSystemFonts:it,useWasm:Z,useWorkerFetch:yt,cMapUrl:f,iccUrl:m,standardFontDataUrl:v,wasmUrl:b}},X={ownerDocument:F,pdfBug:H,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 tt=c.messageHandler.sendWithPromise("GetDocRequest",k,i?[i.buffer]:null);let G;if(o)G=new rn(o,{disableRange:j,disableStream:D});else if(!i){if(!s)throw new Error("getDocument - no `url` parameter provided.");const rt=ve(s)?ln:xt?yn:fn;G=new rt({url:s,length:J,httpHeaders:r,withCredentials:n,rangeChunkSize:h,disableRange:j,disableStream:D})}return tt.then(rt=>{if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const nt=new we(t,rt,c.port),Ft=new Tn(nt,e,G,X,P,ut);e._transport=Ft,nt.send("Ready",null)})}).catch(e._capability.reject),e}class Rs{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId="d"+Rs.#t++;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}destroy(){var e=this;return N(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 N(function*(){return e._transport.getData()})()}}class Ps{#t=Promise.withResolvers();#e=[];#i=[];#s=[];#a=[];constructor(e,t,s=!1,i=null){this.length=e,this.initialData=t,this.progressiveDone=s,this.contentDispositionFilename=i}addRangeListener(e){this.#a.push(e)}addProgressListener(e){this.#s.push(e)}addProgressiveReadListener(e){this.#i.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.#i)t(e)})}onDataProgressiveDone(){this.#t.promise.then(()=>{for(const e of this.#e)e()})}transportReady(){this.#t.resolve()}requestDataRange(e,t){st("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Sn{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 W(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 xn{#t=!1;constructor(e,t,s,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=s,this._stats=i?new Zs:null,this._pdfBug=i,this.commonObjs=s.commonObjs,this.objs=new zi,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:i=0,dontFlip:r=!1}={}){return new ge({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:s,offsetY:i,dontFlip:r})}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 W(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){var e=this;return N(function*(){return e._transport._htmlForXfa?.children[e._pageIndex]||null})()}render({canvasContext:e,canvas:t=e.canvas,viewport:s,intent:i="display",annotationMode:r=Ht.ENABLE,transform:n=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:d=!1,recordOperations:f=!1,operationsFilter:p=null}){this._stats?.time("Overall");const g=this._transport.getRenderingIntent(i,r,u,d),{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=T=>{if(y.renderTasks.delete(S),A){const C=S.gfx?.dependencyTracker.take();C&&(S.stepper&&S.stepper.setOperatorBBoxes(C,S.gfx.dependencyTracker.takeDebugMetadata()),f&&(this.recordedBBoxes=C))}b&&(this.#t=!0),this.#e(),T?(S.capability.reject(T),this._abortOperatorList({intentState:y,reason:T instanceof Error?T:new Error(T)})):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 oe({callback:w,params:{canvas:t,canvasContext:e,dependencyTracker:A?new jr(t,y.operatorList.length,E):null,viewport:s,transform:n,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 x=S.task;return Promise.all([y.displayReadyCapability.promise,o]).then(([T,C])=>{if(this.destroyed)w();else{if(this._stats?.time("Rendering"),!(C.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");S.initializeGraphics({transparency:T,optionalContentConfig:C}),S.operatorListChanged()}}).catch(w),x}getOperatorList({intent:e="display",annotationMode:t=Ht.ENABLE,printAnnotationStorage:s=null,isEditing:i=!1}={}){const n=this._transport.getRenderingIntent(e,t,s,i,!0);let o,a=this._intentStates.get(n.cacheKey);return a||(a=Object.create(null),this._intentStates.set(n.cacheKey,a)),a.opListReadCapability||(o=Object.create(null),o.operatorListChanged=function r(){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(n)),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:i=>i.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>pe.textContent(s));const t=this.streamTextContent(e);return new Promise(function(s,i){const n=t.getReader(),a={items:[],styles:Object.create(null),lang:null};!function r(){n.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),r())},i)}()})}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,i=e.length;s<i;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:i}){const{map:r,transfer:n}=s,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:r,modifiedIds:i},n).getReader(),h=this._intentStates.get(t);h.streamReader=o;const c=()=>{o.read().then(({value:u,done:d})=>{d?h.streamReader=null:this._transport.destroyed||(this._renderPageChunk(u,h),c())},u=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const d of h.renderTasks)d.operatorListChanged();this.#e()}if(h.displayReadyCapability)h.displayReadyCapability.reject(u);else{if(!h.opListReadCapability)throw u;h.opListReadCapability.reject(u)}}})};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 ke){let i=100;return t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i))}}if(e.streamReader.cancel(new jt(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[i,r]of this._intentStates)if(r===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}class gt{#t=Promise.withResolvers();#e=null;#i=null;#s=null;static#a=0;static#n=!1;static#r=(js=()=>{xt&&(this.#n=!0,ne.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{const s=URL.parse(e);if(!s?.origin||"null"===s.origin)return!1;const i=new URL(t,s);return s.origin===i.origin},this._createCDNWrapper=e=>URL.createObjectURL(new Blob([`await import("${e}");`],{type:"text/javascript"})),this.fromPort=e=>{if(function yr(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=lr()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=s,t){if(gt.#r.has(t))throw new Error("Cannot use more than one PDFWorker per port.");gt.#r.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.#i}get messageHandler(){return this.#e}#h(e){this.#i=e,this.#e=new we("main","worker",e),this.#e.on("ready",()=>{}),this.#o()}#l(){if(gt.#n||gt.#u)return void this.#d();let{workerSrc:e}=gt;
1try{gt._isSameOrigin(window.location,e)||(e=gt._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),s=new we("main","worker",t),i=()=>{r.abort(),s.destroy(),t.terminate(),this.destroyed?this.#t.reject(new Error("Worker was destroyed")):this.#d()},r=new AbortController;t.addEventListener("error",()=>{this.#s||i()},{signal:r.signal}),s.on("test",a=>{r.abort(),!this.destroyed&&a?(this.#e=s,this.#i=t,this.#s=t,this.#o()):i()}),s.on("ready",a=>{if(r.abort(),this.destroyed)i();else try{n()}catch{this.#d()}});const n=()=>{const a=new Uint8Array;s.send("test",a,[a.buffer])};return void n()}catch{Me("The worker has been disabled.")}this.#d()}#d(){gt.#n||(V("Setting up fake worker."),gt.#n=!0),gt._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this.#t.reject(new Error("Worker was destroyed"));const t=new Or;this.#i=t;const s="fake"+gt.#a++,i=new we(s+"_worker",s,t);e.setup(i,t),this.#e=new we(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,gt.#r.delete(this.#i),this.#i=null,this.#e?.destroy(),this.#e=null}static create(e){const t=this.#r.get(e?.port);if(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 gt(e)}static get workerSrc(){if(ne.workerSrc)return ne.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#u(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){var e=this;return W(this,"_setupFakeWorkerGlobal",function(){var s=N(function*(){return e.#u?e.#u:(yield import(e.workerSrc)).WorkerMessageHandler});return function i(){return s.apply(this,arguments)}}()())}}js();class Tn{#t=new Map;#e=new Map;#i=new Map;#s=new Map;#a=null;constructor(e,t,s,i,r,n){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new zi,this.fontLoader=new Tr({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.wasmFactory=r.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=n,this.setupMessageHandler()}#n(e,t=null){const s=this.#t.get(e);if(s)return s;const i=this.messageHandler.sendWithPromise(e,t);return this.#t.set(e,i),i}get annotationStorage(){return W(this,"annotationStorage",new ms)}getRenderingIntent(e,t=Ht.ENABLE,s=null,i=!1,r=!1){let n=2,a=gs;switch(e){case"any":n=1;break;case"display":break;case"print":n=4;break;default:V(`getRenderingIntent - invalid intent: ${e}`)}const o=4&n&&s instanceof di?s:this.annotationStorage;switch(t){case Ht.DISABLE:n+=64;break;case Ht.ENABLE:break;case Ht.ENABLE_FORMS:n+=16;break;case Ht.ENABLE_STORAGE:n+=32,a=o.serializable;break;default:V(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(n+=128),r&&(n+=256);const{ids:h,hash:c}=o.modifiedIds;return{renderingIntent:n,cacheKey:[n,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.#i.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(),St.cleanup(),this._networkStream?.cancelAllRequests(new jt("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",(i,r)=>{Q(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},r.onPull=()=>{this._fullReader.read().then(function({value:n,done:a}){a?r.close():(Q(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(n),1,[n]))}).catch(n=>{r.error(n)})},r.onCancel=n=>{this._fullReader.cancel(n),r.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("ReaderHeadersReady",function(){var i=N(function*(r){yield e._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:a,contentLength:o}=e._fullReader;return(!n||!a)&&(e._lastProgress&&s.onProgress?.(e._lastProgress),e._fullReader.onProgress=h=>{s.onProgress?.({loaded:h.loaded,total:h.total})}),{isStreamingSupported:n,isRangeSupported:a,contentLength:o}});return function(r){return i.apply(this,arguments)}}()),t.on("GetRangeReader",(i,r)=>{Q(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(i.begin,i.end);n?(r.onPull=()=>{n.read().then(function({value:a,done:o}){o?r.close():(Q(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(a),1,[a]))}).catch(a=>{r.error(a)})},r.onCancel=a=>{n.cancel(a),r.ready.catch(o=>{if(!this.destroyed)throw o})}):r.close()}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,s._capability.resolve(new Sn(i,this))}),t.on("DocException",i=>{s._capability.reject(Ct(i))}),t.on("PasswordRequest",i=>{this.#a=Promise.withResolvers();try{if(!s.onPassword)throw Ct(i);s.onPassword(n=>{n instanceof Error?this.#a.reject(n):this.#a.resolve({password:n})},i.code)}catch(r){this.#a.reject(r)}return this.#a.promise}),t.on("DataLoaded",i=>{s.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{this.destroyed||this.#e.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,r,n])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(r){case"Font":if("error"in n){const d=n.error;V(`Error during font loading: ${d}`),this.commonObjs.resolve(i,d);break}const a=new Rr(n),o=this._params.pdfBug&&globalThis.FontInspector?.enabled?(d,f)=>globalThis.FontInspector.fontAdded(d,f):null,h=new Cr(a,o,n.extra,n.charProcOperatorList);this.fontLoader.bind(h).catch(()=>
1t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!h.fontExtraProperties&&h.data&&h.clearData(),this.commonObjs.resolve(i,h)});break;case"CopyLocalImage":const{imageRef:c}=n;Q(c,"The imageRef must be defined.");for(const d of this.#e.values())for(const[,f]of d.objs)if(f?.ref===c)return f.dataLen?(this.commonObjs.resolve(i,structuredClone(f)),f.dataLen):null;break;case"FontPath":case"Image":this.commonObjs.resolve(i,n);break;case"Pattern":const u=new pt(n);this.commonObjs.resolve(i,u.getIR());break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),t.on("obj",([i,r,n,a])=>{if(this.destroyed)return;const o=this.#e.get(r);if(!o.objs.has(i)){if(0===o._intentStates.size)return void a?.bitmap?.close();switch(n){case"Image":case"Pattern":o.objs.resolve(i,a);break;default:throw new Error(`Got unknown object type ${n}`)}}}),t.on("DocProgress",i=>{this.destroyed||s.onProgress?.({loaded:i.loaded,total:i.total})}),t.on("FetchBinaryData",function(){var i=N(function*(r){if(e.destroyed)throw new Error("Worker was destroyed.");const n=e[r.type];if(!n)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return n.fetch(r)});return function(r){return i.apply(this,arguments)}}())}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&V("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.#i.get(t);if(s)return s;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&this.#s.set(r.refStr,e);const n=new xn(t,r,this,this._params.pdfBug);return this.#e.set(t,n),n});return this.#i.set(t,i),i}getPageIndex(e){return vs(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.#n("GetFieldObjects")}hasJSActions(){return this.#n("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.#n("GetDocJSActions")}getPageJSActions(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.#n("GetOptionalContentConfig").then(t=>new sn(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#t.get(e);if(t)return t;
1const s=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new tn(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return this.#t.set(e,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(){var e=this;return N(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),St.cleanup()}}).apply(this,arguments)}cachedPageNumber(e){return vs(e)?this.#s.get(0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`)??null:null}}class Cn{#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 oe{#t=null;static#e=new WeakSet;constructor({callback:e,params:t,objs:s,commonObjs:i,annotationCanvasMap:r,operatorList:n,pageIndex:a,canvasFactory:o,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:d=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=s,this.commonObjs=i,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=n,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=h,this._pdfBug=u,this.pageColors=d,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 Cn(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(oe.#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.");oe.#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:i,background:r,dependencyTracker:n}=this.params,a=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new re(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,n),this.gfx.beginDrawing({transform:i,viewport:s,transparency:e,background:r}),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),oe.#e.delete(this._canvas),e||=new ke(`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)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){var e=this;return N(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(),oe.#e.delete(e._canvas),e.callback())))})()}}const Xi="5.4.449",Yi="f44e5f0e6";class Ot{#t=null;#e=null;#i;#s=null;#a=!1;#n=!1;#r=null;#o;#h=null;#l=null;static#d=null;static get _keyboardManager(){return W(this,"_keyboardManager",new be([[["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.#n=!1,this.#r=e):this.#n=!0,this.#l=e?._uiManager||t,this.#o=this.#l._eventBus,this.#i=e?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||"#FFFF98",Ot.#d||=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");
vendor: 7,321 bytes, line 1
1e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#r&&(e.ariaControls=`${this.#r.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.#i,e.append(s),e}renderMainDropdown(){const e=this.#s=this.#u();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#u(){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.#r&&(e.id=`${this.#r.id}_colorpicker_dropdown`);for(const[s,i]of this.#l.highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",i),r.title=s,r.setAttribute("data-l10n-id",Ot.#d[s]);const n=document.createElement("span");r.append(n),n.className="swatch",n.style.backgroundColor=i,r.ariaSelected=i===this.#i,r.addEventListener("click",this.#f.bind(this,i),{signal:t}),e.append(r)}return e.addEventListener("keydown",this.#m.bind(this),{signal:t}),e}#f(e,t){t.stopPropagation(),this.#o.dispatch("switchannotationeditorparams",{source:this,type:_.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.#u();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.#n){if(!this.#p)return void this.#r?.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 Te{#t=null;#e=null;#i=null;static#s=null;constructor(e){this.#e=e,this.#i=e._uiManager,Te.#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,i=this.#t=document.createElement("input");return i.type="color",i.value=s||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",Te.#s[e]),i.addEventListener("input",()=>{this.#i.updateParams(t,i.value)},{signal:this.#i._signal}),i}update(e){this.#t&&(this.#t.value=e)}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}function Ki(l){return Math.floor(255*Math.max(0,Math.min(1,l))).toString(16).padStart(2,"0")}function Ce(l){return Math.max(0,Math.min(255,255*l))}K(116),K(531);class _i{static CMYK_G([e,t,s,i]){return["G",1-Math.min(1,.3*e+.59*s+.11*t+i)]}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=Ce(e),e,e]}static G_HTML([e]){const t=Ki(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(Ce)}static RGB_HTML(e){return`#${e.map(Ki).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,s,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,s+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,s,i]){return[Ce(1-Math.min(1,e+i)),Ce(1-Math.min(1,s+i)),Ce(1-Math.min(1,t+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,s]){const i=1-e,r=1-t,n=1-s;return["CMYK",i,r,n,Math.min(i,r,n)]}}class Rn{create(e,t,s=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),s||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){st("Abstract method `_createSVG` called.")}}class Re extends Rn{_createSVG(e){return document.createElementNS($t,e)}}const Wt=new WeakSet,In=60*(new Date).getTimezoneOffset()*1e3;class Is{static create(e){switch(e.data.annotationType){case ht.LINK:return new Ds(e);case ht.TEXT:return new On(e);case ht.WIDGET:switch(e.data.fieldType){case"Tx":return new Mn(e);case"Btn":return e.data.radioButton?new Qi(e):e.data.checkBox?new Fn(e):new kn(e);case"Ch":return new Nn(e);case"Sig":return new Ln(e)}return new Xt(e);case ht.POPUP:return new Os(e);case ht.FREETEXT:return new Ji(e);case ht.LINE:return new Un(e);case ht.SQUARE:return new Hn(e);case ht.CIRCLE:return new jn(e);case ht.POLYLINE:return new Zi(e);case ht.CARET:return new Gn(e);case ht.INK:return new Ms(e);case ht.POLYGON:return new $n(e);case ht.HIGHLIGHT:return new qi(e);case ht.UNDERLINE:return new zn(e);case ht.SQUIGGLY:return new Vn(e);case ht.STRIKEOUT:return new Wn(e);case ht.STAMP:return new tr(e);case ht.FILEATTACHMENT:return new Xn(e);default:return new lt(e)}}}class lt{#t=null;#e=!1;#i=null;constructor(e,{isRenderable:t=!1,ignoreBorder:s=!1,createQuadrilaterals:i=!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)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!(!e?.str&&!t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return lt._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:i}=this.data;let r=-1/0,n=-1/0;if(t?.length>=8){for(let a=0;a<t.length;a+=8)t[a+1]>n?(n=t[a+1],r=t[a+2]):t[a+1]===n&&(r=Math.max(r,t[a+2]));return[r,n]}if(s?.length>=1){for(const a of s)for(let o=0,h=a.length;o<h;o+=2)a[o+1]>n?(n=a[o+1],r=a[o]):a[o+1]===n&&(r=Math.max(r,a[o]));if(r!==1/0)return[r,n]}return i?[i[2],i[3]]:null}_normalizePoint(e){const{page:{view:t},viewport:{rawDims:{pageWidth:s,pageHeight:i,pageX:r,pageY:n}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-r)/s,e[1]=100*(e[1]-n)/i,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${he}${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(`${he}${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.#i?.popup||this.popup)?.remove(),this.#i=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 i=this.#i?.popup||this.popup;!i&&s?.text&&(this._createPopup(s),i=this.#i.popup),i&&(i.updateEdited(e),s?.deleted&&(i.remove(),this.#i=null,this.popup=null))}resetEdited(){this.#t&&(this.#s(this.#t.rect),this.#i?.popup.resetEdited(),this.#t=null)}#s(e){const{container:{style:t},data:{rect:s,rotation:i},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:n,pageX:a,pageY:o}}}}=this;s?.splice(0,4,...e),t.left=100*(e[0]-a)/r+"%",t.top=100*(n-e[3]+o)/n+"%",0===i?(t.width=100*(e[2]-e[0])/r+"%",t.height=100*(e[3]-e[1])/n+"%"):this.setRotation(i)}_createContainer(e){const{data:t,parent:{page:s,viewport:i}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",t.id),!(this instanceof Xt)&&!(this instanceof Ds)&&(r.tabIndex=0);const{style:n}=r;if(n.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(r.title=t.alternativeText),t.noRotate&&r.classList.add("norotate"),!t.rect||this instanceof Os){const{rotation:g}=t;return!t.hasOwnCanvas&&0!==g&&this.setRotation(g,r),r}const{width:a,height:o}=this;if(!e&&t.borderStyle.width>0){n.borderWidth=`${t.borderStyle.width}px`;const g=t.borderStyle.horizontalCornerRadius,m=t.borderStyle.verticalCornerRadius;switch(g>0||m>0?n.borderRadius=`calc(${g}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`:this instanceof Qi&&(n.borderRadius=`calc(${a}px * var(--total-scale-factor)) / calc(${o}px * var(--total-scale-factor))`),t.borderStyle.style){case 1:n.borderStyle="solid";break;case 2:n.borderStyle="dashed";break;case 3:V("Unimplemented border style: beveled");break;case 4:V("Unimplemented border style: inset");break;case 5:n.borderBottomStyle="solid"}const v=t.borderColor||null;v?(this.#e=!0,n.borderColor=B.makeHexColor(0|v[0],0|v[1],0|v[2])):n.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:u,pageX:d,pageY:f}=i.rawDims;n.left=100*(h[0]-d)/c+"%",n.top=100*(h[1]-f)/u+"%";const{rotation:p}=t;return t.hasOwnCanvas||0===p?(n.width=100*a/c+"%",n.height=100*o/u+"%"):this.setRotation(p,r),r}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:i}=this.parent.viewport.rawDims;let{width:r,height:n}=this;e%180!=0&&([r,n]=[n,r]),t.style.width=100*r/s+"%",t.style.height=100*n/i+"%",t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,s,i)=>{const r=i.detail[t],n=r[0],a=r.slice(1);i.target.style[s]=_i[`${n}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[s]:_i[`${n}_rgb`](a)})};return W(this,"_commonActions",{display:t=>{const{display:s}=t.detail,i=s%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,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 i of Object.keys(t.detail))(e[i]||s[i])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const s=this._commonActions;for(const[i,r]of Object.entries(t)){const n=s[i];n&&(n({detail:{[i]:r},target:e}),delete t[i])}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,s,i,r]=this.data.rect.map(g=>Math.fround(g));if(8===e.length){const[g,m,v,y]=e.subarray(2,6);if(i===g&&r===m&&t===v&&s===y)return}const{style:n}=this.container;let a;if(this.#e){const{borderColor:g,borderWidth:m}=n;n.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=i-t,h=r-s,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const d=c.createElement("defs");u.append(d);const f=c.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),d.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=(r-y)/h,x=(v-b)/o,T=(y-E)/h;A.setAttribute("x",w),A.setAttribute("y",S),A.setAttribute("width",x),A.setAttribute("height",T),f.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${w}" y="${S}" width="${x}" height="${T}"/>`)}this.#e&&(a.push("</g></svg>')"),n.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){const{data:t}=this;let s,i;e?(s={str:e.text},i=e.date):(s=t.contentsObj,i=t.modificationDate),this.#i=new Os({data:{color:t.color,titleObj:t.titleObj,modificationDate:i,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.#i||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#i}render(){st("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const s=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:r,id:n,exportValues:a}of i){if(-1===r||n===t)continue;const o="string"==typeof a?a:null,h=document.querySelector(`[data-element-id="${n}"]`);!h||Wt.has(h)?s.push({id:n,exportValue:o,domElement:h}):V(`_getElementsByName - element not allowed: ${n}`)}return s}for(const i of document.getElementsByName(e)){const{exportValue:r}=i,n=i.getAttribute("data-element-id");n!==t&&Wt.has(i)&&s.push({id:n,exportValue:r,domElement:i})}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 Dn extends lt{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 Ds extends lt{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 i=!1;return e.url?(t.addLinkAttributes(s,e.url,e.newWindow),i=!0):e.action?(this._bindNamedAction(s,e.action,e.overlaidText),i=!0):e.attachment?(this.#e(s,e.attachment,e.overlaidText,e.attachmentDest),i=!0):e.setOCGState?(this.#i(s,e.setOCGState,e.overlaidText),i=!0):e.dest?(this._bindLink(s,e.dest,e.overlaidText),i=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,e),i=!0),e.resetForm?(this._bindResetFormAction(s,e.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&(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="",i=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,i),!1),this.#t()}#i(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 i of Object.keys(t.actions)){const r=s.get(i);r&&(e[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:i}}),!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 V('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(s||(e.onclick=()=>!1));e.onclick=()=>{s?.();const{fields:i,refs:r,include:n}=t,a=[];if(0!==i.length||0!==r.length){const c=new Set(r);for(const u of i){const d=this._fieldObjects[u]||[];for(const{id:f}of d)c.add(f)}for(const u of Object.values(this._fieldObjects))for(const d of u)c.has(d.id)===n&&a.push(d)}else for(const c of Object.values(this._fieldObjects))a.push(...c);const o=this.annotationStorage,h=[];for(const c of a){const{id:u}=c;switch(h.push(u),c.type){case"text":case"combobox":case"listbox":o.setValue(u,{value:c.defaultValue||""});break;case"checkbox":case"radiobutton":o.setValue(u,{value:c.defaultValue===c.exportValues});break;default:continue}const d=document.querySelector(`[data-element-id="${u}"]`);d&&(Wt.has(d)?d.dispatchEvent(new Event("resetform")):V(`_bindResetFormAction - element not allowed: ${u}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}}),!1}}}class On extends lt{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 Xt extends lt{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return ft.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,s,i,r){s.includes("mouse")?e.addEventListener(s,n=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(n),shift:n.shiftKey,modifier:this._getKeyModifier(n)}})}):e.addEventListener(s,n=>{if("blur"===s){if(!t.focused||!n.relatedTarget)return;t.focused=!1}else if("focus"===s){if(t.focused)return;t.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(n)}})})}_setEventListeners(e,t,s,i){for(const[r,n]of s)("Action"===n||this.data.actions?.[n])&&(("Focus"===n||"Blur"===n)&&(t||={focused:!1}),this._setEventListener(e,t,r,n,i),"Focus"!==n||this.data.actions?.Blur?"Blur"===n&&!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,i=this.data.defaultAppearanceData.fontSize||9,r=e.style;let n;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*i))||1;n=Math.min(i,o(h/c/1.35))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-2);n=Math.min(i,o(h/1.35))}r.fontSize=`calc(${n}px * var(--total-scale-factor))`,r.color=B.makeHexColor(s[0],s[1],s[2]),null!==this.data.textAlignment&&(r.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class Mn extends Xt{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,s,i){const r=this.annotationStorage;
vendor: 4,257 bytes, line 1
1for(const n of this._getElementsByName(e.name,e.id))n.domElement&&(n.domElement[t]=s),r.setValue(n.id,{[i]:s})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const i=e.getValue(t,{value:this.data.fieldValue});let r=i.value||"";const n=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;n&&r.length>n&&(r=r.slice(0,n));let a=i.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=a??r,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",a??r),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),Wt.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:u}=this.data,d=!!c&&this.enableScripting;h&&(s.title=h),this._setRequired(s,this.data.required),n&&(s.maxLength=n),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(d&&(m.type=c,u&&(m.step=u)),o.userValue){const v=o.userValue;if(d)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-In).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??"",d||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};d&&(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(d){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])/n;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 Ln extends Xt{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Fn extends Xt{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,s=t.id;let i=e.getValue(s,{value:t.exportValue===t.fieldValue}).value;"string"==typeof i&&(i="Off"!==i,e.setValue(s,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return Wt.add(r),r.setAttribute("data-element-id",s),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.fieldName,i&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=0,r.addEventListener("change",n=>{const{name:a,checked:o}=n.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})}),r.addEventListener("resetform",n=>{n.target.checked=(t.defaultFieldValue||"Off")===t.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({value(o){o.target.checked="Off"!==o.detail.value,e.setValue(s,{value:o.target.checked})}},n)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],n=>n.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Qi extends Xt{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 i=e.getValue(s,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof i&&(i=i!==t.buttonValue,e.setValue(s,{value:i})),i)for(const n of this._getElementsByName(t.fieldName,s))e.setValue(n.id,{value:!1});const r=document.createElement("input");if(Wt.add(r),r.setAttribute("data-element-id",s),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.fieldName,i&&r.setAttribute("checked",!0),r.tabIndex=0,r.addEventListener("change",n=>{const{name:a,checked:o}=n.target;for(const h of this._getElementsByName(a,s))e.setValue(h.id,{value:!1});e.setValue(s,{value:o})}),r.addEventListener("resetform",n=>{const a=t.defaultFieldValue;n.target.checked=null!=a&&a===t.buttonValue}),this.enableScripting&&this.hasJSActions){const n=t.buttonValue;r.addEventListener("updatefromsandbox",a=>{this._dispatchEventFromSandbox({value:h=>{const c=n===h.detail.value;for(const u of this._getElementsByName(h.target.name)){const d=c&&u.id===s;u.domElement&&(u.domElement.checked=d),e.setValue(u.id,{value:d})}}},a)}),this._setEventListeners(r,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(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class kn extends Ds{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 Nn extends Xt{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}),i=document.createElement("select");Wt.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",c=>{const u=this.data.defaultFieldValue;for(const d of i.options)d.selected=d.value===u});for(const c of this.data.options){const u=document.createElement("option");u.textContent=c.displayValue,u.value=c.exportValue,s.value.includes(c.exportValue)&&(u.setAttribute("selected",!0),r=!1),i.append(u)}let n=null;if(r){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),i.prepend(c),n=()=>{c.remove(),i.removeEventListener("input",n),n=null},i.addEventListener("input",n)}const a=c=>{const u=c?"value":"textContent",{options:d,multiple:f}=i;return f?Array.prototype.filter.call(d,p=>p.selected).map(p=>p[u]):-1===d.selectedIndex?null:d[d.selectedIndex][u]};let o=a(!1);const h=c=>Array.prototype.map.call(c.target.options,d=>({displayValue:d.textContent,exportValue:d.value}));return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",c=>{this._dispatchEventFromSandbox({value(d){n?.();const f=d.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(const g of i.options)g.selected=p.has(g.value);e.setValue(t,{value:a(!0)}),o=a(!1)},multipleSelection(d){i.multiple=!0},remove(d){const f=i.options,p=d.detail.remove;f[p].selected=!1,i.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(d)}),o=a(!1)},clear(d){for(;0!==i.length;)i.remove(0);e.setValue(t,{value:null,items:[]}),o=a(!1)},insert(d){const{index:f,displayValue:p,exportValue:g}=d.detail.insert,m=i.children[f],v=document.createElement("option");v.textContent=p,v.value=g,m?m.before(v):i.append(v),e.setValue(t,{value:a(!0),items:h(d)}),o=a(!1)},items(d){const{items:f}=d.detail;for(;0!==i.length;)i.remove(0);for(const p of f){const{displayValue:g,exportValue:m}=p,v=document.createElement("option");v.textContent=g,v.value=m,i.append(v)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:a(!0),items:h(d)}),o=a(!1)},indices(d){const f=new Set(d.detail.indices);for(const p of d.target.options)p.selected=f.has(p.index);e.setValue(t,{value:a(!0)}),o=a(!1)},editable(d){d.target.disabled=!d.detail.editable}},c)}),i.addEventListener("input",c=>{const u=a(!0),d=a(!1);e.setValue(t,{value:u}),c.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,change:d,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,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)):i.addEventListener("input",function(c){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Os extends lt{constructor(e){const{data:t,elements:s,parent:i}=e,r=!!i._commentManager;if(super(e,{isRenderable:!r&<._hasPopupData(t)}),this.elements=s,r&<._hasPopupData(t)){const n=this.popup=this.#t();for(const a of s)a.popup=n}else this.popup=null}#t(){return new Bn({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 i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",s.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(i=>`${Zt}${i}`).join(",")),this.container}}class Bn{#t=null;#e=this.#V.bind(this);#i=this.#H.bind(this);#s=this.#L.bind(this);#a=this.#E.bind(this);#n=null;#r=null;#o=null;#h=null;#l=null;#d=null;#u=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:i,modificationDate:r,contentsObj:n,richText:a,parent:o,rect:h,parentRect:c,open:u,commentManager:d=null}){this.#r=e,this.#S=i,this.#o=n,this.#T=a,this.#d=o,this.#n=t,this.#y=h,this.#u=c,this.#l=s,this.#t=d,this.#A=s[0],this.#h=Be.toDateObject(r),this.trigger=s.flatMap(f=>f.getElementsToTriggerPopup()),d||(this.#D(),this.#r.hidden=!0,u&&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.#i,{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)},i=()=>{this.#t.toggleCommentPopup(this,!1,!0,!t)},r=()=>{this.#t.toggleCommentPopup(this,!1,!1)};if(t){this.#p=this.#A.container;for(const n of this.trigger)n.ariaHasPopup="dialog",n.ariaControls="commentPopup",n.addEventListener("keydown",this.#e,{signal:e}),n.addEventListener("click",s,{signal:e}),n.addEventListener("pointerenter",i,{signal:e}),n.addEventListener("pointerleave",r,{signal:e}),n.classList.add("popupTriggerArea")}else{const n=this.#p=document.createElement("button");n.className="annotationCommentButton";const a=this.#A.container;n.style.zIndex=a.style.zIndex+1,n.tabIndex=0,n.ariaHasPopup="dialog",n.ariaControls="commentPopup",n.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#B(),this.#I(),n.addEventListener("keydown",this.#e,{signal:e}),n.addEventListener("click",s,{signal:e}),n.addEventListener("pointerenter",i,{signal:e}),n.addEventListener("pointerleave",r,{signal:e}),a.after(n)}}#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.#d._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:i,modificationDate:r}=this.#A.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:s,creationDate:i,modificationDate:r}}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:i,y:r,width:n,height:a}=this.#A.layer.getBoundingClientRect();return[(e-i)/n,(t+s-r)/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),i=this.parentBoundingClientRect,{x:r,y:n,width:a,height:o}=i;this.#t.showDialog(null,this,r+t*a,n+s*o,{...e,parentDimensions:i})}render(){if(this.#m)return;const e=this.#m=document.createElement("div");if(e.className="popup",this.#n){const s=e.style.outlineColor=B.makeHexColor(...this.#n);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.#r.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#U(){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}]}},i={style:{color:this.#U,fontSize:this.#F?`calc(${this.#F}px * var(--total-scale-factor))`:""}};for(const r of e.split("\n"))t.push({name:"span",value:r,attributes:i});return s}#V(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=Be.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:i,pageY:r}}}=this.#d;let n=!!this.#u,a=n?this.#u:this.#y;for(const p of this.#l)if(!a||null!==B.intersect(p.data.rect,a)){a=p.data.rect,n=!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]+(n?a[2]-a[0]+5:0)-i)/t,100*(o[1]-r)/s];const{style:f}=this.#r;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.#r.addEventListener("click",this.#a),this.#r.addEventListener("keydown",this.#e)):(this.#H(),this.#r.removeEventListener("click",this.#a),this.#r.removeEventListener("keydown",this.#e)))}#L(){this.#m||this.render(),this.isVisible?this.#f&&this.#r.classList.add("focused"):(this.#C(),this.#r.hidden=!1,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)+1e3)}#H(){this.#r.classList.remove("focused"),!this.#f&&this.isVisible&&(this.#r.hidden=!0,this.#r.style.zIndex=parseInt(this.#r.style.zIndex)-1e3)}forceHide(){this.#R=this.isVisible,this.#R&&(this.#r.hidden=!0)}maybeShow(){this.#t||(this.#D(),this.#R&&(this.#m||this.#L(),this.#R=!1,this.#r.hidden=!1))}get isVisible(){return!this.#t&&!1===this.#r.hidden}}class Ji extends lt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Y.FREETEXT}
vendor: 7,491 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 Un extends lt{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const{data:e,width:t,height:s}=this,i=this.svgFactory.create(t,s,!0),r=this.#t=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),r.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),r.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),r.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),i.append(r),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Hn extends lt{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const{data:e,width:t,height:s}=this,i=this.svgFactory.create(t,s,!0),r=e.borderStyle.width,n=this.#t=this.svgFactory.createElement("svg:rect");return n.setAttribute("x",r/2),n.setAttribute("y",r/2),n.setAttribute("width",t-r),n.setAttribute("height",s-r),n.setAttribute("stroke-width",r||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class jn extends lt{#t=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const{data:e,width:t,height:s}=this,i=this.svgFactory.create(t,s,!0),r=e.borderStyle.width,n=this.#t=this.svgFactory.createElement("svg:ellipse");return n.setAttribute("cx",t/2),n.setAttribute("cy",s/2),n.setAttribute("rx",t/2-r/2),n.setAttribute("ry",s/2-r/2),n.setAttribute("stroke-width",r||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class Zi extends lt{#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:i},width:r,height:n}=this;if(!t)return this.container;const a=this.svgFactory.create(r,n,!0);let o=[];for(let c=0,u=t.length;c<u;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),!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add("highlightArea")}}class $n extends Zi{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Gn extends lt{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 Ms extends lt{#t=null;#e=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?Y.HIGHLIGHT:Y.INK}#i(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:i,popupRef:r}}=this,{transform:n,width:a,height:o}=this.#i(t,e),h=this.svgFactory.create(a,o,!0),c=this.#t=this.svgFactory.createElement("svg:g");h.append(c),c.setAttribute("stroke-width",i.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",n);for(let u=0,d=s.length;u<d;u++){const f=this.svgFactory.createElement(this.svgElementName);this.#e.push(f),f.setAttribute("points",s[u].join(",")),c.append(f)}return!r&&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:i}=e,r=this.#t;if(t>=0&&r.setAttribute("stroke-width",t||1),s)for(let n=0,a=this.#e.length;n<a;n++)this.#e[n].setAttribute("points",s[n].join(","));if(i){const{transform:n,width:a,height:o}=this.#i(this.data.rotation,i);r.parentElement.setAttribute("viewBox",`0 0 ${a} ${o}`),r.setAttribute("transform",n)}}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}}class qi extends lt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Y.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 zn extends lt{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 Vn extends lt{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}}
1class Wn extends lt{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 tr extends lt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Y.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}}class Xn extends lt{#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:i}=ft.platform;return e.addEventListener("keydown",r=>{"Enter"===r.key&&(i?r.metaKey:r.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 Ke{#t=null;#e=null;#i=null;#s=new Map;#a=null;#n=null;#r=[];#o=!1;constructor({div:e,accessibilityManager:t,annotationCanvasMap:s,annotationEditorUIManager:i,page:r,viewport:n,structTreeLayer:a,commentManager:o,linkService:h,annotationStorage:c}){this.div=e,this.#t=t,this.#e=s,this.#a=a||null,this.#n=h||null,this.#i=c||new ms,this.page=r,this.viewport=n,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=o||null}hasEditableAnnotations(){return this.#s.size>0}render(e){var t=this;return N(function*(){const{annotations:s}=e,i=t.div;Gt(i,t.viewport);const r=new Map,n=[],a={data:null,layer:i,linkService:t.#n,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new Re,annotationStorage:t.#i,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===ht.POPUP;if(h){const d=r.get(o.id);if(!d)continue;if(!t._commentManager){n.push(o);continue}a.elements=d}else if(o.rect[2]===o.rect[0]||o.rect[3]===o.rect[1])continue;a.data=o;const c=Is.create(a);if(!c.isRenderable)continue;if(!h&&(t.#r.push(c),o.popupRef)){const d=r.get(o.popupRef);d?d.push(c):r.set(o.popupRef,[c])}const u=c.render();o.hidden&&(u.style.visibility="hidden"),c._isEditable&&(t.#s.set(c.data.id,c),t._annotationEditorUIManager?.renderAnnotationElement(c))}yield t.#h();for(const o of n){const h=a.elements=r.get(o.id);a.data=o;const c=Is.create(a);if(!c.isRenderable)continue;const u=c.render();c.contentElement.id=`${Zt}${o.id}`,o.hidden&&(u.style.visibility="hidden"),h.at(-1).container.after(u)}t.#l()})()}#h(){var e=this;return N(function*(){if(0===e.#r.length)return;e.div.replaceChildren();const t=[];if(!e.#o){e.#o=!0;for(const{contentElement:i,data:{id:r}}of e.#r){const n=i.id=`${Zt}${r}`;t.push(e.#a?.getAriaAttributes(n).then(a=>{if(a)for(const[o,h]of a)i.setAttribute(o,h)}))}}e.#r.sort(({data:{rect:[i,r,n,a]}},{data:{rect:[o,h,c,u]}})=>{if(i===n&&r===a)return 1;if(o===c&&h===u)return-1;const p=(r+a)/2,v=(h+u)/2;return p>=u&&v<=r?-1:v>=a&&p<=h?1:(i+n)/2-(o+c)/2});const s=document.createDocumentFragment();for(const i of e.#r)s.append(i.container),e._commentManager?(i.extraPopupElement?.popup||i.popup)?.renderCommentButton():i.extraPopupElement&&s.append(i.extraPopupElement.render());if(e.div.append(s),yield Promise.all(t),e.#t)for(const i of e.#r)e.#t.addPointerInTextLayer(i.contentElement,!1)})()}addLinkAnnotations(e){var t=this;return N(function*(){const s={data:null,layer:t.div,linkService:t.#n,svgFactory:new Re,parent:t};for(const i of e){i.borderStyle||=Ke._defaultBorderStyle,s.data=i;const r=Is.create(s);r.isRenderable&&(r.render(),r.contentElement.id=`${Zt}${i.id}
1`,t.#r.push(r))}yield t.#h()})()}update({viewport:e}){const t=this.div;this.viewport=e,Gt(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 i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;s.className="annotationContent";const{firstChild:r}=i;r?"CANVAS"===r.nodeName?r.replaceWith(s):r.classList.contains("annotationContent")?r.after(s):r.before(s):i.append(s);const n=this.#s.get(t);n&&(n._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,i.id,s),n._hasNoCanvas=!1):n.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:i}=e,r=new Dn({data:{id:s,rect:e.getPDFRect(),rotation:i},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#n,annotationStorage:this.#i});return r.render(),r.contentElement.id=`${Zt}${s}`,r.createOrUpdatePopup(),this.#r.push(r),r}removeAnnotation(e){const t=this.#r.findIndex(i=>i.data.id===e);if(t<0)return;const[s]=this.#r.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 W(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:1,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}}const _e=/\r\n?|\n/g;class mt extends ${#t="";#e=`${this.id}-editor`;#i=null;#s;_colorPicker=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=mt.prototype,t=r=>r.isEmpty(),s=ee.TRANSLATE_SMALL,i=ee.TRANSLATE_BIG;return W(this,"_keyboardManager",new be([[["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:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[s,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,s],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}]]))}static _type="freetext";static _editorType=Y.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.color=e.color||mt._defaultColor||$._defaultLineColor,this.#s=e.fontSize||mt._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static initialize(e,t){$.initialize(e,t);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case _.FREETEXT_SIZE:mt._defaultFontSize=t;break;case _.FREETEXT_COLOR:mt._defaultColor=t}}updateParams(e,t){switch(e){case _.FREETEXT_SIZE:this.#a(t);break;case _.FREETEXT_COLOR:this.#n(t)}}static get defaultPropertiesToUpdate(){return[[_.FREETEXT_SIZE,mt._defaultFontSize],[_.FREETEXT_COLOR,mt._defaultColor||$._defaultLineColor]]}get propertiesToUpdate(){return[[_.FREETEXT_SIZE,this.#s],[_.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new Te(this),[["colorPicker",this._colorPicker]]}get colorType(){return _.FREETEXT_COLOR}#a(e){const t=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-this.#s)*this.parentScale),this.#s=i,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:_.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#n(e){const t=i=>{this.color=i,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:_.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-mt._internalPadding*e,-(mt._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.#i=new AbortController;const e=this._uiManager.combinedSignal(this.#i);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.#i?.abort(),this.#i=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()}#r(){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(mt.#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:i,div:r}=this,n=r.style.display,a=r.classList.contains("hidden");r.classList.remove("hidden"),r.style.display="hidden",i.div.append(this.div),s=r.getBoundingClientRect(),r.remove(),r.style.display=n,r.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.#r().trimEnd();if(e===t)return;const s=i=>{this.#t=i,i?(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){mt._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[i,r]=this.parentDimensions;if(this.annotationElementId){const{position:n}=this._initialData;let[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);const[h,c]=this.pageDimensions,[u,d]=this.pageTranslation;let f,p;switch(this.rotation){case 0:f=e+(n[0]-u)/h,p=t+this.height-(n[1]-d)/c;break;case 90:f=e+(n[0]-u)/h,p=t-(n[1]-d)/c,[a,o]=[o,-a];break;case 180:f=e-this.width+(n[0]-u)/h,p=t-(n[1]-d)/c,[a,o]=[-a,-o];break;case 270:f=e+(n[0]-u-this.height*c)/h,p=t+(n[1]-d-this.width*h)/c,[a,o]=[-o,a]}this.setAt(f*i,p*r,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(_e,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:s}=t;if(1===s.length&&"text/plain"===s[0])return;e.preventDefault();const i=mt.#u(t.getData("text")||"").replaceAll(_e,"\n");if(!i)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize(),r.deleteFromDocument();const n=r.getRangeAt(0);if(!i.includes("\n"))return n.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),void r.collapseToStart();const{startContainer:a,startOffset:o}=n,h=[],c=[];if(a.nodeType===Node.TEXT_NODE){const f=a.parentElement;if(c.push(a.nodeValue.slice(o).replaceAll(_e,"")),f!==this.editorDiv){let p=h;for(const g of this.editorDiv.childNodes)g!==f?p.push(mt.#h(g)):p=c}h.push(a.nodeValue.slice(0,o).replaceAll(_e,""))}else if(a===this.editorDiv){let f=h,p=0;for(const g of this.editorDiv.childNodes)p++===o&&(f=c),f.push(mt.#h(g))}this.#t=`${h.join("\n")}${i}${c.join("\n")}`,this.#l();const u=new Range;let d=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(d<=p){u.setStart(f,d),u.setEnd(f,d);break}d-=p}r.removeAllRanges(),r.addRange(u)}#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)}}#d(){return this.#t.replaceAll("\xa0"," ")}static#u(e){return e.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}getPDFRect(){const e=mt._internalPadding*this.parentScale;return this.getRect(e,e)}
vendor: 4,884 bytes, line 1
1static deserialize(e,t,s){var i=()=>super.deserialize,r=this;return N(function*(){let n=null;if(e instanceof Ji){const{data:{defaultAppearanceData:{fontSize:o,fontColor:h},rect:c,rotation:u,id:d,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;n=e={annotationType:Y.FREETEXT,color:Array.from(h),fontSize:o,value:y.join("\n"),position:b,pageIndex:E-1,rect:c.slice(0),rotation:u,annotationElementId:d,id:d,deleted:!1,popupRef:f,comment:g?.str||null,richText:p,creationDate:m,modificationDate:v}}const a=yield i().call(r,e,t,s);return a.#s=e.fontSize,a.color=B.makeHexColor(...e.color),a.#t=mt.#u(e.value),a._initialData=n,e.comment&&a.setCommentData(e),a})()}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=$._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(e),{color:t,fontSize:this.#s,value:this.#d()});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:i,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==s||e.color.some((n,a)=>n!==i[a])||e.pageIndex!==r}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 i of this.#t.split("\n")){const r=document.createElement("div");r.append(i?document.createTextNode(i):document.createElement("br")),t.append(r)}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 U=(()=>class l{static PRECISION=1e-4;toSVGPath(){st("Abstract method `toSVGPath` must be implemented.")}get box(){st("Abstract getter `box` must be implemented.")}serialize(t,s){st("Abstract method `serialize` must be implemented.")}static _rescale(t,s,i,r,n,a){a||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)a[o]=s+t[o]*r,a[o+1]=i+t[o+1]*n;return a}static _rescaleAndSwap(t,s,i,r,n,a){a||=new Float32Array(t.length);for(let o=0,h=t.length;o<h;o+=2)a[o]=s+t[o+1]*r,a[o+1]=i+t[o]*n;return a}static _translate(t,s,i,r){r||=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n+=2)r[n]=s+t[n],r[n+1]=i+t[n+1];return r}static svgRound(t){return Math.round(1e4*t)}static _normalizePoint(t,s,i,r,n){switch(n){case 90:return[1-s/i,t/r];case 180:return[1-t/i,1-s/r];case 270:return[s/i,1-t/r];default:return[t/i,s/r]}}static _normalizePagePoint(t,s,i){switch(i){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,i,r,n,a){return[(t+5*i)/6,(s+5*r)/6,(5*i+n)/6,(5*r+a)/6,(i+n)/2,(r+a)/2]}})();class Yt{#t;#e=[];#i;#s;#a=[];#n=new Float32Array(18);#r;#o;#h;#l;#d;#u;#f=[];static#m=8;static#g=2;static#c=Yt.#m+Yt.#g;constructor({x:e,y:t},s,i,r,n,a=0){this.#t=s,this.#u=r*i,this.#s=n,this.#n.set([NaN,NaN,NaN,NaN,e,t],6),this.#i=a,this.#l=Yt.#m*i,this.#h=Yt.#c*i,this.#d=i,this.#f.push(e,t)}isEmpty(){return isNaN(this.#n[8])}#p(){const e=this.#n.subarray(4,6),t=this.#n.subarray(16,18),[s,i,r,n]=this.#t;return[(this.#r+(e[0]-t[0])/2-s)/r,(this.#o+(e[1]-t[1])/2-i)/n,(this.#r+(t[0]-e[0])/2-s)/r,(this.#o+(t[1]-e[1])/2-i)/n]}add({x:e,y:t}){this.#r=e,this.#o=t;const[s,i,r,n]=this.#t;let[a,o,h,c]=this.#n.subarray(8,12);const u=e-h,d=t-c,f=Math.hypot(u,d);if(f<this.#h)return!1;const p=f-this.#l,g=p/f,m=g*u,v=g*d;let y=a,b=o;a=h,o=c,h+=m,c+=v,this.#f?.push(e,t);const w=-v/p*this.#u,S=m/p*this.#u;return this.#n.set(this.#n.subarray(2,8),0),this.#n.set([h+w,c+S],4),this.#n.set(this.#n.subarray(14,18),12),this.#n.set([h-w,c-S],16),isNaN(this.#n[6])?(0===this.#a.length&&(this.#n.set([a+w,o+S],2),this.#a.push(NaN,NaN,NaN,NaN,(a+w-s)/r,(o+S-i)/n),this.#n.set([a-w,o-S],14),this.#e.push(NaN,NaN,NaN,NaN,(a-w-s)/r,(o-S-i)/n)),this.#n.set([y,b,a,o,h,c],6),!this.isEmpty()):(this.#n.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.#n.subarray(2,6),this.#a.push(NaN,NaN,NaN,NaN,((a+h)/2-s)/r,((o+c)/2-i)/n),[a,o,y,b]=this.#n.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((y+a)/2-s)/r,((b+o)/2-i)/n),!0):([y,b,a,o,h,c]=this.#n.subarray(0,6),this.#a.push(((y+5*a)/6-s)/r,((b+5*o)/6-i)/n,((5*a+h)/6-s)/r,((5*o+c)/6-i)/n,((a+h)/2-s)/r,((o+c)/2-i)/n),[h,c,a,o,y,b]=this.#n.subarray(12,18),this.#e.push(((y+5*a)/6-s)/r,((b+5*o)/6-i)/n,((5*a+h)/6-s)/r,((5*o+c)/6-i)/n,((a+h)/2-s)/r,((o+c)/2-i)/n),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#a,t=this.#e;if(isNaN(this.#n[6])&&!this.isEmpty())return this.#v();const s=[];
vendor: 8,833 bytes, line 1
1s.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?s.push(`L${e[i+4]} ${e[i+5]}`):s.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);this.#y(s);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?s.push(`L${t[i+4]} ${t[i+5]}`):s.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return this.#b(s),s.join(" ")}#v(){const[e,t,s,i]=this.#t,[r,n,a,o]=this.#p();return`M${(this.#n[2]-e)/s} ${(this.#n[3]-t)/i} L${(this.#n[4]-e)/s} ${(this.#n[5]-t)/i} L${r} ${n} L${a} ${o} L${(this.#n[16]-e)/s} ${(this.#n[17]-t)/i} L${(this.#n[14]-e)/s} ${(this.#n[15]-t)/i} Z`}#b(e){const t=this.#e;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){const[t,s,i,r]=this.#t,n=this.#n.subarray(4,6),a=this.#n.subarray(16,18),[o,h,c,u]=this.#p();e.push(`L${(n[0]-t)/i} ${(n[1]-s)/r} L${o} ${h} L${c} ${u} L${(a[0]-t)/i} ${(a[1]-s)/r}`)}newFreeDrawOutline(e,t,s,i,r,n){return new er(e,t,s,i,r,n)}getOutlines(){const e=this.#a,t=this.#e,s=this.#n,[i,r,n,a]=this.#t,o=new Float32Array((this.#f?.length??0)+2);for(let u=0,d=o.length-2;u<d;u+=2)o[u]=(this.#f[u]-i)/n,o[u+1]=(this.#f[u+1]-r)/a;if(o[o.length-2]=(this.#r-i)/n,o[o.length-1]=(this.#o-r)/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 u=0;u<c;u+=2)isNaN(e[u])?h[u]=h[u+1]=NaN:(h[u]=e[u],h[u+1]=e[u+1]);c=this.#w(h,c);for(let u=t.length-6;u>=6;u-=6)for(let d=0;d<6;d+=2)isNaN(t[u+d])?(h[c]=h[c+1]=NaN,c+=2):(h[c]=t[u+d],h[c+1]=t[u+d+1],c+=2);return this.#S(h,c),this.newFreeDrawOutline(h,o,this.#t,this.#d,this.#i,this.#s)}#T(e){const t=this.#n,[s,i,r,n]=this.#t,[a,o,h,c]=this.#p(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-s)/r,(t[3]-i)/n,NaN,NaN,NaN,NaN,(t[4]-s)/r,(t[5]-i)/n,NaN,NaN,NaN,NaN,a,o,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,(t[16]-s)/r,(t[17]-i)/n,NaN,NaN,NaN,NaN,(t[14]-s)/r,(t[15]-i)/n],0),this.newFreeDrawOutline(u,e,this.#t,this.#d,this.#i,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.#n.subarray(4,6),i=this.#n.subarray(16,18),[r,n,a,o]=this.#t,[h,c,u,d]=this.#p();return e.set([NaN,NaN,NaN,NaN,(s[0]-r)/a,(s[1]-n)/o,NaN,NaN,NaN,NaN,h,c,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(i[0]-r)/a,(i[1]-n)/o],t),t+24}}class er extends U{#t;#e=new Float32Array(4);#i;#s;#a;#n;#r;constructor(e,t,s,i,r,n){super(),this.#r=e,this.#a=t,this.#t=s,this.#n=i,this.#i=r,this.#s=n,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#o(n);const[a,o,h,c]=this.#e;for(let u=0,d=e.length;u<d;u+=2)e[u]=(e[u]-a)/h,e[u+1]=(e[u+1]-o)/c;for(let u=0,d=t.length;u<d;u+=2)t[u]=(t[u]-a)/h,t[u+1]=(t[u+1]-o)/c}toSVGPath(){const e=[`M${this.#r[4]} ${this.#r[5]}`];for(let t=6,s=this.#r.length;t<s;t+=6)isNaN(this.#r[t])?e.push(`L${this.#r[t+4]} ${this.#r[t+5]}`):e.push(`C${this.#r[t]} ${this.#r[t+1]} ${this.#r[t+2]} ${this.#r[t+3]} ${this.#r[t+4]} ${this.#r[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,s,i],r){const n=s-e,a=i-t;let o,h;switch(r){case 0:o=U._rescale(this.#r,e,i,n,-a),h=U._rescale(this.#a,e,i,n,-a);break;case 90:o=U._rescaleAndSwap(this.#r,e,t,n,a),h=U._rescaleAndSwap(this.#a,e,t,n,a);break;case 180:o=U._rescale(this.#r,s,t,-n,a),h=U._rescale(this.#a,s,t,-n,a);break;case 270:o=U._rescaleAndSwap(this.#r,s,i,-n,-a),h=U._rescaleAndSwap(this.#a,s,i,-n,-a)}return{outline:Array.from(o),points:[Array.from(h)]}}#o(e){const t=this.#r;let s=t[4],i=t[5];const r=[s,i,s,i];let n=s,a=i,o=s,h=i;const c=e?Math.max:Math.min,u=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,r),a>m?(n=g,a=m):a===m&&(n=c(n,g)),h<m?(o=g,h=m):h===m&&(o=c(o,g))):(u[0]=u[1]=1/0,u[2]=u[3]=-1/0,B.bezierBoundingBox(s,i,...t.slice(f,f+6),u),B.rectBoundingBox(u[0],u[1],u[2],u[3],r),a>u[1]?(n=u[0],a=u[1]):a===u[1]&&(n=c(n,u[0])),h<u[3]?(o=u[2],h=u[3]):h===u[3]&&(o=c(o,u[2]))),s=g,i=m}const d=this.#e;d[0]=r[0]-this.#i,d[1]=r[1]-this.#i,d[2]=r[2]-r[0]+2*this.#i,d[3]=r[3]-r[1]+2*this.#i,this.firstPoint=[n,a],this.lastPoint=[o,h]}get box(){return this.#e}newOutliner(e,t,s,i,r,n=0){return new Yt(e,t,s,i,r,n)}getNewOutline(e,t){const[s,i,r,n]=this.#e,[a,o,h,c]=this.#t,u=r*h,d=n*c,f=s*h+a,p=i*c+o,g=this.newOutliner({x:this.#a[0]*u+f,y:this.#a[1]*d+p},this.#t,this.#n,e,this.#s,t??this.#i);for(let m=2;m<this.#a.length;m+=2)g.add({x:this.#a[m]*u+f,y:this.#a[m+1]*d+p});return g.getOutlines()}}class Ls{#t;#e;#i;#s=[];#a=[];constructor(e,t=0,s=0,i=!0){const r=[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,r)}const o=r[2]-r[0]+2*s,h=r[3]-r[1]+2*s,c=r[0]-s,u=r[1]-s;let d=i?-1/0:1/0,f=1/0;const p=this.#s.at(i?-1:-2),g=[p[0],p[2]];for(const m of this.#s){const[v,y,b,E]=m;!E&&i?y<f?(f=y,d=v):y===f&&(d=Math.max(d,v)):E&&!i&&(y<f?(f=y,d=v):y===f&&(d=Math.min(d,v))),m[0]=(v-c)/o,m[1]=(y-u)/h,m[2]=(b-u)/h}this.#t=new Float32Array([c,u,o,h]),this.#e=[d,f],this.#i=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.#n(e)}#n(e){const t=[],s=new Set;for(const n of e){const[a,o,h]=n;t.push([a,o,n],[a,h,n])}t.sort((n,a)=>n[1]-a[1]||n[0]-a[0]);for(let n=0,a=t.length;n<a;n+=2){const o=t[n][2],h=t[n+1][2];o.push(h),h.push(o),s.add(o),s.add(h)}const i=[];let r;for(;s.size>0;){const n=s.values().next().value;let[a,o,h,c,u]=n;s.delete(n);let d=a,f=o;for(r=[a,h],i.push(r);;){let p;if(s.has(c))p=c;else{if(!s.has(u))break;p=u}s.delete(p),[a,o,h,c,u]=p,d!==a&&(r.push(d,f,a,f===o?o:h),d=a),f=f===o?h:o}r.push(d,f)}return new Yn(i,this.#t,this.#e,this.#i)}#r(e){const t=this.#a;let s=0,i=t.length-1;for(;s<=i;){const r=s+i>>1,n=t[r][0];if(n===e)return r;n<e?s=r+1:i=r-1}return i+1}#o([,e,t]){const s=this.#r(e);this.#a.splice(s,0,[e,t])}#h([,e,t]){const s=this.#r(e);for(let i=s;i<this.#a.length;i++){const[r,n]=this.#a[i];if(r!==e)break;if(r===e&&n===t)return void this.#a.splice(i,1)}for(let i=s-1;i>=0;i--){const[r,n]=this.#a[i];if(r!==e)break;if(r===e&&n===t)return void this.#a.splice(i,1)}}#l(e){const[t,s,i]=e,r=[[t,s,i]],n=this.#r(i);for(let a=0;a<n;a++){const[o,h]=this.#a[a];for(let c=0,u=r.length;c<u;c++){const[,d,f]=r[c];if(!(h<=d||f<=o)){if(d>=o){if(f>h)r[c][1]=h;else{if(1===u)return[];r.splice(c,1),c--,u--}continue}r[c][2]=o,f>h&&r.push([t,h,f])}}}return r}}class Yn extends U{#t;#e;constructor(e,t,s,i){super(),this.#e=e,this.#t=t,this.firstPoint=s,this.lastPoint=i}toSVGPath(){const e=[];for(const t of this.#e){let[s,i]=t;e.push(`M${s} ${i}`);for(let r=2;r<t.length;r+=2){const n=t[r],a=t[r+1];n===s?(e.push(`V${a}`),i=a):a===i&&(e.push(`H${n}`),s=n)}e.push("Z")}return e.join(" ")}serialize([e,t,s,i],r){const n=[],a=s-e,o=i-t;for(const h of this.#e){const c=new Array(h.length);for(let u=0;u<h.length;u+=2)c[u]=e+h[u]*a,c[u+1]=i-h[u+1]*o;n.push(c)}return n}get box(){return this.#t}get classNamesForOutlining(){return["highlightOutline"]}}class Fs extends Yt{newFreeDrawOutline(e,t,s,i,r,n){return new Kn(e,t,s,i,r,n)}}class Kn extends er{newOutliner(e,t,s,i,r,n=0){return new Fs(e,t,s,i,r,n)}}class ct extends ${#t=null;#e=0;#i;#s=null;#a=null;#n=null;#r=null;#o=0;#h=null;#l=null;#d=null;#u=!1;#f=null;#m=null;#g=null;#c="";#p;#v="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Y.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=ct.prototype;return W(this,"_keyboardManager",new be([[["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||ct._defaultColor,this.#p=e.thickness||ct._defaultThickness,this.opacity=e.opacity||ct._defaultOpacity,this.#i=e.boxes||null,this.#v=e.methodOfCreation||"",this.#c=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#u=!0,this.#y(e),this.#A()):this.#i&&(this.#t=e.anchorNode,this.#e=e.anchorOffset,this.#r=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.#u?"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 Ls(this.#i,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;const t=new Ls(this.#i,.0025,.001,"ltr"===this._uiManager.direction);this.#n=t.getOutlines();const{firstPoint:s}=this.#l;this.#f=[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height];const{lastPoint:i}=this.#n;this.#m=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#y({highlightOutlines:e,highlightId:t,clipPathId:s}){if(this.#l=e,this.#n=e.getNewOutline(this.#p/2+1.5,.0025),t>=0)this.#d=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.#n.box,path:{d:this.#n.toSVGPath()}},!0);else if(this.parent){const u=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#d,{bbox:ct.#x(this.#l.box,(u-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#g,{bbox:ct.#x(this.#n.box,u),path:{d:this.#n.toSVGPath()}})}const[r,n,a,o]=e.box;switch(this.rotation){case 0:this.x=r,this.y=n,this.width=a,this.height=o;break;case 90:{const[u,d]=this.parentDimensions;this.x=n,this.y=1-r,this.width=a*d/u,this.height=o*u/d;break}case 180:this.x=1-r,this.y=1-n,this.width=a,this.height=o;break;case 270:{const[u,d]=this.parentDimensions;this.x=1-n,this.y=r,this.width=a*d/u,this.height=o*u/d;break}}const{firstPoint:h}=e;this.#f=[(h[0]-r)/a,(h[1]-n)/o];const{lastPoint:c}=this.#n;this.#m=[(c[0]-r)/a,(c[1]-n)/o]}static initialize(e,t){$.initialize(e,t),ct._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case _.HIGHLIGHT_COLOR:ct._defaultColor=t;break;case _.HIGHLIGHT_THICKNESS:ct._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#m}get commentButtonPosition(){return this.#f}updateParams(e,t){switch(e){case _.HIGHLIGHT_COLOR:this.#T(t);break;case _.HIGHLIGHT_THICKNESS:this.#S(t)}}static get defaultPropertiesToUpdate(){return[[_.HIGHLIGHT_COLOR,ct._defaultColor],[_.HIGHLIGHT_THICKNESS,ct._defaultThickness]]}get propertiesToUpdate(){return[[_.HIGHLIGHT_COLOR,this.color||ct._defaultColor],[_.HIGHLIGHT_THICKNESS,this.#p||ct._defaultThickness],[_.HIGHLIGHT_FREE,this.#u]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#d,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#a?.updateColor(this.color),super.onUpdatedColor()}#T(e){const t=(r,n)=>{this.color=r,this.opacity=n,this.onUpdatedColor()},s=this.color,i=this.opacity;this.addCommands({cmd:t.bind(this,e,ct._defaultOpacity),undo:t.bind(this,s,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#S(e){const t=this.#p,s=i=>{this.#p=i,this.#w(i)};this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:_.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.#u&&(this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())}#R(){null===this.#d||!this.parent||(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#g),this.#g=null)}#A(e=this.parent){null===this.#d&&(({id:this.#d,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.#u},path:{d:this.#l.toSVGPath()}},!1,!0)),this.#g=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#u},bbox:this.#n.box,path:{d:this.#n.toSVGPath()}},this.#u),this.#h&&(this.#h.style.clipPath=this.#s))}static#x([e,t,s,i],r){switch(r){case 90:return[1-t-i,e,i,s];case 180:return[1-e-s,1-t-i,s,i];case 270:return[t,1-e-s,i,s]}return[e,t,s,i]}rotate(e){const{drawLayer:t}=this.parent;let s;s=this.#u?ct.#x(this.#l.box,e=(e-this.rotation+360)%360):ct.#x([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#d,{bbox:s,root:{"data-main-rotation":e}}),t.updateProperties(this.#g,{bbox:ct.#x(this.#n.box,e),root:{"data-main-rotation":e}})}
vendor: 11,936 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.#u?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(),li(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){ct._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.#r,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.#u||this.#P(!1))}get _mustFixPosition(){return!this.#u}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#d,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#g,{rootClass:{hidden:!e}}))}#I(){return this.#u?this.rotation:0}#B(){if(this.#u)return null;const[e,t]=this.pageDimensions,[s,i]=this.pageTranslation,r=this.#i,n=new Float32Array(8*r.length);let a=0;for(const{x:o,y:h,width:c,height:u}of r){const d=o*e+s,f=(1-h)*t+i;n[a]=n[a+4]=d,n[a+1]=n[a+3]=f,n[a+2]=n[a+6]=d+c*e,n[a+5]=n[a+7]=f-u*t,a+=8}return n}#M(e){return this.#l.serialize(e,this.#I())}static startHighlighting(e,t,{target:s,x:i,y:r}){const{x:n,y:a,width:o,height:h}=s.getBoundingClientRect(),c=new AbortController,u=e.combinedSignal(c),d=f=>{c.abort(),this.#U(e,f)};window.addEventListener("blur",d,{signal:u}),window.addEventListener("pointerup",d,{signal:u}),window.addEventListener("pointerdown",at,{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",It,{signal:u}),s.addEventListener("pointermove",this.#F.bind(this,e),{signal:u}),this._freeHighlight=new Fs({x:i,y:r},[n,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#U(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 i=()=>super.deserialize,r=this;return N(function*(){let n=null;if(e instanceof qi){const{data:{quadPoints:m,rect:v,rotation:y,id:b,color:E,opacity:A,popupRef:w,richText:S,contentsObj:x,creationDate:T,modificationDate:C},parent:{page:{pageNumber:R}}}=e;n=e={annotationType:Y.HIGHLIGHT,color:Array.from(E),opacity:A,quadPoints:m,boxes:null,pageIndex:R-1,rect:v.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,popupRef:w,richText:S,comment:x?.str||null,creationDate:T,modificationDate:C}}else if(e instanceof Ms){const{data:{inkLists:m,rect:v,rotation:y,id:b,color:E,borderStyle:{rawWidth:A},popupRef:w,richText:S,contentsObj:x,creationDate:T,modificationDate:C},parent:{page:{pageNumber:R}}}=e;n=e={annotationType:Y.HIGHLIGHT,color:Array.from(E),thickness:A,inkLists:m,boxes:null,pageIndex:R-1,rect:v.slice(0),rotation:y,annotationElementId:b,id:b,deleted:!1,popupRef:w,richText:S,comment:x?.str||null,creationDate:T,modificationDate:C}}const{color:a,quadPoints:o,inkLists:h,opacity:c}=e,u=yield i().call(r,e,t,s);u.color=B.makeHexColor(...a),u.opacity=c||1,h&&(u.#p=e.thickness),u._initialData=n,e.comment&&u.setCommentData(e);const[d,f]=u.pageDimensions,[p,g]=u.pageTranslation;if(o){const m=u.#i=[];for(let v=0;v<o.length;v+=8)m.push({x:(o[v]-p)/d,y:1-(o[v+1]-g)/f,width:(o[v+2]-o[v])/d,height:(o[v+1]-o[v+5])/f});u.#b(),u.#A(),u.rotate(u.rotation)}else if(h){u.#u=!0;const m=h[0],v={x:m[0]-p,y:f-(m[1]-g)},y=new Fs(v,[0,0,d,f],1,u.#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:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:y.toSVGPath()}},!0,!0);u.#y({highlightOutlines:y.getOutlines(),highlightId:b,clipPathId:E}),u.#A(),u.rotate(u.parentRotation)}return u})()}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=$._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,i)=>s!==t[i])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class sr{#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(){st("Not implemented")}}let ir=(()=>{class l extends ${#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#i=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.#n(t),this.#h())}#n({drawOutlines:t,drawId:s,drawingOptions:i}){this.#t=t,this._drawingOptions||=i,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.#r(t,this.parent),this.#u(t.box)}#r(t,s){const{id:i}=s.drawLayer.draw(l._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(t,s){const i=new Set(Object.keys(t));for(const[r,n]of Object.entries(s))i.has(r)?Object.assign(t[r],n):t[r]=n;return t}static getDefaultDrawingOptions(t){st("Not implemented")}static get typesMap(){st("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,s){const i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,s),this._currentParent&&(l.#i.updateProperty(i,s),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,s){const i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,s)}static get defaultPropertiesToUpdate(){const t=[],s=this._defaultDrawingOptions;for(const[i,r]of this.typesMap)t.push([i,s[r]]);return t}get propertiesToUpdate(){const t=[],{_drawingOptions:s}=this;for(const[i,r]of this.constructor.typesMap)t.push([i,s[r]]);return t}_updateProperty(t,s,i){const r=this._drawingOptions,n=r[s],a=o=>{r.updateProperty(s,o);const h=this.#t.updateProperty(s,o);h&&this.#u(h),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:a.bind(this,i),undo:a.bind(this,n),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.#d()),{bbox:this.#f()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,l._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#d()),{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.#d(),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.#u(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.#r(this.#t,t)}}#l([t,s,i,r]){const{parentDimensions:[n,a],rotation:o}=this;switch(o){case 90:return[s,1-t,i*(a/n),r*(n/a)];case 180:return[1-t,1-s,i,r];case 270:return[1-s,t,i*(a/n),r*(n/a)];default:return[t,s,i,r]}}#d(){const{x:t,y:s,width:i,height:r,parentDimensions:[n,a],rotation:o}=this;switch(o){case 90:return[1-s,t,i*(n/a),r*(a/n)];case 180:return[1-t,1-s,i,r];case 270:return[s,1-t,i*(n/a),r*(a/n)];default:return[t,s,i,r]}}#u(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:i,height:r,rotation:n,parentRotation:a,parentDimensions:[o,h]}=this;switch((4*n+a)/90){case 1:return[1-s-r,t,r,i];case 2:return[1-t-i,1-s-r,i,r];case 3:return[s,1-t-i,r,i];case 4:return[t,s-i*(o/h),r*(h/o),i*(o/h)];case 5:return[1-s,t,i*(o/h),r*(h/o)];case 6:return[1-t-r*(h/o),1-s,r*(h/o),i*(o/h)];case 7:return[s-i*(o/h),1-t-r*(h/o),i*(o/h),r*(h/o)];case 8:return[t-i,s-r,i,r];case 9:return[1-s,t-i,r,i];case 10:return[1-t,1-s,i,r];case 11:return[s-r,1-t,r,i];case 12:return[t-r*(h/o),s,r*(h/o),i*(o/h)];case 13:return[1-s-i*(o/h),t-r*(h/o),i*(o/h),r*(h/o)];case 14:return[1-t,1-s-i*(o/h),r*(h/o),i*(o/h)];case 15:return[s,1-t,i*(o/h),r*(h/o)];default:return[t,s,i,r]}}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.#u(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
vendor: 18,276 bytes, line 1
1render(){if(this.div)return this.div;let t,s;this._isCopy&&(t=this.x,s=this.y);const i=super.render();i.classList.add("draw");const r=document.createElement("div");return i.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,s),i}static createDrawerInstance(t,s,i,r,n){st("Not implemented")}static startDrawing(t,s,i,r){const{target:n,offsetX:a,offsetY:o,pointerId:h,pointerType:c}=r;if(q.isInitializedAndDifferentPointerType(c))return;const{viewport:{rotation:u}}=t,{width:d,height:f}=n.getBoundingClientRect(),p=l.#s=new AbortController,g=t.combinedSignal(p);q.setPointer(c,h),window.addEventListener("pointerup",m=>{q.isSamePointerIdOrRemove(m.pointerId)&&this._endDraw(m)},{signal:g}),window.addEventListener("pointercancel",m=>{q.isSamePointerIdOrRemove(m.pointerId)&&this._currentParent.endDrawingSession()},{signal:g}),window.addEventListener("pointerdown",m=>{q.isSamePointerType(m.pointerType)&&(q.initializeAndAddPointerId(m.pointerId),l.#i.isCancellable()&&(l.#i.removeLastElement(),l.#i.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",It,{signal:g}),n.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),n.addEventListener("touchmove",m=>{q.isSameTimeStamp(m.timeStamp)&&at(m)},{signal:g}),t.toggleDrawing(),s._editorUndoBar?.hide(),l.#i?t.drawLayer.updateProperties(this._currentDrawId,l.#i.startNew(a,o,d,f,u)):(s.updateUIForDefaultProperties(this),l.#i=this.createDrawerInstance(a,o,d,f,u),l.#a=this.getDefaultDrawingOptions(),this._currentParent=t,({id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(l.#a.toSVGProperties(),l.#i.defaultSVGProperties),!0,!1)))}static _drawMove(t){if(q.isSameTimeStamp(t.timeStamp),!l.#i)return;const{offsetX:s,offsetY:i,pointerId:r}=t;if(q.isSamePointerId(r)){if(q.isUsingMultiplePointers())return void this._endDraw(t);this._currentParent.drawLayer.updateProperties(this._currentDrawId,l.#i.add(s,i)),q.setTimeStamp(t.timeStamp),at(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,l.#i=null,l.#a=null,q.clearPointerType(),q.clearTimeStamp()),l.#s&&(l.#s.abort(),l.#s=null,q.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.#i.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){const i=l.#i,r=this._currentDrawId,n=i.getLastElement();return void s.addCommands({cmd:()=>{s.drawLayer.updateProperties(r,i.setLastElement(n))},undo:()=>{s.drawLayer.updateProperties(r,i.removeLastElement())},mustExec:!1,type:_.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(t){const s=this._currentParent;if(!s)return null;if(s.toggleDrawing(!0),s.cleanUndoStack(_.DRAW_STEP),!l.#i.isEmpty()){const{pageDimensions:[i,r],scale:n}=s,a=s.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l.#i.getOutlines(i*n,r*n,n,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,i,r,n,a){st("Not implemented")}static deserialize(t,s,i){var r=()=>super.deserialize,n=this;return N(function*(){const{rawDims:{pageWidth:a,pageHeight:o,pageX:h,pageY:c}}=s.viewport,u=n.deserializeDraw(h,c,a,o,n._INNER_MARGIN,t),d=yield r().call(n,t,s,i);return d.createDrawingOptions(t),d.#n({drawOutlines:u}),d.#h(),d.onScaleChanging(),d.rotate(),d})()}serializeDraw(t){const[s,i]=this.pageTranslation,[r,n]=this.pageDimensions;return this.#t.serialize([s,i,r,n],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}return l})();class _n{#t=new Float64Array(6);#e;#i;#s;#a;#n;#r="";#o=0;#h=new Pe;#l;#d;constructor(e,t,s,i,r,n){this.#l=s,this.#d=i,this.#s=r,this.#a=n,[e,t]=this.#u(e,t);const a=this.#e=[NaN,NaN,NaN,NaN,e,t];this.#n=[e,t],this.#i=[{line:a,points:this.#n}],this.#t.set(a,0)}updateProperty(e,t){"stroke-width"===e&&(this.#a=t)}#u(e,t){return U._normalizePoint(e,t,this.#l,this.#d,this.#s)}isEmpty(){return!this.#i||0===this.#i.length}isCancellable(){return this.#n.length<=10}add(e,t){[e,t]=this.#u(e,t);const[s,i,r,n]=this.#t.subarray(2,6);return Math.hypot(this.#l*(e-r),this.#d*(t-n))<=2?null:(this.#n.push(e,t),isNaN(s)?(this.#t.set([r,n,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,i,r,n,e,t],0),this.#e.push(...U.createBezierPoints(s,i,r,n,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(2===this.#n.length?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,s,i,r){this.#l=s,this.#d=i,this.#s=r,[e,t]=this.#u(e,t);const n=this.#e=[NaN,NaN,NaN,NaN,e,t];this.#n=[e,t];const a=this.#i.at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),this.#i.push({line:n,points:this.#n}),this.#t.set(n,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#i.at(-1)}setLastElement(e){return this.#i?(this.#i.push(e),this.#e=e.line,this.#n=e.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#h.setLastElement(e)}removeLastElement(){if(!this.#i)return this.#h.removeLastElement();this.#i.pop(),this.#r="";for(let e=0,t=this.#i.length;e<t;e++){const{line:s,points:i}=this.#i[e];this.#e=s,this.#n=i,this.#o=0,this.toSVGPath()}return{path:{d:this.#r}}}toSVGPath(){const e=U.svgRound(this.#e[4]),t=U.svgRound(this.#e[5]);if(2===this.#n.length)return this.#r=`${this.#r} M ${e} ${t} Z`,this.#r;if(this.#n.length<=6){const i=this.#r.lastIndexOf("M");this.#r=`${this.#r.slice(0,i)} M ${e} ${t}`,this.#o=6}if(4===this.#n.length){const i=U.svgRound(this.#e[10]),r=U.svgRound(this.#e[11]);return this.#r=`${this.#r} L ${i} ${r}`,this.#o=12,this.#r}const s=[];0===this.#o&&(s.push(`M ${e} ${t}`),this.#o=6);for(let i=this.#o,r=this.#e.length;i<r;i+=6){const[n,a,o,h,c,u]=this.#e.slice(i,i+6).map(U.svgRound);s.push(`C${n} ${a} ${o} ${h} ${c} ${u}`)}return this.#r+=s.join(" "),this.#o=this.#e.length,this.#r}getOutlines(e,t,s,i){const r=this.#i.at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),this.#h.build(this.#i,e,t,s,this.#s,this.#a,i),this.#t=null,this.#e=null,this.#i=null,this.#r=null,this.#h}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class Pe extends U{#t;#e=0;#i;#s;#a;#n;#r;#o;#h;build(e,t,s,i,r,n,a){this.#a=t,this.#n=s,this.#r=i,this.#o=r,this.#h=n,this.#i=a??0,this.#s=e,this.#u()}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${U.svgRound(t[4])} ${U.svgRound(t[5])}`),6!==t.length)if(12===t.length&&isNaN(t[6]))e.push(`L${U.svgRound(t[10])} ${U.svgRound(t[11])}`);else for(let s=6,i=t.length;s<i;s+=6){const[r,n,a,o,h,c]=t.subarray(s,s+6).map(U.svgRound);e.push(`C${r} ${n} ${a} ${o} ${h} ${c}`)}else e.push("Z");return e.join("")}serialize([e,t,s,i],r){const n=[],a=[],[o,h,c,u]=this.#d();let d,f,p,g,m,v,y,b,E;switch(this.#o){case 0:E=U._rescale,d=e,f=t+i,p=s,g=-i,m=e+o*s,v=t+(1-h-u)*i,y=e+(o+c)*s,b=t+(1-h)*i;break;case 90:E=U._rescaleAndSwap,d=e,f=t,p=s,g=i,m=e+h*s,v=t+o*i,y=e+(h+u)*s,b=t+(o+c)*i;break;case 180:E=U._rescale,d=e+s,f=t,p=-s,g=i,m=e+(1-o-c)*s,v=t+h*i,y=e+(1-o)*s,b=t+(h+u)*i;break;case 270:E=U._rescaleAndSwap,d=e+s,f=t+i,p=-s,g=-i,m=e+(1-h-u)*s,v=t+(1-o-c)*i,y=e+(1-h)*s,b=t+(1-o)*i}for(const{line:A,points:w}of this.#s)n.push(E(A,d,f,p,g,r?new Array(A.length):null)),a.push(E(w,d,f,p,g,r?new Array(w.length):null));return{lines:n,points:a,rect:[m,v,y,b]}}static deserialize(e,t,s,i,r,{paths:{lines:n,points:a},rotation:o,thickness:h}){const c=[];let u,d,f,p,g;switch(o){case 0:g=U._rescale,u=-e/s,d=t/i+1,f=1/s,p=-1/i;break;case 90:g=U._rescaleAndSwap,u=-t/i,d=-e/s,f=1/i,p=1/s;break;case 180:g=U._rescale,u=e/s+1,d=-t/i,f=-1/s,p=1/i;break;case 270:g=U._rescaleAndSwap,u=t/i+1,d=e/s+1,f=-1/i,p=-1/s}if(!n){n=[];for(const v of a){const y=v.length;if(2===y){n.push(new Float32Array([NaN,NaN,NaN,NaN,v[0],v[1]]));continue}if(4===y){n.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));n.push(b);let[E,A,w,S]=v.subarray(0,4);b.set([NaN,NaN,NaN,NaN,E,A],0);for(let x=4;x<y;x+=2){const T=v[x],C=v[x+1];b.set(U.createBezierPoints(E,A,w,S,T,C),3*(x-2)),[E,A,w,S]=[w,S,T,C]}}}for(let v=0,y=n.length;v<y;v++)c.push({line:g(n[v].map(b=>b??NaN),u,d,f,p),points:g(a[v].map(b=>b??NaN),u,d,f,p)});const m=new this.prototype.constructor;return m.build(c,s,i,1,o,h,r),m}#l(e=this.#h){const t=this.#i+e/2*this.#r;return this.#o%180==0?[t/this.#a,t/this.#n]:[t/this.#n,t/this.#a]}#d(){const[e,t,s,i]=this.#t,[r,n]=this.#l(0);return[e+r,t+n,s-2*r,i-2*n]}#u(){const e=this.#t=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:i}of this.#s){if(i.length<=12){for(let a=4,o=i.length;a<o;a+=6)B.pointBoundingBox(i[a],i[a+1],e);continue}let r=i[4],n=i[5];for(let a=6,o=i.length;a<o;a+=6){const[h,c,u,d,f,p]=i.subarray(a,a+6);B.bezierBoundingBox(r,n,h,c,u,d,f,p,e),r=f,n=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[i,r]=this.#l(),[n,a]=[i-t,r-s],o=this.#t;return o[0]-=n,o[1]-=a,o[2]+=2*n,o[3]+=2*a,o}updateParentDimensions([e,t],s){const[i,r]=this.#l();this.#a=e,this.#n=t,this.#r=s;const[n,a]=this.#l(),o=n-i,h=a-r,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(U.svgRound).join(" ")}get defaultProperties(){const[e,t]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`}}}get rotationTransform(){const[,,e,t]=this.#t;let s=0,i=0,r=0,n=0,a=0,o=0;switch(this.#e){case 90:i=t/e,r=-e/t,a=e;break;case 180:s=-1,n=-1,a=e,o=t;break;case 270:i=-t/e,r=e/t,o=t;break;default:return""}return`matrix(${s} ${i} ${r} ${n} ${U.svgRound(a)} ${U.svgRound(o)})`}getPathResizingSVGProperties([e,t,s,i]){const[r,n]=this.#l(),[a,o,h,c]=this.#t;if(Math.abs(h-r)<=U.PRECISION||Math.abs(c-n)<=U.PRECISION){const g=e+s/2-(a+h/2),m=t+i/2-(o+c/2);return{path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:`${this.rotationTransform} translate(${g} ${m})`}}}const u=(s-2*r)/(h-2*r),d=(i-2*n)/(c-2*n),f=h/s,p=c/i;return{path:{"transform-origin":`${U.svgRound(a)} ${U.svgRound(o)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${U.svgRound(r)} ${U.svgRound(n)}) scale(${u} ${d}) translate(${U.svgRound(-r)} ${U.svgRound(-n)})`}}}getPathResizedSVGProperties([e,t,s,i]){const[r,n]=this.#l(),a=this.#t,[o,h,c,u]=a;if(a[0]=e,a[1]=t,a[2]=s,a[3]=i,Math.abs(c-r)<=U.PRECISION||Math.abs(u-n)<=U.PRECISION){const m=e+s/2-(o+c/2),v=t+i/2-(h+u/2);for(const{line:y,points:b}of this.#s)U._translate(y,m,v,y),U._translate(b,m,v,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const d=(s-2*r)/(c-2*r),f=(i-2*n)/(u-2*n),p=-d*(o+r)+e+r,g=-f*(h+n)+t+n;if(1!==d||1!==f||0!==p||0!==g)for(const{line:m,points:v}of this.#s)U._rescale(m,p,g,d,f,m),U._rescale(v,p,g,d,f,v);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],s){const[i,r]=s,n=this.#t,a=e-n[0],o=t-n[1];if(this.#a===i&&this.#n===r)for(const{line:h,points:c}of this.#s)U._translate(h,a,o,h),U._translate(c,a,o,c);else{const h=this.#a/i,c=this.#n/r;this.#a=i,this.#n=r;for(const{line:u,points:d}of this.#s)U._rescale(u,a,o,h,c,u),U._rescale(d,a,o,h,c,d);n[2]*=h,n[3]*=c}return n[0]=e,n[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${U.svgRound(e)} ${U.svgRound(t)}`}}}get defaultSVGProperties(){const e=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${U.svgRound(e[0])} ${U.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class Qe extends sr{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:$._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 Qe(this._viewParameters);return e.updateAll(this),e}}class ks extends ir{static _type="ink";static _editorType=Y.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,t){$.initialize(e,t),this._defaultDrawingOptions=new Qe(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return W(this,"typesMap",new Map([[_.INK_THICKNESS,"stroke-width"],[_.INK_COLOR,"stroke"],[_.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,s,i,r){return new _n(e,t,s,i,r,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,s,i,r,n){return Pe.deserialize(e,t,s,i,r,n)}static deserialize(e,t,s){var i=()=>super.deserialize,r=this;return N(function*(){let n=null;if(e instanceof Ms){const{data:{inkLists:o,rect:h,rotation:c,id:u,color:d,opacity:f,borderStyle:{rawWidth:p},popupRef:g,richText:m,contentsObj:v,creationDate:y,modificationDate:b},parent:{page:{pageNumber:E}}}=e;n=e={annotationType:Y.INK,color:Array.from(d),thickness:p,opacity:f,paths:{points:o},boxes:null,pageIndex:E-1,rect:h.slice(0),rotation:c,annotationElementId:u,id:u,deleted:!1,popupRef:g,richText:m,comment:v?.str||null,creationDate:y,modificationDate:b}}const a=yield i().call(r,e,t,s);return a._initialData=n,e.comment&&a.setCommentData(e),a})()}get toolbarButtons(){return this._colorPicker||=new Te(this),[["colorPicker",this._colorPicker]]}get colorType(){return _.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=ks.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:i,"stroke-opacity":r,"stroke-width":n}}=this,a=Object.assign(super.serialize(e),{color:$._colorManager.convert(i),opacity:r,thickness:n,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:i,pageIndex:r}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((n,a)=>n!==t[a])||e.thickness!==s||e.opacity!==i||e.pageIndex!==r}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 Ns extends Pe{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}class Kt{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(e,t,s,i){return i-=t,0===(s-=e)?i>0?0:4:1===s?i+6:2-i}static#i=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#s(e,t,s,i,r,n,a){const o=this.#e(s,i,r,n);for(let h=0;h<8;h++){const c=(-h+o-a+16)%8;if(0!==e[(s+this.#i[2*c])*t+(i+this.#i[2*c+1])])return c}return-1}static#a(e,t,s,i,r,n,a){const o=this.#e(s,i,r,n);for(let h=0;h<8;h++){const c=(h+o+a+16)%8;if(0!==e[(s+this.#i[2*c])*t+(i+this.#i[2*c+1])])return c}return-1}static#n(e,t,s,i){const r=e.length,n=new Int32Array(r);for(let c=0;c<r;c++)n[c]=e[c]<=i?1:0;for(let c=1;c<s-1;c++)n[c*t]=n[c*t+t-1]=0;for(let c=0;c<t;c++)n[c]=n[t*s-1-c]=0;let o,a=1;const h=[];for(let c=1;c<s-1;c++){o=1;for(let u=1;u<t-1;u++){const d=c*t+u,f=n[d];if(0===f)continue;let p=c,g=u;if(1===f&&0===n[d-1])a+=1,g-=1;else{if(!(f>=1&&0===n[d+1])){1!==f&&(o=Math.abs(f));continue}a+=1,g+=1,f>1&&(o=f)}const m=[u,c],v=g===u+1,y={isHole:v,points:m,id:a,parent:0};let b;h.push(y);for(const R of h)if(R.id===o){b=R;break}y.parent=b?b.isHole?v?b.parent:o:v?o:b.parent:v?o:0;const E=this.#s(n,t,c,u,p,g,0);if(-1===E){n[d]=-a,1!==n[d]&&(o=Math.abs(n[d]));continue}let A=this.#i[2*E],w=this.#i[2*E+1];const S=c+A,x=u+w;p=S,g=x;let T=c,C=u;for(;;){const R=this.#a(n,t,T,C,p,g,1);A=this.#i[2*R],w=this.#i[2*R+1];const M=T+A,O=C+w;m.push(O,M);const F=T*t+C;if(0===n[F+1]?n[F]=-a:1===n[F]&&(n[F]=a),M===c&&O===u&&T===S&&C===x){1!==n[d]&&(o=Math.abs(n[d]));break}p=T,g=C,T=M,C=O}}}return h}static#r(e,t,s,i){if(s-t<=4){for(let S=t;S<s-2;S+=2)i.push(e[S],e[S+1]);return}const r=e[t],n=e[t+1],a=e[s-4]-r,o=e[s-3]-n,h=Math.hypot(a,o),c=a/h,u=o/h,d=c*n-u*r,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 x=Math.abs(d-c*e[S+1]+u*e[S]);x>A&&(w=S,A=x)}A>(h*E)**2?(this.#r(e,t,w+2,i),this.#r(e,w,s,i)):i.push(r,n)}static#o(e){const t=[],s=e.length;
vendor: 5,255 bytes, line 1
1return this.#r(e,0,s,t),t.push(e[s-2],e[s-1]),t.length<=4?null:t}static#h(e,t,s,i,r,n){const a=new Float32Array(n**2),o=-2*i**2,h=n>>1;for(let g=0;g<n;g++){const m=(g-h)**2;for(let v=0;v<n;v++)a[g*n+v]=Math.exp((m+(v-h)**2)/o)}const c=new Float32Array(256),u=-2*r**2;for(let g=0;g<256;g++)c[g]=Math.exp(g**2/u);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<n;w++){const S=g+w-h;if(!(S<0||S>=s))for(let x=0;x<n;x++){const T=m+x-h;if(T<0||T>=t)continue;const C=e[S*t+T],R=a[w*n+x]*c[Math.abs(C-y)];b+=C*R,E+=R}}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#d(e){const s=new Uint8ClampedArray(e.length>>2);let i=-1/0,r=1/0;for(let a=0,o=s.length;a<o;a++){const h=s[a]=e[a<<2];i=Math.max(i,h),r=Math.min(r,h)}const n=255/(i-r);for(let a=0,o=s.length;a<o;a++)s[a]=(s[a]-r)*n;return s}static#u(e){let t,s=-1/0,i=-1/0;const r=e.findIndex(o=>0!==o);let n=r,a=r;for(t=r;t<256;t++){const o=e[t];o>s&&(t-n>i&&(i=t-n,a=t-1),s=o,n=t)}for(t=a-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){const t=e,{width:s,height:i}=e,{maxDim:r}=this.#t;let n=s,a=i;if(s>r||i>r){let d=s,f=i,p=Math.log2(Math.max(s,i)/r);const g=Math.floor(p);p=p===g?g-1:g;for(let v=0;v<p;v++){n=Math.ceil(d/2),a=Math.ceil(f/2);const y=new OffscreenCanvas(n,a);y.getContext("2d").drawImage(e,0,0,d,f,0,0,n,a),d=n,f=a,e!==t&&e.close(),e=y.transferToImageBitmap()}const m=Math.min(r/n,r/a);n=Math.round(n*m),a=Math.round(a*m)}const h=new OffscreenCanvas(n,a).getContext("2d",{willReadFrequently:!0});h.fillStyle="white",h.fillRect(0,0,n,a),h.filter="grayscale(1)",h.drawImage(e,0,0,e.width,e.height,0,0,n,a);const c=h.getImageData(0,0,n,a).data;return[this.#d(c),n,a]}static extractContoursFromText(e,{fontFamily:t,fontStyle:s,fontWeight:i},r,n,a,o){let h=new OffscreenCanvas(1,1),c=h.getContext("2d",{alpha:!1});const d=c.font=`${s} ${i} 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=d,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.#d(c.getImageData(0,0,A,w).data),x=this.#l(S),T=this.#u(x),C=this.#n(S,A,w,T);return this.processDrawnLines({lines:{curves:C,width:A,height:w},pageWidth:r,pageHeight:n,rotation:a,innerMargin:o,mustSmooth:!0,areContours:!0})}static process(e,t,s,i,r){const[n,a,o]=this.#f(e),[h,c]=this.#h(n,a,o,Math.hypot(a,o)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),u=this.#u(c),d=this.#n(h,a,o,u);return this.processDrawnLines({lines:{curves:d,width:a,height:o},pageWidth:t,pageHeight:s,rotation:i,innerMargin:r,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:s,rotation:i,innerMargin:r,mustSmooth:n,areContours:a}){i%180!=0&&([t,s]=[s,t]);const{curves:o,width:h,height:c}=e,u=e.thickness??0,d=[],f=Math.min(t/h,s/c),p=f/t,g=f/s,m=[];for(const{points:y}of o){const b=n?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(d.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,x,T,C]=b;S*=p,x*=g,T*=p,C*=g,A.set([S,x,T,C],0),w.set([NaN,NaN,NaN,NaN,S,x],0);for(let R=4;R<E;R+=2){const M=A[R]=b[R]*p,O=A[R+1]=b[R+1]*g;w.set(U.createBezierPoints(S,x,T,C,M,O),3*(R-2)),[S,x,T,C]=[T,C,M,O]}}if(0===d.length)return null;const v=a?new Ns:new Pe;return v.build(d,t,s,1,i,a?0:u,r),{outline:v,newCurves:m,areContours:a,thickness:u,width:h,height:c}}static compressSignature(e){return N(function*({outlines:t,areContours:s,thickness:i,width:r,height:n}){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 u=t.length,d=8+3*u,f=new Uint32Array(d);let p=0;f[p++]=d*Uint32Array.BYTES_PER_ELEMENT+(h-2*u)*c.BYTES_PER_ELEMENT,f[p++]=0,f[p++]=r,f[p++]=n,f[p++]=s?0:1,f[p++]=Math.max(0,Math.floor(i??0)),f[p++]=u,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 _s(new Uint8Array(y))}).apply(this,arguments)}static decompressSignature(e){return N(function*(){try{const a=function vr(l){return Uint8Array.fromBase64?Uint8Array.fromBase64(l):Jt(atob(l))}(e),{readable:o,writable:h}=new DecompressionStream("deflate-raw"),c=h.getWriter();yield c.ready,c.write(a).then(N(function*(){yield c.ready,yield c.close()})).catch(()=>{});let u=null,d=0;var i,t=!1,s=!1;try{for(var n,r=function nr(l){var e,t,s,i=2;
1for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(t&&null!=(e=l[t]))return e.call(l);if(s&&null!=(e=l[s]))return new De(e.call(l));t="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}(o);t=!(n=yield r.next()).done;t=!1){const x=n.value;u||=new Uint8Array(new Uint32Array(x.buffer,0,4)[0]),u.set(x,d),d+=x.length}}catch(x){s=!0,i=x}finally{try{t&&null!=r.return&&(yield r.return())}finally{if(s)throw i}}const f=new Uint32Array(u.buffer,0,u.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(u.buffer,w);break;case Int16Array.BYTES_PER_ELEMENT:S=new Int16Array(u.buffer,w);break;case Int32Array.BYTES_PER_ELEMENT:S=new Int32Array(u.buffer,w)}d=0;for(let x=0;x<b;x++){const T=f[3*x+8],C=new Float32Array(T+2);A.push(C);for(let R=0;R<2;R++)C[R]=f[3*x+8+R+1];for(let R=0;R<T;R++)C[R+2]=C[R]+S[d++]}return{areContours:v,thickness:y,outlines:A,width:g,height:m}}
vendor: 4,750 bytes, line 1
1catch(a){return V(`decompressSignature: ${a}`),null}})()}}class Bs extends sr{constructor(){super(),super.updateProperties({fill:$._defaultLineColor,"stroke-width":0})}clone(){const e=new Bs;return e.updateAll(this),e}}class Us extends Qe{constructor(e){super(e),super.updateProperties({stroke:$._defaultLineColor,"stroke-width":1})}clone(){const e=new Us(this._viewParameters);return e.updateAll(this),e}}class Ut extends ir{#t=!1;#e=null;#i=null;#s=null;static _type="signature";static _editorType=Y.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#i=e.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,t){$.initialize(e,t),this._defaultDrawingOptions=new Bs,this._defaultDrawnSignatureOptions=new Us(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return W(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.#i){const{lines:i,mustSmooth:r,areContours:n,description:a,uuid:o,heightInPage:h}=this.#i,{rawDims:{pageWidth:c,pageHeight:u},rotation:d}=this.parent.viewport,f=Kt.processDrawnLines({lines:i,pageWidth:c,pageHeight:u,rotation:d,innerMargin:Ut._INNER_MARGIN,mustSmooth:r,areContours:n});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:i,height:r}=this.#i,n=Math.max(i,r);return{areContours:t,outline:Kt.processDrawnLines({lines:{curves:e.map(o=>({points:o})),thickness:s,width:i,height:r},pageWidth:n,pageHeight:n,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,i){const{x:r,y:n}=this,{outline:a}=this.#i=e;let o;this.#t=a instanceof Ns,this.description=s,this.#t?o=Ut.getDefaultDrawingOptions():(o=Ut._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=r,this.y=n,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:t,pageHeight:s},rotation:i}=this.parent.viewport;return Kt.process(e,t,s,i,Ut._INNER_MARGIN)}getFromText(e,t){const{rawDims:{pageWidth:s,pageHeight:i},rotation:r}=this.parent.viewport;return Kt.extractContoursFromText(e,t,s,i,r,Ut._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:t,pageHeight:s},rotation:i}=this.parent.viewport;return Kt.processDrawnLines({lines:e,pageWidth:t,pageHeight:s,rotation:i,innerMargin:Ut._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:t}){e?this._drawingOptions=Ut.getDefaultDrawingOptions():(this._drawingOptions=Ut._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":i}}=this,r=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:i});return this.addComment(r),e?(r.paths={lines:t,points:s},r.uuid=this.#s,r.isCopy=!0):r.lines=t,this.#e&&(r.accessibilityData={type:"Figure",alt:this.#e}),r}
1static deserializeDraw(e,t,s,i,r,n){return n.areContours?Ns.deserialize(e,t,s,i,r,n):Pe.deserialize(e,t,s,i,r,n)}static deserialize(e,t,s){var i=()=>super.deserialize,r=this;return N(function*(){const n=yield i().call(r,e,t,s);return n.#t=e.areContours,n.description=e.accessibilityData?.alt||"",n.#s=e.uuid,n})()}}class Qn extends ${#t=null;#e=null;#i=null;#s=null;#a=null;#n="";#r=null;#o=!1;#h=null;#l=!1;#d=!1;static _type="stamp";static _editorType=Y.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){$.initialize(e,t)}static isHandlingMimeForPasting(e){return Ue.includes(e)}static paste(e,t){t.pasteEditor({mode:Y.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}}#u(e,t=!1){e?(this.#t=e.bitmap,t||(this.#e=e.id,this.#l=e.isSvg),e.file&&(this.#n=e.file.name),this.#g()):this.remove()}#f(){if(this.#i=null,this._uiManager.enableWaiting(!1),this.#r){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 N(function*(t=null,s=!0){if(e.hasAltTextData())return null;const{mlManager:i}=e._uiManager;if(!i)throw new Error("No ML.");if(!(yield i.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");const{data:r,width:n,height:a}=t||e.copyCanvas(null,null,!0).imageData,o=yield i.guess({name:"altText",request:{data:r,width:n,height:a,channels:r.length/(n*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(i=>this.#u(i,!0)).finally(()=>this.#f());if(this.#s){const i=this.#s;return this.#s=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromUrl(i).then(r=>this.#u(r)).finally(()=>this.#f()))}if(this.#a){const i=this.#a;return this.#a=null,this._uiManager.enableWaiting(!0),void(this.#i=this._uiManager.imageManager.getFromFile(i).then(r=>this.#u(r)).finally(()=>this.#f()))}const t=document.createElement("input");t.type="file",t.accept=Ue.join(",");const s=this._uiManager._signal;this.#i=new Promise(i=>{t.addEventListener("change",N(function*(){if(t.files&&0!==t.files.length){e._uiManager.enableWaiting(!0);const r=yield e._uiManager.imageManager.getFromFile(t.files[0]);e._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:e._uiManager.useNewAltTextFlow}}),e.#u(r)}else e.remove();i()}),{signal:s}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:s})}).finally(()=>this.#f()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#r?.remove(),this.#r=null,this.#h&&(clearTimeout(this.#h),this.#h=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#e&&null===this.#r&&this.#m(),this.isAttachedToDOM||this.parent.add(this))):this.#e&&this.#m()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#i||this.#t||this.#s||this.#a||this.#e||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}
vendor: 4,146 bytes, line 1
1render(){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:i}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(this.#e=s,i&&(this.#t=i),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[i,r]=this.pageDimensions,n=.75;if(this.width)t=this.width*i,s=this.height*r;else if(t>n*i||s>n*r){const o=Math.min(n*i/t,n*r/s);t*=o,s*=o}this._uiManager.enableWaiting(!1);const a=this.#r=document.createElement("canvas");a.setAttribute("role","img"),this.addContainer(a),this.width=t/i,this.height=s/r,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.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#n&&this.div.setAttribute("aria-description",this.#n),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,t,s=!1){e||(e=224);const{width:i,height:r}=this.#t,n=new kt;let a=this.#t,o=i,h=r,c=null;if(t){if(i>t||r>t){const w=Math.min(t/i,t/r);o=Math.floor(i*w),h=Math.floor(r*w)}c=document.createElement("canvas");const d=c.width=Math.ceil(o*n.sx),f=c.height=Math.ceil(h*n.sy);this.#l||(a=this.#c(d,f));const p=c.getContext("2d");p.filter=this._uiManager.hcmFilter;let g="white",m="#cfcfd8";"none"!==this._uiManager.hcmFilter?m="black":Ar.isDarkMode&&(g="#8f8f9d",m="#42414d");const v=15,y=v*n.sx,b=v*n.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,d,f),p.drawImage(a,0,0,a.width,a.height,0,0,d,f)}let u=null;if(s){let d,f;if(n.symmetric&&a.width<e&&a.height<e)d=a.width,f=a.height;else if(a=this.#t,i>e||r>e){const m=Math.min(e/i,e/r);d=Math.floor(i*m),f=Math.floor(r*m),this.#l||(a=this.#c(d,f))}const g=new OffscreenCanvas(d,f).getContext("2d",{willReadFrequently:!0});g.drawImage(a,0,0,a.width,a.height,0,0,d,f),u={width:d,height:f,data:g.getImageData(0,0,d,f).data}}return{canvas:c,width:o,height:h,imageData:u}}#c(e,t){const{width:s,height:i}=this.#t;let r=s,n=i,a=this.#t;for(;r>2*e||n>2*t;){const o=r,h=n;r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2));const c=new OffscreenCanvas(r,n);c.getContext("2d").drawImage(a,0,0,o,h,0,0,r,n),a=c.transferToImageBitmap()}return a}#p(){const[e,t]=this.parentDimensions,{width:s,height:i}=this,r=new kt,n=Math.ceil(s*e*r.sx),a=Math.ceil(i*t*r.sy),o=this.#r;if(!o||o.width===n&&o.height===a)return;o.width=n,o.height=a;const h=this.#l?this.#t:this.#c(n,a),c=o.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(h,0,0,h.width,h.height,0,0,n,a)}#v(e){if(e){if(this.#l){const i=this._uiManager.imageManager.getSvgUrl(this.#e);if(i)return i}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,i=Math.round(this.width*t*Vt.PDF_TO_CSS_UNITS),r=Math.round(this.height*s*Vt.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(i,r);return n.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,i,r),n.transferToImageBitmap()}return structuredClone(this.#t)}static deserialize(e,t,s){var i=()=>super.deserialize,r=this;return N(function*(){let n=null,a=!1;if(e instanceof tr){const{data:{rect:v,rotation:y,id:b,structParent:E,popupRef:A,richText:w,contentsObj:S,creationDate:x,modificationDate:T},container:C,parent:{page:{pageNumber:R}},canvas:M}=e;let O,F;
1M?(delete e.canvas,({id:O,bitmap:F}=s.imageManager.getFromCanvas(C.id,M)),M.remove()):(a=!0,e._hasNoCanvas=!0);const j=(yield t._structTree.getAriaAttributes(`${Zt}${b}`))?.get("aria-label")||"";n=e={annotationType:Y.STAMP,bitmapId:O,bitmap:F,pageIndex:R-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:x,modificationDate:T}}const o=yield i().call(r,e,t,s),{rect:h,bitmap:c,bitmapUrl:u,bitmapId:d,isSvg:f,accessibilityData:p}=e;a?(s.addMissingCanvas(e.id,o),o.#o=!0):d&&s.imageManager.isValidId(d)?(o.#e=d,c&&(o.#t=c)):o.#s=u,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=n,e.comment&&o.setCommentData(e),o.#d=!!n,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:i,altText:r}=this.serializeAltText(!1);if(!i&&r&&(s.accessibilityData={type:"Figure",alt:r}),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 n=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);n>a.area&&(a.area=n,a.serialized.bitmap.close(),a.serialized.bitmap=this.#v(!1))}}else t.stamps.set(this.#e,{area:n,serialized:s}),s.bitmap=this.#v(!1);return s}#b(e){const{pageIndex:t,accessibilityData:{altText:s}}=this._initialData,i=e.pageIndex===t,r=(e.accessibilityData?.alt||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&r,isSameAltText:r}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}let rr=(()=>{class l{#t;#e=!1;#i=null;#s=null;#a=null;#n=new Map;#r=!1;#o=!1;#h=!1;#l=null;#d=null;#u=null;#f=null;#m=null;#g=-1;#c;static _initialized=!1;static#p=new Map([mt,ks,Qn,ct,Ut].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:s,div:i,structTreeLayer:r,accessibilityManager:n,annotationLayer:a,drawLayer:o,textLayer:h,viewport:c,l10n:u}){const d=[...l.#p.values()];if(!l._initialized){l._initialized=!0;for(const f of d)f.initialize(u,t)}t.registerEditorTypes(d),this.#c=t,this.pageIndex=s,this.div=i,this.#t=n,this.#i=a,this.viewport=c,this.#u=h,this.drawLayer=o,this._structTree=r,this.#c.addLayer(this)}get isEmpty(){return 0===this.#n.size}get isInvisible(){return this.isEmpty&&this.#c.getMode()===Y.NONE}updateToolbar(t){this.#c.updateToolbar(t)}updateMode(t=this.#c.getMode()){switch(this.#w(),t){case Y.NONE:return this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case Y.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Y.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===Y.POPUP)s.toggle("commentEditing",!0);else{s.toggle("commentEditing",!1);for(const i of l.#p.values())s.toggle(`${i._type}Editing`,t===i._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#u?.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.#i?.togglePointerEvents(t)}get#v(){return 0!==this.#n.size?this.#n.values():this.#c.getEditors(this.pageIndex)}enable(){var t=this;return N(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 r of t.#v)r.enableEditing(),r.show(!0),r.annotationElementId&&(t.#c.removeChangedExistingAnnotation(r),s.add(r.annotationElementId));const i=t.#i;if(i)for(const r of i.getEditableAnnotations()){if(r.hide(),t.#c.isDeletedAnnotationElement(r.data.id)||s.has(r.data.id))continue;const n=yield t.deserialize(r);n&&(t.addOrRebuild(n),n.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.#u&&!this.#m){this.#m=new AbortController;const r=this.#c.combinedSignal(this.#m);this.#u.div.addEventListener("pointerdown",n=>{const{clientX:o,clientY:h,timeStamp:c}=n;if(c-this.#g>500)return void(this.#g=c);this.#g=-1;const{classList:d}=this.div;d.toggle("getElements",!0);const f=document.elementsFromPoint(o,h);if(d.toggle("getElements",!1),!this.div.contains(f[0]))return;let p;const g=new RegExp(`^${he}[0-9]+$`);for(const v of f)if(g.test(v.id)){p=v.id;break}if(!p)return;const m=this.#n.get(p);null===m?.annotationElementId&&(n.stopPropagation(),n.preventDefault(),m.dblclick(n))},{signal:r,capture:!0})}const t=this.#i,s=[];if(t){const r=new Map,n=new Map;for(const o of this.#v)o.disableEditing(),o.annotationElementId?null===o.serialize()?(n.set(o.annotationElementId,o),this.getEditableAnnotation(o.annotationElementId)?.show(),o.remove()):r.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,067 bytes, line 1
1);continue}let c=n.get(h);c?(c.resetAnnotationElement(o),c.show(!1),o.show()):(c=r.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:i}=this.div;for(const r of l.#p.values())i.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(s),this.#o=!1}getEditableAnnotation(t){return this.#i?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#c.getActive()!==t&&this.#c.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#u?.div&&!this.#f){this.#f=new AbortController;const t=this.#c.combinedSignal(this.#f);this.#u.div.addEventListener("pointerdown",this.#b.bind(this),{signal:t}),this.#u.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#u?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#u.div.classList.remove("highlighting"))}#b(t){this.#c.unselectAll();const{target:s}=t;if(s===this.#u.div||("img"===s.getAttribute("role")||s.classList.contains("endOfContent"))&&this.#u.div.contains(s)){const{isMac:i}=ft.platform;if(0!==t.button||t.ctrlKey&&i)return;this.#c.showAllEditors("highlight",!0,!0),this.#u.div.classList.add("free"),this.toggleDrawing(),ct.startHighlighting(this,"ltr"===this.#c.direction,{target:this.#u.div,x:t.x,y:t.y}),this.#u.div.addEventListener("pointerup",()=>{this.#u.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.#n.set(t.id,t);const{annotationElementId:s}=t;s&&this.#c.isDeletedAnnotationElement(s)&&this.#c.removeDeletedAnnotationElement(t)}detach(t){this.#n.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),$.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.#n.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 i=this;return N(function*(){i.updateToolbar(t),yield i.#c.updateMode(t.mode);const{offsetX:r,offsetY:n}=i.#S(),a=i.getNextId(),o=i.#T({parent:i,id:a,x:r,y:n,uiManager:i.#c,isCentered:!0,...s});o&&i.add(o)})()}deserialize(t){var s=this;return N(function*(){return(yield l.#p.get(t.annotationType??t.annotationEditorType)?.deserialize(t,s,s.#c))||null})()}createAndAddNewEditor(t,s,i={}){const r=this.getNextId(),n=this.#T({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#c,isCentered:s,...i});return n&&this.add(n),n}get boundingClientRect(){return this.div.getBoundingClientRect()}#S(){const{x:t,y:s,width:i,height:r}=this.boundingClientRect,n=Math.max(0,t),a=Math.max(0,s),c=(n+Math.min(window.innerWidth,t+i))/2-t,u=(a+Math.min(window.innerHeight,s+r))/2-s,[d,f]=this.viewport.rotation%180==0?[c,u]:[u,c];return{offsetX:d,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}=ft.platform;if(0!==t.button||t.ctrlKey&&s||t.target!==this.div||!this.#r||(this.#r=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#e)return void(this.#e=!0);const i=this.#c.getMode();i!==Y.STAMP&&i!==Y.SIGNATURE?this.createAndAddNewEditor(t,!1):this.#c.unselectAll()}pointerdown(t){if(this.#c.getMode()===Y.HIGHLIGHT&&this.enableTextSelection(),this.#r)return void(this.#r=!1);const{isMac:s}=ft.platform;if(0!==t.button||t.ctrlKey&&s||t.target!==this.div)return;if(this.#r=!0,this.#y?.isDrawer)return void this.startDrawingSession(t);const i=this.#c.getActive();this.#e=!i||i.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:i})=>{i&&!this.div.contains(i)&&(this.#d=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.#d=s))}this.#d&&setTimeout(()=>{this.#d?.focus(),this.#d=null},0)}endDrawingSession(t=!1){return this.#l?(this.#c.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#d=null,this.#y.endDrawing(t)):null}findNewParent(t,s,i){const r=this.#c.findParent(s,i);return null!==r&&r!==this&&(r.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.#n.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#n.clear(),this.#c.removeLayer(this)}#w(){for(const t of this.#n.values())t.isEmpty()&&t.remove()}render({viewport:t}){this.viewport=t,Gt(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,i=t.rotation;if(this.viewport=t,Gt(this.div,{rotation:i}),s!==i)for(const r of this.#n.values())r.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:s}=this.viewport.rawDims;return[t,s]}get scale(){return this.#c.viewParameters.realScale}}return l})();class vt{#t=null;#e=new Map;#i=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 W(this,"_svgFactory",new Re)}static#a(e,[t,s,i,r]){const{style:n}=e;n.top=100*s+"%",n.left=100*t+"%",n.width=100*i+"%",n.height=100*r+"%"}#n(){const e=vt._svgFactory.create(1,1,!0);return this.#t.append(e),e.setAttribute("aria-hidden",!0),e}#r(e,t){const s=vt._svgFactory.createElement("clipPath");e.append(s);const i=`clip_${t}`;s.setAttribute("id",i),s.setAttribute("clipPathUnits","objectBoundingBox");const r=vt._svgFactory.createElement("use");return s.append(r),r.setAttribute("href",`#${t}`),r.classList.add("clip"),i}#o(e,t){for(const[s,i]of Object.entries(t))null===i?e.removeAttribute(s):e.setAttribute(s,i)}draw(e,t=!1,s=!1){const i=vt.#s++,r=this.#n(),n=vt._svgFactory.createElement("defs");r.append(n);const a=vt._svgFactory.createElement("path");n.append(a);const o=`path_p${this.pageIndex}_${i}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#i.set(i,a);const h=s?this.#r(n,o):null,c=vt._svgFactory.createElement("use");return r.append(c),c.setAttribute("href",`#${o}`),this.updateProperties(r,e),this.#e.set(i,r),{id:i,clipPathId:`url(#${h})`}}drawOutline(e,t){const s=vt.#s++,i=this.#n(),r=vt._svgFactory.createElement("defs");i.append(r);const n=vt._svgFactory.createElement("path");r.append(n);const a=`path_p${this.pageIndex}_${s}`;let o;if(n.setAttribute("id",a),n.setAttribute("vector-effect","non-scaling-stroke"),t){const u=vt._svgFactory.createElement("mask");r.append(u),o=`mask_p${this.pageIndex}_${s}`,u.setAttribute("id",o),u.setAttribute("maskUnits","objectBoundingBox");const d=vt._svgFactory.createElement("rect");u.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");const f=vt._svgFactory.createElement("use");u.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=vt._svgFactory.createElement("use");i.append(h),h.setAttribute("href",`#${a}`),o&&h.setAttribute("mask",`url(#${o})`);const c=h.cloneNode();return i.append(c),h.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(i,e),this.#e.set(s,i),s}finalizeDraw(e,t){this.#i.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;const{root:s,bbox:i,rootClass:r,path:n}=t,a="number"==typeof e?this.#e.get(e):e;if(a){if(s&&this.#o(a,s),i&&vt.#a(a,i),r){const{classList:o}=a;
1for(const[h,c]of Object.entries(r))o.toggle(h,c)}n&&this.#o(a.firstElementChild.firstElementChild,n)}}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.#i.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.#i.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:Ls},globalThis.pdfjsLib={AbortException:jt,AnnotationEditorLayer:rr,AnnotationEditorParamsType:_,AnnotationEditorType:Y,AnnotationEditorUIManager:ee,AnnotationLayer:Ke,AnnotationMode:Ht,AnnotationType:ht,applyOpacity:ei,build:Yi,ColorPicker:Ot,createValidAbsoluteUrl:rs,CSSConstants:ti,DOMSVGFactory:Re,DrawLayer:vt,FeatureTest:ft,fetchData:qt,findContrastColor:ai,getDocument:Wi,getFilenameFromUrl:Qs,getPdfFilenameFromUrl:Js,getRGB:te,getUuid:ls,getXfaPageViewport:qs,GlobalWorkerOptions:ne,ImageKind:ce,InvalidPDFException:Le,isDataScheme:me,isPdfFile:Ne,isValidExplicitDest:gi,MathClamp:Et,noContextMenu:It,normalizeUnicode:Ks,OPS:Qt,OutputScale:kt,PasswordResponses:Vs,PDFDataRangeTransport:Ps,PDFDateString:Be,PDFWorker:gt,PermissionFlag:zs,PixelsPerInch:Vt,RenderingCancelledException:ke,renderRichText:ds,ResponseException:fe,setLayerDimensions:Gt,shadow:W,SignatureExtractor:Kt,stopEvent:at,SupportedImageMimeTypes:Ue,TextLayer:St,TouchManager:Ae,updateUrlHash:ns,Util:B,VerbosityLevel:ue,version:Xi,XfaLayer:hs},ts.d(qe,["AnnotationEditorParamsType",0,_,"AnnotationEditorType",0,Y,"AnnotationMode",0,Ht,"AnnotationType",0,ht,"ImageKind",0,ce,"OPS",0,Qt,"PasswordResponses",0,Vs,"PermissionFlag",0,zs,"SupportedImageMimeTypes",0,Ue,"VerbosityLevel",0,ue,"build",0,Yi,"isValidExplicitDest",0,gi,"version",0,Xi])}}]);
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.