@seqyuan/annovibe 0.8.15 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -5
- package/.next/build-manifest.json +4 -4
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +2 -2
- package/.next/required-server-files.js +4 -4
- package/.next/required-server-files.json +4 -4
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/harness/route.js +1 -1
- package/.next/server/app/api/harness/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plot-kernels/route.js +1 -1
- package/.next/server/app/api/plot-kernels/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plot-kernels/status/route.js +1 -1
- package/.next/server/app/api/plot-kernels/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
- package/.next/server/app/api/plot-kernels/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -1
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/projects/route.js +2 -2
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/reports/[id]/route.js +2 -2
- package/.next/server/app/api/reports/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/search/route.js +2 -2
- package/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/install/route.js +5 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/soul/route.js +1 -1
- package/.next/server/app/api/soul/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -5
- package/.next/server/chunks/1688.js +1 -1
- package/.next/server/chunks/63.js +3 -3
- package/.next/server/functions-config-manifest.json +2 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +3 -3
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{51fb665c.9f0b013f33bf4f6d.js → 51fb665c.e2bfdae35ef4d790.js} +1 -1
- package/.next/static/chunks/app/_not-found/page-4b48f2668e1f7080.js +1 -0
- package/.next/static/chunks/app/layout-9130ab8441517a56.js +1 -0
- package/.next/static/chunks/app/login/page-81d155b341701fb2.js +1 -0
- package/.next/static/chunks/app/{page-2b9d326c910bfdb1.js → page-dc4f9ffabf8d8a8a.js} +6 -6
- package/.next/static/chunks/{main-app-ecfccace02c7aaed.js → main-app-8d81a93b58bb990f.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-a7f3f044c72f9137.js +1 -0
- package/.next/static/chunks/{webpack-c223a77d0c5e1b9e.js → webpack-b0025b8b630debd5.js} +1 -1
- package/.next/trace +75 -75
- package/.next/trace-build +1 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
- package/.next/types/app/api/agent/[id]/route.ts +1 -1
- package/.next/types/app/api/agent/new/route.ts +1 -1
- package/.next/types/app/api/auth/all-providers/route.ts +1 -1
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/login/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/login/route.ts +1 -1
- package/.next/types/app/api/auth/logout/[provider]/route.ts +1 -1
- package/.next/types/app/api/auth/providers/route.ts +1 -1
- package/.next/types/app/api/auth/status/route.ts +1 -1
- package/.next/types/app/api/default-cwd/route.ts +1 -1
- package/.next/types/app/api/files/[...path]/route.ts +1 -1
- package/.next/types/app/api/harness/route.ts +1 -1
- package/.next/types/app/api/home/route.ts +1 -1
- package/.next/types/app/api/internal/runtime/route.ts +1 -1
- package/.next/types/app/api/models/route.ts +1 -1
- package/.next/types/app/api/models-config/discover/route.ts +1 -1
- package/.next/types/app/api/models-config/route.ts +1 -1
- package/.next/types/app/api/models-config/test/route.ts +1 -1
- package/.next/types/app/api/plot-kernels/route.ts +1 -1
- package/.next/types/app/api/plot-kernels/status/route.ts +1 -1
- package/.next/types/app/api/plot-kernels/stop/route.ts +1 -1
- package/.next/types/app/api/projects/browse/route.ts +1 -1
- package/.next/types/app/api/projects/route.ts +1 -1
- package/.next/types/app/api/reports/[id]/route.ts +1 -1
- package/.next/types/app/api/search/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/context/route.ts +1 -1
- package/.next/types/app/api/sessions/[id]/route.ts +1 -1
- package/.next/types/app/api/sessions/new/route.ts +1 -1
- package/.next/types/app/api/sessions/route.ts +1 -1
- package/.next/types/app/api/settings/route.ts +1 -1
- package/.next/types/app/api/skills/install/route.ts +1 -1
- package/.next/types/app/api/skills/route.ts +1 -1
- package/.next/types/app/api/skills/search/route.ts +1 -1
- package/.next/types/app/api/soul/route.ts +1 -1
- package/.next/types/app/api/version/route.ts +1 -1
- package/.next/types/app/layout.ts +1 -1
- package/.next/types/app/login/page.ts +1 -1
- package/.next/types/app/page.ts +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/app/_not-found/page-96eb50fac9e7a68c.js +0 -1
- package/.next/static/chunks/app/layout-827e06e39e1e6b05.js +0 -1
- package/.next/static/chunks/app/login/page-9450bfc0d502f432.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-cd03d084301c1bc9.js +0 -1
- /package/.next/static/{sll--ryodjD6y3JTZNo1d → uRzNUfUD2hf84UIeYUGuF}/_buildManifest.js +0 -0
- /package/.next/static/{sll--ryodjD6y3JTZNo1d → uRzNUfUD2hf84UIeYUGuF}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2213],{12810:(t,e,i)=>{i.r(e),i.d(e,{AbortException:()=>O,AnnotationEditorLayer:()=>rz,AnnotationEditorParamsType:()=>m,AnnotationEditorType:()=>g,AnnotationEditorUIManager:()=>tz,AnnotationLayer:()=>rb,AnnotationMode:()=>u,AnnotationType:()=>v,CSSConstants:()=>tx,ColorPicker:()=>iG,DOMSVGFactory:()=>iY,DrawLayer:()=>rH,FeatureTest:()=>U,GlobalWorkerOptions:()=>i_,ImageKind:()=>b,InvalidPDFException:()=>B,MathClamp:()=>K,OPS:()=>A,OutputScale:()=>tv,PDFDataRangeTransport:()=>iF,PDFDateString:()=>tc,PDFWorker:()=>iN,PasswordResponses:()=>x,PermissionFlag:()=>f,PixelsPerInch:()=>Z,RenderingCancelledException:()=>ti,ResponseException:()=>F,SignatureExtractor:()=>rF,SupportedImageMimeTypes:()=>ty,TextLayer:()=>iI,TextLayerImages:()=>r$,TouchManager:()=>t$,Util:()=>z,VerbosityLevel:()=>y,XfaLayer:()=>J,applyOpacity:()=>tw,build:()=>i$,createValidAbsoluteUrl:()=>C,fetchData:()=>tt,findContrastColor:()=>tM,getDocument:()=>iR,getFilenameFromUrl:()=>tn,getPdfFilenameFromUrl:()=>ta,getRGB:()=>tg,getRGBA:()=>tp,getUuid:()=>G,getXfaPageViewport:()=>tu,isDataScheme:()=>tr,isPdfFile:()=>ts,isValidExplicitDest:()=>eb,makeArr:()=>W,makeMap:()=>X,makeObj:()=>q,noContextMenu:()=>th,normalizeUnicode:()=>$,renderRichText:()=>tP,setLayerDimensions:()=>tb,shadow:()=>k,stopEvent:()=>td,updateUrlHash:()=>M,version:()=>ij});var r=i(41463),s=i(92619).Buffer,n={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}},3463(t){var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},4328(t,e,i){var r=i(4995),s=new r.WeakMap,n=r.set,a=r.remove;t.exports=function(t){return n(s,t,1),a(s,t),t}},6557(t,e,i){var r=i(4995).has;t.exports=function(t){return r(t),t}},6469(t,e,i){var r=i(608),s=i(2360),n=i(4913).f,a=r("unscopables"),o=Array.prototype;void 0===o[a]&&n(o,a,{configurable:!0,value:s(null)}),t.exports=function(t){o[a][t]=!0}},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")}},3972(t,e,i){var r=i(34),s=String,n=TypeError;t.exports=function(t){if(void 0===t||r(t))return t;throw new n(s(t)+" is not an object or undefined")}},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")}},4154(t,e,i){var r=i(6955),s=TypeError;t.exports=function(t){if("Uint8Array"===r(t))return t;throw new s("Argument is not an Uint8Array")}},7811(t){t.exports="u">typeof ArrayBuffer&&"u">typeof DataView},7394(t,e,i){var r=i(4576),s=i(6706),n=i(2195),a=r.ArrayBuffer,o=r.TypeError;t.exports=a&&s(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new o("ArrayBuffer expected");return t.byteLength}},3238(t,e,i){var r=i(4576),s=i(7811),n=i(7394),a=r.DataView;t.exports=function(t){if(!s||0!==n(t))return!1;try{return new a(t),!1}catch(t){return!0}}},5169(t,e,i){var r=i(3238),s=TypeError;t.exports=function(t){if(r(t))throw new s("ArrayBuffer is detached");return t}},5636(t,e,i){var r=i(4576),s=i(9504),n=i(6706),a=i(7696),o=i(5169),l=i(7394),h=i(4483),d=i(1548),c=r.structuredClone,u=r.ArrayBuffer,p=r.DataView,g=Math.max,m=Math.min,f=u.prototype,b=p.prototype,v=s(f.slice),y=n(f,"resizable","get"),A=n(f,"maxByteLength","get"),x=s(b.getInt8),w=s(b.setInt8);t.exports=(d||h)&&function(t,e,i){var r,s=l(t),n=void 0===e?s:a(e),f=!y||!y(t);if(o(t),d&&(t=c(t,{transfer:[t]}),s===n&&(i||f)))return t;if(s>=n&&(!i||f))r=v(t,0,n);else{var b=i&&!f&&A?{maxByteLength:g(n,A(t))}:void 0;r=new u(n,b);for(var _=new p(t),S=new p(r),T=m(n,s),E=0;E<T;E++)w(S,E,x(_,E))}return d||h(t),r}},4644(t,e,i){var r,s,n,a=i(7811),o=i(3724),l=i(4576),h=i(4901),d=i(34),c=i(9297),u=i(6955),p=i(6823),g=i(6699),m=i(6840),f=i(2106),b=i(1625),v=i(2787),y=i(2967),A=i(608),x=i(3392),w=i(1181),_=w.enforce,S=w.get,T=l.Int8Array,E=T&&T.prototype,C=l.Uint8ClampedArray,M=C&&C.prototype,P=T&&v(T),k=E&&v(E),D=Object.prototype,I=l.TypeError,R=A("toStringTag"),B=x("TYPED_ARRAY_TAG"),F="TypedArrayConstructor",L=a&&!!y&&"Opera"!==u(l.opera),O=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=v(t);if(d(e)){var i=S(e);return i&&c(i,F)?i[F]:z(e)}},H=function(t){if(!d(t))return!1;var e=u(t);return c(N,e)||c(U,e)};for(r in N)(n=(s=l[r])&&s.prototype)?_(n)[F]=s:L=!1;for(r in U)(n=(s=l[r])&&s.prototype)&&(_(n)[F]=s);if((!L||!h(P)||P===Function.prototype)&&(P=function(){throw new I("Incorrect invocation")},L))for(r in N)l[r]&&y(l[r],P);if((!L||!k||k===D)&&(k=P.prototype,L))for(r in N)l[r]&&y(l[r].prototype,k);if(L&&v(M)!==k&&y(M,k),o&&!c(k,R))for(r in O=!0,f(k,R,{configurable:!0,get:function(){return d(this)?this[B]:void 0}}),N)l[r]&&g(l[r].prototype,B,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:O&&B,aTypedArray:function(t){if(H(t))return t;throw new I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(h(t)&&(!y||b(P,t)))return t;throw new I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,r){if(o){if(i)for(var s in N){var n=l[s];if(n&&c(n.prototype,t))try{delete n.prototype[t]}catch(i){try{n.prototype[t]=e}catch(t){}}}(!k[t]||i)&&m(k,t,i?e:L&&E[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,i){var r,s;if(o){if(y){if(i){for(r in N)if((s=l[r])&&c(s,t))try{delete s[t]}catch(t){}}if(P[t]&&!i)return;try{return m(P,t,i?e:L&&P[t]||e)}catch(t){}}for(r in N)(s=l[r])&&(!s[t]||i)&&m(s,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||c(N,e)||c(U,e)},isTypedArray:H,TypedArray:P,TypedArrayPrototype:k}},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;t.exports=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?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}},7680(t,e,i){t.exports=i(9504)([].slice)},2804(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=e+"+/",r=e+"-_",s=function(t){for(var e={},i=0;i<64;i++)e[t.charAt(i)]=i;return e};t.exports={i2c:i,c2i:s(i),i2cUrl:r,c2iUrl:s(r)}},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)}}},2195(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(2195),a=i(608)("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){t.exports=!i(9039)(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(4576),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){t.exports=!i(9039)(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4483(t,e,i){var r,s,n,a,o=i(4576),l=i(9429),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(4576),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>0x1fffffffffffff)throw new 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},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}}},8727(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(t,e,i){t.exports="NODE"===i(4215)},2839(t,e,i){var r=i(4576).navigator,s=r&&r.userAgent;t.exports=s?String(s):""},9519(t,e,i){var r,s,n=i(4576),a=i(2839),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},4215(t,e,i){var r=i(4576),s=i(2839),n=i(2195),a=function(t){return s.slice(0,t.length)===t};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},8574(t,e,i){var r=i(9504),s=Error,n=r("".replace),a=String(new s("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);t.exports=function(t,e){if(l&&"string"==typeof t&&!s.prepareStackTrace)for(;e--;)t=n(t,o,"");return t}},6518(t,e,i){var r=i(4576),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,m=t.global,f=t.stat;if(i=m?r:f?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(m?d:g+(f?".":"#")+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}}},8745(t,e,i){var r=i(616),s=Function.prototype,n=s.apply,a=s.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(n):function(){return a.apply(n,arguments)})},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){t.exports=!i(9039)(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(2195),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)}}},944(t){var e=TypeError;t.exports=function(t){var i=t&&t.alphabet;if(void 0===i||"base64"===i||"base64url"===i)return i||"base64";throw new e("Incorrect `alphabet` option")}},9429(t,e,i){var r=i(4576),s=i(6193);t.exports=function(t){if(s){try{return r.process.getBuiltinModule(t)}catch(t){}try{return Function('return require("'+t+'")')()}catch(t){}}}},7751(t,e,i){var r=i(4576),s=i(4901);t.exports=function(t,e){var i;return arguments.length<2?s(i=r[t])?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(608)("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)}},4576(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){t.exports=i(7751)("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(2195),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},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(4576),l=i(34),h=i(6699),d=i(9297),c=i(7629),u=i(6119),p=i(421),g="Object already initialized",m=o.TypeError,f=o.WeakMap;if(a||c.state){var b=c.state||(c.state=new f);b.get=b.get,b.has=b.has,b.set=b.set,r=function(t,e){if(b.has(t))throw new m(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 m(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 m("Incompatible receiver, "+t+" required");return i}}}},4209(t,e,i){var r=i(608),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(2195);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)}},3925(t,e,i){var r=i(34);t.exports=function(t){return r(t)||null===t}},6395(t){t.exports=!1},5810(t,e,i){var r=i(34),s=i(1181).get;t.exports=function(t){if(!r(t))return!1;var e=s(t);return!!e&&"RawJSON"===e.type}},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(void 0!==(n=e(s.value)))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},m=g.prototype;t.exports=function(t,e,i){var f,b,v,y,A,x,w,_=i&&i.that,S=!!(i&&i.AS_ENTRIES),T=!!(i&&i.IS_RECORD),E=!!(i&&i.IS_ITERATOR),C=!!(i&&i.INTERRUPTED),M=r(e,_),P=function(t){var e=f;return f=void 0,e&&u(e,"normal"),new g(!0,t)},k=function(t){return S?(n(t),C?M(t[0],t[1],P):M(t[0],t[1])):C?M(t,P):M(t)};if(T)f=t.iterator;else if(E)f=t;else{if(!(b=c(t)))throw new p(a(t)+" is not iterable");if(o(b)){for(v=0,y=l(t);y>v;v++)if((A=k(t[v]))&&h(m,A))return A;return new g(!1)}f=d(t,b)}for(x=T?t.next:f.next;!(w=s(x,f)).done;){var D=w.value;try{A=k(D)}catch(t){if(f)u(f,"throw",t);else throw t}if("object"==typeof A&&A&&h(m,A))return A}return new g(!1)}},1385(t,e,i){var r=i(9539);t.exports=function(t,e,i){for(var s=t.length-1;s>=0;s--)if(void 0!==t[s])try{i=r(t[s].iterator,e,i)}catch(t){e="throw",i=t}if("throw"===e)throw i;return i}},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(608),l=i(1181),h=i(5966),d=i(7657).IteratorPrototype,c=i(2529),u=i(9539),p=i(1385),g=o("toStringTag"),m="IteratorHelper",f="WrapForValidIterator",b="normal",v="throw",y=l.set,A=function(t){var e=l.getterFor(t?f:m);return a(s(d),{next:function(){var i=e(this);if(t)return i.nextHandler();if(i.done)return c(void 0,!0);try{var r=i.nextHandler();return i.returnHandlerResult?r:c(r,i.done)}catch(t){throw i.done=!0,t}},return:function(){var i=e(this),s=i.iterator,n=i.done;if(i.done=!0,t){var a=h(s,"return");return a?r(a,s):c(void 0,!0)}if(n)return c(void 0,!0);if(i.inner)try{u(i.inner.iterator,b)}catch(t){return u(s,v,t)}if(i.openIters)try{p(i.openIters,b)}catch(t){if(s)return u(s,v,t);throw t}return s&&u(s,b),c(void 0,!0)}})},x=A(!0),w=A(!1);n(w,g,"Iterator Helper"),t.exports=function(t,e,i){var r=function(r,s){s?(s.iterator=r.iterator,s.next=r.next):s=r,s.type=e?f:m,s.returnHandlerResult=!!i,s.nextHandler=t,s.counter=0,s.done=!1,y(this,s)};return r.prototype=e?x:w,r}},684(t){t.exports=function(t,e){var i="function"==typeof Iterator&&Iterator.prototype[t];if(i)try{i.call({next:null},e).next()}catch(t){return!0}}},4549(t,e,i){var r=i(4576);t.exports=function(t,e){var i=r.Iterator,s=i&&i.prototype,n=s&&s[t],a=!1;if(n)try{n.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(t){t instanceof e||(a=!1)}if(!a)return n}},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(608),p=i(6395),g=u("iterator"),m=!1;[].keys&&("next"in(n=[].keys())?(s=d(d(n)))!==Object.prototype&&(r=s):m=!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:m}},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,m=r("".slice),f=r("".replace),b=r([].join),v=o&&!s(function(){return 8!==g(function(){},"length",{value:8}).length}),y=String(String).split("String"),A=t.exports=function(t,e,i){"Symbol("===m(p(e),0,7)&&(e="["+f(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(y,"string"==typeof e?e:"")),t};Function.prototype.toString=A(function(){return n(this)&&u(this).source||h(this)},"toString")},2248(t,e,i){var r=i(9504),s=Map.prototype;t.exports={Map:Map,set:r(s.set),get:r(s.get),has:r(s.has),remove:r(s.delete),proto:s}},741(t){var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?i:e)(r)}},7819(t,e,i){t.exports=!i(9039)(function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t})},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)}},4149(t){var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},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(){},m=function(t){return"<"+u+">"+t+"</"+u+">"},f=function(t){t.write(m("")),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(m("document.F=Object")),t.close(),t.F},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}v="u">typeof document?document.domain&&r?f(r):b():f(r);for(var t=a.length;t--;)delete v[c][a[t]];return v()};o[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){t.exports=i(9504)({}.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;e.f=r&&!i.call({1:2},1)?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);t.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 m=h(t,e,e+2);if(s(c,m))r+=c[m],e+=2;else if("\\u"===m){var f=h(t,e+=2,e+4);if(!d(u,f))throw new n("Bad Unicode escape at: "+e);r+=o(a(f,16)),e+=4}else throw new n('Unknown escape sequence: "'+m+'"')}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}}},1103(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},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(s)<=i.size?l(s,function(t){i.includes(t)&&c(s,t)}):h(i.getIterator(),function(t){d(s,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.iterator,"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.iterator,"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}}}}}},n=function(t){return{size:t,has:function(){return!0},keys:function(){throw Error("e")}}};t.exports=function(t,e){var i=r("Set");try{new i()[t](s(0));try{return new i()[t](s(-1)),!1}catch(r){if(!e)return!0;try{return new i()[t](n(-1/0)),!1}catch(r){var a=new i([1,2]);return e(a[t](n(1/0)))}}}catch(t){return!1}}},9835(t){t.exports=function(t){try{var e=new Set,i=e[t]({size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}});return 1===i.size&&4===i.values().next().value}catch(t){return!1}}},5170(t,e,i){t.exports=i(6706)(i(4402).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(4576),n=i(9433),a="__core-js_shared__",o=t.exports=s[a]||n(a,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"\xa9 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.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){var r=i(4576),s=i(9039),n=i(9519),a=i(4215),o=r.structuredClone;t.exports=!!o&&!s(function(){if("DENO"===a&&n>92||"NODE"===a&&n>94||"BROWSER"===a&&n>97)return!1;var t=new ArrayBuffer(8),e=o(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})},4495(t,e,i){var r=i(9519),s=i(9039),n=i(4576).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,0x1fffffffffffff):0}},8981(t,e,i){var r=i(7750),s=Object;t.exports=function(t){return s(r(t))}},9590(t,e,i){var r=i(1291),s=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw new s("The argument can't be less than 0");return e}},2777(t,e,i){var r=i(9565),s=i(34),n=i(757),a=i(5966),o=i(4270),l=i(608),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"),!s(i=r(l,t,e))||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(608)("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)}},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.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++s+n,36)}},9143(t,e,i){var r=i(4576),s=i(9504),n=i(3972),a=i(3463),o=i(9297),l=i(2804),h=i(944),d=i(5169),c=l.c2i,u=l.c2iUrl,p=r.SyntaxError,g=r.TypeError,m=s("".charAt),f=function(t,e){for(var i=t.length;e<i;e++){var r=m(t,e);if(" "!==r&&" "!==r&&"\n"!==r&&"\f"!==r&&"\r"!==r)break}return e},b=function(t,e,i){var r=t.length;r<4&&(t+=2===r?"AA":"A");var s=(e[m(t,0)]<<18)+(e[m(t,1)]<<12)+(e[m(t,2)]<<6)+e[m(t,3)],n=[s>>16&255,s>>8&255,255&s];if(2===r){if(i&&0!==n[1])throw new p("Extra bits");return[n[0]]}if(3===r){if(i&&0!==n[2])throw new p("Extra bits");return[n[0],n[1]]}return n},v=function(t,e,i){for(var r=e.length,s=0;s<r;s++)t[i+s]=e[s];return i+r};t.exports=function(t,e,i,r){a(t),n(e);var s="base64"===h(e)?c:u,l=e?e.lastChunkHandling:void 0;if(void 0===l&&(l="loose"),"loose"!==l&&"strict"!==l&&"stop-before-partial"!==l)throw new g("Incorrect `lastChunkHandling` option");i&&d(i.buffer);var y=t.length,A=i||[],x=0,w=0,_="",S=0;if(r)for(;;){if((S=f(t,S))===y){if(_.length>0){if("stop-before-partial"===l)break;if("loose"===l){if(1===_.length)throw new p("Malformed padding: exactly one additional character");x=v(A,b(_,s,!1),x)}else throw new p("Missing padding")}w=y;break}var T=m(t,S);if(++S,"="===T){if(_.length<2)throw new p("Padding is too early");if(S=f(t,S),2===_.length){if(S===y){if("stop-before-partial"===l)break;throw new p("Malformed padding: only one =")}"="===m(t,S)&&(S=f(t,++S))}if(S<y)throw new p("Unexpected character after padding");x=v(A,b(_,s,"strict"===l),x),w=y;break}if(!o(s,T))throw new p("Unexpected character");var E=r-x;if(1===E&&2===_.length||2===E&&3===_.length||4===(_+=T).length&&(x=v(A,b(_,s,!1),x),_="",w=S,x===r))break}return{bytes:A,read:w,written:x}}},2303(t,e,i){var r=i(4576),s=i(9504),n=r.Uint8Array,a=r.SyntaxError,o=Math.min,l=s("".match);t.exports=function(t,e){var i=t.length;if(i%2!=0)throw new a("String should be an even number of characters");for(var r=e?o(e.length,i/2):i/2,s=e||new n(r),h=l(t,/.{2}/g),d=0;d<r;d++){var c=+("0x"+h[d]+"0");if(c!=c)throw new a("String should only contain hex characters");s[d]=c>>4}return{bytes:s,read:d<<1}}},7416(t,e,i){var r=i(9039),s=i(608),n=i(3724),a=i(6395),o=s("iterator");t.exports=!r(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),r="";return t.pathname="c%20d",e.forEach(function(t,i){e.delete("b"),r+=i+t}),i.delete("a",2),i.delete("b",void 0),a&&(!t.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!e.size&&(a||!n)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host})},7040(t,e,i){t.exports=i(4495)&&!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(4576),s=i(4901),n=r.WeakMap;t.exports=s(n)&&/native code/.test(String(n))},4995(t,e,i){var r=i(9504),s=WeakMap.prototype;t.exports={WeakMap:WeakMap,set:r(s.set),get:r(s.get),has:r(s.has),remove:r(s.delete)}},608(t,e,i){var r=i(4576),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)}})},4423(t,e,i){var r=i(6518),s=i(9617).includes,n=i(9039),a=i(6469),o=n(function(){return![,].includes()}),l=n(function(){return[,1].includes(void 0,1)});r({target:"Array",proto:!0,forced:o||l},{includes:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},4114(t,e,i){var r=i(6518),s=i(8981),n=i(6198),a=i(4527),o=i(6837);r({target:"Array",proto:!0,arity:1,forced:i(9039)(function(){return 0x100000001!==[].push.call({length:0x100000000},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{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}})},8111(t,e,i){var r=i(6518),s=i(4576),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(608),g=i(7657).IteratorPrototype,m=i(3724),f=i(6395),b="constructor",v="Iterator",y=p("toStringTag"),A=TypeError,x=s[v],w=f||!o(x)||x.prototype!==g||!c(function(){x({})}),_=function(){if(n(this,g),l(this)===g)throw new A("Abstract class Iterator not directly constructable")},S=function(t,e){m?h(g,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===g)throw new A("You can't redefine this property");u(this,t)?this[t]=e:d(this,t,e)}}):g[t]=e};u(g,y)||S(y,v),(w||!u(g,b)||g[b]===Object)&&S(b,_),_.prototype=g,r({global:!0,constructor:!0,forced:w},{Iterator:_})},9314(t,e,i){var r=i(6518),s=i(9565),n=i(8551),a=i(1767),o=i(4149),l=i(9590),h=i(9539),d=i(9462),c=i(684),u=i(4549),p=i(6395),g=!p&&!c("drop",0),m=!p&&!g&&u("drop",RangeError),f=p||g||m,b=d(function(){for(var t,e,i=this.iterator,r=this.next;this.remaining;)if(this.remaining--,t=n(s(r,i)),this.done=!!t.done)return;if(t=n(s(r,i)),!(this.done=!!t.done))return t.value});r({target:"Iterator",proto:!0,real:!0,forced:f},{drop:function(t){var e;n(this);try{e=l(o(+t))}catch(t){h(this,"throw",t)}return m?s(m,this,e):new b(a(this),{remaining:e})}})},1148(t,e,i){var r=i(6518),s=i(9565),n=i(2652),a=i(9306),o=i(8551),l=i(1767),h=i(9539),d=i(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:d},{every:function(t){o(this);try{a(t)}catch(t){h(this,"throw",t)}if(d)return s(d,this,t);var e=l(this),i=0;return!n(e,function(e,r){if(!t(e,i++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489(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=i(9539),u=i(684),p=i(4549),g=!d&&!u("filter",function(){}),m=!d&&!g&&p("filter",TypeError),f=d||g||m,b=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(h(i,r,[e=t.value,this.counter++],!0))return e}});r({target:"Iterator",proto:!0,real:!0,forced:f},{filter:function(t){a(this);try{n(t)}catch(t){c(this,"throw",t)}return m?s(m,this,t):new b(o(this),{predicate:t})}})},116(t,e,i){var r=i(6518),s=i(9565),n=i(2652),a=i(9306),o=i(8551),l=i(1767),h=i(9539),d=i(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:d},{find:function(t){o(this);try{a(t)}catch(t){h(this,"throw",t)}if(d)return s(d,this,t);var e=l(this),i=0;return n(e,function(e,r){if(t(e,i++))return r(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},531(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=i(684),p=i(4549),g=!c&&!u("flatMap",function(){}),m=!c&&!g&&p("flatMap",TypeError),f=c||g||m||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(t){return!0}}(),b=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:f},{flatMap:function(t){a(this);try{n(t)}catch(t){d(this,"throw",t)}return m?s(m,this,t):new b(o(this),{mapper:t,inner:null})}})},7588(t,e,i){var r=i(6518),s=i(9565),n=i(2652),a=i(9306),o=i(8551),l=i(1767),h=i(9539),d=i(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(t){o(this);try{a(t)}catch(t){h(this,"throw",t)}if(d)return s(d,this,t);var e=l(this),i=0;n(e,function(e){t(e,i++)},{IS_RECORD:!0})}})},1701(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(9539),c=i(684),u=i(4549),p=i(6395),g=!p&&!c("map",function(){}),m=!p&&!g&&u("map",TypeError),f=p||g||m,b=l(function(){var t=this.iterator,e=a(s(this.next,t));if(!(this.done=!!e.done))return h(t,this.mapper,[e.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:f},{map:function(t){a(this);try{n(t)}catch(t){d(this,"throw",t)}return m?s(m,this,t):new b(o(this),{mapper:t})}})},3579(t,e,i){var r=i(6518),s=i(9565),n=i(2652),a=i(9306),o=i(8551),l=i(1767),h=i(9539),d=i(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:d},{some:function(t){o(this);try{a(t)}catch(t){h(this,"throw",t)}if(d)return s(d,this,t);var e=l(this),i=0;return n(e,function(e,r){if(t(e,i++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},4972(t,e,i){var r=i(6518),s=i(9565),n=i(8551),a=i(1767),o=i(4149),l=i(9590),h=i(9462),d=i(9539),c=i(684),u=i(4549),p=i(6395),g=!p&&!c("take",1),m=!p&&!g&&u("take",RangeError),f=p||g||m,b=h(function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,d(t,"normal",void 0);var e=n(s(this.next,t));if(!(this.done=!!e.done))return e.value});r({target:"Iterator",proto:!0,real:!0,forced:f},{take:function(t){var e;n(this);try{e=l(o(+t))}catch(t){d(this,"throw",t)}return m?s(m,this,e):new b(a(this),{remaining:e})}})},9112(t,e,i){var r=i(6518),s=i(3724),n=i(4576),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),m=i(4659),f=i(9039),b=i(8235),v=i(4495),y=n.JSON,A=n.Number,x=n.SyntaxError,w=y&&y.parse,_=a("Object","keys"),S=Object.getOwnPropertyDescriptor,T=o("".charAt),E=o("".slice),C=o(/./.exec),M=o([].push),P=/^\d$/,k=/^[1-9]$/,D=/^[\d-]$/,I=/^[\t\n\r ]$/,R=function(t,e){var i=new O(t=p(t),0,""),r=i.parse(),s=r.value,n=i.skip(I,r.end);if(n<t.length)throw new x('Unexpected extra character: "'+T(t,n)+'" after the parsed data at: '+n);return h(e)?B({"":s},"",e,r):s},B=function(t,e,i,r){var s,n,a,o,h,p=t[e],m=r&&p===r.value,f=m&&"string"==typeof r.source?{source:r.source}:{};if(d(p)){var b=c(p),v=m?r.nodes:b?[]:{};if(b)for(o=0,s=v.length,a=g(p);o<a;o++)F(p,o,B(p,""+o,i,o<s?v[o]:void 0));else for(o=0,a=g(n=_(p));o<a;o++)F(p,h=n[o],B(p,h,i,u(v,h)?v[h]:void 0))}return l(i,t,e,p,f)},F=function(t,e,i){if(s){var r=S(t,e);if(r&&!r.configurable)return}void 0===i?delete t[e]:m(t,e,i)},L=function(t,e,i,r){this.value=t,this.end=e,this.source=i,this.nodes=r},O=function(t,e){this.source=t,this.index=e};O.prototype={fork:function(t){return new O(this.source,t)},parse:function(){var t=this.source,e=this.skip(I,this.index),i=this.fork(e),r=T(t,e);if(C(D,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 x('Unexpected character: "'+r+'" at: '+e)},node:function(t,e,i,r,s){return new L(e,r,t?null:E(this.source,i,r),s)},object:function(){for(var t=this.source,e=this.index+1,i=!1,r={},s={},n=!1;e<t.length;){if("}"===T(t,e=this.until(['"',"}"],e))&&!i){e++,n=!0;break}var a=this.fork(e).string(),o=a.value;e=a.end,e=this.until([":"],e)+1,e=this.skip(I,e),m(s,o,a=this.fork(e).parse()),m(r,o,a.value);var l=T(t,e=this.until([",","}"],a.end));if(","===l)i=!0,e++;else if("}"===l){e++,n=!0;break}}if(!n)throw new x("Unterminated object at: "+e);return this.node(1,r,this.index,e,s)},array:function(){for(var t=this.source,e=this.index+1,i=!1,r=[],s=[],n=!1;e<t.length;){if("]"===T(t,e=this.skip(I,e))&&!i){e++,n=!0;break}var a=this.fork(e).parse();if(M(s,a),M(r,a.value),","===T(t,e=this.until([",","]"],a.end)))i=!0,e++;else if("]"===T(t,e)){e++,n=!0;break}}if(!n)throw new x("Unterminated array at: "+e);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(k,T(t,i)))i=this.skip(P,i+1);else throw new x("Failed to parse number at: "+i);if("."===T(t,i)){var r=i+1;if(i=this.skip(P,r),r===i)throw new x("Failed to parse number's fraction at: "+i)}if(("e"===T(t,i)||"E"===T(t,i))&&(("+"===T(t,++i)||"-"===T(t,i))&&i++,i===(i=this.skip(P,i))))throw new x("Failed to parse number's exponent value at: "+i);return this.node(0,A(E(t,e,i)),e,i)},keyword:function(t){var e=""+t,i=this.index,r=i+e.length;if(E(this.source,i,r)!==e)throw new x("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(I,e);for(var i=T(this.source,e),r=0;r<t.length;r++)if(t[r]===i)return e;throw new x('Unexpected character: "'+i+'" at: '+e)}};var N=f(function(){var t,e="9007199254740993";return w(e,function(e,i,r){t=r.source}),t!==e}),U=v&&!f(function(){return 1/w("-0 ")!=-1/0});r({target:"JSON",stat:!0,forced:N},{parse:function(t,e){return U&&!h(e)?w(t):R(t,e)}})},3110(t,e,i){var r=i(6518),s=i(7751),n=i(8745),a=i(9565),o=i(9504),l=i(9039),h=i(4376),d=i(4901),c=i(5810),u=i(757),p=i(2195),g=i(655),m=i(7680),f=i(8235),b=i(3392),v=i(4495),y=i(7819),A=String,x=s("JSON","stringify"),w=o(/./.exec),_=o("".charAt),S=o("".charCodeAt),T=o("".replace),E=o("".slice),C=o([].push),M=o(1.1.toString),P=/[\uD800-\uDFFF]/g,k=/^[\uD800-\uDBFF]$/,D=/^[\uDC00-\uDFFF]$/,I=b(),R=I.length,B=!v||l(function(){var t=s("Symbol")("stringify detection");return"[null]"!==x([t])||"{}"!==x({a:t})||"{}"!==x(Object(t))}),F=l(function(){return'"\\udf06\\ud834"'!==x("\uDF06\uD834")||'"\\udead"'!==x("\uDEAD")}),L=B?function(t,e){var i=m(arguments),r=N(e);if(!(!d(r)&&(void 0===t||u(t))))return i[1]=function(t,e){if(d(r)&&(e=a(r,this,A(t),e)),!u(e))return e},n(x,null,i)}:x,O=function(t,e,i){var r=_(i,e-1),s=_(i,e+1);return w(k,t)&&!w(D,s)||w(D,t)&&!w(k,r)?"\\u"+M(S(t,0),16):t},N=function(t){if(d(t))return t;if(h(t)){for(var e=t.length,i=[],r=0;r<e;r++){var s=t[r];"string"==typeof s?C(i,s):("number"==typeof s||"Number"===p(s)||"String"===p(s))&&C(i,g(s))}var n=i.length,a=!0;return function(t,e){if(a)return a=!1,e;if(h(this))return e;for(var r=0;r<n;r++)if(i[r]===t)return e}}};x&&r({target:"JSON",stat:!0,arity:3,forced:B||F||!y},{stringify:function(t,e,i){var r=N(e),s=[],n=L(t,function(t,e){var i=d(r)?a(r,this,A(t),e):e;return!y&&c(i)?I+(C(s,i.rawJSON)-1):i},i);if("string"!=typeof n||(F&&(n=T(n,P,O)),y))return n;for(var o="",l=n.length,h=0;h<l;h++){var u=_(n,h);if('"'===u){var p=f(n,++h).end-1,g=E(n,h,p);o+=E(g,0,R)===I?s[E(g,R)]:'"'+g+'"',h=p}else o+=u}return o}})},2731(t,e,i){var r=i(6518),s=i(9306),n=i(2248),a=i(6395),o=n.get,l=n.has,h=n.set;r({target:"Map",proto:!0,real:!0,forced:a},{getOrInsertComputed:function(t,e){var i=l(this,t);if(s(e),i)return o(this,t);0===t&&1/t==-1/0&&(t=0);var r=e(t);return h(this,t,r),r}})},5367(t,e,i){var r=i(6518),s=i(2248),n=i(6395),a=s.get,o=s.has,l=s.set;r({target:"Map",proto:!0,real:!0,forced:n},{getOrInsert:function(t,e){return o(this,t)?a(this,t):(l(this,t,e),e)}})},3068(t,e,i){var r=i(6518),s=i(9504),n=i(2652),a=RangeError,o=TypeError,l=1/0,h=NaN,d=Math.abs,c=Math.pow,u=s([].push),p=c(2,1023),g=c(2,53)-1,m=Number.MAX_VALUE,f=c(2,971),b={},v={},y={},A={},x={},w=function(t,e){var i=t+e;return{hi:i,lo:e-(i-t)}};r({target:"Math",stat:!0},{sumPrecise:function(t){var e,i,r,s,c,_,S=[],T=0,E=A;switch(n(t,function(t){if(++T>g)throw new a("Maximum allowed index exceeded");if("number"!=typeof t)throw new o("Value is not a number");E!==b&&(t!=t?E=b:t===l?E=E===v?b:y:t===-l?E=E===y?b:v:(0!==t||1/t===l)&&(E===A||E===x)&&(E=x,u(S,t)))}),E){case b:return h;case v:return-l;case y:return l;case A:return -0}for(var C=[],M=0,P=0;P<S.length;P++){e=S[P];for(var k=0,D=0;D<C.length;D++){if(i=C[D],d(e)<d(i)&&(_=e,e=i,i=_),s=(r=w(e,i)).hi,c=r.lo,d(s)===l){var I=s===l?1:-1;M+=I,d(e=e-I*p-I*p)<d(i)&&(_=e,e=i,i=_),s=(r=w(e,i)).hi,c=r.lo}0!==c&&(C[k++]=c),e=s}C.length=k,0!==e&&u(C,e)}var R=C.length-1;if(s=0,c=0,0!==M){var B=R>=0?C[R]:0;if(R--,d(M)>1||M>0&&B>0||M<0&&B<0)return M>0?l:-l;if(s=(r=w(M*p,B/2)).hi,c=2*r.lo,d(2*s)===l)return s>0?s===p&&c===-(f/2)&&R>=0&&C[R]<0?m:l:s===-p&&c===f/2&&R>=0&&C[R]>0?-m:-l;0!==c&&(C[++R]=c,c=0),s*=2}for(;R>=0&&(s=(r=w(s,C[R--])).hi,0===(c=r.lo)););return R>=0&&(c<0&&C[R]<0||c>0&&C[R]>0)&&(e=s+(i=2*c),i===e-s&&(s=e)),s}})},1689(t,e,i){var r=i(6518),s=i(4576),n=i(8745),a=i(7680),o=i(6043),l=i(9306),h=i(1103),d=s.Promise,c=!1;r({target:"Promise",stat:!0,forced:!d||!d.try||h(function(){d.try(function(t){c=8===t},8)}).error||!c},{try:function(t){var e=arguments.length>1?a(arguments,1):[],i=o.f(this),r=h(function(){return n(l(t),void 0,e)});return(r.error?i.reject:i.resolve)(r.value),i.promise}})},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(9039);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("difference",function(t){return 0===t.size})||n(function(){var t=new Set([1,2,3,4]);return 3!==t.difference({size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var i=e++>1;return t.has(1)&&t.clear(),{done:i,value:2}}}}}).size})},{difference:s})},8004(t,e,i){var r=i(6518),s=i(9039),n=i(8750);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||s(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:n})},3853(t,e,i){var r=i(6518),s=i(4449);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("isDisjointFrom",function(t){return!t})},{isDisjointFrom:s})},5876(t,e,i){var r=i(6518),s=i(3838);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("isSubsetOf",function(t){return t})},{isSubsetOf:s})},2475(t,e,i){var r=i(6518),s=i(8527);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("isSupersetOf",function(t){return!t})},{isSupersetOf:s})},5024(t,e,i){var r=i(6518),s=i(3650),n=i(9835);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("symmetricDifference")||!n("symmetricDifference")},{symmetricDifference:s})},1698(t,e,i){var r=i(6518),s=i(4204),n=i(9835);r({target:"Set",proto:!0,real:!0,forced:!i(4916)("union")||!n("union")},{union:s})},9577(t,e,i){var r=i(4644),s=i(1108),n=i(6198),a=i(1291),o=i(5854),l=r.aTypedArray,h=r.getTypedArrayConstructor,d=r.exportTypedArrayMethod,c=RangeError,u=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}(),p=u&&function(){try{new Int8Array(1).with(-.5,1)}catch(t){return!0}}();d("with",{with:function(t,e){var i=l(this),r=n(i),d=a(t),u=d<0?r+d:d,p=s(i)?o(e):+e;if(u>=r||u<0)throw new c("Incorrect index");for(var g=new(h(i))(r),m=0;m<r;m++)g[m]=m===u?p:i[m];return g}}.with,!u||p)},5213(t,e,i){var r=i(6518),s=i(4576),n=i(5370),a=i(9143),o=s.Uint8Array,l=!o||!o.fromBase64||!function(){try{o.fromBase64("a");return}catch(t){}try{o.fromBase64("",null)}catch(t){return!0}}();o&&r({target:"Uint8Array",stat:!0,forced:l},{fromBase64:function(t){var e=a(t,arguments.length>1?arguments[1]:void 0,null,0x1fffffffffffff);return n(o,e.bytes)}})},6632(t,e,i){var r=i(6518),s=i(4576),n=i(9143),a=i(4154),o=s.Uint8Array,l=!o||!o.prototype.setFromBase64||!function(){var t=new o([255,255,255,255,255]);try{t.setFromBase64("",null);return}catch(t){}try{t.setFromBase64("a");return}catch(t){}try{t.setFromBase64("MjYyZg===")}catch(e){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();o&&r({target:"Uint8Array",proto:!0,forced:l},{setFromBase64:function(t){a(this);var e=n(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})},4226(t,e,i){var r=i(6518),s=i(4576),n=i(3463),a=i(4154),o=i(5169),l=i(2303);s.Uint8Array&&r({target:"Uint8Array",proto:!0,forced:function(){try{var t=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(t).setFromHex("cafed00d")}catch(t){return!0}}()},{setFromHex:function(t){a(this),n(t),o(this.buffer);var e=l(t,this).read;return{read:e,written:e/2}}})},9486(t,e,i){var r=i(6518),s=i(4576),n=i(9504),a=i(3972),o=i(4154),l=i(5169),h=i(2804),d=i(944),c=h.i2c,u=h.i2cUrl,p=n("".charAt),g=s.Uint8Array,m=!g||!g.prototype.toBase64||!function(){try{new g().toBase64(null)}catch(t){return!0}}();g&&r({target:"Uint8Array",proto:!0,forced:m},{toBase64:function(){var t,e=o(this),i=arguments.length?a(arguments[0]):void 0,r="base64"===d(i)?c:u,s=!!i&&!!i.omitPadding;l(this.buffer);for(var n="",h=0,g=e.length,m=function(e){return p(r,t>>6*e&63)};h+2<g;h+=3)t=(e[h]<<16)+(e[h+1]<<8)+e[h+2],n+=m(3)+m(2)+m(1)+m(0);return h+2===g?(t=(e[h]<<16)+(e[h+1]<<8),n+=m(3)+m(2)+m(1)+(s?"":"=")):h+1===g&&(t=e[h]<<16,n+=m(3)+m(2)+(s?"":"==")),n}})},456(t,e,i){var r=i(6518),s=i(4576),n=i(9504),a=i(4154),o=i(5169),l=n(1.1.toString),h=n([].join),d=Array,c=s.Uint8Array,u=!c||!c.prototype.toHex||!function(){try{var t=new c([255,255,255,255,255,255,255,255]);return"ffffffffffffffff"===t.toHex()}catch(t){return!1}}();c&&r({target:"Uint8Array",proto:!0,forced:u},{toHex:function(){a(this),o(this.buffer);for(var t=d(this.length),e=0,i=this.length;e<i;e++){var r=l(this[e],16);t[e]=1===r.length?"0"+r:r}return h(t,"")}})},9452(t,e,i){var r=i(6518),s=i(9306),n=i(6557),a=i(4328),o=i(4995),l=i(6395),h=o.get,d=o.has,c=o.set;r({target:"WeakMap",proto:!0,real:!0,forced:l||!function(){try{WeakMap.prototype.getOrInsertComputed&&new WeakMap().getOrInsertComputed(1,function(){throw 1})}catch(t){return t instanceof TypeError}}()},{getOrInsertComputed:function(t,e){if(l||n(this),a(t),s(e),d(this,t))return h(this,t);var i=e(t);return c(this,t,i),i}})},8454(t,e,i){var r=i(6518),s=i(4995),n=i(6395),a=s.get,o=s.has,l=s.set;r({target:"WeakMap",proto:!0,real:!0,forced:n},{getOrInsert:function(t,e){return o(this,t)?a(this,t):(l(this,t,e),e)}})},4979(t,e,i){var r=i(6518),s=i(4576),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(8574),g=i(3724),m=i(6395),f="DOMException",b=n("Error"),v=n(f),y=function(){h(this,A);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=f,o(r,"stack",a(1,p(s.stack,1))),d(r,this,y),r},A=y.prototype=v.prototype,x="stack"in new b(f),w="stack"in new v(1,2),_=v&&g&&Object.getOwnPropertyDescriptor(s,f),S=!!_&&!(_.writable&&_.configurable),T=x&&!S&&!w;r({global:!0,constructor:!0,forced:m||T},{DOMException:T?y:v});var E=n(f),C=E.prototype;if(C.constructor!==E){for(var M in m||o(C,"constructor",a(1,E)),u)if(l(u,M)){var P=u[M],k=P.s;l(E,k)||o(E,k,a(6,P.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=s.length;p<g;)d(this,(e=s[p]).key),p++;for(p=0;p<g;)((e=s[p++]).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})},5781(t,e,i){var r=i(6518),s=i(7751),n=i(2812),a=i(655),o=i(7416),l=s("URL");r({target:"URL",stat:!0,forced:!o},{parse:function(t){var e=n(arguments.length,1),i=a(t),r=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return new l(i,r)}catch(t){return null}}})}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={exports:{}};return n[t].call(i.exports,i,i.exports,o),i.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o(4423),o(4114),o(6573),o(8100),o(7936),o(5367),o(2731),o(9577),o(6632),o(4226),o(9486),o(456),o(5781);let l="object"==typeof r&&r+""=="[object process]"&&!r.versions.nw&&!(r.versions.electron&&r.type&&"browser"!==r.type),h=[1/0,1/0,-1/0,-1/0],d=new Float32Array(h),c=[.001,0,0,.001,0,0],u={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},p="pdfjs_internal_editor_",g={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},m={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},f={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},b={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},v={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},y={ERRORS:0,WARNINGS:1,INFOS:5},A={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},x={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},w=y.WARNINGS;function _(t){w>=y.INFOS&&console.info(`Info: ${t}`)}function S(t){w>=y.WARNINGS&&console.warn(`Warning: ${t}`)}function T(t){throw Error(t)}function E(t,e){t||T(e)}function C(t,e=null,i=null){if(!t)return null;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?URL.parse(t,e):URL.parse(t);return!function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s)?null:s}function M(t,e,i=!1){let r=URL.parse(t);return r?(r.hash=e,r.href):i&&C(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function P(t){return t.substring(t.lastIndexOf("/")+1)}function k(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}let D=function(){function t(t,e){this.message=t,this.name=e}return t.prototype=Error(),t.constructor=t,t}();class I extends D{constructor(t,e){super(t,"PasswordException"),this.code=e}}class R extends D{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class B extends D{constructor(t){super(t,"InvalidPDFException")}}class F extends D{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}}class L extends D{constructor(t){super(t,"FormatError")}}class O extends D{constructor(t){super(t,"AbortException")}}function N(t){"string"!=typeof t&&T("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}class U{static get isLittleEndian(){let t;return k(this,"isLittleEndian",((t=new Uint8Array(4))[0]=1,1===new Uint32Array(t.buffer,0,1)[0]))}static get isOffscreenCanvasSupported(){return k(this,"isOffscreenCanvasSupported","u">typeof OffscreenCanvas)}static get isImageDecoderSupported(){return k(this,"isImageDecoderSupported","u">typeof ImageDecoder)}static get isFloat16ArraySupported(){return k(this,"isFloat16ArraySupported","u">typeof Float16Array)}static get isSanitizerSupported(){return k(this,"isSanitizerSupported","u">typeof Sanitizer)}static get platform(){let{platform:t,userAgent:e}=navigator;return k(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return k(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}static get isAlphaColorInputSupported(){return k(this,"isAlphaColorInputSupported",(()=>{if("u"<typeof document)return!1;let t=document.createElement("input");return t.type="color",t.setAttribute("alpha",""),t.value="#ff000080","#ff0000"!==t.value})())}}class z{static get hexNums(){return k(this,"hexNums",Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0")))}static makeHexColor(t,e,i){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[i]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}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 multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){let r=t[i],s=t[i+1];t[i]=r*e[0]+s*e[2]+e[4],t[i+1]=r*e[1]+s*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){let r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5];for(let e=0;e<6;e+=2){let h=t[i+e],d=t[i+e+1];t[i+e]=h*r+d*n+o,t[i+e+1]=h*s+d*a+l}}static applyInverseTransform(t,e){let i=t[0],r=t[1],s=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-r*e[2]+e[2]*e[5]-e[4]*e[3])/s,t[1]=(-i*e[1]+r*e[0]+e[4]*e[1]-e[5]*e[0])/s}static axialAlignedBoundingBox(t,e,i){let r=e[0],s=e[1],n=e[2],a=e[3],o=e[4],l=e[5],h=t[0],d=t[1],c=t[2],u=t[3],p=r*h+o,g=p,m=r*c+o,f=m,b=a*d+l,v=b,y=a*u+l,A=y;if(0!==s||0!==n){let t=s*h,e=s*c,i=n*d,r=n*u;p+=i,f+=i,m+=r,g+=r,b+=t,A+=t,y+=e,v+=e}i[0]=Math.min(i[0],p,m,g,f),i[1]=Math.min(i[1],b,y,v,A),i[2]=Math.max(i[2],p,m,g,f),i[3]=Math.max(i[3],b,y,v,A)}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,e){let i=t[0],r=t[1],s=t[2],n=t[3],a=i**2+r**2,o=s**2+n**2,l=(a+o)/2,h=Math.sqrt(l**2-(a*o-(i*s+r*n)**2));e[0]=Math.sqrt(l+h||1),e[1]=Math.sqrt(l-h||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=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 pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,r,s){s[0]=Math.min(s[0],t,i),s[1]=Math.min(s[1],e,r),s[2]=Math.max(s[2],t,i),s[3]=Math.max(s[3],e,r)}static #t(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 #e(t,e,i,r,s,n,a,o,l,h,d,c){if(1e-12>Math.abs(l)){Math.abs(h)>=1e-12&&this.#t(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.#t(t,e,i,r,s,n,a,o,(-h+p)/g,c),this.#t(t,e,i,r,s,n,a,o,(-h-p)/g,c)}static bezierBoundingBox(t,e,i,r,s,n,a,o,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),this.#e(t,i,s,a,e,r,n,o,3*(-t+3*(i-s)+a),6*(t-2*i+s),3*(i-t),l),this.#e(t,i,s,a,e,r,n,o,3*(-e+3*(r-n)+o),6*(e-2*r+n),3*(r-e),l)}}let H=null,j=null;function $(t){return H||(H=/([\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,j=new Map([["ſt","ſt"]])),t.replaceAll(H,(t,e,i)=>e?e.normalize("NFKC"):j.get(i))}function G(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();let t=new Uint8Array(32);return crypto.getRandomValues(t),function(t){("object"!=typeof t||t?.length===void 0)&&T("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("")}(t)}let V="pdfjs_internal_id_",W=()=>[],X=()=>new Map,q=()=>Object.create(null);function K(t,e,i){return Math.min(Math.max(t,e),i)}"function"!=typeof Blob.prototype.bytes&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),"function"!=typeof Response.prototype.bytes&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())}),"function"!=typeof AbortSignal.any&&(AbortSignal.any=function(t){let e=new AbortController,{signal:i}=e;for(let r of t)if(r.aborted)return e.abort(r.reason),i;for(let r of t)r.addEventListener("abort",()=>{e.abort(r.reason)},{signal:i});return i}),o(8111),o(1701),o(4603),o(7566),o(8721);class Y{static textContent(t){let e=[],i={items:e,styles:Object.create(null)};return!function t(i){if(!i)return;let r=null,s=i.name;if("#text"===s)r=i.value;else{if(!Y.shouldBuildText(s))return;i?.attributes?.textContent?r=i.attributes.textContent:i.value&&(r=i.value)}if(null!==r&&e.push({str:r}),i.children)for(let e of i.children)t(e)}(t),i}static shouldBuildText(t){return"textarea"!==t&&"input"!==t&&"option"!==t&&"select"!==t}}class J{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:Object.hasOwn(e.attributes,"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,r=t.xfaHtml,s=t.intent||"display",n=document.createElement(r.name);r.attributes&&this.setAttributes({html:n,element:r,intent:s,linkService:i});let a="richText"!==s,o=t.div;if(o.append(n),t.viewport){let e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}a&&o.setAttribute("class","xfaLayer xfaFont");let l=[];if(0===r.children.length){if(r.value){let t=document.createTextNode(r.value);n.append(t),a&&Y.shouldBuildText(r.name)&&l.push(t)}return{textDivs:l}}let h=[[r,-1,n]];for(;h.length>0;){let[t,r,n]=h.at(-1);if(r+1===t.children.length){h.pop();continue}let o=t.children[++h.at(-1)[1]];if(null===o)continue;let{name:d}=o;if("#text"===d){let t=document.createTextNode(o.value);l.push(t),n.append(t);continue}let c=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,d):document.createElement(d);if(n.append(c),o.attributes&&this.setAttributes({html:c,element:o,storage:e,intent:s,linkService:i}),o.children?.length>0)h.push([o,-1,c]);else if(o.value){let t=document.createTextNode(o.value);a&&Y.shouldBuildText(d)&&l.push(t),c.append(t)}}for(let t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}let Q="http://www.w3.org/2000/svg";class Z{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function tt(t,e="text"){if(tl(t,document.baseURI)){let i=await fetch(t);if(!i.ok)throw Error(i.statusText);switch(e){case"blob":return i.blob();case"bytes":return i.bytes();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="bytes"===e?"arraybuffer":e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){switch(e){case"bytes":i(new Uint8Array(s.response));return;case"blob":case"json":i(s.response);return}i(s.responseText);return}r(Error(s.statusText))}},s.send(null)})}class te{constructor({viewBox:t,userUnit:e,scale:i,rotation:r,offsetX:s=0,offsetY:n=0,dontFlip:a=!1}){let o,l,h,d,c,u,p,g;this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=r,this.offsetX=s,this.offsetY=n,i*=e;const m=(t[2]+t[0])/2,f=(t[3]+t[1])/2;switch((r%=360)<0&&(r+=360),r){case 180:o=-1,l=0,h=0,d=1;break;case 90:o=0,l=1,h=1,d=0;break;case 270:o=0,l=-1,h=-1,d=0;break;case 0:o=1,l=0,h=0,d=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,d=-d),0===o?(c=Math.abs(f-t[1])*i+s,u=Math.abs(m-t[0])*i+n,p=(t[3]-t[1])*i,g=(t[2]-t[0])*i):(c=Math.abs(m-t[0])*i+s,u=Math.abs(f-t[1])*i+n,p=(t[2]-t[0])*i,g=(t[3]-t[1])*i),this.transform=[o*i,l*i,h*i,d*i,c-o*i*m-h*i*f,u-l*i*m-d*i*f],this.width=p,this.height=g}get rawDims(){let t=this.viewBox;return k(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 te({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(t,e){let i=[t,e];return z.applyTransform(i,this.transform),i}convertToViewportRectangle(t){let e=[t[0],t[1]];z.applyTransform(e,this.transform);let i=[t[2],t[3]];return z.applyTransform(i,this.transform),[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){let i=[t,e];return z.applyInverseTransform(i,this.transform),i}}class ti extends D{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function tr(t){let e=t.length,i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function ts(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function tn(t){return[t]=t.split(/[#?]/,1),P(t)}function ta(t,e="document.pdf"){if("string"!=typeof t)return e;if(tr(t))return S('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let i=(t=>{try{return new URL(t)}catch{try{return new URL(decodeURIComponent(t))}catch{try{return new URL(t,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(t),"https://foo.bar")}catch{return null}}}}})(t);if(!i)return e;let r=t=>{try{let e=decodeURIComponent(t);if(e.includes("/")&&(e=P(e),/^\.pdf$/i.test(e)))return t;return e}catch{return t}},s=/\.pdf$/i,n=P(i.pathname);if(s.test(n))return r(n);if(i.searchParams.size>0){let t=t=>[...t].findLast(t=>s.test(t)),e=t(i.searchParams.values())??t(i.searchParams.keys());if(e)return r(e)}if(i.hash){let t=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(t)return r(t[0])}return e}class to{#i=new Map;times=[];time(t){this.#i.has(t)&&S(`Timer is already running for ${t}`),this.#i.set(t,Date.now())}timeEnd(t){this.#i.has(t)||S(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.#i.get(t),end:Date.now()}),this.#i.delete(t)}toString(){let t=Math.max(...this.times.map(t=>t.name.length));return this.times.map(e=>`${e.name.padEnd(t)} ${e.end-e.start}ms
|
|
2
|
-
`).join("")}}function tl(t,e){let i=e?URL.parse(t,e):URL.parse(t);return/https?:/.test(i?.protocol??"")}function th(t){t.preventDefault()}function td(t){t.preventDefault(),t.stopPropagation()}class tc{static #r;static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!=typeof t)return null;this.#r||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let e=this.#r.exec(t);if(!e)return null;let i=parseInt(e[1],10),r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let n=parseInt(e[4],10);n=n>=0&&n<=23?n:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;let l=e[7]||"Z",h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(n+=h,a+=d):"+"===l&&(n-=h,a-=d),new Date(Date.UTC(i,r,s,n,a,o))}}function tu(t,{scale:e=1,rotation:i=0}){let{width:r,height:s}=t.attributes.style;return new te({viewBox:[0,0,parseInt(r,10),parseInt(s,10)],userUnit:1,scale:e,rotation:i})}function tp(t){if(t.startsWith("#")){let e=t.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){let[e,i,r]=t.slice(4,-1).split(",").map(t=>parseInt(t,10));return[e,i,r,1]}if(t.startsWith("rgba(")){let e=t.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}let e=t.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(255*parseFloat(e[1])),Math.round(255*parseFloat(e[2])),Math.round(255*parseFloat(e[3])),void 0!==e[4]&&"none"!==e[4]?parseFloat(e[4]):1]:null}function tg(t){let e=tp(t);return e?e.slice(0,3):(S(`Not a valid color format: "${t}"`),[0,0,0])}function tm(t){let{a:e,b:i,c:r,d:s,e:n,f:a}=t.getTransform();return[e,i,r,s,n,a]}function tf(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 tb(t,e,i=!1,r=!0){if(e instanceof te){let{pageWidth:r,pageHeight:s}=e.rawDims,{style:n}=t,a=U.isCSSRoundSupported,o=`var(--total-scale-factor) * ${r}px`,l=`var(--total-scale-factor) * ${s}px`,h=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,d=a?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;i&&e.rotation%180!=0?(n.width=d,n.height=h):(n.width=h,n.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class tv{constructor(){const{pixelRatio:t}=tv;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,r,s=-1){let n=1/0,a=1/0,o=1/0;(i=tv.capPixels(i,s))>0&&(n=Math.sqrt(i/(t*e))),-1!==r&&(a=r/t,o=r/e);let l=Math.min(n,a,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){let i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}let ty=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class tA{static get isDarkMode(){return k(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class tx{static get commentForegroundColor(){let t=document.createElement("span");t.classList.add("comment","sidebar");let{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);let{color:i}=window.getComputedStyle(t);return t.remove(),k(this,"commentForegroundColor",tg(i))}}function tw(t,e){let i=255*(1-(e=K(e??1,0,1)));return t.map(t=>Math.round(t*e+i))}function t_(t,e){let i=t[0]/255,r=t[1]/255,s=t[2]/255,n=Math.max(i,r,s),a=Math.min(i,r,s),o=(n+a)/2;if(n===a)e[0]=e[1]=0;else{let t=n-a;switch(e[1]=o<.5?t/(n+a):t/(2-n-a),n){case i:e[0]=((r-s)/t+6*(r<s))*60;break;case r:e[0]=((s-i)/t+2)*60;break;case s:e[0]=((i-r)/t+4)*60}}e[2]=o}function tS(t,e){let i=t[0],r=t[1],s=t[2],n=(1-Math.abs(2*s-1))*r,a=n*(1-Math.abs(i/60%2-1)),o=s-n/2;switch(Math.floor(i/60)){case 0:e[0]=n+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=n+o,e[2]=o;break;case 2:e[0]=o,e[1]=n+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=n+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=n+o;break;case 5:case 6:e[0]=n+o,e[1]=o,e[2]=a+o}}function tT(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function tE(t,e,i){tS(t,i),i.map(tT);let r=.2126*i[0]+.7152*i[1]+.0722*i[2];tS(e,i),i.map(tT);let s=.2126*i[0]+.7152*i[1]+.0722*i[2];return r>s?(r+.05)/(s+.05):(s+.05)/(r+.05)}let tC=new Map;function tM(t,e){let i=t[0]+256*t[1]+65536*t[2]+0x1000000*e[0]+0x100000000*e[1]+0x10000000000*e[2],r=tC.get(i);if(r)return r;let s=new Float32Array(9),n=s.subarray(0,3),a=s.subarray(3,6);t_(t,a);let o=s.subarray(6,9);t_(e,o);let l=o[2]<.5,h=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),tE(a,o,n)<h){let t,e;for(l?(t=a[2],e=1):(t=0,e=a[2]);e-t>.005;){let i=a[2]=(t+e)/2;l===tE(a,o,n)<h?t=i:e=i}a[2]=l?e:t}return tS(a,n),r=z.makeHexColor(Math.round(255*n[0]),Math.round(255*n[1]),Math.round(255*n[2])),tC.set(i,r),r}function tP({html:t,dir:e,className:i},r){let s=document.createDocumentFragment();if("string"==typeof t){let i=document.createElement("p");i.dir=e||"auto";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"))}s.append(i)}else J.render({xfaHtml:t,div:s,intent:"richText"});s.firstElementChild.classList.add("richText",i),r.append(s)}function tk(t){let e=new Path2D;if(!t)return e;for(let i=0,r=t.length;i<r;)switch(t[i++]){case 0:e.moveTo(t[i++],t[i++]);break;case 1:e.lineTo(t[i++],t[i++]);break;case 2:e.bezierCurveTo(t[i++],t[i++],t[i++],t[i++],t[i++],t[i++]);break;case 3:e.quadraticCurveTo(t[i++],t[i++],t[i++],t[i++]);break;case 4:e.closePath();break;default:S(`Unrecognized drawing path operator: ${t[i-1]}`)}return e}o(4972),o(4628),o(7642),o(8004),o(3853),o(5876),o(2475),o(5024),o(1698),o(8454),o(9452),o(4979),o(3579),o(3110),o(9314),o(1148),o(9112);class tD{#s=null;#n=null;#a;#o=null;#l=null;#h=null;#d=null;#c=null;static #u=null;constructor(t){this.#a=t,tD.#u||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){let t=this.#s=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");let e=this.#a._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",th,{signal:e}),t.addEventListener("pointerdown",tD.#p,{signal:e}));let i=this.#o=document.createElement("div");i.className="buttons",t.append(i);let r=this.#a.toolbarPosition;if(r){let{style:e}=t,i="ltr"===this.#a._uiManager.direction?1-r[0]:r[0];e.insetInlineEnd=`${100*i}%`,e.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#s}static #p(t){t.stopPropagation()}#g(t){this.#a._focusEventsAllowed=!1,td(t)}#m(t){this.#a._focusEventsAllowed=!0,td(t)}#f(t){let e=this.#a._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",this.#g.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#m.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",th,{signal:e}),!0)}hide(){this.#s.classList.add("hidden"),this.#n?.hideDropdown()}show(){this.#s.classList.remove("hidden"),this.#l?.shown(),this.#h?.shown()}addDeleteButton(){let{editorType:t,_uiManager:e}=this.#a,i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",tD.#u[t]),this.#f(i)&&i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),this.#o.append(i)}get #b(){let t=document.createElement("div");return t.className="divider",t}async addAltText(t){let e=await t.render();this.#f(e),this.#o.append(e,this.#b),this.#l=t}addComment(t,e=null){if(this.#h)return;let i=t.renderForToolbar();if(!i)return;this.#f(i);let r=this.#d=this.#b;e?(this.#o.insertBefore(i,e),this.#o.insertBefore(r,e)):this.#o.append(i,r),this.#h=t,t.toolbar=this}addColorPicker(t){if(this.#n)return;this.#n=t;let e=t.renderButton();this.#f(e),this.#o.append(e,this.#b)}async addEditSignatureButton(t){let e=this.#c=await t.renderEditButton(this.#a);this.#f(e),this.#o.append(e,this.#b)}removeButton(t){"comment"===t&&(this.#h?.removeToolbarCommentButton(),this.#h=null,this.#d?.remove(),this.#d=null)}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e)}}async addButtonBefore(t,e,i){if(!e&&"comment"===t)return;let r=this.#o.querySelector(i);r&&"comment"===t&&this.addComment(e,r)}updateEditSignatureButton(t){this.#c&&(this.#c.title=t)}remove(){this.#s.remove(),this.#n?.destroy(),this.#n=null}}class tI{#o=null;#s=null;#v;constructor(t){this.#v=t}#y(){let t=this.#s=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");let e=this.#v._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",th,{signal:e});let i=this.#o=document.createElement("div");return i.className="buttons",t.append(i),this.#v.hasCommentManager()&&this.#A("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#v.commentSelection("floating_button")}),this.#A("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#v.highlightSelection("floating_button")}),t}#x(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.#x(e,i),{style:n}=this.#s||=this.#y();t.append(this.#s),n.insetInlineEnd=`${100*r}%`,n.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#s.remove()}#A(t,e,i,r){let s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);let n=document.createElement("span");s.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id",i);let a=this.#v._signal;a instanceof AbortSignal&&!a.aborted&&(s.addEventListener("contextmenu",th,{signal:a}),s.addEventListener("click",r,{signal:a})),this.#o.append(s)}}function tR(t,e,i){for(let r of i)e.addEventListener(r,t[r].bind(t))}class tB{static #w=NaN;static #_=null;static #S=NaN;static #T=null;static initializeAndAddPointerId(t){(tB.#_||=new Set).add(t)}static setPointer(t,e){tB.#w||=e,tB.#T??=t}static setTimeStamp(t){tB.#S=t}static isSamePointerId(t){return tB.#w===t}static isSamePointerIdOrRemove(t){return tB.#w===t||(tB.#_?.delete(t),!1)}static isSamePointerType(t){return tB.#T===t}static isInitializedAndDifferentPointerType(t){return null!==tB.#T&&!tB.isSamePointerType(t)}static isSameTimeStamp(t){return tB.#S===t}static isUsingMultiplePointers(){return tB.#_?.size>=1}static clearPointerType(){tB.#T=null}static clearPointerIds(){tB.#w=NaN,tB.#_=null}static clearTimeStamp(){tB.#S=NaN}}class tF{#E=0;get id(){return`${p}${this.#E++}`}}class tL{#C=G();#E=0;#M=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;return 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>',k(this,"_isSVGFittingCanvas",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])))}async #P(t,e){this.#M||=new Map;let i=this.#M.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.#C}_${this.#E++}`,refCounter:0,isSvg:!1},"string"==typeof e?(i.url=e,t=await tt(e,"blob")):e instanceof File?t=i.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){let e=tL._isSVGFittingCanvas,r=new FileReader,s=new Image,n=new Promise((t,n)=>{s.onload=()=>{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){S(t),i=null}return this.#M.set(t,i),i&&this.#M.set(i.id,i),i}async getFromFile(t){let{lastModified:e,name:i,size:r,type:s}=t;return this.#P(`${e}_${i}_${r}_${s}`,t)}async getFromUrl(t){return this.#P(t,t)}async getFromBlob(t,e){let i=await e;return this.#P(t,i)}async getFromId(t){this.#M||=new Map;let e=this.#M.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){let{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#M||=new Map;let i=this.#M.get(t);if(i?.bitmap)return i.refCounter+=1,i;let r=new OffscreenCanvas(e.width,e.height);return r.getContext("2d").drawImage(e,0,0),i={bitmap:r.transferToImageBitmap(),id:`image_${this.#C}_${this.#E++}`,refCounter:1,isSvg:!1},this.#M.set(t,i),this.#M.set(i.id,i),i}getSvgUrl(t){let e=this.#M.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#M||=new Map;let e=this.#M.get(t);if(!e||(e.refCounter-=1,0!==e.refCounter))return;let{bitmap:i}=e;if(!e.url&&!e.file){let t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=t.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#C}_`)}}class tO{#k=[];#D=!1;#I;#R=-1;constructor(t=128){this.#I=t}add({cmd:t,undo:e,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:n=!1,keepUndo:a=!1}){if(r&&t(),this.#D)return;let o={cmd:t,undo:e,post:i,type:s};if(-1===this.#R){this.#k.length>0&&(this.#k.length=0),this.#R=0,this.#k.push(o);return}if(n&&this.#k[this.#R].type===s){a&&(o.undo=this.#k[this.#R].undo),this.#k[this.#R]=o;return}let l=this.#R+1;l===this.#I?this.#k.splice(0,1):(this.#R=l,l<this.#k.length&&this.#k.splice(l)),this.#k.push(o)}undo(){if(-1===this.#R)return;this.#D=!0;let{undo:t,post:e}=this.#k[this.#R];t(),e?.(),this.#D=!1,this.#R-=1}redo(){if(this.#R<this.#k.length-1){this.#R+=1,this.#D=!0;let{cmd:t,post:e}=this.#k[this.#R];t(),e?.(),this.#D=!1}}hasSomethingToUndo(){return -1!==this.#R}hasSomethingToRedo(){return this.#R<this.#k.length-1}cleanType(t){if(-1!==this.#R){for(let e=this.#R;e>=0;e--)if(this.#k[e].type!==t){this.#k.splice(e+1,this.#R-e),this.#R=e;return}this.#k.length=0,this.#R=-1}}destroy(){this.#k=null}}class tN{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=U.platform;for(const[i,r,s={}]of t)for(const t of i){const 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)))}}#B(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.#B(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||td(e))}}class tU{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]),e=document.createElement("span");for(let i of(e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e),t.keys())){e.style.color=i;let r=window.getComputedStyle(e).color;t.set(i,tg(r))}return e.remove(),k(this,"_colors",t)}convert(t){let e=tg(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 tU._colorsMapping.get(t);return e}getHexCode(t){let e=this._colors.get(t);return e?z.makeHexColor(...e):t}}class tz{#F=new AbortController;#L=null;#O=null;#N=new Map;#U=new Map;#z=null;#H=null;#j=null;#$=null;#G=new tO;#V=null;#W=null;#X=null;#q=0;#K=new Set;#Y=null;#J=null;#Q=new Set;_editorUndoBar=null;#Z=!1;#tt=!1;#te=!1;#ti=null;#tr=null;#ts=null;#tn=null;#ta=!1;#to=null;#tl=new tF;#th=!1;#td=!1;#tc=!1;#tu=null;#tp=null;#tg=null;#tm=null;#tf=null;#tb=g.NONE;#tv=new Set;#ty=null;#tA=null;#tx=null;#tw=null;#t_=null;#tS={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#tT=[0,0];#tE=null;#tC=null;#tM=null;#tP=null;#tk=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=tz.prototype,e=t=>t.#tC.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>{if(e instanceof HTMLInputElement){let{type:t}=e;return"text"!==t&&"number"!==t}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return k(this,"_keyboardManager",new tN([[["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.#tC.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#tC.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,r,s,n,a,o,l,h,d,c,u,p,g,m){const f=this._signal=this.#F.signal;this.#tC=t,this.#tM=e,this.#tP=i,this.#H=r,this.#V=s,this.#tA=n,this.#t_=o,this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:f}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),a._on("setpreference",this.onSetPreference.bind(this),{signal:f}),a._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:f}),window.addEventListener("pointerdown",()=>{this.#td=!0},{capture:!0,signal:f}),window.addEventListener("pointerup",()=>{this.#td=!1},{capture:!0,signal:f}),window.addEventListener("beforeunload",this.#tD.bind(this),{capture:!0,signal:f}),this.#tI(),this.#tR(),this.#tB(),this.#j=o.annotationStorage,this.#ti=o.filterFactory,this.#tx=l,this.#tn=h||null,this.#Z=d,this.#tt=c,this.#te=u,this.#tf=p||null,this.viewParameters={realScale:Z.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==m,s?.setSidebarUiManager(this)}destroy(){for(let t of(this.#tk?.resolve(),this.#tk=null,this.#F?.abort(),this.#F=null,this._signal=null,this.#U.values()))t.destroy();this.#U.clear(),this.#N.clear(),this.#Q.clear(),this.#tm?.clear(),this.#L=null,this.#tv.clear(),this.#G.destroy(),this.#H?.destroy(),this.#V?.destroy(),this.#tA?.destroy(),this.#to?.hide(),this.#to=null,this.#tg?.destroy(),this.#tg=null,this.#O=null,this.#tr&&(clearTimeout(this.#tr),this.#tr=null),this.#tE&&(clearTimeout(this.#tE),this.#tE=null),this._editorUndoBar?.destroy(),this.#t_=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#tf}get useNewAltTextFlow(){return this.#tt}get useNewAltTextWhenAddingImage(){return this.#te}get hcmFilter(){return k(this,"hcmFilter",this.#tx?this.#ti.addHCMFilter(this.#tx.foreground,this.#tx.background):"none")}get direction(){return k(this,"direction",getComputedStyle(this.#tC).direction)}get _highlightColors(){return k(this,"_highlightColors",this.#tn?new Map(this.#tn.split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){let{_highlightColors:t}=this;if(!t)return k(this,"highlightColors",null);let e=new Map,i=!!this.#tx;for(let[r,s]of t){let t=r.endsWith("_HCM");if(i&&t){e.set(r.replace("_HCM",""),s);continue}i||t||e.set(r,s)}return k(this,"highlightColors",e)}get highlightColorNames(){return k(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;let e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#X=t}setMainHighlightColorPicker(t){this.#tg=t}editAltText(t,e=!1){this.#H?.editAltText(this,t,e)}hasCommentManager(){return!!this.#V}editComment(t,e,i,r){this.#V?.showDialog(this,t,e,i,r)}selectComment(t,e){let i=this.#U.get(t),r=i?.getEditorByUID(e);r?.toggleComment(!0,!0)}updateComment(t){this.#V?.updateComment(t.getData())}updatePopupColor(t){this.#V?.updatePopupColor(t)}removeComment(t){this.#V?.removeComments([t.uid])}deleteComment(t,e){let i=()=>{t.comment=e},r=()=>{this._editorUndoBar?.show(i,"comment"),this.toggleComment(null),t.comment=null};this.addCommands({cmd:r,undo:i,mustExec:!0})}toggleComment(t,e,i){this.#V?.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){return t&&this.#V?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#V?.dialogElement||null}async waitForEditorsRendered(t){if(this.#U.has(t-1))return;let{resolve:e,promise:i}=Promise.withResolvers(),r=i=>{i.pageNumber===t&&(this._eventBus._off("editorsrendered",r),e())};this._eventBus.on("editorsrendered",r),await i}getSignature(t){this.#tA?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#tA}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){"enableNewAltTextWhenAddingImage"===t&&(this.#te=e)}onPageChanging({pageNumber:t}){this.#q=t-1}deletePage(t){for(let e of this.getEditors(t))e.remove();this.#U.delete(t),this.#q===t&&(this.#q=0)}focusMainContainer(){this.#tC.focus()}findParent(t,e){for(let i of this.#U.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.#tM.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#Q.add(t)}removeShouldRescale(t){this.#Q.delete(t)}onScaleChanging({scale:t}){for(let e of(this.commitOrRemove(),this.viewParameters.realScale=t*Z.PDF_TO_CSS_UNITS,this.#Q))e.onScaleChanging();this.#X?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#tF({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#tL(t){let{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(let e of this.#U.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t="",e=!1){let i=document.getSelection();if(!i||i.isCollapsed)return;let{anchorNode:r,anchorOffset:s,focusNode:n,focusOffset:a}=i,o=i.toString(),l=this.#tF(i).closest(".textLayer"),h=this.getSelectionBoxes(l);if(!h)return;i.empty();let d=this.#tL(l),c=this.#tb===g.NONE,u=()=>{let i=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:r,anchorOffset:s,focusNode:n,focusOffset:a,text:o});c&&this.showAllEditors("highlight",!0,!0),e&&i?.editComment()};c?this.switchToMode(g.HIGHLIGHT,u):u()}commentSelection(t=""){this.highlightSelection(t,!0)}#tD(t){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#tO(){let t=document.getSelection();if(!t||t.isCollapsed)return;let e=this.#tF(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#to||=new tI(this),this.#to.show(e,i,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#j)return null;let e=`${p}${t}`,i=this.#j.getRawValue(e);return i&&this.#j.remove(e),i}addToAnnotationStorage(t){t.isEmpty()||!this.#j||this.#j.has(t.id)||this.#j.setValue(t.id,t)}a11yAlert(t,e=null){let i=this.#tP;i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}#tN(){let t=document.getSelection();if(!t||t.isCollapsed){this.#ty&&(this.#to?.hide(),this.#ty=null,this.#tU({hasSelectedText:!1}));return}let{anchorNode:e}=t;if(e===this.#ty)return;let i=this.#tF(t).closest(".textLayer");if(!i){this.#ty&&(this.#to?.hide(),this.#ty=null,this.#tU({hasSelectedText:!1}));return}if(this.#to?.hide(),this.#ty=e,this.#tU({hasSelectedText:!0}),(this.#tb===g.HIGHLIGHT||this.#tb===g.NONE)&&(this.#tb===g.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#ta=this.isShiftKeyDown,!this.isShiftKeyDown)){let t=this.#tb===g.HIGHLIGHT?this.#tL(i):null;if(t?.toggleDrawing(),this.#td){let e=new AbortController,i=this.combinedSignal(e),r=i=>{("pointerup"!==i.type||0===i.button)&&(e.abort(),t?.toggleDrawing(!0),"pointerup"===i.type&&this.#tz("main_toolbar"))};window.addEventListener("pointerup",r,{signal:i}),window.addEventListener("blur",r,{signal:i})}else t?.toggleDrawing(!0),this.#tz("main_toolbar")}}#tz(t=""){this.#tb===g.HIGHLIGHT?this.highlightSelection(t):this.#Z&&this.#tO()}#tI(){document.addEventListener("selectionchange",this.#tN.bind(this),{signal:this._signal})}#tH(){if(this.#ts)return;this.#ts=new AbortController;let t=this.combinedSignal(this.#ts);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#tj(){this.#ts?.abort(),this.#ts=null}blur(){if(this.isShiftKeyDown=!1,this.#ta&&(this.#ta=!1,this.#tz("main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let e of this.#tv)if(e.div.contains(t)){this.#tp=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#tp)return;let[t,e]=this.#tp;this.#tp=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#tB(){if(this.#tu)return;this.#tu=new AbortController;let t=this.combinedSignal(this.#tu);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#t$(){this.#tu?.abort(),this.#tu=null}#tG(){if(this.#W)return;this.#W=new AbortController;let t=this.combinedSignal(this.#W);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#tV(){this.#W?.abort(),this.#W=null}#tR(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#tB(),this.setEditingState(!0)}removeEditListeners(){this.#t$(),this.setEditingState(!1)}dragOver(t){for(let{type:e}of t.dataTransfer.items)for(let i of this.#J)if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let e of t.dataTransfer.items)for(let i of this.#J)if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#L?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let t of this.#tv){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()}async paste(t){t.preventDefault();let{clipboardData:e}=t;for(let t of e.items)for(let e of this.#J)if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){S(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();let r=this.currentLayer;try{let t=[];for(let e of i){let i=await r.deserialize(e);if(!i)return;t.push(i)}let e=()=>{for(let e of t)this.#tW(e);this.#tX(t)};this.addCommands({cmd:e,undo:()=>{for(let e of t)e.remove()},mustExec:!0})}catch(t){S(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#tb===g.NONE||this.isEditorHandlingKeyboard||tz._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#ta&&(this.#ta=!1,this.#tz("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}updatePageIndex(t,e){for(let i of this.getEditors(t))i.pageIndex=e;let i=this.#z.get(t);i&&(i.pageIndex=e,this.#U.set(e,i),this.#th?i.enable():i.disable())}startUpdatePages(){this.#z=new Map(this.#U),this.#U.clear()}endUpdatePages(){this.#z=null}clonePage(t,e){for(let i of this.getEditors(t)){let t=i.serialize(i.mode!==g.HIGHLIGHT);t&&(t.pageIndex=e,t.id=this.getId(),t.isClone=!0,delete t.popupRef,this.#j.setValue(t.id,t))}}findClonesForPage(t){let e=[],{pageIndex:i}=t;for(let[r,s]of this.#j)s.pageIndex===i&&s.isClone&&(this.#j.remove(r),e.push(t.deserialize(s).then(e=>{e&&(e.isClone=!0,t.addOrRebuild(e))})));return Promise.all(e)}#tU(t){Object.entries(t).some(([t,e])=>this.#tS[t]!==e)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#tS,t)}),this.#tb===g.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#tq([[m.HIGHLIGHT_FREE,!0]]))}#tq(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#tH(),this.#tG(),this.#tU({isEditing:this.#tb!==g.NONE,isEmpty:this.#tK(),hasSomethingToUndo:this.#G.hasSomethingToUndo(),hasSomethingToRedo:this.#G.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#tj(),this.#tV(),this.#tU({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#J)for(let e of(this.#J=t,this.#J))this.#tq(e.defaultPropertiesToUpdate)}getId(){return this.#tl.id}get currentLayer(){return this.#U.get(this.#q)}getLayer(t){return this.#U.get(t)}get currentPageIndex(){return this.#q}addLayer(t){this.#U.set(t.pageIndex,t),this.#th?t.enable():t.disable()}removeLayer(t){this.#U.delete(t.pageIndex)}async updateMode(t,e=null,i=!1,r=!1,s=!1,n=!1){if(this.#tb!==t&&(!this.#tk||(await this.#tk.promise,this.#tk))){if(this.#tk=Promise.withResolvers(),this.#X?.commitOrRemove(),this.#tb===g.POPUP&&this.#V?.hideSidebar(),this.#V?.destroyPopup(),this.#tb=t,t===g.NONE){for(let t of(this.setEditingState(!1),this.#tY(),this.#N.values()))t.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#tk.resolve();return}for(let t of this.#N.values())t.addStandaloneCommentButton();for(let e of(t===g.SIGNATURE&&await this.#tA?.loadSignatures(),i&&tB.clearPointerType(),this.setEditingState(!0),await this.#tJ(),this.unselectAll(),this.#U.values()))e.updateMode(t);if(t===g.POPUP){this.#O||=await this.#t_.getAnnotationsByType(new Set(this.#J.map(t=>t._editorType)));let t=new Set,e=[];for(let i of this.#N.values()){let{annotationElementId:r,hasComment:s,deleted:n}=i;r&&t.add(r),s&&!n&&e.push(i.getData())}for(let i of this.#O){let{id:r,popupRef:s,contentsObj:n}=i;s&&n?.str&&!t.has(r)&&!this.#K.has(r)&&e.push(i)}this.#V?.showSidebar(e)}if(!e){r&&this.addNewEditorFromKeyboard(),this.#tk.resolve();return}for(let t of this.#N.values())t.uid===e?(this.setSelected(t),n?t.editComment():s?t.enterInEditMode():t.focus()):t.unselect();this.#tk.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#tb&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#J){switch(t){case m.CREATE:this.currentLayer.addNewEditor(e);return;case m.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#tw||=new Map).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(let i of this.#tv)i.updateParams(t,e);else for(let i of this.#J)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(let i of this.#N.values())i.editorType===t&&i.show(e);(this.#tw?.get(m.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#tq([[m.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#tc!==t)for(let e of(this.#tc=t,this.#U.values()))t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}async #tJ(){if(!this.#th){this.#th=!0;let t=[];for(let e of this.#U.values())t.push(e.enable());for(let e of(await Promise.all(t),this.#N.values()))e.enable()}}#tY(){if(this.unselectAll(),this.#th){for(let t of(this.#th=!1,this.#U.values()))t.disable();for(let t of this.#N.values())t.disable()}}*getEditors(t){for(let e of this.#N.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#N.get(t)}addEditor(t){this.#N.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#tr&&clearTimeout(this.#tr),this.#tr=setTimeout(()=>{this.focusMainContainer(),this.#tr=null},0)),this.#N.delete(t.id),t.annotationElementId&&this.#tm?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#K.has(t.annotationElementId)||this.#j?.remove(t.id)}addDeletedAnnotationElement(t){this.#K.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#K.has(t)}removeDeletedAnnotationElement(t){this.#K.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#tW(t){let e=this.#U.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#L!==t&&(this.#L=t,t&&this.#tq(t.propertiesToUpdate))}get #tQ(){let t=null;for(t of this.#tv);return t}updateUI(t){this.#tQ===t&&this.#tq(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#tq(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#tv.has(t)){this.#tv.delete(t),t.unselect(),this.#tU({hasSelectedEditor:this.hasSelection});return}this.#tv.add(t),t.select(),this.#tq(t.propertiesToUpdate),this.#tU({hasSelectedEditor:!0})}setSelected(t){for(let e of(this.updateToolbar({mode:t.mode,editId:t.uid}),this.#X?.commitOrRemove(),this.#tv))e!==t&&e.unselect();this.#V?.destroyPopup(),this.#tv.clear(),this.#tv.add(t),t.select(),this.#tq(t.propertiesToUpdate),this.#tU({hasSelectedEditor:!0})}isSelected(t){return this.#tv.has(t)}get firstSelectedEditor(){return this.#tv.values().next().value}unselect(t){t.unselect(),this.#tv.delete(t),this.#tU({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#tv.size}get isEnterHandled(){return 1===this.#tv.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#G.undo(),this.#tU({hasSomethingToUndo:this.#G.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#tK()}),this._editorUndoBar?.hide()}redo(){this.#G.redo(),this.#tU({hasSomethingToUndo:!0,hasSomethingToRedo:this.#G.hasSomethingToRedo(),isEmpty:this.#tK()})}addCommands(t){this.#G.add(t),this.#tU({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#tK()})}cleanUndoStack(t){this.#G.cleanType(t)}#tK(){if(0===this.#N.size)return!0;if(1===this.#N.size)for(let t of this.#N.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();let t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;let e=t?[t]:[...this.#tv],i=()=>{for(let t of(this._editorUndoBar?.show(r,1===e.length?e[0].editorType:e.length),e))t.remove()},r=()=>{for(let t of e)this.#tW(t)};this.addCommands({cmd:i,undo:r,mustExec:!0})}commitOrRemove(){this.#L?.commitOrRemove()}hasSomethingToControl(){return this.#L||this.hasSelection}#tX(t){for(let t of this.#tv)t.unselect();for(let e of(this.#tv.clear(),t))e.isEmpty()||(this.#tv.add(e),e.select());this.#tU({hasSelectedEditor:this.hasSelection})}selectAll(){for(let t of this.#tv)t.commit();this.#tX(this.#N.values())}unselectAll(){if(!this.#L||(this.#L.commitOrRemove(),this.#tb===g.NONE)){if(!this.#X?.commitOrRemove()&&(this.#V?.destroyPopup(),this.hasSelection)){for(let t of this.#tv)t.unselect();this.#tv.clear(),this.#tU({hasSelectedEditor:!1})}}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#tT[0]+=t,this.#tT[1]+=e;let[r,s]=this.#tT,n=[...this.#tv];for(let i of(this.#tE&&clearTimeout(this.#tE),this.#tE=setTimeout(()=>{this.#tE=null,this.#tT[0]=this.#tT[1]=0,this.addCommands({cmd:()=>{for(let t of n)this.#N.has(t.id)&&(t.translateInPage(r,s),t.translationDone())},undo:()=>{for(let t of n)this.#N.has(t.id)&&(t.translateInPage(-r,-s),t.translationDone())},mustExec:!1})},1e3),n))i.translateInPage(t,e),i.translationDone()}setUpDragSession(){if(this.hasSelection)for(let t of(this.disableUserSelect(!0),this.#Y=new Map,this.#tv))this.#Y.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#Y)return!1;this.disableUserSelect(!1);let t=this.#Y;this.#Y=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.#N.has(t.id)){let s=this.#U.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.#Y)for(let i of this.#Y.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.#tv.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#L===t}getActive(){return this.#L}getMode(){return this.#tb}isEditingMode(){return this.#tb!==g.NONE}get imageManager(){return k(this,"imageManager",new tL)}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.#$||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#$?.delete(t)}renderAnnotationElement(t){let e=this.#$?.get(t.data.id);if(!e)return;let i=this.#j.getRawValue(e);!i||(this.#tb!==g.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}setMissingCanvas(t,e,i){let r=this.#tm?.get(t);r&&(r.setCanvas(e,i),this.#tm.delete(t))}addMissingCanvas(t,e){(this.#tm||=new Map).set(t,e)}}class tH{#l=null;#tZ=!1;#t0=null;#t1=null;#t2=null;#t5=null;#t3=!1;#t6=null;#a=null;#t4=null;#t9=null;#t8=!1;static #t7=null;static _l10n=null;constructor(t){this.#a=t,this.#t8=t._uiManager.useNewAltTextFlow,tH.#t7||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){tH._l10n??=t}async render(){let t=this.#t0=document.createElement("button");t.className="altText",t.tabIndex="0";let e=this.#t1=document.createElement("span");t.append(e),this.#t8?(t.classList.add("new"),t.setAttribute("data-l10n-id",tH.#t7.missing),e.setAttribute("data-l10n-id",tH.#t7["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let i=this.#a._uiManager._signal;t.addEventListener("contextmenu",th,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});let r=t=>{t.preventDefault(),this.#a._uiManager.editAltText(this.#a),this.#t8&&this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#et}})};return t.addEventListener("click",r,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#t3=!0,r(e))},{signal:i}),await this.#ee(),t}get #et(){return this.#l&&"added"||null===this.#l&&this.guessedText&&"review"||"missing"}finish(){this.#t0&&(this.#t0.focus({focusVisible:this.#t3}),this.#t3=!1)}isEmpty(){return this.#t8?null===this.#l:!this.#l&&!this.#tZ}hasData(){return this.#t8?null!==this.#l||!!this.#t4:this.isEmpty()}get guessedText(){return this.#t4}async setGuessedText(t){null===this.#l&&(this.#t4=t,this.#t9=await tH._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#ee())}toggleAltTextBadge(t=!1){if(!this.#t8||this.#l){this.#t6?.remove(),this.#t6=null;return}if(!this.#t6){let t=this.#t6=document.createElement("div");t.className="noAltTextBadge",this.#a.div.append(t)}this.#t6.classList.toggle("hidden",!t)}serialize(t){let e=this.#l;return t||this.#t4!==e||(e=this.#t9),{altText:e,decorative:this.#tZ,guessedText:this.#t4,textWithDisclaimer:this.#t9}}get data(){return{altText:this.#l,decorative:this.#tZ}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:r,cancel:s=!1}){i&&(this.#t4=i,this.#t9=r),(this.#l!==t||this.#tZ!==e)&&(s||(this.#l=t,this.#tZ=e),this.#ee())}toggle(t=!1){this.#t0&&(!t&&this.#t5&&(clearTimeout(this.#t5),this.#t5=null),this.#t0.disabled=!t)}shown(){this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#et}})}destroy(){this.#t0?.remove(),this.#t0=null,this.#t1=null,this.#t2=null,this.#t6?.remove(),this.#t6=null}async #ee(){let t=this.#t0;if(!t)return;if(this.#t8){if(t.classList.toggle("done",!!this.#l),t.setAttribute("data-l10n-id",tH.#t7[this.#et]),this.#t1?.setAttribute("data-l10n-id",tH.#t7[`${this.#et}-label`]),!this.#l)return void this.#t2?.remove()}else{if(!this.#l&&!this.#tZ){t.classList.remove("done"),this.#t2?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#t2;if(!e){this.#t2=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#a.id}`;let i=this.#a._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(this.#t5),this.#t5=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#t5=setTimeout(()=>{this.#t5=null,this.#t2.classList.add("show"),this.#a._reportTelemetry({action:"alt_text_tooltip"})},100)},{signal:i}),t.addEventListener("mouseleave",()=>{this.#t5&&(clearTimeout(this.#t5),this.#t5=null),this.#t2?.classList.remove("show")},{signal:i})}this.#tZ?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#l),e.parentNode||t.append(e);let i=this.#a.getElementForAltText();i?.setAttribute("aria-describedby",e.id)}}class tj{#ei=null;#er=null;#es=!1;#a=null;#en=null;#ea=null;#eo=null;#el=null;#eh=!1;#ed=null;constructor(t){this.#a=t}renderForToolbar(){let t=this.#er=document.createElement("button");return t.className="comment",this.#y(t,!1)}renderForStandalone(){let t=this.#ei=document.createElement("button");t.className="annotationCommentButton";let e=this.#a.commentButtonPosition;if(e){let{style:i}=t;i.insetInlineEnd=`calc(${100*("ltr"===this.#a._uiManager.direction?1-e[0]:e[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;let r=this.#a.commentButtonColor;r&&(i.backgroundColor=r)}return this.#y(t,!0)}focusButton(){setTimeout(()=>{(this.#ei??this.#er)?.focus()},0)}onUpdatedColor(){if(!this.#ei)return;let t=this.#a.commentButtonColor;t&&(this.#ei.style.backgroundColor=t),this.#a._uiManager.updatePopupColor(this.#a)}get commentButtonWidth(){return(this.#ei?.getBoundingClientRect().width??0)/this.#a.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#ed)return this.#ed;if(!this.#ei)return null;let{x:t,y:e,height:i}=this.#ei.getBoundingClientRect(),{x:r,y:s,width:n,height:a}=this.#a.parent.boundingClientRect;return[(t-r)/n,(e+i-s)/a]}set commentPopupPositionInLayer(t){this.#ed=t}hasDefaultPopupPosition(){return null===this.#ed}removeStandaloneCommentButton(){this.#ei?.remove(),this.#ei=null}removeToolbarCommentButton(){this.#er?.remove(),this.#er=null}setCommentButtonStates({selected:t,hasPopup:e}){this.#ei&&(this.#ei.classList.toggle("selected",t),this.#ei.ariaExpanded=e)}#y(t,e){if(!this.#a._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#a._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let i=this.#a._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",th,{signal:i}),e&&(t.addEventListener("focusin",t=>{this.#a._focusEventsAllowed=!1,td(t)},{capture:!0,signal:i}),t.addEventListener("focusout",t=>{this.#a._focusEventsAllowed=!0,td(t)},{capture:!0,signal:i})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});let r=e=>{e.preventDefault(),t===this.#er?this.edit():this.#a.toggleComment(!0)};return t.addEventListener("click",r,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#es=!0,r(e))},{signal:i}),t.addEventListener("pointerenter",()=>{this.#a.toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{this.#a.toggleComment(!1,!1)},{signal:i}),t}edit(t){let e,i,r=this.commentPopupPositionInLayer;if(r)[e,i]=r;else{[e,i]=this.#a.commentButtonPosition;let{width:t,height:r,x:s,y:n}=this.#a;e=s+e*t,i=n+i*r}let s=this.#a.parent.boundingClientRect,{x:n,y:a,width:o,height:l}=s;this.#a._uiManager.editComment(this.#a,n+e*o,a+i*l,{...t,parentDimensions:s})}finish(){this.#er&&(this.#er.focus({focusVisible:this.#es}),this.#es=!1)}isDeleted(){return this.#eh||""===this.#eo}isEmpty(){return null===this.#eo}hasBeenEdited(){return this.isDeleted()||this.#eo!==this.#en}serialize(){return this.data}get data(){return{text:this.#eo,richText:this.#ea,date:this.#el,deleted:this.isDeleted()}}set data(t){if(t!==this.#eo&&(this.#ea=null),null===t){this.#eo="",this.#eh=!0;return}this.#eo=t,this.#el=new Date,this.#eh=!1}restoreData({text:t,richText:e,date:i}){this.#eo=t,this.#ea=e,this.#el=i,this.#eh=!1}setInitialText(t,e=null){this.#en=t,this.data=t,this.#el=null,this.#ea=e}shown(){}destroy(){this.#er?.remove(),this.#er=null,this.#ei?.remove(),this.#ei=null,this.#eo="",this.#ea=null,this.#el=null,this.#a=null,this.#es=!1,this.#eh=!1}}class t${#tC;#ec=!1;#eu=null;#ep;#eg;#em;#ef;#eb=null;#ev;#ey=null;#eA;#ex=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:r=null,onPinching:s=null,onPinchEnd:n=null,signal:a}){this.#tC=t,this.#eu=i,this.#ep=e,this.#eg=r,this.#em=s,this.#ef=n,this.#eA=new AbortController,this.#ev=AbortSignal.any([a,this.#eA.signal]),t.addEventListener("touchstart",this.#ew.bind(this),{passive:!1,signal:this.#ev})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/tv.pixelRatio}#ew(t){if(this.#ep?.())return;if(1===t.touches.length){if(this.#eb)return;let t=this.#eb=new AbortController,e=AbortSignal.any([this.#ev,t.signal]),i=this.#tC,r={capture:!0,signal:e,passive:!1},s=t=>{"touch"===t.pointerType&&(this.#eb?.abort(),this.#eb=null)};i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(td(t),s(t))},r),i.addEventListener("pointerup",s,r),i.addEventListener("pointercancel",s,r);return}if(!this.#ex){this.#ex=new AbortController;let t=AbortSignal.any([this.#ev,this.#ex.signal]),e=this.#tC,i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#e_.bind(this),i);let r=this.#eS.bind(this);e.addEventListener("touchend",r,i),e.addEventListener("touchcancel",r,i),i.capture=!0,e.addEventListener("pointerdown",td,i),e.addEventListener("pointermove",td,i),e.addEventListener("pointercancel",td,i),e.addEventListener("pointerup",td,i),this.#eg?.()}if(td(t),2!==t.touches.length||this.#eu?.()){this.#ey=null;return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),this.#ey={touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#e_(t){if(!this.#ey||2!==t.touches.length)return;td(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);let{screenX:r,screenY:s}=e,{screenX:n,screenY:a}=i,o=this.#ey,{touch0X:l,touch0Y:h,touch1X:d,touch1Y:c}=o,u=Math.hypot(n-r,a-s)||1,p=Math.hypot(d-l,c-h)||1;if(!this.#ec&&Math.abs(p-u)<=t$.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=r,o.touch0Y=s,o.touch1X=n,o.touch1Y=a,!this.#ec){this.#ec=!0;return}let g=[(r+n)/2,(s+a)/2];this.#em?.(g,p,u)}#eS(t){t.touches.length>=2||(this.#ex&&(this.#ex.abort(),this.#ex=null,this.#ef?.()),this.#ey&&(td(t),this.#ey=null,this.#ec=!1))}destroy(){this.#eA?.abort(),this.#eA=null,this.#eb?.abort(),this.#eb=null}}class tG{#eT=null;#eE=null;#l=null;#h=null;#ei=null;#eC=!1;#eM=null;#eP="";#ek=null;#eD=null;#eI=null;#eR=null;#eB=null;#eF="";#eL=!1;#eO=null;#eN=!1;#eU=!1;#ez=!1;#eH=null;#ej=0;#e$=0;#eG=null;#eV=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#eW=!1;#eX=tG._zIndex++;static _borderLineWidth=-1;static _colorManager=new tU;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=tG.prototype._resizeWithKeyboard,e=tz.TRANSLATE_SMALL,i=tz.TRANSLATE_BIG;return k(this,"_resizerKeyboardManager",new tN([[["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"],tG.prototype._stopResizingWithKeyboard]]))}constructor(t){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,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:n}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,n];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return k(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new tV({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(tG._l10n??=t,tG._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==tG._borderLineWidth)return;let i=getComputedStyle(document.documentElement);tG._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){T("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#eW}set _isDraggable(t){this.#eW=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}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}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#eX}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#eq(),this.#eR?.remove(),this.#eR=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#eL?this.#eL=!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.isInEditMode()&&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()}_moveAfterPaste(t,e){if(this.isClone)return void delete this.isClone;let[i,r]=this.parentDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r),this._onTranslated()}#eK([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#eK(this.parentDimensions,t,e)}translateInPage(t,e){this.#eO||=[this.x,this.y,this.width,this.height],this.#eK(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#eO||=[this.x,this.y,this.width,this.height];let{div:i,parentDimensions:[r,s]}=this;if(this.x+=t/r,this.y+=e/s,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:n,y:a}=this,[o,l]=this.getBaseTranslation();n+=o,a+=l;let{style:h}=i;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*a).toFixed(2)}%`,this._onTranslating(n,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#eO&&(this.#eO[0]!==this.x||this.#eO[1]!==this.y)}get _hasBeenResized(){return!!this.#eO&&(this.#eO[2]!==this.width||this.#eO[3]!==this.height)}getBaseTranslation(){let[t,e]=this.parentDimensions,{_borderLineWidth:i}=tG,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{div:{style:e},pageDimensions:[i,r]}=this,{x:s,y:n,width:a,height:o}=this;if(a*=i,o*=r,s*=i,n*=r,this._mustFixPosition)switch(t){case 0:s=K(s,0,i-a),n=K(n,0,r-o);break;case 90:s=K(s,0,i-o),n=K(n,a,r);break;case 180:s=K(s,a,i),n=K(n,o,r);break;case 270:s=K(s,o,i),n=K(n,0,r-a)}this.x=s/=i,this.y=n/=r;let[l,h]=this.getBaseTranslation();s+=l,n+=h,e.left=`${(100*s).toFixed(2)}%`,e.top=`${(100*n).toFixed(2)}%`,this.moveInDOM()}static #eY(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 tG.#eY(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return tG.#eY(t,e,360-this.parentRotation)}#eJ(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;return[e*t,i*t]}setDims(){let{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#eQ(){if(this.#ek)return;this.#ek=document.createElement("div"),this.#ek.classList.add("resizers");let t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(let i of t){let t=document.createElement("div");this.#ek.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#eZ.bind(this,i),{signal:e}),t.addEventListener("contextmenu",th,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#ek)}#eZ(t,e){e.preventDefault();let{isMac:i}=U.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#l?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#eD=[e.screenX,e.screenY];let s=new AbortController,n=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#e0.bind(this,t),{passive:!0,capture:!0,signal:n}),window.addEventListener("touchmove",td,{passive:!1,signal:n}),window.addEventListener("contextmenu",th,{signal:n}),this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let l=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#l?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#e1()};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})}#e2(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#e1(){if(!this.#eI)return;let{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=this.#eI;this.#eI=null;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.#e2.bind(this,s,n,a,o),undo:this.#e2.bind(this,t,e,i,r),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#e0(t,e){let i,r,s,n,a,o,[l,h]=this.parentDimensions,d=this.x,c=this.y,u=this.width,p=this.height,g=tG.MIN_SIZE/l,m=tG.MIN_SIZE/h,f=this.#eJ(this.rotation),b=(t,e)=>[f[0]*t+f[2]*e,f[1]*t+f[3]*e],v=this.#eJ(360-this.rotation),y=!1,A=!1;switch(t){case"topLeft":y=!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":y=!0,i=(t,e)=>[t,0],r=(t,e)=>[0,e];break;case"middleRight":A=!0,i=(t,e)=>[t,e/2],r=(t,e)=>[0,e/2];break;case"bottomRight":y=!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":y=!0,i=(t,e)=>[0,e],r=(t,e)=>[t,0];break;case"middleLeft":A=!0,i=(t,e)=>[0,e/2],r=(t,e)=>[t,e/2]}let x=i(u,p),w=r(u,p),_=b(...w),S=tG._round(d+_[0]),T=tG._round(c+_[1]),E=1,C=1;if(e.fromKeyboard)({deltaX:s,deltaY:n}=e);else{let{screenX:t,screenY:i}=e,[r,a]=this.#eD;[s,n]=this.screenToPageTranslation(t-r,i-a),this.#eD[0]=t,this.#eD[1]=i}if([s,n]=(a=s/l,o=n/h,[v[0]*a+v[2]*o,v[1]*a+v[3]*o]),y){let t=Math.hypot(u,p);E=C=Math.max(Math.min(Math.hypot(w[0]-x[0]-s,w[1]-x[1]-n)/t,1/u,1/p),g/u,m/p)}else A?E=K(Math.abs(w[0]-x[0]-s),g,1)/u:C=K(Math.abs(w[1]-x[1]-n),m,1)/p;let M=tG._round(u*E),P=tG._round(p*C),k=S-(_=b(...r(M,P)))[0],D=T-_[1];this.#eO||=[this.x,this.y,this.width,this.height],this.width=M,this.height=P,this.x=k,this.y=D,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#l?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#eU)return this._editToolbar;this._editToolbar=new tD(this),this.div.append(this._editToolbar.render());let{toolbarButtons:t}=this;if(t)for(let[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#l?.destroy()}addContainer(t){let e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return!this.#l&&(tH.initialize(tG._l10n),this.#l=new tH(this),this.#eT&&(this.#l.data=this.#eT,this.#eT=null)),this.#l}get altTextData(){return this.#l?.data}set altTextData(t){this.#l&&(this.#l.data=t)}get guessedAltText(){return this.#l?.guessedText}async setGuessedAltText(t){await this.#l?.setGuessedText(t)}serializeAltText(t){return this.#l?.serialize(t)}hasAltText(){return!!this.#l&&!this.#l.isEmpty()}hasAltTextData(){return this.#l?.hasData()??!1}focusCommentButton(){this.#h?.focusButton()}addCommentButton(){return this.canAddComment?this.#h||=new tj(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#ei){this._uiManager.isEditingMode()&&this.#ei.classList.remove("hidden");return}this.hasComment&&(this.#ei=this.#h.renderForStandalone(),this.div.append(this.#ei))}}removeStandaloneCommentButton(){this.#h.removeStandaloneCommentButton(),this.#ei=null}hideStandaloneCommentButton(){this.#ei?.classList.add("hidden")}get comment(){if(!this.#h)return null;let{data:{richText:t,text:e,date:i,deleted:r}}=this.#h;return{text:e,richText:t,date:i,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#h||=new tj(this),"object"==typeof t&&null!==t?this.#h.restoreData(t):this.#h.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:i}){if(!e||(this.#h||=new tj(this),this.#h.setInitialText(t,i),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#h?.hasBeenEdited()}get hasDeletedComment(){return this.#h?.isDeleted()}get hasComment(){return!!this.#h&&!this.#h.isEmpty()&&!this.#h.isDeleted()}async editComment(t){this.#h||=new tj(this),this.#h.edit(t)}toggleComment(t,e){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#h.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){let[,,,e]=t.rect,[i]=this.pageDimensions,[r]=this.pageTranslation,s=r+i+1;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[s,e-100,s+180,e]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#h.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#eC?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#e5();let[e,i]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*i/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/i).toFixed(2)}%`);let[r,s]=this.getInitialTranslation();return this.translate(r,s),tR(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#eV||=new t$({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#e3.bind(this),onPinching:this.#e6.bind(this),onPinchEnd:this.#e4.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#e3(){this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#l?.toggle(!1),this.parent.togglePointerEvents(!1)}#e6(t,e,i){let r=i/e*.7+1-.7;if(1===r)return;let s=this.#eJ(this.rotation),n=(t,e)=>[s[0]*t+s[2]*e,s[1]*t+s[3]*e],[a,o]=this.parentDimensions,l=this.x,h=this.y,d=this.width,c=this.height;r=Math.max(Math.min(r,1/d,1/c),tG.MIN_SIZE/a/d,tG.MIN_SIZE/o/c);let u=tG._round(d*r),p=tG._round(c*r);if(u===d&&p===c)return;this.#eO||=[l,h,d,c];let g=n(d/2,c/2),m=tG._round(l+g[0]),f=tG._round(h+g[1]),b=n(u/2,p/2);this.x=m-b[0],this.y=f-b[1],this.width=u,this.height=p,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#e4(){this.#l?.toggle(!0),this.parent.togglePointerEvents(!0),this.#e1()}pointerdown(t){let{isMac:e}=U.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#eL=!0,this._isDraggable)?this.#e9(t):this.#e8(t)}#e8(t){let{isMac:e}=U.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#e9(t){let{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1,r=new AbortController,s=this._uiManager.combinedSignal(r),n={capture:!0,passive:!1,signal:s},a=t=>{r.abort(),this.#eM=null,this.#eL=!1,this._uiManager.endDragSession()||this.#e8(t),i&&this._onStopDragging()};e&&(this.#ej=t.clientX,this.#e$=t.clientY,this.#eM=t.pointerId,this.#eP=t.pointerType,window.addEventListener("pointermove",t=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:e,clientY:r,pointerId:s}=t;if(s!==this.#eM)return void td(t);let[n,a]=this.screenToPageTranslation(e-this.#ej,r-this.#e$);this.#ej=e,this.#e$=r,this._uiManager.dragSelectedEditors(n,a)},n),window.addEventListener("touchmove",td,n),window.addEventListener("pointerdown",t=>{t.pointerType===this.#eP&&(this.#eV||t.isPrimary)&&a(t),td(t)},n));let o=t=>{this.#eM&&this.#eM!==t.pointerId?td(t):a(t)};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#eH&&clearTimeout(this.#eH),this.#eH=setTimeout(()=>{this.#eH=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}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")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&tG._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#h?.onUpdatedColor()}getData(){let{comment:{text:t,color:e,date:i,opacity:r,deleted:s,richText:n},uid:a,pageIndex:o,creationDate:l,modificationDate:h}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:n,contentsObj:{str:t},creationDate:l,modificationDate:i||h,popupRef:!s,color:e,opacity:r}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#eU=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#eU=!1,!0)}isInEditMode(){return this.#eU}shouldGetKeyboardEvents(){return this.#ez}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:t,left:e,bottom:i,right:r}=this.getClientDimensions(),{innerHeight:s,innerWidth:n}=window;return e<n&&r>0&&t<s&&i>0}#e5(){if(this.#eB||!this.div)return;this.#eB=new AbortController;let t=this._uiManager.combinedSignal(this.#eB);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#e5()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,i){let r=new this.prototype.constructor({parent:e,id:i.getId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});r.rotation=t.rotation,r.#eT=t.accessibilityData,r._isCopy=t.isCopy||!1;let[s,n]=r.pageDimensions,[a,o,l,h]=r.getRectInCurrentCoords(t.rect,n);return 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.#eB?.abort(),this.#eB=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#eH&&(clearTimeout(this.#eH),this.#eH=null),this.#eq(),this.removeEditToolbar(),this.#eG){for(let t of this.#eG.values())clearTimeout(t);this.#eG=null}this.parent=null,this.#eV?.destroy(),this.#eV=null,this.#eR?.remove(),this.#eR=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#eQ(),this.#ek.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,e]}=this,[i,r,s,n]=this.getPDFRect();return[tG._round(i+(s-i)*t),tG._round(r+(n-r)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#h.commentPopupPositionInLayer}set commentPopupPosition(t){this.#h.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#h.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#h.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#h?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let e=this.#ek.children;if(!this.#eE){this.#eE=Array.from(e);let t=this.#e7.bind(this),i=this.#it.bind(this),r=this._uiManager._signal;for(let e of this.#eE){let s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:r}),e.addEventListener("blur",i,{signal:r}),e.addEventListener("focus",this.#ie.bind(this,s),{signal:r}),e.setAttribute("data-l10n-id",tG._l10nResizer[s])}}let i=this.#eE[0],r=0;for(let t of e){if(t===i)break;r++}let s=(360-this.rotation+this.parentRotation)%360/90*(this.#eE.length/4);if(s!==r){if(s<r)for(let t=0;t<r-s;t++)this.#ek.append(this.#ek.firstElementChild);else if(s>r)for(let t=0;t<s-r;t++)this.#ek.firstElementChild.before(this.#ek.lastElementChild);let t=0;for(let i of e){let e=this.#eE[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",tG._l10nResizer[e])}}this.#ii(0),this.#ez=!0,this.#ek.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#e7(t){tG._resizerKeyboardManager.exec(this,t)}#it(t){this.#ez&&t.relatedTarget?.parentNode!==this.#ek&&this.#eq()}#ie(t){this.#eF=this.#ez?t:""}#ii(t){if(this.#eE)for(let e of this.#eE)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#ez&&this.#e0(this.#eF,{deltaX:t,deltaY:e,fromKeyboard:!0})}#eq(){this.#ez=!1,this.#ii(-1),this.#e1()}_stopResizingWithKeyboard(){this.#eq(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar)?(this._editToolbar?.show(),this.#l?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#ek?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#l?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#eN}set isEditing(t){this.#eN=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#eG||=new Map;let{action:e}=t,i=this.#eG.get(e);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#eG.delete(e),0===this.#eG.size&&(this.#eG=null)},tG._telemetryTimeout),this.#eG.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.#eC=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#eC=!0}updateFakeAnnotationElement(t){if(!this.#eR&&!this.deleted){this.#eR=t.addFakeAnnotation(this);return}if(this.deleted){this.#eR.remove(),this.#eR=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#eR.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;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{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}}class tV extends tG{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}class tW{constructor(t){this.h1=t?0|t:0xc3d2e1f0,this.h2=t?0|t:0xc3d2e1f0}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?(l^=a=0x1b873593*(a=(a=0xcc9e2d51*(a=n[t])&0xffff0000|11601*a&65535)<<15|a>>>17)&0xffff0000|13715*a&65535,l=5*(l=l<<13|l>>>19)+0xe6546b64):(h^=o=0x1b873593*(o=(o=0xcc9e2d51*(o=n[t])&0xffff0000|11601*o&65535)<<15|o>>>17)&0xffff0000|13715*o&65535,h=5*(h=h<<13|h>>>19)+0xe6546b64);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=0x1b873593*(a=(a=0xcc9e2d51*a&0xffff0000|11601*a&65535)<<15|a>>>17)&0xffff0000|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,e=0xff51afd7*e&0xffff0000|((e<<16|(t=0xed558ccd*t&0xffff0000|36045*t&65535)>>>16)*0xafd7ed55&0xffff0000)>>>16,t^=e>>>1,e=0xc4ceb9fe*e&0xffff0000|((e<<16|(t=0x1a85ec53*t&0xffff0000|60499*t&65535)>>>16)*0xb9fe1a85&0xffff0000)>>>16,((t^=e>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}let tX=Object.freeze({map:null,hash:"",transfer:void 0});class tq{#ir=!1;#is=null;#ia=null;#io=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(t,e){let i=this.#io.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#io.get(t)}remove(t){let e=this.#io.get(t);void 0===e||(e instanceof tG&&this.#ia.delete(e.annotationElementId),this.#io.delete(t),0===this.#io.size&&this.resetModified(),this.#io.values().some(t=>t instanceof tG)||this.onAnnotationEditor?.(null))}setValue(t,e){let i=this.#io.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.#io.set(t,e);r&&this.#il(),e instanceof tG&&((this.#ia||=new Map).set(e.annotationElementId,e),this.onAnnotationEditor?.(e.constructor._type))}has(t){return this.#io.has(t)}get size(){return this.#io.size}#il(){this.#ir||(this.#ir=!0,this.onSetModified?.())}resetModified(){this.#ir&&(this.#ir=!1,this.onResetModified?.())}get print(){return new tK(this)}get serializable(){if(0===this.#io.size)return tX;let t=new Map,e=new tW,i=[],r=Object.create(null),s=!1;for(let[i,n]of this.#io){let a=n instanceof tG?n.serialize(!1,r):n;n.page&&(n.pageIndex=n.page._pageIndex,delete n.page),a&&(t.set(i,a),e.update(`${i}:${JSON.stringify(a)}`),s||=!!a.bitmap)}if(s)for(let e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:tX}get editorStats(){let t=null,e=new Map,i=0,r=0;for(let s of this.#io.values()){if(!(s instanceof tG)){s.popup&&(s.popup.deleted?r+=1:i+=1);continue}s.isCommentDeleted?r+=1:s.hasEditedComment&&(i+=1);let n=s.telemetryFinalData;if(!n)continue;let{type:a}=n;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||=Object.create(null);let o=t[a]||=new Map;for(let[t,e]of Object.entries(n)){if("type"===t)continue;let i=o.getOrInsertComputed(t,X);i.set(e,(i.get(e)??0)+1)}}if((r>0||i>0)&&((t||=Object.create(null)).comments={deleted:r,edited:i}),!t)return null;for(let[i,r]of e)t[i]=r.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#is=null}updateEditor(t,e){let i=this.#ia?.get(t);return!!i&&(i.updateFromAnnotationLayer(e),!0)}getEditor(t){return this.#ia?.get(t)||null}get modifiedIds(){if(this.#is)return this.#is;let t=[];if(this.#ia)for(let e of this.#ia.values())e.serialize()&&t.push(e.annotationElementId);let e="";if(t.length){let i=new tW;i.update(t.join(",")),e=i.hexdigest()}return this.#is={ids:new Set(t),hash:e}}[Symbol.iterator](){return this.#io.entries()}}class tK extends tq{#ih=tX;constructor(t){super();const{serializable:e}=t;if(e===tX)return;const{map:i,hash:r,transfer:s}=e,n=structuredClone(i,s?{transfer:s}:null);this.#ih={map:n,hash:r,transfer:[]}}get print(){T("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#ih}get modifiedIds(){return k(this,"modifiedIds",{ids:new Set,hash:""})}}o(7588);let tY="__forcedDependency",{floor:tJ,ceil:tQ}=Math;function tZ(t,e,i,r,s,n){t[4*e+0]=Math.min(t[4*e+0],i),t[4*e+1]=Math.min(t[4*e+1],r),t[4*e+2]=Math.max(t[4*e+2],s),t[4*e+3]=Math.max(t[4*e+3],n)}let t0=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class t1{#id;#ic;constructor(t,e){this.#id=t,this.#ic=e}get length(){return this.#id.length}isEmpty(t){return this.#id[t]===t0}minX(t){return this.#ic[4*t+0]/256}minY(t){return this.#ic[4*t+1]/256}maxX(t){return(this.#ic[4*t+2]+1)/256}maxY(t){return(this.#ic[4*t+3]+1)/256}}let t2=(t,e)=>t?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class t5{#iu=[[1,0,0,1,0,0]];#ip=[-1/0,-1/0,1/0,1/0];#ig=new Float64Array(h);_pendingBBoxIdx=-1;#im;#ib;#iv;#id;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#im=t.width,this.#ib=t.height,this.#iy(e)}growOperationsCount(t){t>=this.#id.length&&this.#iy(t,this.#id)}#iy(t,e){let i=new ArrayBuffer(4*t);this.#iv=new Uint8ClampedArray(i),this.#id=new Uint32Array(i),e&&e.length>0?(this.#id.set(e),this.#id.fill(t0,e.length)):this.#id.fill(t0)}get clipBox(){return this.#ip}save(t){return this.#ip={__proto__:this.#ip},this._savesStack.push(t),this}restore(t,e){let i=Object.getPrototypeOf(this.#ip);if(null===i)return this;this.#ip=i;let r=this._savesStack.pop();return void 0!==r&&(e?.(r,t),this.#id[t]=this.#id[r]),this}recordOpenMarker(t){return this._savesStack.push(t),this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(t,e){let i=this._savesStack.pop();return void 0!==i&&(e?.(i,t),this.#id[t]=this.#id[i]),this}beginMarkedContent(t){return this._markedContentStack.push(t),this}endMarkedContent(t,e){let i=this._markedContentStack.pop();return void 0!==i&&(e?.(i,t),this.#id[t]=this.#id[i]),this}pushBaseTransform(t){return this.#iu.push(z.multiplyByDOMMatrix(this.#iu.at(-1),t.getTransform())),this}popBaseTransform(){return this.#iu.length>1&&this.#iu.pop(),this}resetBBox(t){return this._pendingBBoxIdx!==t&&(this._pendingBBoxIdx=t,this.#ig.set(h,0)),this}recordClipBox(t,e,i,r,s,n){let a=z.multiplyByDOMMatrix(this.#iu.at(-1),e.getTransform()),o=h.slice();z.axialAlignedBoundingBox([i,s,r,n],a,o);let l=z.intersect(this.#ip,o);return l?(this.#ip[0]=l[0],this.#ip[1]=l[1],this.#ip[2]=l[2],this.#ip[3]=l[3]):(this.#ip[0]=this.#ip[1]=1/0,this.#ip[2]=this.#ip[3]=-1/0),this}recordBBox(t,e,i,r,s,n){let a=this.#ip;if(a[0]===1/0)return this;let o=z.multiplyByDOMMatrix(this.#iu.at(-1),e.getTransform());if(a[0]===-1/0)return z.axialAlignedBoundingBox([i,s,r,n],o,this.#ig),this;let l=h.slice();return z.axialAlignedBoundingBox([i,s,r,n],o,l),this.#ig[0]=K(l[0],a[0],this.#ig[0]),this.#ig[1]=K(l[1],a[1],this.#ig[1]),this.#ig[2]=K(l[2],this.#ig[2],a[2]),this.#ig[3]=K(l[3],this.#ig[3],a[3]),this}recordFullPageBBox(t){return this.#ig[0]=Math.max(0,this.#ip[0]),this.#ig[1]=Math.max(0,this.#ip[1]),this.#ig[2]=Math.min(this.#im,this.#ip[2]),this.#ig[3]=Math.min(this.#ib,this.#ip[3]),this}recordOperation(t,e=!1,i){if(this._pendingBBoxIdx!==t)return this;let r=tJ(256*this.#ig[0]/this.#im),s=tJ(256*this.#ig[1]/this.#ib),n=tQ(256*this.#ig[2]/this.#im),a=tQ(256*this.#ig[3]/this.#ib);if(tZ(this.#iv,t,r,s,n,a),i)for(let e of i)for(let i of e)i!==t&&tZ(this.#iv,i,r,s,n,a);return e||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(t){return this._pendingBBoxIdx===t&&(this._pendingBBoxIdx=-1,this.#ip[0]=Math.max(this.#ip[0],this.#ig[0]),this.#ip[1]=Math.max(this.#ip[1],this.#ig[1]),this.#ip[2]=Math.min(this.#ip[2],this.#ig[2]),this.#ip[3]=Math.min(this.#ip[3],this.#ig[3])),this}take(){return new t1(this.#id,this.#iv)}takeDebugMetadata(){throw Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,i,r=1,s=0,n=0,a){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class t3{#iA={__proto__:null};#ix={__proto__:null,transform:[],moveText:[],sameLineText:[],[tY]:[]};#iw=new Map;#i_=new Set;#iS=new Map;#iT;#iE;#iC;constructor(t,e=!1){this.#iC=t,e&&(this.#iT=new Map,this.#iE=(t,e)=>{t2(this.#iT,e).dependencies.add(t)})}get clipBox(){return this.#iC.clipBox}growOperationsCount(t){this.#iC.growOperationsCount(t)}save(t){return this.#iA={__proto__:this.#iA},this.#ix={__proto__:this.#ix,transform:{__proto__:this.#ix.transform},moveText:{__proto__:this.#ix.moveText},sameLineText:{__proto__:this.#ix.sameLineText},[tY]:{__proto__:this.#ix[tY]}},this.#iC.save(t),this}restore(t){this.#iC.restore(t,this.#iE);let e=Object.getPrototypeOf(this.#iA);return null===e||(this.#iA=e,this.#ix=Object.getPrototypeOf(this.#ix)),this}recordOpenMarker(t){return this.#iC.recordOpenMarker(t,this.#iE),this}getOpenMarker(){return this.#iC.getOpenMarker()}recordCloseMarker(t){return this.#iC.recordCloseMarker(t,this.#iE),this}beginMarkedContent(t){return this.#iC.beginMarkedContent(t),this}endMarkedContent(t){return this.#iC.endMarkedContent(t,this.#iE),this}pushBaseTransform(t){return this.#iC.pushBaseTransform(t),this}popBaseTransform(){return this.#iC.popBaseTransform(),this}recordSimpleData(t,e){return this.#iA[t]=e,this}recordIncrementalData(t,e){return this.#ix[t].push(e),this}resetIncrementalData(t,e){return this.#ix[t].length=0,this}recordNamedData(t,e){return this.#iw.set(t,e),this}recordSimpleDataFromNamed(t,e,i){this.#iA[t]=this.#iw.get(e)??i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(tY,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(let e of t)e in this.#iA&&this.recordFutureForcedDependency(e,this.#iA[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let t of this.#i_)this.recordFutureForcedDependency(tY,t);return this}resetBBox(t){return this.#iC.resetBBox(t),this}recordClipBox(t,e,i,r,s,n){return this.#iC.recordClipBox(t,e,i,r,s,n),this}recordBBox(t,e,i,r,s,n){return this.#iC.recordBBox(t,e,i,r,s,n),this}recordCharacterBBox(t,e,i,r=1,s=0,n=0,a){let o,l,h=i.bbox;if(h&&!1!==(o=h[2]!==h[0]&&h[3]!==h[1]&&this.#iS.get(i))&&(l=[0,0,0,0],z.axialAlignedBoundingBox(h,i.fontMatrix,l),(1!==r||0!==s||0!==n)&&z.scaleMinMax([r,0,0,-r,s,n],l),o))return this.recordBBox(t,e,l[0],l[2],l[1],l[3]);if(!a)return this.recordFullPageBBox(t);let d=a();return h&&l&&void 0===o&&(o=l[0]<=s-d.actualBoundingBoxLeft&&l[2]>=s+d.actualBoundingBoxRight&&l[1]<=n-d.actualBoundingBoxAscent&&l[3]>=n+d.actualBoundingBoxDescent,this.#iS.set(i,o),o)?this.recordBBox(t,e,l[0],l[2],l[1],l[3]):this.recordBBox(t,e,s-d.actualBoundingBoxLeft,s+d.actualBoundingBoxRight,n-d.actualBoundingBoxAscent,n+d.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#iC.recordFullPageBBox(t),this}getSimpleIndex(t){return this.#iA[t]}recordDependencies(t,e){let i=this.#i_,r=this.#iA,s=this.#ix;for(let t of e)t in this.#iA?i.add(r[t]):t in s&&s[t].forEach(i.add,i);return this}recordNamedDependency(t,e){return this.#iw.has(e)&&this.#i_.add(this.#iw.get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[tY]),this.#iT){let e=t2(this.#iT,t),{dependencies:i}=e;this.#i_.forEach(i.add,i),this.#iC._savesStack.forEach(i.add,i),this.#iC._markedContentStack.forEach(i.add,i),i.delete(t),e.isRenderingOperation=!0}let i=!e&&t===this.#iC._pendingBBoxIdx;return this.#iC.recordOperation(t,e,[this.#i_,this.#iC._savesStack,this.#iC._markedContentStack]),i&&this.#i_.clear(),this}recordShowTextOperation(t,e=!1){let i=Array.from(this.#i_);for(let r of(this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t),i))this.recordIncrementalData("sameLineText",r);return this}bboxToClipBoxDropOperation(t,e=!1){let i=!e&&t===this.#iC._pendingBBoxIdx;return this.#iC.bboxToClipBoxDropOperation(t),i&&this.#i_.clear(),this}take(){return this.#iS.clear(),this.#iC.take()}takeDebugMetadata(){return this.#iT}}class t6{#iM;#iP;#ik;#iD=0;#iI=0;constructor(t,e,i){if(t instanceof t6&&!!i===t.#ik)return t;this.#iM=t,this.#iP=e,this.#ik=!!i}get clipBox(){return this.#iM.clipBox}growOperationsCount(){throw Error("Unreachable")}save(t){return this.#iI++,this.#iM.save(this.#iP),this}restore(t){return this.#iI>0&&(this.#iM.restore(this.#iP),this.#iI--),this}recordOpenMarker(t){return this.#iD++,this}getOpenMarker(){return this.#iD>0?this.#iP:this.#iM.getOpenMarker()}recordCloseMarker(t){return this.#iD--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#iM.pushBaseTransform(t),this}popBaseTransform(){return this.#iM.popBaseTransform(),this}recordSimpleData(t,e){return this.#iM.recordSimpleData(t,this.#iP),this}recordIncrementalData(t,e){return this.#iM.recordIncrementalData(t,this.#iP),this}resetIncrementalData(t,e){return this.#iM.resetIncrementalData(t,this.#iP),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this.#iM.recordSimpleDataFromNamed(t,e,this.#iP),this}recordFutureForcedDependency(t,e){return this.#iM.recordFutureForcedDependency(t,this.#iP),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#iM.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#iM.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#ik||this.#iM.resetBBox(this.#iP),this}recordClipBox(t,e,i,r,s,n){return this.#ik||this.#iM.recordClipBox(this.#iP,e,i,r,s,n),this}recordBBox(t,e,i,r,s,n){return this.#ik||this.#iM.recordBBox(this.#iP,e,i,r,s,n),this}recordCharacterBBox(t,e,i,r,s,n,a){return this.#ik||this.#iM.recordCharacterBBox(this.#iP,e,i,r,s,n,a),this}recordFullPageBBox(t){return this.#ik||this.#iM.recordFullPageBBox(this.#iP),this}getSimpleIndex(t){return this.#iM.getSimpleIndex(t)}recordDependencies(t,e){return this.#iM.recordDependencies(this.#iP,e),this}recordNamedDependency(t,e){return this.#iM.recordNamedDependency(this.#iP,e),this}recordOperation(t){return this.#iM.recordOperation(this.#iP,!0),this}recordShowTextOperation(t){return this.#iM.recordShowTextOperation(this.#iP,!0),this}bboxToClipBoxDropOperation(t){return this.#ik||this.#iM.bboxToClipBoxDropOperation(this.#iP,!0),this}take(){throw Error("Unreachable")}takeDebugMetadata(){throw Error("Unreachable")}}let t4=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],t9=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],t8=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],t7=["filter","fillColor","fillAlpha"],et=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],ee=["transform"],ei=["transform","fillColor"];class er{#im;#ib;#iR=4;#iB=0;#ic=new er.#iF(6*this.#iR);static #iF=U.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#im=t.width,this.#ib=t.height}record(t,e,i,r){let s;if(this.#iB===this.#iR){this.#iR*=2;let t=new er.#iF(6*this.#iR);t.set(this.#ic),this.#ic=t}let n=z.domMatrixToTransform(t.getTransform());if(r[0]!==1/0){let t=h.slice();z.axialAlignedBoundingBox([0,-i,e,0],n,t);let a=z.intersect(r,t);if(!a)return;let[o,l,d,c]=a;if(o!==t[0]||l!==t[1]||d!==t[2]||c!==t[3]){let t=Math.atan2(n[1],n[0]),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));if(e<1e-6||i<1e-6||1e-6>Math.abs(e-i))s=[o,l,o,c,d,l];else{let t=d-o,r=c-l,n=e*e,a=i*i,h=i*e,u=a-n,p=(r*a-t*h)/u;s=[o+(r*h-t*n)/u,l,o,l+p,d,c-p]}}}s||(s=[0,-i,0,0,e,-i],z.applyTransform(s,n,0),z.applyTransform(s,n,2),z.applyTransform(s,n,4)),s[0]/=this.#im,s[1]/=this.#ib,s[2]/=this.#im,s[3]/=this.#ib,s[4]/=this.#im,s[5]/=this.#ib,this.#ic.set(s,6*this.#iB),this.#iB++}take(){return this.#ic.subarray(0,6*this.#iB)}}class es{#iL=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.#iL.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||this.#iL.has(t.loadedName))){if(E(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:e,src:r,style:s}=t,n=new FontFace(e,r,s);this.addNativeFontFace(n);try{await n.load(),this.#iL.add(e),i?.(t)}catch{S(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(n)}return}T("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)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw S(`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(){return k(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return k(this,"isSyncFontLoadingSupported",l||U.platform.isFirefox)}_queueLoadingCallback(t){let{loadingRequests:e}=this,i={done:!1,complete:function(){for(E(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;)setTimeout(e.shift().callback,0)},callback:t};return e.push(i),i}get _loadTestFont(){return k(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){var i;let r,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){return t.substring(0,e)+r+t.substring(e+i)}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,u=n(c=a(c,976,d.length,d),16);for(r=0,s=d.length-3;r<s;r+=4)u=u-0x58585858+n(d,r)|0;r<d.length&&(u=u-0x58585858+n(d+"XXX",r)|0),c=a(c,16,4,String.fromCharCode((i=u)>>24&255,i>>16&255,i>>8&255,255&i));let p=`url(data:font/opentype;base64,${btoa(c)});`,g=`@font-face {font-family:"${d}";src:${p}}`;this.insertRule(g);let m=this._document.createElement("div");for(let e of(m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px",[t.loadedName,d])){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,m.append(t)}this._document.body.append(m),function t(e,i){if(++h>30){S("Load test font never loaded."),i();return}(l.font="30px "+e,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0)?i():setTimeout(t.bind(null,e,i))}(d,()=>{m.remove(),e.complete()})}}class en{compiledGlyphs=Object.create(null);#iO;constructor(t,e=null,i,r){this.#iO=t,this._inspectFont=e,i&&(this.charProcOperatorList=i),r&&Object.assign(this,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=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(t,e){let i;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let r=this.loadedName+"_path_"+e;try{i=t.get(r)}catch(t){S(`getPathGenerator - ignoring character: "${t}".`)}let s=tk(i?.path);return this.fontExtraProperties||t.delete(r),this.compiledGlyphs[e]=s}get black(){return this.#iO.black}get bold(){return this.#iO.bold}get disableFontFace(){return this.#iO.disableFontFace}set disableFontFace(t){k(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#iO.fontExtraProperties}get isInvalidPDFjsFont(){return this.#iO.isInvalidPDFjsFont}get isType3Font(){return this.#iO.isType3Font}get italic(){return this.#iO.italic}get missingFile(){return this.#iO.missingFile}get remeasure(){return this.#iO.remeasure}get vertical(){return this.#iO.vertical}get ascent(){return this.#iO.ascent}get defaultWidth(){return this.#iO.defaultWidth}get descent(){return this.#iO.descent}get bbox(){return this.#iO.bbox}get fontMatrix(){return this.#iO.fontMatrix}get fallbackName(){return this.#iO.fallbackName}get loadedName(){return this.#iO.loadedName}get mimetype(){return this.#iO.mimetype}get name(){return this.#iO.name}get data(){return this.#iO.data}clearData(){this.#iO.clearData()}get cssFontInfo(){return this.#iO.cssFontInfo}get systemFontInfo(){return this.#iO.systemFontInfo}get defaultVMetrics(){return this.#iO.defaultVMetrics}}class ea{static strings=["fontFamily","fontWeight","italicAngle"]}class eo{static strings=["css","loadedName","baseFontName","src"]}class el{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static OFFSET_NUMBERS=Math.ceil(2*this.bools.length/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+8*this.numbers.length;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6}class eh{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class ed{#iN;#iU=new TextDecoder;#iz;constructor(t){this.#iN=t,this.#iz=new DataView(t)}#iH(t){E(t<ea.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get fontFamily(){return this.#iH(0)}get fontWeight(){return this.#iH(1)}get italicAngle(){return this.#iH(2)}}class ec{#iN;#iU=new TextDecoder;#iz;constructor(t){this.#iN=t,this.#iz=new DataView(t)}get guessFallback(){return 0!==this.#iz.getUint8(0)}#iH(t){E(t<eo.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get css(){return this.#iH(0)}get loadedName(){return this.#iH(1)}get baseFontName(){return this.#iH(2)}get src(){return this.#iH(3)}get style(){let t=1;t+=4+this.#iz.getUint32(t);let e=this.#iz.getUint32(t),i=this.#iU.decode(new Uint8Array(this.#iN,t+4,e));t+=4+e;let r=this.#iz.getUint32(t),s=this.#iU.decode(new Uint8Array(this.#iN,t+4,r));return{style:i,weight:s}}}class eu{#iN;#iU=new TextDecoder;#iz;constructor({buffer:t,extra:e}){this.#iN=t,this.#iz=new DataView(t),e&&Object.assign(this,e)}#ij(t){E(t<el.bools.length,"Invalid boolean index");let e=Math.floor(t/4),i=this.#iz.getUint8(e)>>2*t%8&3;return 0===i?void 0:2===i}get black(){return this.#ij(0)}get bold(){return this.#ij(1)}get disableFontFace(){return this.#ij(2)}get fontExtraProperties(){return this.#ij(3)}get isInvalidPDFjsFont(){return this.#ij(4)}get isType3Font(){return this.#ij(5)}get italic(){return this.#ij(6)}get missingFile(){return this.#ij(7)}get remeasure(){return this.#ij(8)}get vertical(){return this.#ij(9)}#i$(t){return E(t<el.numbers.length,"Invalid number index"),this.#iz.getFloat64(el.OFFSET_NUMBERS+8*t)}get ascent(){return this.#i$(0)}get defaultWidth(){return this.#i$(1)}get descent(){return this.#i$(2)}#iG(t,e,i,r){let s=this.#iz.getUint8(t);if(0===s)return;E(s===e,"Invalid array length."),t+=1;let n=Array(s);for(let e=0;e<s;e++)n[e]=this.#iz[i](t,!0),t+=r;return n}get bbox(){return this.#iG(el.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return this.#iG(el.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return this.#iG(el.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}#iH(t){E(t<el.strings.length,"Invalid string index");let e=el.OFFSET_STRINGS+4;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get fallbackName(){return this.#iH(0)}get loadedName(){return this.#iH(1)}get mimetype(){return this.#iH(2)}get name(){return this.#iH(3)}#iV(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);t+=4+i;let r=this.#iz.getUint32(t);t+=4+r;let s=this.#iz.getUint32(t);return{offset:t,length:s}}get data(){let{offset:t,length:e}=this.#iV();return 0===e?void 0:new Uint8Array(this.#iN,t+4,e)}clearData(){let{offset:t,length:e}=this.#iV();0!==e&&(this.#iz.setUint32(t,0),this.#iN=new Uint8Array(this.#iN,0,t+4).slice().buffer,this.#iz=new DataView(this.#iN))}get cssFontInfo(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);t+=4+i;let r=this.#iz.getUint32(t);if(0===r)return null;let s=new Uint8Array(r);return s.set(new Uint8Array(this.#iN,t+4,r)),new ed(s.buffer)}get systemFontInfo(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);if(0===i)return null;let r=new Uint8Array(i);return r.set(new Uint8Array(this.#iN,t+4,i)),new ec(r.buffer)}}class ep{constructor(t){this.buffer=t,this.view=new DataView(t),this.data=new Uint8Array(t)}getIR(){let t=this.view,e=this.data[eh.KIND],i=!!this.data[eh.HAS_BBOX],r=!!this.data[eh.HAS_BACKGROUND],s=t.getUint32(eh.N_COORD,!0),n=t.getUint32(eh.N_COLOR,!0),a=t.getUint32(eh.N_STOP,!0),o=20,l=new Float32Array(this.buffer,o,2*s);o+=8*s;let d=new Uint8Array(this.buffer,o,4*n);o+=4*n;let c=[];for(let e=0;e<a;++e){let e=t.getFloat32(o,!0);o+=4;let i=t.getUint32(o,!0);o+=4,c.push([e,`#${i.toString(16).padStart(6,"0")}`])}let u=null;if(i){u=[];for(let e=0;e<4;++e)u.push(t.getFloat32(o,!0)),o+=4}let p=null;if(r&&(p=new Uint8Array(this.buffer,o,3),o+=3),1===e)return["RadialAxial","axial",u,c,Array.from(l.slice(0,2)),Array.from(l.slice(2,4)),null,null];if(2===e)return["RadialAxial","radial",u,c,[l[0],l[1]],[l[3],l[4]],l[2],l[5]];if(3===e){let t=this.data[eh.SHADING_TYPE],e=null;if(l.length>0){e=h.slice();for(let t=0,i=l.length;t<i;t+=2)z.pointBoundingBox(l[t],l[t+1],e)}return["Mesh",t,l,d,s,e,u,p]}throw Error(`Unsupported pattern kind: ${e}`)}}class eg{#iN;constructor(t){this.#iN=t}get path(){return U.isFloat16ArraySupported?new Float16Array(this.#iN):new Float32Array(this.#iN)}}function em(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw Error(`Invalid factory url: "${t}" must include trailing slash.`)}let ef=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,eb=(function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;let[r,s,...n]=i;if(!t(r)&&!Number.isInteger(r)||!e(s))return!1;let a=n.length,o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(let t of n)if("number"!=typeof t&&(!o||null!==t))return!1;return!0}).bind(null,ef,t=>"object"==typeof t&&"string"==typeof t?.name);class ev{#iW=new Map;#iX=Promise.resolve();postMessage(t,e){let i={data:structuredClone(t,e?{transfer:e}:null)};this.#iX.then(()=>{for(let[t]of this.#iW)t.call(this,i)})}addEventListener(t,e,i=null){let r=null;if(i?.signal instanceof AbortSignal){let{signal:s}=i;if(s.aborted)return void S("LoopbackPort - cannot use an `aborted` signal.");let n=()=>this.removeEventListener(t,e);r=()=>s.removeEventListener("abort",n),s.addEventListener("abort",n)}this.#iW.set(e,r)}removeEventListener(t,e){let i=this.#iW.get(e);i?.(),this.#iW.delete(e)}terminate(){for(let[,t]of this.#iW)t?.();this.#iW.clear()}}o(1689);function ey(){}function eA(t){if(t instanceof O||t instanceof B||t instanceof I||t instanceof F||t instanceof R)return t;switch(!(t instanceof Error||"object"==typeof t&&null!==t)&&T('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new O(t.message);case"InvalidPDFException":return new B(t.message);case"PasswordException":return new I(t.message,t.code);case"ResponseException":return new F(t.message,t.status,t.missing);case"UnknownErrorException":return new R(t.message,t.details)}return new R(t.message,t.toString())}class ex{#iq=new AbortController;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),i.addEventListener("message",this.#iK.bind(this),{signal:this.#iq.signal})}#iK({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#iY(t);if(t.callback){let e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)i.resolve(t.data);else if(2===t.callback)i.reject(eA(t.reason));else throw Error("Unexpected callback case");return}let e=this.actionHandler[t.action];if(!e)throw Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){let i=this.sourceName,r=t.sourceName,s=this.comObj;Promise.try(e,t.data).then(function(e){s.postMessage({sourceName:i,targetName:r,callback:1,callbackId:t.callbackId,data:e})},function(e){s.postMessage({sourceName:i,targetName:r,callback:2,callbackId:t.callbackId,reason:eA(e)})});return}t.streamId?this.#iJ(t):e(t.data)}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)}sendWithPromise(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,r){let s=this.streamId++,n=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{let l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:n,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},r),l.promise},pull:t=>{let e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:n,targetName:a,stream:6,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{E(t instanceof Error,"cancel must have a valid reason");let e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:n,targetName:a,stream:1,streamId:s,reason:eA(t)}),e.promise}},i)}#iJ(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,n=this,a=this.actionHandler[t.action],o={enqueue(t,n=1,a){if(this.isCancelled)return;let o=this.desiredSize;this.desiredSize-=n,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:r,stream:4,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:3,streamId:e}),delete n.streamSinks[e])},error(t){E(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:5,streamId:e,reason:eA(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(a,t.data,o).then(function(){s.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,reason:eA(t)})})}#iY(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,n=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case 8:t.success?n.startCall.resolve():n.startCall.reject(eA(t.reason));break;case 7:t.success?n.pullCall.resolve():n.pullCall.reject(eA(t.reason));break;case 6:if(!a){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||ey).then(function(){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,reason:eA(t)})});break;case 4:if(E(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case 3:if(E(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#iQ(n,e);break;case 5:E(n,"error should have stream controller"),n.controller.error(eA(t.reason)),this.#iQ(n,e);break;case 2:t.success?n.cancelCall.resolve():n.cancelCall.reject(eA(t.reason)),this.#iQ(n,e);break;case 1:if(!a)break;let o=eA(t.reason);Promise.try(a.onCancel||ey,o).then(function(){s.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,reason:eA(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw Error("Unexpected stream case")}}async #iQ(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#iq?.abort(),this.#iq=null}}class ew{#iZ=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:t=null,standardFontDataUrl:e=null,wasmUrl:i=null}){this.cMapUrl=t,this.standardFontDataUrl=e,this.wasmUrl=i}async fetch({kind:t,filename:e}){switch(t){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:T(`Not implemented: ${t}`)}let i=this[t];if(!i)throw Error(`Ensure that the \`${t}\` API parameter is provided.`);let r=`${i}${e}`;return this._fetch(r,t).catch(e=>{throw Error(`Unable to load ${this.#iZ[t]} data at: ${r}`)})}async _fetch(t,e){T("Abstract method `_fetch` called.")}}class e_ extends ew{async _fetch(t,e){let i="cMapUrl"!==e||t.endsWith(".bcmap")?"bytes":"text",r=await tt(t,i);return r instanceof Uint8Array?r:N(r)}}class eS{#i0=!1;constructor({enableHWA:t=!1}){this.#i0=t}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",{willReadFrequently:!this.#i0})}}reset({canvas:t},e,i){if(!t)throw Error("Canvas is not specified");if(e<=0||i<=0)throw Error("Invalid canvas size");t.width=e,t.height=i}destroy(t){let{canvas:e}=t;if(!e)throw Error("Canvas is not specified");e.width=e.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){T("Abstract method `_createCanvas` called.")}}class eT extends eS{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){let i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}o(2489);class eE{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,r,s){return"none"}destroy(t=!1){}}class eC extends eE{#i1;#i2;#i5;#i3;#i6;#i4;#E=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#i3=t,this.#i6=e}get #M(){return this.#i2||=new Map}get #i9(){return this.#i4||=new Map}get #i8(){if(!this.#i5){let t=this.#i6.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.#i6.createElementNS(Q,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#i5=this.#i6.createElementNS(Q,"defs"),t.append(i),i.append(this.#i5),this.#i6.body.append(t)}return this.#i5}#i7(t){if(1===t.length){let e=t[0],i=Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;let r=i.join(",");return[r,r,r]}let[e,i,r]=t,s=Array(256),n=Array(256),a=Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,n[t]=i[t]/255,a[t]=r[t]/255;return[s.join(","),n.join(","),a.join(",")]}#rt(t){if(void 0===this.#i1){this.#i1="";let t=this.#i6.URL;t!==this.#i6.baseURI&&(tr(t)?S('#createUrl: ignore "data:"-URL for performance reasons.'):this.#i1=M(t,""))}return`url(${this.#i1}#${t})`}addFilter(t){if(!t)return"none";let e=this.#M.get(t);if(e)return e;let[i,r,s]=this.#i7(t),n=1===t.length?i:`${i}${r}${s}`;if(e=this.#M.get(n))return this.#M.set(t,e),e;let a=`g_${this.#i3}_transfer_map_${this.#E++}`,o=this.#rt(a);this.#M.set(t,o),this.#M.set(n,o);let l=this.#re(a);return this.#ri(i,r,s,l),o}addHCMFilter(t,e){let i=`${t}-${e}`,r="base",s=this.#i9.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.#i9.set(r,s)),!t||!e))return s.url;let n=this.#rr(t);t=z.makeHexColor(...n);let a=this.#rr(e);if(e=z.makeHexColor(...a),this.#i8.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;let o=Array(256);for(let t=0;t<=255;t++){let e=t/255;o[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}let l=o.join(","),h=`g_${this.#i3}_hcm_filter`,d=s.filter=this.#re(h);this.#ri(l,l,l,d),this.#rs(d);let c=(t,e)=>{let i=n[t]/255,r=a[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.#ri(c(0,5),c(1,5),c(2,5),d),s.url=this.#rt(h),s.url}addAlphaFilter(t){let e=this.#M.get(t);if(e)return e;let[i]=this.#i7([t]),r=`alpha_${i}`;if(e=this.#M.get(r))return this.#M.set(t,e),e;let s=`g_${this.#i3}_alpha_map_${this.#E++}`,n=this.#rt(s);this.#M.set(t,n),this.#M.set(r,n);let a=this.#re(s);return this.#rn(i,a),n}addLuminosityFilter(t){let e,i,r=this.#M.get(t||"luminosity");if(r)return r;if(t?([e]=this.#i7([t]),i=`luminosity_${e}`):i="luminosity",r=this.#M.get(i))return this.#M.set(t,r),r;let s=`g_${this.#i3}_luminosity_map_${this.#E++}`,n=this.#rt(s);this.#M.set(t,n),this.#M.set(i,n);let a=this.#re(s);return this.#ra(a),t&&this.#rn(e,a),n}addHighlightHCMFilter(t,e,i,r,s){let n=`${e}-${i}-${r}-${s}`,a=this.#i9.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.#i9.set(t,a)),!e||!i))return a.url;let[o,l]=[e,i].map(this.#rr.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.#rr.bind(this));d<h&&([h,d,c,u]=[d,h,u,c]),this.#i8.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.#i3}_hcm_${t}_filter`,m=a.filter=this.#re(g);return this.#rs(m),this.#ri(p(c[0],u[0],5),p(c[1],u[1],5),p(c[2],u[2],5),m),a.url=this.#rt(g),a.url}destroy(t=!1){t&&this.#i4?.size||(this.#i5?.parentNode.parentNode.remove(),this.#i5=null,this.#i2?.clear(),this.#i2=null,this.#i4?.clear(),this.#i4=null,this.#E=0)}#ra(t){let e=this.#i6.createElementNS(Q,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#rs(t){let e=this.#i6.createElementNS(Q,"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)}#re(t){let e=this.#i6.createElementNS(Q,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#i8.append(e),e}#ro(t,e,i){let r=this.#i6.createElementNS(Q,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)}#ri(t,e,i,r){let s=this.#i6.createElementNS(Q,"feComponentTransfer");r.append(s),this.#ro(s,"feFuncR",t),this.#ro(s,"feFuncG",e),this.#ro(s,"feFuncB",i)}#rn(t,e){let i=this.#i6.createElementNS(Q,"feComponentTransfer");e.append(i),this.#ro(i,"feFuncA",t)}#rr(t){return this.#i8.style.color=t,tg(getComputedStyle(this.#i8).getPropertyValue("color"))}}if(l){let t;try{let e=r.getBuiltinModule("module").createRequire("file:///home/runner/work/pidex/pidex/node_modules/pdfjs-dist/legacy/build/pdf.mjs");try{t=e("@napi-rs/canvas")}catch(t){S(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){S(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:S("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(t?.ImageData?globalThis.ImageData=t.ImageData:S("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:S("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function eM(t){let e=r.getBuiltinModule("fs/promises");return new Uint8Array(await e.readFile(t))}class eP extends eE{}class ek extends eS{_createCanvas(t,e){return r.getBuiltinModule("module").createRequire("file:///home/runner/work/pidex/pidex/node_modules/pdfjs-dist/legacy/build/pdf.mjs")("@napi-rs/canvas").createCanvas(t,e)}}class eD extends ew{async _fetch(t,e){return eM(t)}}let eI=`
|
|
2
|
+
`).join("")}}function tl(t,e){let i=e?URL.parse(t,e):URL.parse(t);return/https?:/.test(i?.protocol??"")}function th(t){t.preventDefault()}function td(t){t.preventDefault(),t.stopPropagation()}class tc{static #r;static toDateObject(t){if(t instanceof Date)return t;if(!t||"string"!=typeof t)return null;this.#r||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");let e=this.#r.exec(t);if(!e)return null;let i=parseInt(e[1],10),r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let n=parseInt(e[4],10);n=n>=0&&n<=23?n:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;let l=e[7]||"Z",h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(n+=h,a+=d):"+"===l&&(n-=h,a-=d),new Date(Date.UTC(i,r,s,n,a,o))}}function tu(t,{scale:e=1,rotation:i=0}){let{width:r,height:s}=t.attributes.style;return new te({viewBox:[0,0,parseInt(r,10),parseInt(s,10)],userUnit:1,scale:e,rotation:i})}function tp(t){if(t.startsWith("#")){let e=t.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){let[e,i,r]=t.slice(4,-1).split(",").map(t=>parseInt(t,10));return[e,i,r,1]}if(t.startsWith("rgba(")){let e=t.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}let e=t.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(255*parseFloat(e[1])),Math.round(255*parseFloat(e[2])),Math.round(255*parseFloat(e[3])),void 0!==e[4]&&"none"!==e[4]?parseFloat(e[4]):1]:null}function tg(t){let e=tp(t);return e?e.slice(0,3):(S(`Not a valid color format: "${t}"`),[0,0,0])}function tm(t){let{a:e,b:i,c:r,d:s,e:n,f:a}=t.getTransform();return[e,i,r,s,n,a]}function tf(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 tb(t,e,i=!1,r=!0){if(e instanceof te){let{pageWidth:r,pageHeight:s}=e.rawDims,{style:n}=t,a=U.isCSSRoundSupported,o=`var(--total-scale-factor) * ${r}px`,l=`var(--total-scale-factor) * ${s}px`,h=a?`round(down, ${o}, var(--scale-round-x))`:`calc(${o})`,d=a?`round(down, ${l}, var(--scale-round-y))`:`calc(${l})`;i&&e.rotation%180!=0?(n.width=d,n.height=h):(n.width=h,n.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class tv{constructor(){const{pixelRatio:t}=tv;this.sx=t,this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,i,r,s=-1){let n=1/0,a=1/0,o=1/0;(i=tv.capPixels(i,s))>0&&(n=Math.sqrt(i/(t*e))),-1!==r&&(a=r/t,o=r/e);let l=Math.min(n,a,o);return(this.sx>l||this.sy>l)&&(this.sx=l,this.sy=l,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){let i=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,i):i}return t}}let ty=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class tA{static get isDarkMode(){return k(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class tx{static get commentForegroundColor(){let t=document.createElement("span");t.classList.add("comment","sidebar");let{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);let{color:i}=window.getComputedStyle(t);return t.remove(),k(this,"commentForegroundColor",tg(i))}}function tw(t,e){let i=255*(1-(e=K(e??1,0,1)));return t.map(t=>Math.round(t*e+i))}function t_(t,e){let i=t[0]/255,r=t[1]/255,s=t[2]/255,n=Math.max(i,r,s),a=Math.min(i,r,s),o=(n+a)/2;if(n===a)e[0]=e[1]=0;else{let t=n-a;switch(e[1]=o<.5?t/(n+a):t/(2-n-a),n){case i:e[0]=((r-s)/t+6*(r<s))*60;break;case r:e[0]=((s-i)/t+2)*60;break;case s:e[0]=((i-r)/t+4)*60}}e[2]=o}function tS(t,e){let i=t[0],r=t[1],s=t[2],n=(1-Math.abs(2*s-1))*r,a=n*(1-Math.abs(i/60%2-1)),o=s-n/2;switch(Math.floor(i/60)){case 0:e[0]=n+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=n+o,e[2]=o;break;case 2:e[0]=o,e[1]=n+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=n+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=n+o;break;case 5:case 6:e[0]=n+o,e[1]=o,e[2]=a+o}}function tT(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function tE(t,e,i){tS(t,i),i.map(tT);let r=.2126*i[0]+.7152*i[1]+.0722*i[2];tS(e,i),i.map(tT);let s=.2126*i[0]+.7152*i[1]+.0722*i[2];return r>s?(r+.05)/(s+.05):(s+.05)/(r+.05)}let tC=new Map;function tM(t,e){let i=t[0]+256*t[1]+65536*t[2]+0x1000000*e[0]+0x100000000*e[1]+0x10000000000*e[2],r=tC.get(i);if(r)return r;let s=new Float32Array(9),n=s.subarray(0,3),a=s.subarray(3,6);t_(t,a);let o=s.subarray(6,9);t_(e,o);let l=o[2]<.5,h=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),tE(a,o,n)<h){let t,e;for(l?(t=a[2],e=1):(t=0,e=a[2]);e-t>.005;){let i=a[2]=(t+e)/2;l===tE(a,o,n)<h?t=i:e=i}a[2]=l?e:t}return tS(a,n),r=z.makeHexColor(Math.round(255*n[0]),Math.round(255*n[1]),Math.round(255*n[2])),tC.set(i,r),r}function tP({html:t,dir:e,className:i},r){let s=document.createDocumentFragment();if("string"==typeof t){let i=document.createElement("p");i.dir=e||"auto";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"))}s.append(i)}else J.render({xfaHtml:t,div:s,intent:"richText"});s.firstElementChild.classList.add("richText",i),r.append(s)}function tk(t){let e=new Path2D;if(!t)return e;for(let i=0,r=t.length;i<r;)switch(t[i++]){case 0:e.moveTo(t[i++],t[i++]);break;case 1:e.lineTo(t[i++],t[i++]);break;case 2:e.bezierCurveTo(t[i++],t[i++],t[i++],t[i++],t[i++],t[i++]);break;case 3:e.quadraticCurveTo(t[i++],t[i++],t[i++],t[i++]);break;case 4:e.closePath();break;default:S(`Unrecognized drawing path operator: ${t[i-1]}`)}return e}o(4972),o(4628),o(7642),o(8004),o(3853),o(5876),o(2475),o(5024),o(1698),o(8454),o(9452),o(4979),o(3579),o(3110),o(9314),o(1148),o(9112);class tD{#s=null;#n=null;#a;#o=null;#l=null;#h=null;#d=null;#c=null;static #u=null;constructor(t){this.#a=t,tD.#u||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){let t=this.#s=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");let e=this.#a._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",th,{signal:e}),t.addEventListener("pointerdown",tD.#p,{signal:e}));let i=this.#o=document.createElement("div");i.className="buttons",t.append(i);let r=this.#a.toolbarPosition;if(r){let{style:e}=t,i="ltr"===this.#a._uiManager.direction?1-r[0]:r[0];e.insetInlineEnd=`${100*i}%`,e.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#s}static #p(t){t.stopPropagation()}#g(t){this.#a._focusEventsAllowed=!1,td(t)}#m(t){this.#a._focusEventsAllowed=!0,td(t)}#f(t){let e=this.#a._uiManager._signal;return e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("focusin",this.#g.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#m.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",th,{signal:e}),!0)}hide(){this.#s.classList.add("hidden"),this.#n?.hideDropdown()}show(){this.#s.classList.remove("hidden"),this.#l?.shown(),this.#h?.shown()}addDeleteButton(){let{editorType:t,_uiManager:e}=this.#a,i=document.createElement("button");i.classList.add("basic","deleteButton"),i.tabIndex=0,i.setAttribute("data-l10n-id",tD.#u[t]),this.#f(i)&&i.addEventListener("click",t=>{e.delete()},{signal:e._signal}),this.#o.append(i)}get #b(){let t=document.createElement("div");return t.className="divider",t}async addAltText(t){let e=await t.render();this.#f(e),this.#o.append(e,this.#b),this.#l=t}addComment(t,e=null){if(this.#h)return;let i=t.renderForToolbar();if(!i)return;this.#f(i);let r=this.#d=this.#b;e?(this.#o.insertBefore(i,e),this.#o.insertBefore(r,e)):this.#o.append(i,r),this.#h=t,t.toolbar=this}addColorPicker(t){if(this.#n)return;this.#n=t;let e=t.renderButton();this.#f(e),this.#o.append(e,this.#b)}async addEditSignatureButton(t){let e=this.#c=await t.renderEditButton(this.#a);this.#f(e),this.#o.append(e,this.#b)}removeButton(t){"comment"===t&&(this.#h?.removeToolbarCommentButton(),this.#h=null,this.#d?.remove(),this.#d=null)}async addButton(t,e){switch(t){case"colorPicker":e&&this.addColorPicker(e);break;case"altText":e&&await this.addAltText(e);break;case"editSignature":e&&await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":e&&this.addComment(e)}}async addButtonBefore(t,e,i){if(!e&&"comment"===t)return;let r=this.#o.querySelector(i);r&&"comment"===t&&this.addComment(e,r)}updateEditSignatureButton(t){this.#c&&(this.#c.title=t)}remove(){this.#s.remove(),this.#n?.destroy(),this.#n=null}}class tI{#o=null;#s=null;#v;constructor(t){this.#v=t}#y(){let t=this.#s=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");let e=this.#v._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",th,{signal:e});let i=this.#o=document.createElement("div");return i.className="buttons",t.append(i),this.#v.hasCommentManager()&&this.#A("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#v.commentSelection("floating_button")}),this.#A("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#v.highlightSelection("floating_button")}),t}#x(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.#x(e,i),{style:n}=this.#s||=this.#y();t.append(this.#s),n.insetInlineEnd=`${100*r}%`,n.top=`calc(${100*s}% + var(--editor-toolbar-vert-offset))`}hide(){this.#s.remove()}#A(t,e,i,r){let s=document.createElement("button");s.classList.add("basic",t),s.tabIndex=0,s.setAttribute("data-l10n-id",e);let n=document.createElement("span");s.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id",i);let a=this.#v._signal;a instanceof AbortSignal&&!a.aborted&&(s.addEventListener("contextmenu",th,{signal:a}),s.addEventListener("click",r,{signal:a})),this.#o.append(s)}}function tR(t,e,i){for(let r of i)e.addEventListener(r,t[r].bind(t))}class tB{static #w=NaN;static #_=null;static #S=NaN;static #T=null;static initializeAndAddPointerId(t){(tB.#_||=new Set).add(t)}static setPointer(t,e){tB.#w||=e,tB.#T??=t}static setTimeStamp(t){tB.#S=t}static isSamePointerId(t){return tB.#w===t}static isSamePointerIdOrRemove(t){return tB.#w===t||(tB.#_?.delete(t),!1)}static isSamePointerType(t){return tB.#T===t}static isInitializedAndDifferentPointerType(t){return null!==tB.#T&&!tB.isSamePointerType(t)}static isSameTimeStamp(t){return tB.#S===t}static isUsingMultiplePointers(){return tB.#_?.size>=1}static clearPointerType(){tB.#T=null}static clearPointerIds(){tB.#w=NaN,tB.#_=null}static clearTimeStamp(){tB.#S=NaN}}class tF{#E=0;get id(){return`${p}${this.#E++}`}}class tL{#C=G();#E=0;#M=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;return 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>',k(this,"_isSVGFittingCanvas",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])))}async #P(t,e){this.#M||=new Map;let i=this.#M.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.#C}_${this.#E++}`,refCounter:0,isSvg:!1},"string"==typeof e?(i.url=e,t=await tt(e,"blob")):e instanceof File?t=i.file=e:e instanceof Blob&&(t=e),"image/svg+xml"===t.type){let e=tL._isSVGFittingCanvas,r=new FileReader,s=new Image,n=new Promise((t,n)=>{s.onload=()=>{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){S(t),i=null}return this.#M.set(t,i),i&&this.#M.set(i.id,i),i}async getFromFile(t){let{lastModified:e,name:i,size:r,type:s}=t;return this.#P(`${e}_${i}_${r}_${s}`,t)}async getFromUrl(t){return this.#P(t,t)}async getFromBlob(t,e){let i=await e;return this.#P(t,i)}async getFromId(t){this.#M||=new Map;let e=this.#M.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){let{blobPromise:t}=e;return delete e.blobPromise,this.getFromBlob(e.id,t)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#M||=new Map;let i=this.#M.get(t);if(i?.bitmap)return i.refCounter+=1,i;let r=new OffscreenCanvas(e.width,e.height);return r.getContext("2d").drawImage(e,0,0),i={bitmap:r.transferToImageBitmap(),id:`image_${this.#C}_${this.#E++}`,refCounter:1,isSvg:!1},this.#M.set(t,i),this.#M.set(i.id,i),i}getSvgUrl(t){let e=this.#M.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#M||=new Map;let e=this.#M.get(t);if(!e||(e.refCounter-=1,0!==e.refCounter))return;let{bitmap:i}=e;if(!e.url&&!e.file){let t=new OffscreenCanvas(i.width,i.height);t.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=t.convertToBlob()}i.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#C}_`)}}class tO{#k=[];#D=!1;#I;#R=-1;constructor(t=128){this.#I=t}add({cmd:t,undo:e,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:n=!1,keepUndo:a=!1}){if(r&&t(),this.#D)return;let o={cmd:t,undo:e,post:i,type:s};if(-1===this.#R){this.#k.length>0&&(this.#k.length=0),this.#R=0,this.#k.push(o);return}if(n&&this.#k[this.#R].type===s){a&&(o.undo=this.#k[this.#R].undo),this.#k[this.#R]=o;return}let l=this.#R+1;l===this.#I?this.#k.splice(0,1):(this.#R=l,l<this.#k.length&&this.#k.splice(l)),this.#k.push(o)}undo(){if(-1===this.#R)return;this.#D=!0;let{undo:t,post:e}=this.#k[this.#R];t(),e?.(),this.#D=!1,this.#R-=1}redo(){if(this.#R<this.#k.length-1){this.#R+=1,this.#D=!0;let{cmd:t,post:e}=this.#k[this.#R];t(),e?.(),this.#D=!1}}hasSomethingToUndo(){return -1!==this.#R}hasSomethingToRedo(){return this.#R<this.#k.length-1}cleanType(t){if(-1!==this.#R){for(let e=this.#R;e>=0;e--)if(this.#k[e].type!==t){this.#k.splice(e+1,this.#R-e),this.#R=e;return}this.#k.length=0,this.#R=-1}}destroy(){this.#k=null}}class tN{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=U.platform;for(const[i,r,s={}]of t)for(const t of i){const 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)))}}#B(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.#B(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||td(e))}}class tU{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]),e=document.createElement("span");for(let i of(e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e),t.keys())){e.style.color=i;let r=window.getComputedStyle(e).color;t.set(i,tg(r))}return e.remove(),k(this,"_colors",t)}convert(t){let e=tg(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 tU._colorsMapping.get(t);return e}getHexCode(t){let e=this._colors.get(t);return e?z.makeHexColor(...e):t}}class tz{#F=new AbortController;#L=null;#O=null;#N=new Map;#U=new Map;#z=null;#H=null;#j=null;#$=null;#G=new tO;#V=null;#W=null;#X=null;#q=0;#K=new Set;#Y=null;#J=null;#Q=new Set;_editorUndoBar=null;#Z=!1;#tt=!1;#te=!1;#ti=null;#tr=null;#ts=null;#tn=null;#ta=!1;#to=null;#tl=new tF;#th=!1;#td=!1;#tc=!1;#tu=null;#tp=null;#tg=null;#tm=null;#tf=null;#tb=g.NONE;#tv=new Set;#ty=null;#tA=null;#tx=null;#tw=null;#t_=null;#tS={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#tT=[0,0];#tE=null;#tC=null;#tM=null;#tP=null;#tk=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=tz.prototype,e=t=>t.#tC.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,{target:e})=>{if(e instanceof HTMLInputElement){let{type:t}=e;return"text"!==t&&"number"!==t}return!0},r=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return k(this,"_keyboardManager",new tN([[["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.#tC.contains(e)&&!t.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,{target:e})=>!(e instanceof HTMLButtonElement)&&t.#tC.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,r,s,n,a,o,l,h,d,c,u,p,g,m){const f=this._signal=this.#F.signal;this.#tC=t,this.#tM=e,this.#tP=i,this.#H=r,this.#V=s,this.#tA=n,this.#t_=o,this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:f}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),a._on("setpreference",this.onSetPreference.bind(this),{signal:f}),a._on("switchannotationeditorparams",t=>this.updateParams(t.type,t.value),{signal:f}),window.addEventListener("pointerdown",()=>{this.#td=!0},{capture:!0,signal:f}),window.addEventListener("pointerup",()=>{this.#td=!1},{capture:!0,signal:f}),window.addEventListener("beforeunload",this.#tD.bind(this),{capture:!0,signal:f}),this.#tI(),this.#tR(),this.#tB(),this.#j=o.annotationStorage,this.#ti=o.filterFactory,this.#tx=l,this.#tn=h||null,this.#Z=d,this.#tt=c,this.#te=u,this.#tf=p||null,this.viewParameters={realScale:Z.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=!1!==m,s?.setSidebarUiManager(this)}destroy(){for(let t of(this.#tk?.resolve(),this.#tk=null,this.#F?.abort(),this.#F=null,this._signal=null,this.#U.values()))t.destroy();this.#U.clear(),this.#N.clear(),this.#Q.clear(),this.#tm?.clear(),this.#L=null,this.#tv.clear(),this.#G.destroy(),this.#H?.destroy(),this.#V?.destroy(),this.#tA?.destroy(),this.#to?.hide(),this.#to=null,this.#tg?.destroy(),this.#tg=null,this.#O=null,this.#tr&&(clearTimeout(this.#tr),this.#tr=null),this.#tE&&(clearTimeout(this.#tE),this.#tE=null),this._editorUndoBar?.destroy(),this.#t_=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#tf}get useNewAltTextFlow(){return this.#tt}get useNewAltTextWhenAddingImage(){return this.#te}get hcmFilter(){return k(this,"hcmFilter",this.#tx?this.#ti.addHCMFilter(this.#tx.foreground,this.#tx.background):"none")}get direction(){return k(this,"direction",getComputedStyle(this.#tC).direction)}get _highlightColors(){return k(this,"_highlightColors",this.#tn?new Map(this.#tn.split(",").map(t=>((t=t.split("=").map(t=>t.trim()))[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){let{_highlightColors:t}=this;if(!t)return k(this,"highlightColors",null);let e=new Map,i=!!this.#tx;for(let[r,s]of t){let t=r.endsWith("_HCM");if(i&&t){e.set(r.replace("_HCM",""),s);continue}i||t||e.set(r,s)}return k(this,"highlightColors",e)}get highlightColorNames(){return k(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;let e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#X=t}setMainHighlightColorPicker(t){this.#tg=t}editAltText(t,e=!1){this.#H?.editAltText(this,t,e)}hasCommentManager(){return!!this.#V}editComment(t,e,i,r){this.#V?.showDialog(this,t,e,i,r)}selectComment(t,e){let i=this.#U.get(t),r=i?.getEditorByUID(e);r?.toggleComment(!0,!0)}updateComment(t){this.#V?.updateComment(t.getData())}updatePopupColor(t){this.#V?.updatePopupColor(t)}removeComment(t){this.#V?.removeComments([t.uid])}deleteComment(t,e){let i=()=>{t.comment=e},r=()=>{this._editorUndoBar?.show(i,"comment"),this.toggleComment(null),t.comment=null};this.addCommands({cmd:r,undo:i,mustExec:!0})}toggleComment(t,e,i){this.#V?.toggleCommentPopup(t,e,i)}makeCommentColor(t,e){return t&&this.#V?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#V?.dialogElement||null}async waitForEditorsRendered(t){if(this.#U.has(t-1))return;let{resolve:e,promise:i}=Promise.withResolvers(),r=i=>{i.pageNumber===t&&(this._eventBus._off("editorsrendered",r),e())};this._eventBus.on("editorsrendered",r),await i}getSignature(t){this.#tA?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#tA}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){"enableNewAltTextWhenAddingImage"===t&&(this.#te=e)}onPageChanging({pageNumber:t}){this.#q=t-1}deletePage(t){for(let e of this.getEditors(t))e.remove();this.#U.delete(t),this.#q===t&&(this.#q=0)}focusMainContainer(){this.#tC.focus()}findParent(t,e){for(let i of this.#U.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.#tM.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#Q.add(t)}removeShouldRescale(t){this.#Q.delete(t)}onScaleChanging({scale:t}){for(let e of(this.commitOrRemove(),this.viewParameters.realScale=t*Z.PDF_TO_CSS_UNITS,this.#Q))e.onScaleChanging();this.#X?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#tF({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#tL(t){let{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(let e of this.#U.values())if(e.hasTextLayer(t))return e;return null}highlightSelection(t="",e=!1){let i=document.getSelection();if(!i||i.isCollapsed)return;let{anchorNode:r,anchorOffset:s,focusNode:n,focusOffset:a}=i,o=i.toString(),l=this.#tF(i).closest(".textLayer"),h=this.getSelectionBoxes(l);if(!h)return;i.empty();let d=this.#tL(l),c=this.#tb===g.NONE,u=()=>{let i=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:r,anchorOffset:s,focusNode:n,focusOffset:a,text:o});c&&this.showAllEditors("highlight",!0,!0),e&&i?.editComment()};c?this.switchToMode(g.HIGHLIGHT,u):u()}commentSelection(t=""){this.highlightSelection(t,!0)}#tD(t){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#tO(){let t=document.getSelection();if(!t||t.isCollapsed)return;let e=this.#tF(t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(this.#to||=new tI(this),this.#to.show(e,i,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#j)return null;let e=`${p}${t}`,i=this.#j.getRawValue(e);return i&&this.#j.remove(e),i}addToAnnotationStorage(t){t.isEmpty()||!this.#j||this.#j.has(t.id)||this.#j.setValue(t.id,t)}a11yAlert(t,e=null){let i=this.#tP;i&&(i.setAttribute("data-l10n-id",t),e?i.setAttribute("data-l10n-args",JSON.stringify(e)):i.removeAttribute("data-l10n-args"))}#tN(){let t=document.getSelection();if(!t||t.isCollapsed){this.#ty&&(this.#to?.hide(),this.#ty=null,this.#tU({hasSelectedText:!1}));return}let{anchorNode:e}=t;if(e===this.#ty)return;let i=this.#tF(t).closest(".textLayer");if(!i){this.#ty&&(this.#to?.hide(),this.#ty=null,this.#tU({hasSelectedText:!1}));return}if(this.#to?.hide(),this.#ty=e,this.#tU({hasSelectedText:!0}),(this.#tb===g.HIGHLIGHT||this.#tb===g.NONE)&&(this.#tb===g.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#ta=this.isShiftKeyDown,!this.isShiftKeyDown)){let t=this.#tb===g.HIGHLIGHT?this.#tL(i):null;if(t?.toggleDrawing(),this.#td){let e=new AbortController,i=this.combinedSignal(e),r=i=>{("pointerup"!==i.type||0===i.button)&&(e.abort(),t?.toggleDrawing(!0),"pointerup"===i.type&&this.#tz("main_toolbar"))};window.addEventListener("pointerup",r,{signal:i}),window.addEventListener("blur",r,{signal:i})}else t?.toggleDrawing(!0),this.#tz("main_toolbar")}}#tz(t=""){this.#tb===g.HIGHLIGHT?this.highlightSelection(t):this.#Z&&this.#tO()}#tI(){document.addEventListener("selectionchange",this.#tN.bind(this),{signal:this._signal})}#tH(){if(this.#ts)return;this.#ts=new AbortController;let t=this.combinedSignal(this.#ts);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#tj(){this.#ts?.abort(),this.#ts=null}blur(){if(this.isShiftKeyDown=!1,this.#ta&&(this.#ta=!1,this.#tz("main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let e of this.#tv)if(e.div.contains(t)){this.#tp=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#tp)return;let[t,e]=this.#tp;this.#tp=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#tB(){if(this.#tu)return;this.#tu=new AbortController;let t=this.combinedSignal(this.#tu);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#t$(){this.#tu?.abort(),this.#tu=null}#tG(){if(this.#W)return;this.#W=new AbortController;let t=this.combinedSignal(this.#W);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#tV(){this.#W?.abort(),this.#W=null}#tR(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#tB(),this.setEditingState(!0)}removeEditListeners(){this.#t$(),this.setEditingState(!1)}dragOver(t){for(let{type:e}of t.dataTransfer.items)for(let i of this.#J)if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let e of t.dataTransfer.items)for(let i of this.#J)if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#L?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let t of this.#tv){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()}async paste(t){t.preventDefault();let{clipboardData:e}=t;for(let t of e.items)for(let e of this.#J)if(e.isHandlingMimeForPasting(t.type))return void e.paste(t,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){S(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();let r=this.currentLayer;try{let t=[];for(let e of i){let i=await r.deserialize(e);if(!i)return;t.push(i)}let e=()=>{for(let e of t)this.#tW(e);this.#tX(t)};this.addCommands({cmd:e,undo:()=>{for(let e of t)e.remove()},mustExec:!0})}catch(t){S(`paste: "${t.message}".`)}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),this.#tb===g.NONE||this.isEditorHandlingKeyboard||tz._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,this.#ta&&(this.#ta=!1,this.#tz("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}updatePageIndex(t,e){for(let i of this.getEditors(t))i.pageIndex=e;let i=this.#z.get(t);i&&(i.pageIndex=e,this.#U.set(e,i),this.#th?i.enable():i.disable())}startUpdatePages(){this.#z=new Map(this.#U),this.#U.clear()}endUpdatePages(){this.#z=null}clonePage(t,e){for(let i of this.getEditors(t)){let t=i.serialize(i.mode!==g.HIGHLIGHT);t&&(t.pageIndex=e,t.id=this.getId(),t.isClone=!0,delete t.popupRef,this.#j.setValue(t.id,t))}}findClonesForPage(t){let e=[],{pageIndex:i}=t;for(let[r,s]of this.#j)s.pageIndex===i&&s.isClone&&(this.#j.remove(r),e.push(t.deserialize(s).then(e=>{e&&(e.isClone=!0,t.addOrRebuild(e))})));return Promise.all(e)}#tU(t){Object.entries(t).some(([t,e])=>this.#tS[t]!==e)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#tS,t)}),this.#tb===g.HIGHLIGHT&&!1===t.hasSelectedEditor&&this.#tq([[m.HIGHLIGHT_FREE,!0]]))}#tq(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#tH(),this.#tG(),this.#tU({isEditing:this.#tb!==g.NONE,isEmpty:this.#tK(),hasSomethingToUndo:this.#G.hasSomethingToUndo(),hasSomethingToRedo:this.#G.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#tj(),this.#tV(),this.#tU({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#J)for(let e of(this.#J=t,this.#J))this.#tq(e.defaultPropertiesToUpdate)}getId(){return this.#tl.id}get currentLayer(){return this.#U.get(this.#q)}getLayer(t){return this.#U.get(t)}get currentPageIndex(){return this.#q}addLayer(t){this.#U.set(t.pageIndex,t),this.#th?t.enable():t.disable()}removeLayer(t){this.#U.delete(t.pageIndex)}async updateMode(t,e=null,i=!1,r=!1,s=!1,n=!1){if(this.#tb!==t&&(!this.#tk||(await this.#tk.promise,this.#tk))){if(this.#tk=Promise.withResolvers(),this.#X?.commitOrRemove(),this.#tb===g.POPUP&&this.#V?.hideSidebar(),this.#V?.destroyPopup(),this.#tb=t,t===g.NONE){for(let t of(this.setEditingState(!1),this.#tY(),this.#N.values()))t.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#tk.resolve();return}for(let t of this.#N.values())t.addStandaloneCommentButton();for(let e of(t===g.SIGNATURE&&await this.#tA?.loadSignatures(),i&&tB.clearPointerType(),this.setEditingState(!0),await this.#tJ(),this.unselectAll(),this.#U.values()))e.updateMode(t);if(t===g.POPUP){this.#O||=await this.#t_.getAnnotationsByType(new Set(this.#J.map(t=>t._editorType)));let t=new Set,e=[];for(let i of this.#N.values()){let{annotationElementId:r,hasComment:s,deleted:n}=i;r&&t.add(r),s&&!n&&e.push(i.getData())}for(let i of this.#O){let{id:r,popupRef:s,contentsObj:n}=i;s&&n?.str&&!t.has(r)&&!this.#K.has(r)&&e.push(i)}this.#V?.showSidebar(e)}if(!e){r&&this.addNewEditorFromKeyboard(),this.#tk.resolve();return}for(let t of this.#N.values())t.uid===e?(this.setSelected(t),n?t.editComment():s?t.enterInEditMode():t.focus()):t.unselect();this.#tk.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#tb&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#J){switch(t){case m.CREATE:this.currentLayer.addNewEditor(e);return;case m.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#tw||=new Map).set(t,e),this.showAllEditors("highlight",e)}if(this.hasSelection)for(let i of this.#tv)i.updateParams(t,e);else for(let i of this.#J)i.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){for(let i of this.#N.values())i.editorType===t&&i.show(e);(this.#tw?.get(m.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#tq([[m.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#tc!==t)for(let e of(this.#tc=t,this.#U.values()))t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}async #tJ(){if(!this.#th){this.#th=!0;let t=[];for(let e of this.#U.values())t.push(e.enable());for(let e of(await Promise.all(t),this.#N.values()))e.enable()}}#tY(){if(this.unselectAll(),this.#th){for(let t of(this.#th=!1,this.#U.values()))t.disable();for(let t of this.#N.values())t.disable()}}*getEditors(t){for(let e of this.#N.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#N.get(t)}addEditor(t){this.#N.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#tr&&clearTimeout(this.#tr),this.#tr=setTimeout(()=>{this.focusMainContainer(),this.#tr=null},0)),this.#N.delete(t.id),t.annotationElementId&&this.#tm?.delete(t.annotationElementId),this.unselect(t),t.annotationElementId&&this.#K.has(t.annotationElementId)||this.#j?.remove(t.id)}addDeletedAnnotationElement(t){this.#K.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#K.has(t)}removeDeletedAnnotationElement(t){this.#K.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#tW(t){let e=this.#U.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#L!==t&&(this.#L=t,t&&this.#tq(t.propertiesToUpdate))}get #tQ(){let t=null;for(t of this.#tv);return t}updateUI(t){this.#tQ===t&&this.#tq(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#tq(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#tv.has(t)){this.#tv.delete(t),t.unselect(),this.#tU({hasSelectedEditor:this.hasSelection});return}this.#tv.add(t),t.select(),this.#tq(t.propertiesToUpdate),this.#tU({hasSelectedEditor:!0})}setSelected(t){for(let e of(this.updateToolbar({mode:t.mode,editId:t.uid}),this.#X?.commitOrRemove(),this.#tv))e!==t&&e.unselect();this.#V?.destroyPopup(),this.#tv.clear(),this.#tv.add(t),t.select(),this.#tq(t.propertiesToUpdate),this.#tU({hasSelectedEditor:!0})}isSelected(t){return this.#tv.has(t)}get firstSelectedEditor(){return this.#tv.values().next().value}unselect(t){t.unselect(),this.#tv.delete(t),this.#tU({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#tv.size}get isEnterHandled(){return 1===this.#tv.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#G.undo(),this.#tU({hasSomethingToUndo:this.#G.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#tK()}),this._editorUndoBar?.hide()}redo(){this.#G.redo(),this.#tU({hasSomethingToUndo:!0,hasSomethingToRedo:this.#G.hasSomethingToRedo(),isEmpty:this.#tK()})}addCommands(t){this.#G.add(t),this.#tU({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#tK()})}cleanUndoStack(t){this.#G.cleanType(t)}#tK(){if(0===this.#N.size)return!0;if(1===this.#N.size)for(let t of this.#N.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();let t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;let e=t?[t]:[...this.#tv],i=()=>{for(let t of(this._editorUndoBar?.show(r,1===e.length?e[0].editorType:e.length),e))t.remove()},r=()=>{for(let t of e)this.#tW(t)};this.addCommands({cmd:i,undo:r,mustExec:!0})}commitOrRemove(){this.#L?.commitOrRemove()}hasSomethingToControl(){return this.#L||this.hasSelection}#tX(t){for(let t of this.#tv)t.unselect();for(let e of(this.#tv.clear(),t))e.isEmpty()||(this.#tv.add(e),e.select());this.#tU({hasSelectedEditor:this.hasSelection})}selectAll(){for(let t of this.#tv)t.commit();this.#tX(this.#N.values())}unselectAll(){if(!this.#L||(this.#L.commitOrRemove(),this.#tb===g.NONE)){if(!this.#X?.commitOrRemove()&&(this.#V?.destroyPopup(),this.hasSelection)){for(let t of this.#tv)t.unselect();this.#tv.clear(),this.#tU({hasSelectedEditor:!1})}}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;this.#tT[0]+=t,this.#tT[1]+=e;let[r,s]=this.#tT,n=[...this.#tv];for(let i of(this.#tE&&clearTimeout(this.#tE),this.#tE=setTimeout(()=>{this.#tE=null,this.#tT[0]=this.#tT[1]=0,this.addCommands({cmd:()=>{for(let t of n)this.#N.has(t.id)&&(t.translateInPage(r,s),t.translationDone())},undo:()=>{for(let t of n)this.#N.has(t.id)&&(t.translateInPage(-r,-s),t.translationDone())},mustExec:!1})},1e3),n))i.translateInPage(t,e),i.translationDone()}setUpDragSession(){if(this.hasSelection)for(let t of(this.disableUserSelect(!0),this.#Y=new Map,this.#tv))this.#Y.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#Y)return!1;this.disableUserSelect(!1);let t=this.#Y;this.#Y=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.#N.has(t.id)){let s=this.#U.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.#Y)for(let i of this.#Y.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.#tv.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#L===t}getActive(){return this.#L}getMode(){return this.#tb}isEditingMode(){return this.#tb!==g.NONE}get imageManager(){return k(this,"imageManager",new tL)}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.#$||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#$?.delete(t)}renderAnnotationElement(t){let e=this.#$?.get(t.data.id);if(!e)return;let i=this.#j.getRawValue(e);!i||(this.#tb!==g.NONE||i.hasBeenModified)&&i.renderAnnotationElement(t)}setMissingCanvas(t,e,i){let r=this.#tm?.get(t);r&&(r.setCanvas(e,i),this.#tm.delete(t))}addMissingCanvas(t,e){(this.#tm||=new Map).set(t,e)}}class tH{#l=null;#tZ=!1;#t0=null;#t1=null;#t2=null;#t5=null;#t3=!1;#t6=null;#a=null;#t4=null;#t9=null;#t8=!1;static #t7=null;static _l10n=null;constructor(t){this.#a=t,this.#t8=t._uiManager.useNewAltTextFlow,tH.#t7||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){tH._l10n??=t}async render(){let t=this.#t0=document.createElement("button");t.className="altText",t.tabIndex="0";let e=this.#t1=document.createElement("span");t.append(e),this.#t8?(t.classList.add("new"),t.setAttribute("data-l10n-id",tH.#t7.missing),e.setAttribute("data-l10n-id",tH.#t7["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let i=this.#a._uiManager._signal;t.addEventListener("contextmenu",th,{signal:i}),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});let r=t=>{t.preventDefault(),this.#a._uiManager.editAltText(this.#a),this.#t8&&this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#et}})};return t.addEventListener("click",r,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#t3=!0,r(e))},{signal:i}),await this.#ee(),t}get #et(){return this.#l&&"added"||null===this.#l&&this.guessedText&&"review"||"missing"}finish(){this.#t0&&(this.#t0.focus({focusVisible:this.#t3}),this.#t3=!1)}isEmpty(){return this.#t8?null===this.#l:!this.#l&&!this.#tZ}hasData(){return this.#t8?null!==this.#l||!!this.#t4:this.isEmpty()}get guessedText(){return this.#t4}async setGuessedText(t){null===this.#l&&(this.#t4=t,this.#t9=await tH._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#ee())}toggleAltTextBadge(t=!1){if(!this.#t8||this.#l){this.#t6?.remove(),this.#t6=null;return}if(!this.#t6){let t=this.#t6=document.createElement("div");t.className="noAltTextBadge",this.#a.div.append(t)}this.#t6.classList.toggle("hidden",!t)}serialize(t){let e=this.#l;return t||this.#t4!==e||(e=this.#t9),{altText:e,decorative:this.#tZ,guessedText:this.#t4,textWithDisclaimer:this.#t9}}get data(){return{altText:this.#l,decorative:this.#tZ}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:r,cancel:s=!1}){i&&(this.#t4=i,this.#t9=r),(this.#l!==t||this.#tZ!==e)&&(s||(this.#l=t,this.#tZ=e),this.#ee())}toggle(t=!1){this.#t0&&(!t&&this.#t5&&(clearTimeout(this.#t5),this.#t5=null),this.#t0.disabled=!t)}shown(){this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#et}})}destroy(){this.#t0?.remove(),this.#t0=null,this.#t1=null,this.#t2=null,this.#t6?.remove(),this.#t6=null}async #ee(){let t=this.#t0;if(!t)return;if(this.#t8){if(t.classList.toggle("done",!!this.#l),t.setAttribute("data-l10n-id",tH.#t7[this.#et]),this.#t1?.setAttribute("data-l10n-id",tH.#t7[`${this.#et}-label`]),!this.#l)return void this.#t2?.remove()}else{if(!this.#l&&!this.#tZ){t.classList.remove("done"),this.#t2?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#t2;if(!e){this.#t2=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#a.id}`;let i=this.#a._uiManager._signal;i.addEventListener("abort",()=>{clearTimeout(this.#t5),this.#t5=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#t5=setTimeout(()=>{this.#t5=null,this.#t2.classList.add("show"),this.#a._reportTelemetry({action:"alt_text_tooltip"})},100)},{signal:i}),t.addEventListener("mouseleave",()=>{this.#t5&&(clearTimeout(this.#t5),this.#t5=null),this.#t2?.classList.remove("show")},{signal:i})}this.#tZ?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#l),e.parentNode||t.append(e);let i=this.#a.getElementForAltText();i?.setAttribute("aria-describedby",e.id)}}class tj{#ei=null;#er=null;#es=!1;#a=null;#en=null;#ea=null;#eo=null;#el=null;#eh=!1;#ed=null;constructor(t){this.#a=t}renderForToolbar(){let t=this.#er=document.createElement("button");return t.className="comment",this.#y(t,!1)}renderForStandalone(){let t=this.#ei=document.createElement("button");t.className="annotationCommentButton";let e=this.#a.commentButtonPosition;if(e){let{style:i}=t;i.insetInlineEnd=`calc(${100*("ltr"===this.#a._uiManager.direction?1-e[0]:e[0])}% - var(--comment-button-dim))`,i.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;let r=this.#a.commentButtonColor;r&&(i.backgroundColor=r)}return this.#y(t,!0)}focusButton(){setTimeout(()=>{(this.#ei??this.#er)?.focus()},0)}onUpdatedColor(){if(!this.#ei)return;let t=this.#a.commentButtonColor;t&&(this.#ei.style.backgroundColor=t),this.#a._uiManager.updatePopupColor(this.#a)}get commentButtonWidth(){return(this.#ei?.getBoundingClientRect().width??0)/this.#a.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#ed)return this.#ed;if(!this.#ei)return null;let{x:t,y:e,height:i}=this.#ei.getBoundingClientRect(),{x:r,y:s,width:n,height:a}=this.#a.parent.boundingClientRect;return[(t-r)/n,(e+i-s)/a]}set commentPopupPositionInLayer(t){this.#ed=t}hasDefaultPopupPosition(){return null===this.#ed}removeStandaloneCommentButton(){this.#ei?.remove(),this.#ei=null}removeToolbarCommentButton(){this.#er?.remove(),this.#er=null}setCommentButtonStates({selected:t,hasPopup:e}){this.#ei&&(this.#ei.classList.toggle("selected",t),this.#ei.ariaExpanded=e)}#y(t,e){if(!this.#a._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#a._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let i=this.#a._uiManager._signal;if(!(i instanceof AbortSignal)||i.aborted)return t;t.addEventListener("contextmenu",th,{signal:i}),e&&(t.addEventListener("focusin",t=>{this.#a._focusEventsAllowed=!1,td(t)},{capture:!0,signal:i}),t.addEventListener("focusout",t=>{this.#a._focusEventsAllowed=!0,td(t)},{capture:!0,signal:i})),t.addEventListener("pointerdown",t=>t.stopPropagation(),{signal:i});let r=e=>{e.preventDefault(),t===this.#er?this.edit():this.#a.toggleComment(!0)};return t.addEventListener("click",r,{capture:!0,signal:i}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(this.#es=!0,r(e))},{signal:i}),t.addEventListener("pointerenter",()=>{this.#a.toggleComment(!1,!0)},{signal:i}),t.addEventListener("pointerleave",()=>{this.#a.toggleComment(!1,!1)},{signal:i}),t}edit(t){let e,i,r=this.commentPopupPositionInLayer;if(r)[e,i]=r;else{[e,i]=this.#a.commentButtonPosition;let{width:t,height:r,x:s,y:n}=this.#a;e=s+e*t,i=n+i*r}let s=this.#a.parent.boundingClientRect,{x:n,y:a,width:o,height:l}=s;this.#a._uiManager.editComment(this.#a,n+e*o,a+i*l,{...t,parentDimensions:s})}finish(){this.#er&&(this.#er.focus({focusVisible:this.#es}),this.#es=!1)}isDeleted(){return this.#eh||""===this.#eo}isEmpty(){return null===this.#eo}hasBeenEdited(){return this.isDeleted()||this.#eo!==this.#en}serialize(){return this.data}get data(){return{text:this.#eo,richText:this.#ea,date:this.#el,deleted:this.isDeleted()}}set data(t){if(t!==this.#eo&&(this.#ea=null),null===t){this.#eo="",this.#eh=!0;return}this.#eo=t,this.#el=new Date,this.#eh=!1}restoreData({text:t,richText:e,date:i}){this.#eo=t,this.#ea=e,this.#el=i,this.#eh=!1}setInitialText(t,e=null){this.#en=t,this.data=t,this.#el=null,this.#ea=e}shown(){}destroy(){this.#er?.remove(),this.#er=null,this.#ei?.remove(),this.#ei=null,this.#eo="",this.#ea=null,this.#el=null,this.#a=null,this.#es=!1,this.#eh=!1}}class t${#tC;#ec=!1;#eu=null;#ep;#eg;#em;#ef;#eb=null;#ev;#ey=null;#eA;#ex=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:r=null,onPinching:s=null,onPinchEnd:n=null,signal:a}){this.#tC=t,this.#eu=i,this.#ep=e,this.#eg=r,this.#em=s,this.#ef=n,this.#eA=new AbortController,this.#ev=AbortSignal.any([a,this.#eA.signal]),t.addEventListener("touchstart",this.#ew.bind(this),{passive:!1,signal:this.#ev})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/tv.pixelRatio}#ew(t){if(this.#ep?.())return;if(1===t.touches.length){if(this.#eb)return;let t=this.#eb=new AbortController,e=AbortSignal.any([this.#ev,t.signal]),i=this.#tC,r={capture:!0,signal:e,passive:!1},s=t=>{"touch"===t.pointerType&&(this.#eb?.abort(),this.#eb=null)};i.addEventListener("pointerdown",t=>{"touch"===t.pointerType&&(td(t),s(t))},r),i.addEventListener("pointerup",s,r),i.addEventListener("pointercancel",s,r);return}if(!this.#ex){this.#ex=new AbortController;let t=AbortSignal.any([this.#ev,this.#ex.signal]),e=this.#tC,i={signal:t,capture:!1,passive:!1};e.addEventListener("touchmove",this.#e_.bind(this),i);let r=this.#eS.bind(this);e.addEventListener("touchend",r,i),e.addEventListener("touchcancel",r,i),i.capture=!0,e.addEventListener("pointerdown",td,i),e.addEventListener("pointermove",td,i),e.addEventListener("pointercancel",td,i),e.addEventListener("pointerup",td,i),this.#eg?.()}if(td(t),2!==t.touches.length||this.#eu?.()){this.#ey=null;return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),this.#ey={touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY}}#e_(t){if(!this.#ey||2!==t.touches.length)return;td(t);let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);let{screenX:r,screenY:s}=e,{screenX:n,screenY:a}=i,o=this.#ey,{touch0X:l,touch0Y:h,touch1X:d,touch1Y:c}=o,u=Math.hypot(n-r,a-s)||1,p=Math.hypot(d-l,c-h)||1;if(!this.#ec&&Math.abs(p-u)<=t$.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(o.touch0X=r,o.touch0Y=s,o.touch1X=n,o.touch1Y=a,!this.#ec){this.#ec=!0;return}let g=[(r+n)/2,(s+a)/2];this.#em?.(g,p,u)}#eS(t){t.touches.length>=2||(this.#ex&&(this.#ex.abort(),this.#ex=null,this.#ef?.()),this.#ey&&(td(t),this.#ey=null,this.#ec=!1))}destroy(){this.#eA?.abort(),this.#eA=null,this.#eb?.abort(),this.#eb=null}}class tG{#eT=null;#eE=null;#l=null;#h=null;#ei=null;#eC=!1;#eM=null;#eP="";#ek=null;#eD=null;#eI=null;#eR=null;#eB=null;#eF="";#eL=!1;#eO=null;#eN=!1;#eU=!1;#ez=!1;#eH=null;#ej=0;#e$=0;#eG=null;#eV=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#eW=!1;#eX=tG._zIndex++;static _borderLineWidth=-1;static _colorManager=new tU;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=tG.prototype._resizeWithKeyboard,e=tz.TRANSLATE_SMALL,i=tz.TRANSLATE_BIG;return k(this,"_resizerKeyboardManager",new tN([[["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"],tG.prototype._stopResizingWithKeyboard]]))}constructor(t){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,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null,this.canAddComment=!0;const{rotation:e,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:n}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,n];const[a,o]=this.parentDimensions;this.x=t.x/a,this.y=t.y/o,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(t){this.pageIndex=t}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return k(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new tV({id:t._uiManager.getId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(tG._l10n??=t,tG._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==tG._borderLineWidth)return;let i=getComputedStyle(document.documentElement);tG._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){T("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#eW}set _isDraggable(t){this.#eW=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}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}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#eX}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#eq(),this.#eR?.remove(),this.#eR=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#eL?this.#eL=!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.isInEditMode()&&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()}_moveAfterPaste(t,e){if(this.isClone)return void delete this.isClone;let[i,r]=this.parentDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r),this._onTranslated()}#eK([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#eK(this.parentDimensions,t,e)}translateInPage(t,e){this.#eO||=[this.x,this.y,this.width,this.height],this.#eK(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#eO||=[this.x,this.y,this.width,this.height];let{div:i,parentDimensions:[r,s]}=this;if(this.x+=t/r,this.y+=e/s,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:n,y:a}=this,[o,l]=this.getBaseTranslation();n+=o,a+=l;let{style:h}=i;h.left=`${(100*n).toFixed(2)}%`,h.top=`${(100*a).toFixed(2)}%`,this._onTranslating(n,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#eO&&(this.#eO[0]!==this.x||this.#eO[1]!==this.y)}get _hasBeenResized(){return!!this.#eO&&(this.#eO[2]!==this.width||this.#eO[3]!==this.height)}getBaseTranslation(){let[t,e]=this.parentDimensions,{_borderLineWidth:i}=tG,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{div:{style:e},pageDimensions:[i,r]}=this,{x:s,y:n,width:a,height:o}=this;if(a*=i,o*=r,s*=i,n*=r,this._mustFixPosition)switch(t){case 0:s=K(s,0,i-a),n=K(n,0,r-o);break;case 90:s=K(s,0,i-o),n=K(n,a,r);break;case 180:s=K(s,a,i),n=K(n,o,r);break;case 270:s=K(s,o,i),n=K(n,0,r-a)}this.x=s/=i,this.y=n/=r;let[l,h]=this.getBaseTranslation();s+=l,n+=h,e.left=`${(100*s).toFixed(2)}%`,e.top=`${(100*n).toFixed(2)}%`,this.moveInDOM()}static #eY(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 tG.#eY(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return tG.#eY(t,e,360-this.parentRotation)}#eJ(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;return[e*t,i*t]}setDims(){let{div:{style:t},width:e,height:i}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*i).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#eQ(){if(this.#ek)return;this.#ek=document.createElement("div"),this.#ek.classList.add("resizers");let t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(let i of t){let t=document.createElement("div");this.#ek.append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",this.#eZ.bind(this,i),{signal:e}),t.addEventListener("contextmenu",th,{signal:e}),t.tabIndex=-1}this.div.prepend(this.#ek)}#eZ(t,e){e.preventDefault();let{isMac:i}=U.platform;if(0!==e.button||e.ctrlKey&&i)return;this.#l?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#eD=[e.screenX,e.screenY];let s=new AbortController,n=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#e0.bind(this,t),{passive:!0,capture:!0,signal:n}),window.addEventListener("touchmove",td,{passive:!1,signal:n}),window.addEventListener("contextmenu",th,{signal:n}),this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let a=this.parent.div.style.cursor,o=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let l=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#l?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=a,this.div.style.cursor=o,this.#e1()};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})}#e2(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#e1(){if(!this.#eI)return;let{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=this.#eI;this.#eI=null;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.#e2.bind(this,s,n,a,o),undo:this.#e2.bind(this,t,e,i,r),mustExec:!0})}static _round(t){return Math.round(1e4*t)/1e4}#e0(t,e){let i,r,s,n,a,o,[l,h]=this.parentDimensions,d=this.x,c=this.y,u=this.width,p=this.height,g=tG.MIN_SIZE/l,m=tG.MIN_SIZE/h,f=this.#eJ(this.rotation),b=(t,e)=>[f[0]*t+f[2]*e,f[1]*t+f[3]*e],v=this.#eJ(360-this.rotation),y=!1,A=!1;switch(t){case"topLeft":y=!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":y=!0,i=(t,e)=>[t,0],r=(t,e)=>[0,e];break;case"middleRight":A=!0,i=(t,e)=>[t,e/2],r=(t,e)=>[0,e/2];break;case"bottomRight":y=!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":y=!0,i=(t,e)=>[0,e],r=(t,e)=>[t,0];break;case"middleLeft":A=!0,i=(t,e)=>[0,e/2],r=(t,e)=>[t,e/2]}let x=i(u,p),w=r(u,p),_=b(...w),S=tG._round(d+_[0]),T=tG._round(c+_[1]),E=1,C=1;if(e.fromKeyboard)({deltaX:s,deltaY:n}=e);else{let{screenX:t,screenY:i}=e,[r,a]=this.#eD;[s,n]=this.screenToPageTranslation(t-r,i-a),this.#eD[0]=t,this.#eD[1]=i}if([s,n]=(a=s/l,o=n/h,[v[0]*a+v[2]*o,v[1]*a+v[3]*o]),y){let t=Math.hypot(u,p);E=C=Math.max(Math.min(Math.hypot(w[0]-x[0]-s,w[1]-x[1]-n)/t,1/u,1/p),g/u,m/p)}else A?E=K(Math.abs(w[0]-x[0]-s),g,1)/u:C=K(Math.abs(w[1]-x[1]-n),m,1)/p;let M=tG._round(u*E),P=tG._round(p*C),k=S-(_=b(...r(M,P)))[0],D=T-_[1];this.#eO||=[this.x,this.y,this.width,this.height],this.width=M,this.height=P,this.x=k,this.y=D,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#l?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#eU)return this._editToolbar;this._editToolbar=new tD(this),this.div.append(this._editToolbar.render());let{toolbarButtons:t}=this;if(t)for(let[e,i]of t)await this._editToolbar.addButton(e,i);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#l?.destroy()}addContainer(t){let e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return!this.#l&&(tH.initialize(tG._l10n),this.#l=new tH(this),this.#eT&&(this.#l.data=this.#eT,this.#eT=null)),this.#l}get altTextData(){return this.#l?.data}set altTextData(t){this.#l&&(this.#l.data=t)}get guessedAltText(){return this.#l?.guessedText}async setGuessedAltText(t){await this.#l?.setGuessedText(t)}serializeAltText(t){return this.#l?.serialize(t)}hasAltText(){return!!this.#l&&!this.#l.isEmpty()}hasAltTextData(){return this.#l?.hasData()??!1}focusCommentButton(){this.#h?.focusButton()}addCommentButton(){return this.canAddComment?this.#h||=new tj(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#ei){this._uiManager.isEditingMode()&&this.#ei.classList.remove("hidden");return}this.hasComment&&(this.#ei=this.#h.renderForStandalone(),this.div.append(this.#ei))}}removeStandaloneCommentButton(){this.#h.removeStandaloneCommentButton(),this.#ei=null}hideStandaloneCommentButton(){this.#ei?.classList.add("hidden")}get comment(){if(!this.#h)return null;let{data:{richText:t,text:e,date:i,deleted:r}}=this.#h;return{text:e,richText:t,date:i,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#h||=new tj(this),"object"==typeof t&&null!==t?this.#h.restoreData(t):this.#h.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:i}){if(!e||(this.#h||=new tj(this),this.#h.setInitialText(t,i),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#h?.hasBeenEdited()}get hasDeletedComment(){return this.#h?.isDeleted()}get hasComment(){return!!this.#h&&!this.#h.isEmpty()&&!this.#h.isDeleted()}async editComment(t){this.#h||=new tj(this),this.#h.edit(t)}toggleComment(t,e){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#h.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){let[,,,e]=t.rect,[i]=this.pageDimensions,[r]=this.pageTranslation,s=r+i+1;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[s,e-100,s+180,e]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#h.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#eC?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#e5();let[e,i]=this.parentDimensions;this.parentRotation%180!=0&&(t.style.maxWidth=`${(100*i/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/i).toFixed(2)}%`);let[r,s]=this.getInitialTranslation();return this.translate(r,s),tR(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#eV||=new t$({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#e3.bind(this),onPinching:this.#e6.bind(this),onPinchEnd:this.#e4.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#e3(){this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#l?.toggle(!1),this.parent.togglePointerEvents(!1)}#e6(t,e,i){let r=i/e*.7+1-.7;if(1===r)return;let s=this.#eJ(this.rotation),n=(t,e)=>[s[0]*t+s[2]*e,s[1]*t+s[3]*e],[a,o]=this.parentDimensions,l=this.x,h=this.y,d=this.width,c=this.height;r=Math.max(Math.min(r,1/d,1/c),tG.MIN_SIZE/a/d,tG.MIN_SIZE/o/c);let u=tG._round(d*r),p=tG._round(c*r);if(u===d&&p===c)return;this.#eO||=[l,h,d,c];let g=n(d/2,c/2),m=tG._round(l+g[0]),f=tG._round(h+g[1]),b=n(u/2,p/2);this.x=m-b[0],this.y=f-b[1],this.width=u,this.height=p,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#e4(){this.#l?.toggle(!0),this.parent.togglePointerEvents(!0),this.#e1()}pointerdown(t){let{isMac:e}=U.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#eL=!0,this._isDraggable)?this.#e9(t):this.#e8(t)}#e8(t){let{isMac:e}=U.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#e9(t){let{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1,r=new AbortController,s=this._uiManager.combinedSignal(r),n={capture:!0,passive:!1,signal:s},a=t=>{r.abort(),this.#eM=null,this.#eL=!1,this._uiManager.endDragSession()||this.#e8(t),i&&this._onStopDragging()};e&&(this.#ej=t.clientX,this.#e$=t.clientY,this.#eM=t.pointerId,this.#eP=t.pointerType,window.addEventListener("pointermove",t=>{i||(i=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:e,clientY:r,pointerId:s}=t;if(s!==this.#eM)return void td(t);let[n,a]=this.screenToPageTranslation(e-this.#ej,r-this.#e$);this.#ej=e,this.#e$=r,this._uiManager.dragSelectedEditors(n,a)},n),window.addEventListener("touchmove",td,n),window.addEventListener("pointerdown",t=>{t.pointerType===this.#eP&&(this.#eV||t.isPrimary)&&a(t),td(t)},n));let o=t=>{this.#eM&&this.#eM!==t.pointerId?td(t):a(t)};window.addEventListener("pointerup",o,{signal:s}),window.addEventListener("blur",o,{signal:s})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#eH&&clearTimeout(this.#eH),this.#eH=setTimeout(()=>{this.#eH=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}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")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&tG._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#h?.onUpdatedColor()}getData(){let{comment:{text:t,color:e,date:i,opacity:r,deleted:s,richText:n},uid:a,pageIndex:o,creationDate:l,modificationDate:h}=this;return{id:a,pageIndex:o,rect:this.getPDFRect(),richText:n,contentsObj:{str:t},creationDate:l,modificationDate:i||h,popupRef:!s,color:e,opacity:r}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#eU=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#eU=!1,!0)}isInEditMode(){return this.#eU}shouldGetKeyboardEvents(){return this.#ez}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:t,left:e,bottom:i,right:r}=this.getClientDimensions(),{innerHeight:s,innerWidth:n}=window;return e<n&&r>0&&t<s&&i>0}#e5(){if(this.#eB||!this.div)return;this.#eB=new AbortController;let t=this._uiManager.combinedSignal(this.#eB);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#e5()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,i){let r=new this.prototype.constructor({parent:e,id:i.getId(),uiManager:i,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});r.rotation=t.rotation,r.#eT=t.accessibilityData,r._isCopy=t.isCopy||!1;let[s,n]=r.pageDimensions,[a,o,l,h]=r.getRectInCurrentCoords(t.rect,n);return 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.#eB?.abort(),this.#eB=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#eH&&(clearTimeout(this.#eH),this.#eH=null),this.#eq(),this.removeEditToolbar(),this.#eG){for(let t of this.#eG.values())clearTimeout(t);this.#eG=null}this.parent=null,this.#eV?.destroy(),this.#eV=null,this.#eR?.remove(),this.#eR=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#eQ(),this.#ek.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,e]}=this,[i,r,s,n]=this.getPDFRect();return[tG._round(i+(s-i)*t),tG._round(r+(n-r)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#h.commentPopupPositionInLayer}set commentPopupPosition(t){this.#h.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#h.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#h.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#h?.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),this.#eI={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let e=this.#ek.children;if(!this.#eE){this.#eE=Array.from(e);let t=this.#e7.bind(this),i=this.#it.bind(this),r=this._uiManager._signal;for(let e of this.#eE){let s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:r}),e.addEventListener("blur",i,{signal:r}),e.addEventListener("focus",this.#ie.bind(this,s),{signal:r}),e.setAttribute("data-l10n-id",tG._l10nResizer[s])}}let i=this.#eE[0],r=0;for(let t of e){if(t===i)break;r++}let s=(360-this.rotation+this.parentRotation)%360/90*(this.#eE.length/4);if(s!==r){if(s<r)for(let t=0;t<r-s;t++)this.#ek.append(this.#ek.firstElementChild);else if(s>r)for(let t=0;t<s-r;t++)this.#ek.firstElementChild.before(this.#ek.lastElementChild);let t=0;for(let i of e){let e=this.#eE[t++].getAttribute("data-resizer-name");i.setAttribute("data-l10n-id",tG._l10nResizer[e])}}this.#ii(0),this.#ez=!0,this.#ek.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#e7(t){tG._resizerKeyboardManager.exec(this,t)}#it(t){this.#ez&&t.relatedTarget?.parentNode!==this.#ek&&this.#eq()}#ie(t){this.#eF=this.#ez?t:""}#ii(t){if(this.#eE)for(let e of this.#eE)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#ez&&this.#e0(this.#eF,{deltaX:t,deltaY:e,fromKeyboard:!0})}#eq(){this.#ez=!1,this.#ii(-1),this.#e1()}_stopResizingWithKeyboard(){this.#eq(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar)?(this._editToolbar?.show(),this.#l?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#ek?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#l?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){"BUTTON"!==t.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#eN}set isEditing(t){this.#eN=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#eG||=new Map;let{action:e}=t,i=this.#eG.get(e);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#eG.delete(e),0===this.#eG.size&&(this.#eG=null)},tG._telemetryTimeout),this.#eG.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.#eC=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#eC=!0}updateFakeAnnotationElement(t){if(!this.#eR&&!this.deleted){this.#eR=t.addFakeAnnotation(this);return}if(this.deleted){this.#eR.remove(),this.#eR=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#eR.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;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{firstElementChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}}class tV extends tG{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}class tW{constructor(t){this.h1=t?0|t:0xc3d2e1f0,this.h2=t?0|t:0xc3d2e1f0}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?(l^=a=0x1b873593*(a=(a=0xcc9e2d51*(a=n[t])&0xffff0000|11601*a&65535)<<15|a>>>17)&0xffff0000|13715*a&65535,l=5*(l=l<<13|l>>>19)+0xe6546b64):(h^=o=0x1b873593*(o=(o=0xcc9e2d51*(o=n[t])&0xffff0000|11601*o&65535)<<15|o>>>17)&0xffff0000|13715*o&65535,h=5*(h=h<<13|h>>>19)+0xe6546b64);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=0x1b873593*(a=(a=0xcc9e2d51*a&0xffff0000|11601*a&65535)<<15|a>>>17)&0xffff0000|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,e=0xff51afd7*e&0xffff0000|((e<<16|(t=0xed558ccd*t&0xffff0000|36045*t&65535)>>>16)*0xafd7ed55&0xffff0000)>>>16,t^=e>>>1,e=0xc4ceb9fe*e&0xffff0000|((e<<16|(t=0x1a85ec53*t&0xffff0000|60499*t&65535)>>>16)*0xb9fe1a85&0xffff0000)>>>16,((t^=e>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}let tX=Object.freeze({map:null,hash:"",transfer:void 0});class tq{#ir=!1;#is=null;#ia=null;#io=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(t,e){let i=this.#io.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#io.get(t)}remove(t){let e=this.#io.get(t);void 0===e||(e instanceof tG&&this.#ia.delete(e.annotationElementId),this.#io.delete(t),0===this.#io.size&&this.resetModified(),this.#io.values().some(t=>t instanceof tG)||this.onAnnotationEditor?.(null))}setValue(t,e){let i=this.#io.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.#io.set(t,e);r&&this.#il(),e instanceof tG&&((this.#ia||=new Map).set(e.annotationElementId,e),this.onAnnotationEditor?.(e.constructor._type))}has(t){return this.#io.has(t)}get size(){return this.#io.size}#il(){this.#ir||(this.#ir=!0,this.onSetModified?.())}resetModified(){this.#ir&&(this.#ir=!1,this.onResetModified?.())}get print(){return new tK(this)}get serializable(){if(0===this.#io.size)return tX;let t=new Map,e=new tW,i=[],r=Object.create(null),s=!1;for(let[i,n]of this.#io){let a=n instanceof tG?n.serialize(!1,r):n;n.page&&(n.pageIndex=n.page._pageIndex,delete n.page),a&&(t.set(i,a),e.update(`${i}:${JSON.stringify(a)}`),s||=!!a.bitmap)}if(s)for(let e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:tX}get editorStats(){let t=null,e=new Map,i=0,r=0;for(let s of this.#io.values()){if(!(s instanceof tG)){s.popup&&(s.popup.deleted?r+=1:i+=1);continue}s.isCommentDeleted?r+=1:s.hasEditedComment&&(i+=1);let n=s.telemetryFinalData;if(!n)continue;let{type:a}=n;e.has(a)||e.set(a,Object.getPrototypeOf(s).constructor),t||=Object.create(null);let o=t[a]||=new Map;for(let[t,e]of Object.entries(n)){if("type"===t)continue;let i=o.getOrInsertComputed(t,X);i.set(e,(i.get(e)??0)+1)}}if((r>0||i>0)&&((t||=Object.create(null)).comments={deleted:r,edited:i}),!t)return null;for(let[i,r]of e)t[i]=r.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){this.#is=null}updateEditor(t,e){let i=this.#ia?.get(t);return!!i&&(i.updateFromAnnotationLayer(e),!0)}getEditor(t){return this.#ia?.get(t)||null}get modifiedIds(){if(this.#is)return this.#is;let t=[];if(this.#ia)for(let e of this.#ia.values())e.serialize()&&t.push(e.annotationElementId);let e="";if(t.length){let i=new tW;i.update(t.join(",")),e=i.hexdigest()}return this.#is={ids:new Set(t),hash:e}}[Symbol.iterator](){return this.#io.entries()}}class tK extends tq{#ih=tX;constructor(t){super();const{serializable:e}=t;if(e===tX)return;const{map:i,hash:r,transfer:s}=e,n=structuredClone(i,s?{transfer:s}:null);this.#ih={map:n,hash:r,transfer:[]}}get print(){T("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#ih}get modifiedIds(){return k(this,"modifiedIds",{ids:new Set,hash:""})}}o(7588);let tY="__forcedDependency",{floor:tJ,ceil:tQ}=Math;function tZ(t,e,i,r,s,n){t[4*e+0]=Math.min(t[4*e+0],i),t[4*e+1]=Math.min(t[4*e+1],r),t[4*e+2]=Math.max(t[4*e+2],s),t[4*e+3]=Math.max(t[4*e+3],n)}let t0=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class t1{#id;#ic;constructor(t,e){this.#id=t,this.#ic=e}get length(){return this.#id.length}isEmpty(t){return this.#id[t]===t0}minX(t){return this.#ic[4*t+0]/256}minY(t){return this.#ic[4*t+1]/256}maxX(t){return(this.#ic[4*t+2]+1)/256}maxY(t){return(this.#ic[4*t+3]+1)/256}}let t2=(t,e)=>t?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class t5{#iu=[[1,0,0,1,0,0]];#ip=[-1/0,-1/0,1/0,1/0];#ig=new Float64Array(h);_pendingBBoxIdx=-1;#im;#ib;#iv;#id;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#im=t.width,this.#ib=t.height,this.#iy(e)}growOperationsCount(t){t>=this.#id.length&&this.#iy(t,this.#id)}#iy(t,e){let i=new ArrayBuffer(4*t);this.#iv=new Uint8ClampedArray(i),this.#id=new Uint32Array(i),e&&e.length>0?(this.#id.set(e),this.#id.fill(t0,e.length)):this.#id.fill(t0)}get clipBox(){return this.#ip}save(t){return this.#ip={__proto__:this.#ip},this._savesStack.push(t),this}restore(t,e){let i=Object.getPrototypeOf(this.#ip);if(null===i)return this;this.#ip=i;let r=this._savesStack.pop();return void 0!==r&&(e?.(r,t),this.#id[t]=this.#id[r]),this}recordOpenMarker(t){return this._savesStack.push(t),this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(t,e){let i=this._savesStack.pop();return void 0!==i&&(e?.(i,t),this.#id[t]=this.#id[i]),this}beginMarkedContent(t){return this._markedContentStack.push(t),this}endMarkedContent(t,e){let i=this._markedContentStack.pop();return void 0!==i&&(e?.(i,t),this.#id[t]=this.#id[i]),this}pushBaseTransform(t){return this.#iu.push(z.multiplyByDOMMatrix(this.#iu.at(-1),t.getTransform())),this}popBaseTransform(){return this.#iu.length>1&&this.#iu.pop(),this}resetBBox(t){return this._pendingBBoxIdx!==t&&(this._pendingBBoxIdx=t,this.#ig.set(h,0)),this}recordClipBox(t,e,i,r,s,n){let a=z.multiplyByDOMMatrix(this.#iu.at(-1),e.getTransform()),o=h.slice();z.axialAlignedBoundingBox([i,s,r,n],a,o);let l=z.intersect(this.#ip,o);return l?(this.#ip[0]=l[0],this.#ip[1]=l[1],this.#ip[2]=l[2],this.#ip[3]=l[3]):(this.#ip[0]=this.#ip[1]=1/0,this.#ip[2]=this.#ip[3]=-1/0),this}recordBBox(t,e,i,r,s,n){let a=this.#ip;if(a[0]===1/0)return this;let o=z.multiplyByDOMMatrix(this.#iu.at(-1),e.getTransform());if(a[0]===-1/0)return z.axialAlignedBoundingBox([i,s,r,n],o,this.#ig),this;let l=h.slice();return z.axialAlignedBoundingBox([i,s,r,n],o,l),this.#ig[0]=K(l[0],a[0],this.#ig[0]),this.#ig[1]=K(l[1],a[1],this.#ig[1]),this.#ig[2]=K(l[2],this.#ig[2],a[2]),this.#ig[3]=K(l[3],this.#ig[3],a[3]),this}recordFullPageBBox(t){return this.#ig[0]=Math.max(0,this.#ip[0]),this.#ig[1]=Math.max(0,this.#ip[1]),this.#ig[2]=Math.min(this.#im,this.#ip[2]),this.#ig[3]=Math.min(this.#ib,this.#ip[3]),this}recordOperation(t,e=!1,i){if(this._pendingBBoxIdx!==t)return this;let r=tJ(256*this.#ig[0]/this.#im),s=tJ(256*this.#ig[1]/this.#ib),n=tQ(256*this.#ig[2]/this.#im),a=tQ(256*this.#ig[3]/this.#ib);if(tZ(this.#iv,t,r,s,n,a),i)for(let e of i)for(let i of e)i!==t&&tZ(this.#iv,i,r,s,n,a);return e||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(t){return this._pendingBBoxIdx===t&&(this._pendingBBoxIdx=-1,this.#ip[0]=Math.max(this.#ip[0],this.#ig[0]),this.#ip[1]=Math.max(this.#ip[1],this.#ig[1]),this.#ip[2]=Math.min(this.#ip[2],this.#ig[2]),this.#ip[3]=Math.min(this.#ip[3],this.#ig[3])),this}take(){return new t1(this.#id,this.#iv)}takeDebugMetadata(){throw Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,i,r=1,s=0,n=0,a){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class t3{#iA={__proto__:null};#ix={__proto__:null,transform:[],moveText:[],sameLineText:[],[tY]:[]};#iw=new Map;#i_=new Set;#iS=new Map;#iT;#iE;#iC;constructor(t,e=!1){this.#iC=t,e&&(this.#iT=new Map,this.#iE=(t,e)=>{t2(this.#iT,e).dependencies.add(t)})}get clipBox(){return this.#iC.clipBox}growOperationsCount(t){this.#iC.growOperationsCount(t)}save(t){return this.#iA={__proto__:this.#iA},this.#ix={__proto__:this.#ix,transform:{__proto__:this.#ix.transform},moveText:{__proto__:this.#ix.moveText},sameLineText:{__proto__:this.#ix.sameLineText},[tY]:{__proto__:this.#ix[tY]}},this.#iC.save(t),this}restore(t){this.#iC.restore(t,this.#iE);let e=Object.getPrototypeOf(this.#iA);return null===e||(this.#iA=e,this.#ix=Object.getPrototypeOf(this.#ix)),this}recordOpenMarker(t){return this.#iC.recordOpenMarker(t,this.#iE),this}getOpenMarker(){return this.#iC.getOpenMarker()}recordCloseMarker(t){return this.#iC.recordCloseMarker(t,this.#iE),this}beginMarkedContent(t){return this.#iC.beginMarkedContent(t),this}endMarkedContent(t){return this.#iC.endMarkedContent(t,this.#iE),this}pushBaseTransform(t){return this.#iC.pushBaseTransform(t),this}popBaseTransform(){return this.#iC.popBaseTransform(),this}recordSimpleData(t,e){return this.#iA[t]=e,this}recordIncrementalData(t,e){return this.#ix[t].push(e),this}resetIncrementalData(t,e){return this.#ix[t].length=0,this}recordNamedData(t,e){return this.#iw.set(t,e),this}recordSimpleDataFromNamed(t,e,i){this.#iA[t]=this.#iw.get(e)??i}recordFutureForcedDependency(t,e){return this.recordIncrementalData(tY,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(let e of t)e in this.#iA&&this.recordFutureForcedDependency(e,this.#iA[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let t of this.#i_)this.recordFutureForcedDependency(tY,t);return this}resetBBox(t){return this.#iC.resetBBox(t),this}recordClipBox(t,e,i,r,s,n){return this.#iC.recordClipBox(t,e,i,r,s,n),this}recordBBox(t,e,i,r,s,n){return this.#iC.recordBBox(t,e,i,r,s,n),this}recordCharacterBBox(t,e,i,r=1,s=0,n=0,a){let o,l,h=i.bbox;if(h&&!1!==(o=h[2]!==h[0]&&h[3]!==h[1]&&this.#iS.get(i))&&(l=[0,0,0,0],z.axialAlignedBoundingBox(h,i.fontMatrix,l),(1!==r||0!==s||0!==n)&&z.scaleMinMax([r,0,0,-r,s,n],l),o))return this.recordBBox(t,e,l[0],l[2],l[1],l[3]);if(!a)return this.recordFullPageBBox(t);let d=a();return h&&l&&void 0===o&&(o=l[0]<=s-d.actualBoundingBoxLeft&&l[2]>=s+d.actualBoundingBoxRight&&l[1]<=n-d.actualBoundingBoxAscent&&l[3]>=n+d.actualBoundingBoxDescent,this.#iS.set(i,o),o)?this.recordBBox(t,e,l[0],l[2],l[1],l[3]):this.recordBBox(t,e,s-d.actualBoundingBoxLeft,s+d.actualBoundingBoxRight,n-d.actualBoundingBoxAscent,n+d.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#iC.recordFullPageBBox(t),this}getSimpleIndex(t){return this.#iA[t]}recordDependencies(t,e){let i=this.#i_,r=this.#iA,s=this.#ix;for(let t of e)t in this.#iA?i.add(r[t]):t in s&&s[t].forEach(i.add,i);return this}recordNamedDependency(t,e){return this.#iw.has(e)&&this.#i_.add(this.#iw.get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[tY]),this.#iT){let e=t2(this.#iT,t),{dependencies:i}=e;this.#i_.forEach(i.add,i),this.#iC._savesStack.forEach(i.add,i),this.#iC._markedContentStack.forEach(i.add,i),i.delete(t),e.isRenderingOperation=!0}let i=!e&&t===this.#iC._pendingBBoxIdx;return this.#iC.recordOperation(t,e,[this.#i_,this.#iC._savesStack,this.#iC._markedContentStack]),i&&this.#i_.clear(),this}recordShowTextOperation(t,e=!1){let i=Array.from(this.#i_);for(let r of(this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t),i))this.recordIncrementalData("sameLineText",r);return this}bboxToClipBoxDropOperation(t,e=!1){let i=!e&&t===this.#iC._pendingBBoxIdx;return this.#iC.bboxToClipBoxDropOperation(t),i&&this.#i_.clear(),this}take(){return this.#iS.clear(),this.#iC.take()}takeDebugMetadata(){return this.#iT}}class t6{#iM;#iP;#ik;#iD=0;#iI=0;constructor(t,e,i){if(t instanceof t6&&!!i===t.#ik)return t;this.#iM=t,this.#iP=e,this.#ik=!!i}get clipBox(){return this.#iM.clipBox}growOperationsCount(){throw Error("Unreachable")}save(t){return this.#iI++,this.#iM.save(this.#iP),this}restore(t){return this.#iI>0&&(this.#iM.restore(this.#iP),this.#iI--),this}recordOpenMarker(t){return this.#iD++,this}getOpenMarker(){return this.#iD>0?this.#iP:this.#iM.getOpenMarker()}recordCloseMarker(t){return this.#iD--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#iM.pushBaseTransform(t),this}popBaseTransform(){return this.#iM.popBaseTransform(),this}recordSimpleData(t,e){return this.#iM.recordSimpleData(t,this.#iP),this}recordIncrementalData(t,e){return this.#iM.recordIncrementalData(t,this.#iP),this}resetIncrementalData(t,e){return this.#iM.resetIncrementalData(t,this.#iP),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,i){return this.#iM.recordSimpleDataFromNamed(t,e,this.#iP),this}recordFutureForcedDependency(t,e){return this.#iM.recordFutureForcedDependency(t,this.#iP),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#iM.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#iM.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#ik||this.#iM.resetBBox(this.#iP),this}recordClipBox(t,e,i,r,s,n){return this.#ik||this.#iM.recordClipBox(this.#iP,e,i,r,s,n),this}recordBBox(t,e,i,r,s,n){return this.#ik||this.#iM.recordBBox(this.#iP,e,i,r,s,n),this}recordCharacterBBox(t,e,i,r,s,n,a){return this.#ik||this.#iM.recordCharacterBBox(this.#iP,e,i,r,s,n,a),this}recordFullPageBBox(t){return this.#ik||this.#iM.recordFullPageBBox(this.#iP),this}getSimpleIndex(t){return this.#iM.getSimpleIndex(t)}recordDependencies(t,e){return this.#iM.recordDependencies(this.#iP,e),this}recordNamedDependency(t,e){return this.#iM.recordNamedDependency(this.#iP,e),this}recordOperation(t){return this.#iM.recordOperation(this.#iP,!0),this}recordShowTextOperation(t){return this.#iM.recordShowTextOperation(this.#iP,!0),this}bboxToClipBoxDropOperation(t){return this.#ik||this.#iM.bboxToClipBoxDropOperation(this.#iP,!0),this}take(){throw Error("Unreachable")}takeDebugMetadata(){throw Error("Unreachable")}}let t4=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],t9=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],t8=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],t7=["filter","fillColor","fillAlpha"],et=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],ee=["transform"],ei=["transform","fillColor"];class er{#im;#ib;#iR=4;#iB=0;#ic=new er.#iF(6*this.#iR);static #iF=U.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#im=t.width,this.#ib=t.height}record(t,e,i,r){let s;if(this.#iB===this.#iR){this.#iR*=2;let t=new er.#iF(6*this.#iR);t.set(this.#ic),this.#ic=t}let n=z.domMatrixToTransform(t.getTransform());if(r[0]!==1/0){let t=h.slice();z.axialAlignedBoundingBox([0,-i,e,0],n,t);let a=z.intersect(r,t);if(!a)return;let[o,l,d,c]=a;if(o!==t[0]||l!==t[1]||d!==t[2]||c!==t[3]){let t=Math.atan2(n[1],n[0]),e=Math.abs(Math.sin(t)),i=Math.abs(Math.cos(t));if(e<1e-6||i<1e-6||1e-6>Math.abs(e-i))s=[o,l,o,c,d,l];else{let t=d-o,r=c-l,n=e*e,a=i*i,h=i*e,u=a-n,p=(r*a-t*h)/u;s=[o+(r*h-t*n)/u,l,o,l+p,d,c-p]}}}s||(s=[0,-i,0,0,e,-i],z.applyTransform(s,n,0),z.applyTransform(s,n,2),z.applyTransform(s,n,4)),s[0]/=this.#im,s[1]/=this.#ib,s[2]/=this.#im,s[3]/=this.#ib,s[4]/=this.#im,s[5]/=this.#ib,this.#ic.set(s,6*this.#iB),this.#iB++}take(){return this.#ic.subarray(0,6*this.#iB)}}class es{#iL=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.#iL.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:i}){if(!(!t||this.#iL.has(t.loadedName))){if(E(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:e,src:r,style:s}=t,n=new FontFace(e,r,s);this.addNativeFontFace(n);try{await n.load(),this.#iL.add(e),i?.(t)}catch{S(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(n)}return}T("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)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw S(`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(){return k(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return k(this,"isSyncFontLoadingSupported",l||U.platform.isFirefox)}_queueLoadingCallback(t){let{loadingRequests:e}=this,i={done:!1,complete:function(){for(E(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;)setTimeout(e.shift().callback,0)},callback:t};return e.push(i),i}get _loadTestFont(){return k(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){var i;let r,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){return t.substring(0,e)+r+t.substring(e+i)}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,u=n(c=a(c,976,d.length,d),16);for(r=0,s=d.length-3;r<s;r+=4)u=u-0x58585858+n(d,r)|0;r<d.length&&(u=u-0x58585858+n(d+"XXX",r)|0),c=a(c,16,4,String.fromCharCode((i=u)>>24&255,i>>16&255,i>>8&255,255&i));let p=`url(data:font/opentype;base64,${btoa(c)});`,g=`@font-face {font-family:"${d}";src:${p}}`;this.insertRule(g);let m=this._document.createElement("div");for(let e of(m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px",[t.loadedName,d])){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,m.append(t)}this._document.body.append(m),function t(e,i){if(++h>30){S("Load test font never loaded."),i();return}(l.font="30px "+e,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0)?i():setTimeout(t.bind(null,e,i))}(d,()=>{m.remove(),e.complete()})}}class en{compiledGlyphs=Object.create(null);#iO;constructor(t,e=null,i,r){this.#iO=t,this._inspectFont=e,i&&(this.charProcOperatorList=i),r&&Object.assign(this,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=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;if(this.cssFontInfo){let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),t}getPathGenerator(t,e){let i;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let r=this.loadedName+"_path_"+e;try{i=t.get(r)}catch(t){S(`getPathGenerator - ignoring character: "${t}".`)}let s=tk(i?.path);return this.fontExtraProperties||t.delete(r),this.compiledGlyphs[e]=s}get black(){return this.#iO.black}get bold(){return this.#iO.bold}get disableFontFace(){return this.#iO.disableFontFace}set disableFontFace(t){k(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#iO.fontExtraProperties}get isInvalidPDFjsFont(){return this.#iO.isInvalidPDFjsFont}get isType3Font(){return this.#iO.isType3Font}get italic(){return this.#iO.italic}get missingFile(){return this.#iO.missingFile}get remeasure(){return this.#iO.remeasure}get vertical(){return this.#iO.vertical}get ascent(){return this.#iO.ascent}get defaultWidth(){return this.#iO.defaultWidth}get descent(){return this.#iO.descent}get bbox(){return this.#iO.bbox}get fontMatrix(){return this.#iO.fontMatrix}get fallbackName(){return this.#iO.fallbackName}get loadedName(){return this.#iO.loadedName}get mimetype(){return this.#iO.mimetype}get name(){return this.#iO.name}get data(){return this.#iO.data}clearData(){this.#iO.clearData()}get cssFontInfo(){return this.#iO.cssFontInfo}get systemFontInfo(){return this.#iO.systemFontInfo}get defaultVMetrics(){return this.#iO.defaultVMetrics}}class ea{static strings=["fontFamily","fontWeight","italicAngle"]}class eo{static strings=["css","loadedName","baseFontName","src"]}class el{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static OFFSET_NUMBERS=Math.ceil(2*this.bools.length/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+8*this.numbers.length;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6}class eh{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class ed{#iN;#iU=new TextDecoder;#iz;constructor(t){this.#iN=t,this.#iz=new DataView(t)}#iH(t){E(t<ea.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get fontFamily(){return this.#iH(0)}get fontWeight(){return this.#iH(1)}get italicAngle(){return this.#iH(2)}}class ec{#iN;#iU=new TextDecoder;#iz;constructor(t){this.#iN=t,this.#iz=new DataView(t)}get guessFallback(){return 0!==this.#iz.getUint8(0)}#iH(t){E(t<eo.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get css(){return this.#iH(0)}get loadedName(){return this.#iH(1)}get baseFontName(){return this.#iH(2)}get src(){return this.#iH(3)}get style(){let t=1;t+=4+this.#iz.getUint32(t);let e=this.#iz.getUint32(t),i=this.#iU.decode(new Uint8Array(this.#iN,t+4,e));t+=4+e;let r=this.#iz.getUint32(t),s=this.#iU.decode(new Uint8Array(this.#iN,t+4,r));return{style:i,weight:s}}}class eu{#iN;#iU=new TextDecoder;#iz;constructor({buffer:t,extra:e}){this.#iN=t,this.#iz=new DataView(t),e&&Object.assign(this,e)}#ij(t){E(t<el.bools.length,"Invalid boolean index");let e=Math.floor(t/4),i=this.#iz.getUint8(e)>>2*t%8&3;return 0===i?void 0:2===i}get black(){return this.#ij(0)}get bold(){return this.#ij(1)}get disableFontFace(){return this.#ij(2)}get fontExtraProperties(){return this.#ij(3)}get isInvalidPDFjsFont(){return this.#ij(4)}get isType3Font(){return this.#ij(5)}get italic(){return this.#ij(6)}get missingFile(){return this.#ij(7)}get remeasure(){return this.#ij(8)}get vertical(){return this.#ij(9)}#i$(t){return E(t<el.numbers.length,"Invalid number index"),this.#iz.getFloat64(el.OFFSET_NUMBERS+8*t)}get ascent(){return this.#i$(0)}get defaultWidth(){return this.#i$(1)}get descent(){return this.#i$(2)}#iG(t,e,i,r){let s=this.#iz.getUint8(t);if(0===s)return;E(s===e,"Invalid array length."),t+=1;let n=Array(s);for(let e=0;e<s;e++)n[e]=this.#iz[i](t,!0),t+=r;return n}get bbox(){return this.#iG(el.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return this.#iG(el.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return this.#iG(el.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}#iH(t){E(t<el.strings.length,"Invalid string index");let e=el.OFFSET_STRINGS+4;for(let i=0;i<t;i++)e+=this.#iz.getUint32(e)+4;let i=this.#iz.getUint32(e);return this.#iU.decode(new Uint8Array(this.#iN,e+4,i))}get fallbackName(){return this.#iH(0)}get loadedName(){return this.#iH(1)}get mimetype(){return this.#iH(2)}get name(){return this.#iH(3)}#iV(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);t+=4+i;let r=this.#iz.getUint32(t);t+=4+r;let s=this.#iz.getUint32(t);return{offset:t,length:s}}get data(){let{offset:t,length:e}=this.#iV();return 0===e?void 0:new Uint8Array(this.#iN,t+4,e)}clearData(){let{offset:t,length:e}=this.#iV();0!==e&&(this.#iz.setUint32(t,0),this.#iN=new Uint8Array(this.#iN,0,t+4).slice().buffer,this.#iz=new DataView(this.#iN))}get cssFontInfo(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);t+=4+i;let r=this.#iz.getUint32(t);if(0===r)return null;let s=new Uint8Array(r);return s.set(new Uint8Array(this.#iN,t+4,r)),new ed(s.buffer)}get systemFontInfo(){let t=el.OFFSET_STRINGS,e=this.#iz.getUint32(t);t+=4+e;let i=this.#iz.getUint32(t);if(0===i)return null;let r=new Uint8Array(i);return r.set(new Uint8Array(this.#iN,t+4,i)),new ec(r.buffer)}}class ep{constructor(t){this.buffer=t,this.view=new DataView(t),this.data=new Uint8Array(t)}getIR(){let t=this.view,e=this.data[eh.KIND],i=!!this.data[eh.HAS_BBOX],r=!!this.data[eh.HAS_BACKGROUND],s=t.getUint32(eh.N_COORD,!0),n=t.getUint32(eh.N_COLOR,!0),a=t.getUint32(eh.N_STOP,!0),o=20,l=new Float32Array(this.buffer,o,2*s);o+=8*s;let d=new Uint8Array(this.buffer,o,4*n);o+=4*n;let c=[];for(let e=0;e<a;++e){let e=t.getFloat32(o,!0);o+=4;let i=t.getUint32(o,!0);o+=4,c.push([e,`#${i.toString(16).padStart(6,"0")}`])}let u=null;if(i){u=[];for(let e=0;e<4;++e)u.push(t.getFloat32(o,!0)),o+=4}let p=null;if(r&&(p=new Uint8Array(this.buffer,o,3),o+=3),1===e)return["RadialAxial","axial",u,c,Array.from(l.slice(0,2)),Array.from(l.slice(2,4)),null,null];if(2===e)return["RadialAxial","radial",u,c,[l[0],l[1]],[l[3],l[4]],l[2],l[5]];if(3===e){let t=this.data[eh.SHADING_TYPE],e=null;if(l.length>0){e=h.slice();for(let t=0,i=l.length;t<i;t+=2)z.pointBoundingBox(l[t],l[t+1],e)}return["Mesh",t,l,d,s,e,u,p]}throw Error(`Unsupported pattern kind: ${e}`)}}class eg{#iN;constructor(t){this.#iN=t}get path(){return U.isFloat16ArraySupported?new Float16Array(this.#iN):new Float32Array(this.#iN)}}function em(t){if("string"!=typeof t)return null;if(t.endsWith("/"))return t;throw Error(`Invalid factory url: "${t}" must include trailing slash.`)}let ef=t=>"object"==typeof t&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,eb=(function(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;let[r,s,...n]=i;if(!t(r)&&!Number.isInteger(r)||!e(s))return!1;let a=n.length,o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return 0===a;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(4!==a)return!1;o=!1;break;default:return!1}for(let t of n)if("number"!=typeof t&&(!o||null!==t))return!1;return!0}).bind(null,ef,t=>"object"==typeof t&&"string"==typeof t?.name);class ev{#iW=new Map;#iX=Promise.resolve();postMessage(t,e){let i={data:structuredClone(t,e?{transfer:e}:null)};this.#iX.then(()=>{for(let[t]of this.#iW)t.call(this,i)})}addEventListener(t,e,i=null){let r=null;if(i?.signal instanceof AbortSignal){let{signal:s}=i;if(s.aborted)return void S("LoopbackPort - cannot use an `aborted` signal.");let n=()=>this.removeEventListener(t,e);r=()=>s.removeEventListener("abort",n),s.addEventListener("abort",n)}this.#iW.set(e,r)}removeEventListener(t,e){let i=this.#iW.get(e);i?.(),this.#iW.delete(e)}terminate(){for(let[,t]of this.#iW)t?.();this.#iW.clear()}}o(1689);function ey(){}function eA(t){if(t instanceof O||t instanceof B||t instanceof I||t instanceof F||t instanceof R)return t;switch(!(t instanceof Error||"object"==typeof t&&null!==t)&&T('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new O(t.message);case"InvalidPDFException":return new B(t.message);case"PasswordException":return new I(t.message,t.code);case"ResponseException":return new F(t.message,t.status,t.missing);case"UnknownErrorException":return new R(t.message,t.details)}return new R(t.message,t.toString())}class ex{#iq=new AbortController;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),i.addEventListener("message",this.#iK.bind(this),{signal:this.#iq.signal})}#iK({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#iY(t);if(t.callback){let e=t.callbackId,i=this.callbackCapabilities[e];if(!i)throw Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)i.resolve(t.data);else if(2===t.callback)i.reject(eA(t.reason));else throw Error("Unexpected callback case");return}let e=this.actionHandler[t.action];if(!e)throw Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){let i=this.sourceName,r=t.sourceName,s=this.comObj;Promise.try(e,t.data).then(function(e){s.postMessage({sourceName:i,targetName:r,callback:1,callbackId:t.callbackId,data:e})},function(e){s.postMessage({sourceName:i,targetName:r,callback:2,callbackId:t.callbackId,reason:eA(e)})});return}t.streamId?this.#iJ(t):e(t.data)}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)}sendWithPromise(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,r){let s=this.streamId++,n=this.sourceName,a=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{let l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:n,targetName:a,action:t,streamId:s,data:e,desiredSize:i.desiredSize},r),l.promise},pull:t=>{let e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:n,targetName:a,stream:6,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{E(t instanceof Error,"cancel must have a valid reason");let e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:n,targetName:a,stream:1,streamId:s,reason:eA(t)}),e.promise}},i)}#iJ(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,n=this,a=this.actionHandler[t.action],o={enqueue(t,n=1,a){if(this.isCancelled)return;let o=this.desiredSize;this.desiredSize-=n,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:r,stream:4,streamId:e,chunk:t},a)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:3,streamId:e}),delete n.streamSinks[e])},error(t){E(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:5,streamId:e,reason:eA(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,Promise.try(a,t.data,o).then(function(){s.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:8,streamId:e,reason:eA(t)})})}#iY(t){let e=t.streamId,i=this.sourceName,r=t.sourceName,s=this.comObj,n=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case 8:t.success?n.startCall.resolve():n.startCall.reject(eA(t.reason));break;case 7:t.success?n.pullCall.resolve():n.pullCall.reject(eA(t.reason));break;case 6:if(!a){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||ey).then(function(){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:7,streamId:e,reason:eA(t)})});break;case 4:if(E(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case 3:if(E(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#iQ(n,e);break;case 5:E(n,"error should have stream controller"),n.controller.error(eA(t.reason)),this.#iQ(n,e);break;case 2:t.success?n.cancelCall.resolve():n.cancelCall.reject(eA(t.reason)),this.#iQ(n,e);break;case 1:if(!a)break;let o=eA(t.reason);Promise.try(a.onCancel||ey,o).then(function(){s.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,success:!0})},function(t){s.postMessage({sourceName:i,targetName:r,stream:2,streamId:e,reason:eA(t)})}),a.sinkCapability.reject(o),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw Error("Unexpected stream case")}}async #iQ(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#iq?.abort(),this.#iq=null}}class ew{#iZ=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:t=null,standardFontDataUrl:e=null,wasmUrl:i=null}){this.cMapUrl=t,this.standardFontDataUrl=e,this.wasmUrl=i}async fetch({kind:t,filename:e}){switch(t){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:T(`Not implemented: ${t}`)}let i=this[t];if(!i)throw Error(`Ensure that the \`${t}\` API parameter is provided.`);let r=`${i}${e}`;return this._fetch(r,t).catch(e=>{throw Error(`Unable to load ${this.#iZ[t]} data at: ${r}`)})}async _fetch(t,e){T("Abstract method `_fetch` called.")}}class e_ extends ew{async _fetch(t,e){let i="cMapUrl"!==e||t.endsWith(".bcmap")?"bytes":"text",r=await tt(t,i);return r instanceof Uint8Array?r:N(r)}}class eS{#i0=!1;constructor({enableHWA:t=!1}){this.#i0=t}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",{willReadFrequently:!this.#i0})}}reset({canvas:t},e,i){if(!t)throw Error("Canvas is not specified");if(e<=0||i<=0)throw Error("Invalid canvas size");t.width=e,t.height=i}destroy(t){let{canvas:e}=t;if(!e)throw Error("Canvas is not specified");e.width=e.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){T("Abstract method `_createCanvas` called.")}}class eT extends eS{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){let i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}o(2489);class eE{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,r,s){return"none"}destroy(t=!1){}}class eC extends eE{#i1;#i2;#i5;#i3;#i6;#i4;#E=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#i3=t,this.#i6=e}get #M(){return this.#i2||=new Map}get #i9(){return this.#i4||=new Map}get #i8(){if(!this.#i5){let t=this.#i6.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.#i6.createElementNS(Q,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#i5=this.#i6.createElementNS(Q,"defs"),t.append(i),i.append(this.#i5),this.#i6.body.append(t)}return this.#i5}#i7(t){if(1===t.length){let e=t[0],i=Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;let r=i.join(",");return[r,r,r]}let[e,i,r]=t,s=Array(256),n=Array(256),a=Array(256);for(let t=0;t<256;t++)s[t]=e[t]/255,n[t]=i[t]/255,a[t]=r[t]/255;return[s.join(","),n.join(","),a.join(",")]}#rt(t){if(void 0===this.#i1){this.#i1="";let t=this.#i6.URL;t!==this.#i6.baseURI&&(tr(t)?S('#createUrl: ignore "data:"-URL for performance reasons.'):this.#i1=M(t,""))}return`url(${this.#i1}#${t})`}addFilter(t){if(!t)return"none";let e=this.#M.get(t);if(e)return e;let[i,r,s]=this.#i7(t),n=1===t.length?i:`${i}${r}${s}`;if(e=this.#M.get(n))return this.#M.set(t,e),e;let a=`g_${this.#i3}_transfer_map_${this.#E++}`,o=this.#rt(a);this.#M.set(t,o),this.#M.set(n,o);let l=this.#re(a);return this.#ri(i,r,s,l),o}addHCMFilter(t,e){let i=`${t}-${e}`,r="base",s=this.#i9.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.#i9.set(r,s)),!t||!e))return s.url;let n=this.#rr(t);t=z.makeHexColor(...n);let a=this.#rr(e);if(e=z.makeHexColor(...a),this.#i8.style.color="","#000000"===t&&"#ffffff"===e||t===e)return s.url;let o=Array(256);for(let t=0;t<=255;t++){let e=t/255;o[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}let l=o.join(","),h=`g_${this.#i3}_hcm_filter`,d=s.filter=this.#re(h);this.#ri(l,l,l,d),this.#rs(d);let c=(t,e)=>{let i=n[t]/255,r=a[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.#ri(c(0,5),c(1,5),c(2,5),d),s.url=this.#rt(h),s.url}addAlphaFilter(t){let e=this.#M.get(t);if(e)return e;let[i]=this.#i7([t]),r=`alpha_${i}`;if(e=this.#M.get(r))return this.#M.set(t,e),e;let s=`g_${this.#i3}_alpha_map_${this.#E++}`,n=this.#rt(s);this.#M.set(t,n),this.#M.set(r,n);let a=this.#re(s);return this.#rn(i,a),n}addLuminosityFilter(t){let e,i,r=this.#M.get(t||"luminosity");if(r)return r;if(t?([e]=this.#i7([t]),i=`luminosity_${e}`):i="luminosity",r=this.#M.get(i))return this.#M.set(t,r),r;let s=`g_${this.#i3}_luminosity_map_${this.#E++}`,n=this.#rt(s);this.#M.set(t,n),this.#M.set(i,n);let a=this.#re(s);return this.#ra(a),t&&this.#rn(e,a),n}addHighlightHCMFilter(t,e,i,r,s){let n=`${e}-${i}-${r}-${s}`,a=this.#i9.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.#i9.set(t,a)),!e||!i))return a.url;let[o,l]=[e,i].map(this.#rr.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.#rr.bind(this));d<h&&([h,d,c,u]=[d,h,u,c]),this.#i8.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.#i3}_hcm_${t}_filter`,m=a.filter=this.#re(g);return this.#rs(m),this.#ri(p(c[0],u[0],5),p(c[1],u[1],5),p(c[2],u[2],5),m),a.url=this.#rt(g),a.url}destroy(t=!1){t&&this.#i4?.size||(this.#i5?.parentNode.parentNode.remove(),this.#i5=null,this.#i2?.clear(),this.#i2=null,this.#i4?.clear(),this.#i4=null,this.#E=0)}#ra(t){let e=this.#i6.createElementNS(Q,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#rs(t){let e=this.#i6.createElementNS(Q,"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)}#re(t){let e=this.#i6.createElementNS(Q,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#i8.append(e),e}#ro(t,e,i){let r=this.#i6.createElementNS(Q,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)}#ri(t,e,i,r){let s=this.#i6.createElementNS(Q,"feComponentTransfer");r.append(s),this.#ro(s,"feFuncR",t),this.#ro(s,"feFuncG",e),this.#ro(s,"feFuncB",i)}#rn(t,e){let i=this.#i6.createElementNS(Q,"feComponentTransfer");e.append(i),this.#ro(i,"feFuncA",t)}#rr(t){return this.#i8.style.color=t,tg(getComputedStyle(this.#i8).getPropertyValue("color"))}}if(l){let t;try{let e=r.getBuiltinModule("module").createRequire("file:///home/runner/work/annovibe/annovibe/node_modules/pdfjs-dist/legacy/build/pdf.mjs");try{t=e("@napi-rs/canvas")}catch(t){S(`Cannot load "@napi-rs/canvas" package: "${t}".`)}}catch(t){S(`Cannot access the \`require\` function: "${t}".`)}globalThis.DOMMatrix||(t?.DOMMatrix?globalThis.DOMMatrix=t.DOMMatrix:S("Cannot polyfill `DOMMatrix`, rendering may be broken.")),globalThis.ImageData||(t?.ImageData?globalThis.ImageData=t.ImageData:S("Cannot polyfill `ImageData`, rendering may be broken.")),globalThis.Path2D||(t?.Path2D?globalThis.Path2D=t.Path2D:S("Cannot polyfill `Path2D`, rendering may be broken.")),globalThis.navigator?.language||(globalThis.navigator={language:"en-US",platform:"",userAgent:""})}async function eM(t){let e=r.getBuiltinModule("fs/promises");return new Uint8Array(await e.readFile(t))}class eP extends eE{}class ek extends eS{_createCanvas(t,e){return r.getBuiltinModule("module").createRequire("file:///home/runner/work/annovibe/annovibe/node_modules/pdfjs-dist/legacy/build/pdf.mjs")("@napi-rs/canvas").createCanvas(t,e)}}class eD extends ew{async _fetch(t,e){return eM(t)}}let eI=`
|
|
3
3
|
struct Uniforms {
|
|
4
4
|
offsetX : f32,
|
|
5
5
|
offsetY : f32,
|