PageSourceSearch

https://maxatma.vercel.app/_next/static/chunks/51fb665c.2615c59750fd9b0d.js

js maxatma.vercel.app collected 2026-10-03 07:19:05 UTC 361,992 bytes, 2 lines download raw bytes

1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="6d8ba94e-1749-455b-abdf-3fbd6564b087",t._sentryDebugIdIdentifier="sentry-dbid-6d8ba94e-1749-455b-abdf-3fbd6564b087")}catch(t){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{92488:function(t,e,i){i.a(t,async function(t,r){try{i.r(e),i.d(e,{AbortException:function(){return f},AnnotationEditorLayer:function(){return m},AnnotationEditorParamsType:function(){return b},AnnotationEditorType:function(){return v},AnnotationEditorUIManager:function(){return A},AnnotationLayer:function(){return y},AnnotationMode:function(){return _},CMapCompressionType:function(){return E},ColorPicker:function(){return w},DOMSVGFactory:function(){return x},DrawLayer:function(){return T},FeatureTest:function(){return S},GlobalWorkerOptions:function(){return C},ImageKind:function(){return M},InvalidPDFException:function(){return R},MissingPDFException:function(){return P},OPS:function(){return I},Outliner:function(){return k},PDFDataRangeTransport:function(){return L},PDFDateString:function(){return D},PDFWorker:function(){return F},PasswordResponses:function(){return O},PermissionFlag:function(){return N},PixelsPerInch:function(){return B},RenderingCancelledException:function(){return U},UnexpectedResponseException:function(){return H},Util:function(){return z},VerbosityLevel:function(){return j},XfaLayer:function(){return $},build:function(){return V},createValidAbsoluteUrl:function(){return G},fetchData:function(){return W},getDocument:function(){return q},getFilenameFromUrl:function(){return K},getPdfFilenameFromUrl:function(){return X},getXfaPageViewport:function(){return Y},isDataScheme:function(){return J},isPdfFile:function(){return Q},noContextMenu:function(){return Z},normalizeUnicode:function(){return tt},renderTextLayer:function(){return te},setLayerDimensions:function(){return ti},shadow:function(){return tr},updateTextLayer:function(){return ts},version:function(){return tn}});var s,n,a,o,l,h=i(82957).lW,d=i(40257),c={9306:(t,e,i)=>{var r=i(4901),s=i(6823),n=TypeError;t.exports=function(t){if(r(t))return t;throw new n(s(t)+" is not a function")}},3506:(t,e,i)=>{var r=i(3925),s=String,n=TypeError;t.exports=function(t){if(r(t))return t;throw new n("Can't set "+s(t)+" as a prototype")}},7080:(t,e,i)=>{var r=i(4402).has;t.exports=function(t){return r(t),t}},679:(t,e,i)=>{var r=i(1625),s=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new s("Incorrect invocation")}},8551:(t,e,i)=>{var r=i(34),s=String,n=TypeError;t.exports=function(t){if(r(t))return t;throw new n(s(t)+" is not an object")}},7811:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7394:(t,e,i)=>{var r=i(6706),s=i(4576),n=TypeError;t.exports=r(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw new n("ArrayBuffer expected");return t.byteLength}},3238:(t,e,i)=>{var r=i(9504),s=i(7394),n=r(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==s(t))return!1;try{return n(t,0,0),!1}catch(t){return!0}}},5636:(t,e,i)=>{var r=i(4475),s=i(9504),n=i(6706),a=i(7696),o=i(3238),l=i(7394),h=i(4483),d=i(1548),c=r.structuredClone,u=r.ArrayBuffer,p=r.DataView,g=r.TypeError,f=Math.min,m=u.prototype,b=p.prototype,v=s(m.slice),A=n(m,"resizable","get"),y=n(m,"maxByteLength","get"),_=s(b.getInt8),E=s(b.setInt8);t.exports=(d||h)&&function(t,e,i){var r,s=l(t),n=void 0===e?s:a(e),m=!A||!A(t);if(o(t))throw new g("ArrayBuffer is detached");if(d&&(t=c(t,{transfer:[t]}),s===n&&(i||m)))return t;if(s>=n&&(!i||m))r=v(t,0,n);else{var b=i&&!m&&y?{maxByteLength:y(t)}:void 0;r=new u(n,b);for(var w=new p(t),x=new p(r),T=f(n,s),S=0;S<T;S++)E(x,S,_(w,S))}return d||h(t),r}},4644:(t,e,i)=>{var r,s,n,a=i(7811),o=i(3724),l=i(4475),h=i(4901),d=i(34),c=i(9297),u=i(6955),p=i(6823),g=i(6699),f=i(6840),m=i(2106),b=i(1625),v=i(2787),A=i(2967),y=i(8227),_=i(3392),E=i(1181),w=E.enforce,x=E.get,T=l.Int8Array,S=T&&T.prototype,C=l.Uint8ClampedArray,M=C&&C.prototype,R=T&&v(T),P=S&&v(S),I=Object.prototype,k=l.TypeError,L=y("toStringTag"),D=_("TYPED_ARRAY_TAG"),F="TypedArrayConstructor",O=a&&!!A&&"Opera"!==u(l.opera),N=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},H=function(t){var e=v(t);if(d(e)){var i=x(e);return i&&c(i,F)?i[F]:H(e)}},z=function(t){if(!d(t))return!1;var e=u(t);return c(B,e)||c(U,e)};for(r in B)(n=(s=l[r])&&s.prototype)?w(n)[F]=s:O=!1;for(r in U)(n=(s=l[r])&&s.prototype)&&(w(n)[F]=s);if((!O||!h(R)||R===Function.prototype)&&(R=function(){throw new k("Incorrect invocation")},O))for(r in B)l[r]&&A(l[r],R);if((!O||!P||P===I)&&(P=R.prototype,O))for(r in B)l[r]&&A(l[r].prototype,P);if(O&&v(M)!==P&&A(M,P),o&&!c(P,L))for(r in N=!0,m(P,L,{configurable:!0,get:function(){return d(this)?this[D]:void 0}}),B)l[r]&&g(l[r],D,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:N&&D,aTypedArray:function(t){if(z(t))return t;throw new k("Target is not a typed array")},aTypedArrayConstructor:function(t){if(h(t)&&(!A||b(R,t)))return t;throw new k(p(t)+" is not a typed array constructor")}
1,exportTypedArrayMethod:function(t,e,i,r){if(o){if(i)for(var s in B){var n=l[s];if(n&&c(n.prototype,t))try{delete n.prototype[t]}catch(i){try{n.prototype[t]=e}catch(t){}}}(!P[t]||i)&&f(P,t,i?e:O&&S[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,i){var r,s;if(o){if(A){if(i){for(r in B)if((s=l[r])&&c(s,t))try{delete s[t]}catch(t){}}if(R[t]&&!i)return;try{return f(R,t,i?e:O&&R[t]||e)}catch(t){}}for(r in B)(s=l[r])&&(!s[t]||i)&&f(s,t,e)}},getTypedArrayConstructor:H,isView:function(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||c(B,e)||c(U,e)},isTypedArray:z,TypedArray:R,TypedArrayPrototype:P}},5370:(t,e,i)=>{var r=i(6198);t.exports=function(t,e,i){for(var s=0,n=arguments.length>2?i:r(e),a=new t(n);n>s;)a[s]=e[s++];return a}},9617:(t,e,i)=>{var r=i(5397),s=i(5610),n=i(6198),a=function(t){return function(e,i,a){var o,l=r(e),h=n(l);if(0===h)return!t&&-1;var d=s(a,h);if(t&&i!=i){for(;h>d;)if((o=l[d++])!=o)return!0}else for(;h>d;d++)if((t||d in l)&&l[d]===i)return t||d||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},4527:(t,e,i)=>{var r=i(3724),s=i(4376),n=TypeError,a=Object.getOwnPropertyDescriptor,o=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=o?function(t,e){if(s(t)&&!a(t,"length").writable)throw new n("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},7628:(t,e,i)=>{var r=i(6198);t.exports=function(t,e){for(var i=r(t),s=new e(i),n=0;n<i;n++)s[n]=t[i-n-1];return s}},9928:(t,e,i)=>{var r=i(6198),s=i(1291),n=RangeError;t.exports=function(t,e,i,a){var o=r(t),l=s(i),h=l<0?o+l:l;if(h>=o||h<0)throw new n("Incorrect index");for(var d=new e(o),c=0;c<o;c++)d[c]=c===h?a:t[c];return d}},6319:(t,e,i)=>{var r=i(8551),s=i(9539);t.exports=function(t,e,i,n){try{return n?e(r(i)[0],i[1]):e(i)}catch(e){s(t,"throw",e)}}},4576:(t,e,i)=>{var r=i(9504),s=r({}.toString),n=r("".slice);t.exports=function(t){return n(s(t),8,-1)}},6955:(t,e,i)=>{var r=i(2140),s=i(4901),n=i(4576),a=i(8227)("toStringTag"),o=Object,l="Arguments"===n(function(){return arguments}()),h=function(t,e){try{return t[e]}catch(t){}};t.exports=r?n:function(t){var e,i,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=h(e=o(t),a))?i:l?n(e):"Object"===(r=n(e))&&s(e.callee)?"Arguments":r}},7740:(t,e,i)=>{var r=i(9297),s=i(5031),n=i(7347),a=i(4913);t.exports=function(t,e,i){for(var o=s(e),l=a.f,h=n.f,d=0;d<o.length;d++){var c=o[d];r(t,c)||i&&r(i,c)||l(t,c,h(e,c))}}},2211:(t,e,i)=>{var r=i(9039);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},2529:t=>{t.exports=function(t,e){return{value:t,done:e}}},6699:(t,e,i)=>{var r=i(3724),s=i(4913),n=i(6980);t.exports=r?function(t,e,i){return s.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},6980:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},4659:(t,e,i)=>{var r=i(3724),s=i(4913),n=i(6980);t.exports=function(t,e,i){r?s.f(t,e,n(0,i)):t[e]=i}},2106:(t,e,i)=>{var r=i(283),s=i(4913);t.exports=function(t,e,i){return i.get&&r(i.get,e,{getter:!0}),i.set&&r(i.set,e,{setter:!0}),s.f(t,e,i)}},6840:(t,e,i)=>{var r=i(4901),s=i(4913),n=i(283),a=i(9433);t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,h=void 0!==o.name?o.name:e;if(r(i)&&n(i,h,o),o.global)l?t[e]=i:a(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:s.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},6279:(t,e,i)=>{var r=i(6840);t.exports=function(t,e,i){for(var s in e)r(t,s,e[s],i);return t}},9433:(t,e,i)=>{var r=i(4475),s=Object.defineProperty;t.exports=function(t,e){try{s(r,t,{value:e,configurable:!0,writable:!0})}catch(i){r[t]=e}return e}},3724:(t,e,i)=>{var r=i(9039);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4483:(t,e,i)=>{var r,s,n,a,o=i(4475),l=i(9714),h=i(1548),d=o.structuredClone,c=o.ArrayBuffer,u=o.MessageChannel,p=!1;if(h)p=function(t){d(t,{transfer:[t]})};else if(c)try{!u&&(r=l("worker_threads"))&&(u=r.MessageChannel),u&&(s=new u,n=new c(2),a=function(t){s.port1.postMessage(null,[t])},2===n.byteLength&&(a(n),0===n.byteLength&&(p=a)))}catch(t){}t.exports=p},4055:(t,e,i)=>{var r=i(4475),s=i(34),n=r.document,a=s(n)&&s(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}},6837:t=>{var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},5002:t=>{t.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}
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}}},7290:(t,e,i)=>{var r=i(516),s=i(9088);t.exports=!r&&!s&&"object"==typeof window&&"object"==typeof document},516:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},9088:(t,e,i)=>{var r=i(4475),s=i(4576);t.exports="process"===s(r.process)},9392:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7388:(t,e,i)=>{var r,s,n=i(4475),a=i(9392),o=n.process,l=n.Deno,h=o&&o.versions||l&&l.version,d=h&&h.v8;d&&(s=(r=d.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!s&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(s=+r[1]),t.exports=s},8727:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:(t,e,i)=>{var r,s=i(9504),n=Error,a=s("".replace),o=(r="zxcasd",String(new n(r).stack)),l=/\n\s*at [^:]*:[^\n]*/,h=l.test(o);t.exports=function(t,e){if(h&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=a(t,l,"");return t}},6518:(t,e,i)=>{var r=i(4475),s=i(7347).f,n=i(6699),a=i(6840),o=i(9433),l=i(7740),h=i(2796);t.exports=function(t,e){var i,d,c,u,p,g=t.target,f=t.global,m=t.stat;if(i=f?r:m?r[g]||o(g,{}):r[g]&&r[g].prototype)for(d in e){if(u=e[d],c=t.dontCallGetSet?(p=s(i,d))&&p.value:i[d],!h(f?d:g+(m?".":"#")+d,t.forced)&&void 0!==c){if(typeof u==typeof c)continue;l(u,c)}(t.sham||c&&c.sham)&&n(u,"sham",!0),a(i,d,u,t)}}},9039:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6080:(t,e,i)=>{var r=i(7476),s=i(9306),n=i(616),a=r(r.bind);t.exports=function(t,e){return s(t),void 0===e?t:n?a(t,e):function(){return t.apply(e,arguments)}}},616:(t,e,i)=>{var r=i(9039);t.exports=!r(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},9565:(t,e,i)=>{var r=i(616),s=Function.prototype.call;t.exports=r?s.bind(s):function(){return s.apply(s,arguments)}},350:(t,e,i)=>{var r=i(3724),s=i(9297),n=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,o=s(n,"name"),l=o&&(!r||r&&a(n,"name").configurable);t.exports={EXISTS:o,PROPER:o&&"something"===(function(){}).name,CONFIGURABLE:l}},6706:(t,e,i)=>{var r=i(9504),s=i(9306);t.exports=function(t,e,i){try{return r(s(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}},7476:(t,e,i)=>{var r=i(4576),s=i(9504);t.exports=function(t){if("Function"===r(t))return s(t)}},9504:(t,e,i)=>{var r=i(616),s=Function.prototype,n=s.call,a=r&&s.bind.bind(n,n);t.exports=r?a:function(t){return function(){return n.apply(t,arguments)}}},7751:(t,e,i)=>{var r=i(4475),s=i(4901);t.exports=function(t,e){var i;return arguments.length<2?(i=r[t],s(i)?i:void 0):r[t]&&r[t][e]}},1767:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},8646:(t,e,i)=>{var r=i(9565),s=i(8551),n=i(1767),a=i(851);t.exports=function(t,e){e&&"string"==typeof t||s(t);var i=a(t);return n(s(void 0!==i?r(i,t):t))}},851:(t,e,i)=>{var r=i(6955),s=i(5966),n=i(4117),a=i(6269),o=i(8227)("iterator");t.exports=function(t){if(!n(t))return s(t,o)||s(t,"@@iterator")||a[r(t)]}},81:(t,e,i)=>{var r=i(9565),s=i(9306),n=i(8551),a=i(6823),o=i(851),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(s(i))return n(r(i,t));throw new l(a(t)+" is not iterable")}},5966:(t,e,i)=>{var r=i(9306),s=i(4117);t.exports=function(t,e){var i=t[e];return s(i)?void 0:r(i)}},3789:(t,e,i)=>{var r=i(9306),s=i(8551),n=i(9565),a=i(1291),o=i(1767),l="Invalid size",h=RangeError,d=TypeError,c=Math.max,u=function(t,e){this.set=t,this.size=c(e,0),this.has=r(t.has),this.keys=r(t.keys)};u.prototype={getIterator:function(){return o(s(n(this.keys,this.set)))},includes:function(t){return n(this.has,this.set,t)}},t.exports=function(t){s(t);var e=+t.size;if(e!=e)throw new d(l);var i=a(e);if(i<0)throw new h(l);return new u(t,i)}},4475:function(t){var e=function(t){return t&&t.Math===Math&&t};t.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")()},9297:(t,e,i)=>{var r=i(9504),s=i(8981),n=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return n(s(t),e)}},421:t=>{t.exports={}},397:(t,e,i)=>{var r=i(7751);t.exports=r("document","documentElement")},5917:(t,e,i)=>{var r=i(3724),s=i(9039),n=i(4055);t.exports=!r&&!s(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})},7055:(t,e,i)=>{var r=i(9504),s=i(9039),n=i(4576),a=Object,o=r("".split);t.exports=s(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?o(t,""):a(t)}:a}
vendor: 2,002 bytes, line 1
1,3167:(t,e,i)=>{var r=i(4901),s=i(34),n=i(2967);t.exports=function(t,e,i){var a,o;return n&&r(a=e.constructor)&&a!==i&&s(o=a.prototype)&&o!==i.prototype&&n(t,o),t}},3706:(t,e,i)=>{var r=i(9504),s=i(4901),n=i(7629),a=r(Function.toString);s(n.inspectSource)||(n.inspectSource=function(t){return a(t)}),t.exports=n.inspectSource},1181:(t,e,i)=>{var r,s,n,a=i(8622),o=i(4475),l=i(34),h=i(6699),d=i(9297),c=i(7629),u=i(6119),p=i(421),g="Object already initialized",f=o.TypeError,m=o.WeakMap;if(a||c.state){var b=c.state||(c.state=new m);b.get=b.get,b.has=b.has,b.set=b.set,r=function(t,e){if(b.has(t))throw new f(g);return e.facade=t,b.set(t,e),e},s=function(t){return b.get(t)||{}},n=function(t){return b.has(t)}}else{var v=u("state");p[v]=!0,r=function(t,e){if(d(t,v))throw new f(g);return e.facade=t,h(t,v,e),e},s=function(t){return d(t,v)?t[v]:{}},n=function(t){return d(t,v)}}t.exports={set:r,get:s,has:n,enforce:function(t){return n(t)?s(t):r(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=s(e)).type!==t)throw new f("Incompatible receiver, "+t+" required");return i}}}},4209:(t,e,i)=>{var r=i(8227),s=i(6269),n=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||a[n]===t)}},4376:(t,e,i)=>{var r=i(4576);t.exports=Array.isArray||function(t){return"Array"===r(t)}},1108:(t,e,i)=>{var r=i(6955);t.exports=function(t){var e=r(t);return"BigInt64Array"===e||"BigUint64Array"===e}},4901:t=>{var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},2796:(t,e,i)=>{var r=i(9039),s=i(4901),n=/#|\.prototype\./,a=function(t,e){var i=l[o(t)];return i===d||i!==h&&(s(e)?r(e):!!e)},o=a.normalize=function(t){return String(t).replace(n,".").toLowerCase()},l=a.data={},h=a.NATIVE="N",d=a.POLYFILL="P";t.exports=a},4117:t=>{t.exports=function(t){return null==t}},34:(t,e,i)=>{var r=i(4901);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}
1},3925:(t,e,i)=>{var r=i(34);t.exports=function(t){return r(t)||null===t}},6395:t=>{t.exports=!1},757:(t,e,i)=>{var r=i(7751),s=i(4901),n=i(1625),a=i(7040),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return s(e)&&n(e.prototype,o(t))}},507:(t,e,i)=>{var r=i(9565);t.exports=function(t,e,i){for(var s,n,a=i?t:t.iterator,o=t.next;!(s=r(o,a)).done;)if(n=e(s.value),void 0!==n)return n}},2652:(t,e,i)=>{var r=i(6080),s=i(9565),n=i(8551),a=i(6823),o=i(4209),l=i(6198),h=i(1625),d=i(81),c=i(851),u=i(9539),p=TypeError,g=function(t,e){this.stopped=t,this.result=e},f=g.prototype;t.exports=function(t,e,i){var m,b,v,A,y,_,E,w=i&&i.that,x=!!(i&&i.AS_ENTRIES),T=!!(i&&i.IS_RECORD),S=!!(i&&i.IS_ITERATOR),C=!!(i&&i.INTERRUPTED),M=r(e,w),R=function(t){return m&&u(m,"normal",t),new g(!0,t)},P=function(t){return x?(n(t),C?M(t[0],t[1],R):M(t[0],t[1])):C?M(t,R):M(t)};if(T)m=t.iterator;else if(S)m=t;else{if(!(b=c(t)))throw new p(a(t)+" is not iterable");if(o(b)){for(v=0,A=l(t);A>v;v++)if((y=P(t[v]))&&h(f,y))return y;return new g(!1)}m=d(t,b)}for(_=T?t.next:m.next;!(E=s(_,m)).done;){try{y=P(E.value)}catch(t){u(m,"throw",t)}if("object"==typeof y&&y&&h(f,y))return y}return new g(!1)}},9539:(t,e,i)=>{var r=i(9565),s=i(8551),n=i(5966);t.exports=function(t,e,i){var a,o;s(t);try{if(!(a=n(t,"return"))){if("throw"===e)throw i;return i}a=r(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw i;if(o)throw a;return s(a),i}},9462:(t,e,i)=>{var r=i(9565),s=i(2360),n=i(6699),a=i(6279),o=i(8227),l=i(1181),h=i(5966),d=i(7657).IteratorPrototype,c=i(2529),u=i(9539),p=o("toStringTag"),g="IteratorHelper",f="WrapForValidIterator",m=l.set,b=function(t){var e=l.getterFor(t?f:g);return a(s(d),{next:function(){var i=e(this);if(t)return i.nextHandler();try{var r=i.done?void 0:i.nextHandler();return c(r,i.done)}catch(t){throw i.done=!0,t}},return:function(){var i=e(this),s=i.iterator;if(i.done=!0,t){var n=h(s,"return");return n?r(n,s):c(void 0,!0)}if(i.inner)try{u(i.inner.iterator,"normal")}catch(t){return u(s,"throw",t)}return u(s,"normal"),c(void 0,!0)}})},v=b(!0),A=b(!1);n(A,p,"Iterator Helper"),t.exports=function(t,e){var i=function(i,r){r?(r.iterator=i.iterator,r.next=i.next):r=i,r.type=e?f:g,r.nextHandler=t,r.counter=0,r.done=!1,m(this,r)};return i.prototype=e?v:A,i}},713:(t,e,i)=>{var r=i(9565),s=i(9306),n=i(8551),a=i(1767),o=i(9462),l=i(6319),h=o(function(){var t=this.iterator,e=n(r(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)});t.exports=function(t){return n(this),s(t),new h(a(this),{mapper:t})}},7657:(t,e,i)=>{var r,s,n,a=i(9039),o=i(4901),l=i(34),h=i(2360),d=i(2787),c=i(6840),u=i(8227),p=i(6395),g=u("iterator"),f=!1;[].keys&&(n=[].keys(),"next"in n?(s=d(d(n)))!==Object.prototype&&(r=s):f=!0),!l(r)||a(function(){var t={};return r[g].call(t)!==t})?r={}:p&&(r=h(r)),o(r[g])||c(r,g,function(){return this}),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},6269:t=>{t.exports={}},6198:(t,e,i)=>{var r=i(8014);t.exports=function(t){return r(t.length)}},283:(t,e,i)=>{var r=i(9504),s=i(9039),n=i(4901),a=i(9297),o=i(3724),l=i(350).CONFIGURABLE,h=i(3706),d=i(1181),c=d.enforce,u=d.get,p=String,g=Object.defineProperty,f=r("".slice),m=r("".replace),b=r([].join),v=o&&!s(function(){return 8!==g(function(){},"length",{value:8}).length}),A=String(String).split("String"),y=t.exports=function(t,e,i){"Symbol("===f(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?g(t,"name",{value:e,configurable:!0}):t.name=e),v&&i&&a(i,"arity")&&t.length!==i.arity&&g(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&g(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=c(t);return a(r,"source")||(r.source=b(A,"string"==typeof e?e:"")),t};Function.prototype.toString=y(function(){return n(this)&&u(this).source||h(this)},"toString")},741:t=>{var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?i:e)(r)}},6043:(t,e,i)=>{var r=i(9306),s=TypeError,n=function(t){var e,i;this.promise=new t(function(t,r){if(void 0!==e||void 0!==i)throw new s("Bad Promise constructor");e=t,i=r}),this.resolve=r(e),this.reject=r(i)};t.exports.f=function(t){return new n(t)}},2603:(t,e,i)=>{var r=i(655);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},2360:(t,e,i)=>{var r,s=i(8551),n=i(6801),a=i(8727),o=i(421),l=i(397),h=i(4055),d=i(6119),c="prototype",u="script",p=d("IE_PROTO"),g=function(){},f=function(t){return"<"+u+">"+t+"</"+u+">"},m=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=h("iframe");return e.style.display="none",l.appendChild(e),e.src=String("java"+u+":"),(t=e.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}v="undefined"!=typeof document?document.domain&&r?m(r):b():m(r);for(var t=a.length;t--;)delete v[c][a[t]];return v()};
vendor: 2,219 bytes, line 1
1o[p]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(g[c]=s(t),i=new g,g[c]=null,i[p]=t):i=v(),void 0===e?i:n.f(i,e)}},6801:(t,e,i)=>{var r=i(3724),s=i(8686),n=i(4913),a=i(8551),o=i(5397),l=i(1072);e.f=r&&!s?Object.defineProperties:function(t,e){a(t);for(var i,r=o(e),s=l(e),h=s.length,d=0;h>d;)n.f(t,i=s[d++],r[i]);return t}},4913:(t,e,i)=>{var r=i(3724),s=i(5917),n=i(8686),a=i(8551),o=i(6969),l=TypeError,h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",p="writable";e.f=r?n?function(t,e,i){if(a(t),e=o(e),a(i),"function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i[p]){var r=d(t,e);r&&r[p]&&(t[e]=i.value,i={configurable:u in i?i[u]:r[u],enumerable:c in i?i[c]:r[c],writable:!1})}return h(t,e,i)}:h:function(t,e,i){if(a(t),e=o(e),a(i),s)try{return h(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},7347:(t,e,i)=>{var r=i(3724),s=i(9565),n=i(8773),a=i(6980),o=i(5397),l=i(6969),h=i(9297),d=i(5917),c=Object.getOwnPropertyDescriptor;e.f=r?c:function(t,e){if(t=o(t),e=l(e),d)try{return c(t,e)}catch(t){}if(h(t,e))return a(!s(n.f,t,e),t[e])}},8480:(t,e,i)=>{var r=i(1828),s=i(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,s)}},3717:(t,e)=>{e.f=Object.getOwnPropertySymbols},2787:(t,e,i)=>{var r=i(9297),s=i(4901),n=i(8981),a=i(6119),o=i(2211),l=a("IE_PROTO"),h=Object,d=h.prototype;t.exports=o?h.getPrototypeOf:function(t){var e=n(t);if(r(e,l))return e[l];var i=e.constructor;return s(i)&&e instanceof i?i.prototype:e instanceof h?d:null}},1625:(t,e,i)=>{var r=i(9504);t.exports=r({}.isPrototypeOf)},1828:(t,e,i)=>{var r=i(9504),s=i(9297),n=i(5397),a=i(9617).indexOf,o=i(421),l=r([].push);t.exports=function(t,e){var i,r=n(t),h=0,d=[];for(i in r)!s(o,i)&&s(r,i)&&l(d,i);for(;e.length>h;)s(r,i=e[h++])&&(~a(d,i)||l(d,i));return d}},1072:(t,e,i)=>{var r=i(1828),s=i(8727);t.exports=Object.keys||function(t){return r(t,s)}},8773:(t,e)=>{var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!i.call({1:2},1);e.f=s?function(t){var e=r(this,t);return!!e&&e.enumerable}:i},2967:(t,e,i)=>{var r=i(6706),s=i(34),n=i(7750),a=i(3506);
1t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=r(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,r){return n(i),a(r),s(i)&&(e?t(i,r):i.__proto__=r),i}}():void 0)},4270:(t,e,i)=>{var r=i(9565),s=i(4901),n=i(34),a=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&s(i=t.toString)&&!n(o=r(i,t))||s(i=t.valueOf)&&!n(o=r(i,t))||"string"!==e&&s(i=t.toString)&&!n(o=r(i,t)))return o;throw new a("Can't convert object to primitive value")}},5031:(t,e,i)=>{var r=i(7751),s=i(9504),n=i(8480),a=i(3717),o=i(8551),l=s([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=n.f(o(t)),i=a.f;return i?l(e,i(t)):e}},8235:(t,e,i)=>{var r=i(9504),s=i(9297),n=SyntaxError,a=parseInt,o=String.fromCharCode,l=r("".charAt),h=r("".slice),d=r(/./.exec),c={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"	"},u=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var i=!0,r="";e<t.length;){var g=l(t,e);if("\\"===g){var f=h(t,e,e+2);if(s(c,f))r+=c[f],e+=2;else if("\\u"===f){e+=2;var m=h(t,e,e+4);if(!d(u,m))throw new n("Bad Unicode escape at: "+e);r+=o(a(m,16)),e+=4}else throw new n('Unknown escape sequence: "'+f+'"')}else if('"'===g){i=!1,e++;break}else{if(d(p,g))throw new n("Bad control character in string literal at: "+e);r+=g,e++}}if(i)throw new n("Unterminated string at: "+e);return{value:r,end:e}}},7750:(t,e,i)=>{var r=i(4117),s=TypeError;t.exports=function(t){if(r(t))throw new s("Can't call method on "+t);return t}},9286:(t,e,i)=>{var r=i(4402),s=i(8469),n=r.Set,a=r.add;t.exports=function(t){var e=new n;return s(t,function(t){a(e,t)}),e}},3440:(t,e,i)=>{var r=i(7080),s=i(4402),n=i(9286),a=i(5170),o=i(3789),l=i(8469),h=i(507),d=s.has,c=s.remove;t.exports=function(t){var e=r(this),i=o(t),s=n(e);return a(e)<=i.size?l(e,function(t){i.includes(t)&&c(s,t)}):h(i.getIterator(),function(t){d(e,t)&&c(s,t)}),s}},4402:(t,e,i)=>{var r=i(9504),s=Set.prototype;t.exports={Set:Set,add:r(s.add),has:r(s.has),remove:r(s.delete),proto:s}},8750:(t,e,i)=>{var r=i(7080),s=i(4402),n=i(5170),a=i(3789),o=i(8469),l=i(507),h=s.Set,d=s.add,c=s.has;t.exports=function(t){var e=r(this),i=a(t),s=new h;return n(e)>i.size?l(i.getIterator(),function(t){c(e,t)&&d(s,t)}):o(e,function(t){i.includes(t)&&d(s,t)}),s}},4449:(t,e,i)=>{var r=i(7080),s=i(4402).has,n=i(5170),a=i(3789),o=i(8469),l=i(507),h=i(9539);t.exports=function(t){var e=r(this),i=a(t);if(n(e)<=i.size)return!1!==o(e,function(t){if(i.includes(t))return!1},!0);var d=i.getIterator();return!1!==l(d,function(t){if(s(e,t))return h(d,"normal",!1)})}},3838:(t,e,i)=>{var r=i(7080),s=i(5170),n=i(8469),a=i(3789);t.exports=function(t){var e=r(this),i=a(t);return!(s(e)>i.size)&&!1!==n(e,function(t){if(!i.includes(t))return!1},!0)}},8527:(t,e,i)=>{var r=i(7080),s=i(4402).has,n=i(5170),a=i(3789),o=i(507),l=i(9539);t.exports=function(t){var e=r(this),i=a(t);if(n(e)<i.size)return!1;var h=i.getIterator();return!1!==o(h,function(t){if(!s(e,t))return l(h,"normal",!1)})}},8469:(t,e,i)=>{var r=i(9504),s=i(507),n=i(4402),a=n.Set,o=n.proto,l=r(o.forEach),h=r(o.keys),d=h(new a).next;t.exports=function(t,e,i){return i?s({iterator:h(t),next:d},e):l(t,e)}},4916:(t,e,i)=>{var r=i(7751),s=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=r("Set");try{new e()[t](s(0));try{return new e()[t](s(-1)),!1}catch(t){return!0}}catch(t){return!1}}},5170:(t,e,i)=>{var r=i(6706),s=i(4402);t.exports=r(s.proto,"size","get")||function(t){return t.size}},3650:(t,e,i)=>{var r=i(7080),s=i(4402),n=i(9286),a=i(3789),o=i(507),l=s.add,h=s.has,d=s.remove;t.exports=function(t){var e=r(this),i=a(t).getIterator(),s=n(e);return o(i,function(t){h(e,t)?d(s,t):l(s,t)}),s}},4204:(t,e,i)=>{var r=i(7080),s=i(4402).add,n=i(9286),a=i(3789),o=i(507);t.exports=function(t){var e=r(this),i=a(t).getIterator(),l=n(e);return o(i,function(t){s(l,t)}),l}},6119:(t,e,i)=>{var r=i(5745),s=i(3392),n=r("keys");t.exports=function(t){return n[t]||(n[t]=s(t))}},7629:(t,e,i)=>{var r=i(6395),s=i(4475),n=i(9433),a="__core-js_shared__",o=t.exports=s[a]||n(a,{});(o.versions||(o.versions=[])).push({version:"3.37.0",mode:r?"pure":"global",copyright:"\xa9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(t,e,i)=>{var r=i(7629);t.exports=function(t,e){return r[t]||(r[t]=e||{})}},1548:(t,e,i)=>
1{var r=i(4475),s=i(9039),n=i(7388),a=i(7290),o=i(516),l=i(9088),h=r.structuredClone;t.exports=!!h&&!s(function(){if(o&&n>92||l&&n>94||a&&n>97)return!1;var t=new ArrayBuffer(8),e=h(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})},4495:(t,e,i)=>{var r=i(7388),s=i(9039),n=i(4475).String;t.exports=!!Object.getOwnPropertySymbols&&!s(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t) instanceof Symbol)||!Symbol.sham&&r&&r<41})},5610:(t,e,i)=>{var r=i(1291),s=Math.max,n=Math.min;t.exports=function(t,e){var i=r(t);return i<0?s(i+e,0):n(i,e)}},5854:(t,e,i)=>{var r=i(2777),s=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw new s("Can't convert number to bigint");return BigInt(e)}},7696:(t,e,i)=>{var r=i(1291),s=i(8014),n=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=r(t),i=s(e);if(e!==i)throw new n("Wrong length or index");return i}},5397:(t,e,i)=>{var r=i(7055),s=i(7750);t.exports=function(t){return r(s(t))}},1291:(t,e,i)=>{var r=i(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},8014:(t,e,i)=>{var r=i(1291),s=Math.min;t.exports=function(t){var e=r(t);return e>0?s(e,9007199254740991):0}},8981:(t,e,i)=>{var r=i(7750),s=Object;t.exports=function(t){return s(r(t))}},2777:(t,e,i)=>{var r=i(9565),s=i(34),n=i(757),a=i(5966),o=i(4270),l=i(8227),h=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!s(t)||n(t))return t;var i,l=a(t,d);if(l){if(void 0===e&&(e="default"),i=r(l,t,e),!s(i)||n(i))return i;throw new h("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},6969:(t,e,i)=>{var r=i(2777),s=i(757);t.exports=function(t){var e=r(t,"string");return s(e)?e:e+""}},2140:(t,e,i)=>{var r=i(8227)("toStringTag"),s={};s[r]="z",t.exports="[object z]"===String(s)},655:(t,e,i)=>{var r=i(6955),s=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return s(t)}},9714:(t,e,i)=>{var r=i(9088);t.exports=function(t){try{if(r)return Function('return require("'+t+'")')()}catch(t){}}},6823:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},3392:(t,e,i)=>{var r=i(9504),s=0,n=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++s+n,36)}}
1,7040:(t,e,i)=>{var r=i(4495);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(t,e,i)=>{var r=i(3724),s=i(9039);t.exports=r&&s(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},2812:t=>{var e=TypeError;t.exports=function(t,i){if(t<i)throw new e("Not enough arguments");return t}},8622:(t,e,i)=>{var r=i(4475),s=i(4901),n=r.WeakMap;t.exports=s(n)&&/native code/.test(String(n))},8227:(t,e,i)=>{var r=i(4475),s=i(5745),n=i(9297),a=i(3392),o=i(4495),l=i(7040),h=r.Symbol,d=s("wks"),c=l?h.for||h:h&&h.withoutSetter||a;t.exports=function(t){return n(d,t)||(d[t]=o&&n(h,t)?h[t]:c("Symbol."+t)),d[t]}},6573:(t,e,i)=>{var r=i(3724),s=i(2106),n=i(3238),a=ArrayBuffer.prototype;!r||"detached"in a||s(a,"detached",{configurable:!0,get:function(){return n(this)}})},7936:(t,e,i)=>{var r=i(6518),s=i(5636);s&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return s(this,arguments.length?arguments[0]:void 0,!1)}})},8100:(t,e,i)=>{var r=i(6518),s=i(5636);s&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return s(this,arguments.length?arguments[0]:void 0,!0)}})},4114:(t,e,i)=>{var r=i(6518),s=i(8981),n=i(6198),a=i(4527),o=i(6837),l=i(9039)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}();r({target:"Array",proto:!0,arity:1,forced:l},{push:function(t){var e=s(this),i=n(e),r=arguments.length;o(i+r);for(var l=0;l<r;l++)e[i]=arguments[l],i++;return a(e,i),i}})},4628:(t,e,i)=>{var r=i(6518),s=i(6043);r({target:"Promise",stat:!0},{withResolvers:function(){var t=s.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},7642:(t,e,i)=>{var r=i(6518),s=i(3440),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("difference")},{difference:s})},8004:(t,e,i)=>{var r=i(6518),s=i(9039),n=i(8750),a=!i(4916)("intersection")||s(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))});r({target:"Set",proto:!0,real:!0,forced:a},{intersection:n})},3853:(t,e,i)=>{var r=i(6518),s=i(4449),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("isDisjointFrom")},{isDisjointFrom:s})},5876:(t,e,i)=>{var r=i(6518),s=i(3838),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("isSubsetOf")},{isSubsetOf:s})},2475:(t,e,i)=>{var r=i(6518),s=i(8527),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("isSupersetOf")},{isSupersetOf:s})},5024:(t,e,i)=>{var r=i(6518),s=i(3650),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:s})},1698:(t,e,i)=>{var r=i(6518),s=i(4204),n=i(4916);r({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:s})},7467:(t,e,i)=>{var r=i(7628),s=i(4644),n=s.aTypedArray,a=s.exportTypedArrayMethod,o=s.getTypedArrayConstructor;a("toReversed",function(){return r(n(this),o(this))})},4732:(t,e,i)=>{var r=i(4644),s=i(9504),n=i(9306),a=i(5370),o=r.aTypedArray,l=r.getTypedArrayConstructor,h=r.exportTypedArrayMethod,d=s(r.TypedArrayPrototype.sort);h("toSorted",function(t){void 0!==t&&n(t);var e=o(this),i=a(l(e),e);return d(i,t)})},9577:(t,e,i)=>{var r=i(9928),s=i(4644),n=i(1108),a=i(1291),o=i(5854),l=s.aTypedArray,h=s.getTypedArrayConstructor,d=s.exportTypedArrayMethod,c=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();d("with",{with:function(t,e){var i=l(this),s=a(t),d=n(i)?o(e):+e;return r(i,h(i),s,d)}}.with,!c)},8992:(t,e,i)=>{var r=i(6518),s=i(4475),n=i(679),a=i(8551),o=i(4901),l=i(2787),h=i(2106),d=i(4659),c=i(9039),u=i(9297),p=i(8227),g=i(7657).IteratorPrototype,f=i(3724),m=i(6395),b="constructor",v="Iterator",A=p("toStringTag"),y=TypeError,_=s[v],E=m||!o(_)||_.prototype!==g||!c(function(){_({})}),w=function(){if(n(this,g),l(this)===g)throw new y("Abstract class Iterator not directly constructable")},x=function(t,e){f?h(g,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===g)throw new y("You can't redefine this property");u(this,t)?this[t]=e:d(this,t,e)}}):g[t]=e};u(g,A)||x(A,v),(E||!u(g,b)||g[b]===Object)&&x(b,w),w.prototype=g,r({global:!0,constructor:!0,forced:E},{Iterator:w})},3215:(t,e,i)=>{var r=i(6518),s=i(2652),n=i(9306),a=i(8551),o=i(1767);r({target:"Iterator",proto:!0,real:!0},{every:function(t){a(this),n(t);var e=o(this),i=0;return!s(e,function(e,r){if(!t(e,i++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}
vendor: 4,736 bytes, line 1
1,4520:(t,e,i)=>{var r=i(6518),s=i(9565),n=i(9306),a=i(8551),o=i(1767),l=i(9462),h=i(6319),d=i(6395),c=l(function(){for(var t,e,i=this.iterator,r=this.predicate,n=this.next;;){if(t=a(s(n,i)),this.done=!!t.done)return;if(e=t.value,h(i,r,[e,this.counter++],!0))return e}});r({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(t){return a(this),n(t),new c(o(this),{predicate:t})}})},670:(t,e,i)=>{var r=i(6518),s=i(9565),n=i(9306),a=i(8551),o=i(1767),l=i(8646),h=i(9462),d=i(9539),c=i(6395),u=h(function(){for(var t,e,i=this.iterator,r=this.mapper;;){if(e=this.inner)try{if(!(t=a(s(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){d(i,"throw",t)}if(t=a(s(this.next,i)),this.done=!!t.done)return;try{this.inner=l(r(t.value,this.counter++),!1)}catch(t){d(i,"throw",t)}}});r({target:"Iterator",proto:!0,real:!0,forced:c},{flatMap:function(t){return a(this),n(t),new u(o(this),{mapper:t,inner:null})}})},1454:(t,e,i)=>{var r=i(6518),s=i(713),n=i(6395);r({target:"Iterator",proto:!0,real:!0,forced:n},{map:s})},7550:(t,e,i)=>{var r=i(6518),s=i(2652),n=i(9306),a=i(8551),o=i(1767);r({target:"Iterator",proto:!0,real:!0},{some:function(t){a(this),n(t);var e=o(this),i=0;return s(e,function(e,r){if(t(e,i++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},8335:(t,e,i)=>{var r=i(6518),s=i(3724),n=i(4475),a=i(7751),o=i(9504),l=i(9565),h=i(4901),d=i(34),c=i(4376),u=i(9297),p=i(655),g=i(6198),f=i(4659),m=i(9039),b=i(8235),v=i(4495),A=n.JSON,y=n.Number,_=n.SyntaxError,E=A&&A.parse,w=a("Object","keys"),x=Object.getOwnPropertyDescriptor,T=o("".charAt),S=o("".slice),C=o(/./.exec),M=o([].push),R=/^\d$/,P=/^[1-9]$/,I=/^(?:-|\d)$/,k=/^[\t\n\r ]$/,L=function(t,e){t=p(t);var i=new N(t,0,""),r=i.parse(),s=r.value,n=i.skip(k,r.end);if(n<t.length)throw new _('Unexpected extra character: "'+T(t,n)+'" after the parsed data at: '+n);return h(e)?D({"":s},"",e,r):s},D=function(t,e,i,r){var s,n,a,o,h,p=t[e],f=r&&p===r.value,m=f&&"string"==typeof r.source?{source:r.source}:{};if(d(p)){var b=c(p),v=f?r.nodes:b?[]:{};if(b)for(o=0,s=v.length,a=g(p);o<a;o++)F(p,o,D(p,""+o,i,o<s?v[o]:void 0));else for(o=0,n=w(p),a=g(n);o<a;o++)h=n[o],F(p,h,D(p,h,i,u(v,h)?v[h]:void 0))}return l(i,t,e,p,m)},F=function(t,e,i){if(s){var r=x(t,e);if(r&&!r.configurable)return}void 0===i?delete t[e]:f(t,e,i)},O=function(t,e,i,r){this.value=t,this.end=e,this.source=i,this.nodes=r},N=function(t,e){this.source=t,this.index=e};N.prototype={fork:function(t){return new N(this.source,t)},parse:function(){var t=this.source,e=this.skip(k,this.index),i=this.fork(e),r=T(t,e);if(C(I,r))return i.number();switch(r){case"{":return i.object();case"[":return i.array();case'"':return i.string();case"t":return i.keyword(!0);case"f":return i.keyword(!1);case"n":return i.keyword(null)}throw new _('Unexpected character: "'+r+'" at: '+e)},node:function(t,e,i,r,s){return new O(e,r,t?null:S(this.source,i,r),s)},object:function(){for(var t=this.source,e=this.index+1,i=!1,r={},s={};e<t.length;){if(e=this.until(['"',"}"],e),"}"===T(t,e)&&!i){e++;break}var n=this.fork(e).string(),a=n.value;e=n.end,e=this.until([":"],e)+1,e=this.skip(k,e),n=this.fork(e).parse(),f(s,a,n),f(r,a,n.value),e=this.until([",","}"],n.end);var o=T(t,e);if(","===o)i=!0,e++;else if("}"===o){e++;break}}return this.node(1,r,this.index,e,s)},array:function(){for(var t=this.source,e=this.index+1,i=!1,r=[],s=[];e<t.length;){if(e=this.skip(k,e),"]"===T(t,e)&&!i){e++;break}var n=this.fork(e).parse();if(M(s,n),M(r,n.value),e=this.until([",","]"],n.end),","===T(t,e))i=!0,e++;else if("]"===T(t,e)){e++;break}}return this.node(1,r,this.index,e,s)},string:function(){var t=this.index,e=b(this.source,this.index+1);return this.node(0,e.value,t,e.end)},number:function(){var t=this.source,e=this.index,i=e;if("-"===T(t,i)&&i++,"0"===T(t,i))i++;else if(C(P,T(t,i)))i=this.skip(R,++i);else throw new _("Failed to parse number at: "+i);if("."===T(t,i)&&(i=this.skip(R,++i)),"e"===T(t,i)||"E"===T(t,i)){i++,("+"===T(t,i)||"-"===T(t,i))&&i++;var r=i;if(i=this.skip(R,i),r===i)throw new _("Failed to parse number's exponent value at: "+i)}return this.node(0,y(S(t,e,i)),e,i)},keyword:function(t){var e=""+t,i=this.index,r=i+e.length;if(S(this.source,i,r)!==e)throw new _("Failed to parse value at: "+i);return this.node(0,t,i,r)},skip:function(t,e){for(var i=this.source;e<i.length&&C(t,T(i,e));e++);return e},until:function(t,e){e=this.skip(k,e);for(var i=T(this.source,e),r=0;r<t.length;r++)if(t[r]===i)return e;throw new _('Unexpected character: "'+i+'" at: '+e)}};var B=m(function(){var t,e="9007199254740993";return E(e,function(e,i,r){t=r.source}),t!==e}),U=v&&!m(function(){return 1/E("-0 	")!=-1/0});r({target:"JSON",stat:!0,forced:B},{parse:function(t,e){return U&&!h(e)?E(t):L(t,e)}})}
1,3375:(t,e,i)=>{i(7642)},9225:(t,e,i)=>{i(8004)},3972:(t,e,i)=>{i(3853)},9209:(t,e,i)=>{i(5876)},5714:(t,e,i)=>{i(2475)},7561:(t,e,i)=>{i(5024)},6197:(t,e,i)=>{i(1698)},4979:(t,e,i)=>{var r=i(6518),s=i(4475),n=i(7751),a=i(6980),o=i(4913).f,l=i(9297),h=i(679),d=i(3167),c=i(2603),u=i(5002),p=i(6193),g=i(3724),f=i(6395),m="DOMException",b=n("Error"),v=n(m),A=function(){h(this,y);var t=arguments.length,e=c(t<1?void 0:arguments[0]),i=c(t<2?void 0:arguments[1],"Error"),r=new v(e,i),s=new b(e);return s.name=m,o(r,"stack",a(1,p(s.stack,1))),d(r,this,A),r},y=A.prototype=v.prototype,_="stack"in new b(m),E="stack"in new v(1,2),w=v&&g&&Object.getOwnPropertyDescriptor(s,m),x=!!w&&!(w.writable&&w.configurable),T=_&&!x&&!E;r({global:!0,constructor:!0,forced:f||T},{DOMException:T?A:v});var S=n(m),C=S.prototype;if(C.constructor!==S){for(var M in f||o(C,"constructor",a(1,S)),u)if(l(u,M)){var R=u[M],P=R.s;l(S,P)||o(S,P,a(6,R.c))}}},4603:(t,e,i)=>{var r=i(6840),s=i(9504),n=i(655),a=i(2812),o=URLSearchParams,l=o.prototype,h=s(l.append),d=s(l.delete),c=s(l.forEach),u=s([].push),p=new o("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&r(l,"delete",function(t){var e,i=arguments.length,r=i<2?void 0:arguments[1];if(i&&void 0===r)return d(this,t);var s=[];c(this,function(t,e){u(s,{key:e,value:t})}),a(i,1);for(var o=n(t),l=n(r),p=0,g=0,f=!1,m=s.length;p<m;)e=s[p++],f||e.key===o?(f=!0,d(this,e.key)):g++;for(;g<m;)(e=s[g++]).key===o&&e.value===l||h(this,e.key,e.value)},{enumerable:!0,unsafe:!0})},7566:(t,e,i)=>{var r=i(6840),s=i(9504),n=i(655),a=i(2812),o=URLSearchParams,l=o.prototype,h=s(l.getAll),d=s(l.has),c=new o("a=1");(c.has("a",2)||!c.has("a",void 0))&&r(l,"has",function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return d(this,t);var r=h(this,t);a(e,1);for(var s=n(i),o=0;o<r.length;)if(r[o++]===s)return!0;return!1},{enumerable:!0,unsafe:!0})},8721:(t,e,i)=>{var r=i(3724),s=i(9504),n=i(2106),a=URLSearchParams.prototype,o=s(a.forEach);!r||"size"in a||n(a,"size",{get:function(){var t=0;return o(this,function(){t++}),t},configurable:!0,enumerable:!0})},6976:(t,e,i)=>{i.d(e,{AnnotationLayer:()=>U,FreeTextAnnotationElement:()=>T,InkAnnotationElement:()=>k,StampAnnotationElement:()=>N}),i(4114),i(8992),i(670),i(1454),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197);var r=i(4292),s=i(5419),n=i(9792);function a(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function o(t){return Math.max(0,Math.min(255,255*t))}class l{static CMYK_G([t,e,i,r]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+r)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return[t=o(t),t,t]}static G_HTML([t]){let e=a(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(o)}static RGB_HTML(t){return`#${t.map(a).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,r]){return["RGB",1-Math.min(1,t+r),1-Math.min(1,i+r),1-Math.min(1,e+r)]}static CMYK_rgb([t,e,i,r]){return[o(1-Math.min(1,t+r)),o(1-Math.min(1,i+r)),o(1-Math.min(1,e+r))]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){let r=1-t,s=1-e,n=1-i;return["CMYK",r,s,n,Math.min(r,s,n)]}}var h=i(8284);let d=new WeakSet;function c(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class u{static create(t){switch(t.data.annotationType){case r.AnnotationType.LINK:return new g(t);case r.AnnotationType.TEXT:return new f(t);case r.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new b(t);case"Btn":if(t.data.radioButton)return new y(t);if(t.data.checkBox)return new A(t);return new _(t);case"Ch":return new E(t);case"Sig":return new v(t)}return new m(t);case r.AnnotationType.POPUP:return new w(t);case r.AnnotationType.FREETEXT:return new T(t);case r.AnnotationType.LINE:return new S(t);case r.AnnotationType.SQUARE:return new C(t);case r.AnnotationType.CIRCLE:return new M(t);case r.AnnotationType.POLYLINE:return new R(t);case r.AnnotationType.CARET:return new I(t);case r.AnnotationType.INK:return new k(t);case r.AnnotationType.POLYGON:return new P(t);case r.AnnotationType.HIGHLIGHT:return new L(t);case r.AnnotationType.UNDERLINE:return new D(t);case r.AnnotationType.SQUIGGLY:return new F(t);case r.AnnotationType.STRIKEOUT:return new O(t);case r.AnnotationType.STAMP:return new N(t);case r.AnnotationType.FILEATTACHMENT:return new B(t);default:return new p(t)}}}class p{#t=null;#e=!1;constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(t?.str||e?.str||i?.str)}get hasPopupData(){return p._hasPopupData(this.data)}updateEdited(t){if(!this.container)return;this.#t||={rect:this.data.rect.slice(0)};let{rect:e}=t;e&&this.#i(e)}resetEdited(){this.#t&&(this.#i(this.#t.rect),this.#t=null)}#i(t){let{container:{style:e},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:n,pageX:a,pageY:o}}}}=this;i?.splice(0,4,...t);let{width:l,height:h}=c(t);e.left=`${100*(t[0]-a)/s}%`,e.top=`${100*(n-t[3]+o)/n}%`,0===r?(e.width=`${100*l/s}%`,e.height=`${100*h/n}%`):this.setRotation(r)}_createContainer(t){let{data:e,parent:{page:i,viewport:s}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",e.id),this instanceof m||(n.tabIndex=1e3);let{style:a}=n;
1if(a.zIndex=this.parent.zIndex++,e.popupRef&&n.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof w){let{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,n),n}let{width:o,height:l}=c(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth=`${e.borderStyle.width}px`;let t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){let e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;a.borderRadius=e}else if(this instanceof y){let t=`calc(${o}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;a.borderRadius=t}switch(e.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:a.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:a.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:a.borderBottomStyle="solid"}let s=e.borderColor||null;s?(this.#e=!0,a.borderColor=r.Util.makeHexColor(0|s[0],0|s[1],0|s[2])):a.borderWidth=0}let h=r.Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:d,pageHeight:u,pageX:p,pageY:g}=s.rawDims;a.left=`${100*(h[0]-p)/d}%`,a.top=`${100*(h[1]-g)/u}%`;let{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.width=`${100*o/d}%`,a.height=`${100*l/u}%`):this.setRotation(f,n),n}setRotation(t,e=this.container){let i,r;if(!this.data.rect)return;let{pageWidth:s,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:o}=c(this.data.rect);t%180==0?(i=100*a/s,r=100*o/n):(i=100*o/s,r=100*a/n),e.style.width=`${i}%`,e.style.height=`${r}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(t,e,i)=>{let r=i.detail[t],s=r[0],n=r.slice(1);i.target.style[e]=l[`${s}_HTML`](n),this.annotationStorage.setValue(this.data.id,{[e]:l[`${s}_rgb`](n)})};return(0,r.shadow)(this,"_commonActions",{display:t=>{let{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},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:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{let e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){let i=this._commonActions;for(let r of Object.keys(e.detail)){let s=t[r]||i[r];s?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let i=this._commonActions;for(let[r,s]of Object.entries(e)){let n=i[r];if(n){let i={detail:{[r]:s},target:t};n(i),delete e[r]}}}_createQuadrilaterals(){let t;if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[i,r,s,n]=this.data.rect;if(1===e.length){let[,{x:t,y:a},{x:o,y:l}]=e[0];if(s===t&&n===a&&i===o&&r===l)return}let{style:a}=this.container;if(this.#e){let{borderColor:e,borderWidth:i}=a;a.borderWidth=0,t=["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="${e}" stroke-width="${i}">`],this.container.classList.add("hasBorder")}let o=s-i,l=n-r,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);let c=h.createElement("defs");d.append(c);let u=h.createElement("clipPath"),p=`clippath_${this.data.id}`;for(let[,{x:r,y:s},{x:a,y:d}]of(u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),c.append(u),e)){let e=h.createElement("rect"),c=(a-i)/
1o,p=(n-s)/l,g=(r-a)/o,f=(s-d)/l;e.setAttribute("x",c),e.setAttribute("y",p),e.setAttribute("width",g),e.setAttribute("height",f),u.append(e),t?.push(`<rect vector-effect="non-scaling-stroke" x="${c}" y="${p}" width="${g}" height="${f}"/>`)}this.#e&&(t.push("</g></svg>')"),a.backgroundImage=t.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(){let{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");let i=new w({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){let i=[];if(this._fieldObjects){let s=this._fieldObjects[t];if(s)for(let{page:t,id:n,exportValues:a}of s){if(-1===t||n===e)continue;let s="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${n}"]`);if(o&&!d.has(o)){(0,r.warn)(`_getElementsByName - element not allowed: ${n}`);continue}i.push({id:n,exportValue:s,domElement:o})}return i}for(let r of document.getElementsByName(t)){let{exportValue:t}=r,s=r.getAttribute("data-element-id");s!==e&&d.has(r)&&i.push({id:s,exportValue:t,domElement:r})}return i}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(){let t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(let e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class g extends p{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let r=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),r=!0):t.action?(this._bindNamedAction(i,t.action),r=!0):t.attachment?(this.#r(i,t.attachment,t.attachmentDest),r=!0):t.setOCGState?(this.#s(i,t.setOCGState),r=!0):t.dest?(this._bindLink(i,t.dest),r=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),r=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(i,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(i),this.container}#n(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#n()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#n()}#r(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#n()}#s(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#n()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let r of Object.keys(e.actions)){let s=i.get(r);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:r}}),!1))}t.onclick||(t.onclick=()=>!1),this.#n()}_bindResetFormAction(t,e){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#n(),!this._fieldObjects){(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();let{fields:t,refs:s,include:n}=e,a=[];if(0!==t.length||0!==s.length){let e=new Set(s);for(let i of t)for(let{id:t}of this._fieldObjects[i]||[])e.add(t);for(let t of Object.values(this._fieldObjects))for(let i of t)e.has(i.id)===n&&a.push(i)}else for(let t of Object.values(this._fieldObjects))a.push(...t);let o=this.annotationStorage,l=[];for(let t of a){let{id:e}=t;switch(l.push(e),t.type){case"text":{let i=t.defaultValue||"";o.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{let i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});break}case"combobox":case"listbox":{let i=t.defaultValue||"";o.setValue(e,{value:i});break}default:continue}let i=document.querySelector(`[data-element-id="${e}"]`);if(i){if(!d.has(i)){(0,r.warn)(`_bindResetFormAction - element not allowed: ${e}`);continue}i.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class f extends p{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}
1class m extends p{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return r.FeatureTest.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,r,s){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(t)}})})}_setEventListeners(t,e,i,r){for(let[s,n]of i)("Action"===n||this.data.actions?.[n])&&(("Focus"===n||"Blur"===n)&&(e||={focused:!1}),this._setEventListener(t,e,s,n,r),"Focus"!==n||this.data.actions?.Blur?"Blur"!==n||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":r.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e;let{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||9,n=t.style,a=t=>Math.round(10*t)/10;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),i=Math.round(t/(r.LINE_FACTOR*s))||1;e=Math.min(s,a(t/i/r.LINE_FACTOR))}else{let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);e=Math.min(s,a(t/r.LINE_FACTOR))}n.fontSize=`calc(${e}px * var(--scale-factor))`,n.color=r.Util.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(n.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class b extends m{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,r){let s=this.annotationStorage;
1for(let n of this._getElementsByName(t.name,t.id))n.domElement&&(n.domElement[e]=i),s.setValue(n.id,{[r]:i})}render(){let t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){let r=t.getValue(e,{value:this.data.fieldValue}),s=r.value||"",n=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;n&&s.length>n&&(s=s.slice(0,n));let a=r.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));let o={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((i=document.createElement("textarea")).textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):((i=document.createElement("input")).type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),d.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=1e3,this._setRequired(i,this.data.required),n&&(i.maxLength=n),i.addEventListener("input",r=>{t.setValue(e,{value:r.target.value}),this.setPropertyOnSiblings(i,"value",r.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue??"";i.value=o.userValue=e,o.formattedValue=null});let l=t=>{let{formattedValue:e}=o;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",t=>{if(o.focused)return;let{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target),this._dispatchEventFromSandbox({value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){let{formattedValue:r}=i.detail;o.formattedValue=r,null!=r&&i.target!==document.activeElement&&(i.target.value=r),t.setValue(e,{formattedValue:r})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{let{charLimit:r}=i.detail,{target:s}=i;if(0===r){s.removeAttribute("maxLength");return}s.setAttribute("maxLength",r);let n=o.userValue;n&&!(n.length<=r)&&(n=n.slice(0,r),s.value=o.userValue=n,t.setValue(e,{value:n}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}},i)}),i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;let{value:r}=t.target;o.lastCommittedValue!==r&&(o.lastCommittedValue=r,o.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let r=l;l=null,i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);let{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),r(t)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;let{data:i,target:r}=t,{value:s,selectionStart:n,selectionEnd:a}=r,l=n,h=a;switch(t.inputType){case"deleteWordBackward":{let t=s.substring(0,n).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}
1case"deleteWordForward":{let t=s.substring(n).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":n===a&&(l-=1);break;case"deleteContentForward":n===a&&(h+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(l&&i.addEventListener("blur",l),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/n;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else(i=document.createElement("div")).textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class v extends m{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class A extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,i=e.id,r=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,t.setValue(i,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let s=document.createElement("input");return d.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,r&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=1e3,s.addEventListener("change",r=>{let{name:s,checked:n}=r.target;for(let r of this._getElementsByName(s,i)){let i=n&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:n})}),s.addEventListener("resetform",t=>{let i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}},e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class y extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let t=this.annotationStorage,e=this.data,i=e.id,r=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof r&&(r=r!==e.buttonValue,t.setValue(i,{value:r})),r)for(let r of this._getElementsByName(e.fieldName,i))t.setValue(r.id,{value:!1});let s=document.createElement("input");if(d.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,r&&s.setAttribute("checked",!0),s.tabIndex=1e3,s.addEventListener("change",e=>{let{name:r,checked:s}=e.target;for(let e of this._getElementsByName(r,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:s})}),s.addEventListener("resetform",t=>{let i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){let r=e.buttonValue;s.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({value:e=>{let s=r===e.detail.value;for(let r of this._getElementsByName(e.target.name)){let e=s&&r.id===i;r.domElement&&(r.domElement.checked=e),t.setValue(r.id,{value:e})}}},e)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}
1class _ extends g{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");let e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class E extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");d.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=1e3;let s=this.data.combo&&this.data.options.length>0;for(let t of(!this.data.combo&&(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue;for(let t of r.options)t.selected=t.value===e}),this.data.options)){let e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,i.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),s=!1),r.append(e)}let n=null;if(s){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),r.prepend(t),n=()=>{t.remove(),r.removeEventListener("input",n),n=null},r.addEventListener("input",n)}let a=t=>{let e=t?"value":"textContent",{options:i,multiple:s}=r;return s?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]},o=a(!1),l=t=>{let e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({value(i){n?.();let s=i.detail.value,l=new Set(Array.isArray(s)?s:[s]);for(let t of r.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){r.multiple=!0},remove(i){let s=r.options,n=i.detail.remove;if(s[n].selected=!1,r.remove(n),s.length>0){let t=Array.prototype.findIndex.call(s,t=>t.selected);-1===t&&(s[0].selected=!0)}t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){let{index:s,displayValue:n,exportValue:h}=i.detail.insert,d=r.children[s],c=document.createElement("option");c.textContent=n,c.value=h,d?d.before(c):r.append(c),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){let{items:s}=i.detail;for(;0!==r.length;)r.remove(0);for(let t of s){let{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,r.append(s)}r.options.length>0&&(r.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){let r=new Set(i.detail.indices);for(let t of i.target.options)t.selected=r.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}},i)}),r.addEventListener("input",i=>{let r=a(!0),s=a(!1);t.setValue(e,{value:r}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:s,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):r.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class w extends p{constructor(t){let{data:e,elements:i}=t;super(t,{isRenderable:p._hasPopupData(e)}),this.elements=i}render(){this.container.classList.add("popupAnnotation");let t=new x({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(let i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>`${r.AnnotationPrefix}${t}`).join(",")),this.container}}
1class x{#a=this.#o.bind(this);#l=this.#h.bind(this);#d=this.#c.bind(this);#u=this.#p.bind(this);#g=null;#f=null;#m=null;#b=null;#v=null;#A=null;#y=null;#_=!1;#E=null;#w=null;#x=null;#T=null;#S=!1;constructor({container:t,color:e,elements:i,titleObj:r,modificationDate:n,contentsObj:a,richText:o,parent:l,rect:h,parentRect:d,open:c}){for(let c of(this.#f=t,this.#T=r,this.#m=a,this.#x=o,this.#A=l,this.#g=e,this.#w=h,this.#y=d,this.#v=i,this.#b=s.PDFDateString.toDateObject(n),this.trigger=i.flatMap(t=>t.getElementsToTriggerPopup()),this.trigger))c.addEventListener("click",this.#u),c.addEventListener("mouseenter",this.#d),c.addEventListener("mouseleave",this.#l),c.classList.add("popupTriggerArea");for(let t of i)t.container?.addEventListener("keydown",this.#a);this.#f.hidden=!0,c&&this.#p()}render(){if(this.#E)return;let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:n}}}=this.#A,a=this.#E=document.createElement("div");if(a.className="popup",this.#g){let t=a.style.outlineColor=r.Util.makeHexColor(...this.#g);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?a.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`:a.style.backgroundColor=r.Util.makeHexColor(...this.#g.map(t=>Math.floor(.7*(255-t)+t)))}let o=document.createElement("span");o.className="header";let l=document.createElement("h1");if(o.append(l),{dir:l.dir,str:l.textContent}=this.#T,a.append(o),this.#b){let t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:this.#b.toLocaleDateString(),time:this.#b.toLocaleTimeString()})),o.append(t)}let d=this.#m,c=this.#x;if(c?.str&&(!d?.str||d.str===c.str))h.XfaLayer.render({xfaHtml:c.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");else{let t=this._formatContents(d);a.append(t)}let u=!!this.#y,p=u?this.#y:this.#w;for(let t of this.#v)if(!p||null!==r.Util.intersect(t.data.rect,p)){p=t.data.rect,u=!0;break}let g=r.Util.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),f=u?p[2]-p[0]+5:0,m=g[0]+f,b=g[1],{style:v}=this.#f;v.left=`${100*(m-s)/e}%`,v.top=`${100*(b-n)/i}%`,this.#f.append(a)}_formatContents({str:t,dir:e}){let i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;let r=t.split(/(?:\r\n?|\n)/);for(let t=0,e=r.length;t<e;++t){let s=r[t];i.append(document.createTextNode(s)),t<e-1&&i.append(document.createElement("br"))}return i}#o(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||"Enter"!==t.key&&("Escape"!==t.key||!this.#_)||this.#p()}#p(){this.#_=!this.#_,this.#_?(this.#c(),this.#f.addEventListener("click",this.#u),this.#f.addEventListener("keydown",this.#a)):(this.#h(),this.#f.removeEventListener("click",this.#u),this.#f.removeEventListener("keydown",this.#a))}#c(){this.#E||this.render(),this.isVisible?this.#_&&this.#f.classList.add("focused"):(this.#f.hidden=!1,this.#f.style.zIndex=parseInt(this.#f.style.zIndex)+1e3)}#h(){this.#f.classList.remove("focused"),!this.#_&&this.isVisible&&(this.#f.hidden=!0,this.#f.style.zIndex=parseInt(this.#f.style.zIndex)-1e3)}forceHide(){this.#S=this.isVisible,this.#S&&(this.#f.hidden=!0)}maybeShow(){this.#S&&(this.#S=!1,this.#f.hidden=!1)}get isVisible(){return!1===this.#f.hidden}}class T extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=r.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let t=document.createElement("div");for(let e of(t.classList.add("annotationTextContent"),t.setAttribute("role","comment"),this.textContent)){let i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}class S extends p{#C=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let t=this.data,{width:e,height:i}=c(t.rect),r=this.svgFactory.create(e,i,!0),s=this.#C=this.svgFactory.createElement("svg:line");return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),r.append(s),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#C}addHighlightArea(){this.container.classList.add("highlightArea")}}class C extends p{#M=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let t=this.data,{width:e,height:i}=c(t.rect),r=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,n=this.#M=this.svgFactory.createElement("svg:rect");return n.setAttribute("x",s/2),n.setAttribute("y",s/2),n.setAttribute("width",e-s),n.setAttribute("height",i-s),n.setAttribute("stroke-width",s||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),r.append(n),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#M}addHighlightArea(){this.container.classList.add("highlightArea")}}class M extends p{#R=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let t=this.data,{width:e,height:i}=c(t.rect),r=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,n=this.#R=this.svgFactory.createElement("svg:ellipse");return n.setAttribute("cx",e/2),n.setAttribute("cy",i/2),n.setAttribute("rx",e/2-s/2),n.setAttribute("ry",i/2-s/2),n.setAttribute("stroke-width",s||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),r.append(n),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#R}addHighlightArea(){this.container.classList.add("highlightArea")}}class R extends p{#P=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let t=this.data,{width:e,height:i}=c(t.rect),r=this.svgFactory.create(e,i,!0),s=[];for(let e of t.vertices){let i=e.x-t.rect[0],r=t.rect[3]-e.y;s.push(i+","+r)}s=s.join(" ");let n=this.#P=this.svgFactory.createElement(this.svgElementName);return n.setAttribute("points",s),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),r.append(n),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#P}addHighlightArea(){this.container.classList.add("highlightArea")}}class P extends R{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class I extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
1class k extends p{#I=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=r.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let t=this.data,{width:e,height:i}=c(t.rect),r=this.svgFactory.create(e,i,!0);for(let e of t.inkLists){let i=[];for(let r of e){let e=r.x-t.rect[0],s=t.rect[3]-r.y;i.push(`${e},${s}`)}i=i.join(" ");let s=this.svgFactory.createElement(this.svgElementName);this.#I.push(s),s.setAttribute("points",i),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!t.popupRef&&this.hasPopupData&&this._createPopup(),r.append(s)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return this.#I}addHighlightArea(){this.container.classList.add("highlightArea")}}class L extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class D extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class F extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class O extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class N extends p{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class B extends p{#k=null;constructor(t){super(t,{isRenderable:!0});let{filename:e,content:i}=this.data.file;this.filename=(0,s.getFilenameFromUrl)(e,!0),this.content=i,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:i})}render(){let t;this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:i}=this;i.hasAppearance||0===i.fillAlpha?t=document.createElement("div"):((t=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(t.style=`filter: opacity(${Math.round(100*i.fillAlpha)}%);`)),t.addEventListener("dblclick",this.#L.bind(this)),this.#k=t;let{isMac:s}=r.FeatureTest.platform;return e.addEventListener("keydown",t=>{"Enter"===t.key&&(s?t.metaKey:t.ctrlKey)&&this.#L()}),!i.popupRef&&this.hasPopupData?this._createPopup():t.classList.add("popupTriggerArea"),e.append(t),e}getElementsToTriggerPopup(){return this.#k}addHighlightArea(){this.container.classList.add("highlightArea")}#L(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class U{#D=null;#F=null;#O=new Map;constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:r,page:s,viewport:n}){this.div=t,this.#D=e,this.#F=i,this.page=s,this.viewport=n,this.zIndex=0,this._annotationEditorUIManager=r}#N(t,e){let i=t.firstChild||t;i.id=`${r.AnnotationPrefix}${e}`,this.div.append(t),this.#D?.moveElementInDOM(this.div,t,i,!1)}async render(t){let{annotations:e}=t,i=this.div;(0,s.setLayerDimensions)(i,this.viewport);let a=new Map,o={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new s.DOMSVGFactory,annotationStorage:t.annotationStorage||new n.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let t of e){if(t.noHTML)continue;let e=t.annotationType===r.AnnotationType.POPUP;if(e){let e=a.get(t.id);if(!e)continue;o.elements=e}else{let{width:e,height:i}=c(t.rect);if(e<=0||i<=0)continue}o.data=t;let i=u.create(o);if(!i.isRenderable)continue;if(!e&&t.popupRef){let e=a.get(t.popupRef);e?e.push(i):a.set(t.popupRef,[i])}let s=i.render();t.hidden&&(s.style.visibility="hidden"),this.#N(s,t.id),i.annotationEditorType>0&&(this.#O.set(i.data.id,i),this._annotationEditorUIManager?.renderAnnotationElement(i))}this.#B()}update({viewport:t}){let e=this.div;this.viewport=t,(0,s.setLayerDimensions)(e,{rotation:t.rotation}),this.#B(),e.hidden=!1}#B(){if(!this.#F)return;let t=this.div;for(let[e,i]of this.#F){let r=t.querySelector(`[data-annotation-id="${e}"]`);if(!r)continue;i.className="annotationContent";let{firstChild:s}=r;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):r.append(i)}this.#F.clear()}getEditableAnnotations(){return Array.from(this.#O.values())}getEditableAnnotation(t){return this.#O.get(t)}}},9792:(t,e,i)=>{i.d(e,{AnnotationStorage:()=>o,PrintAnnotationStorage:()=>l,SerializableEmpty:()=>a}),i(4114),i(1454),i(4979);var r=i(4292),s=i(310),n=i(7651);let a=Object.freeze({map:null,hash:"",transfer:void 0});class o{#U=!1;#H=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){let i=this.#H.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#H.get(t)}remove(t){if(this.#H.delete(t),0===this.#H.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let t of this.#H.values())if(t instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){let i=this.#H.get(t),r=!1;if(void 0!==i)for(let[t,s]of Object.entries(e))i[t]!==s&&(r=!0,i[t]=s);else r=!0,this.#H.set(t,e);r&&this.#z(),e instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#H.has(t)}getAll(){return this.#H.size>0?(0,r.objectFromMap)(this.#H):null}setAll(t){for(let[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#H.size}#z(){this.#U||(this.#U=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#U&&(this.#U=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new l(this)}get serializable(){if(0===this.#H.size)return a;let t=new Map,e=new n.MurmurHash3_64,i=[],r=Object.create(null),o=!1;for(let[i,n]of this.#H){let a=n instanceof s.AnnotationEditor?n.serialize(!1,r):n;a&&(t.set(i,a),e.update(`${i}:${JSON.stringify(a)}`),o||=!!a.bitmap)}if(o)for(let e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:a}get editorStats(){let t=null,e=new Map;for(let i of this.#H.values()){if(!(i instanceof s.AnnotationEditor))continue;let r=i.telemetryFinalData;if(!r)continue;let{type:n}=r;e.has(n)||e.set(n,Object.getPrototypeOf(i).constructor),t||=Object.create(null);
1let a=t[n]||=new Map;for(let[t,e]of Object.entries(r)){if("type"===t)continue;let i=a.get(t);i||(i=new Map,a.set(t,i));let r=i.get(e)??0;i.set(e,r+1)}}for(let[i,r]of e)t[i]=r.computeTelemetryFinalData(t[i]);return t}}class l extends o{#j;constructor(t){super();let{map:e,hash:i,transfer:r}=t.serializable,s=structuredClone(e,r?{transfer:r}:null);this.#j={map:s,hash:i,transfer:r}}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#j}}},3831:(t,e,i)=>{i.a(t,async(t,r)=>{try{i.d(e,{PDFDataRangeTransport:()=>P,PDFWorker:()=>F,build:()=>j,getDocument:()=>E,version:()=>z}),i(4114),i(6573),i(8100),i(7936),i(4628),i(7467),i(4732),i(9577),i(1454),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197),i(4979),i(4603),i(7566),i(8721);var s=i(4292),n=i(9792),a=i(5419),o=i(10),l=i(1573),d=i(4923),c=i(6814),u=i(6164),p=i(5178),g=i(6062),f=i(5626),m=i(585),b=i(4094),v=i(7457),A=i(4786),y=i(2050),_=t([l,A]);[l,A]=_.then?(await _)():_;let T=s.isNodeJS?l.NodeCanvasFactory:a.DOMCanvasFactory,S=s.isNodeJS?l.NodeCMapReaderFactory:a.DOMCMapReaderFactory,C=s.isNodeJS?l.NodeFilterFactory:a.DOMFilterFactory,M=s.isNodeJS?l.NodeStandardFontDataFactory:a.DOMStandardFontDataFactory;function E(t){if("string"==typeof t||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t}),"object"!=typeof t)throw Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw Error("Invalid parameter object: need either .data, .range or .url");let e=new R,{docId:i}=e,r=t.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(s.isNodeJS&&"string"==typeof t)return t}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(t.url):null,n=t.data?function(t){if(s.isNodeJS&&void 0!==h&&t instanceof h)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,s.stringToBytes)(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"==typeof t&&!isNaN(t?.length))return new Uint8Array(t);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(t.data):null,o=t.httpHeaders||null,l=!0===t.withCredentials,d=t.password??null,c=t.range instanceof P?t.range:null,g=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:65536,f=t.worker instanceof F?t.worker:null,y=t.verbosity,_="string"!=typeof t.docBaseUrl||(0,a.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,E="string"==typeof t.cMapUrl?t.cMapUrl:null,x=!1!==t.cMapPacked,I=t.CMapReaderFactory||S,k="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,L=t.StandardFontDataFactory||M,D=!0!==t.stopAtErrors,N=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,B=!1!==t.isEvalSupported,U="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!s.isNodeJS,H=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,z="boolean"==typeof t.disableFontFace?t.disableFontFace:s.isNodeJS,j=!0===t.fontExtraProperties,$=!0===t.enableXfa,V=t.ownerDocument||globalThis.document,G=!0===t.disableRange,W=!0===t.disableStream,q=!0===t.disableAutoFetch,K=!0===t.pdfBug,X=c?c.length:t.length??NaN,Y="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!s.isNodeJS&&!z,J="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:I===a.DOMCMapReaderFactory&&L===a.DOMStandardFontDataFactory&&E&&k&&(0,a.isValidFetchUrl)(E,document.baseURI)&&(0,a.isValidFetchUrl)(k,document.baseURI),Q=t.canvasFactory||new T({ownerDocument:V}),Z=t.filterFactory||new C({docId:i,ownerDocument:V});(0,s.setVerbosityLevel)(y);let tt={canvasFactory:Q,filterFactory:Z};if(J||(tt.cMapReaderFactory=new I({baseUrl:E,isCompressed:x}),tt.standardFontDataFactory=new L({baseUrl:k})),!f){let t={verbosity:y,port:u.GlobalWorkerOptions.workerPort};f=t.port?F.fromPort(t):new F(t),e._worker=f}let te={docId:i,apiVersion:"4.2.67",data:n,password:d,disableAutoFetch:q,rangeChunkSize:g,length:X,docBaseUrl:_,enableXfa:$,evaluatorOptions:{maxImageSize:N,disableFontFace:z,
1ignoreErrors:D,isEvalSupported:B,isOffscreenCanvasSupported:U,canvasMaxAreaInBytes:H,fontExtraProperties:j,useSystemFonts:Y,cMapUrl:J?E:null,standardFontDataUrl:J?k:null}},ti={ignoreErrors:D,disableFontFace:z,fontExtraProperties:j,enableXfa:$,ownerDocument:V,disableAutoFetch:q,pdfBug:K,styleElement:null};return f.promise.then(function(){if(e.destroyed)throw Error("Loading aborted");let t=w(f,te),h=new Promise(function(t){let e;if(c)e=new m.PDFDataTransportStream(c,{disableRange:G,disableStream:W});else if(!n){var i;i={url:r,length:X,httpHeaders:o,withCredentials:l,rangeChunkSize:g,disableRange:G,disableStream:W},e=s.isNodeJS?"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&(0,a.isValidFetchUrl)(i.url)?new b.PDFFetchStream(i):new A.PDFNodeStream(i):(0,a.isValidFetchUrl)(i.url)?new b.PDFFetchStream(i):new v.PDFNetworkStream(i)}t(e)});return Promise.all([t,h]).then(function([t,r]){if(e.destroyed)throw Error("Loading aborted");let s=new p.MessageHandler(i,t,f.port),n=new O(s,e,r,ti,tt);e._transport=n,s.send("Ready",null)})}).catch(e._capability.reject),e}async function w(t,e){if(t.destroyed)throw Error("Worker was destroyed");let i=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw Error("Worker was destroyed");return i}function x(t){return"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}class R{static #$=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${R.#$++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class P{constructor(t,e,i=!1,r=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(let i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(let i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(let e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,s.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class I{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,s.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){let{renderingIntent:e}
1=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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 k{#V=null;#G=!1;constructor(t,e,i,r=!1){this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=r?new a.StatTimer:null,this._pdfBug=r,this.commonObjs=i.commonObjs,this.objs=new B,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}={}){return new a.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations({intent:t="display"}={}){let{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,s.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:r=s.AnnotationMode.ENABLE,transform:n=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:d=null}){this._stats?.time("Overall");let c=this._transport.getRenderingIntent(i,r,d),{renderingIntent:u,cacheKey:p}=c;this.#G=!1,this.#W(),o||=this._transport.getOptionalContentConfig(u);let g=this._intentStates.get(p);g||(g=Object.create(null),this._intentStates.set(p,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);let f=!!(u&s.RenderingIntentFlag.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(c));let m=t=>{g.renderTasks.delete(b),(this._maybeCleanupAfterRender||f)&&(this.#G=!0),this.#q(!f),t?(b.capability.reject(t),this._abortOperatorList({intentState:g,reason:t instanceof Error?t:Error(t)})):b.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},b=new H({callback:m,params:{canvasContext:t,viewport:e,transform:n,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!f,pdfBug:this._pdfBug,pageColors:h});(g.renderTasks||=new Set).add(b);let v=b.task;return Promise.all([g.displayReadyCapability.promise,o]).then(([t,e])=>{if(this.destroyed){m();return}if(this._stats?.time("Rendering"),!(e.renderingIntent&u))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");b.initializeGraphics({transparency:t,optionalContentConfig:e}),b.operatorListChanged()}).catch(m),v}getOperatorList({intent:t="display",annotationMode:e=s.AnnotationMode.ENABLE,printAnnotationStorage:i=null}={}){let r;
1let n=this._transport.getRenderingIntent(t,e,i,!0),a=this._intentStates.get(n.cacheKey);return a||(a=Object.create(null),this._intentStates.set(n.cacheKey,a)),a.opListReadCapability||((r=Object.create(null)).operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(r))},a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(r),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(n)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(t=>y.XfaText.textContent(t));let e=this.streamTextContent(t);return new Promise(function(t,i){let r=e.getReader(),s={items:[],styles:Object.create(null)};!function e(){r.read().then(function({value:i,done:r}){if(r){t(s);return}Object.assign(s.styles,i.styles),s.items.push(...i.items),e()},i)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let t=[];for(let e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(let i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#G=!1,this.#W(),Promise.all(t)}cleanup(t=!1){this.#G=!0;let e=this.#q(!1);return t&&e&&(this._stats&&=new a.StatTimer),e}#q(t=!1){if(this.#W(),!this.#G||this.destroyed)return!1;if(t)return this.#V=setTimeout(()=>{this.#V=null,this.#q(!1)},5e3),!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#G=!1,!0}#W(){this.#V&&(clearTimeout(this.#V),this.#V=null)}_startRenderPage(t,e){let i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,r=t.length;i<r;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);for(let i of(e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots,e.renderTasks))i.operatorListChanged();t.lastChunk&&this.#q(!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i}){let{map:r,transfer:s}=i,n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r},s).getReader(),a=this._intentStates.get(e);a.streamReader=n;let o=()=>{n.read().then(({value:t,done:e})=>{if(e){a.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(t,a),o())},t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){for(let t of(a.operatorList.lastChunk=!0,a.renderTasks))t.operatorListChanged();this.#q(!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else if(a.opListReadCapability)a.opListReadCapability.reject(t);else throw t}})};o()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof a.RenderingCancelledException){let i=100;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new s.AbortException(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(let[e,i]of this._intentStates)if(i===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}class L{#K=new Set;#X=Promise.resolve();postMessage(t,e){let i={data:structuredClone(t,e?{transfer:e}:null)};this.#X.then(()=>{for(let t of this.#K)t.call(this,i)})}addEventListener(t,e){this.#K.add(e)}removeEventListener(t,e){this.#K.delete(e)}terminate(){this.#K.clear()}}let D={isWorkerDisabled:!1,fakeWorkerId:0};s.isNodeJS&&(D.isWorkerDisabled=!0,u.GlobalWorkerOptions.workerSrc||="./pdf.worker.mjs"),D.isSameOrigin=function(t,e){let i;try{if(!(i=new URL(t)).origin||"null"===i.origin)return!1}catch{return!1}let r=new URL(e,i);return i.origin===r.origin},D.createCDNWrapper=function(t){let e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};class F{static #Y;constructor({name:t=null,port:e=null,verbosity:i=(0,s.getVerbosityLevel)()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if(F.#Y?.has(e))throw Error("Cannot use more than one PDFWorker per port.");(F.#Y||=new WeakMap).set(e,this),this._initializeFromPort(e);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new p.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!D.isWorkerDisabled&&!F.#J){let{workerSrc:t}=F;try{D.isSameOrigin(window.location.href,t)||(t=D.createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t,{type:"module"}),i=new p.MessageHandler("main","worker",e),r=()=>{e.removeEventListener("error",s),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||r()};e.addEventListener("error",s),i.on("test",t=>{if(e.removeEventListener("error",s),this.destroyed){r();return}t?(this._messageHandler=i,this._port=e,this._webWorker=e,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),e.terminate())}),i.on("ready",t=>{if(e.removeEventListener("error",s),this.destroyed){r();return}try{n()}catch{this._setupFakeWorker()}});let n=()=>{let t=new Uint8Array;i.send("test",t,[t.buffer])};n();return}catch{(0,s.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){D.isWorkerDisabled||((0,s.warn)("Setting up fake worker."),D.isWorkerDisabled=!0),F._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let e=new L;this._port=e;let i=`fake${D.fakeWorkerId++}`,r=new p.MessageHandler(i+"_worker",i,e);t.setup(r,e);let s=new p.MessageHandler(i,i+"_worker",e);this._messageHandler=s,this._readyCapability.resolve(),s.send("configure",{verbosity:this.verbosity})}).catch(t=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),F.#Y?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw Error("PDFWorker.fromPort - invalid method signature.");let e=this.#Y?.get(t.port);
1if(e){if(e._pendingDestroy)throw Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new F(t)}static get workerSrc(){if(u.GlobalWorkerOptions.workerSrc)return u.GlobalWorkerOptions.workerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get #J(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let t=async()=>this.#J?this.#J:(await import(this.workerSrc)).WorkerMessageHandler;return(0,s.shadow)(this,"_setupFakeWorkerGlobal",t())}}class O{#Q=new Map;#Z=new Map;#tt=new Map;#te=new Map;#ti=null;constructor(t,e,i,r,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new B,this.fontLoader=new o.FontLoader({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#tr(t,e=null){let i=this.#Q.get(t);if(i)return i;let r=this.messageHandler.sendWithPromise(t,e);return this.#Q.set(t,r),r}get annotationStorage(){return(0,s.shadow)(this,"annotationStorage",new n.AnnotationStorage)}getRenderingIntent(t,e=s.AnnotationMode.ENABLE,i=null,r=!1){let a=s.RenderingIntentFlag.DISPLAY,o=n.SerializableEmpty;switch(t){case"any":a=s.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=s.RenderingIntentFlag.PRINT;break;default:(0,s.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case s.AnnotationMode.DISABLE:a+=s.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case s.AnnotationMode.ENABLE:break;case s.AnnotationMode.ENABLE_FORMS:a+=s.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case s.AnnotationMode.ENABLE_STORAGE:o=((a+=s.RenderingIntentFlag.ANNOTATIONS_STORAGE)&s.RenderingIntentFlag.PRINT&&i instanceof n.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,s.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return r&&(a+=s.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:`${a}_${o.hash}`,annotationStorageSerializable:o}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#ti?.reject(Error("Worker was destroyed during onPassword callback"));let t=[];for(let e of this.#Z.values())t.push(e._destroy());this.#Z.clear(),this.#tt.clear(),this.#te.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Q.clear(),this.filterFactory.destroy(),(0,c.cleanupTextLayer)(),this._networkStream?.cancelAllRequests(new s.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{(0,s.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function({value:t,done:i}){if(i){e.close();return}(0,s.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",t=>{let i=Promise.withResolvers(),r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),r.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},i.reject),i.promise}),t.on("GetRangeReader",(t,e)=>{(0,s.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let i=this._networkStream.getRangeReader(t.begin,t.end);if(!i){e.close();return}e.onPull=()=>{i.read().then(function({value:t,done:i}){if(i){e.close();return}(0,s.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(t),1,[t])}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,e._capability.resolve(new I(t,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new s.PasswordException(t.message,t.code);break;case"InvalidPDFException":i=new s.InvalidPDFException(t.message);break;case"MissingPDFException":i=new s.MissingPDFException(t.message);break;case"UnexpectedResponseException":i=new s.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":i=new s.UnknownErrorException(t.message,t.details);break;default:(0,s.unreachable)("DocException - expected a valid Error.")}e._capability.reject(i)}
1),t.on("PasswordRequest",t=>{if(this.#ti=Promise.withResolvers(),e.onPassword)try{e.onPassword(t=>{t instanceof Error?this.#ti.reject(t):this.#ti.resolve({password:t})},t.code)}catch(t){this.#ti.reject(t)}else this.#ti.reject(new s.PasswordException(t.message,t.code));return this.#ti.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#Z.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",([e,i,r])=>{if(this.destroyed||this.commonObjs.has(e))return null;switch(i){case"Font":let n=this._params;if("error"in r){let t=r.error;(0,s.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(e,t);break}let a=n.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,l=new o.FontFaceObject(r,{disableFontFace:n.disableFontFace,ignoreErrors:n.ignoreErrors,inspectFont:a});this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:e})).finally(()=>{!n.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(e,l)});break;case"CopyLocalImage":let{imageRef:h}=r;for(let t of((0,s.assert)(h,"The imageRef must be defined."),this.#Z.values()))for(let[,i]of t.objs)if(i.ref===h){if(!i.dataLen)return null;return this.commonObjs.resolve(e,structuredClone(i)),i.dataLen}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,r);break;default:throw Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([t,e,i,r])=>{if(this.destroyed)return;let n=this.#Z.get(e);if(!n.objs.has(t)){if(0===n._intentStates.size){r?.bitmap?.close();return}switch(i){case"Image":n.objs.resolve(t,r),r?.dataLen>s.MAX_IMAGE_SIZE_TO_CACHE&&(n._maybeCleanupAfterRender=!0);break;case"Pattern":n.objs.resolve(t,r);break;default:throw Error(`Got unknown object type ${i}`)}}}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),t.on("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,s.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(Error("Invalid page request."));let e=t-1,i=this.#tt.get(e);if(i)return i;let r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(i=>{if(this.destroyed)throw Error("Transport destroyed");i.refStr&&this.#te.set(i.refStr,t);let r=new k(e,i,this,this._params.pdfBug);return this.#Z.set(e,r),r});return this.#tt.set(e,r),r}getPageIndex(t){return x(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#tr("GetFieldObjects")}hasJSActions(){return this.#tr("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}
1getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#tr("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#tr("GetOptionalContentConfig").then(e=>new f.OptionalContentConfig(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let t="GetMetadata",e=this.#Q.get(t);if(e)return e;let i=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new g.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#Q.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){for(let t of(await this.messageHandler.sendWithPromise("Cleanup",null),this.#Z.values()))if(!t.cleanup())throw Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#Q.clear(),this.filterFactory.destroy(!0),(0,c.cleanupTextLayer)()}}cachedPageNumber(t){if(!x(t))return null;let e=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;return this.#te.get(e)??null}get loadingParams(){let{disableAutoFetch:t,enableXfa:e}=this._params;return(0,s.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}let N=Symbol("INITIAL_DATA");class B{#ts=Object.create(null);#tn(t){return this.#ts[t]||={...Promise.withResolvers(),data:N}}get(t,e=null){if(e){let i=this.#tn(t);return i.promise.then(()=>e(i.data)),null}let i=this.#ts[t];if(!i||i.data===N)throw Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){let e=this.#ts[t];return!!e&&e.data!==N}resolve(t,e=null){let i=this.#tn(t);i.data=e,i.resolve()}clear(){for(let t in this.#ts){let{data:e}=this.#ts[t];e?.bitmap?.close()}this.#ts=Object.create(null)}*[Symbol.iterator](){for(let t in this.#ts){let{data:e}=this.#ts[t];e!==N&&(yield[t,e])}}}class U{#ta=null;constructor(t){this.#ta=t,this.onContinue=null}get promise(){return this.#ta.capability.promise}cancel(t=0){this.#ta.cancel(null,t)}get separateAnnots(){let{separateAnnots:t}=this.#ta.operatorList;if(!t)return!1;let{annotationCanvasMap:e}=this.#ta;return t.form||t.canvas&&e?.size>0}}class H{static #to=new WeakSet;constructor({callback:t,params:e,objs:i,commonObjs:r,annotationCanvasMap:s,operatorList:n,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:c=null}){this.callback=t,this.params=e,this.objs=i,this.commonObjs=r,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=n,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=d,this.pageColors=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new U(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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(H.#to.has(this._canvas))throw Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");H.#to.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:i,viewport:r,transform:s,background:n}=this.params;this.gfx=new d.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:r,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),H.#to.delete(this._canvas),this.callback(t||new a.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}
1):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){!this.cancelled&&(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),H.#to.delete(this._canvas),this.callback())))}}let z="4.2.67",j="49b388101";r()}catch(t){r(t)}})},2583:(t,e,i)=>{i.d(e,{BaseCMapReaderFactory:()=>a,BaseCanvasFactory:()=>n,BaseFilterFactory:()=>s,BaseSVGFactory:()=>l,BaseStandardFontDataFactory:()=>o});var r=i(4292);class s{constructor(){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,i,r,s){return"none"}destroy(t=!1){}}class n{constructor(){this.constructor===n&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw Error("Invalid canvas size");let i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d")}}reset(t,e,i){if(!t.canvas)throw Error("Canvas is not specified");if(e<=0||i<=0)throw Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}class a{constructor({baseUrl:t=null,isCompressed:e=!0}){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(e,i).catch(t=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}_fetchData(t,e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}class o{constructor({baseUrl:t=null}){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw Error("Font filename must be specified.");let e=`${this.baseUrl}${t}`;return this._fetchData(e).catch(t=>{throw Error(`Unable to load font data at: ${e}`)})}_fetchData(t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e,i=!1){if(t<=0||e<=0)throw Error("Invalid SVG dimensions");let r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),i||(r.setAttribute("width",`${t}px`),r.setAttribute("height",`${e}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${t} ${e}`),r}createElement(t){if("string"!=typeof t)throw Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,r.unreachable)("Abstract method `_createSVG` called.")}}},4923:(t,e,i)=>{i.d(e,{CanvasGraphics:()=>M}),i(4114),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577),i(8992),i(4520),i(1454);var r=i(4292),s=i(5419);let n={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(t,e){if(!e)return;let i=e[2]-e[0],r=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,r),t.clip(s)}class o{constructor(){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;for(let i of("axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)),this._colorStops))e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,o){let l;if(o===n.STROKE||o===n.FILL){let n=e.current.getClippedPathBoundingBox(o,(0,s.getCurrentTransform)(t))||[0,0,0,0],h=Math.ceil(n[2]-n[0])||1,d=Math.ceil(n[3]-n[1])||1,c=e.cachedCanvases.getCanvas("pattern",h,d,!0),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-n[0],-n[1]),i=r.Util.transform(i,[1,0,0,1,n[0],n[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix
1),a(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=t.createPattern(c.canvas,"no-repeat");let p=new DOMMatrix(i);l.setTransform(p)}else a(t,this._bbox),l=this._createGradient(t);return l}}function h(t,e,i,r,s,n,a,o){let l,h,d,c,u,p,g,f,m;let b=e.coords,v=e.colors,A=t.data,y=4*t.width;b[i+1]>b[r+1]&&(l=i,i=r,r=l,l=n,n=a,a=l),b[r+1]>b[s+1]&&(l=r,r=s,s=l,l=a,a=o,o=l),b[i+1]>b[r+1]&&(l=i,i=r,r=l,l=n,n=a,a=l);let _=(b[i]+e.offsetX)*e.scaleX,E=(b[i+1]+e.offsetY)*e.scaleY,w=(b[r]+e.offsetX)*e.scaleX,x=(b[r+1]+e.offsetY)*e.scaleY,T=(b[s]+e.offsetX)*e.scaleX,S=(b[s+1]+e.offsetY)*e.scaleY;if(E>=S)return;let C=v[n],M=v[n+1],R=v[n+2],P=v[a],I=v[a+1],k=v[a+2],L=v[o],D=v[o+1],F=v[o+2],O=Math.round(E),N=Math.round(S);for(let t=O;t<=N;t++){let e;if(t<x){let e=t<E?0:(E-t)/(E-x);h=_-(_-w)*e,d=C-(C-P)*e,c=M-(M-I)*e,u=R-(R-k)*e}else{let e;e=t>S?1:x===S?0:(x-t)/(x-S),h=w-(w-T)*e,d=P-(P-L)*e,c=I-(I-D)*e,u=k-(k-F)*e}e=t<E?0:t>S?1:(E-t)/(E-S),p=_-(_-T)*e,g=C-(C-L)*e,f=M-(M-D)*e,m=R-(R-F)*e;let i=Math.round(Math.min(h,p)),r=Math.round(Math.max(h,p)),s=y*t+4*i;for(let t=i;t<=r;t++)(e=(h-t)/(h-p))<0?e=0:e>1&&(e=1),A[s++]=d-(d-g)*e|0,A[s++]=c-(c-f)*e|0,A[s++]=u-(u-m)*e|0,A[s++]=255}}class d extends o{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){let r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),n=Math.ceil(this._bounds[2])-r,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(n*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*t[1]*1.1)),3e3),d=n/o,c=a/l,u={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-s,scaleX:1/d,scaleY:1/c},p=o+4,g=l+4,f=i.getCanvas("mesh",p,g,!1),m=f.context,b=m.createImageData(o,l);if(e){let t=b.data;for(let i=0,r=t.length;i<r;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(let t of this._figures)!function(t,e,i){let r,s;let n=e.coords,a=e.colors;switch(e.type){case"lattice":let o=e.verticesPerRow,l=Math.floor(n.length/o)-1,d=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<d;r++,e++)h(t,i,n[e],n[e+1],n[e+o],a[e],a[e+1],a[e+o]),h(t,i,n[e+o+1],n[e+1],n[e+o],a[e+o+1],a[e+1],a[e+o])}break;case"triangles":for(r=0,s=n.length;r<s;r+=3)h(t,i,n[r],n[r+1],n[r+2],a[r],a[r+1],a[r+2]);break;default:throw Error("illegal figure")}}(b,t,u);return m.putImageData(b,2,2),{canvas:f.canvas,offsetX:r-2*d,offsetY:s-2*c,scaleX:d,scaleY:c}}getPattern(t,e,i,o){let l;if(a(t,this._bbox),o===n.SHADING)l=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(t));else if(l=r.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){let t=r.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*t[0],l[1]*t[1]]}let h=this._createMeshCanvas(l,o===n.SHADING?null:this._background,e.cachedCanvases);return o!==n.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(h.offsetX,h.offsetY),t.scale(h.scaleX,h.scaleY),t.createPattern(h.canvas,"no-repeat")}}class c extends o{getPattern(){return"hotpink"}}let u={COLORED:1,UNCOLORED:2};class p{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,r,s){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=r,this.baseTransform=s}createPatternCanvas(t){let e=this.operatorList,i=this.bbox,n=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,h=this.color,d=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+l);let c=i[0],u=i[1],p=i[2],g=i[3],f=r.Util.singularValueDecompose2dScale(this.matrix),m=r.Util.singularValueDecompose2dScale(this.baseTransform),b=[f[0]*m[0],f[1]*m[1]],v=this.getSizeAndScale(n,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(a,this.ctx.canvas.height,b[1]),y=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),_=y.context,E=d.createCanvasGraphics(_);E.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(E,o,h);let w=c,x=u,T=p,S=g;return c<0&&(w=0,T+=Math.abs(c)),u<0&&(x=0,S+=Math.abs(u)),_.translate(-(v.scale*w),-(A.scale*x)),E.transform(v.scale,0,0,A.scale,0,0),_.save(),this.clipBbox(E,w,x,T,S),E.baseTransform=(0,s.getCurrentTransform)(E.ctx),E.executeOperatorList(e),E.endDrawing(),{canvas:y.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:w,offsetY:x}}getSizeAndScale(t,e,i){t=Math.abs(t);let r=Math.max(p.MAX_PATTERN_SIZE,e),s=Math.ceil(t*i);return s>=r?s=r:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,r,n){let a=r-e,o=n-i;t.ctx.rect(e,i,a,o),t.current.updateRectMinMax((0,s.getCurrentTransform)(t.ctx),[e,i,r,n]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){let s=t.ctx,n=t.current;switch(e){case u.COLORED:let a=this.ctx;s.fillStyle=a.fillStyle,s.strokeStyle=a.strokeStyle,n.fillColor=a.fillStyle,n.strokeColor=a.strokeStyle;break;case u.UNCOLORED:let o=r.Util.makeHexColor(i[0],i[1],i[2]);s.fillStyle=o,s.strokeStyle=o,n.fillColor=o,n.strokeColor=o;break;default:throw new r.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,s){let a=i;s!==n.SHADING&&(a=r.Util.transform(a,e.baseTransform),this.matrix&&(a=r.Util.transform(a,this.matrix
1)));let o=this.createPatternCanvas(e),l=new DOMMatrix(a);l=(l=l.translate(o.offsetX,o.offsetY)).scale(1/o.scaleX,1/o.scaleY);let h=t.createPattern(o.canvas,"repeat");return h.setTransform(l),h}}class g{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let r;return void 0!==this.cache[t]?(r=this.cache[t],this.canvasFactory.reset(r,e,i)):(r=this.canvasFactory.create(e,i),this.cache[t]=r),r}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function f(t,e,i,r,n,a,o,l,h,d){let[c,u,p,g,f,m]=(0,s.getCurrentTransform)(t);if(0===u&&0===p){let s=Math.round(o*c+f),b=Math.round(l*g+m),v=Math.abs(Math.round((o+h)*c+f)-s)||1,A=Math.abs(Math.round((l+d)*g+m)-b)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(g),s,b),t.drawImage(e,i,r,n,a,0,0,v,A),t.setTransform(c,u,p,g,f,m),[v,A]}if(0===c&&0===g){let s=Math.round(l*p+f),b=Math.round(o*u+m),v=Math.abs(Math.round((l+d)*p+f)-s)||1,A=Math.abs(Math.round((o+h)*u+m)-b)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,s,b),t.drawImage(e,i,r,n,a,0,0,A,v),t.setTransform(c,u,p,g,f,m),[A,v]}t.drawImage(e,i,r,n,a,o,l,h,d);let b=Math.hypot(c,u),v=Math.hypot(p,g);return[b*h,v*d]}class m{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=r.Util.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){let i=r.Util.applyTransform(e,t),s=r.Util.applyTransform(e.slice(2),t),n=r.Util.applyTransform([e[0],e[3]],t),a=r.Util.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],s[0],n[0],a[0]),this.minY=Math.min(this.minY,i[1],s[1],n[1],a[1]),this.maxX=Math.max(this.maxX,i[0],s[0],n[0],a[0]),this.maxY=Math.max(this.maxY,i[1],s[1],n[1],a[1])}updateScalingPathMinMax(t,e){r.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,s,n,a,o,l,h,d){let c=r.Util.bezierBoundingBox(e,i,s,n,a,o,l,h,d);d||this.updateRectMinMax(t,c)}getPathBoundingBox(t=n.FILL,e=null){let i=[this.minX,this.minY,this.maxX,this.maxY];if(t===n.STROKE){e||(0,r.unreachable)("Stroke bounding box must include transform.");let t=r.Util.singularValueDecompose2dScale(e),s=t[0]*this.lineWidth/2,n=t[1]*this.lineWidth/2;i[0]-=s,i[1]-=n,i[2]+=s,i[3]+=n}return i}updateClipFromPath(){let t=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=n.FILL,e=null){return r.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function b(t,e){let i,s,n,a;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}let o=e.height,l=e.width,h=o%16,d=(o-h)/16,c=0===h?d:d+1,u=t.createImageData(l,16),p=0,g,f=e.data,m=u.data;if(e.kind===r.ImageKind.GRAYSCALE_1BPP){let e=f.byteLength,a=new Uint32Array(m.buffer,0,m.byteLength>>2),o=a.length,b=l+7>>3,v=r.FeatureTest.isLittleEndian?4278190080:255;for(i=0;i<c;i++){for(s=0,n=i<d?16:h,g=0;s<n;s++){let t=e-p,i=0,r=t>b?l:8*t-7,s=-8&r,n=0,o=0;for(;i<s;i+=8)o=f[p++],a[g++]=128&o?4294967295:v,a[g++]=64&o?4294967295:v,a[g++]=32&o?4294967295:v,a[g++]=16&o?4294967295:v,a[g++]=8&o?4294967295:v,a[g++]=4&o?4294967295:v,a[g++]=2&o?4294967295:v,a[g++]=1&o?4294967295:v;for(;i<r;i++)0===n&&(o=f[p++],n=128),a[g++]=o&n?4294967295:v,n>>=1}
1for(;g<o;)a[g++]=0;t.putImageData(u,0,16*i)}}else if(e.kind===r.ImageKind.RGBA_32BPP){for(i=0,s=0,a=64*l;i<d;i++)m.set(f.subarray(p,p+a)),p+=a,t.putImageData(u,0,s),s+=16;i<c&&(a=l*h*4,m.set(f.subarray(p,p+a)),t.putImageData(u,0,s))}else if(e.kind===r.ImageKind.RGB_24BPP)for(i=0,n=16,a=l*n;i<c;i++){for(i>=d&&(n=h,a=l*n),g=0,s=a;s--;)m[g++]=f[p++],m[g++]=f[p++],m[g++]=f[p++],m[g++]=255;t.putImageData(u,0,16*i)}else throw Error(`bad image kind: ${e.kind}`)}function v(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}let i=e.height,s=e.width,n=i%16,a=(i-n)/16,o=0===n?a:a+1,l=t.createImageData(s,16),h=0,d=e.data,c=l.data;for(let e=0;e<o;e++){let i=e<a?16:n;({srcPos:h}=function({src:t,srcPos:e=0,dest:i,width:s,height:n,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let l=r.FeatureTest.isLittleEndian?4278190080:255,[h,d]=o?[a,l]:[l,a],c=s>>3,u=7&s,p=t.length;i=new Uint32Array(i.buffer);let g=0;for(let r=0;r<n;r++){for(let r=e+c;e<r;e++){let r=e<p?t[e]:255;i[g++]=128&r?d:h,i[g++]=64&r?d:h,i[g++]=32&r?d:h,i[g++]=16&r?d:h,i[g++]=8&r?d:h,i[g++]=4&r?d:h,i[g++]=2&r?d:h,i[g++]=1&r?d:h}if(0===u)continue;let r=e<p?t[e++]:255;for(let t=0;t<u;t++)i[g++]=r&1<<7-t?d:h}return{srcPos:e,destPos:g}}({src:d,srcPos:h,dest:c,width:s,height:i,nonBlackColor:0})),t.putImageData(l,0,16*e)}}function A(t,e){for(let i of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==t[i]&&(e[i]=t[i]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function y(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!r.isNodeJS){let{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function _(t,e,i){let r=t.length,s=1/255;for(let n=3;n<r;n+=4){let r=i?i[t[n]]:t[n];e[n]=e[n]*r*s|0}}function E(t,e,i){let r=t.length;for(let s=3;s<r;s+=4){let r=77*t[s-3]+152*t[s-2]+28*t[s-1];e[s]=i?e[s]*i[r>>8]>>8:e[s]*r>>16}}function w(t,e){if(e)return!0;let i=r.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);let n=Math.fround((globalThis.devicePixelRatio||1)*s.PixelsPerInch.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}let x=["butt","round","square"],T=["miter","round","bevel"],S={},C={};class M{constructor(t,e,i,r,s,{optionalContentConfig:n,markedContentStack:a=null},o,l){this.ctx=t,this.current=new m(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=r,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=n,this.cachedCanvases=new g(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:r=null}){let n=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||"#ffffff",this.ctx.fillRect(0,0,n,a),this.ctx.fillStyle=o,i){let t=this.cachedCanvases.getCanvas("transparent",n,a);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,s.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),y(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=(0,s.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,i,s){let n;let a=t.argsArray,o=t.fnArray,l=e||0,h=a.length;if(h===l)return l;let d=h-l>10&&"function"==typeof i,c=d?Date.now()+15:0,u=0,p=this.commonObjs,g=this.objs;for(;;){if(void 0!==s&&l===s.nextBreakPoint)return s.breakIt(l,i),l;if((n=o[l])!==r.OPS.dependency)this[n].apply(this,a[l]);else for(let t of a[l]){let e=t.startsWith("g_")?p:g;if(!e.has(t))return e.get(t,i),l}if(++l===h)return l;if(d&&++u>10){if(Date.now()>c)return i(),l;u=0}}}#tl(){for(;this.stateStack.length||this.inSMaskMode;
1)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){for(let t of(this.#tl(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#th()}#th(){if(this.pageColors){let t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){let e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){let i,r;let s=t.width,n=t.height,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=s,h=n,d="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,s=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(s=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/s),(r=(i=this.cachedCanvases.getCanvas(d,e,s)).context).clearRect(0,0,e,s),r.drawImage(t,0,0,l,h,0,0,e,s),t=i.canvas,l=e,h=s,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){let e,i,a,o;let l=this.ctx,{width:h,height:d}=t,c=this.current.fillColor,u=this.current.patternFill,p=(0,s.getCurrentTransform)(l);if((t.bitmap||t.data)&&t.count>1){let r=t.bitmap||t.data.buffer;i=JSON.stringify(u?p:[p.slice(0,4),c]),(e=this._cachedBitmapsMap.get(r))||(e=new Map,this._cachedBitmapsMap.set(r,e));let s=e.get(i);if(s&&!u){let t=Math.round(Math.min(p[0],p[2])+p[4]),e=Math.round(Math.min(p[1],p[3])+p[5]);return{canvas:s,offsetX:t,offsetY:e}}a=s}a||(o=this.cachedCanvases.getCanvas("maskCanvas",h,d),v(o.context,t));let g=r.Util.transform(p,[1/h,0,0,-1/d,0,0]);g=r.Util.transform(g,[1,0,0,1,0,-d]);let[m,b,A,y]=r.Util.getAxialAlignedBoundingBox([0,0,h,d],g),_=this.cachedCanvases.getCanvas("fillCanvas",Math.round(A-m)||1,Math.round(y-b)||1),E=_.context;E.translate(-m,-b),E.transform(...g),!a&&(a=(a=this._scaleImage(o.canvas,(0,s.getCurrentTransformInverse)(E))).img,e&&u&&e.set(i,a)),E.imageSmoothingEnabled=w((0,s.getCurrentTransform)(E),t.interpolate),f(E,a,0,0,a.width,a.height,0,0,h,d),E.globalCompositeOperation="source-in";let x=r.Util.transform((0,s.getCurrentTransformInverse)(E),[1,0,0,1,-m,-b]);return E.fillStyle=u?c.getPattern(l,this,x,n.FILL):c,E.fillRect(0,0,h,d),e&&!u&&(this.cachedCanvases.delete("fillCanvas"),e.set(i,_.canvas)),{canvas:_.canvas,offsetX:Math.round(m),offsetY:Math.round(b)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=x[t]}setLineJoin(t){this.ctx.lineJoin=T[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){let i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=r.context;let n=this.ctx;n.setTransform(...(0,s.getCurrentTransform)(this.suspendedCtx)),A(this.suspendedCtx,n),function(t,e){if(t._removeMirroring)throw Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()}
1,t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,r,s,n,a){e.transform(t,i,r,s,n,a),this.__originalTransform(t,i,r,s,n,a)},t.setTransform=function(t,i,r,s,n,a){e.setTransform(t,i,r,s,n,a),this.__originalSetTransform(t,i,r,s,n,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,r,s,n,a){e.bezierCurveTo(t,i,r,s,n,a),this.__originalBezierCurveTo(t,i,r,s,n,a)},t.rect=function(t,i,r,s){e.rect(t,i,r,s),this.__originalRect(t,i,r,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(n,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),A(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let e=this.current.activeSMask,i=this.suspendedCtx;!function(t,e,i,r){let s=r[0],n=r[1],a=r[2]-s,o=r[3]-n;0!==a&&0!==o&&(function(t,e,i,r,s,n,a,o,l,h,d){let c=!!n,u=c?n[0]:0,p=c?n[1]:0,g=c?n[2]:0,f="Luminosity"===s?E:_,m=Math.min(r,Math.ceil(1048576/i));for(let s=0;s<r;s+=m){let n=Math.min(m,r-s),b=t.getImageData(o-h,s+(l-d),i,n),v=e.getImageData(o,s+l,i,n);c&&function(t,e,i,r){let s=t.length;for(let n=3;n<s;n+=4){let s=t[n];if(0===s)t[n-3]=e,t[n-2]=i,t[n-1]=r;else if(s<255){let a=255-s;t[n-3]=t[n-3]*s+e*a>>8,t[n-2]=t[n-2]*s+i*a>>8,t[n-1]=t[n-1]*s+r*a>>8}}}(b.data,u,p,g),f(b.data,v.data,a),e.putImageData(v,o,s+l)}}(e.context,i,a,o,e.subtype,e.backdrop,e.transferMap,s,n,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(A(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),A(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,r,s,n){this.ctx.transform(t,e,i,r,s,n),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){let n,a;let o=this.ctx,l=this.current,h=l.x,d=l.y,c=(0,s.getCurrentTransform)(o),u=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],p=u?i.slice(0):null;for(let i=0,s=0,g=t.length;i<g;i++)switch(0|t[i]){case r.OPS.rectangle:h=e[s++],d=e[s++];let g=e[s++],f=e[s++],m=h+g,b=d+f;o.moveTo(h,d),0===g||0===f?o.lineTo(m,b):(o.lineTo(m,d),o.lineTo(m,b),o.lineTo(h,b)),u||l.updateRectMinMax(c,[h,d,m,b]),o.closePath();break;case r.OPS.moveTo:h=e[s++],d=e[s++],o.moveTo(h,d),u||l.updatePathMinMax(c,h,d);break;case r.OPS.lineTo:h=e[s++],d=e[s++],o.lineTo(h,d),u||l.updatePathMinMax(c,h,d);break;case r.OPS.curveTo:n=h,a=d,h=e[s+4],d=e[s+5],o.bezierCurveTo(e[s],e[s+1],e[s+2],e[s+3],h,d),l.updateCurvePathMinMax(c,n,a,e[s],e[s+1],e[s+2],e[s+3],h,d,p),s+=6;break;case r.OPS.curveTo2:n=h,a=d,o.bezierCurveTo(h,d,e[s],e[s+1],e[s+2],e[s+3]),l.updateCurvePathMinMax(c,n,a,h,d,e[s],e[s+1],e[s+2],e[s+3],p),h=e[s+2],d=e[s+3],s+=4;break;case r.OPS.curveTo3:n=h,a=d,h=e[s+2],d=e[s+3],o.bezierCurveTo(e[s],e[s+1],h,d,h,d),l.updateCurvePathMinMax(c,n,a,e[s],e[s+1],h,d,h,d,p),s+=4;break;case r.OPS.closePath:o.closePath()}u&&l.updateScalingPathMinMax(c,p),l.setCurrentPoint(h,d)}closePath(){this.ctx.closePath()}stroke(t=!0){let e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),n.STROKE),this.rescaleAndStroke(!1),e.restore(
1)):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){let e=this.ctx,i=this.current.fillColor,r=this.current.patternFill,a=!1;r&&(e.save(),e.fillStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),n.FILL),a=!0);let o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),a&&e.restore(),t&&this.consumePath(o)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=S}eoClip(){this.pendingClip=C}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let t=this.pendingTextPaths,e=this.ctx;if(void 0===t){e.beginPath();return}for(let i of(e.save(),e.beginPath(),t))e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){let i=this.commonObjs.get(t),s=this.current;if(!i)throw Error(`Can't find font for ${t}`);if(s.fontMatrix=i.fontMatrix||r.FONT_IDENTITY_MATRIX,(0===s.fontMatrix[0]||0===s.fontMatrix[3])&&(0,r.warn)("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;let n=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${n}", ${i.fallbackName}`,o="normal";i.black?o="900":i.bold&&(o="bold");let l=i.italic?"italic":"normal",h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font=`${l} ${o} ${h}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,r,s,n){this.current.textMatrix=[t,e,i,r,s,n],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){let a;let o=this.ctx,l=this.current,h=l.font,d=l.textRenderingMode,c=l.fontSize/l.fontSizeScale,u=d&r.TextRenderingMode.FILL_STROKE_MASK,p=!!(d&r.TextRenderingMode.ADD_TO_PATH_FLAG),g=l.patternFill&&!h.missingFile;(h.disableFontFace||p||g)&&(a=h.getPathGenerator(this.commonObjs,t)),h.disableFontFace||g?(o.save(),o.translate(e,i),o.beginPath(),a(o,c),n&&o.setTransform(...n),(u===r.TextRenderingMode.FILL||u===r.TextRenderingMode.FILL_STROKE)&&o.fill(),(u===r.TextRenderingMode.STROKE||u===r.TextRenderingMode.FILL_STROKE)&&o.stroke(),o.restore()):((u===r.TextRenderingMode.FILL||u===r.TextRenderingMode.FILL_STROKE)&&o.fillText(t,e,i),(u===r.TextRenderingMode.STROKE||u===r.TextRenderingMode.FILL_STROKE)&&o.strokeText(t,e,i)),p&&(this.pendingTextPaths||=[]).push({transform:(0,s.getCurrentTransform)(o),x:e,y:i,fontSize:c,addToPath:a})}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);let e=t.getImageData(0,0,10,10).data,i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){let e;let i=this.current,a=i.font;if(a.isType3Font)return this.showType3Text(t);let o=i.fontSize;if(0===o)return;let l=this.ctx,h=i.fontSizeScale,d=i.charSpacing,c=i.wordSpacing,u=i.fontDirection,p=i.textHScale*u,g=t.length,f=a.vertical,m=f?1:-1,b=a.defaultVMetrics,v=o*i.fontMatrix[0],A=i.textRenderingMode===r.TextRenderingMode.FILL&&!a.disableFontFace&&!i.patternFill;if(l.save(),l.transform(...i.textMatrix),l.translate(i.x,i.y+i.textRise),u>0?l.scale(p,-1):l.scale(p,1),i.patternFill){l.save();let t=i.fillColor.getPattern(l,this,(0,s.getCurrentTransformInverse)(l),n.FILL);
1e=(0,s.getCurrentTransform)(l),l.restore(),l.fillStyle=t}let y=i.lineWidth,_=i.textMatrixScale;if(0===_||0===y){let t=i.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;(t===r.TextRenderingMode.STROKE||t===r.TextRenderingMode.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=_;if(1!==h&&(l.scale(h,h),y/=h),l.lineWidth=y,a.isInvalidPDFjsFont){let e=[],r=0;for(let i of t)e.push(i.unicode),r+=i.width;l.fillText(e.join(""),0,0),i.x+=r*v*p,l.restore(),this.compose();return}let E=0,w;for(w=0;w<g;++w){let i,r;let s=t[w];if("number"==typeof s){E+=m*s*o/1e3;continue}let n=!1,p=(s.isSpace?c:0)+d,g=s.fontChar,y=s.accent,_=s.width;if(f){let t=s.vmetric||b,e=-(s.vmetric?t[1]:.5*_)*v,n=t[2]*v;_=t?-t[0]:_,i=e/h,r=(E+n)/h}else i=E/h,r=0;if(a.remeasure&&_>0){let t=1e3*l.measureText(g).width/o*h;if(_<t&&this.isFontSubpixelAAEnabled){let e=_/t;n=!0,l.save(),l.scale(e,1),i/=e}else _!==t&&(i+=(_-t)/2e3*o/h)}if(this.contentVisible&&(s.isInFont||a.missingFile)){if(A&&!y)l.fillText(g,i,r);else if(this.paintChar(g,i,r,e),y){let t=i+o*y.offset.x/h,s=r-o*y.offset.y/h;this.paintChar(y.fontChar,t,s,e)}}let x=f?_*v-p*u:_*v+p*u;E+=x,n&&l.restore()}f?i.y-=E:i.x+=E*p,l.restore(),this.compose()}showType3Text(t){let e,i,s,n;let a=this.ctx,o=this.current,l=o.font,h=o.fontSize,d=o.fontDirection,c=l.vertical?1:-1,u=o.charSpacing,p=o.wordSpacing,g=o.textHScale*d,f=o.fontMatrix||r.FONT_IDENTITY_MATRIX,m=t.length;if(o.textRenderingMode!==r.TextRenderingMode.INVISIBLE&&0!==h){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,a.save(),a.transform(...o.textMatrix),a.translate(o.x,o.y),a.scale(g,d),e=0;e<m;++e){if(i=t[e],"number"==typeof i){n=c*i*h/1e3,this.ctx.translate(n,0),o.x+=n*g;continue}let d=(i.isSpace?p:0)+u,m=l.charProcOperatorList[i.operatorListId];if(!m){(0,r.warn)(`Type3 character "${i.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=i,this.save(),a.scale(h,h),a.transform(...f),this.executeOperatorList(m),this.restore()),s=r.Util.applyTransform([i.width,0],f)[0]*h+d,a.translate(s,0),o.x+=s*g}a.restore(),this.processingType3=null}}setCharWidth(t,e){}
1setCharWidthAndBounds(t,e,i,r,s,n){this.ctx.rect(i,r,s-i,n-r),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){let i=t[1],r=this.baseTransform||(0,s.getCurrentTransform)(this.ctx);e=new p(t,i,this.ctx,{createCanvasGraphics:t=>new M(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},r)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){let s=r.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(t,e,i){let s=r.Util.makeHexColor(t,e,i);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=function(t){switch(t[0]){case"RadialAxial":return new l(t);case"Mesh":return new d(t);case"Dummy":return new c}throw Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;let e=this.ctx;this.save();let i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),n.SHADING);let a=(0,s.getCurrentTransformInverse)(e);if(a){let{width:t,height:i}=e.canvas,[s,n,o,l]=r.Util.getAxialAlignedBoundingBox([0,0,t,i],a);this.ctx.fillRect(s,n,o-s,l-n)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,s.getCurrentTransform)(this.ctx),e)){let t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax((0,s.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let e=this.ctx;t.isolated||(0,r.info)("TODO: Support non-isolated groups."),t.knockout&&(0,r.warn)("Knockout groups not supported.");let i=(0,s.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw Error("Bounding box is required.");let n=r.Util.getAxialAlignedBoundingBox(t.bbox,(0,s.getCurrentTransform)(e)),a=[0,0,e.canvas.width,e.canvas.height];n=r.Util.intersect(n,a)||[0,0,0,0];let o=Math.floor(n[0]),l=Math.floor(n[1]),h=Math.max(Math.ceil(n[2])-o,1),d=Math.max(Math.ceil(n[3])-l,1),c=1,u=1;h>4096&&(c=h/4096,h=4096),d>4096&&(u=d/4096,d=4096),this.current.startNewPathAndClipBox([0,0,h,d]);let p="groupAt"+this.groupLevel;t.smask&&(p+="_smask_"+this.smaskCounter++%2);let g=this.cachedCanvases.getCanvas(p,h,d),f=g.context;f.scale(1/c,1/u),f.translate(-o,-l),f.transform(...i),t.smask?this.smaskStack.push({canvas:g.canvas,context:f,offsetX:o,offsetY:l,scaleX:c,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(o,l),e.scale(c,u),e.save()),A(e,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;let e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=(0,s.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);let i=r.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}
1beginAnnotation(t,e,i,n,a){if(this.#tl(),y(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){let n=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=o;let[a,l]=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(this.ctx)),{viewportScale:h}=this,d=Math.ceil(n*this.outputScaleX*h),c=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(d,c);let{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,o*l),y(this.ctx)}else y(this.ctx),this.ctx.rect(e[0],e[1],n,o),this.ctx.clip(),this.endPath()}this.current=new m(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#th(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;let e=t.count;(t=this.getObject(t.data,t)).count=e;let i=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(t){let e,i,r;let{width:s,height:n}=t;if(s>1e3||n>1e3)return null;let a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),o=s+1,l=new Uint8Array(o*(n+1)),h=s+7&-8,d=new Uint8Array(h*n),c=0;for(let e of t.data){let t=128;for(;t>0;)d[c++]=e&t?0:255,t>>=1}let u=0;for(c=0,0!==d[c]&&(l[0]=1,++u),i=1;i<s;i++)d[c]!==d[c+1]&&(l[i]=d[c]?2:1,++u),c++;for(0!==d[c]&&(l[i]=2,++u),e=1;e<n;e++){c=e*h,r=e*o,d[c-h]!==d[c]&&(l[r]=d[c]?1:8,++u);let t=(d[c]?4:0)+(d[c-h]?8:0);for(i=1;i<s;i++)a[t=(t>>2)+(d[c+1]?4:0)+(d[c-h+1]?8:0)]&&(l[r+i]=a[t],++u),c++;if(d[c-h]!==d[c]&&(l[r+i]=d[c]?2:4,++u),u>1e3)return null}for(c=h*(n-1),r=e*o,0!==d[c]&&(l[r]=8,++u),i=1;i<s;i++)d[c]!==d[c+1]&&(l[r+i]=d[c]?4:8,++u),c++;if(0!==d[c]&&(l[r+i]=4,++u),u>1e3)return null;let p=new Int32Array([0,o,-1,0,-o,0,0,0,1]),g=new Path2D;for(e=0;u&&e<=n;e++){let t=e*o,i=t+s;for(;t<i&&!l[t];)t++;if(t===i)continue;g.moveTo(t%o,e);let r=t,n=l[t];do{let e=p[n];do t+=e;while(!l[t]);let i=l[t];5!==i&&10!==i?(n=i,l[t]=0):(n=i&51*n>>4,l[t]&=n>>2|n<<2),g.lineTo(t%o,t/o|0),!l[t]&&--u}while(r!==t);--e}return d=null,l=null,function(t){t.save(),t.scale(1/s,-1/n),t.translate(0,-n),t.fill(g),t.beginPath(),t.restore()}}(t)),r.compiled)){r.compiled(i);return}let s=this._createMaskCanvas(t),n=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(n,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,n=0,a,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);let l=this.ctx;l.save();let h=(0,s.getCurrentTransform)(l);l.transform(e,i,n,a,0,0);let d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-h[4],d.offsetY-h[5]);for(let t=0,s=o.length;t<s;t+=2){let s=r.Util.transform(h,[e,i,n,a,o[t],o[t+1]]),[c,u]=r.Util.applyTransform([0,0],s);l.drawImage(d.canvas,c,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;let e=this.ctx,i=this.current.fillColor,r=this.current.patternFill;for(let a of t){let{data:t,width:o,height:l,transform:h}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),c=d.context;c.save();let u=this.getObject(t,a);v(c,u),c.globalCompositeOperation="source-in",c.fillStyle=r?i.getPattern(c,this,(0,s.getCurrentTransformInverse)(e),n.FILL):i,c.fillRect(0,0,o,l),c.restore(),e.save(),e.transform(...h),e.scale(1,-1),f(e,d.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;let e=this.getObject(t);if(!e){(0,r.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,i,s){if(!this.contentVisible)return;let n=this.getObject(t);if(!n){(0,r.warn)("Dependent image isn't ready yet");return}let a=n.width,o=n.height,l=[];for(let t=0,r=s.length;t<r;t+=2)l.push({transform:[e,0,0,i,s[t],s[t+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(n,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;let{bitmap:e,width:i,height:r}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,r),n=s.context;return n.filter=this.current.transferMaps,n.drawImage(e,0,0),n.filter="none",s.canvas}paintInlineImageXObject(t){let e;if(!this.contentVisible)return;let i=t.width,n=t.height,a=this.ctx;if(this.save(),!r.isNodeJS){let{filter:t}=a;
1"none"!==t&&""!==t&&(a.filter="none")}if(a.scale(1/i,-1/n),t.bitmap)e=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)e=t;else{let r=this.cachedCanvases.getCanvas("inlineImage",i,n).context;b(r,t),e=this.applyTransferMapsToCanvas(r)}let o=this._scaleImage(e,(0,s.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=w((0,s.getCurrentTransform)(a),t.interpolate),f(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,i,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){let i;if(!this.contentVisible)return;let r=this.ctx;if(t.bitmap)i=t.bitmap;else{let e=t.width,r=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,r).context;b(s,t),i=this.applyTransferMapsToCanvas(s)}for(let t of e)r.save(),r.transform(...t.transform),r.scale(1,-1),f(r,i,t.x,t.y,t.w,t.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){let e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);let i=this.ctx;this.pendingClip&&(e||(this.pendingClip===C?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=(0,s.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let t,e;let{lineWidth:i}=this.current,{a:r,b:s,c:n,d:a}=this.ctx.getTransform();if(0===s&&0===n){let s=Math.abs(r),n=Math.abs(a);if(s===n){if(0===i)t=e=1/s;else{let r=s*i;t=e=r<1?1/r:1}}else if(0===i)t=1/s,e=1/n;else{let r=s*i,a=n*i;t=r<1?1/r:1,e=a<1?1/a:1}}else{let o=Math.abs(r*a-s*n),l=Math.hypot(r,s),h=Math.hypot(n,a);if(0===i)t=h/o,e=l/o;else{let r=i*o;t=h>r?h/r:1,e=l>r?l/r:1}}this._cachedScaleForStroking[0]=t,this._cachedScaleForStroking[1]=e}return this._cachedScaleForStroking}rescaleAndStroke(t){let{ctx:e}=this,{lineWidth:i}=this.current,[r,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===r&&1===s){e.stroke();return}let n=e.getLineDash();if(t&&e.save(),e.scale(r,s),n.length>0){let t=Math.max(r,s);e.setLineDash(n.map(e=>e/t)),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(let t in r.OPS)void 0!==M.prototype[t]&&(M.prototype[r.OPS[t]]=M.prototype[t])},5419:(t,e,i)=>{let r;i.d(e,{DOMCMapReaderFactory:()=>c,DOMCanvasFactory:()=>h,DOMFilterFactory:()=>l,DOMSVGFactory:()=>p,DOMStandardFontDataFactory:()=>u,PDFDateString:()=>w,PageViewport:()=>g,PixelsPerInch:()=>o,RenderingCancelledException:()=>f,StatTimer:()=>y,fetchData:()=>d,getColorValues:()=>S,getCurrentTransform:()=>C,getCurrentTransformInverse:()=>M,getFilenameFromUrl:()=>v,getPdfFilenameFromUrl:()=>A,getRGB:()=>T,getXfaPageViewport:()=>x,isDataScheme:()=>m,isPdfFile:()=>b,isValidFetchUrl:()=>_,noContextMenu:()=>E,setLayerDimensions:()=>R}),i(4114),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577),i(8992),i(4520),i(1454),i(4603),i(7566),i(8721);var s=i(2583),n=i(4292);let a="http://www.w3.org/2000/svg";class o{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}class l extends s.BaseFilterFactory{#td;#tc;#$;#tu;#tp;#tg=0;constructor({docId:t,ownerDocument:e=globalThis.document}={}){super(),this.#$=t,this.#tu=e}get #tf(){return this.#td||=new Map}get #tm(){return this.#tp||=new Map}get #tb(){if(!this.#tc){let t=this.#tu.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;let i=this.#tu.createElementNS(a,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#tc=this.#tu.createElementNS(a,"defs"),t.append(i),i.append(this.#tc),this.#tu.body.append(t)}return this.#tc}addFilter(t){let e,i,r,s;if(!t)return"none";let n=this.#tf.get(t);if(n)return n;if(1===t.length){let n=t[0],a=Array(256);for(let t=0;t<256;t++)a[t]=n[t]/255;s=e=i=r=a.join(",")}else{let[n,a,o]=t,l=Array(256),h=Array(256),d=Array(256);for(let t=0;t<256;t++)l[t]=n[t]/255,h[t]=a[t]/255,d[t]=o[t]/255;e=l.join(","),i=h.join(","),r=d.join(","),s=`${e}${i}${r}`}if(n=this.#tf.get(s))return this.#tf.set(t,n),n;let a=`g_${this.#$}_transfer_map_${this.#tg++}`,o=`url(#${a})`;this.#tf.set(t,o),this.#tf.set(s,o);let l=this.#tv(a);return this.#tA(e,i,r,l),o}addHCMFilter(t,e){let i=`${t}-${e}`,r="base",s=this.#tm.get(r);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#tm.set(r,s)),!t||!e))return s.url;let a=this.#ty(t);t=n.Util.makeHexColor(...a);let o=this.#ty(e);if(e=n.Util.makeHexColor(...o),this.#tb.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;let l=Array(256);for(let t=0;t<=255;t++){let e=t/255;l[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}let h=l.join(","),d=`g_${this.#$}_hcm_filter`,c=s.filter=this.#tv(d);this.#tA(h,h,h,c),this.#t_(c);let u=(t,e)=>{let i=a[t]/255,r=o[t]/255,s=Array(e+1);for(let t=0;t<=e;t++)s[t]=i+t/e*(r-i);return s.join(",")};return this.#tA(u(0,5),u(1,5),u(2,5),c),s.url=`url(#${d})`,s.url}addHighlightHCMFilter(t,e,i,r,s){let n=`${e}-${i}-${r}-${s}`,a=this.#tm.get(t);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.#tm.set(t,a)),!e||!i))return a.url;let[o,l]=[e,i].map(this.#ty.bind(this)),h=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[c,u]=[r,s].map(this.#ty.bind(this));d<h&&([h,d,c,u]=[d,h,u,c]),this.#tb.style.color="";let p=(t,e,i)=>{let r=Array(256),s=(d-h)/i,n=t/255,a=(e-t)/(255*i),o=0;for(let t=0;t<=i;t++){let e=Math.round(h+t*s),i=n+t*a;for(let t=o;t<=e;t++)r[t]=i;o=e+1}for(let t=o;t<256;t++)r[t]=r[o-1];return r.join(",")},g=`g_${this.#$}_hcm_${t}_filter`,f=a.filter=this.#tv(g);return this.#t_(f),this.#tA(p(c[0],u[0],5),p(c[1],u[1],5),p(c[2],u[2],5),f),a.url=`url(#${g})`,a.url}destroy(t=!1){t&&0!==this.#tm.size||(this.#tc&&(this.#tc.parentNode.parentNode.remove(),this.#tc=null),this.#td&&(this.#td.clear(),this.#td=null),this.#tg=0)}#t_(t){let e=this.#tu.createElementNS(a,"feColorMatrix");e.setAttribute("type","matrix"),e.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"),t.append(e)}#tv(t){let e=this.#tu.createElementNS(a,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#tb.append(e),e}#tE(t,e,i){let r=this.#tu.createElementNS(a,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)}#tA(t,e,i,r){let s=this.#tu.createElementNS(a,"feComponentTransfer");r.append(s),this.#tE(s,"feFuncR",t),this.#tE(s,"feFuncG",e),this.#tE(s,"feFuncB",i)}#ty(t){return this.#tb.style.color=t,T(getComputedStyle(this.#tb).getPropertyValue("color"))}}class h extends s.BaseCanvasFactory{constructor({ownerDocument:t=globalThis.document}={}){super(),this._document=t}_createCanvas(t,e){let i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}async function d(t,e="text"){if(_(t,document.baseURI)){let i=await fetch(t);if(!i.ok)throw Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){switch(e){case"arraybuffer":case"blob":case"json":i(s.response);return}i(s.responseText);return}r(Error(s.statusText))}},s.send(null)})}class c extends s.BaseCMapReaderFactory{_fetchData(t,e){return d(t,this.isCompressed?"arraybuffer":"text").then(t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):(0,n.stringToBytes)(t),compressionType:e}))}}class u extends s.BaseStandardFontDataFactory{_fetchData(t){return d(t,"arraybuffer").then(t=>new Uint8Array(t))}}class p extends s.BaseSVGFactory{_createSVG(t){return document.createElementNS(a,t)}}class g{constructor({viewBox:t,scale:e,rotation:i,offsetX:r=0,offsetY:s=0,dontFlip:n=!1}){let a,o,l,h,d,c,u,p;this.viewBox=t,this.scale=e,this.rotation=i,this.offsetX=r,this.offsetY=s;let g=(t[2]+t[0])/2,f=(t[3]+t[1])/2;switch((i%=360)<0&&(i+=360),i){case 180:a=-1,o=0,l=0,h=1;break;case 90:a=0,o=1,l=1,h=0;break;case 270:a=0,o=-1,l=-1,h=0;break;case 0:a=1,o=0,l=0,h=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(l=-l,h=-h),0===a?(d=Math.abs(f-t[1])*e+r,c=Math.abs(g-t[0])*e+s,u=(t[3]-t[1])*e,p=(t[2]-t[0])*e):(d=Math.abs(g-t[0])*e+r,c=Math.abs(f-t[1])*e+s,u=(t[2]-t[0])*e,p=(t[3]-t[1])*e),this.transform=[a*e,o*e,l*e,h*e,d-a*e*g-l*e*f,c-o*e*g-h*e*f],this.width=u,this.height=p}get rawDims(){let{viewBox:t}=this;return(0,n.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}={}){return new g({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s}
1)}convertToViewportPoint(t,e){return n.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){let e=n.Util.applyTransform([t[0],t[1]],this.transform),i=n.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return n.Util.applyInverseTransform([t,e],this.transform)}}class f extends n.BaseException{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function m(t){let e=t.length,i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function b(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function v(t,e=!1){return e||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)}function A(t,e="document.pdf"){if("string"!=typeof t)return e;if(m(t))return(0,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),s=i.exec(r[1])||i.exec(r[2])||i.exec(r[3]);if(s&&(s=s[0]).includes("%"))try{s=i.exec(decodeURIComponent(s))[0]}catch{}return s||e}class y{started=Object.create(null);times=[];time(t){t in this.started&&(0,n.warn)(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,n.warn)(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){let t=[],e=0;for(let{name:t}of this.times)e=Math.max(t.length,e);for(let{name:i,start:r,end:s}of this.times)t.push(`${i.padEnd(e)} ${s-r}ms
2`);return t.join("")}}function _(t,e){try{let{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function E(t){t.preventDefault()}class w{static toDateObject(t){if(!t||"string"!=typeof t)return null;let e=(r||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(t);if(!e)return null;let i=parseInt(e[1],10),s=parseInt(e[2],10);s=s>=1&&s<=12?s-1:0;let n=parseInt(e[3],10);n=n>=1&&n<=31?n:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;let h=e[7]||"Z",d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===h?(a+=d,o+=c):"+"===h&&(a-=d,o-=c),new Date(Date.UTC(i,s,n,a,o,l))}}function x(t,{scale:e=1,rotation:i=0}){let{width:r,height:s}=t.attributes.style,n=[0,0,parseInt(r),parseInt(s)];return new g({viewBox:n,scale:e,rotation:i})}function T(t){if(t.startsWith("#")){let e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):((0,n.warn)(`Not a valid color format: "${t}"`),[0,0,0])}function S(t){let e=document.createElement("span");for(let i of(e.style.visibility="hidden",document.body.append(e),t.keys())){e.style.color=i;let r=window.getComputedStyle(e).color;t.set(i,T(r))}e.remove()}function C(t){let{a:e,b:i,c:r,d:s,e:n,f:a}=t.getTransform();return[e,i,r,s,n,a]}function M(t){let{a:e,b:i,c:r,d:s,e:n,f:a}=t.getTransform().invertSelf();return[e,i,r,s,n,a]}function R(t,e,i=!1,r=!0){if(e instanceof g){let{pageWidth:r,pageHeight:s}=e.rawDims,{style:a}=t,o=n.FeatureTest.isCSSRoundSupported,l=`var(--scale-factor) * ${r}px`,h=`var(--scale-factor) * ${s}px`,d=o?`round(${l}, 1px)`:`calc(${l})`,c=o?`round(${h}, 1px)`:`calc(${h})`;i&&e.rotation%180!=0?(a.width=c,a.height=d):(a.width=d,a.height=c)}r&&t.setAttribute("data-main-rotation",e.rotation)}},4047:(t,e,i)=>{i.d(e,{DrawLayer:()=>n});var r=i(5419),s=i(4292);class n{#A=null;#tg=0;#tw=new Map;#tx=new Map;constructor({pageIndex:t}){this.pageIndex=t}setParent(t){if(!this.#A){this.#A=t;return}if(this.#A!==t){if(this.#tw.size>0)for(let e of this.#tw.values())e.remove(),t.append(e);this.#A=t}}static get _svgFactory(){return(0,s.shadow)(this,"_svgFactory",new r.DOMSVGFactory)}static #tT(t,{x:e=0,y:i=0,width:r=1,height:s=1}={}){let{style:n}=t;n.top=`${100*i}%`,n.left=`${100*e}%`,n.width=`${100*r}%`,n.height=`${100*s}%`}#tS(t){let e=n._svgFactory.create(1,1,!0);return this.#A.append(e),e.setAttribute("aria-hidden",!0),n.#tT(e,t),e}#tC(t,e){let i=n._svgFactory.createElement("clipPath");t.append(i);let r=`clip_${e}`;i.setAttribute("id",r),i.setAttribute("clipPathUnits","objectBoundingBox");let s=n._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${e}`),s.classList.add("clip"),r}highlight(t,e,i,r=!1){let s=this.#tg++,a=this.#tS(t.box);a.classList.add("highlight"),t.free&&a.classList.add("free");let o=n._svgFactory.createElement("defs");a.append(o);let l=n._svgFactory.createElement("path");o.append(l);let h=`path_p${this.pageIndex}_${s}`;l.setAttribute("id",h),l.setAttribute("d",t.toSVGPath()),r&&this.#tx.set(s,l);let d=this.#tC(o,h),c=n._svgFactory.createElement("use");return a.append(c),a.setAttribute("fill",e),a.setAttribute("fill-opacity",i),c.setAttribute("href",`#${h}`),this.#tw.set(s,a),{id:s,clipPathId:`url(#${d})`}}highlightOutline(t){let e;let i=this.#tg++,r=this.#tS(t.box);r.classList.add("highlightOutline");let s=n._svgFactory.createElement("defs");r.append(s);let a=n._svgFactory.createElement("path");s.append(a);let o=`path_p${this.pageIndex}_${i}`;if(a.setAttribute("id",o),a.setAttribute("d",t.toSVGPath()),a.setAttribute("vector-effect","non-scaling-stroke"),t.free){r.classList.add("free");let t=n._svgFactory.createElement("mask");s.append(t),e=`mask_p${this.pageIndex}_${i}`,t.setAttribute("id",e),t.setAttribute("maskUnits","objectBoundingBox");let a=n._svgFactory.createElement("rect");t.append(a),a.setAttribute("width","1"),a.setAttribute("height","1"),a.setAttribute("fill","white");let l=n._svgFactory.createElement("use");t.append(l),l.setAttribute("href",`#${o}`),l.setAttribute("stroke","none"),l.setAttribute("fill","black"),l.setAttribute("fill-rule","nonzero"),l.classList.add("mask")}let l=n._svgFactory.createElement("use");r.append(l),l.setAttribute("href",`#${o}`),e&&l.setAttribute("mask",`url(#${e})`);let h=l.cloneNode();return r.append(h),l.classList.add("mainOutline"),h.classList.add("secondaryOutline"),this.#tw.set(i,r),i}finalizeLine(t,e){let i=this.#tx.get(t);this.#tx.delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}
2updateLine(t,e){this.#tw.get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),this.#tx.delete(t)}updatePath(t,e){this.#tx.get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){n.#tT(this.#tw.get(t),e)}show(t,e){this.#tw.get(t).classList.toggle("hidden",!e)}rotate(t,e){this.#tw.get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){this.#tw.get(t).setAttribute("fill",e)}changeOpacity(t,e){this.#tw.get(t).setAttribute("fill-opacity",e)}addClass(t,e){this.#tw.get(t).classList.add(e)}removeClass(t,e){this.#tw.get(t).classList.remove(e)}remove(t){null!==this.#A&&(this.#tw.get(t).remove(),this.#tw.delete(t))}destroy(){for(let t of(this.#A=null,this.#tw.values()))t.remove();this.#tw.clear()}}},9731:(t,e,i)=>{i.d(e,{AnnotationEditorLayer:()=>f}),i(1454),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197);var r=i(4292),s=i(310);i(4114),i(8992),i(7550);var n=i(7830),a=i(6976);let o=/\r\n?|\n/g;class l extends s.AnnotationEditor{#tM=this.editorDivBlur.bind(this);#tR=this.editorDivFocus.bind(this);#tP=this.editorDivInput.bind(this);#tI=this.editorDivKeydown.bind(this);#tk=this.editorDivPaste.bind(this);#g;#tL="";#tD=`${this.id}-editor`;#tF;#tO=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=l.prototype,e=t=>t.isEmpty(),i=n.AnnotationEditorUIManager.TRANSLATE_SMALL,s=n.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new n.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:e}]]))}static _type="freetext";static _editorType=r.AnnotationEditorType.FREETEXT;constructor(t){super({...t,name:"freeTextEditor"}),this.#g=t.color||l._defaultColor||s.AnnotationEditor._defaultLineColor,this.#tF=t.fontSize||l._defaultFontSize}static initialize(t,e){s.AnnotationEditor.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:l._defaultFontSize=e;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:l._defaultColor=e}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#tN(e);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#tB(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,l._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,l._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#tF],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#g]]}#tN(t){let e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#tF)*this.parentScale),this.#tF=t,this.#tU()},i=this.#tF;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#tB(t){let e=t=>{this.#g=this.editorDiv.style.color=t},i=this.#g;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){let t=this.parentScale;return[-l._internalPadding*t,-(l._internalPadding+this.#tF)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#tI),this.editorDiv.addEventListener("focus",this.#tR),this.editorDiv.addEventListener("blur",this.#tM),this.editorDiv.addEventListener("input",this.#tP),this.editorDiv.addEventListener("paste",this.#tk))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#tD),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#tI),this.editorDiv.removeEventListener("focus",this.#tR),this.editorDiv.removeEventListener("blur",this.#tM),this.editorDiv.removeEventListener("input",this.#tP),this.editorDiv.removeEventListener("paste",this.#tk),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#tH(){let t=[];
2for(let e of(this.editorDiv.normalize(),this.editorDiv.childNodes))t.push(l.#tz(e));return t.join("\n")}#tU(){let t;let[e,i]=this.parentDimensions;if(this.isAttachedToDOM)t=this.div.getBoundingClientRect();else{let{currentLayer:e,div:i}=this,r=i.style.display,s=i.classList.contains("hidden");i.classList.remove("hidden"),i.style.display="hidden",e.div.append(this.div),t=i.getBoundingClientRect(),i.remove(),i.style.display=r,i.classList.toggle("hidden",s)}this.rotation%180==this.parentRotation%180?(this.width=t.width/e,this.height=t.height/i):(this.width=t.height/e,this.height=t.width/i),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let t=this.#tL,e=this.#tL=this.#tH().trimEnd();if(t===e)return;let i=t=>{if(this.#tL=t,!t){this.remove();return}this.#tj(),this._uiManager.rebuild(this),this.#tU()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#tU()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){l._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#tD),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),s.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#tF}px * var(--scale-factor))`,i.color=this.#g,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,n.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[i,r]=this.parentDimensions;if(this.annotationElementId){let s,n;let{position:a}=this.#tO,[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);let[h,d]=this.pageDimensions,[c,u]=this.pageTranslation;switch(this.rotation){case 0:s=t+(a[0]-c)/h,n=e+this.height-(a[1]-u)/d;break;case 90:s=t+(a[0]-c)/h,n=e-(a[1]-u)/d,[o,l]=[l,-o];break;case 180:s=t-this.width+(a[0]-c)/h,n=e-(a[1]-u)/d,[o,l]=[-o,-l];break;case 270:s=t+(a[0]-c-this.height*d)/h,n=e+(a[1]-u-this.width*h)/d,[o,l]=[-l,o]}this.setAt(s*i,n*r,o,l)}else this.setAt(t*i,e*r,this.width*i,this.height*r);this.#tj(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static #tz(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(o,"")}editorDivPaste(t){let e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();let r=l.#t$(e.getData("text")||"").replaceAll(o,"\n");if(!r)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let n=s.getRangeAt(0);if(!r.includes("\n")){n.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),s.collapseToStart();return}let{startContainer:a,startOffset:h}=n,d=[],c=[];if(a.nodeType===Node.TEXT_NODE){let t=a.parentElement;if(c.push(a.nodeValue.slice(h).replaceAll(o,"")),t!==this.editorDiv){let e=d;for(let i of this.editorDiv.childNodes){if(i===t){e=c;continue}e.push(l.#tz(i))}}d.push(a.nodeValue.slice(0,h).replaceAll(o,""))}else if(a===this.editorDiv){let t=d,e=0;for(let i of this.editorDiv.childNodes)e++===h&&(t=c),t.push(l.#tz(i))}this.#tL=`${d.join("\n")}${r}${c.join("\n")}`,this.#tj();let u=new Range,p=d.reduce((t,e)=>t+e.length,0);for(let{firstChild:t}of this.editorDiv.childNodes)if(t.nodeType===Node.TEXT_NODE){let e=t.nodeValue.length;if(p<=e){u.setStart(t,p),u.setEnd(t,p);break}p-=e}s.removeAllRanges(),s.addRange(u)}#tj(){if(this.editorDiv.replaceChildren(),this.#tL)for(let t of this.#tL.split("\n")){let e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}#tV(){return this.#tL.replaceAll("\xa0"," ")}static #t$(t){return t.replaceAll(" ","\xa0")}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let s=null;if(t instanceof a.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:n,rotation:a,id:o},textContent:l,textPosition:h,parent:{page:{pageNumber:d}}}=t;if(!l||0===l.length)return null;s=t={annotationType:r.AnnotationEditorType.FREETEXT,color:Array.from(i),fontSize:e,value:l.join("\n"),position:h,pageIndex:d-1,rect:n.slice(0),rotation:a,id:o,deleted:!1}}let n=super.deserialize(t,e,i);return n.#tF=t.fontSize,n.#g=r.Util.makeHexColor(...t.color),n.#tL=l.#t$(t.value),n.annotationElementId=t.id||null,n.#tO=s,n}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0}
2;let e=l._internalPadding*this.parentScale,i=this.getRect(e,e),n=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#g),a={annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#tF,value:this.#tV(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?a:this.annotationElementId&&!this.#tG(a)?null:(a.id=this.annotationElementId,a)}#tG(t){let{value:e,fontSize:i,color:r,pageIndex:s}=this.#tO;return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some((t,e)=>t!==r[e])||t.pageIndex!==s}renderAnnotationElement(t){let e=super.renderAnnotationElement(t);if(this.deleted)return e;let{style:i}=e;for(let t of(i.fontSize=`calc(${this.#tF}px * var(--scale-factor))`,i.color=this.#g,e.replaceChildren(),this.#tL.split("\n"))){let i=document.createElement("div");i.append(t?document.createTextNode(t):document.createElement("br")),e.append(i)}let r=l._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(r,r)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}var h=i(4061),d=i(2259),c=i(5419);class u extends s.AnnotationEditor{#tW=null;#tq=0;#tK;#tX=null;#tY=null;#tJ=null;#tQ=null;#tZ=0;#t0=null;#t1=null;#tg=null;#t2=!1;#t4=this.#t5.bind(this);#t6=null;#t3;#t9=null;#t7="";#t8;#et="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _l10nPromise;static _type="highlight";static _editorType=r.AnnotationEditorType.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){let t=u.prototype;return(0,r.shadow)(this,"_keyboardManager",new n.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||u._defaultColor,this.#t8=t.thickness||u._defaultThickness,this.#t3=t.opacity||u._defaultOpacity,this.#tK=t.boxes||null,this.#et=t.methodOfCreation||"",this.#t7=t.text||"",this._isDraggable=!1,t.highlightId>-1?(this.#t2=!0,this.#ee(t),this.#ei()):(this.#tW=t.anchorNode,this.#tq=t.anchorOffset,this.#tQ=t.focusNode,this.#tZ=t.focusOffset,this.#er(),this.#ei(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#t2?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#t8,methodOfCreation:this.#et}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#er(){let t=new h.Outliner(this.#tK,.001);this.#t1=t.getOutlines(),{x:this.x,y:this.y,width:this.width,height:this.height}=this.#t1.box;let e=new h.Outliner(this.#tK,.0025,.001,"ltr"===this._uiManager.direction);this.#tJ=e.getOutlines();let{lastPoint:i}=this.#tJ.box;this.#t6=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#ee({highlightOutlines:t,highlightId:e,clipPathId:i}){if(this.#t1=t,this.#tJ=t.getNewOutline(this.#t8/2+1.5,.0025),e>=0)this.#tg=e,this.#tX=i,this.parent.drawLayer.finalizeLine(e,t),this.#t9=this.parent.drawLayer.highlightOutline(this.#tJ);else if(this.parent){let e=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#tg,t),this.parent.drawLayer.updateBox(this.#tg,u.#es(this.#t1.box,(e-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#t9,this.#tJ),this.parent.drawLayer.updateBox(this.#t9,u.#es(this.#tJ.box,e))}let{x:r,y:s,width:n,height:a}=t.box;switch(this.rotation){case 0:this.x=r,this.y=s,this.width=n,this.height=a;break;case 90:{let[t,e]=this.parentDimensions;this.x=s,this.y=1-r,this.width=n*e/t,this.height=a*t/e;break}case 180:this.x=1-r,this.y=1-s,this.width=n,this.height=a;break;case 270:{let[t,e]=this.parentDimensions;this.x=1-s,this.y=r,this.width=n*e/t,this.height=a*t/e}}let{lastPoint:o}=this.#tJ.box;this.#t6=[(o[0]-r)/n,(o[1]-s)/a]}static initialize(t,e){s.AnnotationEditor.initialize(t,e),u._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:u._defaultColor=e;break;case r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:u._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return this.#t6}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.HIGHLIGHT_COLOR:this.#tB(e);break;case r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:this.#en(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR,u._defaultColor],[r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,u._defaultThickness]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.HIGHLIGHT_COLOR,this.color||u._defaultColor],[r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,this.#t8||u._defaultThickness],[r.AnnotationEditorParamsType.HIGHLIGHT_FREE,this.#t2]]}#tB(t){let e=t=>{this.color=t,this.parent?.drawLayer.changeColor(this.#tg,t),this.#tY?.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}#en(t){let e=this.#t8,i=t=>{this.#t8=t,this.#ea(t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}async addEditToolbar(){let t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(this.#tY=new d.ColorPicker({editor:this}),t.addColorPicker(this.#tY)),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#eo())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#eo())}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#el(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#ei(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#el():t&&(this.#ei(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#ea(t){if(!this.#t2)return;this.#ee({highlightOutlines:this.#t1.getNewOutline(t/2)}),this.fixAndSetPosition();let[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}#el(){null!==this.#tg&&this.parent&&(this.parent.drawLayer.remove(this.#tg),this.#tg=null,this.parent.drawLayer.remove(this.#t9),this.#t9=null)}#ei(t=this.parent){null===this.#tg&&({id:this.#tg,clipPathId:this.#tX}=t.drawLayer.highlight(this.#t1,this.color,this.#t3),this.#t9=t.drawLayer.highlightOutline(this.#tJ),this.#t0&&(this.#t0.style.clipPath=this.#tX))}static #es({x:t,y:e,width:i,height:r},s){switch(s){case 90:return{x:1-e-r,y:t,width:r,height:i};case 180:return{x:1-t-i,y:1-e-r,width:i,height:r};case 270:return{x:e,y:1-t-i,width:r,height:i}}return{x:t,y:e,width:i,height:r}}rotate(t){let e;let{drawLayer:i}
2=this.parent;this.#t2?(t=(t-this.rotation+360)%360,e=u.#es(this.#t1.box,t)):e=u.#es(this,t),i.rotate(this.#tg,t),i.rotate(this.#t9,t),i.updateBox(this.#tg,e),i.updateBox(this.#t9,u.#es(this.#tJ.box,t))}render(){if(this.div)return this.div;let t=super.render();this.#t7&&(t.setAttribute("aria-label",this.#t7),t.setAttribute("role","mark")),this.#t2?t.classList.add("free"):this.div.addEventListener("keydown",this.#t4);let e=this.#t0=document.createElement("div");t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#tX;let[i,r]=this.parentDimensions;return this.setDims(this.width*i,this.height*r),(0,n.bindEvents)(this,this.#t0,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(this.#t9,"hovered")}pointerleave(){this.parent.drawLayer.removeClass(this.#t9,"hovered")}#t5(t){u._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#eh(!0);break;case 1:case 3:this.#eh(!1)}}#eh(t){if(!this.#tW)return;let e=window.getSelection();t?e.setPosition(this.#tW,this.#tq):e.setPosition(this.#tQ,this.#tZ)}select(){super.select(),this.#t9&&(this.parent?.drawLayer.removeClass(this.#t9,"hovered"),this.parent?.drawLayer.addClass(this.#t9,"selected"))}unselect(){super.unselect(),this.#t9&&(this.parent?.drawLayer.removeClass(this.#t9,"selected"),this.#t2||this.#eh(!1))}get _mustFixPosition(){return!this.#t2}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.show(this.#tg,t),this.parent.drawLayer.show(this.#t9,t))}#eo(){return this.#t2?this.rotation:0}#ed(){if(this.#t2)return null;let[t,e]=this.pageDimensions,i=this.#tK,r=Array(8*i.length),s=0;for(let{x:n,y:a,width:o,height:l}of i){let i=n*t,h=(1-a-l)*e;r[s]=r[s+4]=i,r[s+1]=r[s+3]=h,r[s+2]=r[s+6]=i+o*t,r[s+5]=r[s+7]=h+l*e,s+=8}return r}#ec(t){return this.#t1.serialize(t,this.#eo())}static startHighlighting(t,e,{target:i,x:r,y:s}){let{x:n,y:a,width:o,height:l}=i.getBoundingClientRect(),d=e=>{this.#eu(t,e)},u={capture:!0,passive:!1},p=t=>{t.preventDefault(),t.stopPropagation()},g=e=>{i.removeEventListener("pointermove",d),window.removeEventListener("blur",g),window.removeEventListener("pointerup",g),window.removeEventListener("pointerdown",p,u),window.removeEventListener("contextmenu",c.noContextMenu),this.#ep(t,e)};window.addEventListener("blur",g),window.addEventListener("pointerup",g),window.addEventListener("pointerdown",p,u),window.addEventListener("contextmenu",c.noContextMenu),i.addEventListener("pointermove",d),this._freeHighlight=new h.FreeOutliner({x:r,y:s},[n,a,o,l],t.scale,this._defaultThickness/2,e,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static #eu(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static #ep(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(t,e,i){let s=super.deserialize(t,e,i),{rect:[n,a,o,l],color:h,quadPoints:d}=t;s.color=r.Util.makeHexColor(...h),s.#t3=t.opacity;let[c,u]=s.pageDimensions;s.width=(o-n)/c,s.height=(l-a)/u;let p=s.#tK=[];for(let t=0;t<d.length;t+=8)p.push({x:(d[4]-o)/c,y:(l-(1-d[t+5]))/u,width:(d[t+2]-d[t])/c,height:(d[t+5]-d[t+1])/u});return s.#er(),s}serialize(t=!1){if(this.isEmpty()||t)return null;let e=this.getRect(0,0),i=s.AnnotationEditor._colorManager.convert(this.color);return{annotationType:r.AnnotationEditorType.HIGHLIGHT,color:i,opacity:this.#t3,thickness:this.#t8,quadPoints:this.#ed(),outlines:this.#ec(e),pageIndex:this.pageIndex,rect:e,rotation:this.#eo(),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}class p extends s.AnnotationEditor{#eg=0;#ef=0;#em=this.canvasPointermove.bind(this);#eb=this.canvasPointerleave.bind(this);#ev=this.canvasPointerup.bind(this);#eA=this.canvasPointerdown.bind(this);#ey=null;#e_=new Path2D;#eE=!1;#ew=!1;#ex=!1;#eT=null;#eS=0;#eC=0;#eM=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=r.AnnotationEditorType.INK;constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){s.AnnotationEditor.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:p._defaultThickness=e;break;case r.AnnotationEditorParamsType.INK_COLOR:p._defaultColor=e;break;case r.AnnotationEditorParamsType.INK_OPACITY:p._defaultOpacity=e/100}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#en(e);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#tB(e);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#eR(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,p._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,p._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*p._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||p._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||p._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??p._defaultOpacity))]]}#en(t){let e=t=>{this.thickness=t,this.#eP()},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#tB(t){let e=t=>{this.color=t,this.#eI()},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#eR(t){let e=t=>{this.opacity=t,this.#eI()};t/=100;let i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#ek(),this.#eL()),this.isAttachedToDOM||(this.parent.add(this),this.#eD()),this.#eP()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#ey&&(clearTimeout(this.#ey),this.#ey=null),this.#eT.disconnect(),this.#eT=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){let[t,e]=this.parentDimensions,i=this.width*t,r=this.height*e;this.setDimensions(i,r)}
2enableEditMode(){this.#eE||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#eA))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#eA))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#eF(){let{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#eO(){let{ctx:t,color:e,opacity:i,thickness:r,parentScale:s,scaleFactor:a}=this;t.lineWidth=r*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${(0,n.opacityToHex)(i)}`}#eN(t,e){this.canvas.addEventListener("contextmenu",c.noContextMenu),this.canvas.addEventListener("pointerleave",this.#eb),this.canvas.addEventListener("pointermove",this.#em),this.canvas.addEventListener("pointerup",this.#ev),this.canvas.removeEventListener("pointerdown",this.#eA),this.isEditing=!0,this.#ex||(this.#ex=!0,this.#eD(),this.thickness||=p._defaultThickness,this.color||=p._defaultColor||s.AnnotationEditor._defaultLineColor,this.opacity??=p._defaultOpacity),this.currentPath.push([t,e]),this.#ew=!1,this.#eO(),this.#eM=()=>{this.#eB(),this.#eM&&window.requestAnimationFrame(this.#eM)},window.requestAnimationFrame(this.#eM)}#eU(t,e){let[i,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===r)return;let s=this.currentPath,n=this.#e_;if(s.push([t,e]),this.#ew=!0,s.length<=2){n.moveTo(...s[0]),n.lineTo(t,e);return}3===s.length&&(this.#e_=n=new Path2D,n.moveTo(...s[0])),this.#eH(n,...s.at(-3),...s.at(-2),t,e)}#ez(){if(0===this.currentPath.length)return;let t=this.currentPath.at(-1);this.#e_.lineTo(...t)}#ej(t,e){let i;if(this.#eM=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#eU(t,e),this.#ez(),1!==this.currentPath.length)i=this.#e$();else{let r=[t,e];i=[[r,r.slice(),r.slice(),r]]}let r=this.#e_,s=this.currentPath;this.currentPath=[],this.#e_=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(r),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#ek(),this.#eL()),this.#eP())},mustExec:!0})}#eB(){if(!this.#ew)return;this.#ew=!1,this.thickness,this.parentScale;let t=this.currentPath.slice(-3);t.map(t=>t[0]),t.map(t=>t[1]);let{ctx:e}=this;for(let t of(e.save(),e.clearRect(0,0,this.canvas.width,this.canvas.height),this.bezierPath2D))e.stroke(t);e.stroke(this.#e_),e.restore()}#eH(t,e,i,r,s,n,a){let o=(e+r)/2,l=(i+s)/2,h=(r+n)/2,d=(s+a)/2;t.bezierCurveTo(o+2*(r-o)/3,l+2*(s-l)/3,h+2*(r-h)/3,d+2*(s-d)/3,h,d)}#e$(){let t;let e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];let i=[],[r,s]=e[0];for(t=1;t<e.length-2;t++){let[n,a]=e[t],[o,l]=e[t+1],h=(n+o)/2,d=(a+l)/2,c=[r+2*(n-r)/3,s+2*(a-s)/3],u=[h+2*(n-h)/3,d+2*(a-d)/3];i.push([[r,s],c,u,[h,d]]),[r,s]=[h,d]}let[n,a]=e[t],[o,l]=e[t+1],h=[r+2*(n-r)/3,s+2*(a-s)/3];return i.push([[r,s],h,[o+2*(n-o)/3,l+2*(a-l)/3],[o,l]]),i}#eI(){if(this.isEmpty()){this.#eV();return}this.#eO();let{canvas:t,ctx:e}=this;for(let i of(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#eV(),this.bezierPath2D))e.stroke(i)}commit(){this.#eE||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#eE=!0,this.div.classList.add("disabled"),this.#eP(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#eE&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#eN(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#eU(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#eG(t)}canvasPointerleave(t){this.#eG(t)}#eG(t){this.canvas.removeEventListener("pointerleave",this.#eb),this.canvas.removeEventListener("pointermove",this.#em),this.canvas.removeEventListener("pointerup",this.#ev),this.canvas.addEventListener("pointerdown",this.#eA),this.#ey&&clearTimeout(this.#ey),this.#ey=setTimeout(()=>{this.#ey=null,this.canvas.removeEventListener("contextmenu",c.noContextMenu)},10),this.#ej(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
2d()}#ek(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#eL(){this.#eT=new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#eT.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#eE}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");let[i,r,s,n]=this.#eF();if(this.setAt(i,r,0,0),this.setDims(s,n),this.#ek(),this.width){let[i,r]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*r),this.setAt(t*i,e*r,this.width*i,this.height*r),this.#ex=!0,this.#eD(),this.setDims(this.width*i,this.height*r),this.#eI(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#eL(),this.div}#eD(){if(!this.#ex)return;let[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#eV()}setDimensions(t,e){let i=Math.round(t),r=Math.round(e);if(this.#eS===i&&this.#eC===r)return;this.#eS=i,this.#eC=r,this.canvas.style.visibility="hidden";let[s,n]=this.parentDimensions;this.width=t/s,this.height=e/n,this.fixAndSetPosition(),this.#eE&&this.#eW(t,e),this.#eD(),this.#eI(),this.canvas.style.visibility="visible",this.fixDims()}#eW(t,e){let i=this.#eq(),r=(t-i)/this.#ef,s=(e-i)/this.#eg;this.scaleFactor=Math.min(r,s)}#eV(){let t=this.#eq()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static #eK(t){let e=new Path2D;for(let i=0,r=t.length;i<r;i++){let[r,s,n,a]=t[i];0===i&&e.moveTo(...r),e.bezierCurveTo(s[0],s[1],n[0],n[1],a[0],a[1])}return e}static #eX(t,e,i){let[r,s,n,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=r,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=t[e+1]+r,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=n-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=n-t[e+1],t[e+1]=a-i}break;default:throw Error("Invalid rotation")}return t}static #eY(t,e,i){let[r,s,n,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=r,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=t[e+1]-s,t[e+1]=i-r}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=n-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=a-t[e+1],t[e+1]=n-i}break;default:throw Error("Invalid rotation")}return t}#eJ(t,e,i,r){let s=[],n=this.thickness/2,a=t*e+n,o=t*i+n;for(let e of this.paths){let i=[],n=[];for(let r=0,s=e.length;r<s;r++){let[l,h,d,c]=e[r];if(l[0]===c[0]&&l[1]===c[1]&&1===s){let e=t*l[0]+a,r=t*l[1]+o;i.push(e,r),n.push(e,r);break}let u=t*l[0]+a,p=t*l[1]+o,g=t*h[0]+a,f=t*h[1]+o,m=t*d[0]+a,b=t*d[1]+o,v=t*c[0]+a,A=t*c[1]+o;0===r&&(i.push(u,p),n.push(u,p)),i.push(g,f,m,b,v,A),n.push(g,f),r===s-1&&n.push(v,A)}s.push({bezier:p.#eX(i,r,this.rotation),points:p.#eX(n,r,this.rotation)})}return s}#eQ(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(let n of this.paths)for(let[a,o,l,h]of n){let n=r.Util.bezierBoundingBox(...a,...o,...l,...h);t=Math.min(t,n[0]),i=Math.min(i,n[1]),e=Math.max(e,n[2]),s=Math.max(s,n[3])}return[t,i,e,s]}#eq(){return this.#eE?Math.ceil(this.thickness*this.parentScale):0}#eP(t=!1){if(this.isEmpty())return;if(!this.#eE){this.#eI();return}let e=this.#eQ(),i=this.#eq();this.#ef=Math.max(s.AnnotationEditor.MIN_SIZE,e[2]-e[0]),this.#eg=Math.max(s.AnnotationEditor.MIN_SIZE,e[3]-e[1]);let r=Math.ceil(i+this.#ef*this.scaleFactor),n=Math.ceil(i+this.#eg*this.scaleFactor),[a,o]=this.parentDimensions;this.width=r/a,this.height=n/o,this.setAspectRatio(r,n);let l=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#eD(),this.#eI(),this.#eS=r,this.#eC=n,this.setDims(r,n);let d=t?i/this.scaleFactor/2:0;this.translate(l-this.translationX-d,h-this.translationY-d)}static deserialize(t,e,i){if(t instanceof a.InkAnnotationElement)return null;let n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=r.Util.makeHexColor(...t.color),n.opacity=t.opacity;let[o,l]=n.pageDimensions,h=n.width*o,d=n.height*l,c=n.parentScale,u=t.thickness/2;n.#eE=!0,n.#eS=Math.round(h),n.#eC=Math.round(d);let{paths:g,rect:f,rotation:m}=t;for(let{bezier:t}of g){t=p.#eY(t,f,m);let e=[];n.paths.push(e);let i=c*(t[0]-u),r=c*(t[1]-u);for(let s=2,n=t.length;s<n;s+=6){let n=c*(t[s]-u),a=c*(t[s+1]-u),o=c*(t[s+2]-u),l=c*(t[s+3]-u),h=c*(t[s+4]-u),d=c*(t[s+5]-u);e.push([[i,r],[n,a],[o,l],[h,d]]),i=h,r=d}let s=this.#eK(e);n.bezierPath2D.push(s)}let b=n.#eQ();return n.#ef=Math.max(s.AnnotationEditor.MIN_SIZE,b[2]-b[0]),n.#eg=Math.max(s.AnnotationEditor.MIN_SIZE,b[3]-b[1]),n.#eW(h,d),n}serialize(){if(this.isEmpty())return null;let t=this.getRect(0,0),e=s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#eJ(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}i(4520),i(4979);class g extends s.AnnotationEditor{#eZ=null;#e0=null;#e1=null;#e2=null;#e4=null;#e5="";#e6=null;#eT=null;#e3=null;#e9=!1;#e7=!1;static _type="stamp";static _editorType=r.AnnotationEditorType.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#e2=t.bitmapUrl,this.#e4=t.bitmapFile}static initialize(t,e){s.AnnotationEditor.initialize(t,e)}static get supportedTypes(){return(0,r.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>`image/${t}`))}static get supportedTypesStr(){return(0,r.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(r.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#e8(t,e=!1){if(!t){this.remove();return}this.#eZ=t.bitmap,e||(this.#e0=t.id,this.#e9=t.isSvg),t.file&&(this.#e5=t.file.name),this.#ek()}#it(){this.#e1=null,this._uiManager.enableWaiting(!1),this.#e6&&this.div.focus()}
2#ie(){if(this.#e0){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#e0).then(t=>this.#e8(t,!0)).finally(()=>this.#it());return}if(this.#e2){let t=this.#e2;this.#e2=null,this._uiManager.enableWaiting(!0),this.#e1=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#e8(t)).finally(()=>this.#it());return}if(this.#e4){let t=this.#e4;this.#e4=null,this._uiManager.enableWaiting(!0),this.#e1=this._uiManager.imageManager.getFromFile(t).then(t=>this.#e8(t)).finally(()=>this.#it());return}let t=document.createElement("input");t.type="file",t.accept=g.supportedTypesStr,this.#e1=new Promise(e=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);let e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#e8(e)}else this.remove();e()}),t.addEventListener("cancel",()=>{this.remove(),e()})}).finally(()=>this.#it()),t.click()}remove(){this.#e0&&(this.#eZ=null,this._uiManager.imageManager.deleteId(this.#e0),this.#e6?.remove(),this.#e6=null,this.#eT?.disconnect(),this.#eT=null,this.#e3&&(clearTimeout(this.#e3),this.#e3=null)),super.remove()}rebuild(){if(!this.parent){this.#e0&&this.#ie();return}super.rebuild(),null!==this.div&&(this.#e0&&null===this.#e6&&this.#ie(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#e1||this.#eZ||this.#e2||this.#e4||this.#e0)}get isResizable(){return!0}render(){let t,e;if(this.div)return this.div;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),this.#eZ?this.#ek():this.#ie(),this.width){let[i,r]=this.parentDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r)}return this.div}#ek(){let{div:t}=this,{width:e,height:i}=this.#eZ,[r,s]=this.pageDimensions;if(this.width)e=this.width*r,i=this.height*s;else if(e>.75*r||i>.75*s){let t=Math.min(.75*r/e,.75*s/i);e*=t,i*=t}let[n,a]=this.parentDimensions;this.setDims(e*n/r,i*a/s),this._uiManager.enableWaiting(!1);let o=this.#e6=document.createElement("canvas");t.append(o),t.hidden=!1,this.#ii(e,i),this.#eL(),this.#e7||(this.parent.addUndoableEditor(this),this.#e7=!0),this._reportTelemetry({action:"inserted_image"}),this.#e5&&o.setAttribute("aria-label",this.#e5)}#ir(t,e){let[i,r]=this.parentDimensions;this.width=t/i,this.height=e/r,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#e3&&clearTimeout(this.#e3),this.#e3=setTimeout(()=>{this.#e3=null,this.#ii(t,e)},200)}#is(t,e){let{width:i,height:r}=this.#eZ,s=i,n=r,a=this.#eZ;for(;s>2*t||n>2*e;){let i=s,r=n;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),n>2*e&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2));let o=new OffscreenCanvas(s,n);o.getContext("2d").drawImage(a,0,0,i,r,0,0,s,n),a=o.transferToImageBitmap()}return a}#ii(t,e){t=Math.ceil(t),e=Math.ceil(e);let i=this.#e6;if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;let r=this.#e9?this.#eZ:this.#is(t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){let i=new OffscreenCanvas(t,e);i.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,t,e),i.convertToBlob().then(t=>{let e=new FileReader;e.onload=()=>{let t=e.result;this._uiManager.mlGuess({service:"image-to-text",request:{imageData:t}}).then(t=>{let e=t?.output||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})})},e.readAsDataURL(t)})}let s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(r,0,0,r.width,r.height,0,0,t,e)}getImageForAltText(){return this.#e6}#ia(t){if(t){if(this.#e9){let t=this._uiManager.imageManager.getSvgUrl(this.#e0);if(t)return t}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#eZ,t.getContext("2d").drawImage(this.#eZ,0,0),t.toDataURL()}if(this.#e9){let[t,e]=this.pageDimensions,i=Math.round(this.width*t*c.PixelsPerInch.PDF_TO_CSS_UNITS),r=Math.round(this.height*e*c.PixelsPerInch.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,r);return s.getContext("2d").drawImage(this.#eZ,0,0,this.#eZ.width,this.#eZ.height,0,0,i,r),s.transferToImageBitmap()}return structuredClone(this.#eZ)}#eL(){this.#eT=new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.#ir(e.width,e.height)}),this.#eT.observe(this.div)}static deserialize(t,e,i){if(t instanceof a.StampAnnotationElement)return null;let r=super.deserialize(t,e,i),{rect:s,bitmapUrl:n,bitmapId:o,isSvg:l,accessibilityData:h}=t;o&&i.imageManager.isValidId(o)?r.#e0=o:r.#e2=n,r.#e9=l;let[d,c]=r.pageDimensions;return r.width=(s[2]-s[0])/d,r.height=(s[3]-s[1])/c,h&&(r.altTextData=h),r}serialize(t=!1,e=null){if(this.isEmpty())return null;let i={annotationType:r.AnnotationEditorType.STAMP,bitmapId:this.#e0,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#e9,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#ia(!0),i.accessibilityData=this.altTextData,i;let{decorative:s,altText:n}=this.altTextData;if(!s&&n&&(i.accessibilityData={type:"Figure",alt:n}),null===e)return i;e.stamps||=new Map;let a=this.#e9?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#e0)){if(this.#e9){let t=e.stamps.get(this.#e0);a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=this.#ia(!1))}}else e.stamps.set(this.#e0,{area:a,serialized:i}),i.bitmap=this.#ia(!1);return i}}class f{#D;#io=!1;#il=null;#ih=null;#id=null;#ic=null;#iu=null;#ip=new Map;#ig=!1;#im=!1;#ib=!1;#iv=null;#iA;static _initialized=!1;static #iy=new Map([l,p,g,u].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:i,accessibilityManager:r,annotationLayer:s,drawLayer:n,textLayer:a,viewport:o,l10n:l}){let h=[...f.#iy.values()];if(!f._initialized)for(let e of(f._initialized=!0,h))e.initialize(l,t);
2t.registerEditorTypes(h),this.#iA=t,this.pageIndex=e,this.div=i,this.#D=r,this.#il=s,this.viewport=o,this.#iv=a,this.drawLayer=n,this.#iA.addLayer(this)}get isEmpty(){return 0===this.#ip.size}get isInvisible(){return this.isEmpty&&this.#iA.getMode()===r.AnnotationEditorType.NONE}updateToolbar(t){this.#iA.updateToolbar(t)}updateMode(t=this.#iA.getMode()){switch(this.#i_(),t){case r.AnnotationEditorType.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case r.AnnotationEditorType.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case r.AnnotationEditorType.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:e}=this.div;for(let i of f.#iy.values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#iv?.div}addInkEditorIfNeeded(t){if(this.#iA.getMode()===r.AnnotationEditorType.INK){if(!t){for(let t of this.#ip.values())if(t.isEmpty()){t.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){this.#iA.setEditingState(t)}addCommands(t){this.#iA.addCommands(t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#il?.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);let t=new Set;for(let e of this.#ip.values())e.enableEditing(),e.show(!0),e.annotationElementId&&(this.#iA.removeChangedExistingAnnotation(e),t.add(e.annotationElementId));if(this.#il)for(let e of this.#il.getEditableAnnotations()){if(e.hide(),this.#iA.isDeletedAnnotationElement(e.data.id)||t.has(e.data.id))continue;let i=this.deserialize(e);i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){this.#ib=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);let t=new Map,e=new Map;for(let i of this.#ip.values())if(i.disableEditing(),i.annotationElementId){if(null!==i.serialize()){t.set(i.annotationElementId,i);continue}e.set(i.annotationElementId,i),this.getEditableAnnotation(i.annotationElementId)?.show(),i.remove()}if(this.#il)for(let i of this.#il.getEditableAnnotations()){let{id:r}=i.data;if(this.#iA.isDeletedAnnotationElement(r))continue;let s=e.get(r);if(s){s.resetAnnotationElement(i),s.show(!1),i.show();continue}(s=t.get(r))&&(this.#iA.addChangedExistingAnnotation(s),s.renderAnnotationElement(i),s.show(!1)),i.show()}this.#i_(),this.isEmpty&&(this.div.hidden=!0);let{classList:i}=this.div;for(let t of f.#iy.values())i.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#ib=!1}getEditableAnnotation(t){return this.#il?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#iA.getActive()!==t&&this.#iA.setActiveEditor(t)}enableTextSelection(){this.div.tabIndex=-1,this.#iv?.div&&!this.#ic&&(this.#ic=this.#iE.bind(this),this.#iv.div.addEventListener("pointerdown",this.#ic),this.#iv.div.classList.add("highlighting"))}disableTextSelection(){this.div.tabIndex=0,this.#iv?.div&&this.#ic&&(this.#iv.div.removeEventListener("pointerdown",this.#ic),this.#ic=null,this.#iv.div.classList.remove("highlighting"))}#iE(t){if(this.#iA.unselectAll(),t.target===this.#iv.div){let{isMac:e}=r.FeatureTest.platform;0!==t.button||t.ctrlKey&&e||(this.#iA.showAllEditors("highlight",!0,!0),this.#iv.div.classList.add("free"),u.startHighlighting(this,"ltr"===this.#iA.direction,t),this.#iv.div.addEventListener("pointerup",()=>{this.#iv.div.classList.remove("free")},{once:!0}),t.preventDefault())}}enableClick(){this.#id||(this.#id=this.pointerdown.bind(this),this.#ih=this.pointerup.bind(this),this.div.addEventListener("pointerdown",this.#id),this.div.addEventListener("pointerup",this.#ih))}disableClick(){this.#id&&(this.div.removeEventListener("pointerdown",this.#id),this.div.removeEventListener("pointerup",this.#ih),this.#id=null,this.#ih=null)}attach(t){this.#ip.set(t.id,t);let{annotationElementId:e}=t;e&&this.#iA.isDeletedAnnotationElement(e)&&this.#iA.removeDeletedAnnotationElement(t)}detach(t){this.#ip.delete(t.id),this.#D?.removePointerInTextLayer(t.contentDiv),!this.#ib&&t.annotationElementId&&this.#iA.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#iA.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#im||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#iA.addDeletedAnnotationElement(t.annotationElementId),s.AnnotationEditor.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.#iA.addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#iA.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:e}=document;t.div.contains(e)&&!this.#iu&&(t._focusEventsAllowed=!1,this.#iu=setTimeout(()=>{this.#iu=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus())},0)),t._structTreeParentId=this.#D?.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})}getNextId(){return this.#iA.getId()}get #iw(){return f.#iy.get(this.#iA.getMode())}#ix(t){let e=this.#iw;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#iw?.canCreateNewEmptyEditor()}pasteEditor(t,e){this.#iA.updateToolbar(t),this.#iA.updateMode(t);let{offsetX:i,offsetY:r}=this.#iT(),s=this.getNextId(),n=this.#ix({parent:this,id:s,x:i,y:r,uiManager:this.#iA,isCentered:!0,...e});n&&this.add(n)}deserialize(t){return f.#iy.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#iA)||null}createAndAddNewEditor(t,e,i={}){let r=this.getNextId(),s=this.#ix({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#iA,isCentered:e,...i});return s&&this.add(s),s}#iT(){let{x:t,y:e,width:i,height:r}=this.div.getBoundingClientRect(),s=Math.min(window.innerWidth,t+i),n=Math.min(window.innerHeight,e+r),a=(Math.max(0,t)+s)/2-t,o=(Math.max(0,e)+n)/2-e,[l,h]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:h}}addNewEditor(){this.createAndAddNewEditor(this.#iT(),!0)}setSelected(t){this.#iA.setSelected(t)}toggleSelected(t){this.#iA.toggleSelected(t)}isSelected(t){return this.#iA.isSelected(t)}unselect(t){this.#iA.unselect(t)}pointerup(t){let{isMac:e}=r.FeatureTest.platform;if(0===t.button&&(!t.ctrlKey||!e)&&t.target===this.div&&this.#ig){if(this.#ig=!1,!this.#io){this.#io=!0;return}if(this.#iA.getMode()===r.AnnotationEditorType.STAMP){this.#iA.unselectAll();return}this.createAndAddNewEditor(t,!1)}}pointerdown(t){if(this.#iA.getMode()===r.AnnotationEditorType.HIGHLIGHT&&this.enableTextSelection(),this.#ig){this.#ig=!1;return}let{isMac:e}=r.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;this.#ig=!0;let i=this.#iA.getActive();this.#io=!i||i.isEmpty()}findNewParent(t,e,i){let r=this.#iA.findParent(e,i);return null!==r&&r!==this&&(r.changeParent(t),!0)}destroy(){for(let t of(this.#iA.getActive()?.parent===this&&(this.#iA.commitOrRemove(),this.#iA.setActiveEditor(null)),this.#iu&&(clearTimeout(this.#iu),this.#iu=null),this.#ip.values())
2)this.#D?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#ip.clear(),this.#iA.removeLayer(this)}#i_(){for(let t of(this.#im=!0,this.#ip.values()))t.isEmpty()&&t.remove();this.#im=!1}render({viewport:t}){for(let e of(this.viewport=t,(0,c.setLayerDimensions)(this.div,t),this.#iA.getEditors(this.pageIndex)))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){this.#iA.commitOrRemove(),this.#i_();let e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,(0,c.setLayerDimensions)(this.div,{rotation:i}),e!==i)for(let t of this.#ip.values())t.rotate(i);this.addInkEditorIfNeeded(!1)}get pageDimensions(){let{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#iA.viewParameters.realScale}}},2259:(t,e,i)=>{i.d(e,{ColorPicker:()=>a});var r=i(4292),s=i(7830),n=i(5419);class a{#a=this.#o.bind(this);#iS=this.#iC.bind(this);#iM=null;#iR=null;#iP;#iI=null;#ik=!1;#iL=!1;#iD=null;#iF;#iA=null;#iO;static get _keyboardManager(){return(0,r.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["Escape","mac+Escape"],a.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],a.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],a.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],a.prototype._moveToPrevious],[["Home","mac+Home"],a.prototype._moveToBeginning],[["End","mac+End"],a.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#iL=!1,this.#iO=r.AnnotationEditorParamsType.HIGHLIGHT_COLOR,this.#iD=t):(this.#iL=!0,this.#iO=r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR),this.#iA=t?._uiManager||e,this.#iF=this.#iA._eventBus,this.#iP=t?.color||this.#iA?.highlightColors.values().next().value||"#FFFF98"}renderButton(){let t=this.#iM=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0),t.addEventListener("click",this.#iN.bind(this)),t.addEventListener("keydown",this.#a);let e=this.#iR=document.createElement("span");return e.className="swatch",e.setAttribute("aria-hidden",!0),e.style.backgroundColor=this.#iP,t.append(e),t}renderMainDropdown(){let t=this.#iI=this.#iB();return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}#iB(){let t=document.createElement("div");for(let[e,i]of(t.addEventListener("contextmenu",n.noContextMenu),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#iA.highlightColors)){let r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",i),r.title=e,r.setAttribute("data-l10n-id",`pdfjs-editor-colorpicker-${e}`);let s=document.createElement("span");r.append(s),s.className="swatch",s.style.backgroundColor=i,r.setAttribute("aria-selected",i===this.#iP),r.addEventListener("click",this.#iU.bind(this,i)),t.append(r)}return t.addEventListener("keydown",this.#a),t}#iU(t,e){e.stopPropagation(),this.#iF.dispatch("switchannotationeditorparams",{source:this,type:this.#iO,value:t})}_colorSelectFromKeyboard(t){if(t.target===this.#iM){this.#iN(t);return}let e=t.target.getAttribute("data-color");e&&this.#iU(e,t)}_moveToNext(t){if(!this.#iH){this.#iN(t);return}if(t.target===this.#iM){this.#iI.firstChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===this.#iI?.firstChild||t.target===this.#iM){this.#iH&&this._hideDropdownFromKeyboard();return}this.#iH||this.#iN(t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!this.#iH){this.#iN(t);return}this.#iI.firstChild?.focus()}_moveToEnd(t){if(!this.#iH){this.#iN(t);return}this.#iI.lastChild?.focus()}#o(t){a._keyboardManager.exec(this,t)}#iN(t){if(this.#iH){this.hideDropdown();return}if(this.#ik=0===t.detail,window.addEventListener("pointerdown",this.#iS),this.#iI){this.#iI.classList.remove("hidden");return}let e=this.#iI=this.#iB();this.#iM.append(e)}#iC(t){this.#iI?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#iI?.classList.add("hidden"),window.removeEventListener("pointerdown",this.#iS)}get #iH(){return this.#iI&&!this.#iI.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#iL){if(!this.#iH){this.#iD?.unselect();return}this.hideDropdown(),this.#iM.focus({preventScroll:!0,focusVisible:this.#ik})}}updateColor(t){if(this.#iR&&(this.#iR.style.backgroundColor=t),!this.#iI)return;let e=this.#iA.highlightColors.values();for(let i of this.#iI.children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){this.#iM?.remove(),this.#iM=null,this.#iR=null,this.#iI?.remove(),this.#iI=null}}},310:(t,e,i)=>{i.d(e,{AnnotationEditor:()=>l});var r=i(7830),s=i(4292),n=i(5419);class a{#iz="";#ij=!1;#i$=null;#iV=null;#iG=null;#iW=!1;#iD=null;static _l10nPromise=null;constructor(t){this.#iD=t}static initialize(t){a._l10nPromise||=t}async render(){let t=this.#i$=document.createElement("button");t.className="altText";let e=await a._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0",t.addEventListener("contextmenu",n.noContextMenu),t.addEventListener("pointerdown",t=>t.stopPropagation());let i=t=>{t.preventDefault(),this.#iD._uiManager.editAltText(this.#iD)};return t.addEventListener("click",i,{capture:!0}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#iW=!0,i(e))}),await this.#iq(),t}finish(){this.#i$&&(this.#i$.focus({focusVisible:this.#iW}),this.#iW=!1)}isEmpty(){return!this.#iz&&!this.#ij}get data(){return{altText:this.#iz,decorative:this.#ij}}set data({altText:t,decorative:e}){(this.#iz!==t||this.#ij!==e)&&(this.#iz=t,this.#ij=e,this.#iq())}toggle(t=!1){this.#i$&&(!t&&this.#iG&&(clearTimeout(this.#iG),this.#iG=null),this.#i$.disabled=!t)}destroy(){this.#i$?.remove(),this.#i$=null,this.#iV=null}async #iq(){let t=this.#i$;if(!t)return;if(!this.#iz&&!this.#ij){t.classList.remove("done"),this.#iV?.remove();return}t.classList.add("done"),a._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(e=>{t.setAttribute("aria-label",e)});let e=this.#iV;if(!e){this.#iV=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");let i=e.id=`alt-text-tooltip-${this.#iD.id}`;t.setAttribute("aria-describedby",i),t.addEventListener("mouseenter",()=>{this.#iG=setTimeout(()=>{this.#iG=null,this.#iV.classList.add("show"),this.#iD._reportTelemetry({action:"alt_text_tooltip"})},100)}),t.addEventListener("mouseleave",()=>{this.#iG&&(clearTimeout(this.#iG),this.#iG=null),this.#iV?.classList.remove("show")})}e.innerText=this.#ij?await a._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):this.#iz,e.parentNode||t.append(e);let i=this.#iD.getImageForAltText();i?.setAttribute("aria-describedby",e.id)}}var o=i(4362);class l{#iK=null;#iz=null;#iX=!1;#iY=!1;#iJ=null;#iQ=null;#iZ=this.focusin.bind(this);#i0=this.focusout.bind(this);#i1=null;#i2="";#i4=!1;#i5=null;#i6=!1;#i3=!1;#i9=!1;#i7=null;#i8=0;#rt=0;#re=null;_initialOptions=Object.create(null);_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#ri=!1;#rr=l._zIndex++;static _borderLineWidth=-1;static _colorManager=new r.ColorManager;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=l.prototype._resizeWithKeyboard,e=r.AnnotationEditorUIManager.TRANSLATE_SMALL,i=r.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,s.shadow)(this,"_resizerKeyboardManager",new r.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],l.prototype._stopResizingWithKeyboard]]))}constructor(t){this.constructor===l&&(0,s.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;let{rotation:e,rawDims:{pageWidth:i,pageHeight:r,pageX:n,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[n,a];let[o,h]=this.parentDimensions;this.x=t.x/o,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,s.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new h({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(l._l10nPromise||=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(e=>[e,t.get(e.replaceAll(/([A-Z])/g,t=>`-${t.toLowerCase()}`))])),i?.strings)for(let e of i.strings)l._l10nPromise.set(e,t.get(e));if(-1!==l._borderLineWidth)return;let r=getComputedStyle(document.documentElement);l._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,s.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ri}set _isDraggable(t){this.#ri=t,this.div?.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){let[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}
2setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#rr}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):this.#rs(),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#i4?this.#i4=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let e=t.relatedTarget;!e?.closest(`#${this.id}`)&&(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,r){let[s,n]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(t+i)/s,this.y=(e+r)/n,this.fixAndSetPosition()}#rn([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this.fixAndSetPosition()}translate(t,e){this.#rn(this.parentDimensions,t,e)}translateInPage(t,e){this.#i5||=[this.x,this.y],this.#rn(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){this.#i5||=[this.x,this.y];let[i,r]=this.parentDimensions;if(this.x+=t/i,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:n}=this,[a,o]=this.getBaseTranslation();s+=a,n+=o,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*n).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#i5&&(this.#i5[0]!==this.x||this.#i5[1]!==this.y)}getBaseTranslation(){let[t,e]=this.parentDimensions,{_borderLineWidth:i}=l,r=i/t,s=i/e;switch(this.rotation){case 90:return[-r,s];case 180:return[r,s];case 270:return[r,-s];default:return[-r,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){let[e,i]=this.pageDimensions,{x:r,y:s,width:n,height:a}=this;if(n*=e,a*=i,r*=e,s*=i,this._mustFixPosition)switch(t){case 0:r=Math.max(0,Math.min(e-n,r)),s=Math.max(0,Math.min(i-a,s));break;case 90:r=Math.max(0,Math.min(e-a,r)),s=Math.min(i,Math.max(n,s));break;case 180:r=Math.min(e,Math.max(n,r)),s=Math.min(i,Math.max(a,s));break;case 270:r=Math.min(e,Math.max(a,r)),s=Math.max(0,Math.min(i-n,s))}this.x=r/=e,this.y=s/=i;let[o,l]=this.getBaseTranslation();r+=o,s+=l;let{style:h}=this.div;h.left=`${(100*r).toFixed(2)}%`,h.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static #ra(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return l.#ra(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return l.#ra(t,e,360-this.parentRotation)}#ro(t){switch(t){case 90:{let[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,e]=this.pageDimensions;return[0,t/e,-e/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(){let{parentScale:t,pageDimensions:[e,i]}=this,r=e*t,n=i*t;return s.FeatureTest.isCSSRoundSupported?[Math.round(r),Math.round(n)]:[r,n]}setDims(t,e){let[i,r]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#iY||(this.div.style.height=`${(100*e/r).toFixed(2)}%`)}fixDims(){let{style:t}=this.div,{height:e,width:i}=t,r=i.endsWith("%"),s=!this.#iY&&e.endsWith("%");if(r&&s)return;let[n,a]=this.parentDimensions;r||(t.width=`${(100*parseFloat(i)/n).toFixed(2)}%`),this.#iY||s||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#rl(){if(!this.#iJ){for(let t of(this.#iJ=document.createElement("div"),this.#iJ.classList.add("resizers"),this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"])){let e=document.createElement("div");this.#iJ.append(e),e.classList.add("resizer",t),e.setAttribute("data-resizer-name",t),e.addEventListener("pointerdown",this.#rh.bind(this,t)),e.addEventListener("contextmenu",n.noContextMenu),e.tabIndex=-1}this.div.prepend(this.#iJ)}}#rh(t,e){e.preventDefault();let{isMac:i}=s.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#iz?.toggle(!1);let r=this.#rd.bind(this,t),a=this._isDraggable;this._isDraggable=!1;let o={passive:!0,capture:!0};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",r,o),window.addEventListener("contextmenu",n.noContextMenu);let l=this.x,h=this.y,d=this.width,c=this.height,u=this.parent.div.style.cursor,p=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let g=()=>{this.parent.togglePointerEvents(!0),this.#iz?.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),window.removeEventListener("pointermove",r,o),window.removeEventListener("contextmenu",n.noContextMenu),this.parent.div.style.cursor=u,this.div.style.cursor=p,this.#rc(l,h,d,c)};window.addEventListener("pointerup",g),window.addEventListener("blur",g)}#rc(t,e,i,r){let s=this.x,n=this.y,a=this.width,o=this.height;(s!==t||n!==e||a!==i||o!==r)&&this.addCommands({cmd:()=>{this.width=a,this.height=o,this.x=s,this.y=n;let[t,e]=this.parentDimensions;this.setDims(t*a,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=r,this.x=t,this.y=e;
2let[s,n]=this.parentDimensions;this.setDims(s*i,n*r),this.fixAndSetPosition()},mustExec:!0})}#rd(t,e){let i,r,s,n;let[a,o]=this.parentDimensions,h=this.x,d=this.y,c=this.width,u=this.height,p=l.MIN_SIZE/a,g=l.MIN_SIZE/o,f=t=>Math.round(1e4*t)/1e4,m=this.#ro(this.rotation),b=(t,e)=>[m[0]*t+m[2]*e,m[1]*t+m[3]*e],v=this.#ro(360-this.rotation),A=!1,y=!1;switch(t){case"topLeft":A=!0,i=(t,e)=>[0,0],r=(t,e)=>[t,e];break;case"topMiddle":i=(t,e)=>[t/2,0],r=(t,e)=>[t/2,e];break;case"topRight":A=!0,i=(t,e)=>[t,0],r=(t,e)=>[0,e];break;case"middleRight":y=!0,i=(t,e)=>[t,e/2],r=(t,e)=>[0,e/2];break;case"bottomRight":A=!0,i=(t,e)=>[t,e],r=(t,e)=>[0,0];break;case"bottomMiddle":i=(t,e)=>[t/2,e],r=(t,e)=>[t/2,0];break;case"bottomLeft":A=!0,i=(t,e)=>[0,e],r=(t,e)=>[t,0];break;case"middleLeft":y=!0,i=(t,e)=>[0,e/2],r=(t,e)=>[t,e/2]}let _=i(c,u),E=r(c,u),w=b(...E),x=f(h+w[0]),T=f(d+w[1]),S=1,C=1,[M,R]=this.screenToPageTranslation(e.movementX,e.movementY);if([M,R]=(s=M/a,n=R/o,[v[0]*s+v[2]*n,v[1]*s+v[3]*n]),A){let t=Math.hypot(c,u);S=C=Math.max(Math.min(Math.hypot(E[0]-_[0]-M,E[1]-_[1]-R)/t,1/c,1/u),p/c,g/u)}else y?S=Math.max(p,Math.min(1,Math.abs(E[0]-_[0]-M)))/c:C=Math.max(g,Math.min(1,Math.abs(E[1]-_[1]-R)))/u;let P=f(c*S),I=f(u*C);w=b(...r(P,I));let k=x-w[0],L=T-w[1];this.width=P,this.height=I,this.x=k,this.y=L,this.setDims(a*P,o*I),this.fixAndSetPosition()}altTextFinish(){this.#iz?.finish()}async addEditToolbar(){return this.#i1||this.#i3||(this.#i1=new o.EditorToolbar(this),this.div.append(this.#i1.render()),this.#iz&&this.#i1.addAltTextButton(await this.#iz.render())),this.#i1}removeEditToolbar(){this.#i1&&(this.#i1.remove(),this.#i1=null,this.#iz?.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#iz||(a.initialize(l._l10nPromise),this.#iz=new a(this),await this.addEditToolbar())}get altTextData(){return this.#iz?.data}set altTextData(t){this.#iz&&(this.#iz.data=t)}hasAltText(){return!this.#iz?.isEmpty()}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#iX?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.div.addEventListener("focusin",this.#iZ),this.div.addEventListener("focusout",this.#i0);let[t,e]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);let[i,s]=this.getInitialTranslation();return this.translate(i,s),(0,r.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){let{isMac:e}=s.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e){t.preventDefault();return}if(this.#i4=!0,this._isDraggable){this.#ru(t);return}this.#rp(t)}#rp(t){let{isMac:e}=s.FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#ru(t){let e,i;let r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession(),r&&(this.div.classList.add("moving"),e={passive:!0,capture:!0},this.#i8=t.clientX,this.#rt=t.clientY,i=t=>{let{clientX:e,clientY:i}=t,[r,s]=this.screenToPageTranslation(e-this.#i8,i-this.#rt);this.#i8=e,this.#rt=i,this._uiManager.dragSelectedEditors(r,s)},window.addEventListener("pointermove",i,e));let s=()=>{window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),r&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",i,e)),this.#i4=!1,this._uiManager.endDragSession()||this.#rp(t)};window.addEventListener("pointerup",s),window.addEventListener("blur",s)}moveInDOM(){this.#i7&&clearTimeout(this.#i7),this.#i7=setTimeout(()=>{this.#i7=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e,i=this.rotation){let r=this.parentScale,[s,n]=this.pageDimensions,[a,o]=this.pageTranslation,l=t/r,h=e/r,d=this.x*s,c=this.y*n,u=this.width*s,p=this.height*n;switch(i){case 0:return[d+l+a,n-c-h-p+o,d+l+u+a,n-c-h+o];case 90:return[d+h+a,n-c+l+o,d+h+p+a,n-c+l+u+o];case 180:return[d-l-u+a,n-c+h+o,d-l+a,n-c+h+p+o];case 270:return[d-h-p+a,n-c-l-u+o,d-h+a,n-c-l+o];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[i,r,s,n]=t,a=s-i,o=n-r;switch(this.rotation){case 0:return[i,e-n,a,o];case 90:return[i,e-r,o,a];case 180:return[s,e-r,a,o];case 270:return[s,e-n,o,a];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#i3=!0}disableEditMode(){this.#i3=!1}isInEditMode(){return this.#i3}shouldGetKeyboardEvents(){return this.#i9}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#iZ),this.div?.addEventListener("focusout",this.#i0)}rotate(t){}serialize(t=!1,e=null){(0,s.unreachable)("An editor must be serializable")}static deserialize(t,e,i){let r=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});r.rotation=t.rotation;let[s,n]=r.pageDimensions,[a,o,l,h]=r.getRectInCurrentCoords(t.rect,n);
2return r.x=a/s,r.y=o/n,r.width=l/s,r.height=h/n,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",this.#iZ),this.div.removeEventListener("focusout",this.#i0),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#i7&&(clearTimeout(this.#i7),this.#i7=null),this.#rs(),this.removeEditToolbar(),this.#re){for(let t of this.#re.values())clearTimeout(t);this.#re=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#rl(),this.#iJ.classList.remove("hidden"),(0,r.bindEvents)(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#iQ={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let e=this.#iJ.children;if(!this.#iK){this.#iK=Array.from(e);let t=this.#rg.bind(this),i=this.#rf.bind(this);for(let e of this.#iK){let r=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t),e.addEventListener("blur",i),e.addEventListener("focus",this.#rm.bind(this,r)),l._l10nPromise.get(`pdfjs-editor-resizer-label-${r}`).then(t=>e.setAttribute("aria-label",t))}}let i=this.#iK[0],r=0;for(let t of e){if(t===i)break;r++}let s=(360-this.rotation+this.parentRotation)%360/90*(this.#iK.length/4);if(s!==r){if(s<r)for(let t=0;t<r-s;t++)this.#iJ.append(this.#iJ.firstChild);else if(s>r)for(let t=0;t<s-r;t++)this.#iJ.firstChild.before(this.#iJ.lastChild);let t=0;for(let i of e){let e=this.#iK[t++].getAttribute("data-resizer-name");l._l10nPromise.get(`pdfjs-editor-resizer-label-${e}`).then(t=>i.setAttribute("aria-label",t))}}this.#rb(0),this.#i9=!0,this.#iJ.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#rg(t){l._resizerKeyboardManager.exec(this,t)}#rf(t){this.#i9&&t.relatedTarget?.parentNode!==this.#iJ&&this.#rs()}#rm(t){this.#i2=this.#i9?t:""}#rb(t){if(this.#iK)for(let e of this.#iK)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#i9&&this.#rd(this.#i2,{movementX:t,movementY:e})}#rs(){if(this.#i9=!1,this.#rb(-1),this.#iQ){let{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=this.#iQ;this.#rc(t,e,i,r),this.#iQ=null}}_stopResizingWithKeyboard(){this.#rs(),this.div.focus()}select(){if(this.makeResizable(),this.div?.classList.add("selectedEditor"),!this.#i1){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this.#i1?.show()});return}this.#i1?.show()}unselect(){this.#iJ?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this.#i1?.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#i6}set isEditing(t){this.#i6=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#iY=!0;let{style:i}=this.div;i.aspectRatio=t/e,i.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#re||=new Map;let{action:e}=t,i=this.#re.get(e);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#re.delete(e),0===this.#re.size&&(this.#re=null)},l._telemetryTimeout),this.#re.set(e,i);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#iX=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#iX=!0}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){let t=e;(e=document.createElement("div")).classList.add("annotationContent",this.editorType),t.before(e)}}else(e=document.createElement("div")).classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){let{firstChild:e}=t.container;
2"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}class h extends l{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},4061:(t,e,i)=>{i.d(e,{FreeOutliner:()=>o,Outliner:()=>s}),i(4114),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197);var r=i(4292);class s{#rv;#rA=[];#ry=[];constructor(t,e=0,i=0,r=!0){let s=1/0,n=-1/0,a=1/0,o=-1/0;for(let{x:i,y:r,width:l,height:h}of t){let t=1e-4*Math.floor((i-e)/1e-4),d=1e-4*Math.ceil((i+l+e)/1e-4),c=1e-4*Math.floor((r-e)/1e-4),u=1e-4*Math.ceil((r+h+e)/1e-4),p=[t,c,u,!0],g=[d,c,u,!1];this.#rA.push(p,g),s=Math.min(s,t),n=Math.max(n,d),a=Math.min(a,c),o=Math.max(o,u)}let l=n-s+2*i,h=o-a+2*i,d=s-i,c=a-i,u=this.#rA.at(r?-1:-2),p=[u[0],u[2]];for(let t of this.#rA){let[e,i,r]=t;t[0]=(e-d)/l,t[1]=(i-c)/h,t[2]=(r-c)/h}this.#rv={x:d,y:c,width:l,height:h,lastPoint:p}}getOutlines(){this.#rA.sort((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]);let t=[];for(let e of this.#rA)e[3]?(t.push(...this.#r_(e)),this.#rE(e)):(this.#rw(e),t.push(...this.#r_(e)));return this.#rx(t)}#rx(t){let e;let i=[],r=new Set;for(let e of t){let[t,r,s]=e;i.push([t,r,e],[t,s,e])}i.sort((t,e)=>t[1]-e[1]||t[0]-e[0]);for(let t=0,e=i.length;t<e;t+=2){let e=i[t][2],s=i[t+1][2];e.push(s),s.push(e),r.add(e),r.add(s)}let s=[];for(;r.size>0;){let t=r.values().next().value,[i,n,a,o,l]=t;r.delete(t);let h=i,d=n;for(e=[i,a],s.push(e);;){let t;if(r.has(o))t=o;else if(r.has(l))t=l;else break;r.delete(t),[i,n,a,o,l]=t,h!==i&&(e.push(h,d,i,d===n?n:a),h=i),d=d===n?a:n}e.push(h,d)}return new a(s,this.#rv)}#rT(t){let e=this.#ry,i=0,r=e.length-1;for(;i<=r;){let s=i+r>>1,n=e[s][0];if(n===t)return s;n<t?i=s+1:r=s-1}return r+1}#rE([,t,e]){let i=this.#rT(t);this.#ry.splice(i,0,[t,e])}#rw([,t,e]){let i=this.#rT(t);for(let r=i;r<this.#ry.length;r++){let[i,s]=this.#ry[r];if(i!==t)break;if(i===t&&s===e){this.#ry.splice(r,1);return}}for(let r=i-1;r>=0;r--){let[i,s]=this.#ry[r];if(i!==t)break;if(i===t&&s===e){this.#ry.splice(r,1);return}}}#r_(t){let[e,i,r]=t,s=[[e,i,r]],n=this.#rT(r);for(let t=0;t<n;t++){let[i,r]=this.#ry[t];for(let t=0,n=s.length;t<n;t++){let[,a,o]=s[t];if(!(r<=a)&&!(o<=i)){if(a>=i){if(o>r)s[t][1]=r;else{if(1===n)return[];s.splice(t,1),t--,n--}continue}s[t][2]=i,o>r&&s.push([e,r,o])}}}return s}}class n{toSVGPath(){throw Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof l}}class a extends n{#rv;#rS;constructor(t,e){super(),this.#rS=t,this.#rv=e}toSVGPath(){let t=[];for(let e of this.#rS){let[i,r]=e;t.push(`M${i} ${r}`);for(let s=2;s<e.length;s+=2){let n=e[s],a=e[s+1];n===i?(t.push(`V${a}`),r=a):a===r&&(t.push(`H${n}`),i=n)}t.push("Z")}return t.join(" ")}serialize([t,e,i,r],s){let n=[],a=i-t,o=r-e;for(let e of this.#rS){let i=Array(e.length);for(let s=0;s<e.length;s+=2)i[s]=t+e[s]*a,i[s+1]=r-e[s+1]*o;n.push(i)}return n}get box(){return this.#rv}}class o{#rv;#rC=[];#rM;#rR;#rP=[];#rI=new Float64Array(18);#rk;#rL;#rD;#rF;#rO;#t8;#rN=[];static #rB=8;static #rU=2;static #rH=o.#rB+o.#rU;constructor({x:t,y:e},i,r,s,n,a=0){this.#rv=i,this.#t8=s*r,this.#rR=n,this.#rI.set([NaN,NaN,NaN,NaN,t,e],6),this.#rM=a,this.#rF=o.#rB*r,this.#rD=o.#rH*r,this.#rO=r,this.#rN.push(t,e)}get free(){return!0}isEmpty(){return isNaN(this.#rI[8])}#rz(){let t=this.#rI.subarray(4,6),e=this.#rI.subarray(16,18),[i,r,s,n]=this.#rv;return[(this.#rk+(t[0]-e[0])/2-i)/s,(this.#rL+(t[1]-e[1])/2-r)/n,(this.#rk+(e[0]-t[0])/2-i)/s,(this.#rL+(e[1]-t[1])/2-r)/n]}add({x:t,y:e}){this.#rk=t,this.#rL=e;let[i,r,s,n]=this.#rv,[a,o,l,h]=this.#rI.subarray(8,12),d=t-l,c=e-h,u=Math.hypot(d,c);if(u<this.#rD)return!1;let p=u-this.#rF,g=p/u,f=g*d,m=g*c,b=a,v=o;a=l,o=h,l+=f,h+=m,this.#rN?.push(t,e);let A=-m/p*this.#t8,y=f/p*this.#t8;return(this.#rI.set(this.#rI.subarray(2,8),0),this.#rI.set([l+A,h+y],4),this.#rI.set(this.#rI.subarray(14,18),12),this.#rI.set([l-A,h-y],16),isNaN(this.#rI[6]))?(0===this.#rP.length&&(this.#rI.set([a+A,o+y],2),this.#rP.push(NaN,NaN,NaN,NaN,(a+A-i)/s,(o+y-r)/n),this.#rI.set([a-A,o-y],14),this.#rC.push(NaN,NaN,NaN,NaN,(a-A-i)/s,(o-y-r)/n)),this.#rI.set([b,v,a,o,l,h],6),!this.isEmpty()):((this.#rI.set([b,v,a,o,l,h],6),Math.abs(Math.atan2(v-o,b-a)-Math.atan2(m,f))<Math.PI/2)?([a,o,l,h]=this.#rI.subarray(2,6),this.#rP.push(NaN,NaN,NaN,NaN,((a+l)/2-i)/s,((o+h)/2-r)/n),[a,o,b,v]=this.#rI.subarray(14,18),this.#rC.push(NaN,NaN,NaN,NaN,((b+a)/2-i)/s,((v+o)/2-r)/n)):([b,v,a,o,l,h]=this.#rI.subarray(0,6),this.#rP.push(((b+5*a)/6-i)/s,((v+5*o)/6-r)/n,((5*a+l)/6-i)/s,((5*o+h)/6-r)/n,((a+l)/2-i)/s,((o+h)/2-r)/n),[l,h,a,o,b,v]=this.#rI.subarray(12,18),this.#rC.push(((b+5*a)/6-i)/s,((v+5*o)/6-r)/n,((5*a+l)/6-i)/s,((5*o+h)/6-r)/n,((a+l)/2-i)/s,((o+h)/2-r)/n)),!0)}toSVGPath(){if(this.isEmpty())return"";let t=this.#rP,e=this.#rC,i=this.#rI.subarray(4,6),r=this.#rI.subarray(16,18),[s,n,a,o]=this.#rv,[l,h,d,c]=this.#rz();if(isNaN(this.#rI[6])&&!this.isEmpty())return`M${(this.#rI[2]-s)/a} ${(this.#rI[3]-n)/o} L${(this.#rI[4]-s)/a} ${(this.#rI[5]-n)/o} L${l} ${h} L${d} ${c} L${(this.#rI[16]-s)/a} ${(this.#rI[17]-n)/o} L${(this.#rI[14]-s)/a} ${(this.#rI[15]-n)/o} Z`;let u=[];u.push(`M${t[4]} ${t[5]}`);for(let e=6;e<t.length;e+=6)isNaN(t[e])?u.push(`L${t[e+4]} ${t[e+5]}`):u.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);u.push(`L${(i[0]-s)/a} ${(i[1]-n)/o} L${l} ${h} L${d} ${c} L${(r[0]-s)/a} ${(r[1]-n)/o}`);for(let t=e.length-6;t>=6;t-=6)isNaN(e[t])?u.push(`L${e[t+4]} ${e[t+5]}`):u.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);return u.push(`L${e[4]} ${e[5]} Z`),u.join(" ")}getOutlines(){let t=this.#rP,e=this.#rC,i=this.#rI,r=i.subarray(4,6),s=i.subarray(16,18),[n,a,o,h]=this.#rv,d=new Float64Array((this.#rN?.length??0)+2);for(let t=0,e=d.length-2;t<e;t+=2)d[t]=(this.#rN[t]-n)/o,d[t+1]=(this.#rN[t+1]-a)/h;d[d.length-2]=(this.#rk-n)/o,d[d.length-1]=(this.#rL-a)/h;let[c,u,p,g]=this.#rz();if(isNaN(i[6])&&!this.isEmpty()){let t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(i[2]-n)/o,(i[3]-a)/h,NaN,NaN,NaN,NaN,(i[4]-n)/o,(i[5]-a)/h,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,p,g,NaN,NaN,NaN,NaN,(i[16]-n)/o,(i[17]-a)/h,NaN,NaN,NaN,NaN,(i[14]-n)/o,(i[15]-a)/h],0),new l(t,d,this.#rv,this.#rO,this.#rM,this.#rR)}let f=new Float64Array(this.#rP.length+24+this.#rC.length),m=t.length;for(let e=0;e<m;e+=2){if(isNaN(t[e])){f[e]=f[e+1]=NaN;continue}f[e]=t[e],f[e+1]=t[e+1]}f.set([NaN,NaN,NaN,NaN,(r[0]-n)/o,(r[1]-a)/h,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,p,g,NaN,NaN,NaN,NaN,(s[0]-n)/o,(s[1]-a)/h],m),m+=24;for(let t=e.length-6;t>=6;t-=6)for(let i=0;i<6;i+=2){if(isNaN(e[t+i])){f[m]=f[m+1]=NaN,m+=2;continue}f[m]=e[t+i],f[m+1]=e[t+i+1],m+=2}return f.set([NaN,NaN,NaN,NaN,e[4],e[5]],m),new l(f,d,this.#rv,this.#rO,this.#rM,this.#rR)}}class l extends n{#rv;#rj=null;#rM;#rR;#rN;#rO;#r$;constructor(t,e,i,r,s,n){super(),this.#r$=t,this.#rN=e,this.#rv=i,this.#rO=r,this.#rM=s,this.#rR=n,this.#rV(n);let{x:a,y:o,width:l,height:h}=this.#rj;for(let e=0,i=t.length;e<i;e+=2)t[e]=(t[e]-a)/l,t[e+1]=(t[e+1]-o)/h;for(let t=0,i=e.length;t<i;t+=2)e[t]=(e[t]-a)/l,e[t+1]=(e[t+1]-o)/h}toSVGPath(){let t=[`M${this.#r$[4]} ${this.#r$[5]}`];for(let e=6,i=this.#r$.length;e<i;e+=6){if(isNaN(this.#r$[e])){t.push(`L${this.#r$[e+4]} ${this.#r$[e+5]}`);continue}t.push(`C${this.#r$[e]} ${this.#r$[e+1]} ${this.#r$[e+2]} ${this.#r$[e+3]} ${this.#r$[e+4]} ${this.#r$[e+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,e,i,r],s){let n,a;let o=i-t,l=r-e;switch(s){case 0:n=this.#rG(this.#r$,t,r,o,-l),a=this.#rG(this.#rN,t,r,o,-l);break;case 90:n=this.#rW(this.#r$,t,e,o,l),a=this.#rW(this.#rN,t,e,o,l);break;case 180:n=this.#rG(this.#r$,i,e,-o,l),a=this.#rG(this.#rN,i,e,-o,l);break;case 270:n=this.#rW(this.#r$,i,r,-o,-l),a=this.#rW(this.#rN,i,r,-o,-l)}return{outline:Array.from(n),points:[Array.from(a)]}}#rG(t,e,i,r,s){let n=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)n[a]=e+t[a]*r,n[a+1]=i+t[a+1]*s;return n}#rW(t,e,i,r,s){let n=new Float64Array(t.length);for(let a=0,o=t.length;a<o;a+=2)n[a]=e+t[a+1]*r,n[a+1]=i+t[a]*s;return n}#rV(t){let e=this.#r$,i=e[4],s=e[5],n=i,a=s,o=i,l=s,h=i,d=s,c=t?Math.max:Math.min;for(let t=6,u=e.length;t<u;t+=6){if(isNaN(e[t]))n=Math.min(n,e[t+4]),a=Math.min(a,e[t+5]),o=Math.max(o,e[t+4]),l=Math.max(l,e[t+5]),d<e[t+5]?(h=e[t+4],d=e[t+5]):d===e[t+5]&&(h=c(h,e[t+4]));else{let u=r.Util.bezierBoundingBox(i,s,...e.slice(t,t+6));n=Math.min(n,u[0]),a=Math.min(a,u[1]),o=Math.max(o,u[2]),l=Math.max(l,u[3]),d<u[3]?(h=u[2],d=u[3]):d===u[3]&&(h=c(h,u[2]))}i=e[t+4],s=e[t+5]}let u=n-this.#rM,p=a-this.#rM,g=o-n+2*this.#rM,f=l-a+2*this.#rM;this.#rj={x:u,y:p,width:g,height:f,lastPoint:[h,d]}}get box(){return this.#rj}getNewOutline(t,e){let{x:i,y:r,width:s,height:n}=this.#rj,[a,l,h,d]=this.#rv,c=s*h,u=n*d,p=i*h+a,g=r*d+l,f=new o({x:this.#rN[0]*c+p,y:this.#rN[1]*u+g},this.#rv,this.#rO,t,this.#rR,e??this.#rM);for(let t=2;t<this.#rN.length;t+=2)f.add({x:this.#rN[t]*c+p,y:this.#rN[t+1]*u+g});return f.getOutlines()}}}
2,4362:(t,e,i)=>{i.d(e,{EditorToolbar:()=>s,HighlightToolbar:()=>n});var r=i(5419);class s{#rq=null;#tY=null;#iD;#rK=null;constructor(t){this.#iD=t}render(){let t=this.#rq=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",r.noContextMenu),t.addEventListener("pointerdown",s.#iC);let e=this.#rK=document.createElement("div");e.className="buttons",t.append(e);let i=this.#iD.toolbarPosition;if(i){let{style:e}=t,r="ltr"===this.#iD._uiManager.direction?1-i[0]:i[0];e.insetInlineEnd=`${100*r}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#rX(),t}static #iC(t){t.stopPropagation()}#rY(t){this.#iD._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}#rJ(t){this.#iD._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}#rQ(t){t.addEventListener("focusin",this.#rY.bind(this),{capture:!0}),t.addEventListener("focusout",this.#rJ.bind(this),{capture:!0}),t.addEventListener("contextmenu",r.noContextMenu)}hide(){this.#rq.classList.add("hidden"),this.#tY?.hideDropdown()}show(){this.#rq.classList.remove("hidden")}#rX(){let t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${this.#iD.editorType}-button`),this.#rQ(t),t.addEventListener("click",t=>{this.#iD._uiManager.delete()}),this.#rK.append(t)}get #rZ(){let t=document.createElement("div");return t.className="divider",t}addAltTextButton(t){this.#rQ(t),this.#rK.prepend(t,this.#rZ)}addColorPicker(t){this.#tY=t;let e=t.renderButton();this.#rQ(e),this.#rK.prepend(e,this.#rZ)}remove(){this.#rq.remove(),this.#tY?.destroy(),this.#tY=null}}class n{#rK=null;#rq=null;#iA;constructor(t){this.#iA=t}#r0(){let t=this.#rq=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",r.noContextMenu);let e=this.#rK=document.createElement("div");return e.className="buttons",t.append(e),this.#r1(),t}#r2(t,e){let i=0,r=0;for(let s of t){let t=s.y+s.height;if(t<i)continue;let n=s.x+(e?s.width:0);if(t>i){r=n,i=t;continue}e?n>r&&(r=n):n<r&&(r=n)}return[e?1-r:r,i]}show(t,e,i){let[r,s]=this.#r2(e,i),{style:n}=this.#rq||=this.#r0();t.append(this.#rq),n.insetInlineEnd=`${100*r}%`,n.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#rq.remove()}#r1(){let t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");let e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label"),t.addEventListener("contextmenu",r.noContextMenu),t.addEventListener("click",()=>{this.#iA.highlightSelection("floating_button")}),this.#rK.append(t)}}},7830:(t,e,i)=>{i.d(e,{AnnotationEditorUIManager:()=>p,ColorManager:()=>u,KeyboardManager:()=>c,bindEvents:()=>a,opacityToHex:()=>o}),i(4114),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577),i(8992),i(3215),i(1454),i(7550),i(8335),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197);var r=i(4292),s=i(5419),n=i(4362);function a(t,e,i){for(let r of i)e.addEventListener(r,t[r].bind(t))}function o(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class l{#tg=0;constructor(){}get id(){return`${r.AnnotationEditorPrefix}${this.#tg++}`}}class h{#r4=(0,r.getUuid)();#tg=0;#tf=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.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>';let i=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]));return(0,r.shadow)(this,"_isSVGFittingCanvas",i)}async #r5(t,e){this.#tf||=new Map;let i=this.#tf.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#r4}_${this.#tg++}`,refCounter:0,isSvg:!1},"string"==typeof e?(i.url=e,t=await (0,s.fetchData)(e,"blob")):t=i.file=e,"image/svg+xml"===t.type){let e=h._isSVGFittingCanvas,r=new FileReader,s=new Image,n=new Promise((t,n)=>{s.onload=()=>
2{i.bitmap=s,i.isSvg=!0,t()},r.onload=async()=>{let t=i.svgUrl=r.result;s.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},s.onerror=r.onerror=n});r.readAsDataURL(t),await n}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}return this.#tf.set(t,i),i&&this.#tf.set(i.id,i),i}async getFromFile(t){let{lastModified:e,name:i,size:r,type:s}=t;return this.#r5(`${e}_${i}_${r}_${s}`,t)}async getFromUrl(t){return this.#r5(t,t)}async getFromId(t){this.#tf||=new Map;let e=this.#tf.get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){let e=this.#tf.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#tf||=new Map;let e=this.#tf.get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#r4}_`)}}class d{#r6=[];#r3=!1;#r9;#r7=-1;constructor(t=128){this.#r9=t}add({cmd:t,undo:e,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:n=!1,keepUndo:a=!1}){if(r&&t(),this.#r3)return;let o={cmd:t,undo:e,post:i,type:s};if(-1===this.#r7){this.#r6.length>0&&(this.#r6.length=0),this.#r7=0,this.#r6.push(o);return}if(n&&this.#r6[this.#r7].type===s){a&&(o.undo=this.#r6[this.#r7].undo),this.#r6[this.#r7]=o;return}let l=this.#r7+1;l===this.#r9?this.#r6.splice(0,1):(this.#r7=l,l<this.#r6.length&&this.#r6.splice(l)),this.#r6.push(o)}undo(){if(-1===this.#r7)return;this.#r3=!0;let{undo:t,post:e}=this.#r6[this.#r7];t(),e?.(),this.#r3=!1,this.#r7-=1}redo(){if(this.#r7<this.#r6.length-1){this.#r7+=1,this.#r3=!0;let{cmd:t,post:e}=this.#r6[this.#r7];t(),e?.(),this.#r3=!1}}hasSomethingToUndo(){return -1!==this.#r7}hasSomethingToRedo(){return this.#r7<this.#r6.length-1}destroy(){this.#r6=null}}class c{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:e}=r.FeatureTest.platform;for(let[i,r,s={}]of t)for(let t of i){let i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:r,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:r,options:s}),this.allKeys.add(t.split("+").at(-1)))}}#r8(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);let e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;let i=this.callbacks.get(this.#r8(e));if(!i)return;let{callback:r,options:{bubbles:s=!1,args:n=[],checker:a=null}}=i;(!a||a(t,e))&&(r.bind(t,...n,e)(),s||(e.stopPropagation(),e.preventDefault()))}}class u{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return(0,s.getColorValues)(t),(0,r.shadow)(this,"_colors",t)}convert(t){let e=(0,s.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[t,i]of this._colors)if(i.every((t,i)=>t===e[i]))return u._colorsMapping.get(t);return e}getHexCode(t){let e=this._colors.get(t);return e?r.Util.makeHexColor(...e):t}}class p{#st=null;#se=new Map;#si=new Map;#sr=null;#ss=null;#sn=null;#sa=new d;#so=0;#sl=new Set;#sh=null;#iy=null;#sd=new Set;#sc=!1;#su=null;#sp=null;#sg=null;#sf=!1;#sm=null;#sb=new l;#sv=!1;#sA=!1;#sy=null;#s_=null;#sE=null;#sw=r.AnnotationEditorType.NONE;#sx=new Set;#sT=null;#sS=null;#sC=null;#sM=this.blur.bind(this);#sR=this.focus.bind(this);#sP=this.copy.bind(this);#sI=this.cut.bind(this);#sk=this.paste.bind(this);#t4=this.keydown.bind(this);#sL=this.keyup.bind(this);#sD=this.onEditingAction.bind(this);#sF=this.onPageChanging.bind(this);#sO=this.onScaleChanging.bind(this);#sN=this.#sB.bind(this);#sU=this.onRotationChanging.bind(this);#sH={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#sz=[0,0];#sj=null;#f=null;#s$=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=p.prototype,e=t=>t.#f.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>
2{if(e instanceof HTMLInputElement){let{type:t}=e;return"text"!==t&&"number"!==t}return!0},s=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new c([[["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:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#f.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#f.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}]]))}constructor(t,e,i,r,n,a,o,l,h){this.#f=t,this.#s$=e,this.#sr=i,this._eventBus=r,this._eventBus._on("editingaction",this.#sD),this._eventBus._on("pagechanging",this.#sF),this._eventBus._on("scalechanging",this.#sO),this._eventBus._on("rotationchanging",this.#sU),this.#sV(),this.#sG(),this.#ss=n.annotationStorage,this.#su=n.filterFactory,this.#sS=a,this.#sg=o||null,this.#sc=l,this.#sE=h||null,this.viewParameters={realScale:s.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){for(let t of(this.#sW(),this.#sq(),this._eventBus._off("editingaction",this.#sD),this._eventBus._off("pagechanging",this.#sF),this._eventBus._off("scalechanging",this.#sO),this._eventBus._off("rotationchanging",this.#sU),this.#si.values()))t.destroy();this.#si.clear(),this.#se.clear(),this.#sd.clear(),this.#st=null,this.#sx.clear(),this.#sa.destroy(),this.#sr?.destroy(),this.#sm?.hide(),this.#sm=null,this.#sp&&(clearTimeout(this.#sp),this.#sp=null),this.#sj&&(clearTimeout(this.#sj),this.#sj=null),this.#sK()}async mlGuess(t){return this.#sE?.guess(t)||null}get hasMLManager(){return!!this.#sE}get hcmFilter(){return(0,r.shadow)(this,"hcmFilter",this.#sS?this.#su.addHCMFilter(this.#sS.foreground,this.#sS.background):"none")}get direction(){return(0,r.shadow)(this,"direction",getComputedStyle(this.#f).direction)}get highlightColors(){return(0,r.shadow)(this,"highlightColors",this.#sg?new Map(this.#sg.split(",").map(t=>t.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return(0,r.shadow)(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#s_=t}editAltText(t){this.#sr?.editAltText(this,t)}onPageChanging({pageNumber:t}){this.#so=t-1}focusMainContainer(){this.#f.focus()}findParent(t,e){for(let i of this.#si.values()){let{x:r,y:s,width:n,height:a}=i.div.getBoundingClientRect();if(t>=r&&t<=r+n&&e>=s&&e<=s+a)return i}return null}disableUserSelect(t=!1){this.#s$.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#sd.add(t)}removeShouldRescale(t){this.#sd.delete(t)}onScaleChanging({scale:t}){for(let e of(this.commitOrRemove(),this.viewParameters.realScale=t*s.PixelsPerInch.PDF_TO_CSS_UNITS,this.#sd))e.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#sX({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}highlightSelection(t=""){let e=document.getSelection();if(!e||e.isCollapsed)return;let{anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:a}=e,o=e.toString(),l=this.#sX(e).closest(".textLayer"),h=this.getSelectionBoxes(l);if(h){for(let d of(e.empty(),this.#sw===r.AnnotationEditorType.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:r.AnnotationEditorType.HIGHLIGHT}
2),this.showAllEditors("highlight",!0,!0)),this.#si.values()))if(d.hasTextLayer(l)){d.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:s,focusNode:n,focusOffset:a,text:o});break}}}#sY(){let t=document.getSelection();if(!t||t.isCollapsed)return;let e=this.#sX(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#sm||=new n.HighlightToolbar(this),this.#sm.show(e,i,"ltr"===this.direction))}addToAnnotationStorage(t){t.isEmpty()||!this.#ss||this.#ss.has(t.id)||this.#ss.setValue(t.id,t)}#sB(){let t=document.getSelection();if(!t||t.isCollapsed){this.#sT&&(this.#sm?.hide(),this.#sT=null,this.#sJ({hasSelectedText:!1}));return}let{anchorNode:e}=t;if(e!==this.#sT){if(!this.#sX(t).closest(".textLayer")){this.#sT&&(this.#sm?.hide(),this.#sT=null,this.#sJ({hasSelectedText:!1}));return}if(this.#sm?.hide(),this.#sT=e,this.#sJ({hasSelectedText:!0}),(this.#sw===r.AnnotationEditorType.HIGHLIGHT||this.#sw===r.AnnotationEditorType.NONE)&&(this.#sw===r.AnnotationEditorType.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#sf=this.isShiftKeyDown,!this.isShiftKeyDown)){let t=e=>{("pointerup"!==e.type||0===e.button)&&(window.removeEventListener("pointerup",t),window.removeEventListener("blur",t),"pointerup"===e.type&&this.#sQ("main_toolbar"))};window.addEventListener("pointerup",t),window.addEventListener("blur",t)}}}#sQ(t=""){this.#sw===r.AnnotationEditorType.HIGHLIGHT?this.highlightSelection(t):this.#sc&&this.#sY()}#sV(){document.addEventListener("selectionchange",this.#sN)}#sK(){document.removeEventListener("selectionchange",this.#sN)}#sZ(){window.addEventListener("focus",this.#sR),window.addEventListener("blur",this.#sM)}#sq(){window.removeEventListener("focus",this.#sR),window.removeEventListener("blur",this.#sM)}blur(){if(this.isShiftKeyDown=!1,this.#sf&&(this.#sf=!1,this.#sQ("main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let e of this.#sx)if(e.div.contains(t)){this.#sy=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#sy)return;let[t,e]=this.#sy;this.#sy=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus()}#sG(){window.addEventListener("keydown",this.#t4),window.addEventListener("keyup",this.#sL)}#sW(){window.removeEventListener("keydown",this.#t4),window.removeEventListener("keyup",this.#sL)}#s0(){document.addEventListener("copy",this.#sP),document.addEventListener("cut",this.#sI),document.addEventListener("paste",this.#sk)}#s1(){document.removeEventListener("copy",this.#sP),document.removeEventListener("cut",this.#sI),document.removeEventListener("paste",this.#sk)}addEditListeners(){this.#sG(),this.#s0()}removeEditListeners(){this.#sW(),this.#s1()}copy(t){if(t.preventDefault(),this.#st?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let t of this.#sx){let i=t.serialize(!0);i&&e.push(i)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let{clipboardData:e}=t;for(let t of e.items)for(let e of this.#iy)if(e.isHandlingMimeForPasting(t.type)){e.paste(t,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){(0,r.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();let s=this.currentLayer;try{let t=[];for(let e of i){let i=s.deserialize(e);if(!i)return;t.push(i)}this.addCommands({cmd:()=>{for(let e of t)this.#s2(e);this.#s4(t)},undo:()=>{for(let e of t)e.remove()},mustExec:!0})}catch(t){(0,r.warn)(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#sw===r.AnnotationEditorType.NONE||this.isEditorHandlingKeyboard||p._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#sf&&(this.#sf=!1,this.#sQ("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#sJ(t){Object.entries(t).some(([t,e])=>this.#sH[t]!==e)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#sH,t)}),this.#sw===r.AnnotationEditorType.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#s5([[r.AnnotationEditorParamsType.HIGHLIGHT_FREE,!0]]))}#s5(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#sZ(),this.#s0(),this.#sJ({isEditing:this.#sw!==r.AnnotationEditorType.NONE,isEmpty:this.#s6(),hasSomethingToUndo:this.#sa.hasSomethingToUndo(),hasSomethingToRedo:this.#sa.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#sq(),this.#s1(),this.#sJ({isEditing:!1}),this.disableUserSelect(!1))}
2registerEditorTypes(t){if(!this.#iy)for(let e of(this.#iy=t,this.#iy))this.#s5(e.defaultPropertiesToUpdate)}getId(){return this.#sb.id}get currentLayer(){return this.#si.get(this.#so)}getLayer(t){return this.#si.get(t)}get currentPageIndex(){return this.#so}addLayer(t){this.#si.set(t.pageIndex,t),this.#sv?t.enable():t.disable()}removeLayer(t){this.#si.delete(t.pageIndex)}updateMode(t,e=null,i=!1){if(this.#sw!==t){if(this.#sw=t,t===r.AnnotationEditorType.NONE){this.setEditingState(!1),this.#s3();return}for(let e of(this.setEditingState(!0),this.#s9(),this.unselectAll(),this.#si.values()))e.updateMode(t);if(!e&&i){this.addNewEditorFromKeyboard();return}if(e){for(let t of this.#se.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#sw&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#iy){switch(t){case r.AnnotationEditorParamsType.CREATE:this.currentLayer.addNewEditor();return;case r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:this.#s_?.updateColor(e);break;case r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#sC||=new Map).set(t,e),this.showAllEditors("highlight",e)}for(let i of this.#sx)i.updateParams(t,e);for(let i of this.#iy)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(let i of this.#se.values())i.editorType===t&&i.show(e);(this.#sC?.get(r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#s5([[r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#sA!==t)for(let e of(this.#sA=t,this.#si.values()))t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}#s9(){if(!this.#sv){for(let t of(this.#sv=!0,this.#si.values()))t.enable();for(let t of this.#se.values())t.enable()}}#s3(){if(this.unselectAll(),this.#sv){for(let t of(this.#sv=!1,this.#si.values()))t.disable();for(let t of this.#se.values())t.disable()}}getEditors(t){let e=[];for(let i of this.#se.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#se.get(t)}addEditor(t){this.#se.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#sp&&clearTimeout(this.#sp),this.#sp=setTimeout(()=>{this.focusMainContainer(),this.#sp=null},0)),this.#se.delete(t.id),this.unselect(t),t.annotationElementId&&this.#sl.has(t.annotationElementId)||this.#ss?.remove(t.id)}addDeletedAnnotationElement(t){this.#sl.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#sl.has(t)}removeDeletedAnnotationElement(t){this.#sl.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#s2(t){let e=this.#si.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#st!==t&&(this.#st=t,t&&this.#s5(t.propertiesToUpdate))}get #s7(){let t=null;for(t of this.#sx);return t}updateUI(t){this.#s7===t&&this.#s5(t.propertiesToUpdate)}toggleSelected(t){if(this.#sx.has(t)){this.#sx.delete(t),t.unselect(),this.#sJ({hasSelectedEditor:this.hasSelection});return}this.#sx.add(t),t.select(),this.#s5(t.propertiesToUpdate),this.#sJ({hasSelectedEditor:!0})}setSelected(t){for(let e of this.#sx)e!==t&&e.unselect();this.#sx.clear(),this.#sx.add(t),t.select(),this.#s5(t.propertiesToUpdate),this.#sJ({hasSelectedEditor:!0})}isSelected(t){return this.#sx.has(t)}get firstSelectedEditor(){return this.#sx.values().next().value}unselect(t){t.unselect(),this.#sx.delete(t),this.#sJ({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#sx.size}get isEnterHandled(){return 1===this.#sx.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#sa.undo(),this.#sJ({hasSomethingToUndo:this.#sa.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#s6()})}redo(){this.#sa.redo(),this.#sJ({hasSomethingToUndo:!0,hasSomethingToRedo:this.#sa.hasSomethingToRedo(),isEmpty:this.#s6()})}addCommands(t){this.#sa.add(t),this.#sJ({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#s6()})}#s6(){if(0===this.#se.size)return!0;
2if(1===this.#se.size)for(let t of this.#se.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let t=[...this.#sx];this.addCommands({cmd:()=>{for(let e of t)e.remove()},undo:()=>{for(let e of t)this.#s2(e)},mustExec:!0})}commitOrRemove(){this.#st?.commitOrRemove()}hasSomethingToControl(){return this.#st||this.hasSelection}#s4(t){for(let t of this.#sx)t.unselect();for(let e of(this.#sx.clear(),t))e.isEmpty()||(this.#sx.add(e),e.select());this.#sJ({hasSelectedEditor:this.hasSelection})}selectAll(){for(let t of this.#sx)t.commit();this.#s4(this.#se.values())}unselectAll(){if((!this.#st||(this.#st.commitOrRemove(),this.#sw===r.AnnotationEditorType.NONE))&&this.hasSelection){for(let t of this.#sx)t.unselect();this.#sx.clear(),this.#sJ({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#sz[0]+=t,this.#sz[1]+=e;let[r,s]=this.#sz,n=[...this.#sx];for(let i of(this.#sj&&clearTimeout(this.#sj),this.#sj=setTimeout(()=>{this.#sj=null,this.#sz[0]=this.#sz[1]=0,this.addCommands({cmd:()=>{for(let t of n)this.#se.has(t.id)&&t.translateInPage(r,s)},undo:()=>{for(let t of n)this.#se.has(t.id)&&t.translateInPage(-r,-s)},mustExec:!1})},1e3),n))i.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection)for(let t of(this.disableUserSelect(!0),this.#sh=new Map,this.#sx))this.#sh.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#sh)return!1;this.disableUserSelect(!1);let t=this.#sh;this.#sh=null;let e=!1;for(let[{x:i,y:r,pageIndex:s},n]of t)n.newX=i,n.newY=r,n.newPageIndex=s,e||=i!==n.savedX||r!==n.savedY||s!==n.savedPageIndex;if(!e)return!1;let i=(t,e,i,r)=>{if(this.#se.has(t.id)){let s=this.#si.get(r);s?t._setParentAndPosition(s,e,i):(t.pageIndex=r,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(let[e,{newX:r,newY:s,newPageIndex:n}]of t)i(e,r,s,n)},undo:()=>{for(let[e,{savedX:r,savedY:s,savedPageIndex:n}]of t)i(e,r,s,n)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#sh)for(let i of this.#sh.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){let e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#sx.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#st===t}getActive(){return this.#st}getMode(){return this.#sw}get imageManager(){return(0,r.shadow)(this,"imageManager",new h)}getSelectionBoxes(t){let e;if(!t)return null;let i=document.getSelection();for(let e=0,r=i.rangeCount;e<r;e++)if(!t.contains(i.getRangeAt(e).commonAncestorContainer))return null;let{x:r,y:s,width:n,height:a}=t.getBoundingClientRect();switch(t.getAttribute("data-main-rotation")){case"90":e=(t,e,i,o)=>({x:(e-s)/a,y:1-(t+i-r)/n,width:o/a,height:i/n});break;case"180":e=(t,e,i,o)=>({x:1-(t+i-r)/n,y:1-(e+o-s)/a,width:i/n,height:o/a});break;case"270":e=(t,e,i,o)=>({x:1-(e+o-s)/a,y:(t-r)/n,width:o/a,height:i/n});break;default:e=(t,e,i,o)=>({x:(t-r)/n,y:(e-s)/a,width:i/n,height:o/a})}let o=[];for(let t=0,r=i.rangeCount;t<r;t++){let r=i.getRangeAt(t);if(!r.collapsed)for(let{x:t,y:i,width:s,height:n}of r.getClientRects())0!==s&&0!==n&&o.push(e(t,i,s,n))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#sn||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#sn?.delete(t)}renderAnnotationElement(t){let e=this.#sn?.get(t.data.id);if(!e)return;let i=this.#ss.getRawValue(e);i&&(this.#sw!==r.AnnotationEditorType.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}}},4094:(t,e,i)=>{i.d(e,{PDFFetchStream:()=>l}),i(4114),i(6573),i(8100),i(7936),i(4628),i(7467),i(4732),i(9577);var r=i(4292),s=i(6490);function n(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function a(t){let e=new Headers;for(let i in t){let r=t[i];void 0!==r&&e.append(i,r)}return e}function o(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,r.warn)(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class l{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new h(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=new d(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}class h{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=a(this._stream.httpHeaders);let i=e.url;fetch(i,n(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();let e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=a||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:o(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class d{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;let r=t.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-1}`);let o=r.url;fetch(o,n(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,o);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:o(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},10:(t,e,i)=>{i.d(e,{FontFaceObject:()=>n,FontLoader:()=>s}),i(4114),i(3375),i(9225),i(3972),i(9209),i(5714),i(7561),i(6197),i(4979);var r=i(4292);class s{#s8=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#s8.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:e}
2){if(!(!t||this.#s8.has(t.loadedName))){if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:i,src:s,style:n}=t,a=new FontFace(i,s,n);this.addNativeFontFace(a);try{await a.load(),this.#s8.add(i),e?.(t)}catch{(0,r.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw(0,r.warn)(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}let e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{let i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){let t=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return r.isNodeJS?t=!0:"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)&&(t=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){let{loadingRequests:e}=this,i={done:!1,complete:function(){for((0,r.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){let t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){let t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){let i,s;function n(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function a(t,e,i,r){let s=t.substring(0,e),n=t.substring(e+i);return s+r+n}let o=this._document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d"),h=0,d=`lt${Date.now()}${this.loadTestFontId++}`,c=this._loadTestFont;c=a(c,976,d.length,d);let u=n(c,16);for(i=0,s=d.length-3;i<s;i+=4)u=u-1482184792+n(d,i)|0;i<d.length&&(u=u-1482184792+n(d+"XXX",i)|0),c=a(c,16,4,(0,r.string32)(u));let p=`url(data:font/opentype;base64,${btoa(c)});`,g=`@font-face {font-family:"${d}";src:${p}}`;this.insertRule(g);let f=this._document.createElement("div");for(let e of(f.style.visibility="hidden",f.style.width=f.style.height="10px",f.style.position="absolute",f.style.top=f.style.left="0px",[t.loadedName,d])){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,f.append(t)}this._document.body.append(f),function t(e,i){if(++h>30){(0,r.warn)("Load test font never loaded."),i();return}if(l.font="30px "+e,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){i();return}setTimeout(t.bind(null,e,i))}(d,()=>{f.remove(),e.complete()})}}class n{constructor(t,{disableFontFace:e=!1,ignoreErrors:i=!1,inspectFont:r=null}){for(let e in this.compiledGlyphs=Object.create(null),t)this[e]=t[e];this.disableFontFace=!0===e,this.ignoreErrors=!0===i,this._inspectFont=r}createNativeFontFace(){let t;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),t}createFontFaceRule(){let t;if(!this.data||this.disableFontFace)return null;let e=(0,r.bytesToString)(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${i}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${i}}`;return this._inspectFont?.(this,i),t}getPathGenerator(t,e){let i;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;(0,r.warn)(`getPathGenerator - ignoring character: "${t}".`)}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};let s=[];for(let t=0,e=i.length;t<e;)switch(i[t++]){case r.FontRenderOps.BEZIER_CURVE_TO:{let[e,r,n,a,o,l]=i.slice(t,t+6);s.push(t=>t.bezierCurveTo(e,r,n,a,o,l)),t+=6}break;case r.FontRenderOps.MOVE_TO:{let[e,r]=i.slice(t,t+2);s.push(t=>t.moveTo(e,r)),t+=2}break;case r.FontRenderOps.LINE_TO:{let[e,r]=i.slice(t,t+2);s.push(t=>t.lineTo(e,r)),t+=2}break;case r.FontRenderOps.QUADRATIC_CURVE_TO:{let[e,r,n,a]=i.slice(t,t+4);s.push(t=>t.quadraticCurveTo(e,r,n,a)),t+=4}break;case r.FontRenderOps.RESTORE:s.push(t=>
2t.restore());break;case r.FontRenderOps.SAVE:s.push(t=>t.save());break;case r.FontRenderOps.SCALE:(0,r.assert)(2===s.length,"Scale command is only valid at the third position.");break;case r.FontRenderOps.TRANSFORM:{let[e,r,n,a,o,l]=i.slice(t,t+6);s.push(t=>t.transform(e,r,n,a,o,l)),t+=6}break;case r.FontRenderOps.TRANSLATE:{let[e,r]=i.slice(t,t+2);s.push(t=>t.translate(e,r)),t+=2}}return this.compiledGlyphs[e]=function(t,e){s[0](t),s[1](t),t.scale(e,-e);for(let e=2,i=s.length;e<i;e++)s[e](t)}}}},6062:(t,e,i)=>{i.d(e,{Metadata:()=>s});var r=i(4292);class s{#nt;#ne;constructor({parsedData:t,rawData:e}){this.#nt=t,this.#ne=e}getRaw(){return this.#ne}get(t){return this.#nt.get(t)??null}getAll(){return(0,r.objectFromMap)(this.#nt)}has(t){return this.#nt.has(t)}}},7457:(t,e,i)=>{i.d(e,{PDFNetworkStream:()=>a}),i(4114),i(4628);var r=i(4292),s=i(6490);class n{constructor(t,e={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){let r={begin:t,end:e};for(let t in i)r[t]=i[t];return this.request(r)}requestFull(t){return this.request(t)}request(t){let e=new XMLHttpRequest,i=this.currXhrId++,r=this.pendingRequests[i]={xhr:e};for(let t in e.open("GET",this.url),e.withCredentials=this.withCredentials,this.httpHeaders){let i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.expectedStatus=206):r.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){let i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){let i=this.pendingRequests[t];if(!i)return;let s=i.xhr;if(s.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==s.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===s.status&&this.isHttp){i.onError?.(s.status);return}let n=s.status||200;if(!(200===n&&206===i.expectedStatus)&&n!==i.expectedStatus){i.onError?.(s.status);return}let a=function(t){let e=t.response;return"string"!=typeof e?e:(0,r.stringToBytes)(e).buffer}(s);if(206===n){let t=s.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:a})}else a?i.onDone({begin:0,chunk:a}):i.onError?.(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){let e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class a{constructor(t){this._source=t,this._manager=new n(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new o(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let i=new l(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}class o{constructor(t,e){this._manager=t;let i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:r,suggestedLength:n}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=n||this._contentLength,this._filename=(0,s.extractFilenameFromHeader)(i),this._isRangeSupported&&this._manager.abortRequest
2(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){for(let e of(this._storedError=(0,s.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let e of(this._done=!0,this._headersReceivedCapability.reject(t),this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class l{constructor(t,e,i){this._manager=t;let r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){let e=t.chunk;for(let t of(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){for(let e of(this._storedError=(0,s.createResponseStatusError)(t,this._url),this._requests))e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}}
2,6490:(t,e,i)=>{i.d(e,{createResponseStatusError:()=>o,extractFilenameFromHeader:()=>a,validateRangeRequestCapabilities:()=>n,validateResponseStatus:()=>l});var r=i(4292);i(4114),i(4979);var s=i(5419);function n({getResponseHeader:t,isHttp:e,rangeChunkSize:i,disableRange:r}){let s={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t("Content-Length"),10);if(!Number.isInteger(n)||(s.suggestedLength=n,n<=2*i||r||!e||"bytes"!==t("Accept-Ranges")))return s;let a=t("Content-Encoding")||"identity";return"identity"!==a||(s.allowRangeRequests=!0),s}function a(t){let e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=s("filename\\*","i").exec(t);if(i){i=i[1];let t=o(i);return t=unescape(t),t=l(t),t=h(t),a(t)}if(i=function(t){let e;let i=[],r=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=r.exec(t));){let[,t,r,s]=e;if((t=parseInt(t,10))in i){if(0===t)break;continue}i[t]=[r,s]}let n=[];for(let t=0;t<i.length&&(t in i);++t){let[e,r]=i[t];r=o(r),e&&(r=unescape(r),0===t&&(r=l(r))),n.push(r)}return n.join("")}(t)){let t=h(i);return a(t)}if(i=s("filename","i").exec(t)){i=i[1];let t=o(i);return t=h(t),a(t)}function s(t,e){return RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function n(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{let s=new TextDecoder(t,{fatal:!0}),n=(0,r.stringToBytes)(i);i=s.decode(n),e=!1}catch{}}return i}function a(t){return e&&/[\x80-\xff]/.test(t)&&(t=n("utf-8",t),e&&(t=n("iso-8859-1",t))),t}function o(t){if(t.startsWith('"')){let e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){let i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function l(t){let e=t.indexOf("'");if(-1===e)return t;let i=t.slice(0,e),r=t.slice(e+1).replace(/^[^']*'/,"");return n(i,r)}function h(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,r){if("q"===i||"Q"===i)return r=(r=r.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}),n(e,r);try{r=atob(r)}catch{}return n(e,r)})}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,s.isPdfFile)(t))return t}return null}function o(t,e){return 404===t||0===t&&e.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+e+'".'):new r.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function l(t){return 200===t||206===t}},4786:(t,e,i)=>{i.a(t,async(t,r)=>{try{let t,o,l,h;i.d(e,{PDFNodeStream:()=>c}),i(4114),i(6573),i(8100),i(7936),i(4628),i(7467),i(4732),i(9577);var s=i(4292),n=i(6490);s.isNodeJS&&(t=await import("fs"),o=await import("http"),l=await import("https"),h=await import("url"));let d=/^file:\/\/\/[a-zA-Z]:\//;class c{constructor(t){this.source=t,this.url=function(t){let e=h.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?h.parse(`file:///${t}`):(e.host||(e.protocol="file:"),e)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new m(this):new g(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=this.isFsUrl?new b(this,t,e):new f(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}class u{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class p{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function a(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class g extends u{constructor(t){super(t);let e=e=>{if(404===e.statusCode){let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t,this._headersCapability.reject(t);return}this._headersCapability.resolve(),this._setReadableStream(e);let i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:r,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i)};this._request=null,"http:"===this._url.protocol?this._request=o.request(a(this._url,t.httpHeaders),e):this._request=l.request(a(this._url,t.httpHeaders),e),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class f extends p{constructor(t,e,i){for(let e in super(t),this._httpHeaders={},t.httpHeaders){let i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;let r=t=>{if(404===t.statusCode){let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;return}this._setReadableStream(t)};this._request=null,"http:"===this._url.protocol?this._request=o.request(a(this._url,this._httpHeaders),r):this._request=l.request(a(this._url,this._httpHeaders),r),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class m extends u{constructor(e){super(e);let i=decodeURIComponent(this._url.path);d.test(this._url.href)&&(i=i.replace(/^\//,"")),t.promises.lstat(i).then(e=>{this._contentLength=e.size,this._setReadableStream(t.createReadStream(i)),this._headersCapability.resolve()},t=>{"ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${i}".`)),this._storedError=t,this._headersCapability.reject(t)})}}class b extends p{constructor(e,i,r){super(e);let s=decodeURIComponent(this._url.path);d.test(this._url.href)&&(s=s.replace(/^\//,"")),this._setReadableStream(t.createReadStream(s,{start:i,end:r-1}))}}r()}catch(t){r(t)}},1)},1573:(t,e,i)=>{i.a(t,async(t,r)=>{try{let t,a,o;i.d(e,{NodeCMapReaderFactory:()=>c,NodeCanvasFactory:()=>d,NodeFilterFactory:()=>h,NodeStandardFontDataFactory:()=>u}
2),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577);var s=i(2583),n=i(4292);if(n.isNodeJS){t=await import("fs");try{a=await import("canvas")}catch{}try{o=await import("path2d")}catch{}}!function(){if(globalThis.DOMMatrix||!n.isNodeJS)return;let t=a?.DOMMatrix;t?globalThis.DOMMatrix=t:(0,n.warn)("Cannot polyfill `DOMMatrix`, rendering may be broken.")}(),function(){if(globalThis.Path2D||!n.isNodeJS)return;let t=a?.CanvasRenderingContext2D,e=o?.applyPath2DToCanvasRenderingContext,i=o?.Path2D;t&&e&&i?(e(t),globalThis.Path2D=i):(0,n.warn)("Cannot polyfill `Path2D`, rendering may be broken.")}();let l=function(e){return t.promises.readFile(e).then(t=>new Uint8Array(t))};class h extends s.BaseFilterFactory{}class d extends s.BaseCanvasFactory{_createCanvas(t,e){return a.createCanvas(t,e)}}class c extends s.BaseCMapReaderFactory{_fetchData(t,e){return l(t).then(t=>({cMapData:t,compressionType:e}))}}class u extends s.BaseStandardFontDataFactory{_fetchData(t){return l(t)}}r()}catch(t){r(t)}},1)},5626:(t,e,i)=>{i.d(e,{OptionalContentConfig:()=>o});var r=i(4292),s=i(7651);let n=Symbol("INTERNAL");class a{#ni=!1;#nr=!1;#ns=!1;#nn=!0;constructor(t,{name:e,intent:i,usage:s}){this.#ni=!!(t&r.RenderingIntentFlag.DISPLAY),this.#nr=!!(t&r.RenderingIntentFlag.PRINT),this.name=e,this.intent=i,this.usage=s}get visible(){if(this.#ns)return this.#nn;if(!this.#nn)return!1;let{print:t,view:e}=this.usage;return this.#ni?e?.viewState!=="OFF":!this.#nr||t?.printState!=="OFF"}_setVisible(t,e,i=!1){t!==n&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#ns=i,this.#nn=e}}class o{#na=null;#no=new Map;#nl=null;#nh=null;constructor(t,e=r.RenderingIntentFlag.DISPLAY){if(this.renderingIntent=e,this.name=null,this.creator=null,null===t)return;for(let i of(this.name=t.name,this.creator=t.creator,this.#nh=t.order,t.groups))this.#no.set(i.id,new a(e,i));if("OFF"===t.baseState)for(let t of this.#no.values())t._setVisible(n,!1);for(let e of t.on)this.#no.get(e)._setVisible(n,!0);for(let e of t.off)this.#no.get(e)._setVisible(n,!1);this.#nl=this.getHash()}#nd(t){let e=t.length;if(e<2)return!0;let i=t[0];for(let s=1;s<e;s++){let e;let n=t[s];if(Array.isArray(n))e=this.#nd(n);else{if(!this.#no.has(n))return(0,r.warn)(`Optional content group not found: ${n}`),!0;e=this.#no.get(n).visible}switch(i){case"And":if(!e)return!1;break;case"Or":if(e)return!0;break;case"Not":return!e;default:return!0}}return"And"===i}isVisible(t){if(0===this.#no.size)return!0;if(!t)return(0,r.info)("Optional content group not defined."),!0;if("OCG"===t.type)return this.#no.has(t.id)?this.#no.get(t.id).visible:((0,r.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#nd(t.expression);if(t.policy&&"AnyOn"!==t.policy){if("AllOn"===t.policy){for(let e of t.ids){if(!this.#no.has(e)){(0,r.warn)(`Optional content group not found: ${e}`);break}if(!this.#no.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(let e of t.ids){if(!this.#no.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#no.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(let e of t.ids){if(!this.#no.has(e)){(0,r.warn)(`Optional content group not found: ${e}`);break}if(this.#no.get(e).visible)return!1}return!0}}else{for(let e of t.ids){if(!this.#no.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#no.get(e).visible)return!0}return!1}return(0,r.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,r.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0){let i=this.#no.get(t);if(!i){(0,r.warn)(`Optional content group not found: ${t}`);return}i._setVisible(n,!!e,!0),this.#na=null}setOCGState({state:t,preserveRB:e}){let i;for(let e of t){switch(e){case"ON":case"OFF":case"Toggle":i=e;continue}let t=this.#no.get(e);if(t)switch(i){case"ON":t._setVisible(n,!0);break;case"OFF":t._setVisible(n,!1);break;case"Toggle":t._setVisible(n,!t.visible)}}this.#na=null}get hasInitialVisibility(){return null===this.#nl||this.getHash()===this.#nl}getOrder(){return this.#no.size?this.#nh?this.#nh.slice():[...this.#no.keys()]:null}getGroups(){return this.#no.size>0?(0,r.objectFromMap)(this.#no):null}getGroup(t){return this.#no.get(t)||null}getHash(){if(null!==this.#na)return this.#na;let t=new s.MurmurHash3_64;
2for(let[e,i]of this.#no)t.update(`${e}:${i.visible}`);return this.#na=t.hexdigest()}}},6814:(t,e,i)=>{i.d(e,{cleanupTextLayer:()=>l,renderTextLayer:()=>c,updateTextLayer:()=>u}),i(4114),i(4628);var r=i(4292),s=i(5419);let n=new Map,a=null;function o(){if(!a){let t=document.createElement("canvas");t.className="hiddenCanvasElement",document.body.append(t),a=t.getContext("2d",{alpha:!1})}return a}function l(){a?.canvas.remove(),a=null}function h(t){let{div:e,scale:i,properties:r,ctx:s,prevFontSize:n,prevFontFamily:a}=t,{style:o}=e,l="";if(0!==r.canvasWidth&&r.hasText){let{fontFamily:h}=o,{canvasWidth:d,fontSize:c}=r;(n!==c||a!==h)&&(s.font=`${c*i}px ${h}`,t.prevFontSize=c,t.prevFontFamily=h);let{width:u}=s.measureText(e.textContent);u>0&&(l=`scaleX(${d*i/u})`)}0!==r.angle&&(l=`rotate(${r.angle}deg) ${l}`),l.length>0&&(o.transform=l)}class d{constructor({textContentSource:t,container:e,viewport:i,textDivs:r,textDivProperties:n,textContentItemsStr:a}){this._textContentSource=t,this._isReadableStream=t instanceof ReadableStream,this._container=this._rootContainer=e,this._textDivs=r||[],this._textContentItemsStr=a||[],this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=n||new WeakMap,this._canceled=!1,this._capability=Promise.withResolvers(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:o()};let{pageWidth:l,pageHeight:h,pageX:d,pageY:c}=i.rawDims;this._transform=[1,0,0,-1,-d,c+h],this._pageWidth=l,this._pageHeight=h,(0,s.setLayerDimensions)(e,i),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(let i of t){if(void 0===i.str){if("beginMarkedContentProps"===i.type||"beginMarkedContent"===i.type){let t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==i.id&&this._container.setAttribute("id",`${i.id}`),t.append(this._container)}else"endMarkedContent"===i.type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(i.str),function(t,e,i){let s,a;let l=document.createElement("span"),h={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(l);let d=r.Util.transform(t._transform,e.transform),c=Math.atan2(d[1],d[0]),u=i[e.fontName];u.vertical&&(c+=Math.PI/2);let p=t._fontInspectorEnabled&&u.fontSubstitution||u.fontFamily,g=Math.hypot(d[2],d[3]),f=g*function(t){let e=n.get(t);if(e)return e;let i=o(),r=i.font;i.canvas.width=i.canvas.height=30,i.font=`30px ${t}`;let s=i.measureText(""),a=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);if(a){let e=a/(a+l);return n.set(t,e),i.canvas.width=i.canvas.height=0,i.font=r,e}i.strokeStyle="red",i.clearRect(0,0,30,30),i.strokeText("g",0,0);let h=i.getImageData(0,0,30,30).data;l=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){l=Math.ceil(t/4/30);break}i.clearRect(0,0,30,30),i.strokeText("A",0,30),h=i.getImageData(0,0,30,30).data,a=0;for(let t=0,e=h.length;t<e;t+=4)if(h[t]>0){a=30-Math.floor(t/4/30);break}if(i.canvas.width=i.canvas.height=0,i.font=r,a){let e=a/(a+l);return n.set(t,e),e}return n.set(t,.8),.8}(p);0===c?(s=d[4],a=d[5]-f):(s=d[4]+f*Math.sin(c),a=d[5]-f*Math.cos(c));let m="calc(var(--scale-factor)*",b=l.style;t._container===t._rootContainer?(b.left=`${(100*s/t._pageWidth).toFixed(2)}%`,b.top=`${(100*a/t._pageHeight).toFixed(2)}%`):(b.left=`${m}${s.toFixed(2)}px)`,b.top=`${m}${a.toFixed(2)}px)`),b.fontSize=`${m}${g.toFixed(2)}px)`,b.fontFamily=p,h.fontSize=g,l.setAttribute("role","presentation"),l.textContent=e.str,l.dir=e.dir,t._fontInspectorEnabled&&(l.dataset.fontName=u.fontSubstitutionLoadedName||e.fontName),0!==c&&(h.angle=180/Math.PI*c);let v=!1;if(e.str.length>1)v=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){let t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(v=!0)}v&&(h.canvasWidth=u.vertical?e.height:e.width),t._textDivProperties.set(l,h),t._isReadableStream&&t._layoutText(l)}(this,i,e)}}_layoutText(t){let e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,h(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){let{promise:t,resolve:e,reject:i}=Promise.withResolvers(),r=Object.create(null);if(this._isReadableStream){let t=()=>{this._reader.read().then(({value:i,done:s})=>{if(s){e();return}Object.assign(r,i.styles),this._processItems(i.items,r),t()},i)};this._reader=this._textContentSource.getReader(),t()}else if(this._textContentSource){let{items:t,styles:i}=this._textContentSource;this._processItems(t,i),e()}else throw Error('No "textContentSource" parameter specified.');t.then(()=>{r=null,function(t){if(t._canceled)return;let e=t._textDivs,i=t._capability;if(e.length>1e5){i.resolve();return}if(!t._isReadableStream)for(let i of e)t._layoutText(i);i.resolve()}(this)},this._capability.reject)}}function c(t){let e=new d(t);return e._render(),e}function u({container:t,viewport:e,textDivs:i,textDivProperties:r,mustRotate:n=!0,mustRescale:a=!0}){if(n&&(0,s.setLayerDimensions)(t,{rotation:e.rotation}
2),a){let t=o(),s=e.scale*(globalThis.devicePixelRatio||1),n={prevFontSize:null,prevFontFamily:null,div:null,scale:s,properties:null,ctx:t};for(let t of i)n.properties=r.get(t),n.div=t,h(n)}}},585:(t,e,i)=>{i.d(e,{PDFDataTransportStream:()=>n}),i(4114),i(6573),i(8100),i(7936),i(4628),i(7467),i(4732),i(9577),i(8992),i(7550);var r=i(4292),s=i(5419);class n{constructor(t,{disableRange:e=!1,disableStream:i=!1}){(0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:s,initialData:n,progressiveDone:a,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,n?.length>0){let t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),t.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),t.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){let i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{let e=this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(i),!0)});(0,r.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new a(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=new o(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeReaders.slice(0)))e.cancel(t);this._pdfDataRangeTransport.abort()}}class a{constructor(t,e,i=!1,r=null){for(let n of(this._stream=t,this._done=i||!1,this._filename=(0,s.isPdfFile)(r)?r:null,this._queuedChunks=e||[],this._loaded=0,this._queuedChunks))this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class o{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{for(let e of(this._requests.shift().resolve({value:t,done:!1}),this._requests))e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},6164:(t,e,i)=>{i.d(e,{GlobalWorkerOptions:()=>r});class r{static #nc=null;static #nu="";static get workerPort(){return this.#nc}static set workerPort(t){if(!("undefined"!=typeof Worker&&t instanceof Worker)&&null!==t)throw Error("Invalid `workerPort` type.");this.#nc=t}static get workerSrc(){return this.#nu}static set workerSrc(t){if("string"!=typeof t)throw Error("Invalid `workerSrc` type.");this.#nu=t}}},8284:(t,e,i)=>{i.d(e,{XfaLayer:()=>s}),i(4114);var r=i(2050);class s{static setupStorage(t,e,i,r,s){let n=r.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==n.value&&(t.textContent=n.value),"print"===s)break;t.addEventListener("input",t=>{r.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(n.value===i.attributes.xfaOn?t.setAttribute("checked",!0):n.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{r.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==n.value&&t.setAttribute("value",n.value),"print"===s)break;t.addEventListener("input",t=>{r.setValue(e,{value:t.target.value})})}break;case"select":if(null!==n.value)for(let e of(t.setAttribute("value",n.value),i.children))e.attributes.value===n.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected;t.addEventListener("input",t=>{let i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;r.setValue(e,{value:s})})}}static setAttributes({html:t,element:e,storage:i=null,intent:r,linkService:s}){let{attributes:n}=e,a=t instanceof HTMLAnchorElement;for(let[e,i]of("radio"===n.type&&(n.name=`${n.name}-${r}`),Object.entries(n)))if(null!=i)switch(e){case"class":i.length&&t.setAttribute(e,i.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",i);break;case"style":Object.assign(t.style,i);break;case"textContent":t.textContent=i;break;default:a&&("href"===e||"newWindow"===e)||t.setAttribute(e,i)}a&&s.addLinkAttributes(t,n.href,n.newWindow),i&&n.dataId&&this.setupStorage(t,n.dataId,e,i)}static render(t){let e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,n=t.
2intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:n,linkService:i});let o="richText"!==n,l=t.div;if(l.append(a),t.viewport){let e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}o&&l.setAttribute("class","xfaLayer xfaFont");let h=[];if(0===s.children.length){if(s.value){let t=document.createTextNode(s.value);a.append(t),o&&r.XfaText.shouldBuildText(s.name)&&h.push(t)}return{textDivs:h}}let d=[[s,-1,a]];for(;d.length>0;){let[t,s,a]=d.at(-1);if(s+1===t.children.length){d.pop();continue}let l=t.children[++d.at(-1)[1]];if(null===l)continue;let{name:c}=l;if("#text"===c){let t=document.createTextNode(l.value);h.push(t),a.append(t);continue}let u=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,c):document.createElement(c);if(a.append(u),l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:n,linkService:i}),l.children?.length>0)d.push([l,-1,u]);else if(l.value){let t=document.createTextNode(l.value);o&&r.XfaText.shouldBuildText(c)&&h.push(t),u.append(t)}}for(let t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},2050:(t,e,i)=>{i.d(e,{XfaText:()=>r}),i(4114);class r{static textContent(t){let e=[],i={items:e,styles:Object.create(null)};return!function t(i){if(!i)return;let s=null,n=i.name;if("#text"===n)s=i.value;else{if(!r.shouldBuildText(n))return;i?.attributes?.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(let e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}},1228:(t,e,i)=>{i.a(t,async(t,r)=>{try{i.d(e,{AbortException:()=>s.AbortException,AnnotationEditorLayer:()=>l.AnnotationEditorLayer,AnnotationEditorParamsType:()=>s.AnnotationEditorParamsType,AnnotationEditorType:()=>s.AnnotationEditorType,AnnotationEditorUIManager:()=>h.AnnotationEditorUIManager,AnnotationLayer:()=>d.AnnotationLayer,AnnotationMode:()=>s.AnnotationMode,CMapCompressionType:()=>s.CMapCompressionType,ColorPicker:()=>c.ColorPicker,DOMSVGFactory:()=>a.DOMSVGFactory,DrawLayer:()=>u.DrawLayer,FeatureTest:()=>s.FeatureTest,GlobalWorkerOptions:()=>p.GlobalWorkerOptions,ImageKind:()=>s.ImageKind,InvalidPDFException:()=>s.InvalidPDFException,MissingPDFException:()=>s.MissingPDFException,OPS:()=>s.OPS,Outliner:()=>g.Outliner,PDFDataRangeTransport:()=>n.PDFDataRangeTransport,PDFDateString:()=>a.PDFDateString,PDFWorker:()=>n.PDFWorker,PasswordResponses:()=>s.PasswordResponses,PermissionFlag:()=>s.PermissionFlag,PixelsPerInch:()=>a.PixelsPerInch,RenderingCancelledException:()=>a.RenderingCancelledException,UnexpectedResponseException:()=>s.UnexpectedResponseException,Util:()=>s.Util,VerbosityLevel:()=>s.VerbosityLevel,XfaLayer:()=>f.XfaLayer,build:()=>n.build,createValidAbsoluteUrl:()=>s.createValidAbsoluteUrl,fetchData:()=>a.fetchData,getDocument:()=>n.getDocument,getFilenameFromUrl:()=>a.getFilenameFromUrl,getPdfFilenameFromUrl:()=>a.getPdfFilenameFromUrl,getXfaPageViewport:()=>a.getXfaPageViewport,isDataScheme:()=>a.isDataScheme,isPdfFile:()=>a.isPdfFile,noContextMenu:()=>a.noContextMenu,normalizeUnicode:()=>s.normalizeUnicode,renderTextLayer:()=>o.renderTextLayer,setLayerDimensions:()=>a.setLayerDimensions,shadow:()=>s.shadow,updateTextLayer:()=>o.updateTextLayer,version:()=>n.version});var s=i(4292),n=i(3831),a=i(5419),o=i(6814),l=i(9731),h=i(7830),d=i(6976),c=i(2259),u=i(4047),p=i(6164),g=i(4061),f=i(8284),m=t([n]);n=(m.then?(await m)():m)[0],r()}catch(t){r(t)}})},5178:(t,e,i)=>{i.d(e,{MessageHandler:()=>o}),i(4628);var r=i(4292);let s={DATA:1,ERROR:2},n={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function a(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new r.AbortException(t.message);case"MissingPDFException":return new r.MissingPDFException(t.message);case"PasswordException":return new r.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new r.UnknownErrorException(t.message,t.details);default:return new r.UnknownErrorException(t.message,t.toString())}}class o{constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{let e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this.#np(e);return}if(e.callback){let t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===s.DATA)i.resolve(e.data);else if(e.callback===s.ERROR)i.reject(a(e.reason));else throw Error("Unexpected callback case");return}let r=this.actionHandler[e.action];if(!r)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let t=this.sourceName,n=e.sourceName;new Promise(function(t){t(r(e.data))}).then(function(r){i.postMessage({sourceName:t,targetName:n,callback:s.DATA,callbackId:e.callbackId,data:r})},function(r){i.postMessage({sourceName:t,targetName:n,callback:s.ERROR,callbackId:e.callbackId,reason:a(r)})});return}if(e.streamId){this.#ng(e);return}r(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){let i=this.actionHandler;if(i[t])throw Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}
2sendWithPromise(t,e,i){let r=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,s){let o=this.streamId++,l=this.sourceName,h=this.targetName,d=this.comObj;return new ReadableStream({start:i=>{let r=Promise.withResolvers();return this.streamControllers[o]={controller:i,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:l,targetName:h,action:t,streamId:o,data:e,desiredSize:i.desiredSize},s),r.promise},pull:t=>{let e=Promise.withResolvers();return this.streamControllers[o].pullCall=e,d.postMessage({sourceName:l,targetName:h,stream:n.PULL,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,r.assert)(t instanceof Error,"cancel must have a valid reason");let e=Promise.withResolvers();return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,d.postMessage({sourceName:l,targetName:h,stream:n.CANCEL,streamId:o,reason:a(t)}),e.promise}},i)}#ng(t){let e=t.streamId,i=this.sourceName,s=t.sourceName,o=this.comObj,l=this,h=this.actionHandler[t.action],d={enqueue(t,r=1,a){if(this.isCancelled)return;let l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:s,stream:n.ENQUEUE,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:s,stream:n.CLOSE,streamId:e}),delete l.streamSinks[e])},error(t){(0,r.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:s,stream:n.ERROR,streamId:e,reason:a(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[e]=d,new Promise(function(e){e(h(t.data,d))}).then(function(){o.postMessage({sourceName:i,targetName:s,stream:n.START_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:s,stream:n.START_COMPLETE,streamId:e,reason:a(t)})})}#np(t){let e=t.streamId,i=this.sourceName,s=t.sourceName,o=this.comObj,l=this.streamControllers[e],h=this.streamSinks[e];switch(t.stream){case n.START_COMPLETE:t.success?l.startCall.resolve():l.startCall.reject(a(t.reason));break;case n.PULL_COMPLETE:t.success?l.pullCall.resolve():l.pullCall.reject(a(t.reason));break;case n.PULL:if(!h){o.postMessage({sourceName:i,targetName:s,stream:n.PULL_COMPLETE,streamId:e,success:!0});break}h.desiredSize<=0&&t.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=t.desiredSize,new Promise(function(t){t(h.onPull?.())}).then(function(){o.postMessage({sourceName:i,targetName:s,stream:n.PULL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:s,stream:n.PULL_COMPLETE,streamId:e,reason:a(t)})});break;case n.ENQUEUE:if((0,r.assert)(l,"enqueue should have stream controller"),l.isClosed)break;l.controller.enqueue(t.chunk);break;case n.CLOSE:if((0,r.assert)(l,"close should have stream controller"),l.isClosed)break;l.isClosed=!0,l.controller.close(),this.#nf(l,e);break;case n.ERROR:(0,r.assert)(l,"error should have stream controller"),l.controller.error(a(t.reason)),this.#nf(l,e);break;case n.CANCEL_COMPLETE:t.success?l.cancelCall.resolve():l.cancelCall.reject(a(t.reason)),this.#nf(l,e);break;case n.CANCEL:if(!h)break;new Promise(function(e){e(h.onCancel?.(a(t.reason)))}).then(function(){o.postMessage({sourceName:i,targetName:s,stream:n.CANCEL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:s,stream:n.CANCEL_COMPLETE,streamId:e,reason:a(t)})}),h.sinkCapability.reject(a(t.reason)),h.isCancelled=!0,delete this.streamSinks[e];break;default:throw Error("Unexpected stream case")}}async #nf(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},7651:(t,e,i)=>{i.d(e,{MurmurHash3_64:()=>r}
2),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577);class r{constructor(t){this.h1=t?4294967295&t:3285377520,this.h2=t?4294967295&t:3285377520}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let r=0,s=t.length;r<s;r++){let s=t.charCodeAt(r);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else if(ArrayBuffer.isView(t))i=(e=t.slice()).byteLength;else throw Error("Invalid data format, must be a string or TypedArray.");let r=i>>2,s=i-4*r,n=new Uint32Array(e.buffer,0,r),a=0,o=0,l=this.h1,h=this.h2;for(let t=0;t<r;t++)1&t?(a=461845907*(a=(a=3432918353*(a=n[t])&4294901760|11601*a&65535)<<15|a>>>17)&4294901760|13715*a&65535,l^=a,l=l<<13|l>>>19,l=5*l+3864292196):(o=461845907*(o=(o=3432918353*(o=n[t])&4294901760|11601*o&65535)<<15|o>>>17)&4294901760|13715*o&65535,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(a=0,s){case 3:a^=e[4*r+2]<<16;case 2:a^=e[4*r+1]<<8;case 1:a^=e[4*r],a=461845907*(a=(a=3432918353*a&4294901760|11601*a&65535)<<15|a>>>17)&4294901760|13715*a&65535,1&r?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&4294901760|36045*t&65535,e=4283543511*e&4294901760|((e<<16|t>>>16)*2950163797&4294901760)>>>16,t^=e>>>1,t=444984403*t&4294901760|60499*t&65535,e=3301882366*e&4294901760|((e<<16|t>>>16)*3120437893&4294901760)>>>16,((t^=e>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},4292:(t,e,i)=>{i.d(e,{AbortException:()=>U,AnnotationBorderStyleType:()=>v,AnnotationEditorParamsType:()=>p,AnnotationEditorPrefix:()=>c,AnnotationEditorType:()=>u,AnnotationMode:()=>h,AnnotationPrefix:()=>J,AnnotationType:()=>b,BaseException:()=>k,CMapCompressionType:()=>y,FONT_IDENTITY_MATRIX:()=>n,FeatureTest:()=>V,FontRenderOps:()=>Q,FormatError:()=>B,IDENTITY_MATRIX:()=>s,ImageKind:()=>m,InvalidPDFException:()=>F,LINE_FACTOR:()=>o,MAX_IMAGE_SIZE_TO_CACHE:()=>a,MissingPDFException:()=>O,OPS:()=>_,PasswordException:()=>L,PasswordResponses:()=>E,PermissionFlag:()=>g,RenderingIntentFlag:()=>l,TextRenderingMode:()=>f,UnexpectedResponseException:()=>N,UnknownErrorException:()=>D,Util:()=>W,VerbosityLevel:()=>A,assert:()=>R,bytesToString:()=>H,createValidAbsoluteUrl:()=>P,getUuid:()=>Y,getVerbosityLevel:()=>T,info:()=>S,isNodeJS:()=>r,normalizeUnicode:()=>X,objectFromMap:()=>$,setVerbosityLevel:()=>x,shadow:()=>I,string32:()=>j,stringToBytes:()=>z,unreachable:()=>M,warn:()=>C}),i(4114),i(6573),i(8100),i(7936),i(7467),i(4732),i(9577),i(4603),i(7566),i(8721);let r="object"==typeof d&&d+""=="[object process]"&&!d.versions.nw&&!(d.versions.electron&&d.type&&"browser"!==d.type),s=[1,0,0,1,0,0],n=[.001,0,0,.001,0,0],a=1e7,o=1.35,l={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},h={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},c="pdfjs_internal_editor_",u={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},p={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_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},g={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},f={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},m={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},b={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},v={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},A={ERRORS:0,WARNINGS:1,INFOS:5},y={NONE:0,BINARY:1},_={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},E={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},w=A.WARNINGS;function x(t){Number.isInteger(t)&&(w=t)}function T(){return w}function S(t){w>=A.INFOS&&console.log(`Info: ${t}`)}function C(t){w>=A.WARNINGS&&console.log(`Warning: ${t}`)}function M(t){throw Error(t)}function R(t,e){t||M(e)}function P(t,e=null,i=null){if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){let e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{var r;r=t,t=decodeURIComponent(escape(r))}catch{}}let s=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch{}return null}function I(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}let k=function(){function t(e,i){this.constructor===t&&M("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=Error(),t.constructor=t,t}();class L extends k{constructor(t,e){super(t,"PasswordException"),this.code=e}}class D extends k{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class F extends k{constructor(t){super(t,"InvalidPDFException")}}class O extends k{constructor(t){super(t,"MissingPDFException")}}class N extends k{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class B extends k{constructor(t){super(t,"FormatError")}}class U extends k{constructor(t){super(t,"AbortException")}}function H(t){("object"!=typeof t||t?.length===void 0)&&M("Invalid argument for bytesToString");let e=t.length;if(e<8192)return String.fromCharCode.apply(null,t);let i=[];for(let r=0;r<e;r+=8192){let s=Math.min(r+8192,e),n=t.subarray(r,s);i.push(String.fromCharCode.apply(null,n))}return i.join("")}function z(t){"string"!=typeof t&&M("Invalid argument for stringToBytes");let e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=255&t.charCodeAt(r);return i}function j(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function $(t){let e=Object.create(null);for(let[i,r]of t)e[i]=r;return e}class V{static get isLittleEndian(){return I(this,"isLittleEndian",function(){let t=new Uint8Array(4);t[0]=1;let e=new Uint32Array(t.buffer,0,1);return 1===e[0]}())}static get isEvalSupported(){return I(this,"isEvalSupported",function(){try{return Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return I(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?I(this,"platform",{isMac:navigator.platform.includes("Mac")}):I(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){return I(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}let G=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));class W{static makeHexColor(t,e,i){return`#${G[t]}${G[e]}${G[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){let i=t[0]*e[0]+t[1]*e[2]+e[4],r=t[0]*e[1]+t[1]*e[3]+e[5];return[i,r]}static applyInverseTransform(t,e){let i=e[0]*e[3]-e[1]*e[2],r=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,s=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i;return[r,s]}static getAxialAlignedBoundingBox(t,e){let i=this.applyTransform(t,e),r=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),n=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],r[0],s[0],n[0]),Math.min(i[1],r[1],s[1],n[1]),Math.max(i[0],r[0],s[0],n[0]),Math.max(i[1],r[1],s[1],n[1])]}static inverseTransform(t){let e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){let e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],n=t[2]*e[1]+t[3]*e[3],a=(i+n)/2,o=Math.sqrt((i+n)**2-4*(i*n-s*r))/2;return[Math.sqrt(a+o||1),Math.sqrt(a-o||1)]}static normalizeRect(t){let e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){let i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r
2=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;let s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),n=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>n?null:[i,s,r,n]}static #nm(t,e,i,r,s,n,a,o,l,h){if(l<=0||l>=1)return;let d=1-l,c=l*l,u=c*l,p=d*(d*(d*t+3*l*e)+3*c*i)+u*r,g=d*(d*(d*s+3*l*n)+3*c*a)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],g),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],g)}static #nb(t,e,i,r,s,n,a,o,l,h,d,c){if(1e-12>Math.abs(l)){Math.abs(h)>=1e-12&&this.#nm(t,e,i,r,s,n,a,o,-d/h,c);return}let u=h**2-4*d*l;if(u<0)return;let p=Math.sqrt(u),g=2*l;this.#nm(t,e,i,r,s,n,a,o,(-h+p)/g,c),this.#nm(t,e,i,r,s,n,a,o,(-h-p)/g,c)}static bezierBoundingBox(t,e,i,r,s,n,a,o,l){return l?(l[0]=Math.min(l[0],t,a),l[1]=Math.min(l[1],e,o),l[2]=Math.max(l[2],t,a),l[3]=Math.max(l[3],e,o)):l=[Math.min(t,a),Math.min(e,o),Math.max(t,a),Math.max(e,o)],this.#nb(t,i,s,a,e,r,n,o,3*(-t+3*(i-s)+a),6*(t-2*i+s),3*(i-t),l),this.#nb(t,i,s,a,e,r,n,o,3*(-e+3*(r-n)+o),6*(e-2*r+n),3*(r-e),l),l}}let q=null,K=null;function X(t){return q||(q=/([\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,K=new Map([["ſt","ſt"]])),t.replaceAll(q,(t,e,i)=>e?e.normalize("NFKC"):K.get(i))}function Y(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();let t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return H(t)}let J="pdfjs_internal_id_",Q={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8}}},u={};function p(t){var e=u[t];if(void 0!==e)return e.exports;var i=u[t]={exports:{}};return c[t].call(i.exports,i,i.exports,p),i.exports}s="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",n="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",a="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",o=t=>{t&&t.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))},l=t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[s])return t;if(t.then){var e=[];e.d=0,t.then(t=>{i[n]=t,o(e)},t=>{i[a]=t,o(e)});var i={};return i[s]=t=>t(e),i}}var r={};return r[s]=t=>{},r[n]=t,r}),p.a=(t,e,i)=>{i&&((r=[]).d=-1);var r,h,d,c,u=new Set,p=t.exports,g=new Promise((t,e)=>{c=e,d=t});g[n]=p,g[s]=t=>(r&&t(r),u.forEach(t),g.catch(t=>{})),t.exports=g,e(t=>{h=l(t);var e,i=()=>h.map(t=>{if(t[a])throw t[a];return t[n]}),o=new Promise(t=>{(e=()=>t(i)).r=0;var n=t=>t!==r&&!u.has(t)&&(u.add(t),t&&!t.d&&(e.r++,t.push(e)));h.map(t=>t[s](n))});return e.r?o:i()},t=>(t?c(g[a]=t):d(p),o(r))),r&&r.d<0&&(r.d=0)},p.d=(t,e)=>{for(var i in e)p.o(e,i)&&!p.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},p.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var g=p(1228),f=(g=globalThis.pdfjsLib=await (globalThis.pdfjsLibPromise=g)).AbortException,m=g.AnnotationEditorLayer,b=g.AnnotationEditorParamsType,v=g.AnnotationEditorType,A=g.AnnotationEditorUIManager,y=g.AnnotationLayer,_=g.AnnotationMode,E=g.CMapCompressionType,w=g.ColorPicker,x=g.DOMSVGFactory,T=g.DrawLayer,S=g.FeatureTest,C=g.GlobalWorkerOptions,M=g.ImageKind,R=g.InvalidPDFException,P=g.MissingPDFException,I=g.OPS,k=g.Outliner,L=g.PDFDataRangeTransport,D=g.PDFDateString,F=g.PDFWorker,O=g.PasswordResponses,N=g.PermissionFlag,B=g.PixelsPerInch,U=g.RenderingCancelledException,H=g.UnexpectedResponseException,z=g.Util,j=g.VerbosityLevel,$=g.XfaLayer,V=g.build,G=g.createValidAbsoluteUrl,W=g.fetchData,q=g.getDocument,K=g.getFilenameFromUrl,X=g.getPdfFilenameFromUrl,Y=g.getXfaPageViewport,J=g.isDataScheme,Q=g.isPdfFile,Z=g.noContextMenu,tt=g.normalizeUnicode,te=g.renderTextLayer,ti=g.setLayerDimensions,tr=g.shadow,ts=g.updateTextLayer,tn=g.version;r()}catch(t){r(t)}},1)}}]);

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.