papilot 0.7.0 → 0.8.0

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.
Files changed (63) hide show
  1. package/README.md +52 -30
  2. package/README.zh-CN.md +54 -30
  3. package/bin/doctor.mjs +53 -6
  4. package/bin/installation.d.mts +2 -0
  5. package/bin/installation.mjs +7 -1
  6. package/dist/assets/{_virtual_papilot-licenses-BWIsfrQh.js → _virtual_papilot-licenses-D7ro6ecN.js} +54 -3
  7. package/dist/assets/index-Cc-awdNn.css +1 -0
  8. package/dist/assets/index-D_VX51no.js +265 -0
  9. package/dist/assets/latex-BarqJFtQ.svg +1 -0
  10. package/dist/assets/{math-BsEl3u6P.js → math-V9uUaUzA.js} +1 -1
  11. package/dist/assets/pdf-view-Bnb2uIBE.js +598 -0
  12. package/dist/index.html +2 -2
  13. package/examples/papilot-paper/main.tex +1 -1
  14. package/examples/papilot-paper/sections/02-using.tex +3 -1
  15. package/examples/papilot-paper/sections/09-agents.tex +8 -5
  16. package/package.json +10 -6
  17. package/skills/ai-review.md +18 -0
  18. package/skills/latex-warnings.md +1 -1
  19. package/src/conversation.ts +6 -0
  20. package/src/server/acp.ts +354 -0
  21. package/src/server/agents.ts +220 -43
  22. package/src/server/ai-review-routes.ts +72 -0
  23. package/src/server/ai-review.ts +38 -0
  24. package/src/server/app.ts +53 -11
  25. package/src/server/build-problems.ts +329 -0
  26. package/src/server/changes.ts +25 -2
  27. package/src/server/codex.ts +2 -1
  28. package/src/server/cursor.ts +153 -0
  29. package/src/server/latex-installation.ts +43 -0
  30. package/src/server/manuscript.ts +165 -23
  31. package/src/server/paths.ts +1 -1
  32. package/src/server/references.ts +70 -0
  33. package/src/server/review.ts +3 -3
  34. package/src/server/skills.ts +5 -8
  35. package/src/server/store.ts +20 -2
  36. package/src/server/update-install.ts +53 -2
  37. package/src/server/update-worker.ts +6 -6
  38. package/src/server/updates.ts +43 -14
  39. package/src/server/workspace.ts +183 -29
  40. package/src/shared.ts +78 -7
  41. package/src/skill-icons.ts +18 -0
  42. package/src/skill-metadata.ts +45 -0
  43. package/vendor/latex-review/dist/web/assets/index-7VKAte5x.js +19 -0
  44. package/vendor/latex-review/dist/web/assets/index-DEz-LsGl.css +1 -0
  45. package/vendor/latex-review/dist/web/index.html +2 -2
  46. package/vendor/latex-review/src/core/bib.ts +692 -0
  47. package/vendor/latex-review/src/core/changes.ts +39 -0
  48. package/vendor/latex-review/src/core/review.ts +1 -0
  49. package/vendor/latex-review/src/core/verify.ts +784 -0
  50. package/vendor/latex-review/src/core/view.ts +204 -0
  51. package/vendor/latex-review/src/render/round.ts +11 -0
  52. package/vendor/latex-review/src/server.ts +65 -0
  53. package/vendor/latex-review/src/types.ts +125 -0
  54. package/vendor/latex-review/src/web/effect-preferences.ts +10 -0
  55. package/vendor/latex-review/src/web/references.tsx +499 -0
  56. package/vendor/latex-review/src/web/review.tsx +259 -131
  57. package/vendor/latex-review/src/web/style.css +285 -0
  58. package/vendor/latex-review/src/web/zh-CN.ts +75 -0
  59. package/dist/assets/index-CIJEYlP7.js +0 -252
  60. package/dist/assets/index-hOJEruFc.css +0 -1
  61. package/dist/assets/pdf-view-Cz9_vK5U.js +0 -598
  62. package/vendor/latex-review/dist/web/assets/index-Be9CtgcZ.css +0 -1
  63. package/vendor/latex-review/dist/web/assets/index-TvMWVSaw.js +0 -19
@@ -0,0 +1,598 @@
1
+ import{C as e,E as t,S as n,T as r,_ as i,b as a,g as o,h as s,m as c,p as l,v as u,w as d,x as f,y as p}from"./index-D_VX51no.js";var m=t(),h=o(),g=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),_=[1/0,1/0,-1/0,-1/0],v=new Float32Array(_),y=[.001,0,0,.001,0,0],b=`http://www.w3.org/2000/svg`,x={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},S={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},C=`pdfjs_internal_id_`,w=`pdfjs_internal_editor_`,T={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},E={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},D={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},O={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ee={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},k={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,RICHMEDIA:27},te={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ne={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},re={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},j={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},M=ne.WARNINGS;function ie(e){Number.isInteger(e)&&(M=e)}function ae(){return M}function oe(e){M>=ne.INFOS&&console.info(`Info: ${e}`)}function N(e){M>=ne.WARNINGS&&console.warn(`Warning: ${e}`)}function P(e){throw Error(e)}function F(e,t){e||P(t)}function se(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function ce(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=ve(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return se(r)?r:null}function le(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&ce(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function I(e){return e.substring(e.lastIndexOf(`/`)+1)}function L(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var ue=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),de=class extends ue{constructor(e,t){super(e,`PasswordException`),this.code=t}},R=class extends ue{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},fe=class extends ue{constructor(e){super(e,`InvalidPDFException`)}},pe=class extends ue{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},me=class extends ue{constructor(e){super(e,`FormatError`)}},he=class extends ue{constructor(e){super(e,`AbortException`)}};function ge(e){(typeof e!=`object`||e?.length===void 0)&&P(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);let r=[];for(let i=0;i<t;i+=n){let a=Math.min(i+n,t),o=e.subarray(i,a);r.push(String.fromCharCode.apply(null,o))}return r.join(``)}function _e(e){typeof e!=`string`&&P(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}var z=class{static get isLittleEndian(){let e=new Uint8Array(4);e[0]=1;let t=new Uint32Array(e.buffer,0,1);return L(this,`isLittleEndian`,t[0]===1)}static get isOffscreenCanvasSupported(){return L(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return L(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get isFloat16ArraySupported(){return L(this,`isFloat16ArraySupported`,typeof Float16Array<`u`)}static get isSanitizerSupported(){return L(this,`isSanitizerSupported`,typeof Sanitizer<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return L(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCanvasFilterSupported(){let e;return this.isOffscreenCanvasSupported?e=new OffscreenCanvas(1,1).getContext(`2d`):typeof document<`u`&&(e=document.createElement(`canvas`).getContext(`2d`)),L(this,`isCanvasFilterSupported`,e?.filter!==void 0)}static get isAlphaColorInputSupported(){if(typeof document>`u`)return L(this,`isAlphaColorInputSupported`,!1);let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,L(this,`isAlphaColorInputSupported`,e.value!==`#ff0000`)}static get isBackdropFilterSupported(){return L(this,`isBackdropFilterSupported`,typeof CSS<`u`&&CSS.supports(`backdrop-filter`,`blur(1px)`))}},B=class{static get hexNums(){return L(this,`hexNums`,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}};function ve(e){return decodeURIComponent(escape(e))}var ye=null,be=null;function xe(e){return ye||(ye=/([\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,be=new Map([[`ſt`,`ſt`]])),e.replaceAll(ye,(e,t,n)=>t?t.normalize(`NFKC`):be.get(n))}function Se(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),ge(e)}function Ce(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}var we=()=>[],Te=()=>new Map,Ee=()=>Object.create(null),De=()=>new Set;typeof Iterator.prototype.join!=`function`&&(Iterator.prototype.join=function(e){return[...this].join(e)});function V(e,t,n){return Math.min(Math.max(e,t),n)}var Oe=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return L(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return B.applyTransform(n,this.transform),n}convertToPdfPoint(e,t){let n=[e,t];return B.applyInverseTransform(n,this.transform),n}},ke=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},Ae=/url\(|image-set\(/i,je=/^on/i,Me=class{static get _allowedHtmlElements(){return L(this,`_allowedHtmlElements`,new Set([`a`,`b`,`br`,`button`,`div`,`i`,`img`,`input`,`label`,`li`,`ol`,`option`,`p`,`select`,`span`,`sub`,`sup`,`textarea`,`ul`]))}static get _allowedSvgElements(){return L(this,`_allowedSvgElements`,new Set([`ellipse`,`line`,`path`,`rect`,`svg`]))}static get _allowedRichTextElements(){return L(this,`_allowedRichTextElements`,new Set([`a`,`b`,`br`,`div`,`i`,`li`,`ol`,`p`,`span`,`sub`,`sup`,`ul`]))}static get _allowedRichTextAttributes(){return L(this,`_allowedRichTextAttributes`,new Set([`class`,`dir`,`style`]))}static get _allowedRichTextStyles(){return L(this,`_allowedRichTextStyles`,new Set(`color.font.fontFamily.fontSize.fontStretch.fontStyle.fontWeight.kerningMode.letterSpacing.lineHeight.margin.marginBottom.marginLeft.marginRight.marginTop.orphans.paddingLeft.paddingRight.breakAfter.breakBefore.breakInside.tabInterval.tabStop.textAlign.textDecoration.textIndent.transform.verticalAlign.widows`.split(`.`)))}static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(!(n==null||je.test(t))&&(r!==`richText`||this._allowedRichTextAttributes.has(t)))switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:if(r===`richText`){let t=this._allowedRichTextStyles;for(let[r,i]of Object.entries(n))t.has(r)&&!Ae.test(i)&&(e.style[r]=i)}else Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i?.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static#e(e,t,n){return n===`richText`?!t&&this._allowedRichTextElements.has(e)?document.createElement(e):null:t?t===b&&this._allowedSvgElements.has(e)?document.createElementNS(b,e):null:this._allowedHtmlElements.has(e)?document.createElement(e):null}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=this.#e(r.name,r.attributes?.xmlns,i)??document.createElement(`div`);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&ke.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=this.#e(u,s.attributes?.xmlns,i);if(d){if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&ke.shouldBuildText(u)&&c.push(e),d.append(e)}}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}static getPageViewport(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new Oe({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}},Ne=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function Pe(e,t=`text`){if(Ve(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText)}else r(Error(i.statusText))}},i.send(null)})}var Fe=class extends ue{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Ie(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function Le(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function Re(e){return[e]=e.split(/[#?]/,1),I(e)}function ze(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(Ie(e))return N(`getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.`),t;let n=(e=>{try{return new URL(e)}catch{}try{return new URL(decodeURIComponent(e))}catch{}try{return new URL(e,`https://foo.bar`)}catch{}try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{}return null})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=I(t),t.length===4&&i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=I(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let{hash:e}=n,t=-1;for(let{index:n}of e.matchAll(/\.pdf\b/gi))t=n;if(t>0){let n=t;for(;n>0&&!`/?#=`.includes(e[n-1]);)n--;if(n<t)return r(e.slice(n,t+4))}}return t}var Be=class{#e=new Map;times=[];time(e){this.#e.has(e)&&N(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||N(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}};function Ve(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function He(e){e.preventDefault()}function H(e){e.preventDefault(),e.stopPropagation()}var Ue=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function We(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function Ge(e){let t=We(e);return t?t.slice(0,3):(N(`Not a valid color format: "${e}"`),[0,0,0])}function Ke(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,Ge(r))}t.remove()}function U(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function qe(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function Je(e,t,n=!1,r=!0){if(t instanceof Oe){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,s=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!n||t.rotation%180==0?(a.width=o,a.height=s):(a.width=s,a.height=o)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var Ye=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},Xe=new Set([`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`]),Ze=class{static get isDarkMode(){return L(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},Qe=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),L(this,`commentForegroundColor`,Ge(n))}};function $e(e,t){t=V(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function et(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(r<i?6:0))*60;break;case r:t[0]=((i-n)/e+2)*60;break;case i:t[0]=((n-r)/e+4)*60}}t[2]=s}function tt(e,t){let n=e[0],r=e[1],i=e[2],a=(1-Math.abs(2*i-1))*r,o=a*(1-Math.abs(n/60%2-1)),s=i-a/2;switch(Math.floor(n/60)){case 0:t[0]=a+s,t[1]=o+s,t[2]=s;break;case 1:t[0]=o+s,t[1]=a+s,t[2]=s;break;case 2:t[0]=s,t[1]=a+s,t[2]=o+s;break;case 3:t[0]=s,t[1]=o+s,t[2]=a+s;break;case 4:t[0]=o+s,t[1]=s,t[2]=a+s;break;case 5:case 6:t[0]=a+s,t[1]=s,t[2]=o+s}}function nt(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function rt(e,t,n){tt(e,n),n.map(nt);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];tt(t,n),n.map(nt);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}var it=new Map;function at(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=it.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);et(e,o);let s=i.subarray(6,9);et(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),rt(o,s,a)<l){let e,t;for(c?(e=o[2],t=1):(e=0,t=o[2]);t-e>.005;){let n=o[2]=(e+t)/2;c===rt(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return tt(o,a),r=B.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),it.set(n,r),r}function ot({html:e,dir:t,className:n},r){let i=document.createDocumentFragment();if(typeof e==`string`){let n=document.createElement(`p`);n.dir=t||`auto`;let r=e.split(/\r\n?|\n/);for(let e=0,t=r.length;e<t;++e){let i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement(`br`))}i.append(n)}else Me.render({xfaHtml:e,div:i,intent:`richText`});i.firstElementChild.classList.add(`richText`,n),r.append(i)}function st(e){let t=new Path2D;if(!e)return t;for(let n=0,r=e.length;n<r;)switch(e[n++]){case re.moveTo:t.moveTo(e[n++],e[n++]);break;case re.lineTo:t.lineTo(e[n++],e[n++]);break;case re.curveTo:t.bezierCurveTo(e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]);break;case re.quadraticCurveTo:t.quadraticCurveTo(e[n++],e[n++],e[n++],e[n++]);break;case re.closePath:t.closePath();break;default:N(`Unrecognized drawing path operator: ${e[n-1]}`)}return t}var ct=class e{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#o=null;#s=null;static#c=null;constructor(t){this.#n=t,e.#c||=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.#e=document.createElement(`div`);t.classList.add(`editToolbar`,`hidden`),t.setAttribute(`role`,`toolbar`);let n=this.#n._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(t.addEventListener(`contextmenu`,He,{signal:n}),t.addEventListener(`pointerdown`,e.#l,{signal:n}));let r=this.#r=document.createElement(`div`);r.className=`buttons`,t.append(r);let i=this.#n.toolbarPosition;if(i){let{style:e}=t;e.insetInlineEnd=`${100*(this.#n._uiManager.direction===`ltr`?1-i[0]:i[0])}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#e}static#l(e){e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!1,H(e)}#d(e){this.#n._focusEventsAllowed=!0,H(e)}#f(e){let t=this.#n._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,He,{signal:t}),!0)}hide(){this.#e.classList.add(`hidden`),this.#t?.hideDropdown()}show(){this.#e.classList.remove(`hidden`),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){let{editorType:t,_uiManager:n}=this.#n,r=document.createElement(`button`);r.classList.add(`basic`,`deleteButton`),r.tabIndex=0,r.setAttribute(`data-l10n-id`,e.#c[t]),this.#f(r)&&r.addEventListener(`click`,e=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);t&&(this.#f(t),this.#r.append(t,this.#p))}removeButton(e){e===`comment`&&(this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null)}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t)}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},lt=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`),e.dir=this.#n.direction;let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,He,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(e<n)continue;let a=i.x+(t?i.width:0);e>n?(r=a,n=e):t?a>r&&(r=a):a<r&&(r=a)}return[t?1-r:r,n]}show(e,t,n){let[r,i]=this.#i(t,n),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,t,n,r){let i=document.createElement(`button`);i.classList.add(`basic`,e),i.tabIndex=0,i.setAttribute(`data-l10n-id`,t);let a=document.createElement(`span`);i.append(a),a.className=`visuallyHidden`,a.setAttribute(`data-l10n-id`,n);let o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener(`contextmenu`,He,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}},ut=Object.freeze({internal:`2837668c-d334-48d1-ba74-aa7deba483da`});function dt(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var ft=class e{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(t){(e.#t||=new Set).add(t)}static setPointer(t,n){e.#e||=n,e.#r??=t}static setTimeStamp(t){e.#n=t}static isSamePointerId(t){return e.#e===t}static isSamePointerIdOrRemove(t){return e.#e===t||(e.#t?.delete(t),!1)}static isSamePointerType(t){return e.#r===t}static isInitializedAndDifferentPointerType(t){return e.#r!==null&&!e.isSamePointerType(t)}static isSameTimeStamp(t){return e.#n===t}static isUsingMultiplePointers(){return e.#t?.size>=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},pt=class{#e=0;get id(){return`${w}${this.#e++}`}},mt=class e{#e=Se();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${b}"><rect width="1" height="1" style="fill:red;"/></svg>`,t=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),n=new Image;n.src=e;let r=n.decode().then(()=>(t.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return L(this,`_isSVGFittingCanvas`,r)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await Pe(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){N(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},ht=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(s)}undo(){if(this.#r===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1,--this.#r}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let t=this.#r;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},gt=class e{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;let{isMac:n}=z.platform;for(let[r,i,a={}]of t){let t=r.some(e=>e.startsWith(`mac+`));for(let o of r){let r=o;if(t){let e=o.startsWith(`mac+`);if(n!==e)continue;e&&(r=o.slice(4))}let[s,c]=e.#e(r);s!==null&&this.callbacks.getOrInsertComputed(s,we).push({callback:i,options:a,modifiers:c})}}}static#e(t){let n=null,r=0;for(let i of t.split(`+`)){if(i=i.trim(),!i)continue;let a=i.toUpperCase(),o=e[a];if(o)r|=o;else{if(n!==null){N(`KeyboardManager: multiple keys in shortcut "${t}"`);break}n=a===`SPACE`?` `:i}}return n===null&&N(`KeyboardManager: no key found in shortcut "${t}"`),[n,r]}static#t(e){let t=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(e);return t?t[1]?.toLowerCase()??t[2]:null}exec(t,n){let r=this.callbacks.get(n.key);if(!r){if(/^[a-z]$/i.test(n.key))return;let t=e.#t(n.code);if(t===null||t===n.key||(r=this.callbacks.get(t),!r))return}let i=(n.altKey?e.ALT:0)|(n.ctrlKey?e.CTRL:0)|(n.metaKey?e.META:0)|(n.shiftKey?e.SHIFT:0),a=r.find(e=>e.modifiers===i);if(!a)return;let{callback:o,options:{bubbles:s=!1,args:c=[],checker:l=null}}=a;(!l||l(t,n))&&(o.bind(t,...c,n)(),s||H(n))}},_t=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return Ke(e),L(this,`_colors`,e)}convert(t){let n=Ge(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?B.makeHexColor(...t):e}},vt=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=null;#u=new ht;#d=null;#f=null;#p=null;#m=0;#h=new Set;#g=null;#_=null;#v=new Set;_editorUndoBar=null;#y=!1;#b=!1;#x=!1;#S=null;#C=null;#w=null;#T=null;#E=!1;#D=null;#O=new pt;#k=!1;#A=!1;#j=!1;#M=null;#N=null;#P=null;#F=null;#I=null;#L=T.NONE;#R=new Set;#z=null;#B=null;#V=null;#H=null;#U=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#G=[0,0];#K=null;#q=null;#J=null;#Y=null;#X=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#q.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return L(this,`_keyboardManager`,new gt([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`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:r}],[[`Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(t)&&!e.isEnterHandled}],[[`Space`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(document.activeElement)}],[[`Escape`],t.unselectAll],[[`ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#q=e,this.#J=t,this.#Y=n,this.#s=r,this.#d=i,this.#B=a,this.#U=s,this._eventBus=o;let _={signal:g,...ut};o.on(`editingaction`,this.onEditingAction.bind(this),_),o.on(`pagechanging`,this.onPageChanging.bind(this),_),o.on(`scalechanging`,this.onScaleChanging.bind(this),_),o.on(`rotationchanging`,this.onRotationChanging.bind(this),_),o.on(`setpreference`,this.onSetPreference.bind(this),_),o.on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),_),window.addEventListener(`pointerdown`,()=>{this.#A=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#A=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.endCurrentEditing.bind(this),{capture:!0,signal:g}),this.#ne(),this.#le(),this.#ae(),this.#c=s.annotationStorage,this.#S=s.filterFactory,this.#V=c,this.#T=l||null,this.#y=u,this.#b=d,this.#x=f,this.#I=p||null,this.viewParameters={realScale:Ne.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#X?.resolve(),this.#X=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#v.clear(),this.#F?.clear(),this.#t=null,this.#R.clear(),this.#u.destroy(),this.#s?.destroy(),this.#d?.destroy(),this.#B?.destroy(),this.#D?.hide(),this.#D=null,this.#P?.destroy(),this.#P=null,this.#n=null,this.#C&&=(clearTimeout(this.#C),null),this.#K&&=(clearTimeout(this.#K),null),this._editorUndoBar?.destroy(),this.#U=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#I}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#x}get hcmFilter(){return L(this,`hcmFilter`,this.#V?this.#S.addHCMFilter(this.#V.foreground,this.#V.background):`none`)}get direction(){return L(this,`direction`,getComputedStyle(this.#q).direction)}get _highlightColors(){return L(this,`_highlightColors`,this.#T?new Map(this.#T.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return L(this,`highlightColors`,null);let t=new Map,n=!!this.#V;for(let[r,i]of e){let e=r.endsWith(`_HCM`);n&&e?t.set(r.replace(`_HCM`,``),i):!n&&!e&&t.set(r,i)}return L(this,`highlightColors`,t)}get highlightColorNames(){return L(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#p=e}setMainHighlightColorPicker(e){this.#P=e}editAltText(e,t=!1){this.#s?.editAltText(this,e,t)}hasCommentManager(){return!!this.#d}editComment(e,t,n,r){this.#d?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#d?.updateComment(e.getData())}updatePopupColor(e){this.#d?.updatePopupColor(e)}removeComment(e){this.#d?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#d?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#d?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#d?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus.off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r,ut),await n}getSignature(e){this.#B?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#B}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal,...ut}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#x=t)}onPageChanging({pageNumber:e}){this.#m=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#m===e&&(this.#m=0)}focusMainContainer(){this.#q.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#J.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#v.add(e)}removeShouldRescale(e){this.#v.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Ne.PDF_TO_CSS_UNITS;for(let e of this.#v)e.onScaleChanging();this.#p?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#Z(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#Q(c),d=this.#L===T.NONE,f=()=>{let n=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});d&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};d?this.switchToMode(T.HIGHLIGHT,f):f()}commentSelection(e=``){this.highlightSelection(e,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#$(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Z(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#D||=new lt(this),this.#D.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#c)return null;let t=`${w}${e}`,n=this.#c.getRawValue(t);return n&&this.#c.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#c&&!this.#c.has(e.id)&&this.#c.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#Y;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#ee(){let e=document.getSelection();if(!e||e.isCollapsed){this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#z)return;let n=this.#Z(e).closest(`.textLayer`);if(!n)this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));else if(this.#D?.hide(),this.#z=t,this.#ue({hasSelectedText:!0}),(this.#L===T.HIGHLIGHT||this.#L===T.NONE)&&(this.#L===T.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#L===T.HIGHLIGHT?this.#Q(n):null;if(e?.toggleDrawing(),this.#A){let t=new AbortController,n=this.combinedSignal(t),r=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#te(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#te(`main_toolbar`)}}#te(e=``){this.#L===T.HIGHLIGHT?this.highlightSelection(e):this.#y&&this.#$()}#ne(){document.addEventListener(`selectionchange`,this.#ee.bind(this),{signal:this._signal})}#re(){if(this.#w)return;this.#w=new AbortController;let e=this.combinedSignal(this.#w);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ie(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#R)if(t.div.contains(e)){this.#N=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#N)return;let[e,t]=this.#N;this.#N=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ae(){if(this.#M)return;this.#M=new AbortController;let e=this.combinedSignal(this.#M);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#oe(){this.#M?.abort(),this.#M=null}#se(){if(this.#f)return;this.#f=new AbortController;let e=this.combinedSignal(this.#f);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#ce(){this.#f?.abort(),this.#f=null}#le(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ae(),this.setEditingState(!0)}removeEditListeners(){this.#oe(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#R){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#_)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){N(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#me(t);this.#_e(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){N(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#L!==T.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`)}}updatePageIndex(e,t){for(let n of this.#o.get(e)||[])n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#k?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear();let e=this.#o=new Map,t=t=>{e.getOrInsertComputed(t.pageIndex,we).push(t)};for(let e of this.#r.values())t(e);for(let[e,n]of this.#c)e.startsWith(w)&&!this.#r.has(e)&&Number.isInteger(n?.pageIndex)&&t(n)}endUpdatePages(){this.#a=null,this.#o=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==T.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#c.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#c)i.pageIndex===n&&i.isClone&&(this.#c.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#ue(e){Object.entries(e).some(([e,t])=>this.#W[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#W,e)}),this.#L===T.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#de([[E.HIGHLIGHT_FREE,!0]]))}#de(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#se(),this.#ue({isEditing:this.#L!==T.NONE,isEmpty:this.#ge(),hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:this.#u.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ie(),this.#ce(),this.#ue({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#_){this.#_=e;for(let e of this.#_)this.#de(e.defaultPropertiesToUpdate)}}getId(){return this.#O.id}get currentLayer(){return this.#i.get(this.#m)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#m}addLayer(e){this.#i.set(e.pageIndex,e),this.#k?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#L!==e&&!(this.#X&&(await this.#X.promise,!this.#X))){if(this.#X=Promise.withResolvers(),this.#p?.commitOrRemove(),this.#L===T.POPUP&&this.#d?.hideSidebar(),this.#d?.destroyPopup(),this.#L=e,e===T.NONE){this.setEditingState(!1),this.#pe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#X.resolve()}else{for(let e of this.#r.values())e.addStandaloneCommentButton();e===T.SIGNATURE&&await this.#B?.loadSignatures(),n&&ft.clearPointerType(),this.setEditingState(!0),await this.#fe(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===T.POPUP){this.#n||=await this.#U.getAnnotationsByType(new Set(this.#_.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#h.has(r)&&t.push(n)}this.#d?.showSidebar(t)}if(!t)r&&this.addNewEditorFromKeyboard(),this.#X.resolve();else{for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#X.resolve()}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#L&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#_){switch(e){case E.CREATE:this.currentLayer.addNewEditor(t);return;case E.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#H||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}if(this.hasSelection)for(let n of this.#R)n.updateParams(e,t);else for(let n of this.#_)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#H?.get(E.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#de([[E.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#j!==e){this.#j=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#fe(){if(!this.#k){this.#k=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#pe(){if(this.unselectAll(),this.#k){this.#k=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#C&&clearTimeout(this.#C),this.#C=setTimeout(()=>{this.focusMainContainer(),this.#C=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#F?.delete(e.annotationElementId),this.unselect(e),e.annotationElementId&&this.#h.has(e.annotationElementId)||this.#c?.remove(e.id)}addDeletedAnnotationElement(e){this.#h.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#h.has(e)}removeDeletedAnnotationElement(e){this.#h.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#me(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#de(e.propertiesToUpdate))}get#he(){let e=null;for(e of this.#R);return e}updateUI(e){this.#he===e&&this.#de(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#de(e.defaultPropertiesToUpdate)}toggleSelected(e){this.#R.has(e)?(this.#R.delete(e),e.unselect(),this.#ue({hasSelectedEditor:this.hasSelection})):(this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0}))}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#p?.commitOrRemove();for(let t of this.#R)t!==e&&t.unselect();this.#d?.destroyPopup(),this.#R.clear(),this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#R.values().next().value}unselect(e){e.unselect(),this.#R.delete(e),this.#ue({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#R.size!==0}get isEnterHandled(){return this.#R.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#u.undo(),this.#ue({hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ge()}),this._editorUndoBar?.hide()}redo(){this.#u.redo(),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:this.#u.hasSomethingToRedo(),isEmpty:this.#ge()})}addCommands(e){this.#u.add(e),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ge()})}cleanUndoStack(e){this.#u.cleanType(e)}#ge(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#R],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#me(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#_e(e){for(let e of this.#R)e.unselect();this.#R.clear();for(let t of e)t.isEmpty()||(this.#R.add(t),t.select());this.#ue({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#R)e.commit();this.#_e(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#L!==T.NONE))&&!this.#p?.commitOrRemove()&&(this.#d?.destroyPopup(),this.hasSelection)){for(let e of this.#R)e.unselect();this.#R.clear(),this.#ue({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#G[0]+=e,this.#G[1]+=t;let[r,i]=this.#G,a=[...this.#R];this.#K&&clearTimeout(this.#K),this.#K=setTimeout(()=>{this.#K=null,this.#G[0]=this.#G[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(let e of this.#R)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);let e=this.#g;this.#g=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#g)for(let n of this.#g.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#R.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#L}isEditingMode(){return this.#L!==T.NONE}get imageManager(){return L(this,`imageManager`,new mt)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n<r;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute(`data-main-rotation`)){case`90`:o=(e,t,o,s)=>({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(!n.collapsed)for(let{x:e,y:t,width:r,height:i}of n.getClientRects())r!==0&&i!==0&&s.push(o(e,t,r,i))}return s.length===0?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#l||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#l?.delete(e)}renderAnnotationElement(e){let t=this.#l?.get(e.data.id);if(!t)return;let n=this.#c.getRawValue(t);n&&(this.#L!==T.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}setMissingCanvas(e,t,n){let r=this.#F?.get(e);r&&(r.setCanvas(t,n),this.#F.delete(e))}addMissingCanvas(e,t){(this.#F||=new Map).set(e,t)}},yt=class e{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#c=t,this.#d=t._uiManager.useNewAltTextFlow,e.#f||=Object.freeze({added:`pdfjs-editor-new-alt-text-added-button`,"added-label":`pdfjs-editor-new-alt-text-added-button-label`,missing:`pdfjs-editor-new-alt-text-missing-button`,"missing-label":`pdfjs-editor-new-alt-text-missing-button-label`,review:`pdfjs-editor-new-alt-text-to-review-button`,"review-label":`pdfjs-editor-new-alt-text-to-review-button-label`})}static initialize(t){e._l10n??=t}async render(){let t=this.#n=document.createElement(`button`);t.className=`altText`,t.tabIndex=`0`;let n=this.#r=document.createElement(`span`);t.append(n),this.#d?(t.classList.add(`new`),t.setAttribute(`data-l10n-id`,e.#f.missing),n.setAttribute(`data-l10n-id`,e.#f[`missing-label`])):(t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button`),n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button-label`));let r=this.#c._uiManager._signal;t.addEventListener(`contextmenu`,He,{signal:r}),t.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e)this.#s?.remove(),this.#s=null;else{if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},bt=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,He,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,H(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,H(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){e!==this.#o&&(this.#a=null),e===null?(this.#o=``,this.#c=!0):(this.#o=e,this.#s=new Date,this.#c=!1)}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}};function xt(e){e.preventDefault()}var St=1e-4;function Ct(e){return e.cancelable?(H(e),!0):(e.stopPropagation(),!1)}var wt=class{#e;#t=!1;#n=null;#r;#i;#a;#o;#s;#c=!1;#l=null;#u;#d=new Set;#f=null;#p;#m=null;#h=0;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,onPanning:o=null,signal:s}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#s=o,this.#p=new AbortController,this.#u=AbortSignal.any([s,this.#p.signal]),e.addEventListener(`touchstart`,this.#g.bind(this),{passive:!1,signal:this.#u})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Ye.pixelRatio}get MIN_TOUCH_DISTANCE_TO_SCALE(){return 4/Ye.pixelRatio}#g(e){if(this.#r?.())return;this.#v(e);let t=this.#d;for(let{identifier:n}of e.changedTouches)t.add(n);if(t.size===1)this.#_();else{if(!this.#m){this.#m=new AbortController;let e=AbortSignal.any([this.#u,this.#m.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#x.bind(this),n);let r=this.#S.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,H,n),t.addEventListener(`pointermove`,H,n),t.addEventListener(`pointercancel`,xt,n),t.addEventListener(`pointerup`,xt,n),this.#i?.()}this.#c=Ct(e),this.#b(e)}}#_(){if(this.#l)return;let e=this.#l=new AbortController,t=AbortSignal.any([this.#u,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#l?.abort(),this.#l=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(H(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r)}#v(e){let t=this.#d;if(t.size===0)return;let n=this.#d=new Set;for(let{identifier:r}of e.touches)t.has(r)&&n.add(r)}#y(e){let t=this.#d,n=[];for(let r of e.touches)t.has(r.identifier)&&n.push(r);return n}#b(e){let t=this.#y(e);if(t.length!==2||this.#n?.()){this.#f=null;return}let[n,r]=t;this.#f={touch0X:n.screenX,touch0Y:n.screenY,touch1X:r.screenX,touch1Y:r.screenY,panX:(n.clientX+r.clientX)/2,panY:(n.clientY+r.clientY)/2,screenPanX:(n.screenX+r.screenX)/2,screenPanY:(n.screenY+r.screenY)/2}}#x(e){if(!this.#f)return;let t=this.#y(e);if(t.length!==2)return;let n=this.#c;if(this.#c=Ct(e),!this.#c)return;if(!n){this.#b(e);return}let[r,i]=t,{screenX:a,screenY:o}=r,{screenX:s,screenY:c}=i,l=this.#f,{touch0X:u,touch0Y:d,touch1X:f,touch1Y:p,panX:m,panY:h}=l,g=f-u,_=p-d,v=s-a,y=c-o,b=(r.clientX+i.clientX)/2,x=(r.clientY+i.clientY)/2;l.panX=b,l.panY=x;let S=b-m,C=x-h,w=(a+s)/2,T=(o+c)/2,E=Math.hypot(w-l.screenPanX,T-l.screenPanY);l.screenPanX=w,l.screenPanY=T;let D=Math.hypot(v,y),O=Math.hypot(g,_),ee=this.#t?this.MIN_TOUCH_DISTANCE_TO_SCALE:this.MIN_TOUCH_DISTANCE_TO_PINCH+2*E;if(D<St||O<St||Math.abs(O-D)<=ee){(S||C)&&this.#s?.(S,C);return}l.touch0X=a,l.touch0Y=o,l.touch1X=s,l.touch1Y=c;let k=Math.sign(D-O);if(!this.#t)this.#t=!0,this.#h=k,(S||C)&&this.#s?.(S,C);else{if(this.#h){let e=this.#h;if(this.#h=0,k!==e&&Math.abs(D-O)<=2*E){this.#t=!1,(S||C)&&this.#s?.(S,C);return}}this.#a?.([m,h],O,D,S,C)}}#S(e){if(this.#v(e),this.#d.size>=2){this.#b(e);return}let t=!!this.#f;this.#C(),this.#d.size===1&&this.#_(),t&&Ct(e)}#C(){this.#f=null,this.#t=!1,this.#h=0,this.#c=!1,this.#m&&(this.#m.abort(),this.#m=null,this.#o?.())}destroy(){this.#C(),this.#d.clear(),this.#p?.abort(),this.#p=null,this.#l?.abort(),this.#l=null}},W=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new _t;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=vt.TRANSLATE_SMALL,r=vt.TRANSLATE_BIG;return L(this,`_resizerKeyboardManager`,new gt([[[`ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}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 L(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new Tt({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nAlert??=Object.freeze({highlight:`pdfjs-editor-highlight-added-alert`,freetext:`pdfjs-editor-freetext-added-alert`,ink:`pdfjs-editor-ink-added-alert`,stamp:`pdfjs-editor-stamp-added-alert`,signature:`pdfjs-editor-signature-added-alert`}),e._l10nResizer??=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){P(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#G(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o)}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=V(i,0,n-o),a=V(a,0,r-s);break;case 90:i=V(i,0,n-s),a=V(a,o,r);break;case 180:i=V(i,o,n),a=V(a,s,r);break;case 270:i=V(i,s,n),a=V(a,0,r-o)}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,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:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,He,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=z.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,H,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,He,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=V(Math.abs(b[0]-y[0]-E),l,1)/s:T=V(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),ee=e._round(c*T);x=f(...g(O,ee));let k=S-x[0],te=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=ee,this.x=k,this.y=te,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new ct(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);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.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(yt.initialize(e._l10n),this.#n=new yt(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new bt(this):null}addStandaloneCommentButton(){this._uiManager.hasCommentManager()&&(this.#i?this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`):this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i)))}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new bt(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new bt(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new bt(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),dt(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.#B(),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=z.platform;e.button!==0||e.ctrlKey&&t?e.preventDefault():(this.#m=!0,this._isDraggable?this.#R(e):this.#L(e))}#L(e){let{isMac:t}=z.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){H(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o),this.div.scrollIntoView({block:`nearest`})},a),window.addEventListener(`touchmove`,H,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),H(e)},a));let s=e=>{!this.#o||this.#o===e.pointerId?o(e):H(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&r>0&&e<i&&n>0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}#B(){this.#C||!this.div||!this.isResizable||!this._uiManager._supportsPinchToZoom||(this.#C=new wt({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal}))}rebuild(){this.#z(),this.#B()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.#C?.destroy(),this.#C=null,this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#G(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#V.bind(this),r=this.#H.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#U.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let e=0;e<i-a;e++)this.#c.append(this.#c.firstElementChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstElementChild.before(this.#c.lastElementChild);let t=0;for(let r of n){let n=this.#t[t++].getAttribute(`data-resizer-name`);r.setAttribute(`data-l10n-id`,e._l10nResizer[n])}}this.#W(0),this.#v=!0,this.#c.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#V(t){e._resizerKeyboardManager.exec(this,t)}#H(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#G()}#U(e){this.#p=this.#v?e:``}#W(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#v&&this.#N(this.#p,{deltaX:e,deltaY:t,fromKeyboard:!0})}#G(){this.#v=!1,this.#W(-1),this.#M()}_stopResizingWithKeyboard(){this.#G(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add(`selectedEditor`),this._editToolbar?(this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()}))}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(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.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r)}else t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){!this.#d&&!this.deleted?this.#d=e.addFakeAnnotation(this):this.deleted?(this.#d.remove(),this.#d=null):(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},Tt=class extends W{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},Et=3285377520,Dt=4294901760,Ot=65535,kt=class{constructor(e){this.h1=e?e|0:Et,this.h2=e?e|0:Et}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);i<=255?t[n++]=i:(t[n++]=i>>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e<r;e++)e&1?(o=a[e],o=o*u&Dt|o*f&Ot,o=o<<15|o>>>17,o=o*d&Dt|o*p&Ot,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&Dt|s*f&Ot,s=s<<15|s>>>17,s=s*d&Dt|s*p&Ot,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&Dt|o*f&Ot,o=o<<15|o>>>17,o=o*d&Dt|o*p&Ot,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&Dt|e*36045&Ot,t=t*4283543511&Dt|((t<<16|e>>>16)*2950163797&Dt)>>>16,e^=t>>>1,e=e*444984403&Dt|e*60499&Ot,t=t*3301882366&Dt|((t<<16|e>>>16)*3120437893&Dt)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},At=Object.freeze({map:null,hash:``,transfer:void 0}),jt=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof W&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof W)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof W&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new Mt(this)}get serializable(){if(this.#r.size===0)return At;let e=new Map,t=new kt,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof W?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:At}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof W)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.getOrInsertComputed(o,()=>Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,Te);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new kt;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},Mt=class extends jt{#e=At;constructor(e){super();let{serializable:t}=e;if(t===At)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){P(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return L(this,`modifiedIds`,{ids:new Set,hash:``})}},Nt=`__forcedDependency`,{floor:Pt,ceil:Ft}=Math;function It(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}function Lt(e,t,n,r,i){let a;e?(e<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=e,i[2]*=e,t<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t,i[3]*=t):i.fill(0),i[0]+=n,i[1]+=r,i[2]+=n,i[3]+=r}var Rt=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],zt=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===Rt}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},Bt=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),Vt=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(_);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(Rt,t.length)):this.#o.fill(Rt)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(B.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(_,0)),this}recordClipBox(e,t,n,r,i,a){let o=B.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),s=_.slice();B.axialAlignedBoundingBox([n,i,r,a],o,s);let c=B.intersect(this.#t,s);return c?(this.#t[0]=c[0],this.#t[1]=c[1],this.#t[2]=c[2],this.#t[3]=c[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#t;if(o[0]===1/0)return this;let s=B.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(o[0]===-1/0)return B.axialAlignedBoundingBox([n,i,r,a],s,this.#n),this;let c=_.slice();return B.axialAlignedBoundingBox([n,i,r,a],s,c),this.#n[0]=V(c[0],o[0],this.#n[0]),this.#n[1]=V(c[1],o[1],this.#n[1]),this.#n[2]=V(c[2],this.#n[2],o[2]),this.#n[3]=V(c[3],this.#n[3],o[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=Pt(this.#n[0]*256/this.#r),i=Pt(this.#n[1]*256/this.#i),a=Ft(this.#n[2]*256/this.#r),o=Ft(this.#n[3]*256/this.#i);if(It(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&It(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new zt(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},Ht=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[Nt]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{Bt(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[Nt]:{__proto__:this.#t[Nt]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null||(this.#e=t,this.#t=Object.getPrototypeOf(this.#t)),this}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Nt,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(Nt,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],B.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&Lt(r,-r,i,a,l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Nt]),this.#a){let t=Bt(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},Ut=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},Wt={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`filter`,`fillColor`]},Gt=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=z.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,n,r,i){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let a=U(t),o;if(i[0]!==1/0){let e=_.slice();B.axialAlignedBoundingBox([0,-r,n,0],a,e);let t=B.intersect(i,e);if(!t)return;let[s,c,l,u]=t;if(s!==e[0]||c!==e[1]||l!==e[2]||u!==e[3]){let e=Math.atan2(a[1],a[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)o=[s,c,s,u,l,c];else{let e=l-s,r=u-c,i=t*t,a=n*n,d=n*t,f=a-i,p=(r*a-e*d)/f;o=[s+(r*d-e*i)/f,c,s,c+p,l,u-p]}}}o||(o=[0,-r,0,0,n,-r],B.applyTransform(o,a,0),B.applyTransform(o,a,2),B.applyTransform(o,a,4)),o[0]/=this.#e,o[1]/=this.#t,o[2]/=this.#e,o[3]/=this.#t,o[4]/=this.#e,o[5]/=this.#t,this.#i.set(o,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},Kt=/\p{Cc}/u;function qt(e){let t=e[0];if(e.length<2||t!==`"`&&t!==`'`||e.at(-1)!==t)return!1;let n=e.length-1;for(let r=1;r<n;r++){let i=e[r];if(i===t||Kt.test(i)||i===`\\`&&(++r>=n||Kt.test(e[r])))return!1}return!0}function Jt(e){return qt(e)?e:`"${e.replaceAll(/["\\\p{Cc}]/gu,e=>e===`"`||e===`\\`?`\\${e}`:`\\${e.codePointAt(0).toString(16)} `)}"`}var Yt=class{#e=new Set;#t=new Set;#n=null;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.#e.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.#e.delete(e),this._document.fonts.delete(e)}insertRule(e){let t=this.#r();t.insertRule(e,t.cssRules.length)}#r(){if(this.#n)return this.#n;let e=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&e){let{adoptedStyleSheets:t}=this._document;if(t){let n=new e;return t.push(n),this.#n=n}}return this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement)),this.#n=this.styleElement.sheet}clear(){for(let e of this.#e)this._document.fonts.delete(e);if(this.#e.clear(),this.#t.clear(),this.#n){let{adoptedStyleSheets:e}=this._document;e?.includes(this.#n)&&(this._document.adoptedStyleSheets=e.filter(e=>e!==this.#n)),this.#n=null}this.styleElement?.remove(),this.styleElement=null}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(e&&!this.#t.has(e.loadedName)){if(F(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#t.add(t),n?.(e)}catch{N(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}}else P(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw N(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await this.#i(e)}}get isFontLoadingAPISupported(){return L(this,`isFontLoadingAPISupported`,!!this._document?.fonts)}get isSyncFontLoadingSupported(){return L(this,`isSyncFontLoadingSupported`,g||z.platform.isFirefox)}#i(e){function t(){for(F(!a.done,`completeRequest() cannot be called twice.`),a.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.resolve,0)}}let{loadingRequests:n}=this,{promise:r,resolve:i}=Promise.withResolvers(),a={done:!1,resolve:i};n.push(a),this._loadTestFont??=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);function o(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function s(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function c(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let l,u,d=this._document.createElement(`canvas`);d.width=1,d.height=1;let f=d.getContext(`2d`),p=0;function m(e,t){++p>30?(N(`Load test font never loaded.`),t()):(f.font=`30px `+e,f.fillText(`.`,0,20),f.getImageData(0,0,1,1).data[3]>0?t():setTimeout(m.bind(null,e,t)))}let h=`lt${Date.now()}${this.loadTestFontId++}`,g=this._loadTestFont;g=c(g,976,h.length,h);let _=1482184792,v=o(g,16);for(l=0,u=h.length-3;l<u;l+=4)v=v-_+o(h,l)|0;l<h.length&&(v=v-_+o(h+`XXX`,l)|0),g=c(g,16,4,s(v));let y=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(g)});`}}`;this.insertRule(y);let b=this._document.createElement(`div`);b.style.visibility=`hidden`,b.style.width=b.style.height=`10px`,b.style.position=`absolute`,b.style.top=b.style.left=`0px`;for(let t of[e.loadedName,h]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,b.append(e)}return this._document.body.append(b),m(h,()=>{b.remove(),t()}),r}},Xt=class{#e=new Map;#t;constructor(e,t=null,n,r){this.#t=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){let{data:e}=this;if(!e||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,e,{});else{let n={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(n.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(Jt(this.cssFontInfo.fontFamily),e,n)}return this._inspectFont?.(this),t}createFontFaceRule(){let{data:e}=this;if(!e||this.disableFontFace)return null;let t=`url(data:${this.mimetype};base64,${e.toBase64()});`,n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:${Jt(this.cssFontInfo.fontFamily)};${e}src:${t}}`}return this._inspectFont?.(this,t),n}getPathGenerator(e,t){let n=this.#e.get(t);if(n)return n;let r=`${this.loadedName}_path_${t}`,i;try{i=e.get(r)}catch(e){N(`getPathGenerator - ignoring character: "${e}".`)}return n=st(i?.path),this.fontExtraProperties||e.delete(r),this.#e.set(t,n),n}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace}set disableFontFace(e){L(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#t.fontExtraProperties}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get bbox(){return this.#t.bbox}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.missingFile?null:`font/opentype`}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}},Zt=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},Qt=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},$t=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static strings=[`fallbackName`,`loadedName`];static OFFSET_BBOX=Math.ceil(this.bools.length*2/8);static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_STRINGS=this.OFFSET_FONT_MATRIX+1+48},en=class{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},tn=class{static get decoder(){return L(this,`decoder`,new TextDecoder)}static get encoder(){return L(this,`encoder`,new TextEncoder)}};function nn(e,t,n,r=0){let{decoder:i}=tn;for(let e=0;e<n;e++)r+=t.getUint32(r)+4;let a=t.getUint32(r);return i.decode(new Uint8Array(e,r+4,a))}var rn=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){return F(e<Zt.strings.length,`Invalid string index`),nn(this.#e,this.#t,e)}get fontFamily(){return L(this,`fontFamily`,this.#n(0))}get fontWeight(){return L(this,`fontWeight`,this.#n(1))}get italicAngle(){return L(this,`italicAngle`,this.#n(2))}},an=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){return F(e<Qt.strings.length,`Invalid string index`),nn(this.#e,this.#t,e,4)}get css(){return L(this,`css`,this.#n(0))}get loadedName(){return L(this,`loadedName`,this.#n(1))}get baseFontName(){return L(this,`baseFontName`,this.#n(2))}get src(){return L(this,`src`,this.#n(3))}get style(){let e=0;e+=4+this.#t.getUint32(e);let t=nn(this.#e,this.#t,0,e),n=nn(this.#e,this.#t,1,e);return L(this,`style`,{style:t,weight:n})}},on=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){F(e<$t.bools.length,`Invalid boolean index`);let t=Math.floor(e/4),n=e*2%8,r=this.#t.getUint8(t)>>n&3;return r===0?void 0:r===2}get black(){return L(this,`black`,this.#n(0))}get bold(){return L(this,`bold`,this.#n(1))}get disableFontFace(){return L(this,`disableFontFace`,this.#n(2))}get fontExtraProperties(){return L(this,`fontExtraProperties`,this.#n(3))}get isInvalidPDFjsFont(){return L(this,`isInvalidPDFjsFont`,this.#n(4))}get isType3Font(){return L(this,`isType3Font`,this.#n(5))}get italic(){return L(this,`italic`,this.#n(6))}get missingFile(){return L(this,`missingFile`,this.#n(7))}get remeasure(){return L(this,`remeasure`,this.#n(8))}get vertical(){return L(this,`vertical`,this.#n(9))}#r(e,t,n,r){let i=this.#t.getUint8(e++);if(i===0)return;F(i===t,`Invalid array length.`);let a=Array(i);for(let t=0;t<i;t++)a[t]=this.#t[n](e,!0),e+=r;return a}get bbox(){return L(this,`bbox`,this.#r($t.OFFSET_BBOX,4,`getInt16`,2))}get fontMatrix(){return L(this,`fontMatrix`,this.#r($t.OFFSET_FONT_MATRIX,6,`getFloat64`,8))}#i(e){return F(e<$t.strings.length,`Invalid string index`),nn(this.#e,this.#t,e,$t.OFFSET_STRINGS+4)}get fallbackName(){return L(this,`fallbackName`,this.#i(0))}get loadedName(){return L(this,`loadedName`,this.#i(1))}#a(e){let t=$t.OFFSET_STRINGS;for(let n=0;n<=e;n++)t+=4+this.#t.getUint32(t);let n=this.#t.getUint32(t);return{offset:t,length:n}}get data(){let{offset:e,length:t}=this.#a(2);return t?new Uint8Array(this.#e,e+4,t):void 0}clearData(){let{offset:e,length:t}=this.#a(2);t&&(this.#t.setUint32(e,0),this.#e=new Uint8Array(this.#e,0,e+4).slice().buffer,this.#t=new DataView(this.#e))}get cssFontInfo(){let{offset:e,length:t}=this.#a(1),n=null;return t&&(n=new rn(new Uint8Array(this.#e,e+4,t).slice().buffer)),L(this,`cssFontInfo`,n)}get systemFontInfo(){let{offset:e,length:t}=this.#a(0),n=null;return t&&(n=new an(new Uint8Array(this.#e,e+4,t).slice().buffer)),L(this,`systemFontInfo`,n)}},sn=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){let e=this.view,t=this.data[en.KIND],n=!!this.data[en.HAS_BBOX],r=!!this.data[en.HAS_BACKGROUND],i=e.getUint32(en.N_COORD,!0),a=e.getUint32(en.N_COLOR,!0),o=e.getUint32(en.N_STOP,!0),s=20,c=new Float32Array(this.buffer,s,i*2);s+=i*8;let l=new Uint8Array(this.buffer,s,a*4);s+=a*4;let u=[];for(let t=0;t<o;++t){let t=e.getFloat32(s,!0);s+=4;let n=e.getUint32(s,!0);s+=4,u.push([t,`#${n.toString(16).padStart(6,`0`)}`])}let d=null;if(n){d=[];for(let t=0;t<4;++t)d.push(e.getFloat32(s,!0)),s+=4}let f=null;if(r&&(f=new Uint8Array(this.buffer,s,3),s+=3),t===1)return[`RadialAxial`,`axial`,d,u,[c[0],c[1]],[c[2],c[3]],null,null];if(t===2)return[`RadialAxial`,`radial`,d,u,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(t===3){let e=this.data[en.SHADING_TYPE],t=null;if(c.length>0){t=_.slice();for(let e=0,n=c.length;e<n;e+=2)B.pointBoundingBox(c[e],c[e+1],t)}return[`Mesh`,e,c,l,i,t,d,f]}throw Error(`Unsupported pattern kind: ${t}`)}},cn=class{#e;constructor(e){this.#e=e}get path(){return z.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}};function ln(e){if(e instanceof URL)return e;if(typeof e==`string`){if(g){if(/^[a-z][a-z0-9\-+.]+:/i.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}let t=URL.parse(e,window.location);if(t)return t}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}function un(e){if(g&&typeof Buffer<`u`&&e instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e==`string`)return _e(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`object`&&!isNaN(e?.length))return new Uint8Array(e);throw Error(`Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.`)}function dn(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}var fn=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,pn=Ce.bind(null,fn,e=>typeof e==`object`&&typeof e?.name==`string`),mn=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){N("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},hn={DATA:1,ERROR:2},G={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function gn(){}function _n(e){if(e instanceof he||e instanceof fe||e instanceof de||e instanceof pe||e instanceof R)return e;switch(e instanceof Error||typeof e==`object`&&e||P(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new he(e.message);case`InvalidPDFException`:return new fe(e.message);case`PasswordException`:return new de(e.message,e.code);case`ResponseException`:return new pe(e.message,e.status,e.missing);case`UnknownErrorException`:return new R(e.message,e.details)}return new R(e.message,e.toString())}var vn=class{#e=new Map;#t=new Map;#n=1;#r;#i=new AbortController;#a;#o=new Map;#s=1;#c=new Map;#l;constructor(e,t,n){this.#a=e,this.#l=t,this.#r=n,n.addEventListener(`message`,this.#u.bind(this),{signal:this.#i.signal})}#u({data:e}){if(e.targetName!==this.#a)return;if(e.stream){this.#f(e);return}if(e.callback){let{callbackId:t,callback:n}=e,r=this.#t.get(t);if(!r)throw Error(`Cannot resolve callback ${t}`);if(this.#t.delete(t),n===hn.DATA)r.resolve(e.data);else if(n===hn.ERROR)r.reject(_n(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.#e.get(e.action);if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.#a,r=e.sourceName,i=this.#r;Promise.try(t,e.data).then(t=>{i.postMessage({sourceName:n,targetName:r,callback:hn.DATA,callbackId:e.callbackId,data:t})},t=>{i.postMessage({sourceName:n,targetName:r,callback:hn.ERROR,callbackId:e.callbackId,reason:_n(t)})})}else e.streamId?this.#d(e):t(e.data)}on(e,t){let n=this.#e;if(n.has(e))throw Error(`There is already a "${e}" handler.`);n.set(e,t)}send(e,t,n){this.#r.postMessage({sourceName:this.#a,targetName:this.#l,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.#n++,i=Promise.withResolvers();this.#t.set(r,i);try{this.#r.postMessage({sourceName:this.#a,targetName:this.#l,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.#s++,a=this.#a,o=this.#l,s=this.#r;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.#o.set(i,{controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1}),s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.#o.get(i).pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:G.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{F(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.#o.get(i).cancelCall=t,this.#o.get(i).isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:G.CANCEL,streamId:i,reason:_n(e)}),t.promise}},n)}#d(e){let t=e.streamId,n=this.#a,r=e.sourceName,i=this.#r,a=this.#c,o=this.#e.get(e.action),s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:G.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:G.CLOSE,streamId:t}),a.delete(t))},error(e){F(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:G.ERROR,streamId:t,reason:_n(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,a.set(t,s),Promise.try(o,e.data,s).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:G.START_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:G.START_COMPLETE,streamId:t,reason:_n(e)})})}#f(e){let t=e.streamId,n=this.#a,r=e.sourceName,i=this.#r,a=this.#o.get(t),o=this.#c.get(t);switch(e.stream){case G.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(_n(e.reason));break;case G.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(_n(e.reason));break;case G.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:G.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||gn).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:G.PULL_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:G.PULL_COMPLETE,streamId:t,reason:_n(e)})});break;case G.ENQUEUE:if(F(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case G.CLOSE:if(F(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#p(a,t);break;case G.ERROR:F(a,`error should have stream controller`),a.controller.error(_n(e.reason)),this.#p(a,t);break;case G.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(_n(e.reason)),this.#p(a,t);break;case G.CANCEL:if(!o)break;let s=_n(e.reason);Promise.try(o.onCancel||gn,s).then(()=>{i.postMessage({sourceName:n,targetName:r,stream:G.CANCEL_COMPLETE,streamId:t,success:!0})},e=>{i.postMessage({sourceName:n,targetName:r,stream:G.CANCEL_COMPLETE,streamId:t,reason:_n(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,this.#c.delete(t);break;default:throw Error(`Unexpected stream case`)}}async#p(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),this.#o.delete(t)}destroy(){this.#i?.abort(),this.#i=null}},yn=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:P(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){P("Abstract method `_fetch` called.")}},bn=class extends yn{async _fetch(e,t){let n=await Pe(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:_e(n)}},xn=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){P("Abstract method `_createCanvas` called.")}},Sn=class extends xn{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},Cn=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addKnockoutFilter(e=0){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}addSelectionHCMFilter(e,t){return`none`}addSelectionFilter(){return`none`}createSelectionStyle(e=null){return null}destroy(e=!1){}},wn=class extends Cn{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.colorScheme=`only light`,t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(b,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(b,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){let t=e=>e&&Array.from(e,e=>e/255).join(`,`);if(e.length===1){let n=t(e[0]);return[n,n,n]}let[n,r,i]=e;return[t(n),t(r),t(i)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Ie(e)?N(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=le(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=B.makeHexColor(...a);let o=this.#v(t);if(t=B.makeHexColor(...o),this.#b(),e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array.from({length:256},(e,t)=>nt(t/255)).join(`,`),c=`g_${this.#r}_hcm_filter`,l=i.filter=this.#m(c);this.#g(s,s,s,l),this.#p(l);let u=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(u(0,5),u(1,5),u(2,5),l),i.url=this.#d(c),i.url}addSelectionHCMFilter(e,t){return this.addHighlightHCMFilter(`selection`,e,t,`HighlightText`,`Highlight`)}addSelectionFilter(){return this.addHighlightHCMFilter(`selection_default`,`black`,`white`,`HighlightText`,`Highlight`)}createSelectionStyle(e=null){let t=e?this.addSelectionHCMFilter(e.foreground,e.background):this.addSelectionFilter();return t===`none`||!z.platform.isFirefox?null:{"backdrop-filter":t,"background-color":`transparent`}}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addKnockoutFilter(e=0){let t=e>0?Math.min(1/e,1e6):1e6,n=`knockout_${t}`,r=this.#s.get(n);if(r)return r;let i=`g_${this.#r}_knockout_filter_${this.#o++}`,a=this.#d(i);this.#s.set(n,a);let o=this.#m(i),s=this.#i.createElementNS(b,`feComponentTransfer`);o.append(s);let c=this.#i.createElementNS(b,`feFuncA`);return c.setAttribute(`type`,`linear`),c.setAttribute(`slope`,`${t}`),c.setAttribute(`intercept`,`0`),s.append(c),a}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#x.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#b();let p=(e,t,n)=>{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(b,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(b,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(b,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){if(!n)return;let r=this.#i.createElementNS(b,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(b,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(b,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,Ge(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#y(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,We(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#b(){this.#l.style.color=``,this.#l.style.backgroundColor=``}#x(e){let[t,n,r,i]=this.#y(e);if(i===1)return[t,n,r];let[a,o,s]=this.#v(`Canvas`);return[Tn(t,a,i),Tn(n,o,i),Tn(r,s,i)]}};function Tn(e,t,n){return Math.round(n*e+(1-n)*t)}g&&N("Please use the `legacy` build in Node.js environments.");async function En(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}var Dn=class extends Cn{},On=class extends xn{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url)(`@napi-rs/canvas`).createCanvas(e,t)}},kn=class extends yn{async _fetch(e,t){return En(e)}};function An({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=z.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r<i;++r){for(let r=t+u;t<r;++t,m+=8){let r=e[t];n[m]=c^-(r>>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t<p?e[t++]:255;for(let e=0;e<d;++e,++m)n[m]=c^-(r>>7-e&1)&f}return{srcPos:t,destPos:m}}function jn({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0,s=i*a*3,c=s>>2,l=new Uint32Array(e.buffer,t,c),u=z.isLittleEndian?4278190080:255;if(z.isLittleEndian){for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e>>>24|t<<8|u,n[r+2]=t>>>16|i<<16|u,n[r+3]=i>>>8|u}for(let i=t+o*4,a=t+s;i<a;i+=3)n[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|u}else{for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e<<24|t>>>8|u,n[r+2]=t<<16|i>>>16|u,n[r+3]=i<<8|u}for(let i=t+o*4,a=t+s;i<a;i+=3)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|u}return{srcPos:t+s,destPos:r}}var Mn=`
2
+ struct Uniforms {
3
+ offsetX : f32,
4
+ offsetY : f32,
5
+ scaleX : f32,
6
+ scaleY : f32,
7
+ paddedWidth : f32,
8
+ paddedHeight : f32,
9
+ borderSize : f32,
10
+ _pad : f32,
11
+ };
12
+
13
+ @group(0) @binding(0) var<uniform> u : Uniforms;
14
+
15
+ struct VertexInput {
16
+ @location(0) position : vec2<f32>,
17
+ @location(1) color : vec4<f32>,
18
+ };
19
+
20
+ struct VertexOutput {
21
+ @builtin(position) position : vec4<f32>,
22
+ @location(0) color : vec3<f32>,
23
+ };
24
+
25
+ @vertex
26
+ fn vs_main(in : VertexInput) -> VertexOutput {
27
+ var out : VertexOutput;
28
+ let cx = (in.position.x + u.offsetX) * u.scaleX;
29
+ let cy = (in.position.y + u.offsetY) * u.scaleY;
30
+ out.position = vec4<f32>(
31
+ ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
32
+ 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
33
+ 0.0,
34
+ 1.0
35
+ );
36
+ out.color = in.color.rgb;
37
+ return out;
38
+ }
39
+
40
+ @fragment
41
+ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
42
+ return vec4<f32>(in.color, 1.0);
43
+ }
44
+ `,Nn=new class{#e=null;#t=null;#n=null;#r=null;async#i(){if(!globalThis.navigator?.gpu)return!1;try{let e=await navigator.gpu.requestAdapter();return e?(this.#r=navigator.gpu.getPreferredCanvasFormat(),this.#t=await e.requestDevice(),!0):!1}catch{return!1}}init(){return this.#e||=this.#i()}get isReady(){return this.#t!==null}loadMeshShader(){if(!this.#t||this.#n)return;let e=this.#t.createShaderModule({code:Mn});this.#n=this.#t.createRenderPipeline({layout:`auto`,vertex:{module:e,entryPoint:`vs_main`,buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:`float32x2`}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:`unorm8x4`}]}]},fragment:{module:e,entryPoint:`fs_main`,targets:[{format:this.#r}]},primitive:{topology:`triangle-list`}})}draw(e,t,n,r,i,a,o,s){this.loadMeshShader();let c=this.#t,{offsetX:l,offsetY:u,scaleX:d,scaleY:f}=r,p=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(p,0,e);let m=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(m,0,t);let h=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(h,0,new Float32Array([l,u,d,f,a,o,s,0]));let g=c.createBindGroup({layout:this.#n.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:h}}]}),_=new OffscreenCanvas(a,o),v=_.getContext(`webgpu`);v.configure({device:c,format:this.#r,alphaMode:i?`opaque`:`premultiplied`});let y=i?{r:i[0]/255,g:i[1]/255,b:i[2]/255,a:1}:{r:0,g:0,b:0,a:0},b=c.createCommandEncoder(),x=b.beginRenderPass({colorAttachments:[{view:v.getCurrentTexture().createView(),clearValue:y,loadOp:`clear`,storeOp:`store`}]});return n>0&&(x.setPipeline(this.#n),x.setBindGroup(0,g),x.setVertexBuffer(0,p),x.setVertexBuffer(1,m),x.draw(n)),x.end(),c.queue.submit([b.finish()]),p.destroy(),m.destroy(),h.destroy(),_.transferToImageBitmap()}};function Pn(){return Nn.init()}function Fn(){return Nn.isReady}function In(){Nn.loadMeshShader()}function Ln(e,t,n,r,i,a,o,s){return Nn.draw(e,t,n,r,i,a,o,s)}var K={FILL:`Fill`,STROKE:`Stroke`,SHADING:`Shading`};function Rn(e,t){if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}var zn=class{matrix=null;isModifyingCurrentTransform(){return!1}getPattern(){P("Abstract method `getPattern` called.")}},Bn=class extends zn{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7]}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type===`radial`}areConic(){if(!this.isRadial())return!1;let e=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return e+this._r1>this._r0&&e+this._r0>this._r1}_createGradient(e,t=null){let n,r=this._p0,i=this._p1;if(t&&(r=r.slice(),i=i.slice(),B.applyTransform(r,t),B.applyTransform(i,t)),this._type===`axial`)n=e.createLinearGradient(r[0],r[1],i[0],i[1]);else if(this._type===`radial`){let a=this._r0,o=this._r1;if(t){let e=new Float32Array(2);B.singularValueDecompose2dScale(t,e),a*=e[0],o*=e[0]}n=e.createRadialGradient(r[0],r[1],a,i[0],i[1],o)}for(let e of this._colorStops)n.addColorStop(e[0],e[1]);return n}_createReversedGradient(e,t=null){let n=this._p1,r=this._p0;t&&(n=n.slice(),r=r.slice(),B.applyTransform(n,t),B.applyTransform(r,t));let i=this._r1,a=this._r0;if(t){let e=new Float32Array(2);B.singularValueDecompose2dScale(t,e),i*=e[0],a*=e[0]}let o=e.createRadialGradient(n[0],n[1],i,r[0],r[1],a),s=this._colorStops.map(([e,t])=>[1-e,t]).reverse();for(let[e,t]of s)o.addColorStop(e,t);return o}_createRasterPattern(e,t,n,r,i,a){let o=Math.ceil(r[2]-r[0])||1,s=Math.ceil(r[3]-r[1])||1,c=t.canvasFactory.create(o,s),l=c.context;l.clearRect(0,0,o,s),l.beginPath(),l.rect(0,0,o,s),l.translate(-r[0],-r[1]),n=B.transform(n,[1,0,0,1,r[0],r[1]]),l.transform(...i),Rn(l,this._bbox),this.areConic()&&(l.fillStyle=this._createReversedGradient(l),l.fill()),l.fillStyle=this._createGradient(l),l.fill(),a?.applyToCanvas(l);let u=e.createPattern(c.canvas,`no-repeat`);return t.canvasFactory.destroy(c),u.setTransform(new DOMMatrix(n)),u}getPattern(e,t,n,r){let i=t.current.transferMapsFallback;if(r===K.STROKE||r===K.FILL){if(this.isOriginBased()&&!i){let r=B.transform(n,t.baseTransform);this.matrix&&(r=B.transform(r,this.matrix));let i=.001,a=Math.hypot(r[0],r[1]),o=Math.hypot(r[2],r[3]),s=(r[0]*r[2]+r[1]*r[3])/(a*o);if(Math.abs(s)<i){if(this.isRadial()){if(Math.abs(a-o)<i)return this._createGradient(e,r)}else return this._createGradient(e,r)}}let a=t.current.getClippedPathBoundingBox(r,U(e))||[0,0,0,0],o=this.matrix?B.transform(t.baseTransform,this.matrix):t.baseTransform;return this._createRasterPattern(e,t,n,a,o,i)}return i&&n?this._createRasterPattern(e,t,n,t.current.clipBox,U(e),i):(this.areConic()&&(e.save(),Rn(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),Rn(e,this._bbox),this._createGradient(e))}};function Vn(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=e.width*4,f;c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r*2+1]>c[i*2+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n*2]+t.offsetX)*t.scaleX,m=(c[n*2+1]+t.offsetY)*t.scaleY,h=(c[r*2]+t.offsetX)*t.scaleX,g=(c[r*2+1]+t.offsetY)*t.scaleY,_=(c[i*2]+t.offsetX)*t.scaleX,v=(c[i*2+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a*4],b=l[a*4+1],x=l[a*4+2],S=l[o*4],C=l[o*4+1],w=l[o*4+2],T=l[s*4],E=l[s*4+1],D=l[s*4+2],O=Math.round(m),ee=Math.round(v),k,te,ne,A,re,j,M,ie;for(let e=O;e<=ee;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);k=p-(p-h)*t,te=y-(y-S)*t,ne=b-(b-C)*t,A=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),k=h-(h-_)*t,te=S-(S-T)*t,ne=C-(C-E)*t,A=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),re=p-(p-_)*t,j=y-(y-T)*t,M=b-(b-E)*t,ie=x-(x-D)*t;let n=Math.round(Math.min(k,re)),r=Math.round(Math.max(k,re)),i=d*e+n*4;for(let e=n;e<=r;e++)t=(k-e)/(k-re),t<0?t=0:t>1&&(t=1),u[i++]=te-(te-j)*t|0,u[i++]=ne-(ne-M)*t|0,u[i++]=A-(A-ie)*t|0,u[i++]=255}}var Hn=class extends zn{constructor(e){super(),this._posData=e[2],this._colData=e[3],this._vertexCount=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],In()}_createMeshCanvas(e,t,n,r=null){let i=1.1,a=3e3,o=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-o,l=Math.ceil(this._bounds[3])-s,u=Math.min(Math.ceil(Math.abs(c*e[0]*i)),a)||1,d=Math.min(Math.ceil(Math.abs(l*e[1]*i)),a)||1,f=c?c/u:1,p=l?l/d:1,m={coords:this._posData,colors:this._colData,offsetX:-o,offsetY:-s,scaleX:1/f,scaleY:1/p},h=u+4,g=d+4,_=n.create(h,g);if(Fn()&&this._vertexCount>48)_.context.drawImage(Ln(this._posData,this._colData,this._vertexCount,m,t,h,g,2),0,0);else{let e=_.context.createImageData(u,d);if(t){let n=e.data;for(let e=0,r=n.length;e<r;e+=4)n[e]=t[0],n[e+1]=t[1],n[e+2]=t[2],n[e+3]=255}for(let t=0,n=this._vertexCount;t<n;t+=3)Vn(e,m,t,t+1,t+2,t,t+1,t+2);_.context.putImageData(e,2,2)}return r?.applyToCanvas(_.context),{canvas:_.canvas,offsetX:o-2*f,offsetY:s-2*p,scaleX:f,scaleY:p}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){Rn(e,this._bbox);let i=new Float32Array(2);if(r===K.SHADING)B.singularValueDecompose2dScale(U(e),i);else if(this.matrix){B.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;B.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else B.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===K.SHADING?null:this._background,t.canvasFactory,t.current.transferMapsFallback);r!==K.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY);let o=e.createPattern(a.canvas,`no-repeat`);return t.canvasFactory.destroy(a),o}},Un=class extends zn{getPattern(){return`hotpink`}};function Wn(e){switch(e[0]){case`RadialAxial`:return new Bn(e);case`Mesh`:return new Hn(e);case`Dummy`:return new Un}throw Error(`Unknown IR type: ${e[0]}`)}var Gn={COLORED:1,UNCOLORED:2},Kn=class e{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,r){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.needsIsolation=e[9]??!0,this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r,this.patternBaseMatrix=this.matrix?B.transform(r,this.matrix):r}canSkipPatternCanvas([e,t,n,r]){let[i,a,o,s]=this.bbox,c=Math.abs(this.xstep),l=Math.abs(this.ystep);if(e>c+1e-6||t>l+1e-6)return null;let u=Math.floor((n-o)/c)+1,d=Math.ceil((n+e-i)/c)-1,f=Math.floor((r-s)/l)+1,p=Math.ceil((r+t-a)/l)-1;return d<=u&&p<=f?[u,f]:null}updatePatternDims(e,t){let n=_.slice();B.axialAlignedBoundingBox(e,B.inverseTransform(this.patternBaseMatrix),n),t[0]=n[2]-n[0],t[1]=n[3]-n[1],t[2]=n[0],t[3]=n[1]}_renderTileCanvas(e,t,n,r){let[i,a,o,s]=this.bbox,c=e.canvasFactory.create(n.size,r.size),l=c.context,u=this.canvasGraphicsFactory.createCanvasGraphics(l,t);return u.groupLevel=e.groupLevel,u.current.transferMapsFallback=e.current.transferMapsFallback,this.setFillAndStrokeStyleToContext(u,this.paintType,this.color),l.translate(-n.scale*i,-r.scale*a),u.transform(0,n.scale,0,0,r.scale,0,0),l.save(),u.dependencyTracker?.save(),this.clipBbox(u,i,a,o,s),u.baseTransform=U(u.ctx),u.executeOperatorList(this.operatorList),u.endDrawing(),u.dependencyTracker?.restore(),l.restore(),c}_getCombinedScales(){let e=new Float32Array(2);B.singularValueDecompose2dScale(this.matrix,e);let[t,n]=e;return B.singularValueDecompose2dScale(this.baseTransform,e),[t*e[0],n*e[1]]}drawPattern(e,t,n=!1,[r,i],a){let[o,s,c,l]=this.bbox,u=e.dependencyTracker;if(u&&(e.dependencyTracker=new Ut(u,a)),e.save(),n?e.ctx.clip(t,`evenodd`):e.ctx.clip(t),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(r*this.xstep,i*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!==`source-over`||e.inSMaskMode){let t=c-o,n=l-s,[r,i]=this._getCombinedScales(),u=this.getSizeAndScale(t,this.ctx.canvas.width,r),d=this.getSizeAndScale(n,this.ctx.canvas.height,i),f=this._renderTileCanvas(e,a,u,d);e.ctx.drawImage(f.canvas,o,s,t,n),e.canvasFactory.destroy(f)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,s,c,l),e.baseTransformStack.push(e.baseTransform),e.baseTransform=U(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),u&&(e.dependencyTracker=u)}createPatternCanvas(e,t){let[n,r,i,a]=this.bbox,o=i-n,s=a-r,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),oe(`TilingType: `+this.tilingType);let[u,d]=this._getCombinedScales(),f=o,p=s,m=!1,h=!1;Math.ceil(c*u)>=Math.ceil(o*u)?f=c:m=!0,Math.ceil(l*d)>=Math.ceil(s*d)?p=l:h=!0;let g=this.getSizeAndScale(f,this.ctx.canvas.width,u),_=this.getSizeAndScale(p,this.ctx.canvas.height,d),v=this._renderTileCanvas(e,t,g,_);if(m||h){let t=v.canvas;m&&(f=c),h&&(p=l);let i=this.getSizeAndScale(f,this.ctx.canvas.width,u),a=this.getSizeAndScale(p,this.ctx.canvas.height,d),g=i.size,_=a.size,y=e.canvasFactory.create(g,_),b=y.context,x=m?Math.min(Math.floor(o/c),Math.ceil(t.width/g)):0,S=h?Math.min(Math.floor(s/l),Math.ceil(t.height/_)):0,C=t,w=null;if(h){w=e.canvasFactory.create(t.width,_);let n=w.context;for(let e=S;e>=0;e--)n.drawImage(t,0,_*e,t.width,_,0,0,t.width,_);C=w.canvas}for(let e=x;e>=0;e--)b.drawImage(C,g*e,0,g,_,0,0,g,_);return w&&e.canvasFactory.destroy(w),e.canvasFactory.destroy(v),{canvas:y.canvas,canvasEntry:y,scaleX:i.scale,scaleY:a.scale,offsetX:n,offsetY:r}}return{canvas:v.canvas,canvasEntry:v,scaleX:g.scale,scaleY:_.scale,offsetX:n,offsetY:r}}getSizeAndScale(t,n,r){let i=Math.max(e.MAX_PATTERN_SIZE,n),a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(e,t,n,r,i){let a=r-t,o=i-n,s=new Path2D;s.rect(t,n,a,o),B.axialAlignedBoundingBox([t,n,r,i],U(e.ctx),e.current.minMax),e.ctx.clip(s),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,t,n){switch(t){case Gn.COLORED:n=`#000000`;break;case Gn.UNCOLORED:break;default:throw new me(`Unsupported paint type: ${t}`)}let{ctx:r,current:i}=e;i.patternFill=i.patternStroke=!1,r.fillStyle=r.strokeStyle=i.transferMapsFallback?.applyToColor(n)??n,i.fillColor=i.strokeColor=n}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=r===K.SHADING?n:B.transform(n,this.patternBaseMatrix),o=this.createPatternCanvas(t,i),s=new DOMMatrix(a);s=s.translate(o.offsetX,o.offsetY),s=s.scale(1/o.scaleX,1/o.scaleY);let c=e.createPattern(o.canvas,`repeat`);return t.canvasFactory.destroy(o.canvasEntry),c.setTransform(s),c}},qn=16,Jn=100,Yn=15,Xn=10,Zn=16,Qn=new Float32Array(2);function $n(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);let n=new Map;for(let r of[`save`,`restore`,`rotate`,`scale`,`translate`,`transform`,`setTransform`,`resetTransform`,`clip`,`moveTo`,`lineTo`,`bezierCurveTo`,`quadraticCurveTo`,`arc`,`arcTo`,`ellipse`,`rect`,`roundRect`,`closePath`,`beginPath`]){let i=e[r];typeof i==`function`&&typeof t[r]==`function`&&(n.set(r,i),e[r]=function(...e){return t[r](...e),i.apply(this,e)})}e._removeMirroring=()=>{for(let[t,r]of n)e[t]=r;delete e._removeMirroring}}function er(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=U(e);if(d===0&&f===0){let g=o*u+m,_=Math.round(g),v=s*p+h,y=Math.round(v),b=(o+c)*u+m,x=Math.abs(Math.round(b)-_)||1,S=(s+l)*p+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),_,y),e.drawImage(t,n,r,i,a,0,0,x,C),e.setTransform(u,d,f,p,m,h),[x,C]}if(u===0&&p===0){let g=s*f+m,_=Math.round(g),v=o*d+h,y=Math.round(v),b=(s+l)*f+m,x=Math.abs(Math.round(b)-_)||1,S=(o+c)*d+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,_,y),e.drawImage(t,n,r,i,a,0,0,C,x),e.setTransform(u,d,f,p,m,h),[C,x]}e.drawImage(t,n,r,i,a,o,s,c,l);let g=Math.hypot(u,d),_=Math.hypot(f,p);return[g*c,_*l]}var tr=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=y;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=O.FILL;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps=`none`;transferMapsFallback=null;minMax=v.slice();constructor(e,t){this.clipBox=new Float32Array([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=this.tilingPatternDims?.slice(),e}getPathBoundingBox(e=K.FILL,t=null){let n=this.minMax.slice();if(e===K.STROKE){t||P(`Stroke bounding box must include transform.`),B.singularValueDecompose2dScale(t,Qn);let e=Qn[0]*this.lineWidth/2,r=Qn[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=B.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(v,0)}getClippedPathBoundingBox(e=K.FILL,t=null){return B.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function nr(e,t){let{width:n,height:r,kind:i}=t,a=r%Zn,o=(r-a)/Zn,s=a===0?o:o+1,c=e.createImageData(n,Zn),l=0,u=t.data,d=c.data,f;if(i===ee.GRAYSCALE_1BPP)for(f=0;f<s;f++)({srcPos:l}=An({src:u,srcPos:l,dest:d,width:n,height:f<o?Zn:a})),e.putImageData(c,0,f*Zn);else if(i===ee.RGBA_32BPP){let t=0,r=n*Zn*4;for(f=0;f<o;f++)d.set(u.subarray(l,l+r)),l+=r,e.putImageData(c,0,t),t+=Zn;f<s&&(r=n*a*4,d.set(u.subarray(l,l+r)),e.putImageData(c,0,t))}else if(i===ee.RGB_24BPP)for(f=0;f<s;f++)({srcPos:l}=jn({src:u,srcPos:l,dest:new Uint32Array(d.buffer),width:n,height:f<o?Zn:a})),e.putImageData(c,0,f*Zn);else throw Error(`bad image kind: ${i}`)}function rr(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}let{width:n,height:r}=t,i=r%Zn,a=(r-i)/Zn,o=i===0?a:a+1,s=e.createImageData(n,Zn),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++)({srcPos:c}=An({src:l,srcPos:c,dest:u,width:n,height:t<a?Zn:i,nonBlackColor:0})),e.putImageData(s,0,t*Zn)}function ir(e,t){for(let n of[`strokeStyle`,`fillStyle`,`fillRule`,`globalAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`globalCompositeOperation`,`font`,`filter`])e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function ar(e){e.strokeStyle=e.fillStyle=`#000000`,e.fillRule=`nonzero`,e.globalAlpha=1,e.lineWidth=1,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=10,e.globalCompositeOperation=`source-over`,e.font=`10px sans-serif`,e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0);let{filter:t}=e;t!==`none`&&t!==``&&(e.filter=`none`)}var or=class e{#e;constructor(t){let[n,r=n,i=n]=t,{identityMap:a}=e;this.#e=[n||a,r||a,i||a]}static get identityMap(){return L(this,`identityMap`,Uint8Array.from({length:256},(e,t)=>t))}applyToColor(e){if(typeof e!=`string`||!e.startsWith(`#`))return e;let[t,n,r]=We(e),[i,a,o]=this.#e;return B.makeHexColor(i[t],a[n],o[r])}applyToImageData({data:e}){let[t,n,r]=this.#e;for(let i=0,a=e.length;i<a;i+=4)e[i]=t[e[i]],e[i+1]=n[e[i+1]],e[i+2]=r[e[i+2]]}applyToCanvas(e){let{width:t,height:n}=e.canvas,r=e.getImageData(0,0,t,n);this.applyToImageData(r),e.putImageData(r,0,0)}};function sr(e,t){if(t)return!0;B.singularValueDecompose2dScale(e,Qn);let n=Math.fround(Ye.pixelRatio*Ne.PDF_TO_CSS_UNITS);return Qn[0]<=n&&Qn[1]<=n}var cr=[`butt`,`round`,`square`],lr=[`miter`,`round`,`bevel`],ur={},dr={},fr=class e{static#e=null;#t=0;#n=0;#r=null;#i=null;#a=null;#o=null;#s=1;#c;#l=null;#u=[];constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l,u){this.ctx=e,this.current=new tr(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedBitmapsMap=new Map,this.dependencyTracker=l??null,this.imagesTracker=u??null}getObject(e,t,n=null){return typeof t==`string`?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith(`g_`)?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){let i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||`#ffffff`,this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){let e=this.transparentCanvasEntry=this.canvasFactory.create(i,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=e,this.ctx.save(),this.ctx.transform(...U(this.compositeCtx))}this.ctx.save(),ar(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=U(this.ctx)}executeOperatorList(e,t,n,r,i){let a=e.argsArray,o=e.fnArray,s=t||0,c=a.length;if(c===s)return s;let l=c-s>Xn&&typeof n==`function`,u=l?Date.now()+Yn:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0){if(s===r.nextBreakPoint)return r.breakIt(s,n),s;if(r.shouldSkip(s)){if(++s===c)return s;continue}}if(!i||i(s,e)){if(m=o[s],h=a[s]??null,m!==A.dependency)h===null?this[m](s):this[m](s,...h);else for(let e of h){this.dependencyTracker?.recordNamedData(e,s);let t=e.startsWith(`g_`)?f:p;if(!t.has(e))return t.get(e,n),s}}if(s++,s===c)return s;if(l&&++d>Xn){if(Date.now()>u)return n(),s;d=0}}}#d(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}endDrawing(){this.#d();for(let e of this.smaskGroupCanvases)this.canvasFactory.destroy(e);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0;for(let e of this.#u)this.#x(e);this.#u.length=0,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=1,this.#l=null,this.#n=0,this.#t=0,this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#f()}#f(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!==`none`){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,r=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=[],s=i,c=a,l=n,u=r;for(;s>2&&l>1||c>2&&u>1;){let e=l,t=u;s>2&&l>1&&(e=Math.ceil(l/2),s/=l/e),c>2&&u>1&&(t=Math.ceil(u/2),c/=u/t),o.push({newWidth:e,newHeight:t}),l=e,u=t}if(o.length===0)return{img:e,paintWidth:n,paintHeight:r,tmpCanvas:null};if(o.length===1){let{newWidth:t,newHeight:i}=o[0],a=this.canvasFactory.create(t,i);return a.context.drawImage(e,0,0,n,r,0,0,t,i),{img:a.canvas,paintWidth:t,paintHeight:i,tmpCanvas:a}}let d=this.canvasFactory.create(1,1),f=this.canvasFactory.create(1,1),p=n,m=r,h=e;for(let{newWidth:e,newHeight:t}of o)this.canvasFactory.reset(f,e,t),f.context.drawImage(h,0,0,p,m,0,0,e,t),[d,f]=[f,d],h=d.canvas,p=e,m=t;return this.canvasFactory.destroy(f),{img:d.canvas,paintWidth:p,paintHeight:m,tmpCanvas:d}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.patternFill,o=a?this.current.fillColor:n.fillStyle,s=U(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(a?s:[s.slice(0,4),o]),c=this._cachedBitmapsMap.getOrInsertComputed(n,Te);let r=c.get(l);if(r&&!a){let t=Math.round(Math.min(s[0],s[2])+s[4]),n=Math.round(Math.min(s[1],s[3])+s[5]);return this.dependencyTracker?.recordDependencies(e,Wt.transformAndFill),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.canvasFactory.create(r,i),rr(d.context,t));let f=B.transform(s,[1/r,0,0,-1/i,0,0]);f=B.transform(f,[1,0,0,1,0,-i]);let p=v.slice();B.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,y=Math.round(g-m)||1,b=Math.round(_-h)||1,x=this.canvasFactory.create(y,b),S=x.context,C=m,w=h;S.translate(-C,-w),S.transform(...f);let T=null;if(!u){let e=this._scaleImage(d.canvas,qe(S));u=e.img,T=e.tmpCanvas,u!==d.canvas&&(this.canvasFactory.destroy(d),d=null),c&&a&&(c.set(l,u),T=null,d=null)}S.imageSmoothingEnabled=sr(U(S),t.interpolate),er(S,u,0,0,u.width,u.height,0,0,r,i),T&&this.canvasFactory.destroy(T),d&&this.canvasFactory.destroy(d),S.globalCompositeOperation=`source-in`;let E=B.transform(qe(S),[1,0,0,1,-C,-w]);return S.fillStyle=a?o.getPattern(n,this,E,K.FILL,e):o,S.fillRect(0,0,r,i),c&&!a&&c.set(l,x.canvas),this.dependencyTracker?.recordDependencies(e,Wt.transformAndFill),{canvas:x.canvas,canvasEntry:c&&!a?null:x,offsetX:Math.round(C),offsetY:Math.round(w)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData(`lineWidth`,e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData(`lineCap`,e),this.ctx.lineCap=cr[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=lr[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData(`miterLimit`,e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData(`dash`,e);let r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=n)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,r]of t)switch(n){case`LW`:this.setLineWidth(e,r);break;case`LC`:this.setLineCap(e,r);break;case`LJ`:this.setLineJoin(e,r);break;case`ML`:this.setMiterLimit(e,r);break;case`D`:this.setDash(e,r[0],r[1]);break;case`RI`:this.setRenderingIntent(e,r);break;case`FL`:this.setFlatness(e,r);break;case`Font`:this.setFont(e,r[0],r[1]);break;case`CA`:this.dependencyTracker?.recordSimpleData(`strokeAlpha`,e),this.current.strokeAlpha=r;break;case`ca`:this.dependencyTracker?.recordSimpleData(`fillAlpha`,e),this.ctx.globalAlpha=this.current.fillAlpha=r;break;case`BM`:this.dependencyTracker?.recordSimpleData(`globalCompositeOperation`,e),this.ctx.globalCompositeOperation=r;break;case`SMask`:this.dependencyTracker?.recordSimpleData(`SMask`,e),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(e);break;case`TR`:{this.dependencyTracker?.recordSimpleData(`filter`,e);let t=this.filterFactory.addFilter(r);this.ctx.filter=t;let n=null;r&&(t===`none`||!z.isCanvasFilterSupported||this.ctx.filter===`none`||this.ctx.filter===``)&&(this.ctx.filter=t=`none`,n=new or(r)),this.current.transferMaps=t,(n||this.current.transferMapsFallback)&&(this.current.transferMapsFallback=n,this.current.patternFill||(this.ctx.fillStyle=this.#y(this.current.fillColor)),this.current.patternStroke||(this.ctx.strokeStyle=this.#y(this.current.strokeColor)));break}}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&=(this.canvasFactory.destroy(this.smaskPreparedEntry),null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(e){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e))}checkSMaskState(e){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode(e):!this.current.activeSMask&&t?this.endSMaskMode():this.current.activeSMask&&t&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(e){let{canvas:t,subtype:n,backdrop:r,transferMap:i}=e,a=n===`Luminosity`||n===`Alpha`&&i;if(!a&&!(n===`Luminosity`&&r)){this.smaskPreparedFor=e;return}let o;if(n===`Luminosity`&&r){let[e,t,n]=We(r),a=Math.round(.3*e+.59*t+.11*n);o=i?.[a]??a}else o=i?.[0]??0;let{width:s,height:c}=this.ctx.canvas,l=t.width*t.height,u=s*c<4*l,d=a?{url:n===`Alpha`?this.filterFactory.addAlphaFilter(i):this.filterFactory.addLuminosityFilter(i),subtype:n,transferMap:i}:null,f=n===`Luminosity`?r:null,p,m,h;u?(p=this._bakeSMaskCanvas(t,e.offsetX,e.offsetY,s,c,f,d),m=0,h=0):(p=this._bakeSMaskCanvas(t,0,0,t.width,t.height,f,d),m=e.offsetX,h=e.offsetY),this.smaskPreparedEntry=p,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=m,this.smaskPreparedOffsetY=h,this.smaskPreparedOOBAlpha=!u&&o!==0?o:null}_bakeSMaskCanvas(e,t,n,r,i,a,o){!a&&!o&&P(`_bakeSMaskCanvas with neither backdrop nor filter`);let s=this.canvasFactory.create(r,i),c=s.context;if(c.drawImage(e,t,n),a&&(c.globalCompositeOperation=`destination-atop`,c.fillStyle=a,c.fillRect(0,0,r,i)),!o)return s;let l=this.canvasFactory.create(r,i),u=l.context;u.filter=o.url;let d=z.isCanvasFilterSupported&&u.filter!==`none`&&u.filter!==``;if(u.drawImage(s.canvas,0,0),z.isCanvasFilterSupported&&(u.filter=`none`),!d){let e=u.getImageData(0,0,r,i),{data:t}=e,{transferMap:n}=o;if(o.subtype===`Luminosity`)for(let e=0,r=t.length;e<r;e+=4){let r=.3*t[e]+.59*t[e+1]+.11*t[e+2]+.5|0;t[e]=t[e+1]=t[e+2]=0,t[e+3]=n?.[r]??r}else for(let e=3,r=t.length;e<r;e+=4)t[e]=n[t[e]];u.putImageData(e,0,0)}return this.canvasFactory.destroy(s),l}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let{width:t,height:n}=this.ctx.canvas,r=this.canvasFactory.create(t,n);this.smaskScratchCanvas=r,this.suspendedCtx=this.ctx;let i=this.ctx=r.context;i.setTransform(this.suspendedCtx.getTransform()),ir(this.suspendedCtx,i),$n(i,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),ir(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}#p(e,t=null,n=1){let{width:r,height:i}=e,a=t??this.canvasFactory.create(r,i),o=a.context;n=Math.round(n*255)/255;let s=n<1;s&&this.#c===void 0&&(this.#c=z.isCanvasFilterSupported?new Map:`none`);let c=`none`;if(s&&this.#c instanceof Map&&(c=this.#c.getOrInsertComputed(n,()=>this.filterFactory.addKnockoutFilter(n))),!s||c!==`none`)return t&&(o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,r,i),o.restore()),o.filter=c,o.drawImage(e,0,0),o.filter=`none`,a;let l=e.getContext(`2d`,{willReadFrequently:!0}).getImageData(0,0,r,i),u=o.createImageData(r,i),d=l.data,f=u.data,p=n>0?1/n:1e6;for(let e=3,t=d.length;e<t;e+=4)f[e]=Math.min(Math.round(d[e]*p),255);return o.putImageData(u,0,0),a}#m(e,t,n,r){let i=e?.[t]??null;if(i&&(i.canvas.width!==n||i.canvas.height!==r)&&(this.canvasFactory.destroy(i),i=null),!i)return i=this.canvasFactory.create(n,r),e&&(e[t]=i),i;let a=i.context;return a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,n,r),a.restore(),i}#h(e,t,n={}){let{backdropCanvas:r=null,destTransform:i=[1,0,0,1,0,0],backdropOffset:a=[0,0],reuseMaskEntry:o=null,poolMeta:s=null,sourceAlpha:c=1,sourceFilter:l=`none`,knockoutAlpha:u=1}=n,{width:d,height:f}=t,p=this.#p(t,o,u),m=e.globalCompositeOperation;if(e.save(),e.setTransform(...i),e.globalAlpha=1,z.isCanvasFilterSupported&&(e.filter=`none`),e.globalCompositeOperation=`destination-out`,e.drawImage(p.canvas,0,0),r){let[t,n]=a,i=this.#m(s,`knockoutBackdropEntry`,d,f),o=i.context;o.drawImage(r,t,n,d,f,0,0,d,f),o.globalCompositeOperation=`destination-in`,o.drawImage(p.canvas,0,0),o.globalCompositeOperation=`source-over`,e.globalCompositeOperation=`destination-over`,e.drawImage(i.canvas,0,0),s||this.canvasFactory.destroy(i)}e.globalCompositeOperation=m,e.globalAlpha=c,z.isCanvasFilterSupported&&(e.filter=l??`none`),e.drawImage(t,0,0),e.restore(),o||this.canvasFactory.destroy(p)}#g(e=1){if(this.#t===0||this.#n>0||!this.contentVisible)return!1;this.#n++,this.#s=e;let t=this.#u.at(-1),{canvas:n}=this.ctx,r=this.#m(t,`knockoutTempEntry`,n.width,n.height);this.#r=r;let i=r.context;return i.save(),i.setTransform(this.ctx.getTransform()),ir(this.ctx,i),this.#o=i.globalCompositeOperation,i.globalCompositeOperation=`source-over`,$n(i,this.ctx),this.#l=t,this.#i=this.ctx,this.#a=this.suspendedCtx,this.ctx=i,this.inSMaskMode&&(this.suspendedCtx=i),!0}#_(e){if(!e)return;let t=this.#r,n=this.#i,r=this.#a,i=t.context;this.#r=null,this.#i=null,this.#a=null,this.inSMaskMode&&this.suspendedCtx===i&&this.ctx!==i&&this.endSMaskMode(),this.inSMaskMode&&(this.suspendedCtx=r),this.ctx._removeMirroring(),this.ctx.globalCompositeOperation=this.#o,this.#o=null,ir(this.ctx,n),this.ctx=n;let a=this.#l;this.#l=null;let o=this.#s;this.#s=1;try{this.#h(r??n,t.canvas,{backdropCanvas:a?.backdropCtx?.canvas??null,backdropOffset:a?.backdropCtx?[a.offsetX,a.offsetY]:[0,0],reuseMaskEntry:a?.knockoutMaskEntry??null,poolMeta:a,knockoutAlpha:o})}finally{i.restore(),this.#n--,a||this.canvasFactory.destroy(t)}}compose(e){if(!this.current.activeSMask)return;e=e?[Math.floor(e[0]),Math.floor(e[1]),Math.ceil(e[2]),Math.ceil(e[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx,r=this.#n>0&&n===this.ctx;this.composeSMask(r?null:n,t,this.ctx,e),!r&&(this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;if(o===0||s===0)return;let c=this.smaskPreparedEntry;if(c){let e=i,r=a,l=o,u=s,d=this.smaskPreparedOOBAlpha,f=d!==null;if(f){e=Math.max(i,t.offsetX),r=Math.max(a,t.offsetY);let n=Math.min(i+o,t.offsetX+t.canvas.width),c=Math.min(a+s,t.offsetY+t.canvas.height);l=n-e,u=c-r}if(l>0&&u>0){let t=e-this.smaskPreparedOffsetX,i=r-this.smaskPreparedOffsetY;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);let a=new Path2D;a.rect(e,r,l,u),n.clip(a),n.globalCompositeOperation=`destination-in`,n.drawImage(c.canvas,t,i,l,u,e,r,l,u),n.restore()}f&&d<255&&this._applySMaskOOBAlpha(n,i,a,o,s,e,r,e+l,r+u,d)}else this.genericComposeSMask(t,n,o,s,i,a);e&&(e.save(),e.globalAlpha=1,e.globalCompositeOperation=t.blendMode||`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,i,a,o,s,i,a,o,s),e.restore())}_applySMaskOOBAlpha(e,t,n,r,i,a,o,s,c,l){let u=a<s&&o<c;if(u&&a===t&&o===n&&s===t+r&&c===n+i)return;let d=new Path2D;d.rect(t,n,r,i),u&&d.rect(a,o,s-a,c-o),e.save(),e.globalAlpha=l/255,e.setTransform(1,0,0,1,0,0),e.clip(d,`evenodd`),e.globalCompositeOperation=`destination-in`,e.fillStyle=`#000000`,e.fillRect(t,n,r,i),e.restore()}genericComposeSMask(e,t,n,r,i,a){let{context:o,offsetX:s,offsetY:c}=e;t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let l=new Path2D;l.rect(i,a,n,r),t.clip(l),t.globalCompositeOperation=`destination-in`,t.drawImage(o.canvas,i-s,a-c,n,r,i,a,n,r),t.restore()}save(e){this.inSMaskMode&&ir(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){this.dependencyTracker?.restore(e),this.stateStack.length===0?this.inSMaskMode&&this.endSMaskMode():(this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(ir(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(e),this.pendingClip=null,this._cachedScaleForStroking[0]=-1)}transform(e,t,n,r,i,a,o){this.dependencyTracker?.recordIncrementalData(`transform`,e),this.ctx.transform(t,n,r,i,a,o),this._cachedScaleForStroking[0]=-1}constructPath(e,t,n,r){let[i]=n;if(!r){i||=n[0]=new Path2D,t!==A.stroke&&t!==A.closeStroke&&(this.current.tilingPatternDims=null),this[t](e,i);return}if(this.dependencyTracker!==null){let n=t===A.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,r[0]-n,r[2]+n,r[1]-n,r[3]+n).recordDependencies(e,[`transform`])}i instanceof Path2D||(i=n[0]=st(i)),B.axialAlignedBoundingBox(r,U(this.ctx),this.current.minMax);let a=this.current.tilingPatternDims;if(a&&t!==A.stroke&&t!==A.closeStroke&&this.current.fillColor instanceof Kn){let e=B.intersect(this.current.clipBox,this.current.minMax);e?this.current.fillColor.updatePatternDims(e,a):this.current.tilingPatternDims=null}this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=n&&this.#g(this.current.strokeAlpha),i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible){if(typeof a==`object`&&a?.getPattern){let n=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,qe(i),K.STROKE,e),n){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0)}this.dependencyTracker?.recordDependencies(e,Wt.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(K.STROKE,U(this.ctx))),i.globalAlpha=this.current.fillAlpha,this.#_(r)}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=n&&this.#g(this.current.fillAlpha),i=this.ctx,a=this.current.fillColor,o=this.current.patternFill,s=!1,c=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(e,Wt.fill),o){let o=this.current.tilingPatternDims,l=o&&a.canSkipPatternCanvas(o);if(l){a.drawPattern(this,t,this.pendingEOFill,l,e),this.pendingEOFill=!1,n&&this.consumePath(e,t,c),this.current.tilingPatternDims=null,this.#_(r);return}let u=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=a.getPattern(i,this,qe(i),K.FILL,e),u){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(u)),t=e}s=!0}this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(t,`evenodd`),this.pendingEOFill=!1):i.fill(t)),s&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,c),this.#_(r)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){let n=this.#g(Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t),this.#_(n)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){let n=this.#g(this.current.fillAlpha);this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,Wt.rawFillPath).recordOperation(e),this.#_(n)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=ur}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=dr}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData(`sameLineText`).resetIncrementalData(`moveText`,e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:n}=this;t!==void 0&&n.recordFutureForcedDependency(`textClip`,n.getOpenMarker()).recordFutureForcedDependency(`textClip`,e),n.recordCloseMarker(e)}if(t!==void 0){let e=new Path2D,r=n.getTransform().invertSelf();for(let{transform:n,x:i,y:a,fontSize:o,path:s}of t)s&&e.addPath(s,new DOMMatrix(n).preMultiplySelf(r).translate(i,a).scale(o,-o));n.clip(e)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData(`charSpacing`,e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData(`wordSpacing`,e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData(`hScale`,e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData(`leading`,e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData(`font`,e).recordSimpleDataFromNamed(`fontObj`,t,e);let r=this.commonObjs.get(t),i=this.current;if(!r)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||y,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&N(`Invalid font matrix for font `+t),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;let a=r.loadedName||`sans-serif`,o=r.systemFontInfo?.css||`"${a}", ${r.fallbackName}`,s=`normal`;r.black?s=`900`:r.bold&&(s=`bold`);let c=r.italic?`italic`:`normal`,l=V(n,qn,Jn);this.current.fontSizeScale=n/l,this.ctx.font=`${c} ${s} ${l}px ${o}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData(`textRenderingMode`,e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData(`textRise`,e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordIncrementalData(`moveText`,e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordSimpleData(`textMatrix`,e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData(`moveText`,this.dependencyTracker.getSimpleIndex(`leading`)??e)}#v(e,t,n){let r=new Path2D;return r.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),r}paintChar(e,t,n,r,i,a){let o=this.ctx,s=this.current,c=s.font,l=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=l&O.FILL_STROKE_MASK,f=!!(l&O.ADD_TO_PATH_FLAG),p=s.patternFill&&!c.missingFile,m=s.patternStroke&&!c.missingFile,h;if((c.disableFontFace||f||p||m)&&!c.missingFile&&(h=c.getPathGenerator(this.commonObjs,t)),h&&(c.disableFontFace||p||m)){o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c);let t;if(d===O.FILL||d===O.FILL_STROKE){if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#v(h,t,i);o.fill(e)}else o.fill(h)}if(d===O.STROKE||d===O.FILL_STROKE){if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=B.inverseTransform(a),c=B.transform([e,n,r,i,0,0],s);B.singularValueDecompose2dScale(c,Qn),o.lineWidth*=Math.max(Qn[0],Qn[1])/u,o.stroke(this.#v(h,t,a))}else o.lineWidth/=u,o.stroke(h)}o.restore()}else(d===O.FILL||d===O.FILL_STROKE)&&(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),(d===O.STROKE||d===O.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,Wt.stroke),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:U(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let e=this.canvasFactory.create(10,10),t=e.context;t.scale(1.5,1),t.fillText(`I`,0,10);let n=t.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let r=!1;for(let e=3;e<n.length;e+=4)if(n[e]>0&&n[e]<255){r=!0;break}return L(this,`isFontSubpixelAAEnabled`,r)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Wt.showText).resetBBox(e),this.current.textRenderingMode&O.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font){let r=this.#g(n.fillAlpha);this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e),this.#_(r);return}let i=n.fontSize;if(i===0){this.dependencyTracker?.recordOperation(e);return}let a=this.#g(n.fillAlpha),o=this.ctx,s=n.fontSizeScale,c=n.charSpacing,l=n.wordSpacing,u=n.fontDirection,d=n.textHScale*u,f=t.length,p=r.vertical,m=p?1:-1,h=i*n.fontMatrix[0],g=n.textRenderingMode===O.FILL&&!r.disableFontFace&&!n.patternFill;o.save(),n.textMatrix&&o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),u>0?o.scale(d,-1):o.scale(d,1);let _,v,y=n.textRenderingMode&O.FILL_STROKE_MASK,b=y===O.FILL||y===O.FILL_STROKE,x=y===O.STROKE||y===O.FILL_STROKE,S=n.lineWidth,C=n.textMatrixScale;if(C===0||S===0?x&&(S=this.getSinglePixelWidth()):S/=C,s!==1&&(o.scale(s,s),S/=s),o.lineWidth=S,b&&n.patternFill){o.save();let t=n.fillColor.getPattern(o,this,qe(o),K.FILL,e);_=U(o),o.restore(),o.fillStyle=t}if(x&&n.patternStroke){o.save();let t=n.strokeColor.getPattern(o,this,qe(o),K.STROKE,e);v=U(o),o.restore(),o.strokeStyle=t}if(r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let s=r.join(``);if(o.fillText(s,0,0),this.dependencyTracker!==null){let t=o.measureText(s);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=i*h*d,o.restore(),this.compose(),this.#_(a);return}let w=0,T=0;for(;T<f;++T){let n=t[T];if(typeof n==`number`){w+=m*n*i/1e3;continue}let a=!1,d=(n.isSpace?l:0)+c,f=n.fontChar,y=n.accent,b,x,S=n.width;if(p){let e=n.vmetric,t=-e[1]*h,r=e[2]*h;S=-e[0],b=t/s,x=(w+r)/s}else b=w/s,x=0;let C;if(r.remeasure&&S>0){C=o.measureText(f);let e=C.width*1e3/i*s;if(S<e&&this.isFontSubpixelAAEnabled){let t=S/e;a=!0,o.save(),o.scale(t,1),b/=t}else S!==e&&(b+=(S-e)/2e3*i/s)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(g&&!y)o.fillText(f,b,x),this.dependencyTracker?.recordCharacterBBox(e,o,C?{bbox:null}:r,i/s,b,x,()=>C??o.measureText(f));else if(this.paintChar(e,f,b,x,_,v),y){let t=b+i*y.offset.x/s,n=x-i*y.offset.y/s;this.paintChar(e,y.fontChar,t,n,_,v)}}let E=p?S*h-d*u:S*h+d*u;w+=E,a&&o.restore()}p?n.y-=w:n.x+=w*d,o.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e),this.#_(a)}showType3Text(e,t){let n=this.ctx,r=this.current,i=r.font,a=r.fontSize,o=r.fontDirection,s=i.vertical?1:-1,c=r.charSpacing,l=r.wordSpacing,u=r.textHScale*o,d=r.fontMatrix||y,f=t.length,p=r.textRenderingMode===O.INVISIBLE,m,h,g,_;if(p||a===0)return;this._cachedScaleForStroking[0]=-1,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let v=this.dependencyTracker;for(this.dependencyTracker=v?new Ut(v,e):null,m=0;m<f;++m){if(h=t[m],typeof h==`number`){_=s*h*a/1e3,this.ctx.translate(_,0),r.x+=_*u;continue}let e=(h.isSpace?l:0)+c,o=i.charProcOperatorList.get(h.operatorListId);o?this.contentVisible&&(this.save(),o.fnArray[0]===A.setCharWidth&&(r.fillAlpha=r.strokeAlpha=1,n.globalAlpha=1),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):N(`Type3 character "${h.operatorListId}" is not available.`);let f=[h.width,0];B.applyTransform(f,d),g=f[0]*a+e,n.translate(g,0),r.x+=g*u}n.restore(),v&&(this.dependencyTracker=v)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,r,i,a,o){let s=new Path2D;s.rect(r,i,a-r,o-i),this.ctx.clip(s),this.dependencyTracker?.recordBBox(e,this.ctx,r,a,i,o).recordClipBox(e,this.ctx,r,a,i,o),this.endPath(e)}getColorN_Pattern(t,n){let r;if(n[0]===`TilingPattern`){let t=this.baseTransform||U(this.ctx);r=new Kn(n,this.ctx,{createCanvasGraphics:(t,n)=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new Ut(this.dependencyTracker,n,!0):null)},t)}else r=this._getPattern(t,n[1],n[2]);return r}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData(`fillColor`,e);let n=this.current.fillColor=this.getColorN_Pattern(e,t);this.current.patternFill=!0,this.current.tilingPatternDims=n instanceof Kn?[0,0,0,0]:null}#y(e){return this.current.transferMapsFallback?.applyToColor(e)??e}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=t,this.ctx.strokeStyle=this.#y(t),this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=`transparent`,this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.current.fillColor=t,this.ctx.fillStyle=this.#y(t),this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,t,n=null){let r=this.cachedPatterns.getOrInsertComputed(t,()=>Wn(this.getObject(e,t)));return n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx;this.save(e),r.fillStyle=this._getPattern(e,t).getPattern(r,this,qe(r),K.SHADING,e);let i=qe(r);if(i){let{width:e,height:t}=r.canvas,n=v.slice();B.axialAlignedBoundingBox([0,0,e,t],i,n);let[a,o,s,c]=n;this.ctx.fillRect(a,o,s-a,c-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Wt.transform).recordDependencies(e,Wt.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e),this.#_(n)}beginInlineImage(){P(`Should not call beginInlineImage`)}beginImageData(){P(`Should not call beginImageData`)}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=U(this.ctx),n)){B.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[t,r,i,a]=n,o=new Path2D;o.rect(t,r,i-t,a-r),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,t,i,r,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e);let{inSMaskMode:n}=this;n&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;if((!t.needsIsolation||!t.isolated&&!t.hasSoftMask)&&!t.knockout&&!t.isGray&&this.#t===0&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&!n){if(t.bbox){let e=new Path2D,[n,i,a,o]=t.bbox;if(e.rect(n,i,a-n,o-i),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}r.clip(e)}this.groupStack.push(null),this.#u.push(null),this.groupLevel++;return}!t.isolated&&!t.knockout&&this.#t===0&&oe(`TODO: Fully support non-isolated non-knockout groups.`);let i=U(r);t.matrix&&r.transform(...t.matrix);let a=[0,0,r.canvas.width,r.canvas.height],o;t.bbox?(o=v.slice(),B.axialAlignedBoundingBox(t.bbox,U(r),o),o=B.intersect(o,a)||[0,0,0,0]):o=a;let s=Math.floor(o[0]),c=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),u=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,l,u]);let d=this.canvasFactory.create(l,u);t.smask&&this.smaskGroupCanvases.push(d);let f=d.context,p=t.knockout&&!t.isolated?r:null,m=!t.isolated&&!t.knockout&&!t.smask&&t.needsIsolation&&this.#t>0,h=t.knockout?this.canvasFactory.create(l,u):null,g=this.#t;t.knockout?this.#t++:this.#t=0,f.translate(-s,-c),f.transform(...i);let _=!t.isolated&&!t.smask&&t.needsIsolation,y=_&&!n&&g===0&&!t.knockout&&!t.isGray&&t.hasSoftMask&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&this.current.transferMaps===`none`&&!this.current.transferMapsFallback;if(_&&(n||y)&&(f.save(),f.setTransform(1,0,0,1,0,0),f.drawImage(r.canvas,-s,-c),f.restore()),t.bbox){let e=new Path2D,[n,r,i,a]=t.bbox;if(e.rect(n,r,i-n,a-r),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}f.clip(e)}t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:s,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null}),(!t.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(s,c),r.save()),ir(r,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(r),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1],[`TR`,null]]),this.groupStack.push(r),this.#u.push({backdropCtx:p,savedKnockoutLevel:g,offsetX:s,offsetY:c,hasInnerBackdrop:m,replaceBackdrop:y,knockoutMaskEntry:h,knockoutTempEntry:null,knockoutBackdropEntry:null}),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,r=this.groupStack.pop(),i=this.#u.pop();if(i&&(this.#t=i.savedKnockoutLevel),r===null)this.restore(e);else if(t.isGray&&this.#b(n),this.ctx=r,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())),this.#x(i);else{this.ctx.restore();let t=U(this.ctx);this.restore(e),this.current.transferMapsFallback?.applyToCanvas(n),this.ctx.save(),this.ctx.setTransform(...t);let a=v.slice();B.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,a);let o=this.#u.at(-1);if(this.#t>0){if(i.hasInnerBackdrop){let{width:e,height:a}=n.canvas,o=this.canvasFactory.create(e,a),s=o.context;s.drawImage(r.canvas,i.offsetX,i.offsetY,e,a,0,0,e,a),s.globalCompositeOperation=`source-over`,s.drawImage(n.canvas,0,0);let c=this.#p(n.canvas);s.globalCompositeOperation=`destination-in`,s.drawImage(c.canvas,0,0);let l=this.ctx.globalCompositeOperation,u=this.ctx.globalAlpha,d=this.ctx.filter;this.ctx.save(),this.ctx.setTransform(...t),this.ctx.globalAlpha=1,z.isCanvasFilterSupported&&(this.ctx.filter=`none`),this.ctx.globalCompositeOperation=`destination-out`,this.ctx.drawImage(c.canvas,0,0),this.ctx.globalCompositeOperation=l,this.ctx.globalAlpha=u,z.isCanvasFilterSupported&&(this.ctx.filter=d??`none`),this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(c),this.canvasFactory.destroy(o)}else{let e=o?.backdropCtx??null;this.#h(this.ctx,n.canvas,{backdropCanvas:e?.canvas??null,destTransform:t,backdropOffset:e?[o.offsetX+i.offsetX,o.offsetY+i.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}}else{if(i.replaceBackdrop){let e=new Path2D;e.rect(0,0,n.canvas.width,n.canvas.height),this.ctx.clip(e),this.ctx.globalCompositeOperation=`copy`}this.ctx.drawImage(n.canvas,0,0)}this.ctx.restore(),this.canvasFactory.destroy({canvas:n.canvas,context:n}),this.#x(i),this.compose(a)}}#b(e){let{canvas:t}=e,{width:n,height:r}=t;if(z.isCanvasFilterSupported){e.save(),e.setTransform(1,0,0,1,0,0),e.filter=`grayscale(1)`,e.globalAlpha=1,e.globalCompositeOperation=`copy`,e.drawImage(t,0,0),e.restore();return}let i=e.getImageData(0,0,n,r),{data:a}=i;for(let e=0,t=a.length;e<t;e+=4){let t=a[e]*.2126+a[e+1]*.7152+a[e+2]*.0722+.5|0;a[e]=a[e+1]=a[e+2]=t}e.putImageData(i,0,0)}#x(e){e&&(e.knockoutMaskEntry&&=(this.canvasFactory.destroy(e.knockoutMaskEntry),null),e.knockoutTempEntry&&=(this.canvasFactory.destroy(e.knockoutTempEntry),null),e.knockoutBackdropEntry&&=(this.canvasFactory.destroy(e.knockoutBackdropEntry),null))}beginAnnotation(e,t,n,r,i,a,o){if(this.#d(),ar(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],s=n[3]-n[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],B.singularValueDecompose2dScale(U(this.ctx),Qn);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),c=Math.ceil(s*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,c);let{canvas:l,context:u}=this.annotationCanvas;if(o){let e=this.annotationCanvasMap.getOrInsertComputed(t,we);l.setAttribute(`data-canvas-name`,o);let n=e.findIndex(e=>e.getAttribute(`data-canvas-name`)===o);n===-1?e.push(l):e[n]=l}else this.annotationCanvasMap.set(t,l);this.annotationCanvas.savedCtx=this.ctx,this.ctx=u,this.ctx.save(),this.ctx.setTransform(Qn[0],0,0,-Qn[1],0,s*Qn[1]),ar(this.ctx)}else{ar(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,s),this.ctx.clip(t)}}this.current=new tr(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...r),this.transform(e,...i),this.baseTransform=U(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#f(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let r=this.#g(this.current.fillAlpha),i=this.ctx,a=this._createMaskCanvas(e,t),o=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+o.width,a.offsetY,a.offsetY+o.height).recordOperation(e),i.restore(),a.canvasEntry&&this.canvasFactory.destroy(a.canvasEntry),this.compose(),this.#_(r)}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.#g(this.current.fillAlpha),c=this.ctx;c.save();let l=U(c);c.transform(n,r,i,a,0,0);let u=this._createMaskCanvas(e,t);c.setTransform(1,0,0,1,u.offsetX-l[4],u.offsetY-l[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,s=o.length;t<s;t+=2){let s=B.transform(l,[n,r,i,a,o[t],o[t+1]]);c.drawImage(u.canvas,s[4],s[5]),this.dependencyTracker?.recordBBox(e,this.ctx,s[4],s[4]+u.canvas.width,s[5],s[5]+u.canvas.height)}c.restore(),u.canvasEntry&&this.canvasFactory.destroy(u.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(s)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx,i=this.current.patternFill,a=i?this.current.fillColor:r.fillStyle;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Wt.transformAndFill);for(let n of t){let{data:t,width:o,height:s,transform:c}=n,l=this.canvasFactory.create(o,s),u=l.context;u.save(),rr(u,this.getObject(e,t,n)),u.globalCompositeOperation=`source-in`,u.fillStyle=i?a.getPattern(u,this,qe(r),K.FILL,e):a,u.fillRect(0,0,o,s),u.restore(),r.save(),r.transform(...c),r.scale(1,-1),er(r,l.canvas,0,0,o,s,0,-1,1,1),this.canvasFactory.destroy(l),this.dependencyTracker?.recordBBox(e,r,0,o,0,s),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(n)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);n?this.paintInlineImageXObject(e,n):N(`Dependent image isn't ready yet`)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a){N(`Dependent image isn't ready yet`);return}let o=a.width,s=a.height,c=[];for(let e=0,t=i.length;e<t;e+=2)c.push({transform:[n,0,0,r,i[e],i[e+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps===`none`?this.current.transferMapsFallback?.applyToCanvas(e):(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){let{transferMaps:t,transferMapsFallback:n}=this.current;if(t===`none`&&!n)return{img:e.bitmap,canvasEntry:null};let{bitmap:r,width:i,height:a}=e,o=this.canvasFactory.create(i,a),s=o.context;return s.filter=t,s.drawImage(r,0,0),s.filter=`none`,n?.applyToCanvas(s),{img:o.canvas,canvasEntry:o}}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.#g(this.current.fillAlpha),a=this.ctx;this.save(e);let{filter:o}=a;o!==`none`&&o!==``&&(a.filter=`none`),a.scale(1/n,-1/r);let s,c=null;if(t.bitmap){let e=this.applyTransferMapsToBitmap(t);s=e.img,c=e.canvasEntry}else{let e=this.canvasFactory.create(n,r);nr(e.context,t),s=this.applyTransferMapsToCanvas(e.context),c=e}let l=this._scaleImage(s,qe(a));a.imageSmoothingEnabled=sr(U(a),t.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,a,0,n,-r,0).recordDependencies(e,Wt.imageXObject).recordOperation(e),this.imagesTracker?.record(a,n,r,this.dependencyTracker.clipBox)),er(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-r,n,r),l.tmpCanvas&&this.canvasFactory.destroy(l.tmpCanvas),c&&this.canvasFactory.destroy(c),this.compose(),this.restore(e),this.#_(i)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.#g(this.current.fillAlpha),i=this.ctx,a,o=null;if(t.bitmap&&!this.current.transferMapsFallback)a=t.bitmap;else if(t.bitmap)({img:a,canvasEntry:o}=this.applyTransferMapsToBitmap(t));else{let e=t.width,n=t.height,r=this.canvasFactory.create(e,n);nr(r.context,t),a=this.applyTransferMapsToCanvas(r.context),o=r}this.dependencyTracker?.resetBBox(e);for(let t of n)i.save(),i.transform(...t.transform),i.scale(1,-1),er(i,a,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();o&&this.canvasFactory.destroy(o),this.dependencyTracker?.recordOperation(e),this.compose(),this.#_(r)}paintSolidColorImageMask(e){if(!this.contentVisible)return;let t=this.#g(this.current.fillAlpha);this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Wt.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose(),this.#_(t)}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t===`OC`?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let i=this.ctx;this.pendingClip?(r||(this.pendingClip===dr?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){let e=U(this.ctx);if(e[1]===0&&e[2]===0)return 1/Math.min(Math.abs(e[0]),Math.abs(e[3]));let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);return Math.max(n,r)/t}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:r,d:i}=this.ctx.getTransform(),a,o;if(n===0&&r===0){let n=Math.abs(t),r=Math.abs(i);if(n===r){if(e===0)a=o=1/n;else{let t=n*e;a=o=t<1?1/t:1}}else if(e===0)a=1/n,o=1/r;else{let t=n*e,i=r*e;a=t<1?1/t:1,o=i<1?1/i:1}}else{let s=Math.abs(t*i-n*r),c=Math.hypot(t,n),l=Math.hypot(r,i);if(e===0)a=l/s,o=c/s;else{let t=e*s;a=l>t?l/t:1,o=c>t?c/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,n){let{ctx:r,current:{lineWidth:i}}=this,[a,o]=this.getScaleForStroking();if(a===o){r.lineWidth=(i||1)*a,r.stroke(t);return}let s=e.#e??=new DOMMatrix,c=r.getLineDash();n&&r.save(),r.scale(a,o),s.a=1/a,s.d=1/o;let l=new Path2D;if(l.addPath(t,s),c.length>0){let e=Math.max(a,o);r.setLineDash(c.map(t=>t/e)),r.lineDashOffset/=e}r.lineWidth=i||1,r.stroke(l),n&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let e in A)fr.prototype[e]!==void 0&&(fr.prototype[A[e]]=fr.prototype[e]);var pr=class{#e=null;#t=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(e,t,n){this._source=e,this.#e=t,this.#t=n}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return F(!this._fullReader,`BasePDFStream.getFullReader can only be called once.`),this._fullReader=new this.#e(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new this.#t(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}},mr=class{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(e){this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){P("Abstract method `read` called")}cancel(e){P("Abstract method `cancel` called")}},hr=class{_stream=null;constructor(e,t,n){this._stream=e}async read(){P("Abstract method `read` called")}cancel(e){P("Abstract method `cancel` called")}};function gr(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=c(e),e=l(e),a(e)}if(n=o(e),n)return a(l(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=s(n);return e=l(e),a(e)}function r(e,t){return RegExp(`(?:^|;)\\s*`+e+`\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)`,t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let r=new TextDecoder(e,{fatal:!0}),i=_e(n);n=r.decode(i),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i(`utf-8`,e),t&&(e=i(`iso-8859-1`,e))),e}function o(e){let t=[],n,i=r(`filename\\*((?!0\\d)\\d+)(\\*?)`,`ig`);for(;(n=i.exec(e))!==null;){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(e===0)break}else t[e]=[r,i]}let a=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=s(r),n&&(r=unescape(r),e===0&&(r=c(r))),a.push(r)}return a.join(``)}function s(e){if(e.startsWith(`"`)){let t=e.slice(1).split(`\\"`);for(let e=0;e<t.length;++e){let n=t[e].indexOf(`"`);n!==-1&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,`$1`)}e=t.join(`"`)}return e}function c(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function l(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi,function(e,t,n,r){if(n===`q`||n===`Q`)return r=r.replaceAll(`_`,` `).replaceAll(/=([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),i(t,r);try{r=atob(r)}catch{}return i(t,r)})}return``}function _r(e,t){let n=new Headers;if(!e||!t||typeof t!=`object`)return n;for(let e in t){let r=t[e];r!==void 0&&n.append(e,r)}return n}function vr(e){let t=e.length;for(;t>0&&e[t-1]!==` `&&/\s/.test(e[t-1]);)t--;return e.slice(0,t)}function yr(e){return URL.parse(e)?.origin??null}function br({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={contentLength:0,isRangeSupported:!1},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.contentLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)===`identity`&&(i.isRangeSupported=!0),i}function xr(e){let t=e.get(`Content-Disposition`);if(t){let e=gr(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(Le(e))return e}return null}function Sr(e,t){return new pe(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`,e,e===404||e===0&&t.protocol===`file:`)}function Cr(e,t){if(e!==t)throw Error(`Expected range response-origin "${e}" to match "${t}".`)}function wr(e,t,n,r){return fetch(e,{method:`GET`,headers:t,signal:r.signal,mode:`cors`,credentials:n?`include`:`same-origin`,redirect:`follow`})}function Tr(e,t){if(e!==200&&e!==206)throw Sr(e,t)}function Er(e){if(e instanceof Uint8Array)return e.buffer;if(e instanceof ArrayBuffer)return e;throw Error(`getArrayBuffer - unexpected data: ${e}`)}var Dr=class extends pr{_responseOrigin=null;constructor(e){super(e,Or,kr);let{httpHeaders:t,url:n}=e;F(/https?:/.test(n.protocol),`PDFFetchStream only supports http(s):// URLs.`),this.headers=_r(!0,t)}},Or=class extends mr{_abortController=new AbortController;_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i,withCredentials:a}=e._source;this._isStreamingSupported=!n,wr(i,new Headers(e.headers),a,this._abortController).then(n=>{e._responseOrigin=yr(n.url),Tr(n.status,i),this._reader=n.body.getReader();let a=n.headers,{contentLength:o,isRangeSupported:s}=br({responseHeaders:a,isHttp:!0,rangeChunkSize:r,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=xr(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new he(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:Er(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},kr=class extends hr{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r,withCredentials:i}=e._source,a=new Headers(e.headers);a.append(`Range`,`bytes=${t}-${n-1}`),wr(r,a,i,this._abortController).then(t=>{Cr(yr(t.url),e._responseOrigin),Tr(t.status,r),this._reader=t.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:Er(e),done:!1}}cancel(e){this._reader?.cancel(e),this._abortController.abort()}};function Ar(e){return e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function jr(){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}var Mr=class extends pr{_progressiveDone=!1;_queuedChunks=[];constructor(e){super(e,Nr,Pr);let{pdfDataRangeTransport:t}=e,{initialData:n,progressiveDone:r}=t;if(n?.length>0){let e=Ar(n);this._queuedChunks.push(e)}this._progressiveDone=r,t.transportReady(e=>{switch(e.type){case`range`:case`progressiveRead`:this.#e(e.begin,e.chunk);break;case`progressiveDone`:this._fullReader?.progressiveDone(),this._progressiveDone=!0}})}#e(e,t){let n=Ar(t);if(e===void 0)this._fullReader?this._fullReader._enqueue(n):this._queuedChunks.push(n);else{let t=this._rangeReaders.keys().find(t=>t._begin===e);F(t,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),t._enqueue(n)}}getFullReader(){let e=super.getFullReader();return this._queuedChunks=null,e}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onDone=()=>this._rangeReaders.delete(n),this._source.pdfDataRangeTransport.requestDataRange(e,t)),n}cancelAllRequests(e){super.cancelAllRequests(e),this._source.pdfDataRangeTransport.abort()}},Nr=class extends mr{#e=jr.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(e){super(e);let{pdfDataRangeTransport:t,disableRange:n,disableStream:r}=e._source,{length:i,contentDispositionFilename:a}=t;this._queuedChunks=e._queuedChunks||[];for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._done=e._progressiveDone,this._contentLength=i,this._isStreamingSupported=!r,this._isRangeSupported=!n,Le(a)&&(this._filename=a),this._headersCapability.resolve();let o=this._loaded;Promise.resolve().then(()=>{o>0&&this._loaded===o&&this._callOnProgress()})}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e()}progressiveDone(){this._done||=!0,this._queuedChunks.length===0&&this.#e()}},Pr=class extends hr{#e=jr.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(e,t,n){super(e,t,n),this._begin=t}_enqueue(e){this._done||(this._requests.length===0?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this.#e()),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this.onDone?.()}},Fr=200,Ir=206;function Lr(e){return typeof e==`string`?_e(e).buffer:e}var Rr=class extends pr{#e=new WeakMap;_responseOrigin=null;constructor(e){super(e,zr,Br);let{httpHeaders:t,url:n}=e;this.url=n,this.isHttp=/https?:/.test(n.protocol),this.headers=_r(this.isHttp,t)}_request(e){let t=new XMLHttpRequest,n={validateStatus:null,onHeadersReceived:e.onHeadersReceived,onDone:e.onDone,onError:e.onError,onProgress:e.onProgress};this.#e.set(t,n),t.open(`GET`,this.url),t.withCredentials=this._source.withCredentials;for(let[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&`begin`in e&&`end`in e?(t.setRequestHeader(`Range`,`bytes=${e.begin}-${e.end-1}`),n.validateStatus=e=>e===Ir||e===Fr):n.validateStatus=e=>e===Fr,t.responseType=`arraybuffer`,F(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>e.onError(t.status),t.onreadystatechange=this.#n.bind(this,t),t.onprogress=this.#t.bind(this,t),t.send(null),t}#t(e,t){this.#e.get(e)?.onProgress?.(t)}#n(e,t){let n=this.#e.get(e);if(!n||(e.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),e.readyState!==4)||!this.#e.has(e))return;if(this.#e.delete(e),e.status===0&&this.isHttp){n.onError(e.status);return}let r=e.status||Fr;if(!n.validateStatus(r)){n.onError(e.status);return}let i=Lr(e.response);if(r===Ir){let t=e.getResponseHeader(`Content-Range`);/bytes \d+-\d+\/\d+/.test(t)?n.onDone(i):(N(`Missing or invalid "Content-Range" header.`),n.onError(0))}else i?n.onDone(i):n.onError(e.status)}_abortRequest(e){this.#e.has(e)&&(this.#e.delete(e),e.abort())}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onClosed=()=>this._rangeReaders.delete(n)),n}},zr=class extends mr{#e=jr.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(e){super(e),this._fullRequestXhr=e._request({onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:this.#i.bind(this)})}#t(){let e=this._stream,{disableRange:t,rangeChunkSize:n}=e._source,r=this._fullRequestXhr;e._responseOrigin=yr(r.responseURL);let i=r.getAllResponseHeaders(),a=new Headers(i?vr(i.trimStart()).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{contentLength:o,isRangeSupported:s}=br({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:n,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=xr(a),this._isRangeSupported&&e._abortRequest(r),this._headersCapability.resolve()}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._cachedChunks.push(e),this._done=!0,this._cachedChunks.length===0&&this.#e()}#r(e){this._storedError=Sr(e,this._stream.url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}#i(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e),this.#e(),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}},Br=class extends hr{#e=jr.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(e,t,n){super(e,t,n),this._requestXhr=e._request({begin:t,end:n,onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:null})}#t(){let e=yr(this._requestXhr?.responseURL);try{Cr(e,this._stream._responseOrigin)}catch(e){this._storedError=e,this.#r(0)}}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this.#e(),this.onClosed?.()}#r(e){this._storedError??=Sr(e,this._stream.url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}};function Vr(e,t=null){let n=process.getBuiltinModule(`fs`),{Readable:r}=process.getBuiltinModule(`stream`),i=n.createReadStream(e,t);return r.toWeb(i)}var Hr=class extends pr{constructor(e){super(e,Ur,Wr);let{url:t}=e;F(t.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`)}},Ur=class extends mr{_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i}=e._source;this._isStreamingSupported=!n,process.getBuiltinModule(`fs/promises`).lstat(i).then(e=>{let n=Vr(i);this._reader=n.getReader();let{size:a}=e;this._contentLength=a,this._isRangeSupported=!t&&a>2*r,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new he(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(e=>{e.code===`ENOENT`&&(e=Sr(0,i)),this._headersCapability.reject(e)})}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:Er(e),done:!1})}cancel(e){this._reader?.cancel(e)}},Wr=class extends hr{_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r}=e._source;try{let e=Vr(r,{start:t,end:n-1});this._reader=e.getReader(),this._readCapability.resolve()}catch(e){this._readCapability.reject(e)}}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:Er(e),done:!1}}cancel(e){this._reader?.cancel(e)}};function Gr(e){return Ve(e)?Dr:g?Hr:Rr}var Kr=class{static#e=null;static#t=``;static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<`u`&&e instanceof Worker)&&e!==null)throw Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!=`string`)throw Error("Invalid `workerSrc` type.");this.#t=e}},qr=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}},Jr=Symbol(`INTERNAL`),Yr=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&x.DISPLAY),this.#t=!!(e&x.PRINT),this.name=t,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!==`OFF`:!this.#t||e?.printState!==`OFF`}_setVisible(e,t,n=!1){e!==Jr&&P("Internal method `_setVisible` called."),this.#n=n,this.#r=t}get serializable(){return{userSet:this.#n,visible:this.#r}}},Xr=class e{#e=null;#t=new Map;#n=null;#r=null;#i;creator=null;name=null;constructor(e,t=x.DISPLAY,n=null){if(this.#i=e,this.renderingIntent=t,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(let n of e.groups)this.#t.set(n.id,new Yr(t,n));if(n){n.size!==this.#t.size&&P(`Incorrect serialized groupState.`);for(let[e,t]of n)this.#t.get(e)._setVisible(Jr,t.visible,t.userSet)}else{if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(Jr,!1);for(let t of e.on)this.#t.get(t)._setVisible(Jr,!0);for(let t of e.off)this.#t.get(t)._setVisible(Jr,!1)}this.#n=this.getHash()}}#a(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let r=1;r<t;r++){let t=e[r],i;if(Array.isArray(t))i=this.#a(t);else if(this.#t.has(t))i=this.#t.get(t).visible;else return N(`Optional content group not found: ${t}`),!0;switch(n){case`And`:if(!i)return!1;break;case`Or`:if(i)return!0;break;case`Not`:return!i;default:return!0}}return n===`And`}isVisible(e){if(this.#t.size===0)return!0;if(!e)return oe(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(N(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#a(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return N(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOn`){for(let t of e.ids){if(!this.#t.has(t))return N(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}if(e.policy===`AnyOff`){for(let t of e.ids){if(!this.#t.has(t))return N(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOff`){for(let t of e.ids){if(!this.#t.has(t))return N(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return N(`Unknown optional content policy ${e.policy}.`),!0}return N(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(!r)N(`Optional content group not found: ${e}`);else{if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(Jr,!1,!0);r._setVisible(Jr,!!t,!0),this.#e=null}}setOCGState({state:e,preserveRB:t}){let n;for(let r of e){switch(r){case`ON`:case`OFF`:case`Toggle`:n=r;continue}let e=this.#t.get(r);if(e)switch(n){case`ON`:this.setVisibility(r,!0,t);break;case`OFF`:this.setVisibility(r,!1,t);break;case`Toggle`:this.setVisibility(r,!e.visible,t)}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new kt;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}get serializable(){let e=new Map;for(let[t,n]of this.#t)e.set(t,n.serializable);return{data:this.#i,renderingIntent:this.renderingIntent,groupState:e}}static fromSerializable({data:t,renderingIntent:n,groupState:r}){return new e(t,n,r)}},Zr=class{#e=null;#t=null;#n=0;#r=null;#i=null;get pagesNumber(){return this.#n}set pagesNumber(e){this.#n!==e&&(this.#n=e,this.#e=null,this.#t=null)}#a(){if(this.#e)return;let e=this.#n,t=this.#e=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=n+1;this.#t=new Int32Array(t)}#o(){let e=new Map,t=this.#e;for(let n=0,r=this.#n;n<r;n++){let r=t[n],i=e.get(r);i?i.push(n+1):e.set(r,[n+1])}return e}movePages(e,t,n){this.#a();let r=this.#e,i=t.length,a=new Uint32Array(i),o=0;for(let e=0;e<i;e++){let i=t[e]-1;a[e]=r[i],i<n&&o++}let s=this.#n,c=s-i,l=new Int32Array(s),u=V(n-o,0,c);for(let t=0,n=0;t<s;t++)e.has(t+1)||(r[n]=r[t],l[n++]=t+1);r.copyWithin(u+i,u,c),r.set(a,u),l.copyWithin(u+i,u,c),l.set(t,u),this.#t=l,r.every((e,t)=>e===t+1)&&(this.#e=null)}deletePages(e){this.#a();let t=this.#e,n=this.#o();this.#i={pageNumberToId:t.slice(),pagesNumber:this.#n,prevPageNumbers:this.#t.slice()};let r=this.#n-e.length;this.#n=r;let i=this.#e=new Uint32Array(r);this.#t=new Int32Array(r);let a=0,o=0;for(let n of e){let e=n-1;e!==a&&(i.set(t.subarray(a,e),o),o+=e-a),a=e+1}a<t.length&&i.set(t.subarray(a),o),this.#s(n,new Set(e))}cancelDelete(){this.#i&&=(this.#e=this.#i.pageNumberToId,this.#n=this.#i.pagesNumber,this.#t=this.#i.prevPageNumbers,null)}cleanSavedData(){this.#i=null}copyPages(e){this.#a(),this.#r={pageNumbers:e,pageIds:e.map(e=>this.#e[e-1])}}cancelCopy(){this.#r=null}pastePages(e){this.#a();let t=this.#e,n=this.#o(),{pageNumbers:r,pageIds:i}=this.#r,a=this.#n+r.length;this.#n=a;let o=this.#e=new Uint32Array(a);this.#t=new Int32Array(a),o.set(t.subarray(0,e),0),o.set(i,e),o.set(t.subarray(e),e+r.length),this.#s(n,null,e,r),this.#r=null}#s(e,t=null,n=-1,r=null){let i=this.#t,a=this.#e,o=n+(r?.length??0),s=new Map;for(let c=0,l=this.#n;c<l;c++){if(c>=n&&c<o){i[c]=-r[c-n];continue}let l=a[c],u=e.get(l),d=s.get(l)||0;if(t&&u)for(;d<u.length&&t.has(u[d]);)d++;i[c]=u?.[d],s.set(l,d+1)}}hasBeenAltered(){return this.#e!==null}#c(e=null){if(!this.#e)return null;let t=new Int32Array(this.#n).fill(-1),n=new Map;if(e)for(let r of e){let e=this.getPageId(r),i=n.get(e)??0;n.set(e,i+1),t[r-1]=i}else for(let e=0,r=this.#n;e<r;e++){let r=this.#e[e],i=n.get(r)??0;n.set(r,i+1),t[e]=i}return t}getPageMappingForSaving(e=null,t=this.#c()){e??=this.#o();let n=0;for(let t of e.values())n=Math.max(n,t.length);let r=Array(n);for(let e=0;e<n;e++)r[e]={document:null,pageIndices:[],includePages:[]};for(let[t,n]of e)for(let e=0,i=n.length;e<i;e++)r[e].includePages.push([t-1,n[e]-1]);for(let{includePages:e,pageIndices:t}of r){e.sort((e,t)=>e[0]-t[0]);for(let n=0,r=e.length;n<r;n++)t.push(e[n][1]),e[n]=e[n][0]}return{pageInfos:r,copyLevels:t}}extractPages(e){e=Array.from(e).sort((e,t)=>e-t);let t=new Map;for(let n=0,r=e.length;n<r;n++){let r=this.getPageId(e[n]);t.getOrInsertComputed(r,we).push(n+1)}return this.getPageMappingForSaving(t,this.#c(e))}getPrevPageNumber(e){return this.#t?.[e-1]??0}getPageNumber(e){if(!this.#e)return e;let t=this.#e;for(let n=0,r=this.#n;n<r;n++)if(t[n]===e)return n+1;return 0}getPageId(e){return this.#e?.[e-1]??e}getMapping(){return this.#e?.subarray(0,this.pagesNumber)}},Qr=Symbol(`INITIAL_DATA`),$r=()=>({...Promise.withResolvers(),data:Qr}),ei=class{#e=new Map;get(e,t=null){if(t){let n=this.#e.getOrInsertComputed(e,$r);return n.promise.then(()=>t(n.data)),null}let n=this.#e.get(e);if(!n||n.data===Qr)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e.get(e);return!!t&&t.data!==Qr}delete(e){let t=this.#e.get(e);return!t||t.data===Qr?!1:(this.#e.delete(e),!0)}resolve(e,t=null){let n=this.#e.getOrInsertComputed(e,$r);if(n.data!==Qr)throw Error(`Object already resolved ${e}.`);n.data=t,n.resolve()}clear(){for(let{data:e}of this.#e.values())e?.bitmap?.close();this.#e.clear()}*[Symbol.iterator](){for(let[e,{data:t}]of this.#e)t!==Qr&&(yield[e,t])}},ti=1e5,ni=30,ri=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=null;#s=0;#c=0;#l=Ye.pixelRatio;#u=null;#d=null;#f=0;#p=0;#m=Object.create(null);#h=[];#g=null;#_=[];#v=new WeakMap;#y=null;static#b=new Map;static#x=new Map;static#S=new WeakMap;static#C=null;static#w=new Set;constructor({textContentSource:t,images:n,container:r,viewport:i}){if(t instanceof ReadableStream)this.#g=t;else if(typeof t==`object`)this.#g=new ReadableStream({start(e){e.enqueue(t),e.close()}});else throw Error(`No "textContentSource" parameter specified.`);this.#t=this.#d=r,this.#i=n,this.#p=i.scale*this.#l,this.#f=i.rotation,this.#o={div:null,properties:null,ctx:null};let{pageWidth:a,pageHeight:o,pageX:s,pageY:c}=i.rawDims;this.#y=[1,0,0,-1,-s,c+o],this.#c=a,this.#s=o,e.#j(),r.style.setProperty(`--min-font-size`,e.#C),Je(r,i),this.#e.promise.finally(()=>{e.#w.delete(this),this.#o=null,this.#m=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=z.platform;return L(this,`fontFamilyMap`,new Map([[`sans-serif`,`${e&&t?`Calibri, `:``}sans-serif`],[`monospace`,`${e&&t?`Lucida Console, `:``}monospace`]]))}render(){this.#i&&this.#t.append(this.#i.render());let t=()=>{this.#u.read().then(({value:e,done:n})=>{n?this.#e.resolve():(this.#a??=e.lang,Object.assign(this.#m,e.styles),this.#T(e.items),t())},this.#e.reject)};return this.#u=this.#g.getReader(),e.#w.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*Ye.pixelRatio,i=t.rotation;if(i!==this.#f&&(n?.(),this.#f=i,Je(this.#d,{rotation:i})),r!==this.#p){n?.(),this.#p=r,this.#l=Ye.pixelRatio;let t={div:null,properties:null,ctx:e.#O(this.#a)};for(let e of this.#_)t.properties=this.#v.get(e),t.div=e,this.#D(t)}}cancel(){let e=new he(`TextLayer task cancelled.`);this.#u?.cancel(e).catch(()=>{}),this.#u=null,this.#e.reject(e)}get textDivs(){return this.#_}get textContentItemsStr(){return this.#h}#T(t){if(this.#n)return;this.#o.ctx??=e.#O(this.#a);let n=this.#_,r=this.#h;for(let e of t){if(n.length>ti){N(`Ignoring additional textDivs for performance reasons.`),this.#n=!0;return}if(e.str===void 0){if(e.type===`beginMarkedContentProps`||e.type===`beginMarkedContent`){let t=this.#t;this.#t=document.createElement(`span`),this.#t.classList.add(`markedContent`),e.id&&this.#t.setAttribute(`id`,e.id),e.tag===`Artifact`&&(this.#t.ariaHidden=!0),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode)}else r.push(e.str),this.#E(e)}}#E(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#_.push(n);let i=B.transform(this.#y,t.transform),a=Math.atan2(i[1],i[0]),o=this.#m[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=e.fontFamilyMap.get(s)||s;let c=Math.hypot(i[2],i[3]),l=c*e.#M(s,o,this.#a),u,d;a===0?(u=i[4],d=i[5]-l):(u=i[4]+l*Math.sin(a),d=i[5]-l*Math.cos(a));let f=n.style;f.left=`${(100*u/this.#c).toFixed(2)}%`,f.top=`${(100*d/this.#s).toFixed(2)}%`;let p=Math.round(c*100)/100;f.setProperty(`--font-height`,`${p}px`),f.fontFamily=s,r.fontSize=p,n.setAttribute(`role`,`presentation`),n.textContent=t.str,n.dir=t.dir,this.#r&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=180/Math.PI*a);let m=!1;if(t.str.length>1)m=!0;else if(t.str!==` `&&t.transform[0]!==t.transform[3]){let e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(m=!0)}if(m&&(r.canvasWidth=o.vertical?t.height:t.width),this.#v.set(n,r),this.#o.div=n,this.#o.properties=r,this.#D(this.#o),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#D(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n,{canvasWidth:o,fontSize:s}=r;if(o!==0&&s!==0&&r.hasText){let{fontFamily:t}=a,r=this.#l,c=e.#k(s*this.#p/r)*r;e.#A(i,c,t);let{width:l}=i.measureText(n.textContent);l>0&&a.setProperty(`--scale-x`,o*c/(l*s))}r.angle!==0&&a.setProperty(`--rotate`,`${r.angle}deg`)}static cleanup(){if(!(this.#w.size>0)){this.#b.clear();for(let{canvas:e}of this.#x.values())e.remove();this.#x.clear()}}static#O(e=null){let t=this.#x.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.style.cssText=`position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#x.set(e,t),this.#S.set(t,{size:0,family:``})}return t}static#k(e){e=Math.fround(e);let t=Math.fround(e*131073);return Math.fround(t-Math.fround(t-e))}static#A(e,t,n){let r=this.#S.get(e);(t!==r.size||n!==r.family)&&(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#j(){if(this.#C!==null)return;let e=document.createElement(`div`);e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize=`1px`,e.style.position=`absolute`,e.textContent=`X`,document.body.append(e),this.#C=e.getBoundingClientRect().height,e.remove()}static#M(e,t,n){let r=this.#b.get(e);if(r)return r;let i=this.#O(n);this.#A(i,ni,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent),c=.8;return o?c=o/(o+s):(z.platform.isFirefox&&N("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#b.set(e,c),c}},ii=100;function ai(e={}){let t=new oi,{docId:n}=t,r=e.url?ln(e.url):null,i=e.data?un(e.data):null,a=e.httpHeaders||null,o=e.withCredentials===!0,s=e.password??null,c=e.range instanceof si?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:2**16,u=e.worker instanceof ui?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl==`string`&&!Ie(e.docBaseUrl)?e.docBaseUrl:null,p=dn(e.cMapUrl),m=e.cMapPacked!==!1,h=dn(e.iccUrl),_=dn(e.standardFontDataUrl),v=dn(e.wasmUrl),y=e.stopAtErrors!==!0,b=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,x=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!g,S=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!g,C=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,w=typeof e.disableFontFace==`boolean`?e.disableFontFace:g,T=e.fontExtraProperties===!0,E=e.enableXfa===!0,D=e.ownerDocument||globalThis.document,O=e.disableRange===!0,ee=e.disableStream===!0,k=e.disableAutoFetch===!0,te=e.pdfBug===!0,ne=e.CanvasFactory||(g?On:Sn),A=e.FilterFactory||(g?Dn:wn),re=e.BinaryDataFactory||(g?kn:bn),j=e.enableHWA===!0,M=e.enableWebGPU===!0?Pn():Promise.resolve(!1),ae=e.useWasm!==!1,oe=e.pagesMapper||new Zr,N=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!g&&!w,P=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(re===bn&&p&&m&&_&&v&&Ve(p,document.baseURI)&&Ve(_,document.baseURI)&&Ve(v,document.baseURI));ie(d);let F={canvasFactory:new ne({ownerDocument:D,enableHWA:j}),filterFactory:new A({docId:n,ownerDocument:D}),binaryDataFactory:P?null:new re({cMapUrl:p,standardFontDataUrl:_,wasmUrl:v})};u||(u=ui.create({verbosity:d,port:Kr.workerPort}),t._worker=u);let se={docId:n,apiVersion:`6.4.299`,data:i,password:s,disableAutoFetch:k,rangeChunkSize:l,docBaseUrl:f,enableXfa:E,evaluatorOptions:{maxImageSize:b,disableFontFace:w,ignoreErrors:y,isOffscreenCanvasSupported:x,isImageDecoderSupported:S,canvasMaxAreaInBytes:C,fontExtraProperties:T,useSystemFonts:N,useWasm:ae,useWorkerFetch:P,cMapUrl:p,cMapPacked:m,iccUrl:h,standardFontDataUrl:_,wasmUrl:v,hasGPU:!1}},ce={ownerDocument:D,pdfBug:te,styleElement:null,enableHWA:j,loadingParams:{disableAutoFetch:k,enableXfa:E}};return Promise.all([u.promise,M]).then(function([,e]){if(u.destroyed)throw Error(`Worker was destroyed`);se.evaluatorOptions.hasGPU=e;let s=u.messageHandler.sendWithPromise(`GetDocRequest`,se,i?[i.buffer]:null),d;if(!i){if(c)d=new Mr({pdfDataRangeTransport:c,disableRange:O,disableStream:ee});else if(r)d=new(Gr(r))({url:r,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:O,disableStream:ee});else throw Error("getDocument - expected either `data`, `range`, or `url` parameter.")}return s.then(e=>{if(u.destroyed)throw Error(`Worker was destroyed`);let r=new vn(n,e,u.port),i=new di(r,t,d,ce,F,oe);if(t._transport=i,t.destroyed)throw Error(`Loading aborted`);r.send(`Ready`,null)})}).catch(t._capability.reject).finally(t._setupCapability.resolve),t}var oi=class e{static#e=0;_capability=Promise.withResolvers();_setupCapability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${e.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._setupCapability.promise,await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},si=class{#e=Promise.withResolvers();#t=null;constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r}onDataRange(e,t){this.#t({type:`range`,begin:e,chunk:t})}onDataProgressiveRead(e){this.#e.promise.then(()=>{this.#t({type:`progressiveRead`,chunk:e})})}onDataProgressiveDone(){this.#e.promise.then(()=>{this.#t({type:`progressiveDone`})})}transportReady(e){this.#t=e,this.#e.resolve()}requestDataRange(e,t){P(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},ci=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return L(this,`isPureXfa`,!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAttachmentContent(e){return this._transport.getAttachmentContent(e)}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(e){return this._transport.saveDocument(e)}extractPages(e,t=null){return this._transport.extractPages(e,t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}getSignatures(){return this._transport.getSignatures()}getSignatureData(e){return this._transport.getSignatureData(e)}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},li=class e{#e=!1;#t=null;static#n=0;constructor(t,n,r,i,a=!1){this._pageIndex=t,this._id=e.#n++,this._pageInfo=n,this._transport=r,this._stats=a?new Be:null,this._pdfBug=a,this.commonObjs=r.commonObjs,this.objs=new ei,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,this.#t=i,this.imageCoordinates=null}clone(t){let n=new e(t,this._pageInfo,this._transport,this.#t,this._pdfBug);return n.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(n),n}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1,this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new Oe({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return L(this,`isPureXfa`,!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:r=`display`,annotationMode:i=S.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordImages:f=!1,recordOperations:p=!1,operationsFilter:m=null}){this._stats?.time(`Overall`);let h=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:g,cacheKey:_}=h;this.#e=!1,s||=this._transport.getOptionalContentConfig(g);let v=this._intentStates.getOrInsertComputed(_,Ee);v.streamReaderCancelTimeout&&=(clearTimeout(v.streamReaderCancelTimeout),null);let y=!!(g&x.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(h));let b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),C=!!t&&!this.recordedBBoxes&&(p||b),w=!!t&&!this.imageCoordinates&&f,T=e=>{if(v.renderTasks.delete(O),C){let e=O.gfx?.dependencyTracker.take();e&&(O.stepper?.setOperatorBBoxes(e,O.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=e))}w&&!e&&(this.imageCoordinates=O.gfx?.imagesTracker.take()),y&&(this.#e=!0),this.#r(),e?(O.capability.reject(e),this._abortOperatorList({intentState:v,reason:e instanceof Error?e:Error(e)})):O.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},E=null,D=null;(C||w)&&(D=new Vt(t,v.operatorList.length)),C&&(E=new Ht(D,b));let O=new pi({callback:T,params:{canvas:t,canvasContext:e,dependencyTracker:E??D,imagesTracker:w?new Gt(t):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:m});(v.renderTasks||=new Set).add(O);let ee=O.task;return Promise.all([v.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed)T();else{if(this._stats?.time(`Rendering`),!(t.renderingIntent&g))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");O.initializeGraphics({transparency:e,optionalContentConfig:t}),O.operatorListChanged()}}).catch(T),ee}getOperatorList({intent:e=`display`,annotationMode:t=S.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(e,t,n,r,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,Ee),s;return o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size:e=>e.items.length})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>ke.textContent(e));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let e of t)n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items);return n}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:Error(`Page was destroyed.`),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;let t=this.#r();return e&&t&&(this._stats&&=new Be),t}#r(){if(!this.#e||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd(`Page Request`),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#r()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,pageProxyId:this._id,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},void 0,a).getReader(),s=this._intentStates.get(t);s.streamReader=o;let c=()=>{o.read().then(({value:e,done:t})=>{t?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,s),c())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(let e of s.renderTasks)e.operatorListChanged();this.#r()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else if(s.opListReadCapability)s.opListReadCapability.reject(e);else throw e}})};c()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&=(clearTimeout(e.streamReaderCancelTimeout),null),!n){if(e.renderTasks.size>0)return;if(t instanceof Fe){let n=ii;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new he(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}},ui=class e{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!1;static#o=new WeakMap;static{g&&(this.#a=!0,Kr.workerSrc||=`./pdf.worker.mjs`),this._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin===`null`)return!1;let r=new URL(t,n);return n.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:`text/javascript`}))}}constructor({name:t=null,port:n=null,verbosity:r=ae()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=r,n){if(e.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);e.#o.set(n,this),this.#c(n)}else this.#l()}get promise(){return this.#e.promise}#s(){this.#e.resolve(),this.#t.send(`configure`,{verbosity:this.verbosity})}get port(){return this.#n}get messageHandler(){return this.#t}#c(e){this.#n=e,this.#t=new vn(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(e.#a||e.#d){this.#u();return}let{workerSrc:t}=e;try{e._isSameOrigin(window.location,t)||(t=e._createCDNWrapper(new URL(t,window.location).href));let n=new Worker(t,{type:`module`}),r=new vn(`main`,`worker`,n),i=()=>{a.abort(),r.destroy(),n.terminate(),this.destroyed?this.#e.reject(Error(`Worker was destroyed`)):this.#u()},a=new AbortController;n.addEventListener(`error`,()=>{this.#r||i()},{signal:a.signal}),r.on(`ready`,e=>{a.abort(),this.destroyed||!(e instanceof Uint8Array)?i():(this.#t=r,this.#n=n,this.#r=n,this.#s())})}catch{oe(`The worker has been disabled.`),this.#u()}}#u(){e.#a||=(N(`Setting up fake worker.`),!0),e._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#e.reject(Error(`Worker was destroyed`));return}let n=new mn;this.#n=n;let r=`fake${e.#i++}`,i=new vn(r+`_worker`,r,n);t.setup(i,n),this.#t=new vn(r,r+`_worker`,n),this.#s()}).catch(e=>{this.#e.reject(Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#r?.terminate(),this.#r=null,e.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(t){let n=this.#o.get(t?.port);if(n){if(n._pendingDestroy)throw Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new e(t)}static get workerSrc(){if(Kr.workerSrc)return Kr.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return L(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await import(this.workerSrc)).WorkerMessageHandler)())}},di=class{downloadInfoCapability=Promise.withResolvers();#e=null;#t=new Map;#n=null;#r=new Map;#i=new Map;#a=new Map;#o=null;#s=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.#n=n,this.commonObjs=new ei,this.fontLoader=new Yt({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.enableHWA=r.enableHWA,this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.binaryDataFactory=i.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){this.#r.set(e._id,e),this.#i.set(e._pageIndex,Promise.resolve(e))}#c(e,t=null){return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))}#l({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:t?V(Math.round(e/t*100),0,100):NaN})}get annotationStorage(){return L(this,`annotationStorage`,new jt)}getRenderingIntent(e,t=S.ENABLE,n=null,r=!1,i=!1){let a=x.DISPLAY,o=At;switch(e){case`any`:a=x.ANY;break;case`display`:break;case`print`:a=x.PRINT;break;default:N(`getRenderingIntent - invalid intent: ${e}`)}let s=a&x.PRINT&&n instanceof Mt?n:this.annotationStorage;switch(t){case S.DISABLE:a+=x.ANNOTATIONS_DISABLE;break;case S.ENABLE:break;case S.ENABLE_FORMS:a+=x.ANNOTATIONS_FORMS;break;case S.ENABLE_STORAGE:a+=x.ANNOTATIONS_STORAGE,o=s.serializable;break;default:N(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=x.IS_EDITING),i&&(a+=x.OPLIST);let{ids:c,hash:l}=s.modifiedIds,u=[a,o.hash,l];return{renderingIntent:a,cacheKey:u.join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.#a.clear(),Object.hasOwn(this,`annotationStorage`)&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise(`Terminate`,null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),ri.cleanup(),this.#n?.cancelAllRequests(new he(`Worker was terminated.`)),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on(`GetReader`,(e,t)=>{F(this.#n,"GetReader - no `BasePDFStream` instance available."),this.#e=this.#n.getFullReader(),this.#e.onProgress=e=>this.#l(e),t.onPull=()=>{this.#e.read().then(function({value:e,done:n}){n?t.close():(F(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this.#e.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this.#e.headersReady;let{isStreamingSupported:t,isRangeSupported:n,contentLength:r}=this.#e;return t&&n&&(this.#e.onProgress=null),{isStreamingSupported:t,isRangeSupported:n,contentLength:r}}),e.on(`GetRangeReader`,(e,t)=>{F(this.#n,"GetRangeReader - no `BasePDFStream` instance available.");let n=this.#n.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(F(e instanceof ArrayBuffer,`GetRangeReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on(`GetDoc`,({pdfInfo:e})=>{this.pagesMapper.pagesNumber=e.numPages,this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new ci(e,this))}),e.on(`DocException`,e=>{t._capability.reject(_n(e))}),e.on(`PasswordRequest`,e=>{this.#o=Promise.withResolvers();try{if(!t.onPassword)throw _n(e);t.onPassword(e=>{e instanceof Error?this.#o.reject(e):this.#o.resolve({password:e})},e.code)}catch(e){this.#o.reject(e)}return this.#o.promise}),e.on(`DataLoaded`,e=>{this.#l({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#r.get(e.pageProxyId)._startRenderPage(e.transparency,e.cacheKey)}),e.on(`commonobj`,([t,n,r])=>{if(this.destroyed||this.commonObjs.has(t))return null;switch(n){case`Font`:if(`error`in r){let e=r.error;N(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new Xt(new on(r.buffer),this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r.charProcOperatorList,r.extra);this.fontLoader.bind(i).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{i.fontExtraProperties||i.clearData(),this.commonObjs.resolve(t,i)});break;case`CopyLocalImage`:let{imageRef:a}=r;F(a,`The imageRef must be defined.`);for(let e of this.#r.values())for(let[,n]of e.objs){if(n?.ref!==a)continue;if(!n.dataLen)return null;let e=structuredClone(n);return this.commonObjs.resolve(t,e),n.dataLen}break;case`FontPath`:this.commonObjs.resolve(t,new cn(r));break;case`Image`:this.commonObjs.resolve(t,r);break;case`Pattern`:let o=new sn(r);this.commonObjs.resolve(t,o.getIR());break;default:throw Error(`Got unknown common object type ${n}`)}return null}),e.on(`obj`,([e,t,n,r])=>{if(this.destroyed)return;let i=this.#r.get(t);if(!i.objs.has(e)){if(i._intentStates.size===0)r?.bitmap?.close();else switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}}}),e.on(`DocProgress`,e=>{this.destroyed||this.#l(e)}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.binaryDataFactory)throw Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(e=null){this.annotationStorage.size<=0&&N("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,supportsPrintToPDF:this.#s!==null,filename:this.#e?.filename??null},n).finally(()=>{this.#s=null,this.annotationStorage.resetModified()})}extractPages(e,t=null){let n={pageInfos:e},r,i=globalThis.ImageBitmap;if(typeof i==`function`){let t=Array.isArray(e)?e:[e];for(let e of t)e?.image instanceof i&&(r||=[]).push(e.image)}if(this.annotationStorage.size>0){let e=this.annotationStorage.serializable,{map:i}=e;e.transfer?.length&&(r?r.push(...e.transfer):r=e.transfer);let a=this.pagesMapper.getMapping();if(a){let e=new Map;for(let[n,r]of i){if(r?.pageIndex!==void 0&&r.pageIndex>=0&&r.pageIndex<a.length){let i=t?.[r.pageIndex]??0,o=a[r.pageIndex]-1;if(o!==r.pageIndex||i!==0){e.set(n,{...r,pageIndex:o,copyLevel:i});continue}}e.set(n,r)}i=e}n.annotationStorage=i}return this.messageHandler.sendWithPromise(`ExtractPages`,n,r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.pagesMapper.getPageId(e)-1,r=this.#i.get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:n}).then(e=>{if(this.destroyed)throw Error(`Transport destroyed`);e.refStr&&this.#a.set(e.refStr,n);let r=new li(t,e,this,this.pagesMapper,this._params.pdfBug);return this.#r.set(r._id,r),r});return this.#i.set(t,i),i}async getPageIndex(e){if(!fn(e))throw Error(`Invalid pageIndex request.`);let t=await this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw Error(`GetPageIndex: page has been removed.`);return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return this.#c(`GetFieldObjects`)}getSignatures(){return this.#c(`GetSignatures`)}getSignatureData(e){return this.messageHandler.sendWithPromise(`GetSignatureData`,e)}hasJSActions(){return this.#c(`HasJSActions`)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise(`GetCalculationOrderIds`,null)}getDestinations(){return this.messageHandler.sendWithPromise(`GetDestinations`,null)}getDestination(e){return typeof e==`string`?this.messageHandler.sendWithPromise(`GetDestination`,{id:e}):Promise.reject(Error(`Invalid destination request.`))}getPageLabels(){return this.messageHandler.sendWithPromise(`GetPageLabels`,null)}getPageLayout(){return this.messageHandler.sendWithPromise(`GetPageLayout`,null)}getPageMode(){return this.messageHandler.sendWithPromise(`GetPageMode`,null)}getViewerPreferences(){return this.messageHandler.sendWithPromise(`GetViewerPreferences`,null)}getOpenAction(){return this.messageHandler.sendWithPromise(`GetOpenAction`,null)}getAttachments(){return this.messageHandler.sendWithPromise(`GetAttachments`,null)}getAttachmentContent(e){return this.messageHandler.sendWithPromise(`GetAttachmentContent`,e)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#c(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#c(`GetOptionalContentConfig`).then(t=>new Xr(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`;return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new qr(e[1]):null,contentDispositionFilename:this.#e?.filename??null,contentLength:this.#e?.contentLength??null,hasStructTree:e[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise(`GetMarkInfo`,null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise(`Cleanup`,null);for(let e of this.#r.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),ri.cleanup()}}cachedPageNumber(e){if(!fn(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=this.#a.get(t);if(n>=0){let e=this.pagesMapper.getPageNumber(n+1);if(e!==0)return e}return null}},fi=class{_internalRenderTask=null;onContinue=null;onError=null;constructor(e){this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}},pi=class e{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,filterFactory:c,useRequestAnimationFrame:l=!1,pdfBug:u=!1,pageColors:d=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this.filterFactory=c,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=l===!0&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new fi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(()=>{})}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.#t.has(this._canvas))throw Error(`Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.`);e.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:r,transform:i,background:a,dependencyTracker:o,imagesTracker:s}=this.params,c=this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new fr(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o,s),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&=(window.cancelAnimationFrame(this.#e),null),e.#t.delete(this._canvas),t||=new Fe(`Rendering cancelled, page ${this._pageIndex+1}`,n),this.callback(t),this.task.onError?.(t)}operatorListChanged(){this.graphicsReady?(this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),e.#t.delete(this._canvas),this.callback())))}},mi=`6.4.299`,hi=`d0991a0d5`,gi=class e{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#o=null;#s;#c=null;#l=null;static#u=null;static get _keyboardManager(){return L(this,`_keyboardManager`,new gt([[[`Escape`],e.prototype._hideDropdownFromKeyboard],[[`Space`],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`],e.prototype._moveToPrevious],[[`Home`],e.prototype._moveToBeginning],[[`End`],e.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:n=null}){t?(this.#a=!1,this.#o=t):this.#a=!0,this.#l=t?._uiManager||n,this.#s=this.#l._eventBus,this.#n=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||`#FFFF98`,e.#u||=Object.freeze({blue:`pdfjs-editor-colorpicker-blue`,green:`pdfjs-editor-colorpicker-green`,pink:`pdfjs-editor-colorpicker-pink`,red:`pdfjs-editor-colorpicker-red`,yellow:`pdfjs-editor-colorpicker-yellow`})}renderButton(){let e=this.#e=document.createElement(`button`);e.className=`colorPicker`,e.tabIndex=`0`,e.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-button`),e.ariaHasPopup=`true`,this.#o&&(e.ariaControls=`${this.#o.id}_colorpicker_dropdown`);let t=this.#l._signal;e.addEventListener(`click`,this.#m.bind(this),{signal:t}),e.addEventListener(`keydown`,this.#p.bind(this),{signal:t});let n=this.#t=document.createElement(`span`);return n.className=`swatch`,n.ariaHidden=`true`,n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){let e=this.#r=this.#d();return e.ariaOrientation=`horizontal`,e.ariaLabelledBy=`highlightColorPickerLabel`,e}#d(){let t=document.createElement(`div`),n=this.#l._signal;t.addEventListener(`contextmenu`,He,{signal:n}),t.className=`dropdown`,t.role=`listbox`,t.ariaMultiSelectable=`false`,t.ariaOrientation=`vertical`,t.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-dropdown`),this.#o&&(t.id=`${this.#o.id}_colorpicker_dropdown`);for(let[r,i]of this.#l.highlightColors){let a=document.createElement(`button`);a.tabIndex=`0`,a.role=`option`,a.setAttribute(`data-color`,i),a.title=r,a.setAttribute(`data-l10n-id`,e.#u[r]);let o=document.createElement(`span`);a.append(o),o.className=`swatch`,o.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener(`click`,this.#f.bind(this,i),{signal:n}),t.append(a)}return t.addEventListener(`keydown`,this.#p.bind(this),{signal:n}),t}#f(e,t){t.stopPropagation(),this.#s.dispatch(`switchannotationeditorparams`,{source:this,type:E.HIGHLIGHT_COLOR,value:e}),this.update(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#m(e);return}let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){this.#g?e.target===this.#e?this.#r.firstElementChild?.focus():e.target.nextSibling?.focus():this.#m(e)}_moveToPrevious(e){e.target===this.#r?.firstElementChild||e.target===this.#e?this.#g&&this._hideDropdownFromKeyboard():(this.#g||this.#m(e),e.target.previousSibling?.focus())}_moveToBeginning(e){this.#g?this.#r.firstElementChild?.focus():this.#m(e)}_moveToEnd(e){this.#g?this.#r.lastElementChild?.focus():this.#m(e)}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g){this.hideDropdown();return}if(this.#i=e.detail===0,this.#c||(this.#c=new AbortController,window.addEventListener(`pointerdown`,this.#h.bind(this),{signal:this.#l.combinedSignal(this.#c)})),this.#e.ariaExpanded=`true`,this.#r){this.#r.classList.remove(`hidden`);return}let t=this.#r=this.#d();this.#e.append(t)}#h(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add(`hidden`),this.#e.ariaExpanded=`false`,this.#c?.abort(),this.#c=null}get#g(){return this.#r&&!this.#r.classList.contains(`hidden`)}_hideDropdownFromKeyboard(){this.#a||(this.#g?(this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})):this.#o?.unselect())}update(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;let t=this.#l.highlightColors.values();for(let n of this.#r.children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}},_i=class e{#e=null;#t=!1;#n=null;#r=null;static#i=null;constructor(t){this.#n=t,this.#r=t._uiManager,e.#i||=Object.freeze({freetext:`pdfjs-editor-color-picker-free-text-input`,ink:`pdfjs-editor-color-picker-ink-input`})}renderButton(){if(this.#e)return this.#e;let{editorType:t,colorType:n,colorAndOpacityType:r,opacityType:i,color:a,opacity:o}=this.#n,s=this.#t=z.isAlphaColorInputSupported&&i!==void 0,c=this.#e=document.createElement(`input`);if(c.type=`color`,s){c.setAttribute(`alpha`,``);let e=B.hexNums[Math.round((o??1)*255)];c.value=(a||`#000000`)+e}else c.value=a||`#000000`;return c.className=`basicColorPicker`,c.tabIndex=0,c.setAttribute(`data-l10n-id`,e.#i[t]),c.addEventListener(`input`,()=>{if(s){let e=We(c.value);if(!e)return;let[t,a,o,s]=e,l=B.makeHexColor(t,a,o);r===void 0?(this.#r.updateParams(n,l),this.#r.updateParams(i,s)):this.#r.updateParams(r,{color:l,opacity:s})}else this.#r.updateParams(n,c.value)},{signal:this.#r._signal}),c}update(e){if(this.#e){if(this.#t){let t=B.hexNums[Math.round(this.#n.opacity*255)];this.#e.value=e+t}else this.#e.value=e}}updateOpacity(e){if(!this.#e||!this.#t)return;let t=B.hexNums[Math.round(e*255)];this.#e.value=this.#n.color+t}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function vi(e){return Math.floor(V(e,0,1)*255).toString(16).padStart(2,`0`)}function yi(e){return V(e,0,1)*255}var bi=class{static CMYK_G([e,t,n,r]){return[`G`,1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return[`CMYK`,0,0,0,1-e]}static G_RGB([e]){return[`RGB`,e,e,e]}static G_rgb([e]){return e=yi(e),[e,e,e]}static G_HTML([e]){let t=vi(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return[`G`,.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(yi)}static RGB_HTML(e){return`#${e.map(vi).join(``)}`}static T_HTML(){return`#00000000`}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,r]){return[`RGB`,1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,n,r]){return[yi(1-Math.min(1,e+r)),yi(1-Math.min(1,n+r)),yi(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let r=1-e,i=1-t,a=1-n;return[`CMYK`,r,i,a,Math.min(r,i,a)]}},xi=class{create(e,t,n=!1){if(e<=0||t<=0)throw Error(`Invalid SVG dimensions`);let r=this._createSVG(`svg:svg`);return r.setAttribute(`version`,`1.1`),n||(r.setAttribute(`width`,`${e}px`),r.setAttribute(`height`,`${t}px`)),r.setAttribute(`preserveAspectRatio`,`none`),r.setAttribute(`viewBox`,`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!=`string`)throw Error(`Invalid SVG element type`);return this._createSVG(e)}_createSVG(e){P("Abstract method `_createSVG` called.")}},Si=class extends xi{_createSVG(e){return document.createElementNS(b,e)}},Ci=9,wi=new WeakSet,Ti=new Date().getTimezoneOffset()*60*1e3,Ei=class{static create(e){switch(e.data.annotationType){case k.LINK:return new Oi(e);case k.TEXT:return new ki(e);case k.WIDGET:switch(e.data.fieldType){case`Tx`:return new ji(e);case`Btn`:return e.data.radioButton?new Pi(e):e.data.checkBox?new Ni(e):new Fi(e);case`Ch`:return new Ii(e);case`Sig`:return new Mi(e)}return new Ai(e);case k.POPUP:return new Li(e);case k.FREETEXT:return new zi(e);case k.LINE:return new Bi(e);case k.SQUARE:return new Vi(e);case k.CIRCLE:return new Hi(e);case k.POLYLINE:return new Ui(e);case k.CARET:return new Gi(e);case k.INK:return new Ki(e);case k.POLYGON:return new Wi(e);case k.HIGHLIGHT:return new qi(e);case k.UNDERLINE:return new Ji(e);case k.SQUIGGLY:return new Yi(e);case k.STRIKEOUT:return new Xi(e);case k.STAMP:return new Zi(e);case k.FILEATTACHMENT:return new Qi(e);case k.RICHMEDIA:case k.SCREEN:case k.SOUND:return new $i(e);default:return new q(e)}}},q=class e{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return e._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:r}=this.data,i=-1/0,a=-1/0;if(t?.length>=8){for(let e=0;e<t.length;e+=8)t[e+1]>a?(a=t[e+1],i=t[e+2]):t[e+1]===a&&(i=Math.max(i,t[e+2]));return[i,a]}if(n?.length>=1){for(let e of n)for(let t=0,n=e.length;t<n;t+=2)e[t+1]>a?(a=e[t+1],i=e[t]):e[t+1]===a&&(i=Math.max(i,e[t]));if(i!==1/0)return[i,a]}return r?[r[2],r[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/n,e[1]=100*(e[1]-a)/r,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${w}${e.id}`)?.popup?.contents||e.contentsObj?.str||``}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||``};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${w}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});let{rect:t,popup:n}=e;t&&this.#r(t);let r=this.#n?.popup||this.popup;!r&&n?.text&&(this._createPopup(n),r=this.#n.popup),r&&(r.updateEdited(e),n?.deleted&&(r.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&=(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),null)}#r(e){let{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:s}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+s)/a}%`,r===0?(t.width=`${100*(e[2]-e[0])/i}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement(`section`);i.setAttribute(`data-annotation-id`,t.id),this instanceof Ai||this instanceof Oi||this instanceof $i||(i.tabIndex=0);let{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add(`norotate`),!t.rect||this instanceof Li){let{rotation:e}=t;return!t.hasOwnCanvas&&e!==0&&this.setRotation(e,i),i}let{width:o,height:s}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;switch((e>0||n>0)&&(a.borderRadius=`calc(${e}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`),t.borderStyle.style){case te.SOLID:a.borderStyle=`solid`;break;case te.DASHED:a.borderStyle=`dashed`;break;case te.BEVELED:N(`Unimplemented border style: beveled`);break;case te.INSET:N(`Unimplemented border style: inset`);break;case te.UNDERLINE:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=B.makeHexColor(...r)):a.borderWidth=0}let c=B.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:u,pageX:d,pageY:f}=r.rawDims;a.left=`${100*(c[0]-d)/l}%`,a.top=`${100*(c[1]-f)/u}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/l}%`,a.height=`${100*s/u}%`):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:a}=this;e%180!=0&&([i,a]=[a,i]),t.style.width=`${100*i/n}%`,t.style.height=`${100*a/r}%`,t.setAttribute(`data-main-rotation`,(360-e)%360)}get _commonActions(){let e=(e,t,n)=>{let r=n.detail[e],i=r[0],a=r.slice(1);n.target.style[t]=bi[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:bi[`${i}_rgb`](a)})};return L(this,`_commonActions`,{display:e=>{let{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:t===1||t===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:t}=e.detail;this.container.style.visibility=t?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e(`bgColor`,`backgroundColor`,t)},fillColor:t=>{e(`fillColor`,`backgroundColor`,t)},fgColor:t=>{e(`fgColor`,`color`,t)},textColor:t=>{e(`textColor`,`color`,t)},borderColor:t=>{e(`borderColor`,`borderColor`,t)},strokeColor:t=>{e(`strokeColor`,`borderColor`,t)},rotation:e=>{let t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||n[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[r,i]of Object.entries(t)){let a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,r,i]=this.data.rect.map(Math.fround);if(e.length===8){let[a,o,s,c]=e.subarray(2,6);if(r===a&&i===o&&t===s&&n===c)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:e,borderWidth:t}=a;a.borderWidth=0,o=[`url('data:image/svg+xml;utf8,`,`<svg xmlns="${b}" preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add(`hasBorder`)}let s=r-t,c=i-n,{svgFactory:l}=this,u=l.createElement(`svg`);u.classList.add(`quadrilateralsContainer`),u.setAttribute(`width`,0),u.setAttribute(`height`,0),u.role=`none`;let d=l.createElement(`defs`);u.append(d);let f=l.createElement(`clipPath`),p=`clippath_${this.data.id}`;f.setAttribute(`id`,p),f.setAttribute(`clipPathUnits`,`objectBoundingBox`),d.append(f);for(let n=2,r=e.length;n<r;n+=8){let r=e[n],a=e[n+1],u=e[n+2],d=e[n+3],p=l.createElement(`rect`),m=(u-t)/s,h=(i-a)/c,g=(r-u)/s,_=(a-d)/c;p.setAttribute(`x`,m),p.setAttribute(`y`,h),p.setAttribute(`width`,g),p.setAttribute(`height`,_),f.append(p),o?.push(`<rect vector-effect="non-scaling-stroke" x="${m}" y="${h}" width="${g}" height="${_}"/>`)}this.#t&&(o.push(`</g></svg>')`),a.backgroundImage=o.join(``)),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){let{data:t}=this,n,r;e?(n={str:e.text},r=e.date):(n=t.contentsObj,r=t.modificationDate),this.#n=new Li({data:{color:t.color,titleObj:t.titleObj,modificationDate:r,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){P("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects.get(e)||[];for(let{page:e,id:i,exportValues:a}of r){if(e===-1||i===t)continue;let r=typeof a==`string`?a:null,o=document.querySelector(`[data-element-id="${i}"]`);o&&!wi.has(o)?N(`_getElementsByName - element not allowed: ${i}`):n.push({id:i,exportValue:r,domElement:o})}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&wi.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add(`highlightArea`);else e.classList.add(`highlightArea`)}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener(`dblclick`,()=>{this.linkService.eventBus?.dispatch(`switchannotationeditormode`,{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}updateOC(e){this.data.oc&&e&&(e.isVisible(this.data.oc)?this.show():this.hide())}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:B.makeHexColor(...t)}},Di=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className=`editorAnnotation`,this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},Oi=class extends q{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement(`a`);n.setAttribute(`data-element-id`,e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),r=!0):e.attachment?(this.#t(n,e.attachmentId,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.has(`Action`)||e.actions.has(`Mouse Up`)||e.actions.has(`Mouse Down`))&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,``),r=!0)),this.container.classList.add(`linkAnnotation`),r&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute(`data-internal-link`,``)}_bindLink(e,t,n=``){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t===``)&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),n&&(e.title=n),this.#e()}#t(e,t,n,r=``,i=null){e.href=this.linkService.getAnchorUrl(``),n.description?e.title=n.description:r&&(e.title=r);let a=async()=>{let e=await this.linkService.getAttachmentContent(t);e&&this.downloadManager?.openOrDownloadData(e,n.filename,i)};e.onclick=()=>(a(),!1),this.#e()}#n(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,{actions:t,id:n,overlaidText:r}){e.href=this.linkService.getAnchorUrl(``);let i=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of t.keys()){let t=i.get(r);t&&(e[t]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:n,name:r}}),!1))}r&&(e.title=r),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),this._fieldObjects?e.onclick=()=>{n?.();let{fields:e,refs:r,include:i}=t,a=[];if(e.length!==0||r.length!==0){let t=new Set(r);for(let n of e){let e=this._fieldObjects.get(n)||[];for(let{id:n}of e)t.add(n)}let n=new Map;for(let e of this._fieldObjects.values())for(let{id:t,kidIds:r}of e)r&&n.set(t,r);for(let e of t)for(let r of n.get(e)||[])t.add(r);for(let e of this._fieldObjects.values())for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of this._fieldObjects.values())a.push(...e);let o=this.annotationStorage,s=[];for(let e of a){let{id:t}=e;switch(s.push(t),e.type){case`text`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}case`checkbox`:case`radiobutton`:{let n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case`combobox`:case`listbox`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${t}"]`);n&&(wi.has(n)?n.dispatchEvent(new Event(`resetform`)):N(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}:(N('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1))}},ki=class extends q{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add(`textAnnotation`);let e=document.createElement(`img`);return e.src=this.imageResourcesPath+`annotation-`+this.data.name.toLowerCase()+`.svg`,e.setAttribute(`data-l10n-id`,`pdfjs-text-annotation-type`),e.setAttribute(`data-l10n-args`,JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}},Ai=class extends q{render(){return this.container}_getKeyModifier(e){return z.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes(`mouse`)?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if(n===`blur`){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if(n===`focus`){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e)}})})}_setEventListeners(e,t,n,r){let{actions:i}=this.data;for(let[a,o]of n)(o===`Action`||i?.has(o))&&((o===`Focus`||o===`Blur`)&&(t||={focused:!1}),this._setEventListener(e,t,a,o,r),o===`Focus`&&!i?.has(`Blur`)?this._setEventListener(e,t,`blur`,`Blur`,null):o===`Blur`&&!i?.has(`Focus`)&&this._setEventListener(e,t,`focus`,`Focus`,null))}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||Ci,i=e.style,a,o=e=>Math.round(10*e)/10;if(this.data.multiLine){let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(1.35*r))||1);a=Math.min(r,o(t/1.35))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/1.35))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=B.makeHexColor(...n),this.data.textAlignment!==null&&!this.data.comb&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},ji=class extends Ai{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,r){let i=this.annotationStorage;for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add(`textWidgetAnnotation`);let n=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),i=r.value||``,a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let o=r.formattedValue||this.data.textContent?.join(`
45
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,``));let s={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement(`textarea`),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY=`hidden`)):(n=document.createElement(`input`),n.type=this.data.password?`password`:`text`,n.setAttribute(`value`,o??i),this.data.doNotScroll&&(n.style.overflowX=`hidden`)),this.data.hasOwnCanvas&&(this.container.classList.add(`hasOwnCanvas`),e.has(t)&&this.container.classList.add(`sandboxModified`)),wi.add(n),this.contentElement=n,n.setAttribute(`data-element-id`,t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:l,timeStep:u}=this.data,d=!!l&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener(`input`,r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,`value`,r.target.value,`value`),s.formattedValue=null}),n.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue??``;n.value=s.userValue=t,s.formattedValue=null});let f=e=>{let{formattedValue:t}=s;t!=null&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener(`focus`,e=>{if(s.focused)return;let{target:t}=e;if(d&&(t.type=l,u&&(t.step=u)),s.userValue){let e=s.userValue;if(d){if(l===`time`){let n=new Date(e);t.value=[n.getHours(),n.getMinutes(),n.getSeconds()].map(e=>e.toString().padStart(2,`0`)).join(`:`)}else t.value=new Date(e-Ti).toISOString().split(l===`date`?`T`:`.`,1)[0]}else t.value=e}s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.has(`Focus`)||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.container.classList.add(`sandboxModified`),this._dispatchEventFromSandbox({value(n){s.userValue=n.detail.value??``,d||e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){let{formattedValue:r}=n.detail;s.formattedValue=r,r!=null&&n.target!==document.activeElement&&(n.target.value=r);let i={formattedValue:r};d&&(i.value=r),e.setValue(t,i)},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{let{charLimit:r}=n.detail,{target:i}=n;if(r===0){i.removeAttribute(`maxLength`);return}i.setAttribute(`maxLength`,r);let a=s.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=s.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}},n)}),n.addEventListener(`keydown`,e=>{s.commitKey=1;let n=-1;if(e.key===`Escape`?n=0:e.key===`Enter`&&!this.data.multiLine?n=2:e.key===`Tab`&&(s.commitKey=3),n===-1)return;let{value:r}=e.target;s.lastCommittedValue!==r&&(s.lastCommittedValue=r,s.userValue=r,this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});let r=f;f=null,n.addEventListener(`blur`,e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.has(`Blur`)||(s.focused=!1);let{target:n}=e,{value:i}=n;if(d){if(i&&l===`time`){let e=i.split(`:`).map(e=>parseInt(e,10));i=new Date(2e3,0,1,e[0],e[1],e[2]||0).valueOf(),n.step=``}else i.includes(`T`)||(i=`${i}T00:00`),i=new Date(i).valueOf();n.type=`text`}s.userValue=i,s.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.has(`Keystroke`)&&n.addEventListener(`beforeinput`,e=>{s.lastCommittedValue=null;let{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:o}=r,c=a,l=o;switch(e.inputType){case`deleteWordBackward`:{let e=/\w/;for(;c>0&&!e.test(i[c-1]);)c--;for(;c>0&&e.test(i[c-1]);)c--;break}case`deleteWordForward`:{let e=i.substring(a).match(/^\W*\w*/);e&&(l+=e[0].length);break}case`deleteContentBackward`:a===o&&--c;break;case`deleteContentForward`:a===o&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,change:n||``,willCommit:!1,selStart:c,selEnd:l}})}),this._setEventListeners(n,s,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.value)}if(f&&n.addEventListener(`blur`,f),this.data.comb){let e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add(`comb`),n.style.setProperty(`--comb-width`,`calc(${e}px * var(--total-scale-factor))`);let t=this.data.textAlignment;if(t===1||t===2){let e=()=>{let e=a-n.value.length;n.style.setProperty(`--comb-offset`,`${t===1?e>>1:e}`)};e();for(let t of[`input`,`blur`,`resetform`,`updatefromsandbox`])n.addEventListener(t,e)}}}else n=document.createElement(`div`),n.textContent=this.data.fieldValue,n.style.verticalAlign=`middle`,n.style.display=`table-cell`,this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},Mi=class extends Ai{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},Ni=class extends Ai{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof r==`string`&&(r=r!==`Off`,e.setValue(n,{value:r})),this.container.classList.add(`buttonWidgetAnnotation`,`checkBox`);let i=document.createElement(`input`);return wi.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`checkbox`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.setAttribute(`exportValue`,t.exportValue),i.tabIndex=0,i.addEventListener(`change`,r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n)){let n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue||`Off`;e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value(t){t.target.checked=t.detail.value!==`Off`,e.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Pi=class extends Ai{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`buttonWidgetAnnotation`,`radioButton`);let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.buttonValue!==null&&t.fieldValue===t.buttonValue}).value;if(typeof r==`string`&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(let r of this._getElementsByName(t.fieldName,n))e.setValue(r.id,{value:!1});let i=document.createElement(`input`);if(wi.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`radio`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.tabIndex=0,i.addEventListener(`change`,t=>{let{name:r,checked:i}=t.target;for(let t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue;e.target.checked=n!=null&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){let r=t.buttonValue;i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value:t=>{let i=r===t.detail.value;for(let r of this._getElementsByName(t.target.name)){let t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)}return this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Fi=class extends Oi{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add(`buttonWidgetAnnotation`,`pushButton`);let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener(`updatefromsandbox`,e=>{this._dispatchEventFromSandbox({},e)})),e}},Ii=class extends Ai{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`choiceWidgetAnnotation`);let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement(`select`);wi.add(r),r.setAttribute(`data-element-id`,t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue;for(let e of r.options)e.selected=e.value===t});let a=(e,t)=>{let n=t.replaceAll(` `,`\xA0`);e.textContent=n,n!==t&&e.setAttribute(`display-value`,t)};for(let e of this.data.options){let t=document.createElement(`option`);a(t,e.displayValue),t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let o=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener(`input`,o),o=null},r.addEventListener(`input`,o)}let s=e=>{let t=e?`value`:`textContent`,{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):n.selectedIndex===-1?null:n[n.selectedIndex][t]},c=s(!1),l=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.getAttribute(`display-value`)||e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){o?.();let i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=a.has(e.value);e.setValue(t,{value:s(!0)}),c=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){let i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&Array.prototype.findIndex.call(i,e=>e.selected)===-1&&(i[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),c=s(!1)},insert(n){let{index:i,displayValue:o,exportValue:u}=n.detail.insert,d=r.children[i],f=document.createElement(`option`);a(f,o),f.value=u,d?d.before(f):r.append(f),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},items(n){let{items:i}=n.detail;for(;r.length!==0;)r.remove(0);for(let e of i){let{displayValue:t,exportValue:n}=e,i=document.createElement(`option`);a(i,t),i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},indices(n){let r=new Set(n.detail.indices);for(let e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(!0)}),c=s(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=s(!0),i=s(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:c,change:i,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`],[`input`,`Action`],[`input`,`Validate`]],e=>e.target.value)):r.addEventListener(`input`,function(n){e.setValue(t,{value:s(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},Li=class extends q{constructor(e){let{data:t,elements:n,parent:r}=e,i=!!r._commentManager;if(super(e,{isRenderable:!i&&q._hasPopupData(t)}),this.elements=n,i&&q._hasPopupData(t)){let e=this.popup=this.#e();for(let t of n)t.popup=e}else this.popup=null}#e(){return new Ri({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){let{container:e}=this;e.classList.add(`popupAnnotation`),e.role=`comment`;let t=this.popup=this.#e(),n=[];for(let e of this.elements)e.popup=t,e.container.ariaHasPopup=`dialog`,n.push(e.data.id),e.addHighlightArea();return this.container.setAttribute(`aria-controls`,n.map(e=>`${C}${e}`).join(`,`)),this.container}},Ri=class{#e=null;#t=this.#P.bind(this);#n=this.#R.bind(this);#r=this.#L.bind(this);#i=this.#I.bind(this);#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=null;#f=!1;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=!1;#w=null;#T=null;constructor({container:e,color:t,elements:n,titleObj:r,modificationDate:i,contentsObj:a,richText:o,parent:s,rect:c,parentRect:l,open:u,commentManager:d=null}){this.#o=e,this.#x=r,this.#s=a,this.#b=o,this.#u=s,this.#a=t,this.#y=c,this.#d=l,this.#l=n,this.#e=d,this.#w=n[0],this.#c=Ue.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup()),d||(this.#E(),this.#o.hidden=!0,u&&this.#I())}#E(){if(this.#m)return;this.#m=new AbortController;let{signal:e}=this.#m;for(let t of this.trigger)t.addEventListener(`click`,this.#i,{signal:e}),t.addEventListener(`pointerenter`,this.#r,{signal:e}),t.addEventListener(`pointerleave`,this.#n,{signal:e}),t.classList.add(`popupTriggerArea`);for(let t of this.#l)t.container?.addEventListener(`keydown`,this.#t,{signal:e})}#D(){let e=this.#l.find(e=>e.hasCommentButton);e&&(this.#_=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#g){this.#g.parentNode||this.#w.container.after(this.#g);return}if(this.#_||this.#D(),!this.#_)return;let{signal:e}=this.#m=new AbortController,t=this.#w.hasOwnCommentButton,n=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!t)},r=()=>{this.#e.toggleCommentPopup(this,!1,!0,!t)},i=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(t){this.#g=this.#w.container;for(let t of this.trigger)t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),t.classList.add(`popupTriggerArea`)}else{let t=this.#g=document.createElement(`button`);t.className=`annotationCommentButton`;let a=this.#w.container;t.style.zIndex=parseInt(a.style.zIndex,10)+1,t.tabIndex=0,t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`),this.#k(),this.#O(),t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),a.after(t)}}#O(){if(this.#w.extraPopupElement&&!this.#w.editor)return;this.#g||this.renderCommentButton();let[e,t]=this.#_,{style:n}=this.#g;n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`}#k(){this.#w.extraPopupElement||(this.#g||this.renderCommentButton(),this.#g.style.backgroundColor=this.commentButtonColor||``)}get commentButtonColor(){let{color:e,opacity:t}=this.#w.commentData;return e?this.#u._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#g?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}=this.#w.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}}get elementBeforePopup(){return this.#g}get comment(){return this.#T||=this.#w.commentText,this.#T}set comment(e){e!==this.comment&&(this.#w.commentText=this.#T=e)}focus(){this.#w.container?.focus()}get parentBoundingClientRect(){return this.#w.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#g&&(this.#g.classList.toggle(`selected`,e),this.#g.ariaExpanded=t)}setSelectedCommentButton(e){this.#g.classList.toggle(`selected`,e)}get commentPopupPosition(){if(this.#v)return this.#v;let{x:e,y:t,height:n}=this.#g.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#w.layer.getBoundingClientRect();return[(e-r)/a,(t+n-i)/o]}set commentPopupPosition(e){this.#v=e}hasDefaultPopupPosition(){return this.#v===null}get commentButtonPosition(){return this.#_}get commentButtonWidth(){return this.#g.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=this.#v||this.commentButtonPosition.map(e=>e/100),r=this.parentBoundingClientRect,{x:i,y:a,width:o,height:s}=r;this.#e.showDialog(null,this,i+t*o,a+n*s,{...e,parentDimensions:r})}render(){if(this.#p)return;let e=this.#p=document.createElement(`div`);if(e.className=`popup`,this.#a){let t=e.style.outlineColor=B.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}let t=document.createElement(`span`);if(t.className=`header`,this.#x?.str){let e=document.createElement(`span`);e.className=`title`,t.append(e),{dir:e.dir,str:e.textContent}=this.#x}if(e.append(t),this.#c){let e=document.createElement(`time`);e.className=`popupDate`,e.setAttribute(`data-l10n-id`,`pdfjs-annotation-date-time-string`),e.setAttribute(`data-l10n-args`,JSON.stringify({dateObj:this.#c.valueOf()})),e.dateTime=this.#c.toISOString(),t.append(e)}ot({html:this.#A||this.#s.str,dir:this.#s?.dir,className:`popupContent`},e),this.#o.append(e)}get#A(){let e=this.#b,t=this.#s;return e?.str&&(!t?.str||t.str===e.str)&&this.#b.html||null}get#j(){return this.#A?.attributes?.style?.fontSize||0}get#M(){return this.#A?.attributes?.style?.color||null}#N(e){let t=[],n={str:e,html:{name:`div`,attributes:{dir:`auto`},children:[{name:`p`,children:t}]}},r={style:{color:this.#M,fontSize:this.#j?`calc(${this.#j}px * var(--total-scale-factor))`:``}};for(let n of e.split(`
46
+ `))t.push({name:`span`,value:n,attributes:r});return n}#P(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key===`Enter`||e.key===`Escape`&&this.#f)&&this.#I()}updateEdited({rect:e,popup:t,deleted:n}){this.#e?(n?(this.remove(),this.#T=null):t&&(t.deleted?this.remove():(this.#k(),this.#T=t.text)),e&&(this.#_=null,this.#D(),this.#O())):n||t?.deleted?this.remove():(this.#E(),this.#S||={contentsObj:this.#s,richText:this.#b},e&&(this.#h=null),t&&t.text&&(this.#b=this.#N(t.text),this.#c=Ue.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null)}resetEdited(){this.#S&&({contentsObj:this.#s,richText:this.#b}=this.#S,this.#S=null,this.#p?.remove(),this.#p=null,this.#h=null)}remove(){if(this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#C=!1,this.#f=!1,this.#g?.remove(),this.#g=null,this.trigger)for(let e of this.trigger)e.classList.remove(`popupTriggerArea`)}#F(){if(this.#h!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=this.#u,a=!!this.#d,o=a?this.#d:this.#y;for(let e of this.#l)if(!o||B.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=B.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),c=a?o[2]-o[0]+5:0,l=s[0]+c,u=s[1];this.#h=[100*(l-r)/t,100*(u-i)/n];let{style:d}=this.#o;d.left=`${this.#h[0]}%`,d.top=`${this.#h[1]}%`}#I(){this.#e?this.#e.toggleCommentPopup(this,!1):(this.#f=!this.#f,this.#f?(this.#L(),this.#o.addEventListener(`click`,this.#i),this.#o.addEventListener(`keydown`,this.#t)):(this.#R(),this.#o.removeEventListener(`click`,this.#i),this.#o.removeEventListener(`keydown`,this.#t)))}#L(){this.#p||this.render(),this.isVisible?this.#f&&this.#o.classList.add(`focused`):(this.#F(),this.#o.hidden=!1,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)+1e3)}#R(){this.#o.classList.remove(`focused`),!(this.#f||!this.isVisible)&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)-1e3)}forceHide(){this.#C=this.isVisible,this.#C&&(this.#o.hidden=!0)}maybeShow(){this.#e||(this.#E(),this.#C&&(this.#p||this.#L(),this.#C=!1,this.#o.hidden=!1))}get isVisible(){return!this.#e&&this.#o.hidden===!1}},zi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=T.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=this.contentElement=document.createElement(`div`);e.classList.add(`annotationTextContent`),e.setAttribute(`role`,`comment`);for(let t of this.textContent){let n=document.createElement(`span`);n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},Bi=class extends q{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`lineAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement(`svg:line`);return i.setAttribute(`x1`,e.rect[2]-e.lineCoordinates[0]),i.setAttribute(`y1`,e.rect[3]-e.lineCoordinates[1]),i.setAttribute(`x2`,e.rect[2]-e.lineCoordinates[2]),i.setAttribute(`y2`,e.rect[3]-e.lineCoordinates[3]),i.setAttribute(`stroke-width`,e.borderStyle.width||1),i.setAttribute(`stroke`,`transparent`),i.setAttribute(`fill`,`transparent`),r.append(i),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Vi=class extends q{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`squareAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:rect`);return a.setAttribute(`x`,i/2),a.setAttribute(`y`,i/2),a.setAttribute(`width`,t-i),a.setAttribute(`height`,n-i),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Hi=class extends q{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`circleAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:ellipse`);return a.setAttribute(`cx`,t/2),a.setAttribute(`cy`,n/2),a.setAttribute(`rx`,t/2-i/2),a.setAttribute(`ry`,n/2-i/2),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Ui=class extends q{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`polylineAnnotation`,this.svgElementName=`svg:polyline`}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:r},width:i,height:a}=this;if(!t)return this.container;let o=this.svgFactory.create(i,a,!0),s=[];for(let n=0,r=t.length;n<r;n+=2){let r=t[n]-e[0],i=e[3]-t[n+1];s.push(`${r},${i}`)}s=s.join(` `);let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute(`points`,s),c.setAttribute(`stroke-width`,n.width||1),c.setAttribute(`stroke`,`transparent`),c.setAttribute(`fill`,`transparent`),o.append(c),this.container.append(o),!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Wi=class extends Ui{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},Gi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},Ki=class extends q{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?T.HIGHLIGHT:T.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:a,width:o,height:s}=this.#n(t,e),c=this.svgFactory.create(o,s,!0),l=this.#e=this.svgFactory.createElement(`svg:g`);c.append(l),l.setAttribute(`stroke-width`,r.width||1),l.setAttribute(`stroke-linecap`,`round`),l.setAttribute(`stroke-linejoin`,`round`),l.setAttribute(`stroke-miterlimit`,10),l.setAttribute(`stroke`,`transparent`),l.setAttribute(`fill`,`transparent`),l.setAttribute(`transform`,a);for(let e of n){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,e.join(`,`)),l.append(t)}return!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:r}=e,i=this.#e;if(t>=0&&i.setAttribute(`stroke-width`,t||1),n)for(let e=0,t=this.#t.length;e<t;e++)this.#t[e].setAttribute(`points`,n[e].join(`,`));if(r){let{transform:e,width:t,height:n}=this.#n(this.data.rotation,r);i.parentElement.setAttribute(`viewBox`,`0 0 ${t} ${n}`),i.setAttribute(`transform`,e)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add(`highlightArea`)}},qi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=T.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`highlightAnnotation`),this._editOnDoubleClick(),e){let t=document.createElement(`mark`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},Ji=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`underlineAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},Yi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`squigglyAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},Xi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`strikeoutAnnotation`),e){let t=document.createElement(`s`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},Zi=class extends q{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=T.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},Qi=class extends q{#e=null;constructor(e){super(e,{isRenderable:!0});let{fileId:t,file:n}=this.data;this.filename=n.filename,this.content=n.content,this.fileId=t,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,attachmentId:this.fileId,...n})}render(){this.container.classList.add(`fileAttachmentAnnotation`);let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement(`div`):(n=document.createElement(`img`),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?`paperclip`:`pushpin`}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=z.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}async#t(){let{fileId:e,filename:t,content:n}=this,r=await this.linkService.getAttachmentContent(e)||n;r&&this.downloadManager?.openOrDownloadData(r,t)}},$i=class extends q{#e=new AbortController;#t=null;#n=null;constructor(e){super(e,{isRenderable:!!e.data.richMedia})}render(){this.container.classList.add(`mediaAnnotation`);let{filename:e}=this.data.richMedia,t=document.createElement(`button`);return t.className=`mediaPlayButton`,t.type=`button`,t.title=t.ariaLabel=e,t.addEventListener(`click`,()=>this.#r(t),{signal:this.#e.signal}),this.container.append(t),this.container}async#r(e){let{fileId:t,filename:n,contentType:r}=this.data.richMedia;e.disabled=!0;let i;try{i=await this.linkService.getAttachmentContent(t)}catch{return}finally{e.disabled=!1}if(!i||!e.isConnected)return;let{signal:a}=this.#e,o=new Blob([i],{type:r});if(!/^(?:video|audio)\//.test(o.type))return;let s=URL.createObjectURL(o);this.#t=s;let c=o.type.startsWith(`audio/`),l=document.createElement(c?`audio`:`video`);if(this.#n=l,l.className=`mediaContent`,this._setBackgroundColor(l),l.src=s,l.title=n,l.controls=!0,l.autoplay=!0,l.tabIndex=0,c){let e=!1,t=!1,n=()=>{l.controls=e||t};this.container.addEventListener(`pointerenter`,()=>{e=!0,n()},{signal:a}),this.container.addEventListener(`pointerleave`,()=>{e=!1,n()},{signal:a}),this.container.addEventListener(`focusin`,()=>{t=!0,n()},{signal:a}),this.container.addEventListener(`focusout`,()=>{t=!1,n()},{signal:a})}l.addEventListener(`emptied`,()=>this.#i(s),{once:!0,signal:a}),e.replaceWith(l),l.play().catch(()=>{})}#i(e=this.#t){e&&e===this.#t&&(URL.revokeObjectURL(e),this.#t=null)}destroy(){this.#e.abort(),this.#n&&=(this.#n.pause(),this.#n.removeAttribute(`src`),this.#n.load(),null),this.#i()}},ea=class e{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;#o=[];#s=!1;zIndex=0;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:a,structTreeLayer:o,commentManager:s,linkService:c,annotationStorage:l}){this.div=e,this.#e=t,this.#t=n,this.#i=o||null,this.#a=c||null,this.#n=l||new jt,this.page=i,this.viewport=a,this._annotationEditorUIManager=r,this._commentManager=s||null}hasEditableAnnotations(){return this.#r.size>0}async render(e){let{annotations:t,optionalContentConfig:n}=e,r=this.div;Je(r,this.viewport);let i=new Map,a=[],o={data:null,layer:r,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:e.renderForms!==!1,svgFactory:new Si,annotationStorage:this.#n,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===k.POPUP;if(t){let t=i.get(e.id);if(!t)continue;if(!this._commentManager){a.push(e);continue}o.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;o.data=e;let r=Ei.create(o);if(!r.isRenderable)continue;t||(this.#o.push(r),e.popupRef&&i.getOrInsertComputed(e.popupRef,we).push(r));let s=r.render();e.hidden&&(s.style.visibility=`hidden`),r.updateOC(n),r._isEditable&&(this.#r.set(r.data.id,r),this._annotationEditorUIManager?.renderAnnotationElement(r))}await this.#c();for(let e of a){let t=o.elements=i.get(e.id);o.data=e;let n=Ei.create(o);if(!n.isRenderable)continue;let r=n.render();n.contentElement.id=`${C}${e.id}`,e.hidden&&(r.style.visibility=`hidden`),t.at(-1).container.after(r)}this.#l()}async#c(){if(this.#o.length===0)return;this.div.replaceChildren();let e=[];if(!this.#s){this.#s=!0;for(let{contentElement:t,data:{hidden:n,id:r,oc:i}}of this.#o){let a=t.id=`${C}${r}`,o=t.localName===`a`&&!n&&!i;e.push(this.#i?.getAriaAttributes(a,{enableLinkOwnership:o}).then(e=>{if(e)for(let[n,r]of e)t.setAttribute(n,r)}))}}this.#o.sort(({data:{rect:[e,t,n,r]}},{data:{rect:[i,a,o,s]}})=>{if(e===n&&t===r)return 1;if(i===o&&a===s)return-1;let c=r,l=t,u=(t+r)/2,d=s,f=a,p=(a+s)/2;return u>=d&&p<=l?-1:p>=c&&u<=f?1:(e+n)/2-(i+o)/2});let t=document.createDocumentFragment();for(let e of this.#o)t.append(e.container),this._commentManager?(e.extraPopupElement?.popup||e.popup)?.renderCommentButton():e.extraPopupElement&&t.append(e.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),this.#e){let e=await this.#i?.getAnnotationIds();for(let{contentElement:t}of this.#o)e?.has(t.id)||this.#e.addPointerInTextLayer(t,!1)}}async addLinkAnnotations(t){let n={data:null,layer:this.div,linkService:this.#a,svgFactory:new Si,parent:this};for(let r of t){r.borderStyle||=e._defaultBorderStyle,n.data=r;let t=Ei.create(n);t.isRenderable&&(t.render(),t.contentElement.id=`${C}${r.id}`,this.#o.push(t))}await this.#c()}update({viewport:e,optionalContentConfig:t}){let n=this.div;this.viewport=e,Je(n,{rotation:e.rotation});for(let e of this.#o)e.updateOC(t);this.#l(),n.hidden=!1}destroy(){for(let e of this.#o)e.destroy?.(),this.#e?.removePointerInTextLayer(e.contentElement);this.#o.length=0,this.#r.clear(),this.div.replaceChildren()}#l(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;if(Array.isArray(n))for(let e of n)e.className=`annotationContent`,e.ariaHidden=!0;else n.className=`annotationContent`,n.ariaHidden=!0;let i=[];for(let e of r.children)e.nodeName===`CANVAS`&&i.push(e);for(let e of i)e.remove();let a=Array.isArray(n)?n[0]:n,{firstChild:o}=r;if(o?o.classList.contains(`annotationContent`)?o.after(a):o.before(a):r.append(a),Array.isArray(n)){let e=a;for(let t=1,r=n.length;t<r;t++)e.after(n[t]),e=n[t]}this.#t.delete(t);let s=this.#r.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,r.id,n),s._hasNoCanvas=!1):s.canvas=n)}}refreshCanvases(){this.#l()}getEditableAnnotations(){return this.#r.values()}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:r}=e,i=new Di({data:{id:n,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n});return i.render(),i.contentElement.id=`${C}${n}`,i.createOrUpdatePopup(),this.#o.push(i),i}removeAnnotation(e){let t=this.#o.findIndex(t=>t.data.id===e);if(t<0)return;let[n]=this.#o.splice(t,1);this.#e?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);this.#c()}}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}static get _defaultBorderStyle(){return L(this,`_defaultBorderStyle`,Object.freeze({width:1,rawWidth:1,style:te.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},ta=/\r\n?|\n/g,na=class e extends W{#e=``;#t=`${this.id}-editor`;#n=null;#r;_colorPicker=null;static _freeTextDefaultContent=``;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.isEmpty(),r=vt.TRANSLATE_SMALL,i=vt.TRANSLATE_BIG;return L(this,`_keyboardManager`,new gt([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`],t.commitOrRemove],[[`Escape`],t.commitOrRemove],[[`ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`],t._translateEmpty,{args:[0,r],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t._translateEmpty,{args:[0,i],checker:n}]]))}static _type=`freetext`;static _editorType=T.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.color=t.color||e._defaultColor||W._defaultLineColor,this.#r=t.fontSize||e._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert(W._l10nAlert.freetext),this.canAddComment=!1}static initialize(e,t){W.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}static updateDefaultParams(t,n){switch(t){case E.FREETEXT_SIZE:e._defaultFontSize=n;break;case E.FREETEXT_COLOR:e._defaultColor=n}}updateParams(e,t){switch(e){case E.FREETEXT_SIZE:this.#i(t);break;case E.FREETEXT_COLOR:this.#a(t)}}static get defaultPropertiesToUpdate(){return[[E.FREETEXT_SIZE,e._defaultFontSize],[E.FREETEXT_COLOR,e._defaultColor||W._defaultLineColor]]}get propertiesToUpdate(){return[[E.FREETEXT_SIZE,this.#r],[E.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new _i(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return E.FREETEXT_COLOR}#i(e){let t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--total-scale-factor))`,this.translate(0,-(e-this.#r)*this.parentScale),this.#r=e,this.#s()},n=this.#r;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:E.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#a(e){let t=e=>{this.color=e,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:E.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let t=this.parentScale;return[-e._internalPadding*t,-(e._internalPadding+this.#r)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove(`enabled`),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute(`aria-activedescendant`),this.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener(`keydown`,this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener(`focus`,this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener(`blur`,this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener(`input`,this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener(`paste`,this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add(`enabled`),this.editorDiv.contentEditable=!1,this.div.setAttribute(`aria-activedescendant`,this.#t),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add(`freetextEditing`),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===``}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add(`freetextEditing`)),super.remove()}#o(){let t=[];this.editorDiv.normalize();let n=null;for(let r of this.editorDiv.childNodes)(n?.nodeType!==Node.TEXT_NODE||r.nodeName!==`BR`)&&(t.push(e.#c(r)),n=r);return t.join(`
47
+ `)}#s(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains(`hidden`);t.classList.remove(`hidden`),t.style.display=`hidden`,e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle(`hidden`,i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#e,t=this.#e=this.#o().trimEnd();if(e===t)return;let n=e=>{this.#e=e,e?(this.#l(),this._uiManager.rebuild(this),this.#s()):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#s()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key===`Enter`&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(t){e._keyboardManager.exec(this,t)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle(`freetextEditing`,this.isEmpty())}disableEditing(){this.editorDiv.setAttribute(`role`,`comment`),this.editorDiv.removeAttribute(`aria-multiline`)}enableEditing(){this.editorDiv.setAttribute(`role`,`textbox`),this.editorDiv.setAttribute(`aria-multiline`,!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement(`div`),this.editorDiv.className=`internal`,this.editorDiv.setAttribute(`id`,this.#t),this.editorDiv.setAttribute(`data-l10n-id`,`pdfjs-free-text2`),this.editorDiv.setAttribute(`data-l10n-attrs`,`default-content`),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement(`div`),this.overlayDiv.classList.add(`overlay`,`enabled`),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[n,r]=this.parentDimensions;if(this.annotationElementId){let{position:i}=this._initialData,[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);let[s,c]=this.pageDimensions,[l,u]=this.pageTranslation,d,f;switch(this.rotation){case 0:d=e+(i[0]-l)/s,f=t+this.height-(i[1]-u)/c;break;case 90:d=e+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[o,-a];break;case 180:d=e-this.width+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[-a,-o];break;case 270:d=e+(i[0]-l-this.height*c)/s,f=t+(i[1]-u-this.width*s)/c,[a,o]=[-o,a]}this.setAt(d*n,f*r,a,o)}else this._moveAfterPaste(e,t);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(ta,``)}editorDivPaste(t){let n=t.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]===`text/plain`)return;t.preventDefault();let i=e.#d(n.getData(`text`)||``).replaceAll(ta,`
48
+ `);if(!i)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!i.includes(`
49
+ `)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:s,startOffset:c}=o,l=[],u=[];if(s.nodeType===Node.TEXT_NODE){let t=s.parentElement;if(u.push(s.nodeValue.slice(c).replaceAll(ta,``)),t!==this.editorDiv){let n=l;for(let r of this.editorDiv.childNodes)r===t?n=u:n.push(e.#c(r))}l.push(s.nodeValue.slice(0,c).replaceAll(ta,``))}else if(s===this.editorDiv){let t=l,n=0;for(let r of this.editorDiv.childNodes)n++===c&&(t=u),t.push(e.#c(r))}this.#e=`${l.join(`
50
+ `)}${i}${u.join(`
51
+ `)}`,this.#l();let d=new Range,f=Math.sumPrecise(l.map(e=>e.length));for(let{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){let t=e.nodeValue.length;if(f<=t){d.setStart(e,f),d.setEnd(e,f);break}f-=t}a.removeAllRanges(),a.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),this.#e)for(let e of this.#e.split(`
52
+ `)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),this.editorDiv.append(t)}}#u(){return this.#e.replaceAll(`\xA0`,` `)}static#d(e){return e.replaceAll(` `,`\xA0`)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=e._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,r){let i=null;if(t instanceof zi){let{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o,popupRef:s,richText:c,contentsObj:l,creationDate:u,modificationDate:d},textContent:f,textPosition:p,parent:{page:{pageNumber:m}}}=t;if(!f?.length)return null;i=t={annotationType:T.FREETEXT,color:Array.from(n),fontSize:e,value:f.join(`
53
+ `),position:p,pageIndex:m-1,rect:r.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,popupRef:s,comment:l?.str||null,richText:c,creationDate:u,modificationDate:d}}let a=await super.deserialize(t,n,r);return a.#r=t.fontSize,a.color=B.makeHexColor(...t.color),a.#e=e.#d(t.value),a._initialData=i,t.comment&&a.setCommentData(t),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=W._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),n=Object.assign(super.serialize(e),{color:t,fontSize:this.#r,value:this.#u()});return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!this.#f(n)?null:(n.id=this.annotationElementId,n)}#f(e){let{value:t,fontSize:n,color:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(!t)return null;let{style:n}=t;n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,t.replaceChildren();for(let e of this.#e.split(`
54
+ `)){let n=document.createElement(`div`);n.append(e?document.createTextNode(e):document.createElement(`br`)),t.append(n)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#e}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},ra=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith(`_`)||this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){P(`Not implemented`)}},ia=class e extends W{#e=null;#t;_clipPathId=null;_colorPicker=null;_drawId=null;_drawOutlines=null;_focusDrawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=null;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(e){e.drawOutlines&&(this.#o(e),this.#m())}#o({drawOutlines:e,drawId:t,drawingOptions:n,clipPathId:r}){this._drawOutlines=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(W._l10nAlert[this.editorType]),t>=0?(this._drawId=t,this._clipPathId=r??null,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties),this.#c(this.parent)):this._drawId=this.#s(e,this.parent),this.#_(e.box)}#s(t,n){let{id:r,clipPathId:i}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,this.constructor._hasClipPath);return this.constructor._hasClipPath&&(this._clipPathId=i),this.#c(n),r}#c(e){let t=this._drawOutlines.getFocusSVGProperties(this.#f);t&&(this._focusDrawId=e.drawLayer.drawOutline(t,this._drawOutlines.focusMustRemoveSelfIntersections))}#l(e=this.#f){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,this._drawOutlines.getFocusSVGProperties(e))}#u(e){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,{rootClass:e})}#d(){let{parent:e,_drawId:t,_focusDrawId:n,_isVisible:r}=this;if(!e||t===null)return;let i={hidden:!r};e.drawLayer.updateProperties(t,{rootClass:i}),n!==null&&e.drawLayer.updateProperties(n,{rootClass:i})}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[r,i]of Object.entries(t))n.has(r)?Object.assign(e[r],i):e[r]=i;return e}static getDefaultDrawingOptions(e){P(`Not implemented`)}static get typesMap(){P(`Not implemented`)}static get isDrawer(){return!0}static get _hasClipPath(){return!1}static get _hasDrawClass(){return!0}static get supportMultipleDrawings(){return!1}get _drawRotation(){return this.rotation}get _opacityName(){return this.constructor.typesMap.get(this.opacityType)}get#f(){return(this.parentRotation-this._drawRotation+360)%360}static updateDefaultParams(t,n){let r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(e.#n.updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,r]of this.typesMap)e.push([n,t[r]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,r]of this.constructor.typesMap)e.push([n,t[r]]);return e}_updateProperty(e,t,n){let r=this._drawingOptions,i=r[t],a=n=>{r.updateProperty(t,n);let i=this._drawOutlines.updateProperty(t,n);i&&this.#_(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType?this.onUpdatedColor():e===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(e,t,n=this.colorAndOpacityType){let r=this.constructor.typesMap.get(this.colorType),i=this._opacityName,a=this._drawingOptions,o=a[r],s=a[i],c=(e,t)=>{a.updateProperty(r,e),a.updateProperty(i,t),this._drawOutlines.updateProperty(r,e),this._drawOutlines.updateProperty(i,t),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:c.bind(this,e,t),undo:c.bind(this,o,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizingSVGProperties(this.#g()),{bbox:this.#v()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizedSVGProperties(this.#g()),{bbox:this.#v()})),this.#l()}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#v()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathTranslatedSVGProperties(this.#g(),this.parentDimensions),{bbox:this.#v()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}get _mustBeDisabledOnCommit(){return!0}commit(){super.commit(),this._mustBeDisabledOnCommit&&(this.disableEditMode(),this.disableEditing())}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this._uiManager.removeShouldRescale(this),this.#p(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#m(),this.#_(this._drawOutlines.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#p()):e&&(this._uiManager.addShouldRescale(this),this.#m(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.#d(),t&&this.select()}#p(){if(this._drawId===null||!this.parent)return;let{drawLayer:e}=this.parent;e.remove(this._drawId),this._drawId=null,this._focusDrawId!==null&&(e.remove(this._focusDrawId),this._focusDrawId=null),this._drawingOptions.reset()}#m(e=this.parent){if(this._drawId===null||this.parent!==e){if(this._drawId!==null){let{drawLayer:t}=this.parent;t.updateParent(this._drawId,e.drawLayer),this._focusDrawId!==null&&t.updateParent(this._focusDrawId,e.drawLayer)}else this._drawingOptions.updateAll(),this._drawId=this.#s(this._drawOutlines,e),this._clipPathId&&this.#e&&(this.#e.style.clipPath=this._clipPathId)}}#h([e,t,n,r]){let{parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[t,1-e,a/i*n,i/a*r];case 180:return[1-e,1-t,n,r];case 270:return[1-t,e,a/i*n,i/a*r];default:return[e,t,n,r]}}#g(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[1-t,e,i/a*n,a/i*r];case 180:return[1-e,1-t,n,r];case 270:return[t,1-e,i/a*n,a/i*r];default:return[e,t,n,r]}}#_(e){[this.x,this.y,this.width,this.height]=this.#h(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#v(e=this.parentRotation){let{x:t,y:n,width:r,height:i,_drawRotation:a,parentDimensions:[o,s]}=this;switch((a*4+e)/90){case 1:return[1-n-i,t,i,r];case 2:return[1-t-r,1-n-i,r,i];case 3:return[n,1-t-r,i,r];case 4:return[t,n-o/s*r,s/o*i,o/s*r];case 5:return[1-n,t,o/s*r,s/o*i];case 6:return[1-t-s/o*i,1-n,s/o*i,o/s*r];case 7:return[n-o/s*r,1-t-s/o*i,o/s*r,s/o*i];case 8:return[t-r,n-i,r,i];case 9:return[1-n,t-r,i,r];case 10:return[1-t,1-n,r,i];case 11:return[n-i,1-t,i,r];case 12:return[t-s/o*i,n,s/o*i,o/s*r];case 13:return[1-n-o/s*r,t-s/o*i,o/s*r,s/o*i];case 14:return[1-t,1-n-o/s*r,s/o*i,o/s*r];case 15:return[n,1-t,o/s*r,s/o*i];default:return[t,n,r,i]}}rotate(t=this.parentRotation){if(!this.parent||this._drawId===null)return;let n=(t-this._drawRotation+360)%360;this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#v(t)},this._drawOutlines.updateRotation(n))),this.#l(n)}show(e=this._isVisible){super.show(e),this.#d()}select(){super.select(),this.#u({hovered:!1,selected:!0})}unselect(){super.unselect(),this.#u({selected:!1})}pointerover(){this.isSelected||this.#u({hovered:!0})}pointerleave(){this.isSelected||this.#u({hovered:!1})}onScaleChanging(){if(!this.parent)return;let e=this._drawOutlines.updateParentDimensions(this.parentDimensions,this.parent.scale);e&&this.#_(e)}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();this.constructor._hasDrawClass&&n.classList.add(`draw`);let r=this.#e=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this._clipPathId&&(r.style.clipPath=this._clipPathId),dt(this,r,[`pointerover`,`pointerleave`]),this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e){P(`Not implemented`)}static _getDrawingTarget(e,{target:t}){return t}static _getPointerCoords({offsetX:e,offsetY:t,clientX:n,clientY:r},i=null){if(!i)return[e,t];let a=n-i.clientX,o=r-i.clientY;switch(this._currentParent.viewport.rotation){case 90:[a,o]=[o,-a];break;case 180:[a,o]=[-a,-o];break;case 270:[a,o]=[-o,a]}return[i.offsetX+a,i.offsetY+o]}static _addDrawingListeners(e,t){}static _endDrawingSession(e=!1){return this._currentParent.endDrawingSession(e)}static startDrawing(t,n,r,i){let{pointerId:a,pointerType:o}=i;if(ft.isInitializedAndDifferentPointerType(o))return;let s=this._getDrawingTarget(t,i),[c,l]=this._getPointerCoords(i),{viewport:{rotation:u}}=t,{x:d,y:f,width:p,height:m}=s.getBoundingClientRect(),h=e.#r=new AbortController,g=t.combinedSignal(h);if(ft.setPointer(o,a),window.addEventListener(`pointerup`,e=>{ft.isSamePointerIdOrRemove(e.pointerId)&&this._endDraw(e)},{signal:g}),window.addEventListener(`pointercancel`,e=>{ft.isSamePointerIdOrRemove(e.pointerId)&&this._endDrawingSession()},{signal:g}),window.addEventListener(`pointerdown`,t=>{ft.isSamePointerType(t.pointerType)&&(ft.initializeAndAddPointerId(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener(`contextmenu`,He,{signal:g}),s.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:g}),s.addEventListener(`touchmove`,e=>{ft.isSameTimeStamp(e.timeStamp)&&H(e)},{signal:g}),this._addDrawingListeners(s,g),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n){t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(c,l,p,m,u));return}n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance({x:c,y:l,box:[d,f,p,m],rotation:u,parent:t,isLTR:r}),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t;let{id:_,clipPathId:v}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,this._hasClipPath);this._currentDrawId=_,e.#a=this._hasClipPath?v:null}static _drawMove(t){if(ft.isSameTimeStamp(t.timeStamp),!e.#n||!ft.isSamePointerId(t.pointerId))return;if(ft.isUsingMultiplePointers()){this._endDraw(t);return}let n,r=t.getCoalescedEvents?.();if(r?.length){let i=[];for(let e of r)i.push(...this._getPointerCoords(e,t));n=e.#n.addPoints(i)}else n=e.#n.add(...this._getPointerCoords(t));this._currentParent.drawLayer.updateProperties(this._currentDrawId,n),ft.setTimeStamp(t.timeStamp),H(t)}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#a=null,ft.clearTimeStamp()),e.#r&&(e.#r.abort(),e.#r=null,ft.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),n.drawLayer.updateProperties(this._currentDrawId,t?.target===n.div?e.#n.end(...this._getPointerCoords(t)):e.#n.end()),this.supportMultipleDrawings){let t=e.#n,r=this._currentDrawId,i=t.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,t.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,t.removeLastElement())},mustExec:!1,type:E.DRAW_STEP})}else this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(E.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,clipPathId:e.#a,drawOutlines:e.#n.getOutlines(r*a,i*a,a,this._INNER_MARGIN),drawingOptions:e.#i,mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,r,i,a,o){P(`Not implemented`)}static async deserialize(e,t,n){let{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=t.viewport,s=this.deserializeDraw(a,o,r,i,this._INNER_MARGIN,e,n),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#o({drawOutlines:s}),c.#m(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this._drawOutlines.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},J=class{static PRECISION=1e-4;focusOutline=null;toSVGPath(){P("Abstract method `toSVGPath` must be implemented.")}get box(){P("Abstract getter `box` must be implemented.")}serialize(e,t){P("Abstract method `serialize` must be implemented.")}get defaultSVGProperties(){P("Abstract getter `defaultSVGProperties` must be implemented.")}get defaultProperties(){return this.defaultSVGProperties}getFocusSVGProperties(e){return null}get focusMustRemoveSelfIntersections(){return!1}updateProperty(e,t){return null}updateParentDimensions(e,t){return null}serializeQuadPoints(e,t){return null}updateRotation(e){return{}}getPathResizingSVGProperties(e){return{}}getPathResizedSVGProperties(e){return{}}getPathTranslatedSVGProperties(e,t){return{}}static _rotateBox([e,t,n,r],i){switch(i){case 90:return[1-t-r,e,r,n];case 180:return[1-e-n,1-t-r,n,r];case 270:return[t,1-e-n,r,n]}return[e,t,n,r]}static _rescale(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o]*r,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o+1]*r,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,r){r||=new Float32Array(e.length);for(let i=0,a=e.length;i<a;i+=2)r[i]=t+e[i],r[i+1]=n+e[i+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,r,i){switch(i){case 90:return[1-t/n,e/r];case 180:return[1-e/n,1-t/r];case 270:return[t/n,1-e/r];default:return[e/n,t/r]}}static createBezierPoints(e,t,n,r,i,a){return[(e+5*n)/6,(t+5*r)/6,(5*n+i)/6,(5*r+a)/6,(n+i)/2,(r+a)/2]}},aa=class e{#e;#t=[];#n;#r;#i=[];#a=new Float32Array(18);#o;#s;#c;#l;#u;#d;#f=[];static#p=8;static#m=2;static#h=e.#p+e.#m;constructor(t,n,r,i,a,o,s=0){this.#e=r,this.#d=a*i,this.#r=o,this.#a.set([NaN,NaN,NaN,NaN,t,n],6),this.#n=s,this.#l=e.#p*i,this.#c=e.#h*i,this.#u=i,this.#f.push(t,n)}isEmpty(){return isNaN(this.#a[8])}isCancellable(){return this.#f.length<=10}removeLastElement(){return this.#a.fill(NaN),this.#i.length=this.#t.length=this.#f.length=0,{path:{d:``}}}#g(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,r,i,a]=this.#e;return[(this.#o+(e[0]-t[0])/2-n)/i,(this.#s+(e[1]-t[1])/2-r)/a,(this.#o+(t[0]-e[0])/2-n)/i,(this.#s+(t[1]-e[1])/2-r)/a]}add(e,t){this.#o=e,this.#s=t;let[n,r,i,a]=this.#e,[o,s,c,l]=this.#a.subarray(8,12),u=e-c,d=t-l,f=Math.hypot(u,d);if(f<this.#c)return!1;let p=f-this.#l,m=p/f,h=m*u,g=m*d,_=o,v=s;o=c,s=l,c+=h,l+=g,this.#f?.push(e,t);let y=-g/p,b=h/p,x=y*this.#d,S=b*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,l+S],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,l-S],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+x,s+S],2),this.#i.push(NaN,NaN,NaN,NaN,(o+x-n)/i,(s+S-r)/a),this.#a.set([o-x,s-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-x-n)/i,(s-S-r)/a)),this.#a.set([_,v,o,s,c,l],6),!this.isEmpty()):(this.#a.set([_,v,o,s,c,l],6),Math.abs(Math.atan2(v-s,_-o)-Math.atan2(g,h))<Math.PI/2?([o,s,c,l]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((s+l)/2-r)/a),[o,s,_,v]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((_+o)/2-n)/i,((v+s)/2-r)/a),!0):([_,v,o,s,c,l]=this.#a.subarray(0,6),this.#i.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),[c,l,o,s,_,v]=this.#a.subarray(12,18),this.#t.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return``;let e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#_();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#y(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#v(n),n.join(` `)}#_(){let[e,t,n,r]=this.#e,[i,a,o,s]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/r} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/r} L${i} ${a} L${o} ${s} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/r} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/r} Z`}#v(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,r,i]=this.#e,a=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[s,c,l,u]=this.#g();e.push(`L${(a[0]-t)/r} ${(a[1]-n)/i} L${s} ${c} L${l} ${u} L${(o[0]-t)/r} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,r,i,a){return new oa(e,t,n,r,i,a)}getOutlines(){let e=this.#i,t=this.#t,n=this.#a,[r,i,a,o]=this.#e,s=new Float32Array((this.#f?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#f[e]-r)/a,s[e+1]=(this.#f[e+1]-i)/o;if(s[s.length-2]=(this.#o-r)/a,s[s.length-1]=(this.#s-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#b(s);let c=new Float32Array(this.#i.length+24+this.#t.length),l=e.length;for(let t=0;t<l;t+=2)isNaN(e[t])?c[t]=c[t+1]=NaN:(c[t]=e[t],c[t+1]=e[t+1]);l=this.#S(c,l);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2)isNaN(t[e+n])?(c[l]=c[l+1]=NaN,l+=2):(c[l]=t[e+n],c[l+1]=t[e+n+1],l+=2);return this.#x(c,l),this.newFreeDrawOutline(c,s,this.#e,this.#u,this.#n,this.#r)}#b(e){let t=this.#a,[n,r,i,a]=this.#e,[o,s,c,l]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-r)/a],0),this.newFreeDrawOutline(u,e,this.#e,this.#u,this.#n,this.#r)}#x(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#S(e,t){let n=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[i,a,o,s]=this.#e,[c,l,u,d]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/s],t),t+=24}},oa=class extends J{#e;#t=new Float32Array(4);#n;#r;#i;#a;#o;constructor(e,t,n,r,i,a){super(),this.#o=e,this.#i=t,this.#e=n,this.#a=r,this.#n=i,this.#r=a,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#s(a);let[o,s,c,l]=this.#t;for(let t=0,n=e.length;t<n;t+=2)e[t]=(e[t]-o)/c,e[t+1]=(e[t+1]-s)/l;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-o)/c,t[e+1]=(t[e+1]-s)/l}toSVGPath(){let e=[`M${this.#o[4]} ${this.#o[5]}`];for(let t=6,n=this.#o.length;t<n;t+=6)isNaN(this.#o[t])?e.push(`L${this.#o[t+4]} ${this.#o[t+5]}`):e.push(`C${this.#o[t]} ${this.#o[t+1]} ${this.#o[t+2]} ${this.#o[t+3]} ${this.#o[t+4]} ${this.#o[t+5]}`);return e.push(`Z`),e.join(` `)}serialize([e,t,n,r],i){let a=n-e,o=r-t,s,c;switch(i){case 0:s=J._rescale(this.#o,e,r,a,-o),c=J._rescale(this.#i,e,r,a,-o);break;case 90:s=J._rescaleAndSwap(this.#o,e,t,a,o),c=J._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=J._rescale(this.#o,n,t,-a,o),c=J._rescale(this.#i,n,t,-a,o);break;case 270:s=J._rescaleAndSwap(this.#o,n,r,-a,-o),c=J._rescaleAndSwap(this.#i,n,r,-a,-o)}return{outline:Array.from(s),points:[Array.from(c)]}}#s(e){let t=this.#o,n=t[4],r=t[5],i=[n,r,n,r],a=n,o=r,s=n,c=r,l=e?Math.max:Math.min,u=new Float32Array(4);for(let e=6,d=t.length;e<d;e+=6){let d=t[e+4],f=t[e+5];isNaN(t[e])?(B.pointBoundingBox(d,f,i),o>f?(a=d,o=f):o===f&&(a=l(a,d)),c<f?(s=d,c=f):c===f&&(s=l(s,d))):(u.set(_,0),B.bezierBoundingBox(n,r,...t.slice(e,e+6),u),B.rectBoundingBox(...u,i),o>u[1]?(a=u[0],o=u[1]):o===u[1]&&(a=l(a,u[0])),c<u[3]?(s=u[2],c=u[3]):c===u[3]&&(s=l(s,u[2]))),n=d,r=f}let d=this.#t;d[0]=i[0]-this.#n,d[1]=i[1]-this.#n,d[2]=i[2]-i[0]+2*this.#n,d[3]=i[3]-i[1]+2*this.#n,this.firstPoint=[a,o],this.lastPoint=[s,c]}get box(){return this.#t}newOutliner(e,t,n,r,i,a,o=0){return new aa(e,t,n,r,i,a,o)}updateThickness(e){let t=this.getNewOutline(e);return this.#o=t.#o,this.#i=t.#i,this.#t.set(t.#t),this.firstPoint=t.firstPoint,this.lastPoint=t.lastPoint,this.#t}getNewOutline(e,t){let[n,r,i,a]=this.#t,[o,s,c,l]=this.#e,u=i*c,d=a*l,f=n*c+o,p=r*l+s,m=this.#i,h=this.newOutliner(m[0]*u+f,m[1]*d+p,this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2,t=m.length;e<t;e+=2)h.add(m[e]*u+f,m[e+1]*d+p);return h.getOutlines()}};function sa(e){return{bbox:e.box,root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:e.isFree},path:{d:e.toSVGPath()}}}function ca(e,t){let{focusOutline:n}=e;return{bbox:J._rotateBox(n.box,t),root:{"data-main-rotation":t},rootClass:{highlightOutline:!0,free:e.isFree},path:{d:n.toSVGPath()}}}var la=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=_.slice(),a=10**-4;for(let{x:n,y:r,width:o,height:s}of e){let e=Math.floor((n-t)/a)*a,c=Math.ceil((n+o+t)/a)*a,l=Math.floor((r-t)/a)*a,u=Math.ceil((r+s+t)/a)*a,d=[e,l,u,!0],f=[c,l,u,!1];this.#r.push(d,f),B.rectBoundingBox(e,l,c,u,i)}let o=i[2]-i[0]+2*n,s=i[3]-i[1]+2*n,c=i[0]-n,l=i[1]-n,u=r?-1/0:1/0,d=1/0,f=this.#r.at(r?-1:-2),p=[f[0],f[2]];for(let e of this.#r){let[t,n,i,a]=e;!a&&r?n<d?(d=n,u=t):n===d&&(u=Math.max(u,t)):a&&!r&&(n<d?(d=n,u=t):n===d&&(u=Math.min(u,t))),e[0]=(t-c)/o,e[1]=(n-l)/s,e[2]=(i-l)/s}this.#e=new Float32Array([c,l,o,s]),this.#t=[u,d],this.#n=p}getOutlines(){this.#r.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);let e=[];for(let t of this.#r)t[3]?(e.push(...this.#l(t)),this.#s(t)):(this.#c(t),e.push(...this.#l(t)));return this.#a(e)}#a(e){let t=[],n=new Set;for(let n of e){let[e,r,i]=n;t.push([e,r,n],[e,i,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,r=t.length;e<r;e+=2){let r=t[e][2],i=t[e+1][2];r.push(i),i.push(r),n.add(r),n.add(i)}let r=[];for(;n.size>0;){let e=n.values().next().value,[t,i,a,o,s]=e;n.delete(e);let c=t,l=i,u=[t,a];for(r.push(u);;){let e;if(n.has(o))e=o;else if(n.has(s))e=s;else break;n.delete(e),[t,i,a,o,s]=e,c!==t&&(u.push(c,l,t,l===i?i:a),c=t),l=l===i?a:i}u.push(c,l)}return new ua(r,this.#e,this.#t,this.#n)}#o(e){let t=this.#i,n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:r=i-1}return r+1}#s([,e,t]){let n=this.#o(e);this.#i.splice(n,0,[e,t])}#c([,e,t]){let n=this.#o(e);for(let r=n;r<this.#i.length;r++){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}}#l(e){let[t,n,r]=e,i=[[t,n,r]],a=this.#o(r);for(let e=0;e<a;e++){let[n,r]=this.#i[e];for(let e=0,a=i.length;e<a;e++){let[,o,s]=i[e];if(!(r<=o||s<=n)){if(o>=n){if(s>r)i[e][1]=r;else{if(a===1)return[];i.splice(e,1),e--,a--}}else i[e][2]=n,s>r&&i.push([t,r,s])}}}return i}},ua=class extends J{#e;#t=null;#n;constructor(e,t,n,r){super(),this.#n=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}static build(e,t){let n=new la(e,.001).getOutlines();return n.#t=e,n.focusOutline=new la(e,.0025,.001,t).getOutlines(),n}get isFree(){return!1}get defaultSVGProperties(){return sa(this)}getFocusSVGProperties(e){return ca(this,e)}updateRotation(e){return{root:{"data-main-rotation":e}}}serializeQuadPoints([e,t],[n,r]){let i=this.#t,a=new Float32Array(i.length*8),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*n+e,d=(1-c)*r+t;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*n,a[o+5]=a[o+7]=d-u*r,o+=8}return a}toSVGPath(){let e=[];for(let t of this.#n){let[n,r]=t;e.push(`M${n} ${r}`);for(let i=2;i<t.length;i+=2){let a=t[i],o=t[i+1];a===n?(e.push(`V${o}`),r=o):o===r&&(e.push(`H${a}`),n=a)}e.push(`Z`)}return e.join(` `)}serialize([e,t,n,r],i){let a=[],o=n-e,s=r-t;for(let t of this.#n){let n=Array(t.length);for(let i=0;i<t.length;i+=2)n[i]=e+t[i]*o,n[i+1]=r-t[i+1]*s;a.push(n)}return a}get box(){return this.#e}},da=class extends aa{newFreeDrawOutline(e,t,n,r,i,a){return new pa(e,t,n,r,i,a)}},fa=class{#e;#t;constructor(e,t,n,r,i,a,o){this.#e=new da(e,t,n,r,i,a,o),this.#t=i}add(e,t){return this.#e.add(e,t)?{path:{d:this.#e.toSVGPath()}}:null}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)t=this.#e.add(e[n],e[n+1])||t;return t?{path:{d:this.#e.toSVGPath()}}:null}end(e,t){return e===void 0?null:this.add(e,t)}isEmpty(){return this.#e.isEmpty()}isCancellable(){return this.#e.isCancellable()}removeLastElement(){return this.#e.removeLastElement()}updateProperty(e,t){return null}getOutlines(){let e=this.#e.getOutlines();return e.buildFocusOutline(2*this.#t),e}get defaultSVGProperties(){return{bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:!0},path:{d:this.#e.toSVGPath()}}}},pa=class e extends oa{static#e=1.5;newOutliner(e,t,n,r,i,a,o=0){return new da(e,t,n,r,i,a,o)}get isFree(){return!0}buildFocusOutline(t){this.focusOutline=this.getNewOutline(t/2+e.#e,.0025)}get defaultSVGProperties(){return sa(this)}getFocusSVGProperties(e){return ca(this,e)}get focusMustRemoveSelfIntersections(){return!0}updateRotation(e){return{root:{"data-main-rotation":e}}}updateProperty(e,t){if(e!==`thickness`)return null;let n=this.updateThickness(t/2);return this.buildFocusOutline(t),n}getPathResizedSVGProperties(){return{path:{d:this.toSVGPath()}}}},ma=class e extends ra{constructor(e=null){super(),super.updateProperties(e)}updateSVGProperty(e,t){e!==`thickness`&&super.updateSVGProperty(e,t)}clone(){let t=new e;return t.updateAll(this),t}},ha=class e extends ia{#e=null;#t=0;#n=null;#r=0;#i=``;#a=``;static _DEFAULT_OPACITY=1;static _DEFAULT_THICKNESS=12;static _defaultDrawingOptions=null;static _type=`highlight`;static _editorType=T.HIGHLIGHT;static get _keyboardManager(){let t=e.prototype;return L(this,`_keyboardManager`,new gt([[[`ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:`highlightEditor`}),this.#e=e.anchorNode||null,this.#t=e.anchorOffset||0,this.#n=e.focusNode||null,this.#r=e.focusOffset||0,this.#i=e.methodOfCreation||(this._drawOutlines?.isFree?`main_toolbar`:``),this.#a=e.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,this.rotate()}static initialize(t,n){W.initialize(t,n),this._defaultDrawingOptions||=new ma({fill:n.highlightColors?.values().next().value||`#fff066`,"fill-opacity":e._DEFAULT_OPACITY,thickness:e._DEFAULT_THICKNESS})}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get typesMap(){return L(this,`typesMap`,new Map([[E.HIGHLIGHT_COLOR,`fill`],[E.HIGHLIGHT_THICKNESS,`thickness`]]))}static get isDrawer(){return!1}static get _hasClipPath(){return!0}static get _hasDrawClass(){return!1}_addOutlines(t){let{boxes:n,drawOutlines:r}=t;(n||r)&&(this._drawingOptions||=t.drawingOptions||e.getDefaultDrawingOptions(),n&&(t={...t,drawOutlines:ua.build(n,this._uiManager.direction===`ltr`)}),super._addOutlines(t))}get colorType(){return E.HIGHLIGHT_COLOR}get color(){return this._drawingOptions.fill}get opacity(){return this._drawingOptions[`fill-opacity`]}get _opacityName(){return`fill-opacity`}get _drawRotation(){return this._drawOutlines?.isFree?this.rotation:0}get isResizable(){return!1}get _mustBeDisabledOnCommit(){return!1}get _mustFixPosition(){return!this._drawOutlines?.isFree}get telemetryInitialData(){return{action:`added`,type:this._drawOutlines.isFree?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this._drawingOptions.thickness,methodOfCreation:this.#i}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}translateInPage(e,t){}get toolbarPosition(){return this.#o(this._drawOutlines.focusOutline.lastPoint)}get commentButtonPosition(){return this.#o(this._drawOutlines.firstPoint)}#o([e,t]){let[n,r,i,a]=this._drawOutlines.box;return[(e-n)/i,(t-r)/a]}updateParams(t,n){switch(t){case E.HIGHLIGHT_COLOR:this._updateColorAndOpacity(n,e._DEFAULT_OPACITY,t),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(n)},!0);break;case E.HIGHLIGHT_THICKNESS:super.updateParams(t,n),this._reportTelemetry({action:`thickness_changed`,thickness:n},!0)}}get propertiesToUpdate(){let e=super.propertiesToUpdate;return e.push([E.HIGHLIGHT_FREE,this._drawOutlines.isFree]),e}get toolbarButtons(){return this._uiManager.highlightColors?(this._colorPicker=new gi({editor:this}),[[`colorPicker`,this._colorPicker]]):super.toolbarButtons}fixAndSetPosition(){return super.fixAndSetPosition(this._drawRotation)}getRect(e,t){return super.getRect(e,t,this._drawRotation)}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this._reportTelemetry({action:`deleted`}),super.remove()}render(){if(this.div)return this.div;let e=super.render();return this.#a&&(e.setAttribute(`aria-label`,this.#a),e.setAttribute(`role`,`mark`)),this._drawOutlines.isFree?e.classList.add(`free`):e.addEventListener(`keydown`,this.#s.bind(this),{signal:this._uiManager._signal}),this.enableEditing(),e}#s(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#c(!0);break;case 1:case 3:this.#c(!1)}}#c(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#n,this.#r)}unselect(){super.unselect(),this._drawOutlines.isFree||this.#c(!1)}static createDrawerInstance({x:e,y:t,box:n,parent:r,isLTR:i}){return new fa(e,t,n,r.scale,this._defaultDrawingOptions.thickness/2,i,.001)}static _getDrawingTarget(e,{target:t}){return t.closest(`.textLayer`)}static _getPointerCoords({x:e,y:t}){return[e,t]}static _addDrawingListeners(e,t){e.classList.add(`free`),t.addEventListener(`abort`,()=>e.classList.remove(`free`),{once:!0}),window.addEventListener(`blur`,()=>this._endDraw(null),{signal:t}),window.addEventListener(`pointerdown`,H,{capture:!0,passive:!1,signal:t})}static _endDrawingSession(e=!1){return this.endDrawing(e)}createDrawingOptions({color:t,opacity:n,thickness:r}){let{_defaultDrawingOptions:i,_DEFAULT_OPACITY:a}=e;this._drawingOptions=e.getDefaultDrawingOptions({fill:B.makeHexColor(...t),"fill-opacity":n||a,thickness:r||i.thickness})}static deserializeDraw(e,t,n,r,i,a,o){let{quadPoints:s}=a;if(s){let i=[];for(let a=0,o=s.length;a<o;a+=8)i.push({x:(s[a]-e)/n,y:1-(s[a+1]-t)/r,width:(s[a+2]-s[a])/n,height:(s[a+1]-s[a+5])/r});return ua.build(i,o.direction===`ltr`)}let c=a.thickness||this._defaultDrawingOptions.thickness,l=(a.inkLists||a.outlines.points)[0],u=new da(l[0]-e,r-(l[1]-t),[0,0,n,r],1,c/2,!0,.001);for(let n=0,i=l.length;n<i;n+=2)u.add(l[n]-e,r-(l[n+1]-t));let d=u.getOutlines();return d.buildFocusOutline(c),d}static async deserialize(e,t,n){let r=null;if(e instanceof qi){let{data:{quadPoints:t,rect:n,rotation:i,id:a,color:o,opacity:s,popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:T.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}else if(e instanceof Ki){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,borderStyle:{rawWidth:s},popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:T.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=super.serialize(e);return Object.assign(t,{color:W._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),opacity:this.opacity,thickness:this._drawingOptions.thickness,quadPoints:this._drawOutlines.serializeQuadPoints(this.pageTranslation,this.pageDimensions),outlines:this._drawOutlines.serialize(t.rect,this._drawRotation)}),this.addComment(t),this.annotationElementId&&!this.#l(t)?null:(t.id=this.annotationElementId,t)}#l(e){let{color:t}=this._initialData;return this.hasEditedComment||e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},ga=class{#e=new Float64Array(6);#t=new Float64Array(2);#n;#r;#i;#a;#o;#s=``;#c=0;#l=new _a;#u;#d;constructor(e,t,n,r,i,a){this.#u=n,this.#d=r,this.#i=i,this.#a=a,[e,t]=this.#f(e,t);let o=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#r=[{line:o,points:this.#o}],this.#e.set(o,0),this.#t.set([e,t],0)}updateProperty(e,t){e===`stroke-width`&&(this.#a=t)}#f(e,t){return J._normalizePoint(e,t,this.#u,this.#d,this.#i)}isEmpty(){return!this.#r?.length}isCancellable(){return this.#o.length<=10}add(e,t){return this.#p(e,t)&&this.toSVGPath(),{path:{d:this.#m()}}}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)this.#p(e[n],e[n+1])&&(t=!0,this.#o.length<=6&&(this.toSVGPath(),t=!1));return t&&this.toSVGPath(),{path:{d:this.#m()}}}#p(e,t){[e,t]=this.#f(e,t),this.#t.set([e,t],0);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#u*o,this.#d*s)<=2?!1:(this.#o.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#n.push(NaN,NaN,NaN,NaN,e,t),!0):(isNaN(this.#e[0])&&this.#n.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#n.push(...J.createBezierPoints(n,r,i,a,e,t)),!0))}end(e,t){return e!==void 0&&this.#p(e,t)||this.#o.length===2?{path:{d:this.toSVGPath()}}:{path:{d:this.#s}}}startNew(e,t,n,r,i){this.#u=n,this.#d=r,this.#i=i,[e,t]=this.#f(e,t);let a=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#t.set([e,t],0);let o=this.#r.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#r.push({line:a,points:this.#o}),this.#e.set(a,0),this.#c=0,this.toSVGPath(),null}getLastElement(){return this.#r.at(-1)}setLastElement(e){return this.#r?(this.#r.push(e),this.#n=e.line,this.#o=e.points,this.#c=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(e)}removeLastElement(){if(!this.#r)return this.#l.removeLastElement();this.#r.pop(),this.#s=``;for(let e=0,t=this.#r.length;e<t;e++){let{line:t,points:n}=this.#r[e];this.#n=t,this.#o=n,this.#c=0,this.toSVGPath()}return{path:{d:this.#s}}}#m(){let e=J.svgRound(this.#t[0]),t=J.svgRound(this.#t[1]);if(this.#o.length===2){let n=J.svgRound(this.#n[4]),r=J.svgRound(this.#n[5]);return`${this.#s} M ${n} ${r} L ${e} ${t}`}return`${this.#s} L ${e} ${t}`}toSVGPath(){let e=J.svgRound(this.#n[4]),t=J.svgRound(this.#n[5]);if(this.#o.length===2)return this.#s=`${this.#s} M ${e} ${t} Z`,this.#s;if(this.#o.length<=6){let n=this.#s.lastIndexOf(`M`);this.#s=`${this.#s.slice(0,n)} M ${e} ${t}`,this.#c=6}if(this.#o.length===4){let e=J.svgRound(this.#n[10]),t=J.svgRound(this.#n[11]);return this.#s=`${this.#s} L ${e} ${t}`,this.#c=12,this.#s}let n=[];this.#c===0&&(n.push(`M ${e} ${t}`),this.#c=6);for(let e=this.#c,t=this.#n.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#n.slice(e,e+6).map(J.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#s+=n.join(` `),this.#c=this.#n.length,this.#s}getOutlines(e,t,n,r){let i=this.#r.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#l.build(this.#r,e,t,n,this.#i,this.#a,r),this.#e=null,this.#n=null,this.#r=null,this.#s=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},_a=class extends J{#e;#t=0;#n;#r;#i;#a;#o;#s;#c;build(e,t,n,r,i,a,o){this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a,this.#n=o??0,this.#r=e,this.#d()}get thickness(){return this.#c}setLastElement(e){return this.#r.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#r.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#r)if(e.push(`M${J.svgRound(t[4])} ${J.svgRound(t[5])}`),t.length===6)e.push(`Z`);else if(t.length===12&&isNaN(t[6]))e.push(`L${J.svgRound(t[10])} ${J.svgRound(t[11])}`);else for(let n=6,r=t.length;n<r;n+=6){let[r,i,a,o,s,c]=t.subarray(n,n+6).map(J.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}return e.join(``)}serialize([e,t,n,r],i){let a=[],o=[],[s,c,l,u]=this.#u(),d,f,p,m,h,g,_,v,y;switch(this.#s){case 0:y=J._rescale,d=e,f=t+r,p=n,m=-r,h=e+s*n,g=t+(1-c-u)*r,_=e+(s+l)*n,v=t+(1-c)*r;break;case 90:y=J._rescaleAndSwap,d=e,f=t,p=n,m=r,h=e+c*n,g=t+s*r,_=e+(c+u)*n,v=t+(s+l)*r;break;case 180:y=J._rescale,d=e+n,f=t,p=-n,m=r,h=e+(1-s-l)*n,g=t+c*r,_=e+(1-s)*n,v=t+(c+u)*r;break;case 270:y=J._rescaleAndSwap,d=e+n,f=t+r,p=-n,m=-r,h=e+(1-c-u)*n,g=t+(1-s-l)*r,_=e+(1-c)*n,v=t+(1-s)*r}for(let{line:e,points:t}of this.#r)a.push(y(e,d,f,p,m,i?Array(e.length):null)),o.push(y(t,d,f,p,m,i?Array(t.length):null));return{lines:a,points:o,rect:[h,g,_,v]}}static deserialize(e,t,n,r,i,{paths:{lines:a,points:o},rotation:s,thickness:c}){let l=[],u,d,f,p,m;switch(s){case 0:m=J._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=J._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=J._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=J._rescaleAndSwap,u=t/r+1,d=e/n+1,f=-1/r,p=-1/n}if(!a){a=[];for(let e of o){let t=e.length;if(t===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(t===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}let n=new Float32Array(3*(t-2));a.push(n);let[r,i,o,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let a=4;a<t;a+=2){let t=e[a],c=e[a+1];n.set(J.createBezierPoints(r,i,o,s,t,c),(a-2)*3),[r,i,o,s]=[o,s,t,c]}}}for(let e=0,t=a.length;e<t;e++)l.push({line:m(a[e].map(e=>e??NaN),u,d,f,p),points:m(o[e].map(e=>e??NaN),u,d,f,p)});let h=new this.prototype.constructor;return h.build(l,n,r,1,s,c,i),h}#l(e=this.#c){let t=this.#n+e/2*this.#o;return this.#s%180==0?[t/this.#i,t/this.#a]:[t/this.#a,t/this.#i]}#u(){let[e,t,n,r]=this.#e,[i,a]=this.#l(0);return[e+i,t+a,n-2*i,r-2*a]}#d(){let e=this.#e=v.slice();for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)B.pointBoundingBox(t[n],t[n+1],e);continue}let n=t[4],r=t[5];for(let i=6,a=t.length;i<a;i+=6){let[a,o,s,c,l,u]=t.subarray(i,i+6);B.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=V(e[0]-t,0,1),e[1]=V(e[1]-n,0,1),e[2]=V(e[2]+t,0,1),e[3]=V(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e===`stroke-width`?this.#f(t):null}#f(e){let[t,n]=this.#l();this.#c=e;let[r,i]=this.#l(),[a,o]=[r-t,i-n],s=this.#e;return s[0]-=a,s[1]-=o,s[2]+=2*a,s[3]+=2*o,s}updateParentDimensions([e,t],n){let[r,i]=this.#l();this.#i=e,this.#a=t,this.#o=n;let[a,o]=this.#l(),s=a-r,c=o-i,l=this.#e;return l[0]-=s,l[1]-=c,l[2]+=2*s,l[3]+=2*c,l}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(J.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${J.svgRound(e)} ${J.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,r=0,i=0,a=0,o=0,s=0;switch(this.#t){case 90:r=t/e,i=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,s=t;break;case 270:r=-t/e,i=e/t,s=t;break;default:return``}return`matrix(${n} ${r} ${i} ${a} ${J.svgRound(o)} ${J.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=J.PRECISION||Math.abs(l-a)<=J.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${J.svgRound(e)} ${J.svgRound(t)}`,transform:`${this.rotationTransform} translate(${i} ${a})`}}}let u=(n-2*i)/(c-2*i),d=(r-2*a)/(l-2*a),f=c/n,p=l/r;return{path:{"transform-origin":`${J.svgRound(o)} ${J.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${J.svgRound(i)} ${J.svgRound(a)}) scale(${u} ${d}) translate(${J.svgRound(-i)} ${J.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,r]){let[i,a]=this.#l(),o=this.#e,[s,c,l,u]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=r,Math.abs(l-i)<=J.PRECISION||Math.abs(u-a)<=J.PRECISION){let i=e+n/2-(s+l/2),a=t+r/2-(c+u/2);for(let{line:e,points:t}of this.#r)J._translate(e,i,a,e),J._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${J.svgRound(e)} ${J.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*i)/(l-2*i),f=(r-2*a)/(u-2*a),p=-d*(s+i)+e+i,m=-f*(c+a)+t+a;if(d!==1||f!==1||p!==0||m!==0)for(let{line:e,points:t}of this.#r)J._rescale(e,p,m,d,f,e),J._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${J.svgRound(e)} ${J.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[r,i]=n,a=this.#e,o=e-a[0],s=t-a[1];if(this.#i===r&&this.#a===i)for(let{line:e,points:t}of this.#r)J._translate(e,o,s,e),J._translate(t,o,s,t);else{let e=this.#i/r,t=this.#a/i;this.#i=r,this.#a=i;for(let{line:n,points:r}of this.#r)J._rescale(n,o,s,e,t,n),J._rescale(r,o,s,e,t,r);a[2]*=e,a[3]*=t}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${J.svgRound(e)} ${J.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${J.svgRound(e[0])} ${J.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},va=class e extends ra{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:W._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":10})}updateSVGProperty(e,t){e===`stroke-width`&&(t??=this[`stroke-width`],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},ya=class e extends ia{static _type=`ink`;static _editorType=T.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){W.initialize(e,t),this._defaultDrawingOptions=new va(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return L(this,`typesMap`,new Map([[E.INK_THICKNESS,`stroke-width`],[E.INK_COLOR,`stroke`],[E.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance({x:e,y:t,box:[,,n,r],rotation:i}){return new ga(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return _a.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof Ki){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,opacity:s,borderStyle:{rawWidth:c},popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},parent:{page:{pageNumber:m}}}=e;r=e={annotationType:T.INK,color:Array.from(o),thickness:c,opacity:s,paths:{points:t},boxes:null,pageIndex:m-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}get toolbarButtons(){return this._colorPicker||=new _i(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return E.INK_COLOR}get colorAndOpacityType(){return E.INK_COLOR_AND_OPACITY}get opacityType(){return E.INK_OPACITY}updateParams(e,t){e===E.INK_COLOR_AND_OPACITY?this._updateColorAndOpacity(t.color,t.opacity):super.updateParams(e,t)}static updateDefaultParams(e,t){e===E.INK_COLOR_AND_OPACITY?(super.updateDefaultParams(E.INK_COLOR,t.color),super.updateDefaultParams(E.INK_OPACITY,t.opacity)):super.updateDefaultParams(e,t)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions[`stroke-opacity`]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty(`stroke-width`),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty(`stroke-width`),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:r}){this._drawingOptions=e.getDefaultDrawingOptions({stroke:B.makeHexColor(...t),"stroke-width":n,"stroke-opacity":r})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":i,"stroke-width":a}}=this,o=Object.assign(super.serialize(e),{color:W._colorManager.convert(r),opacity:i,thickness:a,paths:{lines:t,points:n}});return this.addComment(o),e?(o.isCopy=!0,o):this.annotationElementId&&!this.#e(o)?null:(o.id=this.annotationElementId,o)}#e(e){let{color:t,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==r||e.pageIndex!==i}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions[`stroke-width`],points:t,popup:this.comment}),null}},ba=class extends _a{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},xa=8,Sa=3,Ca=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return n-=e,r-=t,n===0?r>0?0:4:n===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#r(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(-i+s-o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#i(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(i+s+o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#a(e,t,n,r){let i=e.length,a=new Int32Array(i);for(let t=0;t<i;t++)a[t]=+(e[t]<=r);for(let e=1;e<n-1;e++)a[e*t]=a[e*t+t-1]=0;for(let e=0;e<t;e++)a[e]=a[t*n-1-e]=0;let o=1,s,c=[];for(let e=1;e<n-1;e++){s=1;for(let n=1;n<t-1;n++){let r=e*t+n,i=a[r];if(i===0)continue;let l=e,u=n;if(i===1&&a[r-1]===0)o+=1,--u;else if(i>=1&&a[r+1]===0)o+=1,u+=1,i>1&&(s=i);else{i!==1&&(s=Math.abs(i));continue}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:o,parent:0};c.push(p);let m;for(let e of c)if(e.id===s){m=e;break}p.parent=m?m.isHole?f?m.parent:s:f?s:m.parent:f?s:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-o,a[r]!==1&&(s=Math.abs(a[r]));continue}let g=this.#n[2*h],_=this.#n[2*h+1],v=e+g,y=n+_;l=v,u=y;let b=e,x=n;for(;;){let i=this.#i(a,t,b,x,l,u,1);g=this.#n[2*i],_=this.#n[2*i+1];let c=b+g,f=x+_;d.push(f,c);let p=b*t+x;if(a[p+1]===0?a[p]=-o:a[p]===1&&(a[p]=o),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(s=Math.abs(a[r]));break}l=b,u=x,b=c,x=f}}}return c}static#o(e,t,n,r){if(n-t<=4){for(let i=t;i<n-2;i+=2)r.push(e[i],e[i+1]);return}let i=e[t],a=e[t+1],o=e[n-4]-i,s=e[n-3]-a,c=Math.hypot(o,s),l=o/c,u=s/c,d=l*a-u*i,f=s/o,p=1/c,m=Math.atan(f),h=Math.cos(m),g=Math.sin(m),_=p*(Math.abs(h)+Math.abs(g)),v=p*(1-_+_**2),y=Math.max(Math.atan(Math.abs(g+h)*v),Math.atan(Math.abs(g-h)*v)),b=0,x=t;for(let r=t+2;r<n-2;r+=2){let t=Math.abs(d-l*e[r+1]+u*e[r]);t>b&&(x=r,b=t)}b>(c*y)**2?(this.#o(e,t,x+2,r),this.#o(e,x,n,r)):r.push(i,a)}static#s(e){let t=[],n=e.length;return this.#o(e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t}static#c(e,t,n,r,i,a){let o=new Float32Array(a**2),s=-2*r**2,c=a>>1;for(let e=0;e<a;e++){let t=(e-c)**2;for(let n=0;n<a;n++)o[e*a+n]=Math.exp((t+(n-c)**2)/s)}let l=new Float32Array(256),u=-2*i**2;for(let e=0;e<256;e++)l[e]=Math.exp(e**2/u);let d=e.length,f=new Uint8Array(d),p=new Uint32Array(256);for(let r=0;r<n;r++)for(let i=0;i<t;i++){let s=r*t+i,u=e[s],d=0,m=0;for(let s=0;s<a;s++){let f=r+s-c;if(!(f<0||f>=n))for(let n=0;n<a;n++){let r=i+n-c;if(r<0||r>=t)continue;let p=e[f*t+r],h=o[s*a+n]*l[Math.abs(p-u)];d+=p*h,m+=h}}let h=f[s]=Math.round(d/m);p[h]++}return[f,p]}static#l(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t}static#u(e){let t=e.length,n=new Uint8ClampedArray(t>>2),r=-1/0,i=1/0;for(let t=0,a=n.length;t<a;t++){let a=n[t]=e[t<<2];r=Math.max(r,a),i=Math.min(i,a)}let a=255/(r-i);for(let e=0,t=n.length;e<t;e++)n[e]=(n[e]-i)*a;return n}static#d(e){let t,n=-1/0,r=-1/0,i=e.findIndex(e=>e!==0),a=i,o=i;for(t=i;t<256;t++){let i=e[t];i>n&&(t-a>r&&(r=t-a,o=t-1),n=i,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){let t=e,{width:n,height:r}=e,{maxDim:i}=this.#e,a=n,o=r;if(n>i||r>i){let s=n,c=r,l=Math.log2(Math.max(n,r)/i),u=Math.floor(l);l=l===u?u-1:u;for(let n=0;n<l;n++){a=Math.ceil(s/2),o=Math.ceil(c/2);let n=new OffscreenCanvas(a,o);n.getContext(`2d`).drawImage(e,0,0,s,c,0,0,a,o),s=a,c=o,e!==t&&e.close(),e=n.transferToImageBitmap()}let d=Math.min(i/a,i/o);a=Math.round(a*d),o=Math.round(o*d)}let s=new OffscreenCanvas(a,o).getContext(`2d`,{willReadFrequently:!0});s.fillStyle=`white`,s.fillRect(0,0,a,o),s.filter=`grayscale(1)`,s.drawImage(e,0,0,e.width,e.height,0,0,a,o);let c=s.getImageData(0,0,a,o).data;return[this.#u(c),a,o]}static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:r},i,a,o,s){let c=new OffscreenCanvas(1,1),l=c.getContext(`2d`,{alpha:!1}),u=l.font=`${n} ${r} 200px ${t}`,{actualBoundingBoxLeft:d,actualBoundingBoxRight:f,actualBoundingBoxAscent:p,actualBoundingBoxDescent:m,fontBoundingBoxAscent:h,fontBoundingBoxDescent:g,width:_}=l.measureText(e),v=1.5,y=Math.ceil(Math.max(Math.abs(d)+Math.abs(f)||0,_)*v),b=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||200,Math.abs(h)+Math.abs(g)||200)*v);c=new OffscreenCanvas(y,b),l=c.getContext(`2d`,{alpha:!0,willReadFrequently:!0}),l.font=u,l.filter=`grayscale(1)`,l.fillStyle=`white`,l.fillRect(0,0,y,b),l.fillStyle=`black`,l.fillText(e,y*.5/2,b*1.5/2);let x=this.#u(l.getImageData(0,0,y,b).data),S=this.#l(x),C=this.#d(S),w=this.#a(x,y,b,C);return this.processDrawnLines({lines:{curves:w,width:y,height:b},pageWidth:i,pageHeight:a,rotation:o,innerMargin:s,mustSmooth:!0,areContours:!0})}static process(e,t,n,r,i){let[a,o,s]=this.#f(e),[c,l]=this.#c(a,o,s,Math.hypot(o,s)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),u=this.#d(l),d=this.#a(c,o,s,u);return this.processDrawnLines({lines:{curves:d,width:o,height:s},pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:a,areContours:o}){r%180!=0&&([t,n]=[n,t]);let{curves:s,width:c,height:l}=e,u=e.thickness??0,d=[],f=Math.min(t/c,n/l),p=f/t,m=f/n,h=[];for(let{points:e}of s){let t=a?this.#s(e):e;if(!t)continue;h.push(t);let n=t.length,r=new Float32Array(n),i=new Float32Array(3*(n===2?2:n-2));if(d.push({line:i,points:r}),n===2){r[0]=t[0]*p,r[1]=t[1]*m,i.set([NaN,NaN,NaN,NaN,r[0],r[1]],0);continue}let[o,s,c,l]=t;o*=p,s*=m,c*=p,l*=m,r.set([o,s,c,l],0),i.set([NaN,NaN,NaN,NaN,o,s],0);for(let e=4;e<n;e+=2){let n=r[e]=t[e]*p,a=r[e+1]=t[e+1]*m;i.set(J.createBezierPoints(o,s,c,l,n,a),(e-2)*3),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new ba:new _a;return g.build(d,t,n,1,r,o?0:u,i),{outline:g,newCurves:h,areContours:o,thickness:u,width:c,height:l}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:r,height:i}){let a=1/0,o=-1/0,s=0;for(let t of e){s+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];a=Math.min(a,n),o=Math.max(o,n)}}let c;c=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;let l=e.length,u=xa+Sa*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(s-2*l)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=r,d[f++]=i,d[f++]=+!t,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=l,d[f++]=c.BYTES_PER_ELEMENT;for(let t of e)d[f++]=t.length-2,d[f++]=t[0],d[f++]=t[1];let p=new CompressionStream(`deflate-raw`),m=p.writable.getWriter();await m.ready,m.write(d);let h=c.prototype.constructor;for(let t of e){let e=new h(t.length-2);for(let n=2,r=t.length;n<r;n++)e[n-2]=t[n]-t[n-2];m.write(e)}return m.close(),(await new Response(p.readable).bytes()).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(e),{readable:n,writable:r}=new DecompressionStream(`deflate-raw`),i=r.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(let e of n)a||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),a.set(e,o),o+=e.length;let s=new Uint32Array(a.buffer,0,a.length>>2),c=s[1];if(c!==0)throw Error(`Invalid version: ${c}`);let l=s[2],u=s[3],d=s[4]===0,f=s[5],p=s[6],m=s[7],h=[],g=(xa+Sa*p)*Uint32Array.BYTES_PER_ELEMENT,_;switch(m){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(a.buffer,g);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(a.buffer,g);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(a.buffer,g)}o=0;for(let e=0;e<p;e++){let t=s[Sa*e+xa],n=new Float32Array(t+2);h.push(n);for(let t=0;t<2;t++)n[t]=s[Sa*e+xa+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+_[o++]}return{areContours:d,thickness:f,outlines:h,width:l,height:u}}catch(e){return N(`decompressSignature: ${e}`),null}}},wa=class e extends ra{constructor(){super(),super.updateProperties({fill:W._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},Ta=class e extends va{constructor(e){super(e),super.updateProperties({stroke:W._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},Ea=class e extends ia{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=T.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:`signatureEditor`}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#t=null,this.defaultL10nId=`pdfjs-editor-signature-editor1`}static initialize(e,t){W.initialize(e,t),this._defaultDrawingOptions=new wa,this._defaultDrawnSignatureOptions=new Ta(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return L(this,`typesMap`,new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:`signature`,hasDescription:!!this.#t}}static computeTelemetryFinalData(e){let t=e.get(`hasDescription`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:r}=this;if(r&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null){if(this.#n){let{lines:t,mustSmooth:n,areContours:r,description:i,uuid:a,heightInPage:o}=this.#n,{rawDims:{pageWidth:s,pageHeight:c},rotation:l}=this.parent.viewport,u=Ca.processDrawnLines({lines:t,pageWidth:s,pageHeight:c,rotation:l,innerMargin:e._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(u,o,i,a)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:``})),this.div.hidden=!0,this._uiManager.getSignature(this)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:this.#t||``}));return r&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(e){this.#r=e,this.addEditToolbar()}getUuid(){return this.#r}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:t,thickness:n,width:r,height:i}=this.#n,a=Math.max(r,i);return{areContours:t,outline:Ca.processDrawnLines({lines:{curves:e.map(e=>({points:e})),thickness:n,width:r,height:i},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[[`editSignature`,this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,r,i){let{x:a,y:o}=this,{outline:s}=this.#n=t;this.#e=s instanceof ba,this.description=r;let c;this.#e?c=e.getDefaultDrawingOptions():(c=e._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":s.thickness})),this._addOutlines({drawOutlines:s,drawingOptions:c});let[,l]=this.pageDimensions,u=n/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:`pdfjs.signature.inserted`,data:{hasBeenSaved:!!i,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return Ca.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return Ca.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return Ca.processDrawnLines({lines:t,pageWidth:n,pageHeight:r,rotation:i,innerMargin:e._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=e.getDefaultDrawingOptions():(this._drawingOptions=e._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,i=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:r});return this.addComment(i),e?(i.paths={lines:t,points:n},i.uuid=this.#r,i.isCopy=!0):i.lines=t,this.#t&&(i.accessibilityData={type:`Figure`,alt:this.#t}),i}static deserializeDraw(e,t,n,r,i,a){return a.areContours?ba.deserialize(e,t,n,r,i,a):_a.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=await super.deserialize(e,t,n);return r.#e=e.areContours,r.description=e.accessibilityData?.alt||``,r.#r=e.uuid,r}},Da=class extends W{#e=null;#t=null;#n=null;#r=null;#i=null;#a=``;#o=null;#s=!1;#c=null;#l=!1;#u=!1;static _type=`stamp`;static _editorType=T.STAMP;constructor(e){super({...e,name:`stampEditor`}),this.#r=e.bitmapUrl,this.#i=e.bitmapFile,this.defaultL10nId=`pdfjs-editor-stamp-editor`}static initialize(e,t){W.initialize(e,t)}static isHandlingMimeForPasting(e){return Xe.has(e)}static paste(e,t){t.pasteEditor({mode:T.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:`stamp`,hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get(`hasAltText`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#d(e,t=!1){e?(this.#e=e.bitmap,t||(this.#t=e.id,this.#l=e.isSvg),e.file&&(this.#a=e.file.name),this.#m()):this.remove()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#o){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e)this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:`pdfjs.image.image_added`,data:{alt_text_modal:!1,alt_text_type:`empty`}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw Error(`No ML.`);if(!await n.isEnabledFor(`altText`))throw Error(`ML isn't enabled for alt text.`);let{data:r,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:`altText`,request:{data:r,width:i,height:a,channels:r.length/(i*a)}});if(!o)throw Error(`No response from the AI service.`);if(o.error)throw Error(`Error from the AI service.`);if(o.cancel)return null;if(!o.output)throw Error(`No valid response from the AI service.`);let s=o.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());return}if(this.#r){let e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#d(e)).finally(()=>this.#f());return}if(this.#i){let e=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(e=>this.#d(e)).finally(()=>this.#f());return}let e=document.createElement(`input`);e.type=`file`,e.accept=Xe.keys().join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:`pdfjs.image.image_selected`,data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#d(t)}n()},{signal:t}),e.addEventListener(`cancel`,()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#f()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#o?.remove(),this.#o=null,this.#c&&=(clearTimeout(this.#c),null)),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(this.#t&&this.#o===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))):this.#t&&this.#p()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#i||this.#t||this.#s)}get toolbarButtons(){return[[`altText`,this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#s||(this.#e?this.#m():this.#p()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){let{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#t=n,r&&(this.#e=r),this.#s=!1,this.#m())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>{this.#c=null,this.#g()},200))}#m(){let{div:e}=this,{width:t,height:n}=this.#e,[r,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>a*r||n>a*i){let e=Math.min(a*r/t,a*i/n);t*=e,n*=e}this._uiManager.enableWaiting(!1);let o=this.#o=document.createElement(`canvas`);o.setAttribute(`role`,`img`),this.addContainer(o),this.width=t/r,this.height=n/i,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#g(),this.#u||=(this.parent.addUndoableEditor(this),!0),this._reportTelemetry({action:`inserted_image`}),this.#a&&this.div.setAttribute(`aria-description`,this.#a),this.annotationElementId||this._uiManager.a11yAlert(W._l10nAlert.stamp)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new Ye,o=this.#e,s=r,c=i,l=null;if(t){if(r>t||i>t){let e=Math.min(t/r,t/i);s=Math.floor(r*e),c=Math.floor(i*e)}l=document.createElement(`canvas`);let e=l.width=Math.ceil(s*a.sx),n=l.height=Math.ceil(c*a.sy);this.#l||(o=this.#h(e,n));let u=l.getContext(`2d`);u.filter=this._uiManager.hcmFilter;let d=`white`,f=`#cfcfd8`;this._uiManager.hcmFilter===`none`?Ze.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(p*2,m*2),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,p*2,m*2),g.fillStyle=f,g.fillRect(0,0,p,m),g.fillRect(p,m,p,m),u.fillStyle=u.createPattern(h,`repeat`),u.fillRect(0,0,e,n),u.drawImage(o,0,0,o.width,o.height,0,0,e,n)}let u=null;if(n){let t,n;if(a.symmetric&&o.width<e&&o.height<e)t=o.width,n=o.height;else if(o=this.#e,r>e||i>e){let a=Math.min(e/r,e/i);t=Math.floor(r*a),n=Math.floor(i*a),this.#l||(o=this.#h(t,n))}let s=new OffscreenCanvas(t,n).getContext(`2d`,{willReadFrequently:!0});s.drawImage(o,0,0,o.width,o.height,0,0,t,n),u={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:l,width:s,height:c,imageData:u}}#h(e,t){let{width:n,height:r}=this.#e,i=n,a=r,o=this.#e;for(;i>2*e||a>2*t;){let n=i,r=a;i>2*e&&(i=Math.ceil(i/2)),a>2*t&&(a=Math.ceil(a/2));let s=new OffscreenCanvas(i,a);s.getContext(`2d`).drawImage(o,0,0,n,r,0,0,i,a),o=s.transferToImageBitmap()}return o}#g(){let[e,t]=this.parentDimensions,{width:n,height:r}=this,i=new Ye,a=Math.ceil(n*e*i.sx),o=Math.ceil(r*t*i.sy),s=this.#o;if(!s||s.width===a&&s.height===o)return;s.width=a,s.height=o;let c=this.#l?this.#e:this.#h(a,o),l=s.getContext(`2d`);l.filter=this._uiManager.hcmFilter,l.drawImage(c,0,0,c.width,c.height,0,0,a,o)}#_(e){if(e){if(this.#l){let e=this._uiManager.imageManager.getSvgUrl(this.#t);if(e)return e}let e=document.createElement(`canvas`);return{width:e.width,height:e.height}=this.#e,e.getContext(`2d`).drawImage(this.#e,0,0),e.toDataURL()}if(this.#l){let[e,t]=this.pageDimensions,n=Math.round(this.width*e*Ne.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*Ne.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext(`2d`).drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let r=null,i=!1;if(e instanceof Zi){let{data:{rect:a,rotation:o,id:s,structParent:c,popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},container:m,parent:{page:{pageNumber:h}},canvas:g}=e,_,v;g?(delete e.canvas,{id:_,bitmap:v}=n.imageManager.getFromCanvas(m.id,g),g.remove()):(i=!0,e._hasNoCanvas=!0);let y=(await t._structTree.getAriaAttributes(`${C}${s}`))?.get(`aria-label`)||``;r=e={annotationType:T.STAMP,bitmapId:_,bitmap:v,pageIndex:h-1,rect:a.slice(0),rotation:o,annotationElementId:s,id:s,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let a=await super.deserialize(e,t,n),{rect:o,bitmap:s,bitmapUrl:c,bitmapId:l,isSvg:u,accessibilityData:d}=e;i?(n.addMissingCanvas(e.id,a),a.#s=!0):l&&n.imageManager.isValidId(l)?(a.#t=l,s&&(a.#e=s)):a.#r=c,a.#l=u;let[f,p]=a.pageDimensions;return a.width=(o[2]-o[0])/f,a.height=(o[3]-o[1])/p,d&&(a.altTextData=d),a._initialData=r,e.comment&&a.setCommentData(e),a.#u=!!r,a}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=Object.assign(super.serialize(e),{bitmapId:this.#t,isSvg:this.#l});if(this.addComment(n),e)return n.bitmapUrl=this.#_(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;let{decorative:r,altText:i}=this.serializeAltText(!1);if(!r&&i&&(n.accessibilityData={type:`Figure`,alt:i}),this.annotationElementId){let e=this.#v(n);return e.isSame?null:(e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(t===null)return n;t.stamps||=new Map;let a=this.#l?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#_(!1);else if(this.#l){let e=t.stamps.get(this.#t);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#_(!1))}return n}#v(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===t,i=(e.accessibilityData?.alt||``)===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&i,isSameAltText:i}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},Oa=class e{#e;#t=!1;#n=null;#r=null;#i=null;#a=new Map;#o=!1;#s=!1;#c=!1;#l=null;#u=null;#d=null;#f=null;#p=null;#m=-1;#h;static _initialized=!1;static#g=new Map([na,ya,Da,ha,Ea].map(e=>[e._editorType,e]));constructor({uiManager:t,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:c,viewport:l,l10n:u}){let d=[...e.#g.values()];if(!e._initialized){e._initialized=!0;for(let e of d)e.initialize(u,t)}t.registerEditorTypes(d),this.#h=t,this.pageIndex=n,this.div=r,this.#e=a,this.#n=o,this.viewport=l,this.#d=c,this.drawLayer=s,this._structTree=i,this.#h.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#h.getMode()===T.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case T.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case T.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case T.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:n}=this.div;if(n.toggle(`nonEditing`,!1),t===T.POPUP)n.toggle(`commentEditing`,!0);else{n.toggle(`commentEditing`,!1);for(let r of e.#g.values())n.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#d?.div}setEditingState(e){this.#h.setEditingState(e)}addCommands(e){this.#h.addCommands(e)}cleanUndoStack(e){this.#h.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle(`drawing`,!e)}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.togglePointerEvents(e)}get#_(){return this.#a.size===0?this.#h.getEditors(this.pageIndex):this.#a.values()}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle(`nonEditing`,!1),this.#p?.abort(),this.#p=null;let e=new Set;for(let t of this.#_)t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#h.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));let t=this.#n;if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),this.#h.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#c=!1,this.#h._eventBus.dispatch(`editorsrendered`,{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle(`nonEditing`,!0),this.#d&&!this.#p){this.#p=new AbortController;let e=this.#h.combinedSignal(this.#p);this.#d.div.addEventListener(`pointerdown`,e=>{let{clientX:t,clientY:n,timeStamp:r}=e;if(r-this.#m>500){this.#m=r;return}this.#m=-1;let{classList:i}=this.div;i.toggle(`getElements`,!0);let a=document.elementsFromPoint(t,n);if(i.toggle(`getElements`,!1),!this.div.contains(a[0]))return;let o,s=RegExp(`^${w}[0-9]+$`);for(let e of a)if(s.test(e.id)){o=e.id;break}if(!o)return;let c=this.#a.get(o);c?.annotationElementId===null&&(H(e),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n,n=[];if(t){let e=new Map,r=new Map;for(let t of this.#_)t.disableEditing(),t.annotationElementId?t.serialize()===null?(r.set(t.annotationElementId,t),this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()):e.set(t.annotationElementId,t):n.push(t);for(let n of t.getEditableAnnotations()){let{id:t}=n.data;if(this.#h.isDeletedAnnotationElement(t)){n.updateEdited({deleted:!0});continue}let i=r.get(t);i?(i.resetAnnotationElement(n),i.show(!1),n.show()):(i=e.get(t),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(n)&&i.show(!1)),n.show())}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let t of e.#g.values())r.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(n),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#h.getActive()!==e&&this.#h.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;let e=this.#h.combinedSignal(this.#f);this.#d.div.addEventListener(`pointerdown`,this.#v.bind(this),{signal:e}),this.#d.div.classList.add(`highlighting`)}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove(`highlighting`))}#v(e){this.#h.unselectAll();let{target:t}=e;if(t===this.#d.div||(t.getAttribute(`role`)===`img`||t.classList.contains(`endOfContent`)||t.classList.contains(`textLayerImages`)||t.classList.contains(`textLayerImagePlaceholder`))&&this.#d.div.contains(t)){let{isMac:t}=z.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),ha.startDrawing(this,this.#h,this.#h.direction===`ltr`,e),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;let e=this.#h.combinedSignal(this.#r);this.div.addEventListener(`pointerdown`,this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener(`pointerup`,t,{signal:e}),this.div.addEventListener(`pointercancel`,t,{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#h.isDeletedAnnotationElement(t)&&this.#h.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#h.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#h.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#h.addDeletedAnnotationElement(e),W.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#h.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#h.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#i&&(e._focusEventsAllowed=!1,this.#i=setTimeout(()=>{this.#i=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getEditorByUID(e){for(let t of this.#a.values())if(t.uid===e)return t;return null}get#y(){return e.#g.get(this.#h.getMode())}combinedSignal(e){return this.#h.combinedSignal(e)}#b(e){let t=this.#y;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#h.updateMode(e.mode);let{offsetX:n,offsetY:r}=this.#x(),i=this.#h.getId(),a=this.#b({parent:this,id:i,x:n,y:r,uiManager:this.#h,isCentered:!0,...t});a&&this.add(a)}async deserialize(t){return await e.#g.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#h)||null}createAndAddNewEditor(e,t,n={}){let r=this.#h.getId(),i=this.#b({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#h,isCentered:t,...n});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}#x(){let{x:e,y:t,width:n,height:r}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),s=Math.min(window.innerHeight,t+r),c=(i+o)/2-e,l=(a+s)/2-t,[u,d]=this.viewport.rotation%180==0?[c,l]:[l,c];return{offsetX:u,offsetY:d}}addNewEditor(e={}){this.createAndAddNewEditor(this.#x(),!0,e)}setSelected(e){this.#h.setSelected(e)}toggleSelected(e){this.#h.toggleSelected(e)}unselect(e){this.#h.unselect(e)}pointerup(e){let{isMac:t}=z.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#o||(this.#o=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}let n=this.#h.getMode();n===T.STAMP||n===T.POPUP||n===T.SIGNATURE?this.#h.unselectAll():this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#h.getMode()===T.HIGHLIGHT&&this.enableTextSelection(),this.#o){this.#o=!1;return}let{isMac:t}=z.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer){this.startDrawingSession(e);return}let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l){this.#y.startDrawing(this,this.#h,!1,e);return}this.#h.setCurrentDrawingSession(this),this.#l=new AbortController;let t=this.#h.combinedSignal(this.#l);this.div.addEventListener(`blur`,({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#y.startDrawing(this,this.#h,!1,e)}pause(e){if(e){let{activeElement:e}=document;this.div.contains(e)&&(this.#u=e)}else this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#l?(this.#h.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#y.endDrawing(e)):null}findNewParent(e,t,n){let r=this.#h.findParent(t,n);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#i&&=(clearTimeout(this.#i),null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#h.removeLayer(this)}#S(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}async render({viewport:e}){this.viewport=e,Je(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#h.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Je(this.div,{rotation:n}),t!==n)for(let e of this.#a.values())e.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#h.viewParameters.realScale}};function ka(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Aa(e){return e?e.nodeType===Node.ELEMENT_NODE?e.closest(`.textLayer`):e.parentElement?.closest(`.textLayer`)||null:null}function ja(e,t,n,r){if(e===n)return t<=r;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING?!0:i&Node.DOCUMENT_POSITION_PRECEDING?!1:null}function Ma(e,t,n){if(e.nodeType!==Node.ELEMENT_NODE||!e.classList.contains(`textLayer`)||t!==e.childNodes.length)return{container:e,offset:t};let r=e.lastChild;return r?.nodeType===Node.ELEMENT_NODE&&r.classList.contains(`endOfContent`)&&(r=r.previousSibling),!r||!n.contains(r)?null:r.nodeType===Node.TEXT_NODE?{container:r,offset:r.textContent.length}:{container:r,offset:r.childNodes.length}}var Na=class e{#e=null;#t=new Map;#n=null;#r=null;#i=null;#a=null;#o=new Map;static#s=0;static#c=0;static#l=null;static#u=new Set;static#d=!1;static#f=new Set;static#p=new WeakMap;constructor({filterFactory:t=null,pageColors:n=null,pageIndex:r,textLayer:i=null}){if(this.pageIndex=r,this.#r=t,this.#i=n,i){let t=e.#p.get(i);if(t?.selectionDiv&&(t.selectionDiv.remove(),e.#u.delete(t.selectionDiv)),e.#p.set(i,{drawLayer:this}),e.#f.add(i),this.#n=i,this.#a=new MutationObserver(t=>{if(this.#e&&this.#n?.isConnected&&e.#h()){for(let{addedNodes:n}of t)for(let t of n)if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){e.#_();return}}}),this.#a.observe(i,{childList:!0}),e.#l===null){e.#l=new AbortController;let{signal:t}=e.#l;document.addEventListener(`selectionchange`,e.#_.bind(e),{signal:t}),document.addEventListener(`pointerdown`,()=>{e.#d=!0},{signal:t}),document.addEventListener(`pointerup`,()=>{e.#d=!1},{signal:t}),window.addEventListener(`blur`,()=>{e.#d=!1},{signal:t})}}}setParent(t){if(!this.#e)this.#e=t,this.#n?.isConnected&&e.#h()&&e.#_();else if(this.#e!==t){if(this.#t.size>0)for(let e of this.#t.values())e.remove(),t.append(e);this.#e=t}}static#m(e){let t=this.#p.get(e);t?.selectionDiv&&(t.selectionDiv.remove(),this.#u.delete(t.selectionDiv),t.selectionDiv=null,t.path=null)}static#h(){let e=document.getSelection();return!!e&&!e.isCollapsed}static#g(){return this.#f.keys().filter(e=>e.isConnected).toArray().sort(ka)}static#_(){let t=document.getSelection();if(!t||t.isCollapsed){for(let e of this.#u)e.remove();this.#u.clear();return}let n=new WeakMap,r=this.#g(),i=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(n.collapsed)continue;let{startContainer:a,startOffset:o,endContainer:s,endOffset:c}=n,l=Aa(a),u=Aa(s),d=l===null,f=u===null;if(this.#d&&d!==f)return;if(t.rangeCount===1){let{anchorNode:e,anchorOffset:n,focusNode:r,focusOffset:i}=t,d=Aa(e),f=Aa(r),p=ja(e,n,r,i);d&&f&&p!==null&&(p?(a=e,o=n,l=d,s=r,c=i,u=f):(a=r,o=i,l=f,s=e,c=n,u=d))}let p=r.filter(e=>n.intersectsNode(e));if(p.length===0)continue;let m=!1;if(l||(l=p[0],a=l,o=0,m=!0),u||(u=p.at(-1),s=u,c=u.childNodes.length,m=!0),s.nodeType===Node.ELEMENT_NODE){if(s.classList.contains(`endOfContent`)){let e=s.previousSibling;if(!e)continue;s=e,c=e.nodeType===Node.TEXT_NODE?e.textContent.length:e.childNodes.length}else if(s.classList.contains(`textLayer`)&&s.childNodes.length===c){let e=Ma(s,c,u);if(!e)continue;s=e.container,c=e.offset}}if(a.nodeType===Node.ELEMENT_NODE){let e=Ma(a,o,l);if(!e)continue;a=e.container,o=e.offset}if(l===u&&!m&&p.includes(l))i.push([n,l]);else for(let e of p){let t=e.firstChild;if(!t)continue;let n=document.createRange();if(e===l?n.setStart(a,o):n.setStartBefore(t),e===u)n.setEnd(s,c);else{let t=e.lastChild;if(!t)continue;if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){let e=t.previousSibling;if(!e)continue;n.setEndAfter(e)}else n.setEndAfter(t)}n.collapsed||i.push([n,e])}}let a=new Set(i.map(e=>e[1]));for(let e of this.#f)a.has(e)||this.#m(e);for(let[t,r]of i){let i=e.#p.get(r);if(!i)continue;let a=n.get(r);if(!a){let e=r.getBoundingClientRect();a=(t,n,r,i)=>({x:(t-e.x)/e.width,y:(n-e.y)/e.height,width:r/e.width,height:i/e.height}),n.set(r,a)}let o=[];for(let{x:e,y:n,width:r,height:i}of t.getClientRects())r!==0&&i!==0&&({x:e,y:n,width:r,height:i}=a(e,n,r,i),(r!==1||i!==1)&&o.push(`M${e} ${n} h${r} v${i} h-${r} Z`));if(o.length===0)continue;let s=i.drawLayer,c=i.selectionDiv,l=i.path;if(!c){let t=`clip_selection_${e.#c++}`;c=document.createElement(`div`),c.className=`selection`,c.style.clipPath=`url(#${t})`;let n=s.#r?.createSelectionStyle(s.#i);if(n)for(let[e,t]of Object.entries(n))c.style.setProperty(e,t);let r=e._svgFactory.create(1,1,!0);r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`width`,`100%`),r.setAttribute(`height`,`100%`);let a=e._svgFactory.createElement(`clipPath`);a.setAttribute(`id`,t),a.setAttribute(`clipPathUnits`,`objectBoundingBox`),l=e._svgFactory.createElement(`path`),a.append(l),r.append(a),c.append(r),i.path=l,i.selectionDiv=c}s.#e&&c.parentNode!==s.#e&&(s.#e.append(c),this.#u.add(c)),l.setAttribute(`d`,o.join(` `))}}static get _svgFactory(){return L(this,`_svgFactory`,new Si)}static#v(e,[t,n,r,i]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*i}%`}#y(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,`true`),t}#b(t,n){let r=e._svgFactory.createElement(`clipPath`);t.append(r);let i=`clip_${n}`;r.setAttribute(`id`,i),r.setAttribute(`clipPathUnits`,`objectBoundingBox`);let a=e._svgFactory.createElement(`use`);return r.append(a),a.setAttribute(`href`,`#${n}`),a.classList.add(`clip`),i}#x(e,t){for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r)}draw(t,n=!1,r=!1){let i=e.#s++,a=this.#y(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#o.set(i,s);let l=r?this.#b(o,c):null,u=e._svgFactory.createElement(`use`);return a.append(u),u.setAttribute(`href`,`#${c}`),this.updateProperties(a,t),this.#t.set(i,a),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,n){let r=e.#s++,i=this.#y(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_${r}`;o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`);let c;if(n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_${r}`,t.setAttribute(`id`,c),t.setAttribute(`maskUnits`,`objectBoundingBox`);let n=e._svgFactory.createElement(`rect`);t.append(n),n.setAttribute(`width`,`1`),n.setAttribute(`height`,`1`),n.setAttribute(`fill`,`white`);let i=e._svgFactory.createElement(`use`);t.append(i),i.setAttribute(`href`,`#${s}`),i.setAttribute(`stroke`,`none`),i.setAttribute(`fill`,`black`),i.setAttribute(`fill-rule`,`nonzero`),i.classList.add(`mask`)}let l=e._svgFactory.createElement(`use`);i.append(l),l.setAttribute(`href`,`#${s}`),c&&l.setAttribute(`mask`,`url(#${c})`);let u=l.cloneNode();return i.append(u),l.classList.add(`mainOutline`),u.classList.add(`secondaryOutline`),this.updateProperties(i,t),this.#t.set(r,i),r}finalizeDraw(e,t){this.#o.delete(e),this.updateProperties(e,t)}updateProperties(t,n){if(!n)return;let{root:r,bbox:i,rootClass:a,path:o}=n,s=typeof t==`number`?this.#t.get(t):t;if(s){if(r&&this.#x(s,r),i&&e.#v(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstElementChild.firstElementChild;this.#x(e,o)}}}updateParent(e,t){if(t===this)return;let n=this.#t.get(e);n&&(t.#e.append(n),this.#t.delete(e),t.#t.set(e,n))}remove(e){this.#o.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(let e of this.#t.values())e.remove();this.#t.clear(),this.#o.clear(),this.#a?.disconnect(),this.#a=null,this.#n&&=(e.#p.get(this.#n)?.drawLayer===this&&(e.#m(this.#n),e.#p.delete(this.#n),e.#f.delete(this.#n),e.#f.size===0&&(e.#l?.abort(),e.#l=null,e.#d=!1)),null)}};function Pa(e){return`${(e*100).toFixed(2)}%`}var Fa=class e{#e=[];#t=new Map;#n=null;#r=0;#i=0;#a=0;static#o=null;constructor(e,t,n,r){this.#r=e,this.#e=t,this.#i=n.rawDims.pageWidth,this.#a=n.rawDims.pageHeight,this.#n=r}render(){let t=document.createElement(`div`);t.className=`textLayerImages`;for(let e=0;e<this.#e.length;e+=6){let n=this.#s(this.#e.subarray(e,e+6));n&&t.append(n)}return t.addEventListener(`contextmenu`,t=>{if(!(t.target instanceof HTMLCanvasElement))return;let n=t.target,r=this.#t.get(n);if(!r)return;let i=e.#o?.deref();if(i===n)return;i&&(i.width=0,i.height=0),e.#o=new WeakRef(n);let{inverseTransform:a,x1:o,y1:s,width:c,height:l}=r,u=this.#n(),d=Math.ceil(o*u.width),f=Math.ceil(s*u.height),p=Math.floor((o+c/this.#i)*u.width),m=Math.floor((s+l/this.#a)*u.height);n.width=p-d,n.height=m-f;let h=n.getContext(`2d`);h.setTransform(...a),h.translate(-d,-f),h.drawImage(u,0,0)}),t}#s([e,t,n,r,i,a]){let o=Math.hypot((i-e)*this.#i,(a-t)*this.#a),s=Math.hypot((n-e)*this.#i,(r-t)*this.#a);if(o<this.#r||s<this.#r)return null;let c=[(i-e)*this.#i/o,(a-t)*this.#a/o,(n-e)*this.#i/s,(r-t)*this.#a/s,0,0],l=B.inverseTransform(c),u=document.createElement(`canvas`);return u.className=`textLayerImagePlaceholder`,u.width=0,u.height=0,Object.assign(u.style,{opacity:0,position:`absolute`,left:Pa(e),top:Pa(t),width:Pa(o/this.#i),height:Pa(s/this.#a),transformOrigin:`0% 0%`,transform:`matrix(${c.join(`,`)})`}),this.#t.set(u,{inverseTransform:l,width:o,height:s,x1:e,y1:t}),u}};globalThis._pdfjsTestingUtils={HighlightOutliner:la},globalThis.pdfjsLib={AbortException:he,AnnotationEditorLayer:Oa,AnnotationEditorParamsType:E,AnnotationEditorType:T,AnnotationEditorUIManager:vt,AnnotationLayer:ea,AnnotationMode:S,AnnotationType:k,applyOpacity:$e,build:hi,ColorPicker:gi,createValidAbsoluteUrl:ce,CSSConstants:Qe,DOMSVGFactory:Si,DrawLayer:Na,FeatureTest:z,fetchData:Pe,findContrastColor:at,getDocument:ai,getFilenameFromUrl:Re,getPdfFilenameFromUrl:ze,getRGB:Ge,getRGBA:We,getUuid:Se,GlobalWorkerOptions:Kr,ImageKind:ee,InvalidPDFException:fe,isDataScheme:Ie,isPdfFile:Le,isValidExplicitDest:pn,makeArr:we,makeMap:Te,makeObj:Ee,makeSet:De,MathClamp:V,noContextMenu:He,normalizeUnicode:xe,OPS:A,OutputScale:Ye,PasswordException:de,PasswordResponses:j,PDFDataRangeTransport:si,PDFDateString:Ue,PDFWorker:ui,PermissionFlag:D,PixelsPerInch:Ne,RenderingCancelledException:Fe,renderRichText:ot,ResponseException:pe,setLayerDimensions:Je,shadow:L,SignatureExtractor:Ca,stopEvent:H,SupportedImageMimeTypes:Xe,TextLayer:ri,TextLayerImages:Fa,TouchManager:wt,updateUrlHash:le,Util:B,VerbosityLevel:ne,version:mi,XfaLayer:Me};var{AbortException:Ia,AnnotationEditorLayer:La,AnnotationEditorParamsType:Ra,AnnotationEditorType:za,AnnotationEditorUIManager:Ba,AnnotationLayer:Va,AnnotationMode:Ha,AnnotationType:Ua,applyOpacity:Wa,build:Ga,ColorPicker:Ka,createValidAbsoluteUrl:qa,CSSConstants:Ja,DOMSVGFactory:Ya,DrawLayer:Xa,FeatureTest:Za,fetchData:Qa,findContrastColor:$a,getDocument:eo,getFilenameFromUrl:to,getPdfFilenameFromUrl:no,getRGB:ro,getRGBA:io,getUuid:ao,GlobalWorkerOptions:oo,ImageKind:so,InvalidPDFException:co,isDataScheme:lo,isPdfFile:uo,isValidExplicitDest:fo,makeArr:po,makeMap:mo,makeObj:ho,makeSet:go,MathClamp:_o,noContextMenu:vo,normalizeUnicode:yo,OPS:bo,OutputScale:xo,PasswordException:So,PasswordResponses:Co,PDFDataRangeTransport:wo,PDFDateString:To,PDFWorker:Eo,PermissionFlag:Do,PixelsPerInch:Oo,RenderingCancelledException:ko,renderRichText:Ao,ResponseException:jo,setLayerDimensions:Mo,shadow:No,SignatureExtractor:Po,stopEvent:Fo,SupportedImageMimeTypes:Io,TextLayer:Lo,TextLayerImages:Ro,TouchManager:zo,updateUrlHash:Bo,Util:Vo,VerbosityLevel:Ho,version:Uo,XfaLayer:Wo}=globalThis.pdfjsLib,Go=null,Ko=null;function qo(e,t){Ko||=new Intl.Segmenter(void 0,{granularity:`grapheme`});let n=Ko.segment(e),r=n.containing(t);if(r.index!==t)return!1;Go||=new Intl.Segmenter(void 0,{granularity:`word`});let i=n.containing(t-1).segment;return Go.segment(i+r.segment).containing(i.length).index===i.length}function Jo(e,t,n){let r=t+n;return(t===0||qo(e,t))&&(r===e.length||qo(e,r))}var Yo;function Xo(){if(!Yo){let e=[],t=[],n=/^\p{M}$/u;for(let r=0;r<65536;r++){if(r>=55296&&r<=57343)continue;let i=String.fromCharCode(r);if(i.normalize(`NFKC`)!==i&&!n.test(i)){if(t.length!==2){t[0]=t[1]=r;continue}t[1]+1===r?t[1]=r:(t[0]===t[1]?e.push(String.fromCharCode(t[0])):e.push(`${String.fromCharCode(t[0])}-${String.fromCharCode(t[1])}`),t[0]=t[1]=r)}}let r=e.join(``);if(!Yo)Yo=r;else if(r!==Yo){for(let e=1;e<r.length;e++)if(r[e]!==Yo[e]){console.log(`Difference at index ${e}: U+${r.charCodeAt(e).toString(16).toUpperCase().padStart(4,`0`)}!== U+${Yo.charCodeAt(e).toString(16).toUpperCase().padStart(4,`0`)}`);break}throw Error("getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.")}}return Yo}var Zo={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},Qo={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},Y={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},$o={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function es(e,t){let n=e.offsetParent;if(!n){console.error(`offsetParent is not set -- cannot scroll`);return}let r=e.offsetTop+e.clientTop,i=e.offsetLeft+e.clientLeft;for(;n.clientHeight===n.scrollHeight&&n.clientWidth===n.scrollWidth;)if(r+=n.offsetTop,i+=n.offsetLeft,n=n.offsetParent,!n)return;t&&(t.top!==void 0&&(r+=t.top),t.left!==void 0&&(i+=t.left,n.scrollLeft=i)),n.scrollTop=r}function ts(e,t,n=void 0){function r(){a=null;let n=e.scrollLeft,r=i.lastX;n!==r&&(i.right=n>r),i.lastX=n;let o=e.scrollTop,s=i.lastY;o!==s&&(i.down=o>s),i.lastY=o,t(i)}let i={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop},a=null;return e.addEventListener(`scroll`,()=>{a??=window.requestAnimationFrame(r)},{useCapture:!0,signal:n}),n?.addEventListener(`abort`,()=>window.cancelAnimationFrame(a),{once:!0}),i}function ns(e){let t=new Map;for(let[n,r]of new URLSearchParams(e))t.set(n.toLowerCase(),r);return t}var rs=/[\x00-\x1F]/g;function is(e,t=!1){return rs.test(e)?t?e.replaceAll(rs,e=>e===`\0`?``:` `):e.replaceAll(`\0`,``):e}function as(e,t,n=0){let r=n,i=e.length-1;if(i<0||!t(e[i]))return e.length;if(t(e[r]))return r;for(;r<i;){let n=r+i>>1,a=e[n];t(a)?i=n:r=n+1}return r}function os(e){if(Math.floor(e)===e)return[e,1];let t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];let n=e>1?t:e,r=0,i=1,a=1,o=1;for(;;){let e=r+a,t=i+o;if(t>8)break;n<=e/t?(a=e,o=t):(r=e,i=t)}return n-r/i<a/o-n?n===e?[r,i]:[i,r]:n===e?[a,o]:[o,a]}function ss(e,t){return e-e%t}function cs(e,t,n){if(e<2)return e;let r=t[e].div,i=r.offsetTop+r.clientTop;i>=n&&(r=t[e-1].div,i=r.offsetTop+r.clientTop);for(let n=e-2;n>=0&&(r=t[n].div,!(r.offsetTop+r.clientTop+r.clientHeight<=i));--n)e=n;return e}function ls(e,t){let n=e.percent-t.percent;return Math.abs(n)>.001?-n:e.id-t.id}function us({scrollEl:e,views:t,sortByVisibility:n=!1,horizontal:r=!1,rtl:i=!1}){let a=e.scrollTop,o=a+e.clientHeight,s=e.scrollLeft,c=s+e.clientWidth;function l(e){let t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>a}function u(e){let t=e.div,n=t.offsetLeft+t.clientLeft,r=n+t.clientWidth;return i?n<c:r>s}let d=[],f=new Set,p=t.length,m=as(t,r?u:l);m>0&&m<p&&!r&&(m=cs(m,t,a));let h=r?c:-1;for(let e=m;e<p;e++){let n=t[e],i=n.div,l=i.offsetLeft+i.clientLeft,u=i.offsetTop+i.clientTop,p=i.clientWidth,m=i.clientHeight,g=l+p,_=u+m;if(h===-1)_>=o&&(h=_);else if((r?l:u)>h)break;if(_<=a||u>=o||g<=s||l>=c)continue;let v=Math.max(0,a-u),y=Math.max(0,s-l),b=v+Math.max(0,_-o),x=y+Math.max(0,g-c),S=(m-b)/m,C=(p-x)/p,w=S*C*100|0;d.push({id:n.id,x:l,y:u,visibleArea:w===100?null:{minX:y,minY:v,maxX:Math.min(g,c)-l,maxY:Math.min(_,o)-u},view:n,percent:w,widthPercent:C*100|0}),f.add(n.id)}let g=d[0],_=d.at(-1);return n&&d.sort(ls),{first:g,last:_,views:d,ids:f}}function ds(e){return Number.isInteger(e)&&e%90==0}function fs(e){return Number.isInteger(e)&&Object.values(Y).includes(e)&&e!==Y.UNKNOWN}function ps(e){return Number.isInteger(e)&&Object.values($o).includes(e)&&e!==$o.UNKNOWN}function ms(e){return e.width<=e.height}new Promise(function(e){window.requestAnimationFrame(e)});var hs=document.documentElement.style,gs=class{#e=null;#t=null;#n=0;#r=null;#i=!0;constructor(e){this.#e=e.classList,this.#r=e.style}get percent(){return this.#n}set percent(e){this.#n=e,isNaN(e)?this.#e.add(`indeterminate`):(this.#e.remove(`indeterminate`),this.#r.setProperty(`--progressBar-percent`,`${this.#n}%`))}setWidth(e){if(!e)return;let t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&this.#r.setProperty(`--progressBar-end-offset`,`${t}px`)}setDisableAutoFetch(e=5e3){this.#n===100||isNaN(this.#n)||(this.#t&&clearTimeout(this.#t),this.show(),this.#t=setTimeout(()=>{this.#t=null,this.hide()},e))}hide(){this.#i&&(this.#i=!1,this.#e.add(`hidden`))}show(){this.#i||(this.#i=!0,this.#e.remove(`hidden`))}};function _s(e){let t=Y.VERTICAL,n=$o.NONE;switch(e){case`SinglePage`:t=Y.PAGE;break;case`OneColumn`:break;case`TwoPageLeft`:t=Y.PAGE;case`TwoColumnLeft`:n=$o.ODD;break;case`TwoPageRight`:t=Y.PAGE;case`TwoColumnRight`:n=$o.EVEN}return{scrollMode:t,spreadMode:n}}var vs=function(){let e=document.createElement(`div`);return e.style.width=`round(down, calc(1.6666666666666665 * 792px), 1px)`,e.style.width===`calc(1320px)`?Math.fround:e=>e}(),ys=`2837668c-d334-48d1-ba74-aa7deba483da`,bs=Object.freeze({internal:ys}),xs={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},Ss=new Map([[`‐`,`-`],[`‘`,`'`],[`’`,`'`],[`‚`,`'`],[`‛`,`'`],[`“`,`"`],[`”`,`"`],[`„`,`"`],[`‟`,`"`],[`¼`,`1/4`],[`½`,`1/2`],[`¾`,`3/4`]]),Cs=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]),ws,Ts=/\p{M}+/gu,Es=/([+^$|])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu,Ds=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,Os=new Map,ks=`[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]`,As=new Map,js=null,Ms=null;function Ns(e,t={}){let n=[],r;for(;(r=Ds.exec(e))!==null;){let{index:e}=r;for(let t of r[0]){let r=Os.get(t);r||(r=t.normalize(`NFD`).length,Os.set(t,r)),n.push([r,e++])}}let i=n.length>0,a=t.ignoreDashEOL??!1,o;if(!i&&js)o=js;else if(i&&Ms)o=Ms;else{let e=Ss.keys().join(``),t=Xo(),n=[`[${e}]`,`[${t}]`,`(?:゙|゚)\\n`,`\\p{M}+(?:-\\n)?`,`\\p{Ll}-\\n(?=\\p{Ll})|\\p{Lu}-\\n(?=\\p{L})`,`\\S-\\n`,`(?:\\p{Ideographic}|[぀-ヿ])\\n`,`\\n`,i?ks:`\\u0000`];o=new RegExp(n.map(e=>`(${e})`).join(`|`),`gmu`),i?Ms=o:js=o}let s=[];for(;(r=Ts.exec(e))!==null;)s.push([r[0].length,r.index]);let c=e.normalize(`NFD`),l=[0,0],u=0,d=0,f=0,p=0,m=0,h=!1;c=c.replace(o,(e,t,r,i,o,c,g,_,v,y,b)=>{if(b-=p,t){let e=Ss.get(t),n=e.length;for(let e=1;e<n;e++)l.push(b-f+e,f-e);return f-=n-1,e}if(r){let e=As.getOrInsertComputed(r,()=>r.normalize(`NFKC`)),t=e.length;for(let e=1;e<t;e++)l.push(b-f+e,f-e);return f-=t-1,e}if(i)return h=!0,b+m===s[u]?.[1]?++u:(l.push(b-1-f+1,f-1),--f,p+=1),l.push(b-f+1,f),p+=1,m+=1,i.charAt(0);if(o){let e=o.endsWith(`
55
+ `),t=e?o.length-2:o.length;h=!0;let n=t;b+m===s[u]?.[1]&&(n-=s[u][0],++u);for(let e=1;e<=n;e++)l.push(b-1-f+e,f-e);return f-=n,p+=n,e?(b+=t-1,l.push(b-f+1,1+f),f+=1,p+=1,m+=1,o.slice(0,t)):o}if(c){if(a)return p+=1,m+=1,c.slice(0,-1);let e=c.length-2;return l.push(b-f+e,1+f),f+=1,p+=1,m+=1,c.slice(0,-2)}if(g)return p+=1,m+=1,g.slice(0,-1);if(_){let e=_.length-1;return l.push(b-f+e,f),p+=1,m+=1,_.slice(0,-1)}if(v)return l.push(b-f+1,f-1),--f,p+=1,m+=1,` `;if(b+m===n[d]?.[1]){let e=n[d][0]-1;++d;for(let t=1;t<=e;t++)l.push(b-(f-t),f-t);f-=e,p+=e}return y}),l.push(c.length,f);let g=new Uint32Array(l.length>>1),_=new Int32Array(l.length>>1);for(let e=0,t=l.length;e<t;e+=2)g[e>>1]=l[e],_[e>>1]=l[e+1];return[c,[g,_],h]}function Ps(e,t,n){if(!e)return[t,n];let[r,i]=e,a=t,o=t+n-1,s=as(r,e=>e>=a);r[s]>a&&--s;let c=as(r,e=>e>=o,s);r[c]>o&&--c;let l=a+i[s];return[l,o+i[c]+1-l]}var Fs=class{#e=null;#t=!0;#n=0;#r=0;#i=null;#a=null;constructor({linkService:e,eventBus:t,delay:n=250,updateMatchesCountOnProgress:r=!0}){this._linkService=e,this._eventBus=t,this.#t=r,this.#n=n,this.onIsPageVisible=null,this.#s(),t.on(`find`,this.#o.bind(this),bs),t.on(`findbarclose`,this.#x.bind(this),bs),t.on(`pagesedited`,this.#b.bind(this),bs)}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#e}setDocument(e){this._pdfDocument&&this.#s(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}#o(e){if(!e)return;let t=this._pdfDocument,{type:n}=e;(this.#e===null||this.#l(e))&&(this._dirtyMatch=!0),this.#e=e,n!==`highlightallchange`&&this.#w(xs.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this.#f();let e=!this._highlightMatches,r=!!this._findTimeout;this._findTimeout&&=(clearTimeout(this._findTimeout),null),n?this._dirtyMatch?this.#h():n===`again`?(this.#h(),e&&this.#e.highlightAll&&this.#m()):n===`highlightallchange`?(r?this.#h():this._highlightMatches=!0,this.#m()):this.#h():this._findTimeout=setTimeout(()=>{this.#h(),this._findTimeout=null},this.#n)})}scrollMatchIntoView({element:e=null,pageIndex:t=-1,matchIndex:n=-1}){this._scrollMatches&&e&&n!==-1&&n===this._selected.matchIdx&&t!==-1&&t===this._selected.pageIdx&&(this._scrollMatches=!1,e.scrollIntoView({block:`start`,inline:`center`}))}#s(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#r=0,this.#e=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this.#i=null,this._firstPageCapability=Promise.withResolvers()}get#c(){let{query:e}=this.#e;return typeof e==`string`?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=Ns(e)),this._normalizedQuery):(e||[]).filter(Boolean).map(e=>Ns(e)[0])}#l(e){let t=e.query,n=this.#e.query,r=typeof t;if(r!==typeof n)return!0;if(r===`string`){if(t!==n)return!0}else if(JSON.stringify(t)!==JSON.stringify(n))return!0;switch(e.type){case`again`:let e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!(this.onIsPageVisible?.(e)??!0);case`highlightallchange`:return!1}return!0}#u(e,t){let{matchDiacritics:n}=this.#e,r=!1,i=(t,n)=>t===e?n:e.startsWith(t)?`${n}[ ]*`:e.endsWith(t)?`[ ]*${n}`:`[ ]*${n}[ ]*`;return e=e.replaceAll(Es,(e,a,o,s,c,l)=>a?i(a,RegExp.escape(a)):o?i(o,RegExp.escape(o)):s?`[ ]+`:n?c||l:c?Cs.has(c.charCodeAt(0))?c:``:t?(r=!0,`${l}\\p{M}*`):l),e.endsWith(`[ ]*`)&&(e=e.slice(0,e.length-4)),n&&t&&(ws||=String.fromCharCode(...Cs),r=!0,e=`${e}(?=[${ws}]|[^\\p{M}]|$)`),[r,e]}#d(e){if(!this.#e)return;let t=this.#c;if(t.length===0)return;let n=this._pageContents[e],r=this.match(t,n,e),i=this._pageMatches[e]=[],a=this._pageMatchesLength[e]=[],o=this._pageDiffs[e];r?.forEach(({index:e,length:t})=>{let[n,r]=Ps(o,e,t);r&&(i.push(n),a.push(r))}),this.#e.highlightAll&&this.#p(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this.#_());let s=i.length;this._matchesCountTotal+=s,this.#t?s>0&&this.#C():++this.#r===this._linkService.pagesCount&&this.#C()}match(e,t,n){let r=this._hasDiacritics[n],i=!1;if(typeof e==`string`?[i,e]=this.#u(e,r):e=e.sort().reverse().map(e=>{let[t,n]=this.#u(e,r);return i||=t,`(${n})`}).join(`|`),!e)return;let{caseSensitive:a,entireWord:o}=this.#e;e=new RegExp(e,`g${i?`u`:``}${a?``:`i`}`);let s=[],c;for(;(c=e.exec(t))!==null;)(!o||Jo(t,c.index,c[0].length))&&s.push({index:c.index,length:c[0].length});return s}#f(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve(),t={disableNormalization:!0},n=this._pdfDocument;for(let r=0,i=this._linkService.pagesCount;r<i;r++){let{promise:i,resolve:a}=Promise.withResolvers();this._extractTextPromises[r]=i,e=e.then(async()=>{if(n!==this._pdfDocument)a();else{try{let e=await(await n.getPage(r+1)).getTextContent(t);if(n!==this._pdfDocument){a();return}let i=[];for(let t of e.items)i.push(t.str),t.hasEOL&&i.push(`
56
+ `);[this._pageContents[r],this._pageDiffs[r],this._hasDiacritics[r]]=Ns(i.join(``))}catch(e){if(n!==this._pdfDocument){a();return}console.error(`Unable to get text content for page ${r+1}`,e),[this._pageContents[r],this._pageDiffs[r],this._hasDiacritics[r]]=[``,null,!1]}a()}})}}#p(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch(`updatetextlayermatches`,{source:this,pageIndex:e})}#m(){this._eventBus.dispatch(`updatetextlayermatches`,{source:this,pageIndex:-1})}#h(){let e=this.#e.findPrevious,t=this._linkService.page-1,n=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#r=0,this._matchesCountTotal=0,this.#m();for(let e=0;e<n;e++)this._pendingFindMatches.has(e)||(this._pendingFindMatches.add(e),this._extractTextPromises[e].then(()=>{this._pendingFindMatches.delete(e),this.#d(e)}))}if(this.#c.length===0){this.#w(xs.FOUND);return}if(this._resumePageIdx)return;let r=this._offset;if(this._pagesToSearch=n,r.matchIdx!==null){let t=this._pageMatches[r.pageIdx].length;if(!e&&r.matchIdx+1<t||e&&r.matchIdx>0){r.matchIdx=e?r.matchIdx-1:r.matchIdx+1,this.#y(!0);return}this.#v(e)}this.#_()}#g(e){let t=this._offset,n=e.length,r=this.#e.findPrevious;return n?(t.matchIdx=r?n-1:0,this.#y(!0),!0):(this.#v(r),t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0)?(this.#y(!1),!0):!1)}#_(){this._resumePageIdx!==null&&console.error(`There can only be one pending page.`);let e=null;do{let t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this.#g(e))}#v(e){let t=this._offset,n=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=n||t.pageIdx<0)&&(t.pageIdx=e?n-1:0,t.wrapped=!0)}#y(e=!1){let t=xs.NOT_FOUND,n=this._offset.wrapped;if(this._offset.wrapped=!1,e){let e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=n?xs.WRAPPED:xs.FOUND,e!==-1&&e!==this._selected.pageIdx&&this.#p(e)}this.#w(t,this.#e.findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,this.#p(this._selected.pageIdx))}#b({pagesMapper:e,type:t,pageNumbers:n}){if(this._extractTextPromises.length===0)return;if(t===`copy`){let e=new Map,t=new Map,r=new Map,i=new Map;for(let a of n)e.set(a,this._extractTextPromises[a-1]),t.set(a,this._pageContents[a-1]),r.set(a,this._pageDiffs[a-1]),i.set(a,this._hasDiacritics[a-1]);this.#i={promises:e,contents:t,diffs:r,diacritics:i};return}if(t===`cancelCopy`){this.#i=null;return}if(t===`delete`&&(this.#a={promises:this._extractTextPromises,contents:this._pageContents,diffs:this._pageDiffs,diacritics:this._hasDiacritics}),t===`cancelDelete`){this._extractTextPromises=this.#a.promises,this._pageContents=this.#a.contents,this._pageDiffs=this.#a.diffs,this._hasDiacritics=this.#a.diacritics;return}if(t===`cleanSavedData`){this.#a=null;return}this._findTimeout&&=(clearTimeout(this._findTimeout),null),this._resumePageIdx=null,this._dirtyMatch=!0;let r=this._extractTextPromises,i=this._pageContents,a=this._pageDiffs,o=this._hasDiacritics,s=this._extractTextPromises=[],c=this._pageContents=[],l=this._pageDiffs=[],u=this._hasDiacritics=[];for(let t=1,n=e.pagesNumber;t<=n;t++){let n=e.getPrevPageNumber(t);if(n<0){let e=-n;s.push(this.#i?.promises.get(e)||Promise.resolve()),c.push(this.#i?.contents.get(e)??``),l.push(this.#i?.diffs.get(e)??null),u.push(this.#i?.diacritics.get(e)??!1)}else s.push(r[n-1]||Promise.resolve()),c.push(i[n-1]??``),l.push(a[n-1]??null),u.push(o[n-1]??!1)}this.#e&&this.#h()}#x(e){let t=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&=(clearTimeout(this._findTimeout),null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#w(xs.FOUND),this._highlightMatches=!1,this.#m())})}#S(){let{pageIdx:e,matchIdx:t}=this._selected,n=0,r=this._matchesCountTotal;if(t!==-1){for(let t=0;t<e;t++)n+=this._pageMatches[t]?.length||0;n+=t+1}return(n<1||n>r)&&(n=r=0),{current:n,total:r}}#C(){this._eventBus.dispatch(`updatefindmatchescount`,{source:this,matchesCount:this.#S()})}#w(e,t=!1){(this.#t||this.#r===this._linkService.pagesCount&&e!==xs.PENDING)&&this._eventBus.dispatch(`updatefindcontrolstate`,{source:this,state:e,previous:t,entireWord:this.#e?.entireWord??null,matchesCount:this.#S(),rawQuery:this.#e?.query??null})}},Is=`noopener noreferrer nofollow`,Ls={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},Rs=class{externalLinkEnabled=!0;constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:n=null,ignoreDestinationZoom:r=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=n,this._ignoreDestinationZoom=r,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?.pagesMapper.pagesNumber||0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(e){this.pdfDocument&&(this.pdfViewer.currentPageNumber=e)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(e){this.pdfDocument&&(this.pdfViewer.pagesRotation=e)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}async goToDestination(e){if(!this.pdfDocument)return;let t,n,r;if(typeof e==`string`?(t=e,n=await this.pdfDocument.getDestination(e)):(t=null,n=await e),!Array.isArray(n)){console.error(`goToDestination: "${n}" is not a valid destination array, for dest="${e}".`);return}let[i]=n;if(i&&typeof i==`object`){if(r=this.pdfDocument.cachedPageNumber(i),!r)try{r=await this.pdfDocument.getPageIndex(i)+1}catch{console.error(`goToDestination: "${i}" is not a valid page reference, for dest="${e}".`);return}}else Number.isInteger(i)&&(r=i+1);if(!r||r<1||r>this.pagesCount){console.error(`goToDestination: "${r}" is not a valid page number, for dest="${e}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:n,pageNumber:r})),this.pdfViewer.scrollPageIntoView({pageNumber:r,destArray:n,ignoreDestinationZoom:this._ignoreDestinationZoom});let a=new AbortController;this.eventBus.on(`textlayerrendered`,e=>{e.pageNumber===r&&(e.source.textLayer.div.focus(),a.abort())},{signal:a.signal,...bs})}goToPage(e){if(!this.pdfDocument)return;let t=typeof e==`string`&&this.pdfViewer.pageLabelToPageNumber(e)||e|0;Number.isInteger(t)&&t>0&&t<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})):console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}goToXY(e,t,n,r={}){this.pdfViewer.scrollPageIntoView({pageNumber:e,destArray:[null,{name:`XYZ`},t,n],ignoreDestinationZoom:!0,...r})}async getAttachmentContent(e){try{return await this.pdfDocument?.getAttachmentContent(e)}catch(e){e instanceof So||console.warn(`Unable to load attachment content: ${e}`)}return null}addLinkAttributes(e,t,n=!1){if(!t||typeof t!=`string`)throw Error(`A valid "url" parameter must provided.`);let r=n?Ls.BLANK:this.externalLinkTarget,i=this.externalLinkRel,a=t,o=URL.parse(t);(o?.username||o?.password)&&(o.username=o.password=``,a=o.href),this.externalLinkEnabled?(e.href=t,e.title=a):(e.href=``,e.title=`Disabled: ${a}`,e.onclick=()=>!1);let s=``;switch(r){case Ls.NONE:break;case Ls.SELF:s=`_self`;break;case Ls.BLANK:s=`_blank`;break;case Ls.PARENT:s=`_parent`;break;case Ls.TOP:s=`_top`}e.target=s,e.rel=typeof i==`string`?i:Is}getDestinationHash(e){if(typeof e==`string`){if(e.length>0)return this.getAnchorUrl(`#`+escape(e))}else if(Array.isArray(e)){let t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl(`#`+escape(t))}return this.getAnchorUrl(``)}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){if(!this.pdfDocument)return;let t,n;if(e.includes(`=`)){let r=ns(e);if(r.has(`search`)){let e=r.get(`search`).replaceAll(`"`,``),t=r.get(`phrase`)===`true`;this.eventBus.dispatch(`findfromurlhash`,{source:this,query:t?e:e.match(/\S+/g)})}if(r.has(`page`)&&(t=r.get(`page`)|0||1),r.has(`zoom`)){let e=r.get(`zoom`).split(`,`),t=e[0],i=parseFloat(t);t.includes(`Fit`)?t===`Fit`||t===`FitB`?n=[null,{name:t}]:t===`FitH`||t===`FitBH`||t===`FitV`||t===`FitBV`?n=[null,{name:t},e.length>1?e[1]|0:null]:t===`FitR`?e.length===5?n=[null,{name:t},e[1]|0,e[2]|0,e[3]|0,e[4]|0]:console.error(`PDFLinkService.setHash: Not enough parameters for "FitR".`):console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):n=[null,{name:`XYZ`},e.length>1?e[1]|0:null,e.length>2?e[2]|0:null,i?i/100:t]}n?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:n,allowNegativeOffset:!0}):t&&(this.page=t),r.has(`pagemode`)&&this.eventBus.dispatch(`pagemode`,{source:this,mode:r.get(`pagemode`)}),r.has(`nameddest`)&&this.goToDestination(r.get(`nameddest`))}else{n=unescape(e);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch{}typeof n==`string`||fo(n)?this.goToDestination(n):console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){if(this.pdfDocument){switch(e){case`GoBack`:this.pdfHistory?.back();break;case`GoForward`:this.pdfHistory?.forward();break;case`NextPage`:this.pdfViewer.nextPage();break;case`PrevPage`:this.pdfViewer.previousPage();break;case`LastPage`:this.page=this.pagesCount;break;case`FirstPage`:this.page=1}this.eventBus.dispatch(`namedaction`,{source:this,action:e})}}async executeSetOCGState(e){if(!this.pdfDocument)return;let t=this.pdfDocument,n=await this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(n.setOCGState(e),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(n))}},zs=class extends Rs{setDocument(e,t=null){}},Bs=class{#e=null;#t=null;#n=null;#r=null;#i=!1;constructor({pdfPage:e,linkService:t,downloadManager:n,annotationStorage:r=null,imageResourcesPath:i=``,renderForms:a=!0,enableComment:o=!1,commentManager:s=null,enableScripting:c=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:u=null,annotationCanvasMap:d=null,accessibilityManager:f=null,annotationEditorUIManager:p=null,onAppend:m=null}){this.pdfPage=e,this.linkService=t,this.downloadManager=n,this.imageResourcesPath=i,this.renderForms=a,this.annotationStorage=r,this.enableComment=o,this.#t=s,this.enableScripting=c,this._hasJSActionsPromise=l||Promise.resolve(!1),this._fieldObjectsPromise=u||Promise.resolve(null),this._annotationCanvasMap=d,this._accessibilityManager=f,this._annotationEditorUIManager=p,this.#n=m,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}async render({viewport:e,intent:t=`display`,structTreeLayer:n=null,optionalContentConfigPromise:r=null}){if(this.div){let t=await r;if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:e.clone({dontFlip:!0}),optionalContentConfig:t});return}let[i,a,o,s]=await Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise,this._fieldObjectsPromise,r]);if(this._cancelled)return;let c=this.div=document.createElement(`div`);c.className=`annotationLayer`,this.#n?.(c),this.#a(e,n),i.length===0?(this.#e=i,Mo(this.div,e)):(await this.annotationLayer.render({annotations:i,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,downloadManager:this.downloadManager,enableComment:this.enableComment,enableScripting:this.enableScripting,hasJSActions:a,fieldObjects:o,optionalContentConfig:s}),this.#e=i,this.linkService.isInPresentationMode&&this.#o(Zo.FULLSCREEN),this.#r||(this.#r=new AbortController,this._eventBus?.on(`presentationmodechanged`,e=>{this.#o(e.state)},{signal:this.#r.signal,...bs})))}#a(e,t){this.annotationLayer=new Va({div:this.div,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,annotationStorage:this.annotationStorage,page:this.pdfPage,viewport:e.clone({dontFlip:!0}),structTreeLayer:t,commentManager:this.#t,linkService:this.linkService})}cancel(){this._cancelled=!0,this.#r?.abort(),this.#r=null,this.annotationLayer?.destroy()}refreshCanvases(){this.annotationLayer?.refreshCanvases()}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}async injectLinkAnnotations(e){if(this.#e===null)throw Error("`render` method must be called before `injectLinkAnnotations`.");if(this._cancelled||this.#i)return;this.#i=!0;let t=this.#e.length?this.#s(e):e;t.length&&await this.annotationLayer.addLinkAnnotations(t)}#o(e){if(!this.div)return;let t=!1;switch(e){case Zo.FULLSCREEN:t=!0;break;case Zo.NORMAL:break;default:return}for(let e of this.div.childNodes)e.hasAttribute(`data-internal-link`)||e.classList.contains(`mediaAnnotation`)||(e.inert=t)}#s(e){function t(e){if(!e.quadPoints)return[e.rect];let t=[];for(let n=2,r=e.quadPoints.length;n<r;n+=8){let r=e.quadPoints[n],i=e.quadPoints[n+1],a=e.quadPoints[n+2],o=e.quadPoints[n+3];t.push([a,o,r,i])}return t}function n(e,n){let r=[],i=t(e),a=t(n);for(let e of i)for(let t of a){let n=Vo.intersect(e,t);n&&r.push(n)}return r}function r(e){let t=0;for(let n of e)t+=Math.abs((n[2]-n[0])*(n[3]-n[1]));return t}return e.filter(e=>{let i;for(let a of this.#e){if(a.annotationType!==Ua.LINK)continue;let o=n(a,e);if(o.length!==0&&(i??=r(t(e)),r(o)/i>.5))return!1}return!0})}},Vs=class{#e=new WeakMap;_triggerDownload(e,t,n,r=!1){throw Error(`Not implemented: _triggerDownload`)}_getOpenDataUrl(e,t,n=null){throw Error(`Not implemented: _getOpenDataUrl`)}downloadData(e,t,n){let r=URL.createObjectURL(new Blob([e],{type:n}));this._triggerDownload(r,r,t,!0)}openOrDownloadData(e,t,n=null){let r=uo(t),i=r?`application/pdf`:``;if(r){let r=this.#e.getOrInsertComputed(e,()=>URL.createObjectURL(new Blob([e],{type:i})));try{let e=this._getOpenDataUrl(r,t,n);return window.open(e),!0}catch(t){console.error(`openOrDownloadData:`,t),URL.revokeObjectURL(r),this.#e.delete(e)}}return this.downloadData(e,t,i),!1}download(e,t,n){let r=e?URL.createObjectURL(new Blob([e],{type:`application/pdf`})):null;this._triggerDownload(r,t,n)}},Hs=class extends Vs{_triggerDownload(e,t,n,r=!1){if(!e&&!r){if(!qa(t,`http://example.com`))throw Error(`_triggerDownload - not a valid URL: ${t}`);e=t+`#pdfjs.action=download`}let i=document.createElement(`a`);i.href=e,i.target=`_parent`,`download`in i&&(i.download=n),(document.body||document.documentElement).append(i),i.click(),i.remove()}_getOpenDataUrl(e,t,n=null){throw Error("Opening data is not supported in `COMPONENTS` builds.")}},Us={EVENT:`event`,TIMEOUT:`timeout`};async function Ws({target:e,name:t,delay:n=0}){if(typeof e!=`object`||!(t&&typeof t==`string`)||!(Number.isInteger(n)&&n>=0))throw Error(`waitOnEventOrTimeout - invalid parameters.`);let{promise:r,resolve:i}=Promise.withResolvers(),a=new AbortController;function o(e){a.abort(),clearTimeout(l),i(e)}let s=e instanceof Gs?`on`:`addEventListener`,c=e instanceof Gs?{signal:a.signal,...bs}:{signal:a.signal};e[s](t,o.bind(null,Us.EVENT),c);let l=setTimeout(o.bind(null,Us.TIMEOUT),n);return r}var Gs=class{#e=new Map;constructor(){Object.seal(this)}on(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){console.error("Cannot use an `aborted` signal.");return}let a=()=>this.off(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.getOrInsertComputed(e,go).add({listener:t,internal:n?.internal===ys,once:n?.once===!0,rmAbort:r})}off(e,t,n=null){let r=this.#e.get(e),i=r?.keys().find(e=>e.listener===t);i&&(i.rmAbort?.(),r.delete(i))}dispatch(e,t){let n=this.#e.get(e);if(!n?.size)return;let r;for(let{listener:i,internal:a,once:o}of new Set(n))o&&this.off(e,i),a?i(t):(r??=[]).push(i);if(r)for(let e of r)e(t)}},Ks=class{constructor(e){this.value=e}valueOf(){return this.value}},X=class extends Ks{constructor(e=`???`){super(e)}toString(e){return`{${this.value}}`}},qs=class extends Ks{constructor(e,t={}){super(e),this.opts=t}toString(e){if(e)try{return e.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(t){e.reportError(t)}return this.value.toString(10)}},Js=class e extends Ks{static supportsValue(t){if(typeof t==`number`||t instanceof Date)return!0;if(t instanceof Ks)return e.supportsValue(t.valueOf());if(`Temporal`in globalThis){let e=globalThis.Temporal;if(t instanceof e.Instant||t instanceof e.PlainDateTime||t instanceof e.PlainDate||t instanceof e.PlainMonthDay||t instanceof e.PlainTime||t instanceof e.PlainYearMonth)return!0}return!1}constructor(t,n={}){t instanceof e?(n={...t.opts,...n},t=t.value):t instanceof Ks&&(t=t.valueOf()),typeof t==`object`&&`calendarId`in t&&n.calendar===void 0&&(n={...n,calendar:t.calendarId}),super(t),this.opts=n}[Symbol.toPrimitive](e){return e===`string`?this.toString():this.toNumber()}toNumber(){let e=this.value;if(typeof e==`number`)return e;if(e instanceof Date)return e.getTime();if(`epochMilliseconds`in e)return e.epochMilliseconds;if(`toZonedDateTime`in e)return e.toZonedDateTime(`UTC`).epochMilliseconds;throw TypeError(`Unwrapping a non-number value as a number`)}toString(e){if(e)try{return e.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(t){e.reportError(t)}return typeof this.value==`number`||this.value instanceof Date?new Date(this.value).toISOString():this.value.toString()}},Ys=100,Xs=`⁨`,Zs=`⁩`;function Qs(e,t,n){return n===t||n instanceof qs&&t instanceof qs&&n.value===t.value||t instanceof qs&&typeof n==`string`&&n===e.memoizeIntlObject(Intl.PluralRules,t.opts).select(t.value)}function $s(e,t,n){return t[n]?cc(e,t[n].value):(e.reportError(RangeError(`No default`)),new X)}function ec(e,t){let n=[],r=Object.create(null);for(let i of t)i.type===`narg`?r[i.name]=tc(e,i.value):n.push(tc(e,i));return{positional:n,named:r}}function tc(e,t){switch(t.type){case`str`:return t.value;case`num`:return new qs(t.value,{minimumFractionDigits:t.precision});case`var`:return nc(e,t);case`mesg`:return rc(e,t);case`term`:return ic(e,t);case`func`:return ac(e,t);case`select`:return oc(e,t);default:return new X}}function nc(e,{name:t}){let n;if(e.params){if(Object.prototype.hasOwnProperty.call(e.params,t))n=e.params[t];else return new X(`$${t}`)}else if(e.args&&Object.prototype.hasOwnProperty.call(e.args,t))n=e.args[t];else return e.reportError(ReferenceError(`Unknown variable: $${t}`)),new X(`$${t}`);if(n instanceof Ks)return n;switch(typeof n){case`string`:return n;case`number`:return new qs(n);case`object`:if(Js.supportsValue(n))return new Js(n);default:return e.reportError(TypeError(`Variable type not supported: $${t}, ${typeof n}`)),new X(`$${t}`)}}function rc(e,{name:t,attr:n}){let r=e.bundle._messages.get(t);if(!r)return e.reportError(ReferenceError(`Unknown message: ${t}`)),new X(t);if(n){let i=r.attributes[n];return i?cc(e,i):(e.reportError(ReferenceError(`Unknown attribute: ${n}`)),new X(`${t}.${n}`))}return r.value?cc(e,r.value):(e.reportError(ReferenceError(`No value: ${t}`)),new X(t))}function ic(e,{name:t,attr:n,args:r}){let i=`-${t}`,a=e.bundle._terms.get(i);if(!a)return e.reportError(ReferenceError(`Unknown term: ${i}`)),new X(i);if(n){let t=a.attributes[n];if(t){e.params=ec(e,r).named;let n=cc(e,t);return e.params=null,n}return e.reportError(ReferenceError(`Unknown attribute: ${n}`)),new X(`${i}.${n}`)}e.params=ec(e,r).named;let o=cc(e,a.value);return e.params=null,o}function ac(e,{name:t,args:n}){let r=e.bundle._functions[t];if(!r)return e.reportError(ReferenceError(`Unknown function: ${t}()`)),new X(`${t}()`);if(typeof r!=`function`)return e.reportError(TypeError(`Function ${t}() is not callable`)),new X(`${t}()`);try{let t=ec(e,n);return r(t.positional,t.named)}catch(n){return e.reportError(n),new X(`${t}()`)}}function oc(e,{selector:t,variants:n,star:r}){let i=tc(e,t);if(i instanceof X)return $s(e,n,r);for(let t of n)if(Qs(e,i,tc(e,t.key)))return cc(e,t.value);return $s(e,n,r)}function sc(e,t){if(e.dirty.has(t))return e.reportError(RangeError(`Cyclic reference`)),new X;e.dirty.add(t);let n=[],r=e.bundle._useIsolating&&t.length>1;for(let i of t)if(typeof i==`string`)n.push(e.bundle._transform(i));else{if(e.placeables++,e.placeables>Ys)throw e.dirty.delete(t),RangeError(`Too many placeables expanded: ${e.placeables}, max allowed is ${Ys}`);r&&n.push(Xs),n.push(tc(e,i).toString(e)),r&&n.push(Zs)}return e.dirty.delete(t),n.join(``)}function cc(e,t){return typeof t==`string`?e.bundle._transform(t):sc(e,t)}var lc=class{constructor(e,t,n){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=e,this.errors=t,this.args=n}reportError(e){if(!this.errors||!(e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,t){let n=this.bundle._intls.get(e);n||(n={},this.bundle._intls.set(e,n));let r=JSON.stringify(t);return n[r]||(n[r]=new e(this.bundle.locales,t)),n[r]}};function uc(e,t){let n=Object.create(null);for(let[r,i]of Object.entries(e))t.includes(r)&&(n[r]=i.valueOf());return n}var dc=[`unitDisplay`,`currencyDisplay`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`];function fc(e,t){let n=e[0];if(n instanceof X)return new X(`NUMBER(${n.valueOf()})`);if(n instanceof qs)return new qs(n.valueOf(),{...n.opts,...uc(t,dc)});if(n instanceof Js)return new qs(n.toNumber(),{...uc(t,dc)});throw TypeError(`Invalid argument to NUMBER`)}var pc=[`dateStyle`,`timeStyle`,`fractionalSecondDigits`,`dayPeriod`,`hour12`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`];function mc(e,t){let n=e[0];if(n instanceof X)return new X(`DATETIME(${n.valueOf()})`);if(n instanceof Js||n instanceof qs)return new Js(n,uc(t,pc));throw TypeError(`Invalid argument to DATETIME`)}var hc=new Map;function gc(e){let t=Array.isArray(e)?e.join(` `):e,n=hc.get(t);return n===void 0&&(n=new Map,hc.set(t,n)),n}var _c=class{constructor(e,{functions:t,useIsolating:n=!0,transform:r=e=>e}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(e)?e:[e],this._functions={NUMBER:fc,DATETIME:mc,...t},this._useIsolating=n,this._transform=r,this._intls=gc(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:t=!1}={}){let n=[];for(let r=0;r<e.body.length;r++){let i=e.body[r];if(i.id.startsWith(`-`)){if(t===!1&&this._terms.has(i.id)){n.push(Error(`Attempt to override an existing term: "${i.id}"`));continue}this._terms.set(i.id,i)}else{if(t===!1&&this._messages.has(i.id)){n.push(Error(`Attempt to override an existing message: "${i.id}"`));continue}this._messages.set(i.id,i)}}return n}formatPattern(e,t=null,n=null){if(typeof e==`string`)return this._transform(e);let r=new lc(this,n,t);try{return sc(r,e).toString(r)}catch(e){if(r.errors&&e instanceof Error)return r.errors.push(e),new X().toString(r);throw e}}},vc=/^(-?[a-zA-Z][\w-]*) *= */gm,yc=/\.([a-zA-Z][\w-]*) *= */y,bc=/\*?\[/y,xc=/(-?[0-9]+(?:\.([0-9]+))?)/y,Sc=/([a-zA-Z][\w-]*)/y,Cc=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,wc=/^[A-Z][A-Z0-9_-]*$/,Tc=/([^{}\n\r]+)/y,Ec=/([^\\"\n\r]*)/y,Dc=/\\([\\"])/y,Oc=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,kc=/^\n+/,Ac=/ +$/,jc=/ *\r?\n/g,Mc=/( *)$/,Nc=/{\s*/y,Pc=/\s*}/y,Fc=/\[\s*/y,Ic=/\s*] */y,Lc=/\s*\(\s*/y,Rc=/\s*->\s*/y,zc=/\s*:\s*/y,Bc=/\s*,?\s*/y,Vc=/\s+/y,Hc=class{constructor(e){this.body=[],vc.lastIndex=0;let t=0;for(;;){let n=vc.exec(e);if(n===null)break;t=vc.lastIndex;try{this.body.push(s(n[1]))}catch(e){if(e instanceof SyntaxError)continue;throw e}}function n(n){return n.lastIndex=t,n.test(e)}function r(n,r){if(e[t]===n)return t++,!0;if(r)throw new r(`Expected ${n}`);return!1}function i(e,r){if(n(e))return t=e.lastIndex,!0;if(r)throw new r(`Expected ${e.toString()}`);return!1}function a(n){n.lastIndex=t;let r=n.exec(e);if(r===null)throw SyntaxError(`Expected ${n.toString()}`);return t=n.lastIndex,r}function o(e){return a(e)[1]}function s(e){let t=l(),n=c();if(t===null&&Object.keys(n).length===0)throw SyntaxError(`Expected message value or attributes`);return{id:e,value:t,attributes:n}}function c(){let e=Object.create(null);for(;n(yc);){let t=o(yc),n=l();if(n===null)throw SyntaxError(`Expected attribute value`);e[t]=n}return e}function l(){let r;if(n(Tc)&&(r=o(Tc)),e[t]===`{`||e[t]===`}`)return u(r?[r]:[],1/0);let i=x();return i?r?u([r,i],i.length):(i.value=S(i.value,kc),u([i],i.length)):r?S(r,Ac):null}function u(r=[],i){for(;;){if(n(Tc)){r.push(o(Tc));continue}if(e[t]===`{`){r.push(d());continue}if(e[t]===`}`)throw SyntaxError(`Unbalanced closing brace`);let a=x();if(a)r.push(a),i=Math.min(i,a.length);else break}let a=r.length-1,s=r[a];typeof s==`string`&&(r[a]=S(s,Ac));let c=[];for(let e of r)e instanceof Uc&&(e=e.value.slice(0,e.value.length-i)),e&&c.push(e);return c}function d(){i(Nc,SyntaxError);let e=f();if(i(Pc))return e;if(i(Rc)){let t=h();return i(Pc,SyntaxError),{type:`select`,selector:e,...t}}throw SyntaxError(`Unclosed placeable`)}function f(){if(e[t]===`{`)return d();if(n(Cc)){let[,e,t,n=null]=a(Cc);if(e===`$`)return{type:`var`,name:t};if(i(Lc)){let r=p();if(e===`-`)return{type:`term`,name:t,attr:n,args:r};if(wc.test(t))return{type:`func`,name:t,args:r};throw SyntaxError(`Function names must be all upper-case`)}return e===`-`?{type:`term`,name:t,attr:n,args:[]}:{type:`mesg`,name:t,attr:n}}return _()}function p(){let n=[];for(;;){switch(e[t]){case`)`:return t++,n;case void 0:throw SyntaxError(`Unclosed argument list`)}n.push(m()),i(Bc)}}function m(){let e=f();return e.type===`mesg`&&i(zc)?{type:`narg`,name:e.name,value:_()}:e}function h(){let e=[],t=0,i;for(;n(bc);){r(`*`)&&(i=t);let n=g(),a=l();if(a===null)throw SyntaxError(`Expected variant value`);e[t++]={key:n,value:a}}if(t===0)return null;if(i===void 0)throw SyntaxError(`Expected default variant`);return{variants:e,star:i}}function g(){i(Fc,SyntaxError);let e;return e=n(xc)?v():{type:`str`,value:o(Sc)},i(Ic,SyntaxError),e}function _(){if(n(xc))return v();if(e[t]===`"`)return y();throw SyntaxError(`Invalid expression`)}function v(){let[,e,t=``]=a(xc),n=t.length;return{type:`num`,value:parseFloat(e),precision:n}}function y(){r(`"`,SyntaxError);let n=``;for(;;)if(n+=o(Ec),e[t]===`\\`)n+=b();else{if(r(`"`))return{type:`str`,value:n};throw SyntaxError(`Unclosed string literal`)}}function b(){if(n(Dc))return o(Dc);if(n(Oc)){let[,e,t]=a(Oc),n=parseInt(e||t,16);return n<=55295||57344<=n?String.fromCodePoint(n):`�`}throw SyntaxError(`Unknown escape sequence`)}function x(){let n=t;switch(i(Vc),e[t]){case`.`:case`[`:case`*`:case`}`:case void 0:return!1;case`{`:return C(e.slice(n,t))}return e[t-1]===` `&&C(e.slice(n,t))}function S(e,t){return e.replace(t,``)}function C(e){let t=e.replace(jc,`
57
+ `),n=Mc.exec(e)[1].length;return new Uc(t,n)}}},Uc=class{constructor(e,t){this.value=e,this.length=t}},Wc=/<|&#?\w+;/,Gc={"http://www.w3.org/1999/xhtml":[`em`,`strong`,`small`,`s`,`cite`,`q`,`dfn`,`abbr`,`data`,`time`,`code`,`var`,`samp`,`kbd`,`sub`,`sup`,`i`,`b`,`u`,`mark`,`bdi`,`bdo`,`span`,`br`,`wbr`]},Kc={"http://www.w3.org/1999/xhtml":{global:[`title`,`aria-description`,`aria-label`,`aria-valuetext`],a:[`download`],area:[`download`,`alt`],input:[`alt`,`placeholder`],menuitem:[`label`],menu:[`label`],optgroup:[`label`],option:[`label`],track:[`label`],img:[`alt`],textarea:[`placeholder`],th:[`abbr`]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:[`accesskey`,`aria-label`,`aria-valuetext`,`label`,`title`,`tooltiptext`],description:[`value`],key:[`key`,`keycode`],label:[`value`],textbox:[`placeholder`,`value`]}};function qc(e,t){let{value:n}=t;if(typeof n==`string`){if(e.localName===`title`&&e.namespaceURI===`http://www.w3.org/1999/xhtml`)e.textContent=n;else if(!Wc.test(n))e.textContent=n;else{let t=e.ownerDocument.createElementNS(`http://www.w3.org/1999/xhtml`,`template`);t.innerHTML=n,Jc(t.content,e)}}Xc(t,e)}function Jc(e,t){for(let n of e.childNodes)if(n.nodeType!==n.TEXT_NODE){if(n.hasAttribute(`data-l10n-name`)){let r=Zc(t,n);e.replaceChild(r,n)}else if(el(n)){let t=Qc(n);e.replaceChild(t,n)}else console.warn(`An element of forbidden type "${n.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),e.replaceChild($c(n),n)}t.textContent=``,t.appendChild(e)}function Yc(e,t){if(!e)return!1;for(let n of e)if(n.name===t)return!0;return!1}function Xc(e,t){let n=t.hasAttribute(`data-l10n-attrs`)?t.getAttribute(`data-l10n-attrs`).split(`,`).map(e=>e.trim()):null;for(let r of Array.from(t.attributes))tl(r.name,t,n)&&!Yc(e.attributes,r.name)&&t.removeAttribute(r.name);if(e.attributes)for(let r of Array.from(e.attributes))tl(r.name,t,n)&&t.getAttribute(r.name)!==r.value&&t.setAttribute(r.name,r.value)}function Zc(e,t){let n=t.getAttribute(`data-l10n-name`),r=e.querySelector(`[data-l10n-name="${n}"]`);return r?r.localName===t.localName?(e.removeChild(r),nl(t,r.cloneNode(!1))):(console.warn(`An element named "${n}" was found in the translation but its type ${t.localName} didn't match the element found in the source (${r.localName}).`),$c(t)):(console.warn(`An element named "${n}" wasn't found in the source.`),$c(t))}function Qc(e){return nl(e,e.ownerDocument.createElement(e.localName))}function $c(e){return e.ownerDocument.createTextNode(e.textContent)}function el(e){let t=Gc[e.namespaceURI];return t&&t.includes(e.localName)}function tl(e,t,n=null){if(n&&n.includes(e))return!0;let r=Kc[t.namespaceURI];if(!r)return!1;let i=e.toLowerCase(),a=t.localName;if(r.global.includes(i))return!0;if(!r[a])return!1;if(r[a].includes(i))return!0;if(t.namespaceURI===`http://www.w3.org/1999/xhtml`&&a===`input`&&i===`value`){let e=t.type.toLowerCase();if(e===`submit`||e===`button`||e===`reset`)return!0}return!1}function nl(e,t){return t.textContent=e.textContent,Xc(e,t),t}var rl=class extends Array{static from(e){return e instanceof this?e:new this(e)}},il=class extends rl{constructor(e){if(super(),Symbol.asyncIterator in Object(e))this.iterator=e[Symbol.asyncIterator]();else if(Symbol.iterator in Object(e))this.iterator=e[Symbol.iterator]();else throw TypeError(`Argument must implement the iteration protocol.`)}[Symbol.asyncIterator](){let e=this,t=0;return{async next(){return e.length<=t&&e.push(e.iterator.next()),e[t++]}}}async touchNext(e=1){let t=0;for(;t++<e;){let e=this[this.length-1];if(e&&(await e).done)break;this.push(this.iterator.next())}return this[this.length-1]}},al=class{constructor(e=[],t){this.resourceIds=e,this.generateBundles=t,this.onChange(!0)}addResourceIds(e,t=!1){return this.resourceIds.push(...e),this.onChange(t),this.resourceIds.length}removeResourceIds(e){return this.resourceIds=this.resourceIds.filter(t=>!e.includes(t)),this.onChange(),this.resourceIds.length}async formatWithFallback(e,t){let n=[],r=!1;for await(let i of this.bundles){r=!0;let a=cl(t,i,e,n);if(a.size===0)break;if(typeof console<`u`){let e=i.locales[0],t=Array.from(a).join(`, `);console.warn(`[fluent] Missing translations in ${e}: ${t}`)}}return!r&&typeof console<`u`&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
58
+ keys: ${JSON.stringify(e)}.
59
+ resourceIds: ${JSON.stringify(this.resourceIds)}.`),n}formatMessages(e){return this.formatWithFallback(e,sl)}formatValues(e){return this.formatWithFallback(e,ol)}async formatValue(e,t){let[n]=await this.formatValues([{id:e,args:t}]);return n}handleEvent(){this.onChange()}onChange(e=!1){this.bundles=il.from(this.generateBundles(this.resourceIds)),e&&this.bundles.touchNext(2)}};function ol(e,t,n,r){return n.value?e.formatPattern(n.value,r,t):null}function sl(e,t,n,r){let i={value:null,attributes:null};n.value&&(i.value=e.formatPattern(n.value,r,t));let a=Object.keys(n.attributes);if(a.length>0){i.attributes=Array(a.length);for(let[o,s]of a.entries()){let a=e.formatPattern(n.attributes[s],r,t);i.attributes[o]={name:s,value:a}}}return i}function cl(e,t,n,r){let i=[],a=new Set;return n.forEach(({id:n,args:o},s)=>{if(r[s]!==void 0)return;let c=t.getMessage(n);if(c){if(i.length=0,r[s]=e(t,i,c,o),i.length>0&&typeof console<`u`){let e=t.locales[0],r=i.join(`, `);console.warn(`[fluent][resolver] errors in ${e}/${n}: ${r}.`)}}else a.add(n)}),a}var ll=`data-l10n-id`,ul=`data-l10n-args`,dl=`[${ll}]`,fl=class extends al{constructor(e,t){super(e,t),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[ll,ul]}}onChange(e=!1){super.onChange(e),this.roots&&this.translateRoots()}setAttributes(e,t,n){return e.setAttribute(ll,t),n?e.setAttribute(ul,JSON.stringify(n)):e.removeAttribute(ul),e}getAttributes(e){return{id:e.getAttribute(ll),args:JSON.parse(e.getAttribute(ul)||null)}}connectRoot(e){for(let t of this.roots)if(t===e||t.contains(e)||e.contains(t))throw Error(`Cannot add a root that overlaps with existing root.`);if(this.windowElement){if(this.windowElement!==e.ownerDocument.defaultView)throw Error(`Cannot connect a root:
60
+ DOMLocalization already has a root from a different window.`)}else this.windowElement=e.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(e=>this.translateMutations(e));this.roots.add(e),this.mutationObserver.observe(e,this.observerConfig)}disconnectRoot(e){return this.roots.delete(e),this.pauseObserving(),this.roots.size===0?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){let e=Array.from(this.roots);return Promise.all(e.map(e=>this.translateFragment(e)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(let e of this.roots)this.mutationObserver.observe(e,this.observerConfig)}translateMutations(e){for(let t of e)switch(t.type){case`attributes`:t.target.hasAttribute(`data-l10n-id`)&&this.pendingElements.add(t.target);break;case`childList`:for(let e of t.addedNodes)if(e.nodeType===e.ELEMENT_NODE){if(e.childElementCount)for(let t of this.getTranslatables(e))this.pendingElements.add(t);else e.hasAttribute(ll)&&this.pendingElements.add(e)}}this.pendingElements.size>0&&this.pendingrAF===null&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(e){return this.translateElements(this.getTranslatables(e))}async translateElements(e){if(!e.length)return;let t=e.map(this.getKeysForElement),n=await this.formatMessages(t);return this.applyTranslations(e,n)}applyTranslations(e,t){this.pauseObserving();for(let n=0;n<e.length;n++)t[n]!==void 0&&qc(e[n],t[n]);this.resumeObserving()}getTranslatables(e){let t=Array.from(e.querySelectorAll(dl));return typeof e.hasAttribute==`function`&&e.hasAttribute(ll)&&t.push(e),t}getKeysForElement(e){return{id:e.getAttribute(ll),args:JSON.parse(e.getAttribute(ul)||null)}}},pl=class e{#e;#t;#n;#r;constructor({lang:t,isRTL:n},r=null){this.#n=e.#i(t),this.#r=r,this.#e=n??e.#a(this.#n)?`rtl`:`ltr`}_setL10n(e){this.#r=e}getLanguage(){return this.#n}getDirection(){return this.#e}async get(e,t=null){return Array.isArray(e)?(e=e.map(e=>({id:e})),(await this.#r.formatMessages(e)).map(e=>e.value)):(await this.#r.formatMessages([{id:e,args:t}]))[0]?.value}async translate(e){(this.#t||=new Set).add(e);try{this.#r.connectRoot(e),await this.#r.translateRoots()}catch{}}async translateOnce(e){try{await this.#r.translateElements([e])}catch(e){console.error(`translateOnce:`,e)}}async destroy(){if(this.#t){for(let e of this.#t)this.#r.disconnectRoot(e);this.#t.clear(),this.#t=null}this.#r.pauseObserving()}pause(){this.#r.pauseObserving()}resume(){this.#r.resumeObserving()}static#i(e){return e=e?.toLowerCase()||`en-us`,{en:`en-us`,es:`es-es`,fy:`fy-nl`,ga:`ga-ie`,gu:`gu-in`,hi:`hi-in`,hy:`hy-am`,nb:`nb-no`,ne:`ne-np`,nn:`nn-no`,pa:`pa-in`,pt:`pt-pt`,sv:`sv-se`,zh:`zh-cn`}[e]||e}static#a(e){let t=e.split(`-`,1)[0];return[`ar`,`he`,`fa`,`ps`,`ur`].includes(t)}};function ml(){let{isAndroid:e,isLinux:t,isMac:n,isWindows:r}=Za.platform;return t?`linux`:r?`windows`:n?`macos`:e?`android`:`other`}function hl(e,t){let n=new Hc(t),r=new _c(e,{functions:{PLATFORM:ml}}),i=r.addResource(n);return i.length&&console.error(`L10n errors`,i),r}var gl=class e extends pl{constructor(t){super({lang:t});let n=t?e.#e.bind(e,`en-us`,this.getLanguage()):e.#r.bind(e,this.getLanguage());this._setL10n(new fl([],n))}static async*#e(e,t){let{baseURL:n,paths:r}=await this.#n(),i=[t];if(e!==t){let n=t.split(`-`,1)[0];n!==t&&i.push(n),i.push(e)}let a=i.map(e=>[e,this.#t(e,n,r)]);for(let[e,t]of a){let n=await t;n?yield n:e===`en-us`&&(yield this.#i(e))}}static async#t(e,t,n){let r=n[e];return r?hl(e,await Qa(new URL(r,t),`text`)):null}static async#n(){try{let{href:e}=document.querySelector(`link[type="application/l10n"]`),t=await Qa(e,`json`);return{baseURL:e.substring(0,e.lastIndexOf(`/`)+1)||`./`,paths:t}}catch{}return{baseURL:`./`,paths:Object.create(null)}}static async*#r(e){yield this.#i(e)}static async#i(e){return hl(e,`pdfjs-previous-button =
61
+ .title = Previous Page
62
+ pdfjs-previous-button-label = Previous
63
+ pdfjs-next-button =
64
+ .title = Next Page
65
+ pdfjs-next-button-label = Next
66
+ pdfjs-page-input =
67
+ .title = Page
68
+ pdfjs-of-pages = of { $pagesCount }
69
+ pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })
70
+ pdfjs-zoom-out-button =
71
+ .title = Zoom Out
72
+ pdfjs-zoom-out-button-label = Zoom Out
73
+ pdfjs-zoom-in-button =
74
+ .title = Zoom In
75
+ pdfjs-zoom-in-button-label = Zoom In
76
+ pdfjs-zoom-select =
77
+ .title = Zoom
78
+ pdfjs-presentation-mode-button =
79
+ .title = Switch to Presentation Mode
80
+ pdfjs-presentation-mode-button-label = Presentation Mode
81
+ pdfjs-open-file-button =
82
+ .title = Open File
83
+ pdfjs-open-file-button-label = Open
84
+ pdfjs-print-button =
85
+ .title = Print
86
+ pdfjs-print-button-label = Print
87
+ pdfjs-save-button =
88
+ .title = Save
89
+ pdfjs-save-button-label = Save
90
+ pdfjs-download-button =
91
+ .title = Download
92
+ pdfjs-download-button-label = Download
93
+ pdfjs-bookmark-button =
94
+ .title = Current Page (View URL from Current Page)
95
+ pdfjs-bookmark-button-label = Current Page
96
+ pdfjs-tools-button =
97
+ .title = Tools
98
+ pdfjs-tools-button-label = Tools
99
+ pdfjs-first-page-button =
100
+ .title = Go to First Page
101
+ pdfjs-first-page-button-label = Go to First Page
102
+ pdfjs-last-page-button =
103
+ .title = Go to Last Page
104
+ pdfjs-last-page-button-label = Go to Last Page
105
+ pdfjs-page-rotate-cw-button =
106
+ .title = Rotate Clockwise
107
+ pdfjs-page-rotate-cw-button-label = Rotate Clockwise
108
+ pdfjs-page-rotate-ccw-button =
109
+ .title = Rotate Counterclockwise
110
+ pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise
111
+ pdfjs-cursor-text-select-tool-button =
112
+ .title = Enable Text Selection Tool
113
+ pdfjs-cursor-text-select-tool-button-label = Text Selection Tool
114
+ pdfjs-cursor-hand-tool-button =
115
+ .title = Enable Hand Tool
116
+ pdfjs-cursor-hand-tool-button-label = Hand Tool
117
+ pdfjs-scroll-page-button =
118
+ .title = Use Page Scrolling
119
+ pdfjs-scroll-page-button-label = Page Scrolling
120
+ pdfjs-scroll-vertical-button =
121
+ .title = Use Vertical Scrolling
122
+ pdfjs-scroll-vertical-button-label = Vertical Scrolling
123
+ pdfjs-scroll-horizontal-button =
124
+ .title = Use Horizontal Scrolling
125
+ pdfjs-scroll-horizontal-button-label = Horizontal Scrolling
126
+ pdfjs-scroll-wrapped-button =
127
+ .title = Use Wrapped Scrolling
128
+ pdfjs-scroll-wrapped-button-label = Wrapped Scrolling
129
+ pdfjs-spread-none-button =
130
+ .title = Do not join page spreads
131
+ pdfjs-spread-none-button-label = No Spreads
132
+ pdfjs-spread-odd-button =
133
+ .title = Join page spreads starting with odd-numbered pages
134
+ pdfjs-spread-odd-button-label = Odd Spreads
135
+ pdfjs-spread-even-button =
136
+ .title = Join page spreads starting with even-numbered pages
137
+ pdfjs-spread-even-button-label = Even Spreads
138
+ pdfjs-document-properties-button =
139
+ .title = Document Properties…
140
+ pdfjs-document-properties-button-label = Document Properties…
141
+ pdfjs-document-properties-file-name = File name:
142
+ pdfjs-document-properties-file-size = File size:
143
+ pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)
144
+ pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)
145
+ pdfjs-document-properties-title = Title:
146
+ pdfjs-document-properties-author = Author:
147
+ pdfjs-document-properties-subject = Subject:
148
+ pdfjs-document-properties-keywords = Keywords:
149
+ pdfjs-document-properties-creation-date = Creation Date:
150
+ pdfjs-document-properties-modification-date = Modification Date:
151
+ pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
152
+ pdfjs-document-properties-creator = Creator:
153
+ pdfjs-document-properties-producer = PDF Producer:
154
+ pdfjs-document-properties-version = PDF Version:
155
+ pdfjs-document-properties-page-count = Page Count:
156
+ pdfjs-document-properties-page-size = Page Size:
157
+ pdfjs-document-properties-page-size-unit-inches = in
158
+ pdfjs-document-properties-page-size-unit-millimeters = mm
159
+ pdfjs-document-properties-page-size-orientation-portrait = portrait
160
+ pdfjs-document-properties-page-size-orientation-landscape = landscape
161
+ pdfjs-document-properties-page-size-name-a-three = A3
162
+ pdfjs-document-properties-page-size-name-a-four = A4
163
+ pdfjs-document-properties-page-size-name-letter = Letter
164
+ pdfjs-document-properties-page-size-name-legal = Legal
165
+ pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation })
166
+ pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation })
167
+ pdfjs-document-properties-linearized = Fast Web View:
168
+ pdfjs-document-properties-linearized-yes = Yes
169
+ pdfjs-document-properties-linearized-no = No
170
+ pdfjs-document-properties-close-button = Close
171
+ pdfjs-print-progress-message = Preparing document for printing…
172
+ pdfjs-print-progress-percent = { $progress }%
173
+ pdfjs-print-progress-close-button = Cancel
174
+ pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.
175
+ pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.
176
+ pdfjs-current-outline-item-button =
177
+ .title = Find Current Outline Item
178
+ pdfjs-current-outline-item-button-label = Current Outline Item
179
+ pdfjs-findbar-button =
180
+ .title = Find in Document
181
+ pdfjs-findbar-button-label = Find
182
+ pdfjs-additional-layers = Additional Layers
183
+ pdfjs-thumb-page-title1 =
184
+ .title = Page { $page } of { $total }
185
+ pdfjs-thumb-page-canvas =
186
+ .aria-label = Thumbnail of Page { $page }
187
+ pdfjs-thumb-page-checkbox1 =
188
+ .title = Select page { $page }
189
+ pdfjs-find-input =
190
+ .title = Find
191
+ .placeholder = Find in document…
192
+ pdfjs-find-previous-button =
193
+ .title = Find the previous occurrence of the phrase
194
+ pdfjs-find-previous-button-label = Previous
195
+ pdfjs-find-next-button =
196
+ .title = Find the next occurrence of the phrase
197
+ pdfjs-find-next-button-label = Next
198
+ pdfjs-find-highlight-checkbox = Highlight All
199
+ pdfjs-find-match-case-checkbox-label = Match Case
200
+ pdfjs-find-match-diacritics-checkbox-label = Match Diacritics
201
+ pdfjs-find-entire-word-checkbox-label = Whole Words
202
+ pdfjs-find-reached-top = Reached top of document, continued from bottom
203
+ pdfjs-find-reached-bottom = Reached end of document, continued from top
204
+ pdfjs-find-match-count =
205
+ { $total ->
206
+ [one] { $current } of { $total } match
207
+ *[other] { $current } of { $total } matches
208
+ }
209
+ pdfjs-find-match-count-limit =
210
+ { $limit ->
211
+ [one] More than { $limit } match
212
+ *[other] More than { $limit } matches
213
+ }
214
+ pdfjs-find-not-found = Phrase not found
215
+ pdfjs-page-scale-width = Page Width
216
+ pdfjs-page-scale-fit = Page Fit
217
+ pdfjs-page-scale-auto = Automatic Zoom
218
+ pdfjs-page-scale-actual = Actual Size
219
+ pdfjs-page-scale-percent = { $scale }%
220
+ pdfjs-page-landmark =
221
+ .aria-label = Page { $page }
222
+ pdfjs-loading-error = An error occurred while loading the PDF.
223
+ pdfjs-invalid-file-error = Invalid or corrupted PDF file.
224
+ pdfjs-missing-file-error = Missing PDF file.
225
+ pdfjs-unexpected-response-error = Unexpected server response.
226
+ pdfjs-rendering-error = An error occurred while rendering the page.
227
+ pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
228
+ pdfjs-text-annotation-type =
229
+ .alt = [{ $type } Annotation]
230
+ pdfjs-password-label = Enter the password to open this PDF file.
231
+ pdfjs-password-invalid = Invalid password. Please try again.
232
+ pdfjs-password-ok-button = OK
233
+ pdfjs-password-cancel-button = Cancel
234
+ pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.
235
+ pdfjs-editor-free-text-button =
236
+ .title = Text
237
+ pdfjs-editor-color-picker-free-text-input =
238
+ .title = Change text color
239
+ pdfjs-editor-free-text-button-label = Text
240
+ pdfjs-editor-ink-button =
241
+ .title = Draw
242
+ pdfjs-editor-color-picker-ink-input =
243
+ .title = Change drawing color
244
+ pdfjs-editor-ink-button-label = Draw
245
+ pdfjs-editor-stamp-button =
246
+ .title = Add or edit images
247
+ pdfjs-editor-stamp-button-label = Add or edit images
248
+ pdfjs-editor-highlight-button =
249
+ .title = Highlight
250
+ pdfjs-editor-highlight-button-label = Highlight
251
+ pdfjs-highlight-floating-button1 =
252
+ .title = Highlight
253
+ .aria-label = Highlight
254
+ pdfjs-highlight-floating-button-label = Highlight
255
+ pdfjs-comment-floating-button =
256
+ .title = Comment
257
+ .aria-label = Comment
258
+ pdfjs-comment-floating-button-label = Comment
259
+ pdfjs-editor-comment-button =
260
+ .title = Comment
261
+ .aria-label = Comment
262
+ pdfjs-editor-comment-button-label = Comment
263
+ pdfjs-editor-signature-button =
264
+ .title = Add signature
265
+ pdfjs-editor-signature-button-label = Add signature
266
+ pdfjs-editor-highlight-editor =
267
+ .aria-label = Highlight editor
268
+ pdfjs-editor-ink-editor =
269
+ .aria-label = Drawing editor
270
+ pdfjs-editor-signature-editor1 =
271
+ .aria-description = Signature editor: { $description }
272
+ pdfjs-editor-stamp-editor =
273
+ .aria-label = Image editor
274
+ pdfjs-editor-remove-ink-button =
275
+ .title = Remove drawing
276
+ pdfjs-editor-remove-freetext-button =
277
+ .title = Remove text
278
+ pdfjs-editor-remove-stamp-button =
279
+ .title = Remove image
280
+ pdfjs-editor-remove-highlight-button =
281
+ .title = Remove highlight
282
+ pdfjs-editor-remove-signature-button =
283
+ .title = Remove signature
284
+ pdfjs-editor-free-text-color-input = Color
285
+ pdfjs-editor-free-text-size-input = Size
286
+ pdfjs-editor-ink-color-input = Color
287
+ pdfjs-editor-ink-thickness-input = Thickness
288
+ pdfjs-editor-ink-opacity-input = Opacity
289
+ pdfjs-editor-stamp-add-image-button =
290
+ .title = Add image
291
+ pdfjs-editor-stamp-add-image-button-label = Add image
292
+ pdfjs-editor-free-highlight-thickness-input = Thickness
293
+ pdfjs-editor-free-highlight-thickness-title =
294
+ .title = Change thickness when highlighting items other than text
295
+ pdfjs-editor-add-signature-container =
296
+ .aria-label = Signature controls and saved signatures
297
+ pdfjs-editor-signature-add-signature-button =
298
+ .title = Add new signature
299
+ pdfjs-editor-signature-add-signature-button-label = Add new signature
300
+ pdfjs-editor-add-saved-signature-button =
301
+ .title = Saved signature: { $description }
302
+ pdfjs-free-text2 =
303
+ .aria-label = Text Editor
304
+ .default-content = Start typing…
305
+ pdfjs-editor-comments-sidebar-title =
306
+ { $count ->
307
+ [one] Comment
308
+ *[other] Comments
309
+ }
310
+ pdfjs-editor-comments-sidebar-close-button =
311
+ .title = Close the sidebar
312
+ .aria-label = Close the sidebar
313
+ pdfjs-editor-comments-sidebar-close-button-label = Close the sidebar
314
+ pdfjs-editor-comments-sidebar-no-comments1 = See something noteworthy? Highlight it and leave a comment.
315
+ pdfjs-editor-comments-sidebar-no-comments-link = Learn more
316
+ pdfjs-editor-alt-text-button =
317
+ .aria-label = Alt text
318
+ pdfjs-editor-alt-text-button-label = Alt text
319
+ pdfjs-editor-alt-text-edit-button =
320
+ .aria-label = Edit alt text
321
+ pdfjs-editor-alt-text-dialog-label = Choose an option
322
+ pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load.
323
+ pdfjs-editor-alt-text-add-description-label = Add a description
324
+ pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.
325
+ pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative
326
+ pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.
327
+ pdfjs-editor-alt-text-cancel-button = Cancel
328
+ pdfjs-editor-alt-text-save-button = Save
329
+ pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative
330
+ pdfjs-editor-alt-text-textarea =
331
+ .placeholder = For example, “A young man sits down at a table to eat a meal”
332
+ pdfjs-editor-resizer-top-left =
333
+ .aria-label = Top left corner — resize
334
+ pdfjs-editor-resizer-top-middle =
335
+ .aria-label = Top middle — resize
336
+ pdfjs-editor-resizer-top-right =
337
+ .aria-label = Top right corner — resize
338
+ pdfjs-editor-resizer-middle-right =
339
+ .aria-label = Middle right — resize
340
+ pdfjs-editor-resizer-bottom-right =
341
+ .aria-label = Bottom right corner — resize
342
+ pdfjs-editor-resizer-bottom-middle =
343
+ .aria-label = Bottom middle — resize
344
+ pdfjs-editor-resizer-bottom-left =
345
+ .aria-label = Bottom left corner — resize
346
+ pdfjs-editor-resizer-middle-left =
347
+ .aria-label = Middle left — resize
348
+ pdfjs-editor-highlight-colorpicker-label = Highlight color
349
+ pdfjs-editor-colorpicker-button =
350
+ .title = Change color
351
+ pdfjs-editor-colorpicker-dropdown =
352
+ .aria-label = Color choices
353
+ pdfjs-editor-colorpicker-yellow =
354
+ .title = Yellow
355
+ pdfjs-editor-colorpicker-green =
356
+ .title = Green
357
+ pdfjs-editor-colorpicker-blue =
358
+ .title = Blue
359
+ pdfjs-editor-colorpicker-pink =
360
+ .title = Pink
361
+ pdfjs-editor-colorpicker-red =
362
+ .title = Red
363
+ pdfjs-editor-highlight-show-all-button-label = Show all
364
+ pdfjs-editor-highlight-show-all-button =
365
+ .title = Show all
366
+ pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)
367
+ pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)
368
+ pdfjs-editor-new-alt-text-textarea =
369
+ .placeholder = Write your description here…
370
+ pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load.
371
+ pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.
372
+ pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more
373
+ pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically
374
+ pdfjs-editor-new-alt-text-not-now-button = Not now
375
+ pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically
376
+ pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.
377
+ pdfjs-editor-new-alt-text-error-close-button = Close
378
+ pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
379
+ .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)
380
+ pdfjs-editor-new-alt-text-added-button =
381
+ .aria-label = Alt text added
382
+ pdfjs-editor-new-alt-text-added-button-label = Alt text added
383
+ pdfjs-editor-new-alt-text-missing-button =
384
+ .aria-label = Missing alt text
385
+ pdfjs-editor-new-alt-text-missing-button-label = Missing alt text
386
+ pdfjs-editor-new-alt-text-to-review-button =
387
+ .aria-label = Review alt text
388
+ pdfjs-editor-new-alt-text-to-review-button-label = Review alt text
389
+ pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }
390
+ pdfjs-image-alt-text-settings-button =
391
+ .title = Image alt text settings
392
+ pdfjs-image-alt-text-settings-button-label = Image alt text settings
393
+ pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings
394
+ pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text
395
+ pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically
396
+ pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load.
397
+ pdfjs-editor-alt-text-settings-editor-title = Alt text editor
398
+ pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image
399
+ pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.
400
+ pdfjs-editor-alt-text-settings-close-button = Close
401
+ pdfjs-editor-highlight-added-alert = Highlight added
402
+ pdfjs-editor-freetext-added-alert = Text added
403
+ pdfjs-editor-ink-added-alert = Drawing added
404
+ pdfjs-editor-stamp-added-alert = Image added
405
+ pdfjs-editor-signature-added-alert = Signature added
406
+ pdfjs-editor-undo-bar-message-highlight = Highlight removed
407
+ pdfjs-editor-undo-bar-message-freetext = Text removed
408
+ pdfjs-editor-undo-bar-message-ink = Drawing removed
409
+ pdfjs-editor-undo-bar-message-stamp = Image removed
410
+ pdfjs-editor-undo-bar-message-signature = Signature removed
411
+ pdfjs-editor-undo-bar-message-comment = Comment removed
412
+ pdfjs-editor-undo-bar-message-multiple =
413
+ { $count ->
414
+ [one] { $count } annotation removed
415
+ *[other] { $count } annotations removed
416
+ }
417
+ pdfjs-editor-undo-bar-undo-button =
418
+ .title = Undo
419
+ pdfjs-editor-undo-bar-undo-button-label = Undo
420
+ pdfjs-editor-undo-bar-close-button =
421
+ .title = Close
422
+ pdfjs-editor-undo-bar-close-button-label = Close
423
+ pdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.
424
+ pdfjs-editor-add-signature-dialog-title = Add a signature
425
+ pdfjs-editor-add-signature-type-button = Type
426
+ .title = Type
427
+ pdfjs-editor-add-signature-draw-button = Draw
428
+ .title = Draw
429
+ pdfjs-editor-add-signature-image-button = Image
430
+ .title = Image
431
+ pdfjs-editor-add-signature-type-input =
432
+ .aria-label = Type your signature
433
+ .placeholder = Type your signature
434
+ pdfjs-editor-add-signature-draw-placeholder = Draw your signature
435
+ pdfjs-editor-add-signature-draw-thickness-range-label = Thickness
436
+ pdfjs-editor-add-signature-draw-thickness-range =
437
+ .title = Drawing thickness: { $thickness }
438
+ pdfjs-editor-add-signature-image-placeholder = Drag a file here to upload
439
+ pdfjs-editor-add-signature-image-browse-link =
440
+ { PLATFORM() ->
441
+ [macos] Or choose image files
442
+ *[other] Or browse image files
443
+ }
444
+ pdfjs-editor-add-signature-description-label = Description (alt text)
445
+ pdfjs-editor-add-signature-description-input =
446
+ .title = Description (alt text)
447
+ pdfjs-editor-add-signature-description-default-when-drawing = Signature
448
+ pdfjs-editor-add-signature-clear-button-label = Clear signature
449
+ pdfjs-editor-add-signature-clear-button =
450
+ .title = Clear signature
451
+ pdfjs-editor-add-signature-save-checkbox = Save signature
452
+ pdfjs-editor-add-signature-save-warning-message = You’ve reached the limit of 5 saved signatures. Remove one to save more.
453
+ pdfjs-editor-add-signature-image-upload-error-title = Couldn’t upload image
454
+ pdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.
455
+ pdfjs-editor-add-signature-image-no-data-error-title = Can’t convert this image into a signature
456
+ pdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.
457
+ pdfjs-editor-add-signature-error-close-button = Close
458
+ pdfjs-editor-add-signature-cancel-button = Cancel
459
+ pdfjs-editor-add-signature-add-button = Add
460
+ pdfjs-editor-delete-signature-button1 =
461
+ .title = Remove saved signature
462
+ pdfjs-editor-delete-signature-button-label1 = Remove saved signature
463
+ pdfjs-editor-add-signature-edit-button-label = Edit description
464
+ pdfjs-editor-edit-signature-dialog-title = Edit description
465
+ pdfjs-editor-edit-signature-update-button = Update
466
+ pdfjs-show-comment-button =
467
+ .title = Show comment
468
+ pdfjs-editor-edit-comment-popup-button-label = Edit comment
469
+ pdfjs-editor-edit-comment-popup-button =
470
+ .title = Edit comment
471
+ pdfjs-editor-delete-comment-popup-button-label = Remove comment
472
+ pdfjs-editor-delete-comment-popup-button =
473
+ .title = Remove comment
474
+ pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment
475
+ pdfjs-editor-edit-comment-dialog-save-button-when-editing = Update
476
+ pdfjs-editor-edit-comment-dialog-title-when-adding = Add comment
477
+ pdfjs-editor-edit-comment-dialog-save-button-when-adding = Add
478
+ pdfjs-editor-edit-comment-dialog-text-input =
479
+ .placeholder = Start typing…
480
+ pdfjs-editor-edit-comment-dialog-cancel-button = Cancel
481
+ pdfjs-editor-add-comment-button =
482
+ .title = Add comment
483
+ pdfjs-toggle-views-manager-button1 =
484
+ .title = Manage pages
485
+ pdfjs-toggle-views-manager-notification-button =
486
+ .title = Toggle Sidebar (document contains thumbnails/outline/attachments/layers)
487
+ pdfjs-toggle-views-manager-button1-label = Manage pages
488
+ pdfjs-views-manager-sidebar =
489
+ .aria-label = Sidebar
490
+ pdfjs-views-manager-sidebar-resizer =
491
+ .aria-label = Sidebar resizer
492
+ pdfjs-views-manager-view-selector-button =
493
+ .title = Views
494
+ pdfjs-views-manager-view-selector-button-label = Views
495
+ pdfjs-views-manager-pages-title = Pages
496
+ pdfjs-views-manager-outlines-title1 = Document outline
497
+ .title = Document outline (double-click to expand/collapse all items)
498
+ pdfjs-views-manager-attachments-title = Attachments
499
+ pdfjs-views-manager-layers-title1 = Layers
500
+ .title = Layers (double-click to reset all layers to the default state)
501
+ pdfjs-views-manager-pages-option-label = Pages
502
+ pdfjs-views-manager-outlines-option-label = Document outline
503
+ pdfjs-views-manager-attachments-option-label = Attachments
504
+ pdfjs-views-manager-layers-option-label = Layers
505
+ pdfjs-views-manager-add-file-button =
506
+ .title = Add file
507
+ pdfjs-views-manager-add-file-button-label = Add file
508
+ pdfjs-views-manager-pages-status-action-label =
509
+ { $count ->
510
+ [one] { $count } selected
511
+ *[other] { $count } selected
512
+ }
513
+ pdfjs-views-manager-pages-status-none-action-label = Select pages
514
+ pdfjs-views-manager-pages-status-action-button-label = Manage
515
+ pdfjs-views-manager-pages-status-copy-button-label = Copy
516
+ pdfjs-views-manager-pages-status-cut-button-label = Cut
517
+ pdfjs-views-manager-pages-status-delete-button-label = Delete
518
+ pdfjs-views-manager-pages-status-export-selected-button-label = Export selected…
519
+ pdfjs-views-manager-status-undo-cut-label =
520
+ { $count ->
521
+ [one] 1 page cut
522
+ *[other] { $count } pages cut
523
+ }
524
+ pdfjs-views-manager-pages-status-undo-copy-label =
525
+ { $count ->
526
+ [one] 1 page copied
527
+ *[other] { $count } pages copied
528
+ }
529
+ pdfjs-views-manager-pages-status-undo-delete-label =
530
+ { $count ->
531
+ [one] 1 page deleted
532
+ *[other] { $count } pages deleted
533
+ }
534
+ pdfjs-views-manager-status-undo-button-label = Undo
535
+ pdfjs-views-manager-status-done-button-label = Done
536
+ pdfjs-views-manager-status-close-button =
537
+ .title = Close
538
+ pdfjs-views-manager-status-close-button-label = Close
539
+ pdfjs-views-manager-paste-button-label = Paste
540
+ pdfjs-views-manager-paste-button-before =
541
+ .title = Paste before the first page
542
+ pdfjs-views-manager-paste-button-after =
543
+ .title = Paste after page { $page }
544
+ pdfjs-new-badge-content = NEW
545
+ pdfjs-views-manager-waiting-for-file = Uploading file…
546
+ pdfjs-digital-signature-properties-button =
547
+ .title = Digital signature properties
548
+ .aria-label = Digital signature properties
549
+ pdfjs-digital-signature-properties-button-label = Digital signature properties
550
+ pdfjs-digital-signature-properties-banner-verified = Document was signed with a valid digital signature
551
+ pdfjs-digital-signature-properties-banner-unknown =
552
+ { $count ->
553
+ [one] Document signed but { $count } digital signature could not be verified
554
+ *[other] Document signed but { $count } digital signatures could not be verified
555
+ }
556
+ pdfjs-digital-signature-properties-banner-untrusted =
557
+ { $count ->
558
+ [one] Document signed with { $count } certificate that is not trusted
559
+ *[other] Document signed with { $count } certificates that are not trusted
560
+ }
561
+ pdfjs-digital-signature-properties-banner-expired =
562
+ { $count ->
563
+ [one] Document signed with { $count } expired certificate
564
+ *[other] Document signed with { $count } expired certificates
565
+ }
566
+ pdfjs-digital-signature-properties-banner-invalid =
567
+ { $count ->
568
+ [one] Document has { $count } invalid digital signature
569
+ *[other] Document has { $count } invalid digital signatures
570
+ }
571
+ pdfjs-digital-signature-properties-banner-revoked =
572
+ { $count ->
573
+ [one] Document signed with { $count } revoked certificate
574
+ *[other] Document signed with { $count } revoked certificates
575
+ }
576
+ pdfjs-digital-signature-properties-status-verified = Status: Signature verified
577
+ pdfjs-digital-signature-properties-status-invalid = Status: Signature invalid
578
+ pdfjs-digital-signature-properties-status-unknown = Status: Unable to verify (unsupported)
579
+ pdfjs-digital-signature-properties-certificate-trusted = Certificate: Trusted ({ $issuer })
580
+ pdfjs-digital-signature-properties-certificate-unknown = Certificate: Unavailable
581
+ pdfjs-digital-signature-properties-certificate-untrusted = Certificate: Untrusted
582
+ pdfjs-digital-signature-properties-certificate-untrusted-unknown-issuer = Certificate: Unknown issuer ({ $issuer })
583
+ pdfjs-digital-signature-properties-certificate-untrusted-self-signed = Certificate: Self-signed ({ $issuer })
584
+ pdfjs-digital-signature-properties-certificate-untrusted-untrusted-issuer = Certificate: Untrusted issuer ({ $issuer })
585
+ pdfjs-digital-signature-properties-certificate-expired = Certificate: Expired
586
+ pdfjs-digital-signature-properties-certificate-expired-with-date = Certificate: Expired ({ DATETIME($dateObj, dateStyle: "medium") })
587
+ pdfjs-digital-signature-properties-certificate-revoked = Certificate: Revoked
588
+ pdfjs-digital-signature-properties-view-certificate = View certificate
589
+ pdfjs-digital-signature-properties-reason = Reason: { $reason }
590
+ pdfjs-digital-signature-properties-timestamp = Timestamp: { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
591
+ pdfjs-digital-signature-properties-sub-signatures =
592
+ { $count ->
593
+ [one] Sub-signature ({ $count })
594
+ *[other] Sub-signatures ({ $count })
595
+ }`)}},_l=1e3,vl=50,yl=1e3;function bl(){return document.location.hash}var xl=class{#e=null;constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint=``,this.reset(),this.eventBus.on(`pagesinit`,()=>{this._isPagesLoaded=!1,this.eventBus.on(`pagesloaded`,e=>{this._isPagesLoaded=!!e.pagesCount},{once:!0,...bs})},bs)}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:n=!1}){if(!e||typeof e!=`string`){console.error(`PDFHistory.initialize: The "fingerprint" must be a non-empty string.`);return}this._initialized&&this.reset();let r=this._fingerprint!==``&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=n===!0,this._initialized=!0,this.#u();let i=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=bl(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this.#i(i,!0)||t){let{hash:e,page:n,rotation:i}=this.#o(!0);if(!e||r||t){this.#t(null,!0);return}this.#t({hash:e,page:n,rotation:i},!0);return}let a=i.destination;this.#a(a,i.uid,!0),a.rotation!==void 0&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this.#l(),this._initialized=!1,this.#d()),this._updateViewareaTimeout&&=(clearTimeout(this._updateViewareaTimeout),null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:n}){if(!this._initialized)return;if(e&&typeof e!=`string`){console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);return}if(!Array.isArray(t)){console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);return}if(!this.#r(n)&&(n!==null||this._destination)){console.error(`PDFHistory.push: "${n}" is not a valid pageNumber parameter.`);return}let r=e||JSON.stringify(t);if(!r)return;let i=!1;if(this._destination&&(Sl(this._destination.hash,r)||Cl(this._destination.dest,t))){if(this._destination.page)return;i=!0}(!this._popStateInProgress||i)&&(this.#t({dest:t,hash:r,page:n,rotation:this.linkService.rotation},i),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(e){this._initialized&&(this.#r(e)?this._destination?.page!==e&&(this._popStateInProgress||(this.#t({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))):console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this.#n()}back(){if(!this._initialized||this._popStateInProgress)return;let e=window.history.state;this.#i(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;let e=window.history.state;this.#i(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}#t(e,t=!1){let n=t||!this._destination,r={fingerprint:this._fingerprint,uid:n?this._uid:this._uid+1,destination:e};this.#a(e,r.uid);let i;if(this._updateUrl&&e?.hash){let{href:t,protocol:n}=document.location;n!==`file:`&&(i=Bo(t,e.hash))}n?window.history.replaceState(r,``,i):window.history.pushState(r,``,i)}#n(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination){this.#t(t);return}if(this._destination.temporary){this.#t(t,!0);return}if(this._destination.hash===t.hash||!this._destination.page&&this._numPositionUpdates<=vl)return;let n=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest!==void 0||!this._destination.first)return;n=!0}this.#t(t,n)}#r(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}#i(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(t){if(typeof e.fingerprint!=`string`||e.fingerprint.length!==this._fingerprint.length)return!1;let[t]=performance.getEntriesByType(`navigation`);if(t?.type!==`reload`)return!1}else return!1}return!(!Number.isInteger(e.uid)||e.uid<0||e.destination===null||typeof e.destination!=`object`)}#a(e,t,n=!1){this._updateViewareaTimeout&&=(clearTimeout(this._updateViewareaTimeout),null),n&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}#o(e=!1){let t=unescape(bl()).substring(1),n=ns(t),r=n.get(`nameddest`)||``,i=n.get(`page`)|0;return(!this.#r(i)||e&&r.length>0)&&(i=null),{hash:t,page:i,rotation:this.linkService.rotation}}#s({location:e}){this._updateViewareaTimeout&&=(clearTimeout(this._updateViewareaTimeout),null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this.#n(!0),this._updateViewareaTimeout=null},yl))}#c({state:e}){let t=bl(),n=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;let{hash:e,page:t,rotation:n}=this.#o();this.#t({hash:e,page:t,rotation:n},!0);return}if(!this.#i(e))return;this._popStateInProgress=!0,n&&(this._blockHashChange++,Ws({target:window,name:`hashchange`,delay:_l}).then(()=>{this._blockHashChange--}));let r=e.destination;this.#a(r,e.uid,!0),ds(r.rotation)&&(this.linkService.rotation=r.rotation),r.dest?this.linkService.goToDestination(r.dest):r.hash?this.linkService.setHash(r.hash):r.page&&(this.linkService.page=r.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}#l(){(!this._destination||this._destination.temporary)&&this.#n()}#u(){if(this.#e)return;this.#e=new AbortController;let{signal:e}=this.#e;this.eventBus.on(`updateviewarea`,this.#s.bind(this),{signal:e,...bs}),window.addEventListener(`popstate`,this.#c.bind(this),{signal:e}),window.addEventListener(`pagehide`,this.#l.bind(this),{signal:e})}#d(){this.#e?.abort(),this.#e=null}};function Sl(e,t){return typeof e!=`string`||typeof t!=`string`?!1:e===t||ns(e).get(`nameddest`)===t}function Cl(e,t){function n(e,t){if(typeof e!=typeof t||Array.isArray(e)||Array.isArray(t))return!1;if(typeof e==`object`&&e&&t!==null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!n(e[r],t[r]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!(Array.isArray(e)&&Array.isArray(t))||e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}var wl=class{#e=null;#t=null;#n=null;#r=null;#i=null;#a;constructor(e){this.pageIndex=e.pageIndex,this.accessibilityManager=e.accessibilityManager,this.l10n=e.l10n,this.l10n||=new gl,this.annotationEditorLayer=null,this.div=null,this._cancelled=!1,this.#a=e.uiManager,this.#e=e.annotationLayer||null,this.#i=e.textLayer||null,this.#t=e.drawLayer||null,this.#n=e.onAppend||null,this.#r=e.structTreeLayer||null}updatePageIndex(e){this.pageIndex=e,this.annotationEditorLayer?.updatePageIndex(e)}async render({viewport:e,intent:t=`display`}){if(t!==`display`||this._cancelled)return;let n=e.clone({dontFlip:!0});if(this.div){this.annotationEditorLayer.update({viewport:n}),this.show();return}let r=this.div=document.createElement(`div`);r.className=`annotationEditorLayer`,r.hidden=!0,r.dir=this.#a.direction,this.#n?.(r),this.annotationEditorLayer=new La({uiManager:this.#a,div:r,structTreeLayer:this.#r,accessibilityManager:this.accessibilityManager,pageIndex:this.pageIndex,l10n:this.l10n,viewport:n,annotationLayer:this.#e,textLayer:this.#i,drawLayer:this.#t});let i={viewport:n,div:r,annotations:null,intent:t};await this.annotationEditorLayer.render(i),this.show()}update(e){this.div&&this.annotationEditorLayer.update({viewport:e.clone({dontFlip:!0})})}cancel(){this._cancelled=!0,this.div&&this.annotationEditorLayer.destroy()}hide(){this.div&&(this.annotationEditorLayer.pause(!0),this.div.hidden=!0)}show(){this.div&&!this.annotationEditorLayer.isInvisible&&(this.div.hidden=!1,this.annotationEditorLayer.pause(!1))}};{var Tl=new Map;let{maxTouchPoints:e,platform:t,userAgent:n}=navigator,r=/Android/.test(n);(/\b(?:iPad|iPhone|iPod)(?=;)/.test(n)||t===`MacIntel`&&e>1||r)&&Tl.set(`maxCanvasPixels`,5242880),r&&Tl.set(`useSystemFonts`,!1)}var Z={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},El={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},Dl=new Map([[`allowedGlobalEvents`,{value:null,kind:Z.BROWSER}],[`canvasMaxAreaInBytes`,{value:-1,kind:Z.BROWSER+Z.API}],[`isInAutomation`,{value:!1,kind:Z.BROWSER}],[`localeProperties`,{value:{lang:navigator.language||`en-US`},kind:Z.BROWSER}],[`maxCanvasDim`,{value:32767,kind:Z.BROWSER+Z.VIEWER}],[`nimbusDataStr`,{value:``,kind:Z.BROWSER}],[`supportsCaretBrowsingMode`,{value:!1,kind:Z.BROWSER}],[`supportsDocumentFonts`,{value:!0,kind:Z.BROWSER}],[`supportsDownloading`,{value:!0,kind:Z.BROWSER}],[`supportsIntegratedFind`,{value:!1,kind:Z.BROWSER}],[`supportsMouseWheelZoomCtrlKey`,{value:!0,kind:Z.BROWSER}],[`supportsMouseWheelZoomMetaKey`,{value:!0,kind:Z.BROWSER}],[`supportsPinchToZoom`,{value:!0,kind:Z.BROWSER}],[`supportsPrinting`,{value:!0,kind:Z.BROWSER}],[`toolbarDensity`,{value:0,kind:Z.BROWSER+Z.EVENT_DISPATCH}],[`altTextLearnMoreUrl`,{value:``,kind:Z.VIEWER+Z.PREFERENCE}],[`annotationEditorMode`,{value:0,kind:Z.VIEWER+Z.PREFERENCE}],[`annotationMode`,{value:2,kind:Z.VIEWER+Z.PREFERENCE}],[`capCanvasAreaFactor`,{value:200,kind:Z.VIEWER+Z.PREFERENCE}],[`commentLearnMoreUrl`,{value:``,kind:Z.VIEWER+Z.PREFERENCE}],[`cursorToolOnLoad`,{value:0,kind:Z.VIEWER+Z.PREFERENCE}],[`debuggerSrc`,{value:`./debugger.mjs`,kind:Z.VIEWER}],[`defaultUrl`,{value:`compressed.tracemonkey-pldi-09.pdf`,kind:Z.VIEWER}],[`defaultZoomDelay`,{value:400,kind:Z.VIEWER+Z.PREFERENCE}],[`defaultZoomValue`,{value:``,kind:Z.VIEWER+Z.PREFERENCE}],[`disableHistory`,{value:!1,kind:Z.VIEWER}],[`disablePageLabels`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`disablePreferences`,{value:!1,kind:Z.VIEWER}],[`enableAltText`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableAltTextModelDownload`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE+Z.EVENT_DISPATCH}],[`enableAutoLinking`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableComment`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableDetailCanvas`,{value:!0,kind:Z.VIEWER}],[`enableGuessAltText`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE+Z.EVENT_DISPATCH}],[`enableHighlightFloatingButton`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableMerge`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableNewAltTextWhenAddingImage`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableNewBadge`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableNova`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableOptimizedPartialRendering`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enablePermissions`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enablePrintAutoRotate`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableScripting`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableSelectionRendering`,{value:!0,kind:Z.VIEWER+Z.PREFERENCE}],[`enableSignatureEditor`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableSignatureVerification`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableSplitMerge`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`enableUpdatedAddImage`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`externalLinkRel`,{value:`noopener noreferrer nofollow`,kind:Z.VIEWER}],[`externalLinkTarget`,{value:0,kind:Z.VIEWER+Z.PREFERENCE}],[`highlightEditorColors`,{value:`yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043`,kind:Z.VIEWER+Z.PREFERENCE}],[`historyUpdateUrl`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`ignoreDestinationZoom`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`imageResourcesPath`,{value:`./images/`,kind:Z.VIEWER}],[`imagesRightClickMinSize`,{value:-1,kind:Z.VIEWER+Z.PREFERENCE}],[`maxCanvasPixels`,{value:2**25,kind:Z.VIEWER}],[`minDurationToUpdateCanvas`,{value:500,kind:Z.VIEWER}],[`forcePageColors`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`pageColorsBackground`,{value:`Canvas`,kind:Z.VIEWER+Z.PREFERENCE}],[`pageColorsForeground`,{value:`CanvasText`,kind:Z.VIEWER+Z.PREFERENCE}],[`pdfBugEnabled`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`postMessageAfterPrintCallback`,{value:!1,kind:Z.VIEWER+Z.PREFERENCE}],[`printResolution`,{value:150,kind:Z.VIEWER}],[`sandboxBundleSrc`,{value:`../build/pdf.sandbox.mjs`,kind:Z.VIEWER}],[`sidebarViewOnLoad`,{value:-1,kind:Z.VIEWER+Z.PREFERENCE}],[`scrollModeOnLoad`,{value:-1,kind:Z.VIEWER+Z.PREFERENCE}],[`spreadModeOnLoad`,{value:-1,kind:Z.VIEWER+Z.PREFERENCE}],[`textLayerMode`,{value:1,kind:Z.VIEWER+Z.PREFERENCE}],[`viewerCssTheme`,{value:0,kind:Z.VIEWER+Z.PREFERENCE}],[`viewOnLoad`,{value:0,kind:Z.VIEWER+Z.PREFERENCE}],[`cMapPacked`,{value:!0,kind:Z.API}],[`cMapUrl`,{value:`../web/cmaps/`,kind:Z.API}],[`disableAutoFetch`,{value:!1,kind:Z.API+Z.PREFERENCE}],[`disableFontFace`,{value:!1,kind:Z.API+Z.PREFERENCE}],[`disableRange`,{value:!1,kind:Z.API+Z.PREFERENCE}],[`disableStream`,{value:!1,kind:Z.API+Z.PREFERENCE}],[`docBaseUrl`,{value:``,kind:Z.API}],[`enableHWA`,{value:!0,kind:Z.API+Z.PREFERENCE}],[`enableWebGPU`,{value:!0,kind:Z.API+Z.PREFERENCE}],[`enableXfa`,{value:!0,kind:Z.API+Z.PREFERENCE}],[`fontExtraProperties`,{value:!1,kind:Z.API}],[`iccUrl`,{value:`../web/iccs/`,kind:Z.API}],[`isOffscreenCanvasSupported`,{value:!0,kind:Z.API}],[`maxImageSize`,{value:-1,kind:Z.API}],[`pdfBug`,{value:!1,kind:Z.API}],[`standardFontDataUrl`,{value:`../web/standard_fonts/`,kind:Z.API}],[`useSystemFonts`,{value:void 0,kind:Z.API,type:El.BOOLEAN+El.UNDEFINED}],[`verbosity`,{value:1,kind:Z.API}],[`wasmUrl`,{value:`../web/wasm/`,kind:Z.API}],[`workerPort`,{value:null,kind:Z.WORKER}],[`workerSrc`,{value:`../build/pdf.worker.mjs`,kind:Z.WORKER}]]),Ol=class{static eventBus;static#e=new Map;static{for(let[e,t]of Dl)this.#e.set(e,t.value);for(let[e,t]of Tl)this.#e.set(e,t);this._hasInvokedSet=!1,this._checkDisablePreferences=()=>this.get(`disablePreferences`)?!0:(this._hasInvokedSet&&console.warn(`The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.`),!1)}static get(e){return this.#e.get(e)}static getAll(e=null,t=!1){let n=Object.create(null);for(let[r,i]of Dl)(!e||e&i.kind)&&(n[r]=t?i.value:this.#e.get(r));return n}static set(e,t){this.setAll({[e]:t})}static setAll(e,t=!1){this._hasInvokedSet||=!0;let n;for(let r in e){let i=Dl.get(r),a=e[r];if(!i||!(typeof a==typeof i.value||El[(typeof a).toUpperCase()]&i.type))continue;let{kind:o}=i;(!t||o&Z.BROWSER||o&Z.PREFERENCE)&&(this.eventBus&&o&Z.EVENT_DISPATCH&&(n??=new Map).set(r,a),this.#e.set(r,a))}n?.forEach((e,t)=>{this.eventBus.dispatch(t.toLowerCase(),{source:this,value:e})})}};function kl({width:e,height:t,left:n,top:r},i){if(e===0||t===0)return null;let a=i.textLayer.div.getBoundingClientRect(),o=i.getPagePoint(n-a.left,r-a.top),s=i.getPagePoint(n-a.left+e,r-a.top+t);return Vo.normalizeRect([o[0],o[1],s[0],s[1]])}function Al(e,t){let n=e.getClientRects();if(n.length===1)return{rect:kl(n[0],t)};let r=[1/0,1/0,-1/0,-1/0],i=[],a=0;for(let e of n){let n=kl(e,t);n!==null&&(i[a]=i[a+4]=n[0],i[a+1]=i[a+3]=n[3],i[a+2]=i[a+6]=n[2],i[a+5]=i[a+7]=n[1],Vo.rectBoundingBox(...n,r),a+=8)}return{quadPoints:i,rect:r}}function jl(e,t){let n=e;do{if(n.nodeType===Node.TEXT_NODE){let e=n.textContent.length;if(t<=e)return[n,t];t-=e}else if(n.firstChild){n=n.firstChild;continue}for(;!n.nextSibling&&n!==e;)n=n.parentNode;n!==e&&(n=n.nextSibling)}while(n!==e);throw Error(`Offset is bigger than container's contents length.`)}function Ml({url:e,index:t,length:n},r,i){let a=r._textHighlighter,[{begin:o,end:s}]=a._convertMatches([t],[n]),c=new Range;return c.setStart(...jl(a.textDivs[o.divIdx],o.offset)),c.setEnd(...jl(a.textDivs[s.divIdx],s.offset)),{id:`inferred_link_${i}`,unsafeUrl:e,url:e,annotationType:Ua.LINK,rotation:0,...Al(c,r),borderStyle:null}}var Nl=class{static#e=0;static#t;static#n;static findLinks(e){this.#t??=RegExp(`\\b(?:https?:\\/\\/|mailto:|www\\.)(?:[\\S--[\\p{P}<>]]|\\/|[\\S--[\\[\\]]]+[\\S--[\\p{P}<>]])+|(?=\\p{L})[\\S--[@\\p{Ps}\\p{Pe}<>]]{1,64}@([\\S--[[\\p{P}--\\-]<>]]{1,63}(?:\\.[\\S--[[\\p{P}--\\-]<>]]{1,63})+)`,`gv`);let[t,n]=Ns(e,{ignoreDashEOL:!0}),r=t.matchAll(this.#t),i=[];for(let e of r){let[t,r]=e,a;if(t.startsWith(`www.`)||t.startsWith(`http://`)||t.startsWith(`https://`))a=t;else if(r){let e=URL.parse(`http://${r}`)?.hostname;if(!e||(this.#n??=/\.\d+$/,this.#n.test(e)))continue}a??=t.startsWith(`mailto:`)?t:`mailto:${t}`;let o=qa(a,null,{addDefaultProtocol:!0});if(o){let[r,a]=Ps(n,e.index,t.length);i.push({url:o.href,index:r,length:a})}}return i}static processLinks(e){return this.findLinks(e._textHighlighter.textContentItemsStr.join(`
596
+ `)).map(t=>Ml(t,e,this.#e++))}},Q={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},Pl=class{renderingId=``;renderTask=null;resume=null;get renderingState(){throw Error("Abstract getter `renderingState` accessed")}set renderingState(e){throw Error("Abstract setter `renderingState` accessed")}async draw(){throw Error(`Not implemented: draw`)}},Fl=class extends Pl{#e=null;#t=null;#n=Q.INITIAL;#r=null;#i=0;#a=null;canvas=null;div=null;enableOptimizedPartialRendering=!1;enableSelectionRendering=!0;imagesRightClickMinSize=-1;eventBus=null;id=null;imageCoordinates=null;pageColors=null;recordedBBoxes=null;renderingQueue=null;constructor(e){super(),this.eventBus=e.eventBus,this.id=e.id,this.pageColors=e.pageColors||null,this.renderingQueue=e.renderingQueue,this.enableOptimizedPartialRendering=e.enableOptimizedPartialRendering??!1,this.enableSelectionRendering=e.enableSelectionRendering!==!1&&Za.isBackdropFilterSupported,this.imagesRightClickMinSize=e.imagesRightClickMinSize??-1,this.minDurationToUpdateCanvas=e.minDurationToUpdateCanvas??500}get renderingState(){return this.#n}set renderingState(e){if(e!==this.#n)switch(this.#n=e,this.#e&&=(clearTimeout(this.#e),null),e){case Q.PAUSED:this.div.classList.remove(`loading`),this.#i=0,this.#r?.(!1);break;case Q.RUNNING:this.div.classList.add(`loadingIcon`),this.#e=setTimeout(()=>{this.div.classList.add(`loading`),this.#e=null},0),this.#i=Date.now();break;case Q.INITIAL:case Q.FINISHED:this.div.classList.remove(`loadingIcon`,`loading`),this.#i=0}}_createCanvas(e,t=!1){let{pageColors:n}=this,r=!!(n?.background&&n?.foreground),i=this.canvas,a=!i&&!r&&!t,o=this.canvas=document.createElement(`canvas`);return this.#r=t=>{if(a){let n=this.#a;if(!t&&this.minDurationToUpdateCanvas>0){if(Date.now()-this.#i<this.minDurationToUpdateCanvas)return;n||(n=this.#a=o,o=this.canvas=o.cloneNode(!1),e(o))}if(n){o.getContext(`2d`,{alpha:!1}).drawImage(n,0,0),t?this.#s():this.#i=Date.now();return}e(o),this.#r=null}else t&&(i?(i.replaceWith(o),i.width=i.height=0):e(o))},{canvas:o,prevCanvas:i}}#o=e=>{this.#r?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)?(this.renderingState=Q.PAUSED,this.resume=()=>{this.renderingState=Q.RUNNING,e()}):e()};_resetCanvas(){let{canvas:e}=this;e&&(e.remove(),e.width=e.height=0,this.canvas=null,this.#s())}#s(){this.#a&&=(this.#a.width=this.#a.height=0,null)}async _drawCanvas(e,t,n){let r=this.renderTask=this.pdfPage.render(e);r.onContinue=this.#o,r.onError=e=>{e instanceof ko&&(t(),this.#t=null)};let i=null;try{await r.promise,this.#r?.(!0)}catch(e){if(e instanceof ko)return;i=e,this.#r?.(!0)}finally{this.#t=i,r===this.renderTask&&(this.renderTask=null,this.enableOptimizedPartialRendering&&(this.recordedBBoxes??=r.recordedBBoxes),this.imagesRightClickMinSize!==-1&&(this.imageCoordinates??=this.pdfPage.imageCoordinates))}if(this.renderingState=Q.FINISHED,n(r),i)throw i}cancelRendering({cancelExtraDelay:e=0}={}){this.renderTask&&=(this.renderTask.cancel(e),null),this.resume=null}dispatchPageRender(){this.eventBus.dispatch(`pagerender`,{source:this,pageNumber:this.id})}dispatchPageRendered(e,t){this.eventBus.dispatch(`pagerendered`,{source:this,pageNumber:this.id,cssTransform:e,isDetailView:t,timestamp:performance.now(),error:this.#t})}},Il=class{#e=null;constructor(e){this.pageIndex=e.pageIndex,this.textLayer=e.textLayer||null,this.filterFactory=e.filterFactory||null,this.pageColors=e.pageColors||null}async render({intent:e=`display`}){e!==`display`||this.#e||this._cancelled||(this.#e=new Xa({pageIndex:this.pageIndex,textLayer:this.textLayer,filterFactory:this.filterFactory,pageColors:this.pageColors}))}cancel(){this._cancelled=!0,this.#e?.destroy(),this.#e=null}setParent(e){this.#e?.setParent(e)}getDrawLayer(){return this.#e}},Ll=class extends Fl{#e=null;renderingCancelled=!1;constructor({pageView:e}){super(e),this.pageView=e,this.renderingId=`detail`+this.id,this.div=e.div}setPdfPage(e){this.pageView.setPdfPage(e)}get pdfPage(){return this.pageView.pdfPage}get renderingState(){return super.renderingState}set renderingState(e){this.renderingCancelled=!1,super.renderingState=e}reset({keepCanvas:e=!1}={}){let t=this.renderingCancelled||this.renderingState===Q.RUNNING||this.renderingState===Q.PAUSED;this.cancelRendering(),this.renderingState=Q.INITIAL,this.renderingCancelled=t,e||this._resetCanvas()}#t(e){if(!this.#e)return!0;let t=this.#e.minX,n=this.#e.minY,r=this.#e.width+t,i=this.#e.height+n;if(e.minX<t||e.minY<n||e.maxX>r||e.maxY>i)return!0;let{width:a,height:o,scale:s}=this.pageView.viewport;if(this.#e.scale!==s)return!0;let c=e.minX-t,l=r-e.maxX,u=e.minY-n,d=i-e.maxY;return t>0&&l/c>3||r<a&&c/l>3||n>0&&d/u>3||i<o&&u/d>3}update({visibleArea:e=null,underlyingViewUpdated:t=!1}={}){if(t){this.cancelRendering(),this.renderingState=Q.INITIAL;return}if(!this.#t(e))return;let{viewport:n,maxCanvasPixels:r,capCanvasAreaFactor:i}=this.pageView,a=e.maxX-e.minX,o=e.maxY-e.minY,s=a*o*xo.pixelRatio**2,c=(Math.sqrt(xo.capPixels(r,i)/s)-1)/2,l=Math.min(1,c);l<0&&(l=0);let u=a*l,d=o*l,f=Math.max(0,e.minX-u),p=Math.min(n.width,e.maxX+u),m=Math.max(0,e.minY-d),h=Math.min(n.height,e.maxY+d),g=p-f,_=h-m;this.#e={minX:f,minY:m,width:g,height:_,scale:n.scale},this.reset({keepCanvas:!0})}_getRenderingContext(e,t){let n=this.pageView._getRenderingContext(e,t,!1),r=this.pdfPage.recordedBBoxes;if(!r||!this.enableOptimizedPartialRendering)return n;let{viewport:{width:i,height:a}}=this.pageView,{width:o,height:s,minX:c,minY:l}=this.#e,u=c/i,d=l/a,f=(c+o)/i,p=(l+s)/a;return{...n,operationsFilter(e){return!r.isEmpty(e)&&r.minX(e)<=f&&r.maxX(e)>=u&&r.minY(e)<=p&&r.maxY(e)>=d}}}async draw(){if(this.pageView.detailView!==this)return;let e=this.pageView.renderingState===Q.FINISHED||this.renderingState===Q.FINISHED;this.renderingState!==Q.INITIAL&&(console.error(`Must be in new state before drawing`),this.reset());let{div:t,pdfPage:n,viewport:r}=this.pageView;if(!n)throw this.renderingState=Q.FINISHED,Error(`pdfPage is not loaded`);this.renderingState=Q.RUNNING;let i=this.pageView._ensureCanvasWrapper(),{canvas:a,prevCanvas:o}=this._createCanvas(e=>{i.firstElementChild?.tagName===`CANVAS`?i.firstElementChild.after(e):i.prepend(e)},e);a.ariaHidden=!0,this.enableOptimizedPartialRendering&&(a.className=`detailView`);let{width:s,height:c}=r,l=this.#e,{pixelRatio:u}=xo,d=[u,0,0,u,-l.minX*u,-l.minY*u];a.width=l.width*u,a.height=l.height*u;let{style:f}=a;f.width=`${l.width*100/s}%`,f.height=`${l.height*100/c}%`,f.top=`${l.minY*100/c}%`,f.left=`${l.minX*100/s}%`;let p=this._drawCanvas(this._getRenderingContext(a,d),()=>{this.canvas?.remove(),this.canvas=o},()=>{this.pageView._refreshAnnotationLayer(),this.dispatchPageRendered(!1,!0)});return t.setAttribute(`data-loaded`,!0),this.dispatchPageRender(),p}},Rl={Document:null,DocumentFragment:null,Part:`group`,Art:`article`,Sect:`group`,Div:`group`,BlockQuote:`blockquote`,Aside:`note`,NonStruct:`none`,P:`paragraph`,H:`heading`,Title:null,FENote:`note`,Sub:`group`,Lbl:null,Span:null,Em:`emphasis`,Strong:`strong`,Note:`note`,Code:`code`,Link:`link`,Annot:`note`,Form:`form`,Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:`list`,LI:`listitem`,LBody:null,Table:`table`,TR:`row`,TH:`columnheader`,TD:`cell`,THead:`rowgroup`,TBody:`rowgroup`,TFoot:`rowgroup`,Caption:`caption`,Figure:`figure`,Formula:null,Artifact:null},zl=new Set([`caption`,`code`,`emphasis`,`generic`,`none`,`paragraph`,`strong`]),Bl=new Set(`math.merror.mfrac.mi.mmultiscripts.mn.mo.mover.mpadded.mprescripts.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msubsup.msup.mtable.mtd.mtext.mtr.munder.munderover.semantics`.split(`.`)),Vl=`http://www.w3.org/1998/Math/MathML`,Hl=class{static get sanitizer(){return No(this,`sanitizer`,Za.isSanitizerSupported?new Sanitizer({elements:Array.from(Bl.keys(),e=>({name:e,namespace:Vl})),replaceWithChildrenElements:[{name:`maction`,namespace:Vl}],attributes:`dir.displaystyle.mathbackground.mathcolor.mathsize.scriptlevel.encoding.display.linethickness.intent.arg.form.fence.separator.lspace.rspace.stretchy.symmetric.maxsize.minsize.largeop.movablelimits.width.height.depth.voffset.accent.accentunder.columnspan.rowspan`.split(`.`),comments:!1}):null)}},Ul=/^H(\d+)$/,Wl=class{#e;#t=null;#n;#r=new Set;#i=new Map;#a=new Map;#o=0;#s=`pdfjs_internal_struct_${ao()}_`;#c=new Map;#l=new Map;#u;#d=null;#f=null;#p=null;constructor(e,t){this.#e=e.getStructTree(),this.#u=t}async render(){if(this.#n)return this.#n;let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.#n=e;try{let e=await this.#e;this.#m(e),this.#h(e),this.#t=this.#x(e)}catch(e){n(e)}return this.#e=null,this.#t?.classList.add(`structTree`),t(this.#t),e}async getAriaAttributes(e,{enableLinkOwnership:t=!1}={}){try{await this.render();let n=this.#a.get(e);if(n&&t){let{element:t,ids:r}=n;t.removeAttribute(`role`),r.length>0&&this.#i.getOrInsertComputed(e,mo).set(`aria-owns`,r.join(` `)),this.#a.delete(e)}return this.#i.get(e)}catch{}return null}async getAnnotationIds(){try{return await this.render(),this.#r}catch{}return null}hide(){this.#t&&!this.#t.hidden&&(this.#t.hidden=!0)}show(){this.#t?.hidden&&(this.#t.hidden=!1)}#m(e){if(e){e.structId&&this.#l.getOrInsert(e.structId,e);for(let t of e.children||[])this.#m(t)}}#h(e){if(e){if(e.type===`annotation`)this.#r.add(e.id);else for(let t of e.children||[])this.#h(t)}}#g(e){return this.#c.getOrInsertComputed(e,()=>`${this.#s}${this.#c.size}`)}#_(e){let t=[],n=new Set,r=e.toReversed();for(;r.length>0;){let e=r.pop();if(n.has(e))continue;n.add(e);let i=this.#l.get(e);if(i?.role===`TH`&&(t.push(this.#g(e)),i.headers))for(let e=i.headers.length-1;e>=0;e--)r.push(i.headers[e])}return t}#v(e,t){let{alt:n,colSpan:r,headers:i,id:a,lang:o,rowSpan:s,short:c,structId:l,summary:u}=e;if(n!==void 0){let r=!1,i=is(n);for(let t of e.children)t.type===`annotation`&&(this.#i.getOrInsertComputed(t.id,mo).set(`aria-label`,i),r=!0);let a=t.getAttribute(`role`)||(t.localName===`span`?`generic`:null);!r&&a!==`none`&&t.setAttribute(zl.has(a)?`aria-description`:`aria-label`,i)}if(a!==void 0&&t.setAttribute(`aria-owns`,a),l!==void 0&&this.#l.get(l)===e){let e=this.#g(l);if(c!==void 0){let n=document.createElement(`span`);n.setAttribute(`id`,e),n.setAttribute(`aria-hidden`,`true`),n.textContent=is(c),t.append(n)}else t.setAttribute(`id`,e)}if(o!==void 0&&t.setAttribute(`lang`,is(o,!0)),s!==void 0&&t.setAttribute(`aria-rowspan`,s),r!==void 0&&t.setAttribute(`aria-colspan`,r),i?.length>0){let e=this.#_(i);e.length>0&&t.setAttribute(`aria-describedby`,e.join(` `))}u!==void 0&&t.setAttribute(`aria-description`,is(u))}#y(e,t){let{alt:n,bbox:r,children:i}=e,a=i?.[0];if(!this.#u||!n||!r||a?.type!==`content`)return!1;let{id:o}=a;if(!o)return!1;t.setAttribute(`aria-owns`,o);let s=document.createElement(`span`);(this.#d||=new Map).set(o,s),s.setAttribute(`role`,`img`),s.setAttribute(`aria-label`,is(n));let{pageHeight:c,pageX:l,pageY:u}=this.#u,d=`calc(var(--total-scale-factor) *`,{style:f}=s;return f.width=`${d}${r[2]-r[0]}px)`,f.height=`${d}${r[3]-r[1]}px)`,f.left=`${d}${r[0]-l}px)`,f.top=`${d}${c-r[3]+u}px)`,!0}updateTextLayer(){if(this.#d){for(let[e,t]of this.#d)document.getElementById(e)?.append(t);this.#d.clear(),this.#d=null}if(this.#f){for(let e of this.#f){let t=document.getElementById(e);t&&(t.ariaHidden=!0)}this.#f.length=0,this.#f=null}if(this.#p){for(let e=0,t=this.#p.length;e<t;e+=2){let t=this.#p[e],n=this.#p[e+1],r=``;for(let e of n){let t=document.getElementById(e);t&&(r+=t.textContent.trim()||``,t.ariaHidden=`true`)}r&&(t.textContent=r)}this.#p.length=0,this.#p=null}}#b(e,t){if(e){`id`in e&&t.push(e.id);for(let n of e.children||[])this.#b(n,t)}}#x(e,t=[]){if(!e)return null;let n,r=!0;if(`role`in e){let{role:i}=e;if(Bl.has(i)){n=document.createElementNS(Vl,i);let t=[];(this.#p||=[]).push(n,t);for(let{type:n,id:r}of e.children||[])n===`content`&&r&&t.push(r)}else n=document.createElement(`span`);let a=i.match(Ul);if(a)n.setAttribute(`role`,`heading`),n.setAttribute(`aria-level`,a[1]);else if(Rl[i]){let r=Rl[i];if(i===`TH`)e.scope===`Row`?r=`rowheader`:e.scope===`Column`?r=`columnheader`:t.at(-1)?.role===`TR`&&t.at(-2)?.role===`TBody`&&(r=`rowheader`);else if(i===`Caption`){let e=t.at(-1)?.role;e!==`Table`&&e!==`Figure`&&(r=null)}r&&n.setAttribute(`role`,r)}if(i===`Figure`&&this.#y(e,n))return n;i===`Formula`&&(e.mathML&&Hl.sanitizer&&(r=!1,n.setHTML(e.mathML,{sanitizer:Hl.sanitizer}),this.#b(e,this.#f||=[]),delete e.alt),!e.mathML&&e.children.length===1&&e.children[0].role!==`math`&&(n=document.createElementNS(Vl,`math`),delete e.alt))}if(n||=document.createElement(`span`),this.#v(e,n),e.children){if(e.children.length===1&&!(`role`in e.children[0])&&`id`in e.children[0]&&n.getAttribute(`role`)!==`none`)this.#v(e.children[0],n);else if(r){t.push(e);for(let r of e.children)n.append(this.#x(r,t));t.pop()}}if(e.role===`Link`){let t=e.children?.filter(e=>e.type===`annotation`);if(t?.length===1){let e=t[0],r=[];for(let t of n.children)t.getAttribute(`aria-owns`)!==e.id&&(t.id||=`${this.#s}link_${this.#o++}`,r.push(t.id));this.#a.set(e.id,{element:n,ids:r})}}return n}},Gl=class e{#e=!1;#t=null;#n=new Map;#r=new Map;setTextMapping(e){this.#t=e}static#i(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(n.width===0&&n.height===0)return 1;if(r.width===0&&r.height===0)return-1;let i=n.y,a=n.y+n.height,o=n.y+n.height/2,s=r.y,c=r.y+r.height,l=r.y+r.height/2;return o<=s&&l>=a?-1:l<=i&&o>=c?1:n.x+n.width/2-(r.x+r.width/2)}enable(){if(this.#e)throw Error(`TextAccessibilityManager is already enabled.`);if(!this.#t)throw Error(`Text divs and strings have not been set.`);if(this.#e=!0,this.#t=this.#t.slice(),this.#t.sort(e.#i),this.#n.size>0){let e=this.#t;for(let[t,n]of this.#n)document.getElementById(t)?this.#a(t,e[n]):this.#n.delete(t)}for(let[e,t]of this.#r)this.addPointerInTextLayer(e,t);this.#r.clear()}disable(){this.#e&&=(this.#r.clear(),this.#t=null,!1)}removePointerInTextLayer(e){if(!this.#e){this.#r.delete(e);return}let t=this.#t;if(!t?.length)return;let{id:n}=e,r=this.#n.get(n);if(r===void 0)return;let i=t[r];this.#n.delete(n);let a=i.getAttribute(`aria-owns`);a?.includes(n)&&(a=a.split(` `).filter(e=>e!==n).join(` `),a?i.setAttribute(`aria-owns`,a):(i.removeAttribute(`aria-owns`),i.setAttribute(`role`,`presentation`)))}#a(e,t){let n=t.getAttribute(`aria-owns`);n?.includes(e)||t.setAttribute(`aria-owns`,n?`${n} ${e}`:e),t.removeAttribute(`role`)}addPointerInTextLayer(t,n){let{id:r}=t;if(!r)return null;if(!this.#e)return this.#r.set(t,n),null;n&&this.removePointerInTextLayer(t);let i=this.#t;if(!i?.length)return null;let a=as(i,n=>e.#i(t,n)<0),o=Math.max(0,a-1),s=i[o];this.#a(r,s),this.#n.set(r,o);let c=s.parentNode;return c?.classList.contains(`markedContent`)?c.id:null}moveElementInDOM(t,n,r,i){let a=this.addPointerInTextLayer(r,i);if(!t.hasChildNodes())return t.append(n),a;let o=Array.from(t.childNodes).filter(e=>e!==n);if(o.length===0)return a;let s=as(o,t=>e.#i(n,t)<0);return s===0?o[0].before(n):o[s-1].after(n),a}},Kl=class{#e=null;constructor({findController:e,eventBus:t,pageIndex:n}){this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=n,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw Error(`Text divs and strings have not been set.`);if(this.enabled)throw Error(`TextHighlighter is already enabled.`);this.enabled=!0,this.#e||(this.#e=new AbortController,this.eventBus.on(`updatetextlayermatches`,e=>{(e.pageIndex===this.pageIdx||e.pageIndex===-1)&&this._updateMatches()},{signal:this.#e.signal,...bs})),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this.#e?.abort(),this.#e=null,this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];let{textContentItemsStr:n}=this,r=0,i=0,a=n.length-1,o=[];for(let s=0,c=e.length;s<c;s++){let c=e[s];for(;r!==a&&c>=i+n[r].length;)i+=n[r].length,r++;r===n.length&&console.error(`Could not find a matching mapping`);let l={begin:{divIdx:r,offset:c-i}};for(c+=t[s];r!==a&&c>i+n[r].length;)i+=n[r].length,r++;l.end={divIdx:r,offset:c-i},o.push(l)}return o}_renderMatches(e){if(e.length===0)return;let{findController:t,pageIdx:n}=this,{textContentItemsStr:r,textDivs:i}=this,a=n===t.selected.pageIdx,o=t.selected.matchIdx,s=t.state.highlightAll,c=null,l={divIdx:-1,offset:void 0};function u(e,t){let n=e.divIdx;return i[n].textContent=``,d(n,0,e.offset,t)}function d(e,t,n,a){let o=i[e];if(o.nodeType===Node.TEXT_NODE){let t=document.createElement(`span`);o.before(t),t.append(o),i[e]=t,o=t}let s=r[e].substring(t,n),c=document.createTextNode(s);if(a){let e=document.createElement(`span`);return e.className=`${a} appended`,e.append(c),o.append(e),a.includes(`selected`)?e:null}return o.append(c),0}let f=o,p=f+1;if(s)f=0,p=e.length;else if(!a)return;let m=-1,h=-1;for(let r=f;r<p;r++){let s=e[r],f=s.begin;if(f.divIdx===m&&f.offset===h)continue;m=f.divIdx,h=f.offset;let p=s.end,g=a&&r===o,_=g?` selected`:``,v=null;if(!c||f.divIdx!==c.divIdx?(c!==null&&d(c.divIdx,c.offset,l.offset),u(f)):d(c.divIdx,c.offset,f.offset),f.divIdx===p.divIdx)v=d(f.divIdx,f.offset,p.offset,`highlight`+_);else{v=d(f.divIdx,f.offset,l.offset,`highlight begin`+_);for(let e=f.divIdx+1,t=p.divIdx;e<t;e++)i[e].className=`highlight middle`+_;u(p,`highlight end`+_)}c=p,g&&t.scrollMatchIntoView({element:v,pageIndex:n,matchIndex:o})}c&&d(c.divIdx,c.offset,l.offset)}_updateMatches(e=!1){if(!this.enabled&&!e)return;let{findController:t,matches:n,pageIdx:r}=this,{textContentItemsStr:i,textDivs:a}=this,o=-1;for(let e of n){let t=Math.max(o,e.begin.divIdx);for(let n=t,r=e.end.divIdx;n<=r;n++){let e=a[n];e.textContent=i[n],e.className=``}o=e.end.divIdx+1}if(!t?.highlightMatches||e)return;let s=t.pageMatches[r]||null,c=t.pageMatchesLength[r]||null;this.matches=this._convertMatches(s,c),this._renderMatches(this.matches)}},ql=class e{#e=null;#t=!1;#n=null;#r=!1;#i=null;static#a=new Map;static#o=null;constructor({pdfPage:e,highlighter:t=null,accessibilityManager:n=null,enablePermissions:r=!1,onAppend:i=null,abortSignal:a=null}){this.pdfPage=e,this.highlighter=t,this.accessibilityManager=n,this.#t=r===!0,this.#n=i,this.#e=a,this.div=document.createElement(`div`),this.div.tabIndex=0,this.div.className=`textLayer`}async render({viewport:e,images:t,textContentParams:n=null}){if(this.#r&&this.#i){this.#i.update({viewport:e,onBefore:this.hide.bind(this)}),this.show();return}this.cancel(),this.#i=new Lo({textContentSource:this.pdfPage.streamTextContent(n||{includeMarkedContent:!0,disableNormalization:!0}),images:t,container:this.div,viewport:e});let{textDivs:r,textContentItemsStr:i}=this.#i;this.highlighter?.setTextMapping(r,i),this.accessibilityManager?.setTextMapping(r),await this.#i.render(),this.#r=!0;let a=document.createElement(`div`);a.className=`endOfContent`,this.div.append(a),this.#s(a),this.#n?.(this.div),this.highlighter?.enable(),this.accessibilityManager?.enable()}hide(){!this.div.hidden&&this.#r&&(this.highlighter?.disable(),this.div.hidden=!0)}show(){this.div.hidden&&this.#r&&(this.div.hidden=!1,this.highlighter?.enable())}cancel(){this.#i?.cancel(),this.#i=null,this.#r=!1,this.div.replaceChildren(),this.highlighter?.disable(),this.accessibilityManager?.disable(),e.#c(this.div)}#s(t){let{div:n}=this,r=this.#e,i=r?{signal:r}:null;n.addEventListener(`mousedown`,()=>{n.classList.add(`selecting`)},i),n.addEventListener(`copy`,e=>{if(!this.#t){let t=document.getSelection();e.clipboardData.setData(`text/plain`,is(yo(t.toString())))}Fo(e)},i),e.#a.set(n,t),e.#l(r)}static#c(e){this.#a.delete(e),this.#a.size===0&&(this.#o?.abort(),this.#o=null)}static#l(e){if(this.#o)return;this.#o=new AbortController;let t=e?AbortSignal.any([this.#o.signal,e]):this.#o.signal,n=(e,t)=>{t.append(e),e.style.width=``,e.style.height=``,t.classList.remove(`selecting`)},r=!1;document.addEventListener(`pointerdown`,()=>{r=!0},{signal:t}),document.addEventListener(`pointerup`,()=>{r=!1,this.#a.forEach(n)},{signal:t}),window.addEventListener(`blur`,()=>{r=!1,this.#a.forEach(n)},{signal:t}),document.addEventListener(`keyup`,()=>{r||this.#a.forEach(n)},{signal:t});var i,a;document.addEventListener(`selectionchange`,()=>{let e=document.getSelection();if(e.rangeCount===0){this.#a.forEach(n);return}let t=new Set;for(let n=0;n<e.rangeCount;n++){let r=e.getRangeAt(n);for(let e of this.#a.keys())!t.has(e)&&r.intersectsNode(e)&&t.add(e)}for(let[e,r]of this.#a)t.has(e)?e.classList.add(`selecting`):n(r,e);if(i===void 0&&(i=getComputedStyle(this.#a.values().next().value).getPropertyValue(`-moz-user-select`)===`none`,!i)){let e=navigator.userAgentData?navigator.userAgentData.brands.find(({brand:e})=>e===`Chromium`)?.version:/\bChrome\/(\d+)\b/.exec(navigator.userAgent)?.[1];i=!!e&&parseInt(e,10)>=148}if(i)return;let r=e.getRangeAt(0),o=a&&(r.compareBoundaryPoints(Range.END_TO_END,a)===0||r.compareBoundaryPoints(Range.START_TO_END,a)===0),s=o?r.startContainer:r.endContainer;if(s.nodeType===Node.TEXT_NODE&&(s=s.parentNode),s.classList?.contains(`highlight`)&&(s=s.parentNode),!o&&r.endOffset===0)do{for(;!s.previousSibling;)s=s.parentNode;s=s.previousSibling}while(!s.childNodes.length);let c=s.parentElement?.closest(`.textLayer`),l=this.#a.get(c);l&&(l.style.width=c.style.width,l.style.height=c.style.height,l.style.userSelect=`text`,s.parentElement.insertBefore(l,o?s:s.nextSibling)),a=r.cloneRange()},{signal:t})}},Jl=class{#e=!1;div=null;constructor({pdfPage:e,annotationStorage:t=null,linkService:n,xfaHtml:r=null}){this.pdfPage=e,this.annotationStorage=t,this.linkService=n,this.xfaHtml=r}async render({viewport:e,intent:t=`display`}){let n;if(t===`print`)n=this.xfaHtml;else if(n=await this.pdfPage.getXfa(),this.#e||!n)return{textDivs:[]};let r=!!this.div,i={viewport:e.clone({dontFlip:!0}),div:this.div??=document.createElement(`div`),xfaHtml:n,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:t};return r?Wo.update(i):Wo.render(i)}cancel(){this.#e=!0}hide(){this.div&&(this.div.hidden=!0)}},Yl={annotationEditorUIManager:null,annotationStorage:null,downloadManager:null,enableScripting:!1,fieldObjectsPromise:null,findController:null,hasJSActionsPromise:null,get linkService(){return new zs}},Xl=new Map([[`canvasWrapper`,0],[`textLayer`,1],[`annotationLayer`,2],[`annotationEditorLayer`,3],[`xfaLayer`,3]]),Zl=class e extends Fl{#e=null;#t=Ha.ENABLE_FORMS;#n=null;#r=null;#i=!0;#a=!1;#o=!1;#s=null;#c=!1;#l=null;#u=null;#d=1;#f=1;#p=Qo.ENABLE;#m=1;#h={directDrawing:!0,initialOptionalContent:!0,regularAnnotations:!0};#g=[null,null,null,null];constructor(e){super(e);let{container:t,defaultViewport:n}=e;this.renderingId=`page`+this.id,this.#s=e.layerProperties||Yl,this.#e=e.abortSignal||null,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||1,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.#p=e.textLayerMode??Qo.ENABLE,this.#t=e.annotationMode??Ha.ENABLE_FORMS,this.imageResourcesPath=e.imageResourcesPath||``,this.enableDetailCanvas=e.enableDetailCanvas??!0,this.maxCanvasPixels=e.maxCanvasPixels??Ol.get(`maxCanvasPixels`),this.maxCanvasDim=e.maxCanvasDim||Ol.get(`maxCanvasDim`),this.capCanvasAreaFactor=e.capCanvasAreaFactor??Ol.get(`capCanvasAreaFactor`),this.#i=e.enableAutoLinking!==!1,this.#r=e.commentManager||null,this.l10n=e.l10n,this.l10n||=new gl,this._isStandalone=!this.renderingQueue?.hasViewer(),this._container=t,this._annotationCanvasMap=null,this.annotationLayer=null,this.annotationEditorLayer=null,this.textLayer=null,this.xfaLayer=null,this.structTreeLayer=null,this.drawLayer=null,this.detailView=null;let r=document.createElement(`div`);if(r.className=`page`,r.setAttribute(`data-page-number`,this.id),r.setAttribute(`role`,`region`),r.setAttribute(`data-l10n-id`,`pdfjs-page-landmark`),r.setAttribute(`data-l10n-args`,JSON.stringify({page:this.id})),this.div=r,this.#v(),t?.append(r),this._isStandalone){t?.style.setProperty(`--scale-factor`,this.scale*Oo.PDF_TO_CSS_UNITS),this.pageColors?.background&&t?.style.setProperty(`--page-bg-color`,this.pageColors.background);let{optionalContentConfigPromise:n}=e;n&&n.then(e=>{n===this._optionalContentConfigPromise&&(this.#h.initialOptionalContent=e.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}clone(t){let n=new e({container:null,eventBus:this.eventBus,pagesColors:this.pageColors,renderingQueue:this.renderingQueue,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,minDurationToUpdateCanvas:this.minDurationToUpdateCanvas,defaultViewport:this.viewport,id:t,layerProperties:this.#s,abortSignal:this.#e,scale:this.scale,optionalContentConfigPromise:this._optionalContentConfigPromise,textLayerMode:this.#p,annotationMode:this.#t,imageResourcesPath:this.imageResourcesPath,enableDetailCanvas:this.enableDetailCanvas,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableAutoLinking:this.#i,commentManager:this.#r,l10n:this.l10n});return n.setPdfPage(this.pdfPage.clone(t-1)),n}#_(e,t){let n=Xl.get(t),r=this.#g[n];if(this.#g[n]=e,r)r.replaceWith(e);else{for(let t=n-1;t>=0;t--){let n=this.#g[t];if(n){n.after(e);return}}this.div.prepend(e)}}#v(){let{div:e,viewport:t}=this;if(t.userUnit!==this.#m&&(t.userUnit===1?e.style.removeProperty(`--user-unit`):e.style.setProperty(`--user-unit`,t.userUnit),this.#m=t.userUnit),this.pdfPage){if(this.#u===t.rotation)return;this.#u=t.rotation}Mo(e,t,!0,!1)}updatePageNumber(e){let t=this.id;if(t!==e){this.id=e,this.renderingId=`page${e}`,this.pdfPage&&(this.pdfPage.pageNumber=e),this.setPageLabel(this.pageLabel);let{div:t}=this;t.setAttribute(`data-page-number`,e),t.setAttribute(`data-l10n-args`,JSON.stringify({page:e})),this._textHighlighter.pageIdx=e-1}this.#s.annotationEditorUIManager?.updatePageIndex(t-1,e-1)}setPdfPage(e){this._isStandalone&&(this.pageColors?.foreground===`CanvasText`||this.pageColors?.background===`Canvas`)&&(this._container?.style.setProperty(`--hcm-highlight-filter`,e.filterFactory.addHighlightHCMFilter(`highlight`,`CanvasText`,`Canvas`,`HighlightText`,`Highlight`)),this._container?.style.setProperty(`--hcm-highlight-selected-filter`,e.filterFactory.addHighlightHCMFilter(`highlight_selected`,`CanvasText`,`Canvas`,`HighlightText`,`Highlight`))),this.pdfPage=e,this.pdfPageRotate=e.rotate;let t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*Oo.PDF_TO_CSS_UNITS,rotation:t}),this.#v(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}deleteMe(e){e?this.div.remove():(this.destroy(),this.#s.annotationEditorUIManager?.deletePage(this.id))}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}get _textHighlighter(){return No(this,`_textHighlighter`,new Kl({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#s.findController}))}#y(e,t){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:t})}async#b(e=null){let{annotationLayer:t,textLayer:n}=this,r=null;try{await this.annotationLayer.render({viewport:this.viewport,intent:`display`,structTreeLayer:this.structTreeLayer,optionalContentConfigPromise:this._optionalContentConfigPromise})}catch(e){console.error(`#renderAnnotationLayer:`,e),r=e}finally{this.#y(`annotationlayerrendered`,r)}this.#i&&e&&this.#D(e,t,n)}_refreshAnnotationLayer(){this._annotationCanvasMap?.size&&this.annotationLayer?.refreshCanvases()}async#x(){let e=null;try{await this.annotationEditorLayer.render({viewport:this.viewport,intent:`display`})}catch(t){console.error(`#renderAnnotationEditorLayer:`,t),e=t}finally{this.#y(`annotationeditorlayerrendered`,e)}}async#S(){try{await this.drawLayer.render({intent:`display`})}catch(e){console.error(`#renderDrawLayer:`,e)}}async#C(){let e=null;try{let e=await this.xfaLayer.render({viewport:this.viewport,intent:`display`});e?.textDivs&&this._textHighlighter&&this.#E(e.textDivs)}catch(t){console.error(`#renderXfaLayer:`,t),e=t}finally{this.xfaLayer?.div&&(this.l10n.pause(),this.#_(this.xfaLayer.div,`xfaLayer`),this.l10n.resume()),this.#y(`xfalayerrendered`,e)}}async#w(){let e=null;try{await this.textLayer.render({viewport:this.viewport,images:this.imageCoordinates?new Ro(this.imagesRightClickMinSize,this.imageCoordinates,this.viewport,()=>this.canvas):null})}catch(t){if(t instanceof Ia)return;console.error(`#renderTextLayer:`,t),e=t}this.#y(`textlayerrendered`,e),this.#T()}async#T(){let e=await this.structTreeLayer?.render();e&&(this.l10n.pause(),this.structTreeLayer?.updateTextLayer(),this.canvas&&e.parentNode!==this.canvas&&this.canvas.append(e),this.l10n.resume()),this.structTreeLayer?.show()}async#E(e){let t=await this.pdfPage.getTextContent(),n=[];for(let e of t.items)n.push(e.str);this._textHighlighter.setTextMapping(e,n),this._textHighlighter.enable()}async#D(e,t,n){let r=null;try{if(await e,t!==this.annotationLayer||n!==this.textLayer)return;await t.injectLinkAnnotations(Nl.processLinks(this))}catch(e){console.error(`#injectLinkAnnotations:`,e),r=e}this.#y(`linkannotationsadded`,r)}_resetCanvas(){super._resetCanvas(),this.#l=null}reset({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:n=!1,keepTextLayer:r=!1,keepCanvasWrapper:i=!1,preserveDetailViewState:a=!1}={}){let o=this.pdfPage?._pdfBug??!1;this.cancelRendering({keepAnnotationLayer:e,keepAnnotationEditorLayer:t,keepXfaLayer:n,keepTextLayer:r}),this.renderingState=Q.INITIAL;let s=this.div,c=s.childNodes,l=e&&this.annotationLayer?.div||null,u=t&&this.annotationEditorLayer?.div||null,d=n&&this.xfaLayer?.div||null,f=r&&this.textLayer?.div||null,p=i&&this.#n||null;for(let e=c.length-1;e>=0;e--){let t=c[e];switch(t){case l:case u:case d:case f:case p:continue}if(o&&t.classList.contains(`pdfBugGroupsLayer`))continue;t.remove();let n=this.#g.indexOf(t);n>=0&&(this.#g[n]=null)}s.removeAttribute(`data-loaded`),l&&this.annotationLayer.hide(),u&&this.annotationEditorLayer.hide(),d&&this.xfaLayer.hide(),f&&this.textLayer.hide(),this.structTreeLayer?.hide(),!i&&this.#n&&(this.#n=null,this._resetCanvas()),a||(this.detailView?.reset({keepCanvas:i}),i||(this.detailView=null))}toggleEditingMode(e){this.#o=e,this.hasEditableAnnotations()&&this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0})}updateVisibleArea(e){this.enableDetailCanvas&&(this.#c&&this.maxCanvasPixels>0&&e?(this.detailView??=new Ll({pageView:this,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,imagesRightClickMinSize:-1}),this.detailView.update({visibleArea:e})):this.detailView&&=(this.detailView.reset(),null))}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:n=null,drawingDelay:r=-1}){this.scale=e||this.scale,typeof t==`number`&&(this.rotation=t),n instanceof Promise&&(this._optionalContentConfigPromise=n,n.then(e=>{n===this._optionalContentConfigPromise&&(this.#h.initialOptionalContent=e.hasInitialVisibility)})),this.#h.directDrawing=!0;let i=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Oo.PDF_TO_CSS_UNITS,rotation:i}),this.#v(),this._isStandalone&&this._container?.style.setProperty(`--scale-factor`,this.viewport.scale),this.#O(),this.canvas){let e=this.#a&&this.#c,t=r>=0&&r<1e3;if(t||e){t&&!e&&this.renderingState!==Q.FINISHED&&(this.cancelRendering({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=Q.FINISHED,this.#h.directDrawing=!1),this.cssTransform({redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!t,hideTextLayer:t}),t||(this.detailView?.update({underlyingViewUpdated:!0}),this.dispatchPageRendered(!0,!1));return}}this.cssTransform({}),this.annotationEditorLayer?.update(this.viewport),this.reset({keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,keepCanvasWrapper:!0,preserveDetailViewState:!0}),this.detailView?.update({underlyingViewUpdated:!0})}#O(){let{width:e,height:t}=this.viewport,n=this.outputScale=new xo;if(this.maxCanvasPixels===0){let e=1/this.scale;n.sx*=e,n.sy*=e,this.#c=!0}else if(this.#c=n.limitCanvas(e,t,this.maxCanvasPixels,this.maxCanvasDim,this.capCanvasAreaFactor),this.#c&&this.enableDetailCanvas){let e=this.enableOptimizedPartialRendering?4:2;n.sx/=e,n.sy/=e}}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:n=!1,keepTextLayer:r=!1,cancelExtraDelay:i=0}={}){super.cancelRendering({cancelExtraDelay:i}),!this.textLayer||r&&this.textLayer.div||(this.textLayer.cancel(),this.textLayer=null),!this.annotationLayer||e&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),!this.annotationEditorLayer||t&&this.annotationEditorLayer.div&&this.textLayer||(this.drawLayer&&=(this.drawLayer.cancel(),null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.drawLayer&&!this.textLayer&&(this.drawLayer.cancel(),this.drawLayer=null),!this.xfaLayer||n&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({redrawAnnotationLayer:e=!1,redrawAnnotationEditorLayer:t=!1,redrawXfaLayer:n=!1,redrawTextLayer:r=!1,hideTextLayer:i=!1}){let{canvas:a}=this;if(!a)return;let o=this.#l;if(this.viewport!==o){let e=(360+this.viewport.rotation-o.rotation)%360;if(e===90||e===270){let{width:t,height:n}=this.viewport,r=n/t,i=t/n;a.style.transform=`rotate(${e}deg) scale(${r},${i})`}else a.style.transform=e===0?``:`rotate(${e}deg)`}e&&this.annotationLayer&&this.#b(),t&&this.annotationEditorLayer&&(this.drawLayer&&this.#S(),this.#x()),n&&this.xfaLayer&&this.#C(),this.textLayer&&(i?(this.textLayer.hide(),this.structTreeLayer?.hide()):r&&this.#w())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}_ensureCanvasWrapper(){let e=this.#n;return e||(e=this.#n=document.createElement(`div`),e.classList.add(`canvasWrapper`),this.#_(e,`canvasWrapper`)),e}_getRenderingContext(e,t,n,r){return{canvas:e,transform:t,viewport:this.viewport,annotationMode:this.#t,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:this.pageColors,isEditing:this.#o,recordOperations:n,recordImages:r}}async draw(){this.renderingState!==Q.INITIAL&&(console.error(`Must be in new state before drawing`),this.reset());let{div:e,l10n:t,pdfPage:n,viewport:r}=this;if(!n)throw this.renderingState=Q.FINISHED,Error(`pdfPage is not loaded`);this.renderingState=Q.RUNNING;let i=this._ensureCanvasWrapper();if(!this.textLayer&&this.#p!==Qo.DISABLE&&!n.isPureXfa&&(this._accessibilityManager||=new Gl,this.textLayer=new ql({pdfPage:n,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:this.#p===Qo.ENABLE_PERMISSIONS,onAppend:e=>{this.l10n.pause(),this.#_(e,`textLayer`),this.l10n.resume()},abortSignal:this.#e}),this.enableSelectionRendering&&this.textLayer.div.classList.add(`selectionRendering`)),!this.annotationLayer&&this.#t!==Ha.DISABLE){let{annotationStorage:e,annotationEditorUIManager:t,downloadManager:r,enableComment:i,enableScripting:a,fieldObjectsPromise:o,hasJSActionsPromise:s,linkService:c}=this.#s;this._annotationCanvasMap||=new Map,this.annotationLayer=new Bs({pdfPage:n,annotationStorage:e,imageResourcesPath:this.imageResourcesPath,renderForms:this.#t===Ha.ENABLE_FORMS,linkService:c,downloadManager:r,enableComment:i,enableScripting:a,hasJSActionsPromise:s,fieldObjectsPromise:o,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:t,commentManager:this.#r,onAppend:e=>{this.#_(e,`annotationLayer`)}})}let{width:a,height:o}=r;this.#l=r;let{canvas:s,prevCanvas:c}=this._createCanvas(e=>{i.prepend(e)});s.setAttribute(`role`,`presentation`),this.outputScale||this.#O();let{outputScale:l}=this;this.#a=this.#c;let u=os(l.sx),d=os(l.sy),f=s.width=ss(vs(a*l.sx),u[0]),p=s.height=ss(vs(o*l.sy),d[0]),m=ss(vs(a),u[1]),h=ss(vs(o),d[1]);l.sx=f/m,l.sy=p/h,this.#d!==u[1]&&(e.style.setProperty(`--scale-round-x`,`${u[1]}px`),this.#d=u[1]),this.#f!==d[1]&&(e.style.setProperty(`--scale-round-y`,`${d[1]}px`),this.#f=d[1]);let g=this.enableOptimizedPartialRendering&&this.#a&&!this.recordedBBoxes,_=this.imagesRightClickMinSize!==-1&&!this.imageCoordinates,v=l.scaled?[l.sx,0,0,l.sy,0,0]:null,y=this._drawCanvas(this._getRenderingContext(s,v,g,_),()=>{c?.remove(),this._resetCanvas()},e=>{this.#h.regularAnnotations=!e.separateAnnots,this.dispatchPageRendered(!1,!1)}).then(async()=>{if(this.renderingState!==Q.FINISHED)return;this.structTreeLayer||=new Wl(n,r.rawDims);let e=this.textLayer?this.#w():null;this.annotationLayer&&await this.#b(e),this.drawLayer||=new Il({pageIndex:this.id,textLayer:this.enableSelectionRendering?this.textLayer?.div:null,filterFactory:this.pdfPage?.filterFactory,pageColors:this.pageColors}),await this.#S(),this.drawLayer.setParent(i);let{annotationEditorUIManager:a}=this.#s;a&&(this.annotationLayer||this.#t===Ha.DISABLE)&&(this.annotationEditorLayer||=new wl({uiManager:a,pageIndex:this.id-1,l10n:t,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:e=>{this.#_(e,`annotationEditorLayer`)}}),this.#x())});if(n.isPureXfa){if(!this.xfaLayer){let{annotationStorage:e,linkService:t}=this.#s;this.xfaLayer=new Jl({pdfPage:n,annotationStorage:e,linkService:t})}this.#C()}return e.setAttribute(`data-loaded`,!0),this.dispatchPageRender(),y}setPageLabel(e){this.pageLabel=typeof e==`string`?e:null,this.div.setAttribute(`data-l10n-args`,JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel===null?this.div.removeAttribute(`data-page-label`):this.div.setAttribute(`data-page-label`,this.pageLabel)}get thumbnailCanvas(){let{directDrawing:e,initialOptionalContent:t,regularAnnotations:n}=this.#h;return e&&t&&n?this.canvas:null}};async function Ql(e){let{info:t,metadata:n,contentDispositionFilename:r,contentLength:i}=await e.getMetadata();return{...t,baseURL:``,filesize:i||(await e.getDownloadInfo()).length,filename:r||no(``),metadata:n?.getRaw(),authors:n?.get(`dc:creator`),numPages:e.numPages,URL:``}}var $l=class{constructor(e,t){this._ready=new Promise((n,r)=>{import(e).then(e=>{n(e.QuickJSSandbox(new URL(t,location.href).href))}).catch(r)})}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){let t=await this._ready;setTimeout(()=>t.dispatchEvent(e),0)}async destroySandbox(){(await this._ready).nukeSandbox()}},eu=class{#e=null;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=null;#d=null;constructor({eventBus:e,externalServices:t=null,docProperties:n=null}){this.#i=e,this.#a=t,this.#n=n}setViewer(e){this.#c=e}async setDocument(e){if(this.#s&&await this.#g(),this.#s=e,!e)return;let[t,n,r]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(!t&&!r){await this.#g();return}if(e!==this.#s)return;if(t){this.#o=new Set;for(let e of t.values())for(let{id:t}of e)this.#o.add(t)}try{this.#u=this.#h()}catch(e){console.error(`setDocument:`,e),await this.#g();return}let i=this.#i;this.#r=new AbortController;let a={signal:this.#r.signal,...bs};i.on(`updatefromsandbox`,e=>{e?.source===window&&this.#f(e.detail)},a),i.on(`dispatcheventinsandbox`,e=>{this.#u?.dispatchEventInSandbox(e.detail)},a),i.on(`pagechanging`,({pageNumber:e,previous:t})=>{e!==t&&(this.#m(t),this.#p(e))},a),i.on(`pagerendered`,({pageNumber:e})=>{this._pageOpenPending.has(e)&&e===this.#c.currentPageNumber&&this.#p(e)},a),i.on(`pagesdestroy`,async()=>{await this.#m(this.#c.currentPageNumber),await this.#u?.dispatchEventInSandbox({id:`doc`,name:`WillClose`}),this.#e?.resolve()},a);try{let a=await this.#n(e);if(e!==this.#s)return;await this.#u.createSandbox({objects:t,calculationOrder:n,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...a,actions:r}}),i.dispatch(`sandboxcreated`,{source:this})}catch(e){console.error(`setDocument:`,e),await this.#g();return}await this.#u?.dispatchEventInSandbox({id:`doc`,name:`Open`}),await this.#p(this.#c.currentPageNumber,!0),Promise.resolve().then(()=>{e===this.#s&&(this.#l=!0)})}async dispatchWillSave(){return this.#u?.dispatchEventInSandbox({id:`doc`,name:`WillSave`})}async dispatchDidSave(){return this.#u?.dispatchEventInSandbox({id:`doc`,name:`DidSave`})}async dispatchWillPrint(){if(this.#u){await this.#d?.promise,this.#d=Promise.withResolvers();try{await this.#u.dispatchEventInSandbox({id:`doc`,name:`WillPrint`})}catch(e){throw this.#d.resolve(),this.#d=null,e}await this.#d.promise}}async dispatchDidPrint(){return this.#u?.dispatchEventInSandbox({id:`doc`,name:`DidPrint`})}get destroyPromise(){return this.#t?.promise||null}get ready(){return this.#l}get _pageOpenPending(){return No(this,`_pageOpenPending`,new Set)}get _visitedPages(){return No(this,`_visitedPages`,new Map)}async#f(e){let t=this.#c,n=t.isInPresentationMode||t.isChangingPresentationMode,{id:r,siblings:i,command:a,value:o}=e;if(!r){switch(a){case`clear`:console.clear();break;case`error`:console.error(o);break;case`layout`:n||(t.spreadMode=_s(o).spreadMode);break;case`page-num`:t.currentPageNumber=o+1;break;case`print`:await t.pagesPromise,this.#i.dispatch(`print`,{source:this});break;case`println`:console.log(o);break;case`zoom`:n||(t.currentScaleValue=o);break;case`SaveAs`:this.#i.dispatch(`download`,{source:this});break;case`FirstPage`:t.currentPageNumber=1;break;case`LastPage`:t.currentPageNumber=t.pagesCount;break;case`NextPage`:t.nextPage();break;case`PrevPage`:t.previousPage();break;case`ZoomViewIn`:n||t.increaseScale();break;case`ZoomViewOut`:n||t.decreaseScale();break;case`WillPrintFinished`:this.#d?.resolve(),this.#d=null}return}if(n&&e.focus)return;delete e.id,delete e.siblings;let s=i?[r,...i]:[r];for(let t of s){if(!this.#o?.has(t))continue;let n=document.querySelector(`[data-element-id="${t}"]`);n?n.dispatchEvent(new CustomEvent(`updatefromsandbox`,{detail:e})):this.#s?.annotationStorage.setValue(t,e)}}async#p(e,t=!1){let n=this.#s,r=this._visitedPages;if(t&&(this.#e=Promise.withResolvers()),!this.#e)return;let i=this.#c.getPageView(e-1);if(i?.renderingState!==Q.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);let a=(async()=>{let t=await(r.has(e)?null:i.pdfPage?.getJSActions());n===this.#s&&await this.#u?.dispatchEventInSandbox({id:`page`,name:`PageOpen`,pageNumber:e,actions:t})})();r.set(e,a)}async#m(e){let t=this.#s,n=this._visitedPages;if(!this.#e||this._pageOpenPending.has(e))return;let r=n.get(e);r&&(n.set(e,null),await r,t===this.#s&&await this.#u?.dispatchEventInSandbox({id:`page`,name:`PageClose`,pageNumber:e}))}#h(){if(this.#t=Promise.withResolvers(),this.#u)throw Error(`#initScripting: Scripting already exists.`);return this.#a.createScripting()}async#g(){if(this.#o=null,!this.#u)this.#s=null,this.#t?.resolve();else{this.#e&&=(await Promise.race([this.#e.promise,new Promise(e=>{setTimeout(e,1e3)})]).catch(()=>{}),null),this.#s=null;try{await this.#u.destroySandbox()}catch{}this.#d?.reject(Error(`Scripting destroyed.`)),this.#d=null,this.#r?.abort(),this.#r=null,this._pageOpenPending.clear(),this._visitedPages.clear(),this.#u=null,this.#l=!1,this.#t?.resolve()}}},tu=class extends eu{constructor(e){e.externalServices||window.addEventListener(`updatefromsandbox`,t=>{e.eventBus.dispatch(`updatefromsandbox`,{source:window,detail:t.detail})}),e.externalServices||={createScripting:()=>new $l(e.sandboxBundleSrc,e.wasmUrl)},e.docProperties||=e=>Ql(e),super(e)}},nu=3e4,ru=class{#e=null;#t=null;#n=null;#r=null;isThumbnailViewEnabled=!1;onIdle=null;printing=!1;constructor(){Object.defineProperty(this,"hasViewer",{value:()=>!!this.#r})}setViewer(e){this.#r=e}setThumbnailViewer(e){this.#n=e}isHighestPriority(e){return this.#e===e.renderingId}renderHighestPriority(e){this.#t&&=(clearTimeout(this.#t),null),this.#r.forceRendering(e)||this.isThumbnailViewEnabled&&this.#n?.forceRendering()||this.printing||this.onIdle&&(this.#t=setTimeout(this.onIdle.bind(this),nu))}getHighestPriority(e,t,n,r=!1,i=!1){let a=e.views,o=a.length;if(o===0)return null;for(let e=0;e<o;e++){let t=a[e].view;if(!this.isViewFinished(t))return t}if(!i)for(let e=0;e<o;e++){let{detailView:t}=a[e].view;if(t&&!this.isViewFinished(t))return t}let s=e.first.id,c=e.last.id;if(c-s+1>o){let r=e.ids;for(let e=1,i=c-s;e<i;e++){let i=n?s+e:c-e;if(r.has(i))continue;let a=t[i-1];if(!this.isViewFinished(a))return a}}let l=n?c:s-2,u=t[l];return u&&!this.isViewFinished(u)||r&&(l+=n?1:-1,u=t[l],u&&!this.isViewFinished(u))?u:null}isViewFinished(e){return e.renderingState===Q.FINISHED}renderView(e){switch(e.renderingState){case Q.FINISHED:return!1;case Q.PAUSED:this.#e=e.renderingId,e.resume();break;case Q.RUNNING:this.#e=e.renderingId;break;case Q.INITIAL:this.#e=e.renderingId,e.draw().finally(()=>{this.renderHighestPriority()}).catch(e=>{e instanceof ko||console.error(`renderView:`,e)})}return!0}},iu=10,au={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function ou(e){return Object.values(za).includes(e)&&e!==za.DISABLE}var su=class{#e=new Set;#t=0;constructor(e){this.#t=e}push(e){let t=this.#e;t.has(e)&&t.delete(e),t.add(e),t.size>this.#t&&this.#n()}resize(e,t=null){this.#t=e;let n=this.#e;if(t){let e=n.size,r=1;for(let i of n)if(t.has(i.id)&&(n.delete(i),n.add(i)),++r>e)break}for(;n.size>this.#t;)this.#n()}has(e){return this.#e.has(e)}[Symbol.iterator](){return this.#e.keys()}#n(){let e=this.#e.keys().next().value;e?.destroy(),this.#e.delete(e)}},cu=class{#e=null;#t=null;#n=null;#r=za.NONE;#i=null;#a=Ha.ENABLE_FORMS;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=!1;#f=!1;#p=!0;#m=null;#h=null;#g=0;#_=null;#v=[NaN,NaN];#y=!0;#b=null;#x=!1;#S=null;#C=null;#w=!1;#T=null;#E=0;#D=new ResizeObserver(this.#ee.bind(this));#O=null;#k=null;#A=null;#j=!0;#M=Qo.ENABLE;#N=null;#P=null;#F=null;#I=null;constructor(e){let t=`6.4.299`;if(Uo!==t)throw Error(`The API version "${Uo}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.#N=e.viewerAlert||null,this.container?.tagName!==`DIV`||this.viewer?.tagName!==`DIV`)throw Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!==`absolute`)throw Error("The `container` must be absolutely positioned.");this.#D.observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new zs,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.#t=e.altTextManager||null,this.#o=e.commentManager||null,this.#A=e.signatureManager||null,this.#c=e.editorUndoBar||null,this.findController&&(this.findController.onIsPageVisible=e=>this._getVisiblePages().ids.has(e)),this._scriptingManager=e.scriptingManager||null,this.#M=e.textLayerMode??Qo.ENABLE,this.#a=e.annotationMode??Ha.ENABLE_FORMS,this.#r=e.annotationEditorMode??za.NONE,this.#n=e.annotationEditorHighlightColors||null,this.#l=e.enableHighlightFloatingButton===!0,this.#d=e.enableUpdatedAddImage===!0,this.#f=e.enableNewAltTextWhenAddingImage===!0,this.imageResourcesPath=e.imageResourcesPath||``,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.maxCanvasDim=e.maxCanvasDim,this.capCanvasAreaFactor=e.capCanvasAreaFactor,this.enableDetailCanvas=e.enableDetailCanvas??!0,this.enableOptimizedPartialRendering=e.enableOptimizedPartialRendering??!1,this.enableSelectionRendering=e.enableSelectionRendering!==!1,this.imagesRightClickMinSize=e.imagesRightClickMinSize??-1,this.l10n=e.l10n,this.l10n||=new gl,this.#u=e.enablePermissions||!1,this.pageColors=e.pageColors||null,this.#_=e.mlManager||null,this.#j=e.supportsPinchToZoom!==!1,this.#p=e.enableAutoLinking!==!1,this.#g=e.minDurationToUpdateCanvas??500,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new ru,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue;let{abortSignal:n}=e;this.#m=n||null,n?.addEventListener(`abort`,()=>{this.#D.disconnect(),this.#D=null},{once:!0}),this.scroll=ts(this.container,this._scrollUpdate.bind(this),n),this.presentationModeState=Zo.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add(`removePageBorders`),this.#$(),this.eventBus.on(`thumbnailrendered`,({pageNumber:e,pdfPage:t})=>{let n=this._pages[e-1];this.#e.has(n)||t?.cleanup()},bs),e.l10n||this.l10n.translate(this.container)}get printingAllowed(){return this.#y}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(this.#e)}get pageViewsReady(){return this._pages.every(e=>e?.pdfPage)}clearSelection(){let e=document.getSelection();if(e&&!e.isCollapsed){for(let t=0,n=e.rangeCount;t<n;t++)if(e.getRangeAt(t).intersectsNode(this.viewer)){e.removeAllRanges?.(),e.empty?.();return}}}get renderForms(){return this.#a===Ha.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw Error(`Invalid page number.`);this.pdfDocument&&(this._currentPageNumber!==e&&this.clearSelection(),this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this.#J(),!0;if(!(0<e&&e<=this.pagesCount))return!1;let n=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch(`pagechanging`,{source:this,pageNumber:e,pageLabel:this._pageLabels?.[e-1]??null,previous:n}),t&&this.#J(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=e|0;if(this._pageLabels){let n=this._pageLabels.indexOf(e);n>=0&&(t=n+1)}this._currentPageNumber!==t&&this.clearSelection(),this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale===0?1:this._currentScale}set currentScale(e){if(isNaN(e))throw Error(`Invalid numeric scale.`);this.pdfDocument&&this.#q(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this.#q(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!ds(e))throw Error(`Invalid pages rotation angle.`);if(!this.pdfDocument||(e%=360,e<0&&(e+=360),this._pagesRotation===e))return;this.clearSelection(),this._pagesRotation=e;let t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&this.#q(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch(`rotationchanging`,{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){let e=this;return No(this,`_layerProperties`,{get annotationEditorUIManager(){return e.#i},get annotationStorage(){return e.pdfDocument?.annotationStorage},get downloadManager(){return e.downloadManager},get enableComment(){return!!e.#o},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){return e.pdfDocument?.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){return e.pdfDocument?.hasJSActions()},get linkService(){return e.linkService}})}#L(e){this.#y=e,this.eventBus.dispatch(`printingallowed`,{source:this,isAllowed:e})}#R(e){let t={annotationEditorMode:this.#r,annotationMode:this.#a,textLayerMode:this.#M};return e?(this.#L(e.has(Do.PRINT_HIGH_QUALITY)||e.has(Do.PRINT)),!e.has(Do.COPY)&&this.#M===Qo.ENABLE&&(t.textLayerMode=Qo.ENABLE_PERMISSIONS),e.has(Do.MODIFY_CONTENTS)||(t.annotationEditorMode=za.DISABLE),!e.has(Do.MODIFY_ANNOTATIONS)&&!e.has(Do.FILL_INTERACTIVE_FORMS)&&this.#a===Ha.ENABLE_FORMS&&(t.annotationMode=Ha.ENABLE),t):(this.#L(!0),t)}async#z(e){if(document.visibilityState===`hidden`||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;let t=Promise.withResolvers(),n=new AbortController;document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&t.resolve()},{signal:AbortSignal.any([e,n.signal])}),await Promise.race([this._onePageRenderedCapability.promise,t.promise]),n.abort()}async getAllText(e=null){let t=[],n=[];for(let r=1,i=this.pdfDocument.numPages;r<=i;++r){if(e?.aborted)return null;n.length=0;let{items:i}=await(await this.pdfDocument.getPage(r)).getTextContent();for(let e of i)e.str&&n.push(e.str),e.hasEOL&&n.push(`
597
+ `);t.push(is(n.join(``)))}return t.join(`
598
+ `)}#B(e,t){let n=document.getSelection(),{focusNode:r,anchorNode:i}=n;if(i&&r&&n.containsNode(this.#T)){if(this.#w||e===Qo.ENABLE_PERMISSIONS){Fo(t);return}this.#w=!0;let{classList:n}=this.viewer;n.add(`copyAll`);let r=new AbortController,i=new AbortController;window.addEventListener(`keydown`,e=>{e.key===`Escape`&&i.abort()},{signal:r.signal}),this.getAllText(i.signal).then(async e=>{e!==null&&await navigator.clipboard.writeText(e)}).catch(e=>{console.warn(`Something goes wrong when extracting the text: ${e.message}`)}).finally(()=>{this.#w=!1,r.abort(),n.remove(`copyAll`)}),Fo(t)}}setDocument(e){if(this.pdfDocument&&(this.eventBus.dispatch(`pagesdestroy`,{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#i?.destroy(),this.#i=null,this.#r!==za.DISABLE&&(this.#r=za.NONE),this.#y=!0),this.pdfDocument=e,!e)return;let t=e.numPages,n=e.getPage(1),r=e.getOptionalContentConfig({intent:`display`}),i=this.#u?e.getPermissions():Promise.resolve(),{eventBus:a,pageColors:o,viewer:s}=this;this.#h=new AbortController;let{signal:c}=this.#h,l={signal:c,...bs};if(t>au.FORCE_SCROLL_MODE_PAGE){console.warn(`Forcing PAGE-scrolling for performance reasons, given the length of the document.`);let e=this._scrollMode=Y.PAGE;a.dispatch(`scrollmodechanged`,{source:this,mode:e})}this._pagesCapability.promise.then(()=>{a.dispatch(`pagesloaded`,{source:this,pagesCount:t})},()=>{}),a.on(`pagerender`,e=>{let t=this._pages[e.pageNumber-1];t&&this.#e.push(t)},l);let u=e=>{e.cssTransform||e.isDetailView||(this._onePageRenderedCapability.resolve({timestamp:e.timestamp}),a.off(`pagerendered`,u))};a.on(`pagerendered`,u,l),Promise.all([n,i]).then(([n,i])=>{if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(n),this._optionalContentConfigPromise=r;let{annotationEditorMode:l,annotationMode:u,textLayerMode:d}=this.#R(i);if(d!==Qo.DISABLE){let e=this.#T=document.createElement(`div`);e.id=`hiddenCopyElement`,e.style.cssText=`position:absolute;top:0;left:0;width:0;height:0;display:none`,s.before(e)}if(l!==za.DISABLE){let t=l;e.isPureXfa?console.warn(`Warning: XFA-editing is not implemented.`):ou(t)?(this.#i=new Ba(this.container,s,this.#N,this.#t,this.#o,this.#A,a,e,o,this.#n,this.#l,this.#d,this.#f,this.#_,this.#c,this.#j),a.dispatch(`annotationeditoruimanager`,{source:this,uiManager:this.#i}),t!==za.NONE&&(this.#re(t),this.#i.updateMode(t))):console.error(`Invalid AnnotationEditor mode: ${t}`)}let f=this._scrollMode===Y.PAGE?null:s,p=this.currentScale,m=n.getViewport({scale:p*Oo.PDF_TO_CSS_UNITS});s.style.setProperty(`--scale-factor`,m.scale),o?.background&&s.style.setProperty(`--page-bg-color`,o.background),(o?.foreground===`CanvasText`||o?.background===`Canvas`)&&(s.style.setProperty(`--hcm-highlight-filter`,e.filterFactory.addHighlightHCMFilter(`highlight`,`CanvasText`,`Canvas`,`HighlightText`,`Highlight`)),s.style.setProperty(`--hcm-highlight-selected-filter`,e.filterFactory.addHighlightHCMFilter(`highlight_selected`,`CanvasText`,`Canvas`,`HighlightText`,`ButtonText`)));for(let e=1;e<=t;++e){let t=new Zl({container:f,eventBus:a,id:e,scale:p,defaultViewport:m.clone(),optionalContentConfigPromise:r,renderingQueue:this.renderingQueue,textLayerMode:d,annotationMode:u,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,maxCanvasDim:this.maxCanvasDim,capCanvasAreaFactor:this.capCanvasAreaFactor,enableDetailCanvas:this.enableDetailCanvas,enableOptimizedPartialRendering:this.enableOptimizedPartialRendering,enableSelectionRendering:this.enableSelectionRendering,imagesRightClickMinSize:this.imagesRightClickMinSize,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableAutoLinking:this.#p,minDurationToUpdateCanvas:this.#g,commentManager:this.#o,abortSignal:this.#m});this._pages.push(t)}this._pages[0]?.setPdfPage(n),this._scrollMode===Y.PAGE?this.#V():this._spreadMode!==$o.NONE&&this._updateSpreadMode(),a.on(`annotationeditorlayerrendered`,e=>{this.#i&&a.dispatch(`annotationeditormodechanged`,{source:this,mode:this.#r})},{once:!0,signal:c,...bs}),this.#z(c).then(async()=>{if(e!==this.pdfDocument)return;if(this.findController?.setDocument(e),this._scriptingManager?.setDocument(e),this.#T&&document.addEventListener(`copy`,this.#B.bind(this,d),{signal:c}),e.loadingParams.disableAutoFetch||t>au.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let n=t-1;if(n<=0)this._pagesCapability.resolve();else for(let r=2;r<=t;++r){let t=e.getPage(r).then(e=>{let t=this._pages[r-1];t.pdfPage||t.setPdfPage(e),--n===0&&this._pagesCapability.resolve()},e=>{console.error(`Unable to get page ${r} to initialize viewer`,e),--n===0&&this._pagesCapability.resolve()});r%au.PAUSE_EAGER_PAGE_INIT===0&&await t}}),a.dispatch(`pagesinit`,{source:this}),e.getMetadata().then(({info:t})=>{e===this.pdfDocument&&t.Language&&(s.lang=t.Language)}),this.defaultRenderingQueue&&this.update()}).catch(e=>{console.error(`Unable to initialize viewer`,e),this._pagesCapability.reject(e)})}onPagesEdited({pagesMapper:e,type:t,hasBeenCut:n,pageNumbers:r}){if(t===`copy`){this.#P=new Map;for(let e of r)this.#P.set(e,this._pages[e-1]);return}if(t===`cancelCopy`){this.#P=null;return}if((t===`cut`||t===`delete`)&&(this.#F=this._pages,this.#I=r),t===`cancelDelete`){if(this.#I=null,!this.#F)return;let e=this._scrollMode===Y.PAGE?null:this.viewer;if(e){this.#i?.startUpdatePages();let t=document.createDocumentFragment();for(let e=0,n=this.#F.length;e<n;e++){let n=this.#F[e];n.updatePageNumber(e+1),t.append(n.div)}e.replaceChildren(t),this.#i?.endUpdatePages()}this._pages=this.#F,this.#F=null;return}if(t===`cleanSavedData`){if(this.#I){if(this.#F){for(let e of this.#I)this.#F[e-1].deleteMe();this.#F=null}this.#I=null}return}this._currentPageNumber=0;let i=this._pages,a=this._pages=[];this.#i?.startUpdatePages();for(let t=1,r=e.pagesNumber;t<=r;t++){let r=e.getPrevPageNumber(t);if(r<0){let e=this.#P.get(-r);n?e.updatePageNumber(t):(this.#i?.clonePage(-r-1,t-1),e=e.clone(t)),a.push(e);continue}let o=i[r-1];a.push(o),o.updatePageNumber(t)}this.#i?.endUpdatePages(),t===`paste`&&(this.#P=null);let o=this._scrollMode===Y.PAGE?null:this.viewer;if(o){let e=document.createDocumentFragment();for(let{div:t}of a)e.append(t);o.replaceChildren(e)}setTimeout(()=>{this.forceRendering()})}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error(`setPageLabels: Invalid page labels.`)):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=0,this._currentScaleValue=null,this._pageLabels=null,this.#e=new su(iu),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=Promise.withResolvers(),this._onePageRenderedCapability=Promise.withResolvers(),this._pagesCapability=Promise.withResolvers(),this._scrollMode=Y.VERTICAL,this._previousScrollMode=Y.UNKNOWN,this._spreadMode=$o.NONE,this.#O={previousPageNumber:1,scrollDown:!0,pages:[]},this.#h?.abort(),this.#h=null,this.viewer.textContent=``,this._updateScrollMode(),this.viewer.removeAttribute(`lang`),this.#T?.remove(),this.#T=null,this.#te(),this.#ne()}#V(){if(this._scrollMode!==Y.PAGE)throw Error(`#ensurePageViewVisible: Invalid scrollMode value.`);let e=this._currentPageNumber,t=this.#O,n=this.viewer;if(n.textContent=``,t.pages.length=0,this._spreadMode===$o.NONE&&!this.isInPresentationMode){let r=this._pages[e-1];n.append(r.div),t.pages.push(r)}else{let r=new Set,i=this._spreadMode-1;i===-1?r.add(e-1):e%2===i?(r.add(e-2),r.add(e-1)):(r.add(e-1),r.add(e));let a=document.createElement(`div`);if(a.className=`spread`,this.isInPresentationMode){let e=document.createElement(`div`);e.className=`dummyPage`,a.append(e)}for(let e of r){let n=this._pages[e];n&&(a.append(n.div),t.pages.push(n))}n.append(a)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e}_scrollUpdate(){this.pagesCount!==0&&(this.#b&&clearTimeout(this.#b),this.#b=setTimeout(()=>{this.#b=null,this.update()},100),this.update())}#H(e,t=null){let{div:n,id:r}=e;if(this._currentPageNumber!==r&&this._setCurrentPageNumber(r),this._scrollMode===Y.PAGE&&(this.#V(),this.update()),!t&&!this.isInPresentationMode){let e=n.offsetLeft+n.clientLeft,r=e+n.clientWidth,{scrollLeft:i,clientWidth:a}=this.container;(this._scrollMode===Y.HORIZONTAL||e<i||r>i+a)&&(t={left:0,top:0})}es(n,t),!this._currentScaleValue&&this._location&&(this._location=null)}#U(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}panBy(e,t){let{container:n}=this,r=this.#v,{scrollLeft:i,scrollTop:a}=n,o=(Math.abs(i-r[0])<1?r[0]:i)-e,s=(Math.abs(a-r[1])<1?r[1]:a)-t;r[0]=o,r[1]=s,n.scrollLeft=o,n.scrollTop=s,this.#x=!0}#W(){if(!this.#x)return;let{first:e}=this._getVisiblePages();e&&this._updateLocation(e)}#G(e,t,{noScroll:n=!1,preset:r=!1,drawingDelay:i=-1,origin:a=null,pan:o=null}){if(this._currentScaleValue=t.toString(),this.#U(e)){o&&!n&&this.panBy(o[0],o[1]),r&&this.eventBus.dispatch(`scalechanging`,{source:this,scale:e,presetValue:t});return}this.clearSelection(),this.viewer.style.setProperty(`--scale-factor`,e*Oo.PDF_TO_CSS_UNITS);let s=i>=0&&i<1e3;this.refresh(!0,{scale:e,drawingDelay:s?i:-1}),s&&(this.#k=setTimeout(()=>{this.#k=null,this.refresh()},i));let c=this._currentScale;if(this._currentScale=e,!n){this.#W();let t=this._currentPageNumber,n;this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(t=this._location.pageNumber,n=[null,{name:`XYZ`},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:n,allowNegativeOffset:!0});let r=o?.[0]??0,i=o?.[1]??0;if(Array.isArray(a)){let t=e/c-1,[n,o]=this.containerTopLeft;r-=(a[0]-o)*t,i-=(a[1]-n)*t}(r||i)&&this.panBy(r,i)}this.eventBus.dispatch(`scalechanging`,{source:this,scale:e,presetValue:r?t:void 0}),this.defaultRenderingQueue&&this.update()}get#K(){return this._spreadMode!==$o.NONE&&this._scrollMode!==Y.HORIZONTAL?2:1}#q(e,t){let n=parseFloat(e);if(n>0)t.preset=!1,this.#G(n,e,t);else{let r=this._pages[this._currentPageNumber-1];if(!r)return;let i=40,a=5;this.isInPresentationMode?(i=a=4,this._spreadMode!==$o.NONE&&(i*=2)):this.removePageBorders?i=a=0:this._scrollMode===Y.HORIZONTAL&&([i,a]=[a,i]);let o=(this.container.clientWidth-i)/r.width*r.scale/this.#K,s=(this.container.clientHeight-a)/r.height*r.scale;switch(e){case`page-actual`:n=1;break;case`page-width`:n=o;break;case`page-height`:n=s;break;case`page-fit`:n=Math.min(o,s);break;case`auto`:let t=ms(r)?o:Math.min(s,o);n=Math.min(1.25,t);break;default:console.error(`#setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0,this.#G(n,e,t)}}#J(){let e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#q(this._currentScaleValue,{noScroll:!0}),this.#H(e)}pageLabelToPageNumber(e){if(!this._pageLabels)return null;let t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:n=!1,ignoreDestinationZoom:r=!1,center:i=null}){if(!this.pdfDocument)return;let a=Number.isInteger(e)&&this._pages[e-1];if(!a){console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!t){this._setCurrentPageNumber(e,!0);return}let o=0,s=0,c=0,l=0,u,d,f=a.rotation%180!=0,p=(f?a.height:a.width)/a.scale/Oo.PDF_TO_CSS_UNITS,m=(f?a.width:a.height)/a.scale/Oo.PDF_TO_CSS_UNITS,h=0;switch(t[1].name){case`XYZ`:o=t[2],s=t[3],h=t[4],o=o===null?0:o,s=s===null?m:s;break;case`Fit`:case`FitB`:h=`page-fit`;break;case`FitH`:case`FitBH`:s=t[2],h=`page-width`,s===null&&this._location?(o=this._location.left,s=this._location.top):(typeof s!=`number`||s<0)&&(s=m);break;case`FitV`:case`FitBV`:o=t[2],c=p,l=m,h=`page-height`;break;case`FitR`:o=t[2],s=t[3],c=t[4]-o,l=t[5]-s;let e=40,n=5;this.removePageBorders&&(e=n=0),u=(this.container.clientWidth-e)/c/Oo.PDF_TO_CSS_UNITS,d=(this.container.clientHeight-n)/l/Oo.PDF_TO_CSS_UNITS,h=Math.min(Math.abs(u),Math.abs(d));break;default:console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`);return}if(r||(h&&h!==this._currentScale?this.currentScaleValue=h:this._currentScale===0&&(this.currentScaleValue=`auto`)),h===`page-fit`&&!t[4]){this.#H(a);return}let g=[a.viewport.convertToViewportPoint(o,s),a.viewport.convertToViewportPoint(o+c,s+l)],_=Math.min(g[0][0],g[1][0]),v=Math.min(g[0][1],g[1][1]);i?((i===`both`||i===`vertical`)&&(v-=(this.container.clientHeight-Math.abs(g[1][1]-g[0][1]))/2),(i===`both`||i===`horizontal`)&&(_-=(this.container.clientWidth-Math.abs(g[1][0]-g[0][0]))/2)):n||(_=Math.max(_,0),v=Math.max(v,0)),this.#H(a,{left:_,top:v})}_updateLocation(e){this.#x=!1;let t=this._currentScale,n=this._currentScaleValue,r=parseFloat(n)===t?Math.round(t*1e4)/100:n,i=e.id,a=this._pages[i-1],o=this.container,[s,c]=a.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),l=`#page=${i}`;this.isInPresentationMode||(l+=`&zoom=${r},${Math.round(s)},${Math.round(c)}`),this._location={pageNumber:i,scale:r,top:c,left:s,rotation:this._pagesRotation,pdfOpenParams:l}}update(){let e=this._getVisiblePages(),t=e.views,n=t.length;if(n===0)return;let r=Math.max(iu,2*n+1);this.#e.resize(r,e.ids);for(let{view:e,visibleArea:n}of t)e.updateVisibleArea(n);for(let t of this.#e)e.ids.has(t.id)||t.updateVisibleArea(null);this.renderingQueue.renderHighestPriority(e);let i=this._spreadMode===$o.NONE&&(this._scrollMode===Y.PAGE||this._scrollMode===Y.VERTICAL),a=this._currentPageNumber,o=!1;for(let e of t){if(e.percent<100)break;if(e.id===a&&i){o=!0;break}}this._setCurrentPageNumber(o?this._currentPageNumber:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch(`updateviewarea`,{source:this,location:this._location})}#Y(){let e=this._getVisiblePages(),t=[],{ids:n,views:r}=e;for(let e of r){let{view:r}=e;r.hasEditableAnnotations()?t.push(e):n.delete(r.id)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:n}),n)}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction===`rtl`}get isInPresentationMode(){return this.presentationModeState===Zo.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===Zo.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){let e=this._scrollMode===Y.PAGE?this.#O.pages:this._pages,t=this._scrollMode===Y.HORIZONTAL,n=t&&this._isContainerRtl;return us({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:n})}cleanup(){for(let e of this._pages)e.renderingState!==Q.FINISHED&&e.reset()}_cancelRendering(){for(let e of this._pages)e.cancelRendering()}async#X(e){if(e.pdfPage)return e.pdfPage;try{let t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),t}catch(e){return console.error(`Unable to get page for page view`,e),null}}#Z(e){if(e.first?.id===1)return!0;if(e.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case Y.PAGE:return this.#O.scrollDown;case Y.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(e){let t=e||this._getVisiblePages(),n=this.#Z(t),r=this._spreadMode!==$o.NONE&&this._scrollMode!==Y.HORIZONTAL,i=this.#k!==null||this.#b!==null&&t.views.some(e=>e.detailView?.renderingCancelled),a=this.renderingQueue.getHighestPriority(t,this._pages,n,r,i);return a?(this.#X(a).then(()=>{this.renderingQueue.renderView(a)}),!0):!1}get hasEqualPageSizes(){let e=this._pages[0];for(let t=1,n=this._pages.length;t<n;++t){let n=this._pages[t];if(n.width!==e.width||n.height!==e.height)return!1}return!0}getPagesOverview(){let e;return this._pages.map(t=>{let n=t.pdfPage.getViewport({scale:1}),r=ms(n);if(e===void 0)e=r;else if(this.enablePrintAutoRotate&&r!==e)return{width:n.height,height:n.width,rotation:(n.rotation-90)%360};return{width:n.width,height:n.height,rotation:n.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error(`optionalContentConfigPromise: Not initialized yet.`),this.pdfDocument.getOptionalContentConfig({intent:`display`})):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch(`optionalcontentconfigchanged`,{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!fs(e))throw Error(`Invalid scroll mode: ${e}`);this.pagesCount>au.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this.clearSelection(),this._scrollMode=e,this.eventBus.dispatch(`scrollmodechanged`,{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){let t=this._scrollMode,n=this.viewer;n.classList.toggle(`scrollHorizontal`,t===Y.HORIZONTAL),n.classList.toggle(`scrollWrapped`,t===Y.WRAPPED),this.pdfDocument&&e&&(t===Y.PAGE?this.#V():this._previousScrollMode===Y.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#q(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!ps(e))throw Error(`Invalid spread mode: ${e}`);this.clearSelection(),this._spreadMode=e,this.eventBus.dispatch(`spreadmodechanged`,{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;let t=this.viewer,n=this._pages;if(this._scrollMode===Y.PAGE)this.#V();else if(t.textContent=``,this._spreadMode===$o.NONE)for(let e of this._pages)t.append(e.div);else{let e=this._spreadMode-1,r=null;for(let i=0,a=n.length;i<a;++i)r===null?(r=document.createElement(`div`),r.className=`spread`,t.append(r)):i%2===e&&(r=r.cloneNode(!1),t.append(r)),r.append(n[i].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#q(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}#Q(e,t=!1){switch(this._scrollMode){case Y.WRAPPED:{let{views:n}=this._getVisiblePages(),r=new Map;for(let{id:e,y:t,percent:i,widthPercent:a}of n)i===0||a<100||r.getOrInsertComputed(t,po).push(e);for(let n of r.values()){let r=n.indexOf(e);if(r===-1)continue;let i=n.length;if(i===1)break;if(t)for(let t=r-1,i=0;t>=0;t--){let r=n[t],i=n[t+1]-1;if(r<i)return e-i}else for(let t=r+1;t<i;t++){let r=n[t],i=n[t-1]+1;if(r>i)return i-e}if(t){let t=n[0];if(t<e)return e-t+1}else{let t=n[i-1];if(t>e)return t-e+1}break}break}case Y.HORIZONTAL:break;case Y.PAGE:case Y.VERTICAL:{if(this._spreadMode===$o.NONE)break;let n=this._spreadMode-1;if(t&&e%2!==n||!t&&e%2===n)break;let{views:r}=this._getVisiblePages(),i=t?e-1:e+1;for(let{id:e,percent:t,widthPercent:n}of r)if(e===i){if(t>0&&n===100)return 2;break}break}}return 1}nextPage(){let e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;let n=this.#Q(e,!1)||1;return this.currentPageNumber=Math.min(e+n,t),!0}previousPage(){let e=this._currentPageNumber;if(e<=1)return!1;let t=this.#Q(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}updateScale({drawingDelay:e,scaleFactor:t=null,steps:n=null,origin:r,pan:i=null}){if(n===null&&t===null)throw Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let a=this._currentScale;if(t>0&&t!==1)a=Math.round(a*t*100)/100;else if(n){let e=n>0?1.1:1/1.1,t=n>0?Math.ceil:Math.floor;n=Math.abs(n);do a=t((a*e).toFixed(2)*10)/10;while(--n>0)}a=_o(a,.1,25),this.#q(a,{noScroll:!1,drawingDelay:e,origin:r,pan:i})}increaseScale(e={}){this.updateScale({...e,steps:e.steps??1})}decreaseScale(e={}){this.updateScale({...e,steps:-(e.steps??1)})}#$(e=this.container.clientHeight){e!==this.#E&&(this.#E=e,hs.setProperty(`--viewer-container-height`,`${e}px`))}#ee(e){for(let t of e)if(t.target===this.container){this.#$(Math.floor(t.borderBoxSize[0].blockSize)),this.#s=null;break}}get containerTopLeft(){return this.#s||=[this.container.offsetTop,this.container.offsetLeft]}#te(){this.#k!==null&&(clearTimeout(this.#k),this.#k=null),this.#b!==null&&(clearTimeout(this.#b),this.#b=null)}#ne(){this.#S?.abort(),this.#S=null,this.#C!==null&&(clearTimeout(this.#C),this.#C=null)}#re(e){switch(e){case za.STAMP:this.#_?.loadModel(`altText`);break;case za.SIGNATURE:this.#A?.loadSignatures()}}get annotationEditorMode(){return this.#i?this.#r:za.DISABLE}set annotationEditorMode({mode:e,editId:t=null,isFromKeyboard:n=!1,mustEnterInEditMode:r=!1,editComment:i=!1}){if(!this.#i)throw Error(`The AnnotationEditor is not enabled.`);if(this.#r===e)return;if(!ou(e))throw Error(`Invalid AnnotationEditor mode: ${e}`);if(!this.pdfDocument)return;this.#re(e);let{eventBus:a,pdfDocument:o}=this,s=async()=>{this.#ne(),this.#r=e,await this.#i.updateMode(e,t,!0,n,r,i),e===this.#r&&o===this.pdfDocument&&a.dispatch(`annotationeditormodechanged`,{source:this,mode:e})};if(e===za.NONE||this.#r===za.NONE){let t=e!==za.NONE;t||this.pdfDocument.annotationStorage.resetModifiedIds(),this.cleanup();for(let e of this._pages)e.toggleEditingMode(t);let n=this.#Y();if(t&&n){this.#ne(),this.#S=new AbortController;let e=AbortSignal.any([this.#h.signal,this.#S.signal]);a.on(`pagerendered`,({pageNumber:e})=>{n.delete(e),n.size===0&&(this.#C=setTimeout(s,0))},{signal:e,...bs});return}}s()}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(let e of this._pages)e.update(t);this.#te(),e||this.update()}}};globalThis.pdfjsViewer={AnnotationLayerBuilder:Bs,DownloadManager:Hs,EventBus:Gs,FindState:xs,GenericL10n:gl,LinkTarget:Ls,parseQueryString:ns,PDFFindController:Fs,PDFHistory:xl,PDFLinkService:Rs,PDFPageView:Zl,PDFScriptingManager:tu,PDFSinglePageViewer:class extends cu{_resetView(){super._resetView(),this._scrollMode=Y.PAGE,this._spreadMode=$o.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}},PDFViewer:cu,ProgressBar:gs,RenderingStates:Q,ScrollMode:Y,SimpleLinkService:zs,SpreadMode:$o,StructTreeLayerBuilder:Wl,TextLayerBuilder:ql,XfaLayerBuilder:Jl};var lu=`:root{--button-primary-bg-color:var(--button-background-color-primary,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--button-primary-fg-color:var(--button-text-color-primary,var(--lightningcss-light,#fbfbfe)var(--lightningcss-dark,#15141a));--button-primary-border-color:var(--button-primary-bg-color);--button-primary-active-bg-color:var(--button-background-color-primary-active,var(--lightningcss-light,#054096)var(--lightningcss-dark,#aaf2ff));--button-primary-active-fg-color:var(--button-primary-fg-color);--button-primary-active-border-color:var(--button-primary-active-bg-color);--button-primary-hover-bg-color:var(--button-background-color-primary-hover,var(--lightningcss-light,#0250bb)var(--lightningcss-dark,#80ebff));--button-primary-hover-fg-color:var(--button-primary-fg-color);--button-primary-hover-border-color:var(--button-primary-hover-bg-color);--button-primary-disabled-bg-color:var(--button-primary-bg-color);--button-primary-disabled-border-color:var(--button-primary-border-color);--button-primary-disabled-fg-color:var(--button-primary-fg-color);--button-secondary-bg-color:var(--button-background-color,var(--lightningcss-light,#15141a12)var(--lightningcss-dark,#fbfbfe12));--button-secondary-fg-color:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--button-secondary-border-color:var(--button-border-color,var(--button-secondary-bg-color));--button-secondary-active-bg-color:var(--button-background-color-active,var(--lightningcss-light,#15141a36)var(--lightningcss-dark,#fbfbfe36));--button-secondary-active-fg-color:var(--button-secondary-fg-color);--button-secondary-active-border-color:var(--button-secondary-bg-color);--button-secondary-hover-bg-color:var(--button-background-color-hover,var(--lightningcss-light,#15141a24)var(--lightningcss-dark,#fbfbfe24));--button-secondary-hover-fg-color:var(--button-secondary-fg-color);--button-secondary-hover-border-color:var(--button-secondary-hover-bg-color);--button-secondary-disabled-bg-color:var(--button-secondary-bg-color);--button-secondary-disabled-border-color:var(--button-secondary-border-color);--button-secondary-disabled-fg-color:var(--button-secondary-fg-color);--button-disabled-opacity:.4;--hover-filter:brightness(.9)}@media (prefers-color-scheme:dark){:root{--button-disabled-opacity:.6;--hover-filter:brightness(1.4)}}@media screen and (forced-colors:active){:root{--button-primary-bg-color:var(--button-background-color-primary,ButtonText);--button-primary-fg-color:var(--button-text-color-primary,ButtonFace);--button-primary-border-color:var(--button-border-color-primary,ButtonText);--button-primary-active-bg-color:var(--button-background-color-primary-active,SelectedItem);--button-primary-active-fg-color:var(--button-text-color-primary-active,HighlightText);--button-primary-active-border-color:var(--button-border-color-primary-active,ButtonText);--button-primary-hover-bg-color:var(--button-background-color-primary-hover,SelectedItem);--button-primary-hover-fg-color:var(--button-text-color-primary-hover,HighlightText);--button-primary-hover-border-color:var(--button-border-color-primary-hover,SelectedItem);--button-primary-disabled-bg-color:var(--button-background-color-primary-disabled,GrayText);--button-primary-disabled-fg-color:var(--button-text-color-primary-disabled,ButtonFace);--button-primary-disabled-border-color:var(--button-border-color-primary-disabled,GrayText);--button-secondary-bg-color:var(--button-background-color,ButtonFace);--button-secondary-fg-color:var(--button-text-color,ButtonText);--button-secondary-border-color:var(--button-border-color,ButtonText);--button-secondary-active-bg-color:var(--button-background-color-active,HighlightText);--button-secondary-active-fg-color:var(--button-text-color-active,SelectedItem);--button-secondary-active-border-color:var(--button-border-color-active,ButtonText);--button-secondary-hover-bg-color:var(--button-background-color-hover,HighlightText);--button-secondary-hover-fg-color:var(--button-text-color-hover,SelectedItem);--button-secondary-hover-border-color:var(--button-border-color-hover,SelectedItem);--button-secondary-disabled-fg-color:var(--button-text-color-disabled,GrayText);--button-secondary-disabled-border-color:var(--button-border-color-disabled,GrayText);--button-disabled-opacity:1;--hover-filter:none}}.primaryButton,.secondaryButton{border-radius:var(--button-border-radius,4px);font:menu;font-weight:var(--button-font-weight,590);font-size:var(--button-font-size,13px);padding:var(--button-padding,4px 16px);width:auto;min-height:var(--button-min-height,32px);border:1px solid}:is(.primaryButton,.secondaryButton):hover{cursor:pointer;filter:var(--hover-filter)}:is(.primaryButton,.secondaryButton)>span{color:inherit;font:inherit}:is(.primaryButton,.secondaryButton):disabled{pointer-events:none}.primaryButton{color:var(--button-primary-fg-color);background-color:var(--button-primary-bg-color);border-color:var(--button-primary-border-color);opacity:1}.primaryButton:hover{color:var(--button-primary-hover-fg-color);background-color:var(--button-primary-hover-bg-color);border-color:var(--button-primary-hover-border-color)}.primaryButton:active{color:var(--button-primary-active-fg-color);background-color:var(--button-primary-active-bg-color);border-color:var(--button-primary-active-border-color)}.primaryButton:disabled{background-color:var(--button-primary-disabled-bg-color);border-color:var(--button-primary-disabled-border-color);color:var(--button-primary-disabled-fg-color);opacity:var(--button-disabled-opacity)}.secondaryButton{color:var(--button-secondary-fg-color);background-color:var(--button-secondary-bg-color);border-color:var(--button-secondary-border-color)}.secondaryButton:hover{color:var(--button-secondary-hover-fg-color);background-color:var(--button-secondary-hover-bg-color);border-color:var(--button-secondary-hover-border-color)}.secondaryButton:active{color:var(--button-secondary-active-fg-color);background-color:var(--button-secondary-active-bg-color);border-color:var(--button-secondary-active-border-color)}.secondaryButton:disabled{background-color:var(--button-secondary-disabled-bg-color);border-color:var(--button-secondary-disabled-border-color);color:var(--button-secondary-disabled-fg-color);opacity:var(--button-disabled-opacity)}.messageBar{--closing-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.85822%208.84922L4.85322%2011.8542C4.75891%2011.9453%204.63261%2011.9957%204.50151%2011.9946C4.37042%2011.9934%204.24501%2011.9408%204.15231%2011.8481C4.0596%2011.7554%204.00702%2011.63%204.00588%2011.4989C4.00474%2011.3678%204.05514%2011.2415%204.14622%2011.1472L7.15122%208.14222V7.85922L4.14622%204.85322C4.05514%204.75891%204.00474%204.63261%204.00588%204.50151C4.00702%204.37042%204.0596%204.24501%204.15231%204.15231C4.24501%204.0596%204.37042%204.00702%204.50151%204.00588C4.63261%204.00474%204.75891%204.05514%204.85322%204.14622L7.85822%207.15122H8.14122L11.1462%204.14622C11.2405%204.05514%2011.3668%204.00474%2011.4979%204.00588C11.629%204.00702%2011.7544%204.0596%2011.8471%204.15231C11.9398%204.24501%2011.9924%204.37042%2011.9936%204.50151C11.9947%204.63261%2011.9443%204.75891%2011.8532%204.85322L8.84822%207.85922V8.14222L11.8532%2011.1472C11.9443%2011.2415%2011.9947%2011.3678%2011.9936%2011.4989C11.9924%2011.63%2011.9398%2011.7554%2011.8471%2011.8481C11.7544%2011.9408%2011.629%2011.9934%2011.4979%2011.9946C11.3668%2011.9957%2011.2405%2011.9453%2011.1462%2011.8542L8.14122%208.84922L8.14222%208.85022L7.85822%208.84922Z'%20fill='black'/%3e%3c/svg%3e");--message-bar-close-button-color:var(--text-primary-color);--message-bar-close-button-color-hover:var(--text-primary-color);--message-bar-close-button-border-radius:var(--border-radius-small,4px);--message-bar-close-button-border:none;--message-bar-close-button-hover-bg-color:var(--button-background-color-hover,var(--lightningcss-light,#15141a24)var(--lightningcss-dark,#fbfbfe24));--message-bar-close-button-active-bg-color:var(--button-background-color-active,var(--lightningcss-light,#15141a36)var(--lightningcss-dark,#fbfbfe36));--message-bar-close-button-focus-bg-color:var(--button-background-color,var(--lightningcss-light,#15141a12)var(--lightningcss-dark,#fbfbfe12))}@media screen and (forced-colors:active){.messageBar{--message-bar-close-button-color:var(--button-text-color,ButtonText);--message-bar-close-button-border:1px solid var(--button-border-color,ButtonText);--message-bar-close-button-hover-bg-color:var(--button-background-color-hover,SelectedItemText);--message-bar-close-button-active-bg-color:var(--button-background-color-hover,SelectedItemText);--message-bar-close-button-focus-bg-color:var(--button-background-color-hover,SelectedItemText);--message-bar-close-button-color-hover:var(--button-text-color-hover,SelectedItem)}}.messageBar{-webkit-user-select:none;user-select:none;border-radius:var(--border-radius-small,4px);border:1px solid var(--message-bar-border-color);background:var(--message-bar-bg-color);color:var(--message-bar-fg-color);flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:8px 8px 8px 16px;display:flex;position:relative}.messageBar>div{align-self:stretch;align-items:flex-start;gap:8px;display:flex}.messageBar>div:before{content:"";width:16px;height:16px;-webkit-mask-image:var(--message-bar-icon);-webkit-mask-image:var(--message-bar-icon);mask-image:var(--message-bar-icon);background-color:var(--message-bar-icon-color);flex-shrink:0;display:inline-block;-webkit-mask-size:cover;mask-size:cover}.messageBar button{cursor:pointer}.messageBar button:focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}.messageBar .closeButton{border-radius:var(--message-bar-close-button-border-radius);border:var(--message-bar-close-button-border);background:0 0;justify-content:center;align-items:center;width:32px;height:32px;display:flex}.messageBar .closeButton:before{content:"";width:16px;height:16px;-webkit-mask-image:var(--closing-button-icon);-webkit-mask-image:var(--closing-button-icon);mask-image:var(--closing-button-icon);background-color:var(--message-bar-close-button-color);display:inline-block;-webkit-mask-size:cover;mask-size:cover}.messageBar .closeButton:is(:hover,:active,:focus):before{background-color:var(--message-bar-close-button-color-hover)}.messageBar .closeButton:hover{background-color:var(--message-bar-close-button-hover-bg-color)}.messageBar .closeButton:active{background-color:var(--message-bar-close-button-active-bg-color)}.messageBar .closeButton:focus{background-color:var(--message-bar-close-button-focus-bg-color)}.messageBar .closeButton>span{width:0;height:0;display:inline-block;overflow:hidden}#editorUndoBar{--message-bar-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.625%200.5C6.64009%200.5%205.66482%200.693993%204.75487%201.0709C3.84493%201.44781%203.01814%202.00026%202.3217%202.6967C1.62526%203.39314%201.07281%204.21993%200.695904%205.12987C0.318993%206.03982%200.125%207.01509%200.125%208C0.125%208.98491%200.318993%209.96018%200.695904%2010.8701C1.07281%2011.7801%201.62526%2012.6069%202.3217%2013.3033C3.01814%2013.9997%203.84493%2014.5522%204.75487%2014.9291C5.66482%2015.306%206.64009%2015.5%207.625%2015.5C9.61412%2015.5%2011.5218%2014.7098%2012.9283%2013.3033C14.3348%2011.8968%2015.125%209.98912%2015.125%208C15.125%206.01088%2014.3348%204.10322%2012.9283%202.6967C11.5218%201.29018%209.61412%200.5%207.625%200.5ZM8.25%2011.375C8.25%2011.5408%208.18415%2011.6997%208.06694%2011.8169C7.94973%2011.9342%207.79076%2012%207.625%2012C7.45924%2012%207.30027%2011.9342%207.18306%2011.8169C7.06585%2011.6997%207%2011.5408%207%2011.375V6.938C7%206.77224%207.06585%206.61327%207.18306%206.49606C7.30027%206.37885%207.45924%206.313%207.625%206.313C7.79076%206.313%207.94973%206.37885%208.06694%206.49606C8.18415%206.61327%208.25%206.77224%208.25%206.938V11.375ZM8.25%205L8%205.25H7.25L7%205V4.25L7.25%204H8L8.25%204.25V5Z'%20fill='black'%20/%3e%3c/svg%3e");--message-bar-icon-color:var(--lightningcss-light,#0060df)var(--lightningcss-dark,#73a7f3);--message-bar-bg-color:var(--lightningcss-light,#deeafc)var(--lightningcss-dark,#003070);--message-bar-fg-color:var(--text-primary-color);--message-bar-border-color:var(--lightningcss-light,#00000014)var(--lightningcss-dark,#ffffff14)}@media screen and (forced-colors:active){#editorUndoBar{--message-bar-icon-color:CanvasText;--message-bar-bg-color:Canvas;--message-bar-border-color:CanvasText}}#editorUndoBar{z-index:10;font:menu;cursor:default;padding-block:8px;padding-inline:16px 8px;font-size:15px;position:fixed;top:50px;left:50%;transform:translate(-50%)}#editorUndoBar button{cursor:pointer}#editorUndoBar #editorUndoBarUndoButton{border-color:var(--color-accent-primary,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));margin-inline-start:8px}#editorUndoBar>div{align-items:center}.dialog{--dialog-bg-color:var(--background-color-canvas,var(--lightningcss-light,#fff)var(--lightningcss-dark,#1c1b22));--dialog-border-color:var(--background-color-canvas,var(--lightningcss-light,#fff)var(--lightningcss-dark,#1c1b22));--dialog-shadow:0 2px 14px 0 var(--lightningcss-light,#3a394433)var(--lightningcss-dark,#15141a);--text-secondary-color:var(--lightningcss-light,#5b5b66)var(--lightningcss-dark,#cfcfd8);--separator-color:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#52525e);--textarea-border-color:var(--border-color-interactive,#8f8f9d);--textarea-bg-color:var(--lightningcss-light,#fff)var(--lightningcss-dark,#42414d);--textarea-fg-color:var(--text-secondary-color);--input-text-bg-color:var(--lightningcss-light,#fff)var(--lightningcss-dark,#42414d);--input-text-fg-color:var(--text-primary-color)}@media screen and (forced-colors:active){.dialog{--dialog-bg-color:var(--background-color-canvas,Canvas);--dialog-border-color:var(--border-color,CanvasText);--dialog-shadow:none;--text-secondary-color:CanvasText;--separator-color:CanvasText;--textarea-border-color:ButtonBorder;--textarea-bg-color:Field;--textarea-fg-color:ButtonText;--input-text-bg-color:Field;--input-text-fg-color:FieldText}}.dialog{font:message-box;border-radius:var(--border-radius-medium,4px);border:1px solid var(--dialog-border-color);background:var(--dialog-bg-color);color:var(--text-primary-color);box-shadow:var(--dialog-shadow);padding:12px 16px;font-size:13px;font-weight:400;line-height:150%}.dialog .mainContainer :focus-visible{outline:var(--focus-ring-outline);outline-offset:2px}.dialog .mainContainer .title{flex-direction:column;justify-content:flex-end;align-items:flex-start;gap:12px;width:auto;display:flex}.dialog .mainContainer .title>span{font-size:13px;font-style:normal;font-weight:590;line-height:150%}.dialog .mainContainer .dialogSeparator{border-top:1px solid var(--separator-color);border-bottom:none;width:100%;height:0;margin-block:4px}.dialog .mainContainer .dialogButtonsGroup{align-self:flex-end;gap:12px;display:flex}.dialog .mainContainer input:is([type=checkbox],[type=radio]){accent-color:var(--color-accent-primary,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));width:var(--checkbox-size,16px);height:var(--checkbox-size,16px)}.dialog .mainContainer .radio{flex-direction:column;align-items:flex-start;gap:4px;display:flex}.dialog .mainContainer .radio>.radioButton{align-self:stretch;align-items:center;gap:8px;display:flex}.dialog .mainContainer .radio>.radioLabel{align-self:stretch;align-items:flex-start;gap:10px;padding-inline-start:24px;display:flex}.dialog .mainContainer .radio>.radioLabel>span{color:var(--text-secondary-color);flex:1 0 0;font-size:11px}.dialog .mainContainer button:not(:is(.toggle-button,.closeButton,.clearInputButton)){border-radius:var(--button-border-radius,4px);font:menu;font-weight:var(--button-font-weight,590);font-size:var(--button-font-size,13px);padding:var(--button-padding,4px 16px);width:auto;min-height:var(--button-min-height,32px);border-style:solid;border-width:1px}.dialog .mainContainer button:not(:is(.toggle-button,.closeButton,.clearInputButton)):hover{cursor:pointer;filter:var(--hover-filter)}.dialog .mainContainer button:not(:is(.toggle-button,.closeButton,.clearInputButton))>span{color:inherit;font:inherit}.dialog .mainContainer button:not(:is(.toggle-button,.closeButton,.clearInputButton)):disabled{pointer-events:none}.dialog .mainContainer a{color:var(--link-fg-color)}.dialog .mainContainer a:hover{color:var(--link-hover-fg-color)}.dialog .mainContainer textarea{font:inherit;resize:none;box-sizing:border-box;border-radius:var(--border-radius-small,4px);border:1px solid var(--textarea-border-color);background:var(--textarea-bg-color);color:var(--textarea-fg-color);margin:0;padding:8px}.dialog .mainContainer textarea:focus{outline-offset:0;border-color:#0000}.dialog .mainContainer textarea:disabled{pointer-events:none;opacity:.4}.dialog .mainContainer input[type=text]{background-color:var(--input-text-bg-color);color:var(--input-text-fg-color)}.dialog .mainContainer .messageBar{--message-bar-bg-color:var(--lightningcss-light,#ffebcd)var(--lightningcss-dark,#5a3100);--message-bar-fg-color:var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe);--message-bar-border-color:var(--lightningcss-light,#00000014)var(--lightningcss-dark,#ffffff14);--message-bar-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.8748%2012.037L9.37782%202.037C8.99682%201.346%208.31082%201%207.62482%201C6.93882%201%206.25282%201.346%205.87282%202.037L0.375823%2012.037C-0.358177%2013.37%200.606823%2015%202.12782%2015H13.1228C14.6428%2015%2015.6078%2013.37%2014.8748%2012.037ZM8.24982%2011.75L7.99982%2012H7.24982L6.99982%2011.75V11L7.24982%2010.75H7.99982L8.24982%2011V11.75ZM8.24982%209.062C8.24982%209.22776%208.18398%209.38673%208.06677%209.50394C7.94955%209.62115%207.79058%209.687%207.62482%209.687C7.45906%209.687%207.30009%209.62115%207.18288%209.50394C7.06567%209.38673%206.99982%209.22776%206.99982%209.062V5.625C6.99982%205.45924%207.06567%205.30027%207.18288%205.18306C7.30009%205.06585%207.45906%205%207.62482%205C7.79058%205%207.94955%205.06585%208.06677%205.18306C8.18398%205.30027%208.24982%205.45924%208.24982%205.625V9.062Z'%20fill='black'/%3e%3c/svg%3e");--message-bar-icon-color:var(--lightningcss-light,#cd411e)var(--lightningcss-dark,#e49c49)}@media screen and (forced-colors:active){.dialog .mainContainer .messageBar{--message-bar-bg-color:HighlightText;--message-bar-fg-color:CanvasText;--message-bar-border-color:CanvasText;--message-bar-icon-color:CanvasText}}.dialog .mainContainer .messageBar{align-self:stretch}.dialog .mainContainer .messageBar>div:before,.dialog .mainContainer .messageBar>div>div{margin-block:4px}.dialog .mainContainer .messageBar>div>div{flex-direction:column;flex:1 0 0;align-items:flex-start;gap:8px;display:flex}.dialog .mainContainer .messageBar>div>div .title{font-size:13px;font-weight:590}.dialog .mainContainer .messageBar>div>div .description{font-size:13px}.dialog .mainContainer .toggler{align-self:stretch;align-items:center;gap:8px;display:flex}.dialog .mainContainer .toggler>.togglerLabel{-webkit-user-select:none;user-select:none}.textLayer{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light only;text-align:initial;opacity:1;letter-spacing:normal;word-spacing:normal;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;caret-color:canvastext;z-index:0;line-height:1;position:absolute;inset:0;overflow:clip}.textLayer.highlighting{touch-action:none}.textLayer :is(span,br){color:#0000;white-space:pre;cursor:text;transform-origin:0 0;-webkit-user-select:text;user-select:text;position:absolute}.textLayer{--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size))}.textLayer>:not(.markedContent),.textLayer .markedContent span:not(.markedContent){z-index:1;--font-height:0;font-size:calc(var(--text-scale-factor) * var(--font-height));--scale-x:1;--rotate:0deg;transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}.textLayer .markedContent{display:contents}.textLayer span[role=img]{-webkit-user-select:none;user-select:none;cursor:default}.textLayer .highlight{--highlight-bg-color:#b400aa40;--highlight-selected-bg-color:#00640040;--highlight-backdrop-filter:none;--highlight-selected-backdrop-filter:none}@media screen and (forced-colors:active){.textLayer .highlight{--highlight-bg-color:transparent;--highlight-selected-bg-color:transparent;--highlight-backdrop-filter:var(--hcm-highlight-filter);--highlight-selected-backdrop-filter:var(--hcm-highlight-selected-filter)}}.textLayer .highlight{background-color:var(--highlight-bg-color);-webkit-backdrop-filter:var(--highlight-backdrop-filter);backdrop-filter:var(--highlight-backdrop-filter);border-radius:4px;margin:-1px;padding:1px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color);-webkit-backdrop-filter:var(--highlight-selected-backdrop-filter);backdrop-filter:var(--highlight-selected-backdrop-filter);scroll-margin-top:50px}.textLayer ::selection{background:#0000ff40;background:color-mix(in srgb, AccentColor, transparent 50%);color:#0000}.textLayer.selectionRendering ::selection{color:#0000;background:0 0}.textLayer br::selection{background:0 0}.textLayer .endOfContent{z-index:0;cursor:default;-webkit-user-select:none;user-select:none;display:block;position:absolute;inset:100% 0 0}.textLayer.selecting .endOfContent{top:0}.textLayerImages{-webkit-user-select:none;user-select:none;position:absolute;inset:0}.textLayerImages canvas{transform-origin:0 0;position:absolute}.annotationLayer{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light only;--annotation-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--annotation-unfocused-field-filter:url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='pdfjsFillableField' x='0%' y='0%' width='100%' height='100%' color-interpolation-filters='sRGB'><feFlood flood-color='rgb(0,54,255)' flood-opacity='0.13' result='f'/><feComposite in='f' in2='SourceGraphic' operator='over'/></filter></svg>#pdfjsFillableField");--input-focus-border-color:Highlight;--input-focus-outline:1px solid Canvas;--input-unfocused-border-color:transparent;--input-disabled-border-color:transparent;--input-hover-border-color:black;--link-outline:none}@media screen and (forced-colors:active){.annotationLayer{--input-focus-border-color:CanvasText;--input-unfocused-border-color:ActiveText;--input-disabled-border-color:GrayText;--input-hover-border-color:Highlight;--link-outline:1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selecteditem}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter)}.annotationLayer .linkAnnotation>a:hover{box-shadow:none;opacity:0!important;background:0 0!important}.annotationLayer .popupAnnotation .popup{outline:calc(1.5px * var(--total-scale-factor)) solid CanvasText!important;color:buttontext!important;background-color:buttonface!important}.annotationLayer .highlightArea:hover:after{width:100%;height:100%;-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter);content:"";pointer-events:none;position:absolute;top:0;left:0}.annotationLayer .popupAnnotation.focused .popup{outline:calc(3px * var(--total-scale-factor)) solid Highlight!important}}.annotationLayer{pointer-events:none;transform-origin:0 0;position:absolute;top:0;left:0}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg)translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg)translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg)translateY(-100%)}.annotationLayer.disabled section,.annotationLayer.disabled .popup{pointer-events:none}.annotationLayer .annotationContent{pointer-events:none;width:100%;height:100%;position:absolute}.annotationLayer .annotationContent.freetext{white-space:nowrap;background:0 0;border:none;font:10px/1.35 sans-serif;inset:0;overflow:visible}.annotationLayer section{text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0;-webkit-user-select:none;user-select:none;position:absolute}.annotationLayer section:has(div.annotationContent) canvas.annotationContent{display:none}.annotationLayer section .overlaidText{width:0;height:0;display:inline-block;position:absolute;top:0;left:0;overflow:hidden}.annotationLayer .hasOwnCanvas:not(.sandboxModified) :is(input,textarea),.annotationLayer .hasOwnCanvas.sandboxModified canvas.annotationContent{display:none}.textLayer.selecting~.annotationLayer section{pointer-events:none}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{width:100%;height:100%;font-size:1em;position:absolute;top:0;left:0}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton):not(.hasBorder)>a:hover{opacity:.2;background-color:#ff0}.annotationLayer .linkAnnotation.hasBorder:hover{background-color:#ff03}.annotationLayer .hasBorder{background-size:100% 100%}.annotationLayer .textAnnotation img{cursor:pointer;width:100%;height:100%;position:absolute;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--total-scale-factor)) sans-serif;vertical-align:top;width:100%;height:100%;margin:0}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{border:2px solid var(--input-disabled-border-color);cursor:not-allowed;background:0 0}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline);background:0 0;border-radius:2px}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-color:#0000;background-image:none}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline);border-radius:2px}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) [data-canvas-name]{filter:var(--annotation-unfocused-field-filter)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton):focus-within [data-canvas-name]{filter:none}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) [data-canvas-name=checked]:has(~input:checked){display:block}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) [data-canvas-name=checked]:has(~input:not(:checked)){display:none}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) [data-canvas-name=unchecked]:has(~input:checked){display:none}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) [data-canvas-name=unchecked]:has(~input:not(:checked)){display:block}.annotationLayer .textWidgetAnnotation input.comb{--comb-width:0px;--comb-letter-spacing:calc(var(--comb-width) - 1ch);letter-spacing:var(--comb-letter-spacing);text-indent:calc(var(--comb-offset,0) * var(--comb-width) + var(--comb-letter-spacing) / 2);padding:0;font-family:monospace;overflow-x:hidden}.annotationLayer .textWidgetAnnotation input.comb:focus{background-image:repeating-linear-gradient(to right, transparent 0 calc(var(--comb-width) - 1px), var(--input-focus-border-color) calc(var(--comb-width) - 1px) var(--comb-width))}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{appearance:none}:is(.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton):has([data-canvas-name=checked]) input:checked,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton):has([data-canvas-name=unchecked]) input:not(:checked)){background-image:none}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{width:100%;height:100%}.annotationLayer .mediaAnnotation{pointer-events:auto}.annotationLayer .mediaAnnotation .mediaContent{width:100%}.annotationLayer .mediaAnnotation video.mediaContent{-o-object-fit:contain;object-fit:contain;height:100%}.annotationLayer .mediaAnnotation audio.mediaContent{position:absolute;bottom:0}.annotationLayer .mediaAnnotation .mediaPlayButton{cursor:pointer;background-color:#0000;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='rgba(0,0,0,0.55)'/%3E%3Cpath d='M40 32 L70 50 L40 68 Z' fill='white'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:calc(48px * var(--total-scale-factor));border:none;width:100%;height:100%;margin:0;padding:0}.annotationLayer .mediaAnnotation .mediaPlayButton:hover{background-color:#ffffff1a}.annotationLayer .popupAnnotation{font-size:calc(9px * var(--total-scale-factor));pointer-events:none;width:max-content;max-width:45%;height:auto;position:absolute}.annotationLayer .popup{color:#000;box-shadow:0 calc(2px * var(--total-scale-factor)) calc(5px * var(--total-scale-factor)) #888;border-radius:calc(2px * var(--total-scale-factor));padding:calc(6px * var(--total-scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto;-webkit-user-select:text;user-select:text;background-color:#ff9;outline:1.5px solid #ffff4a}.annotationLayer .popupAnnotation.focused .popup{outline-width:3px}.annotationLayer .popup *{font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popup>.header{display:inline-block}.annotationLayer .popup>.header>.title{font-weight:700;display:inline}.annotationLayer .popup>.header .popupDate{margin-left:calc(5px * var(--total-scale-factor));width:fit-content;display:inline-block}.annotationLayer .popupContent{margin-top:calc(2px * var(--total-scale-factor));padding-top:calc(2px * var(--total-scale-factor));border-top:1px solid #333}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popupTriggerArea{cursor:pointer}.annotationLayer .popupTriggerArea:hover{-webkit-backdrop-filter:var(--hcm-highlight-filter);backdrop-filter:var(--hcm-highlight-filter)}.annotationLayer section svg{width:100%;height:100%;position:absolute;top:0;left:0}.annotationLayer .annotationTextContent{opacity:0;color:#0000;-webkit-user-select:none;user-select:none;pointer-events:none;width:100%;height:100%;position:absolute}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}.annotationLayer svg.quadrilateralsContainer{contain:strict;z-index:-1;width:0;height:0;position:absolute;top:0;left:0}:root{--xfa-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--xfa-focus-outline:auto}@media screen and (forced-colors:active){:root{--xfa-focus-outline:2px solid CanvasText}.xfaLayer :required{outline:1.5px solid selecteditem}}.xfaLayer{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light only;background-color:#0000}.xfaLayer .highlight{background-color:#efcbed;border-radius:4px;margin:-1px;padding:1px}.xfaLayer .highlight.appended{position:initial}.xfaLayer .highlight.begin{border-radius:4px 0 0 4px}.xfaLayer .highlight.end{border-radius:0 4px 4px 0}.xfaLayer .highlight.middle{border-radius:0}.xfaLayer .highlight.selected{background-color:#cbdfcb}.xfaPage{position:relative;overflow:hidden}.xfaContentarea{position:absolute}.xfaPrintOnly{display:none}.xfaLayer{text-align:initial;transform-origin:0 0;line-height:1.2;position:absolute;top:0;left:0}.xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;-webkit-text-decoration:inherit;text-decoration:inherit;box-sizing:border-box;pointer-events:auto;line-height:inherit;background-color:#0000;margin:0;padding:0}.xfaLayer :required{outline:1.5px solid red}.xfaLayer div,.xfaLayer svg,.xfaLayer svg *{pointer-events:none}.xfaLayer a{color:#00f}.xfaRich li{margin-left:3em}.xfaFont{color:#000;font-kerning:none;letter-spacing:0;vertical-align:0;font-size:10px;font-style:normal;font-weight:400;text-decoration:none}.xfaCaption{flex:none;overflow:hidden}.xfaCaptionForCheckButton{flex:auto;overflow:hidden}.xfaLabel{width:100%;height:100%}.xfaLeft{flex-direction:row;align-items:center;display:flex}.xfaRight{flex-direction:row-reverse;align-items:center;display:flex}:is(.xfaLeft,.xfaRight)>:is(.xfaCaption,.xfaCaptionForCheckButton){max-height:100%}.xfaTop{flex-direction:column;align-items:flex-start;display:flex}.xfaBottom{flex-direction:column-reverse;align-items:flex-start;display:flex}:is(.xfaTop,.xfaBottom)>:is(.xfaCaption,.xfaCaptionForCheckButton){width:100%}.xfaBorder{pointer-events:none;background-color:#0000;position:absolute}.xfaWrapped{width:100%;height:100%}:is(.xfaTextfield,.xfaSelect):focus{outline:var(--xfa-focus-outline);outline-offset:-1px;background-color:#0000;background-image:none}:is(.xfaCheckbox,.xfaRadio):focus{outline:var(--xfa-focus-outline)}.xfaTextfield,.xfaSelect{resize:none;background-image:var(--xfa-unfocused-field-background);border:none;flex:auto;width:100%;height:100%}.xfaSelect{padding-inline:2px}:is(.xfaTop,.xfaBottom)>:is(.xfaTextfield,.xfaSelect){flex:0 auto}.xfaButton{cursor:pointer;text-align:center;border:none;width:100%;height:100%}.xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}.xfaCheckbox,.xfaRadio{border:none;flex:none;width:100%;height:100%}.xfaRich{white-space:pre-wrap;width:100%;height:100%}.xfaImage{-o-object-position:left top;object-position:left top;-o-object-fit:contain;object-fit:contain;width:100%;height:100%}.xfaLrTb,.xfaRlTb,.xfaTb{flex-direction:column;align-items:stretch;display:flex}.xfaLr{flex-direction:row;align-items:stretch;display:flex}.xfaRl{flex-direction:row-reverse;align-items:stretch;display:flex}.xfaTb>div{justify-content:left}.xfaPosition,.xfaArea{position:relative}.xfaValignMiddle{align-items:center;display:flex}.xfaTable{flex-direction:column;align-items:stretch;display:flex}.xfaTable .xfaRow{flex-direction:row;align-items:stretch;display:flex}.xfaTable .xfaRlRow{flex-direction:row-reverse;flex:1;align-items:stretch;display:flex}.xfaTable .xfaRlRow>div{flex:1}:is(.xfaNonInteractive,.xfaDisabled,.xfaReadOnly) :is(input,textarea){background:initial}@media print{.xfaTextfield,.xfaSelect{background:0 0}.xfaSelect{appearance:none;text-indent:1px;text-overflow:""}}.canvasWrapper svg{transform:none}.canvasWrapper svg.moving{z-index:100000}:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="90"] mask,:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="90"] use:not(.clip,.mask){transform:matrix(0,1,-1,0,1,0)}:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="180"] mask,:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="180"] use:not(.clip,.mask){transform:matrix(-1,0,0,-1,1,1)}:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="270"] mask,:is(.canvasWrapper svg.highlight,.canvasWrapper svg.highlightOutline)[data-main-rotation="270"] use:not(.clip,.mask){transform:matrix(0,-1,1,0,0,1)}.canvasWrapper svg.draw{mix-blend-mode:normal;position:absolute}.canvasWrapper svg.draw[data-draw-rotation="90"]{transform:rotate(90deg)}.canvasWrapper svg.draw[data-draw-rotation="180"]{transform:rotate(180deg)}.canvasWrapper svg.draw[data-draw-rotation="270"]{transform:rotate(270deg)}.canvasWrapper svg.highlight{--blend-mode:multiply}@media screen and (forced-colors:active){.canvasWrapper svg.highlight{--blend-mode:difference}}.canvasWrapper svg.highlight{mix-blend-mode:var(--blend-mode);position:absolute}.canvasWrapper svg.highlight:not(.free){fill-rule:evenodd}.canvasWrapper svg.highlightOutline{mix-blend-mode:normal;fill-rule:evenodd;fill:none;position:absolute}.canvasWrapper svg.highlightOutline:not(.free).hovered:not(.selected){stroke:var(--hover-outline-color);stroke-width:var(--outline-width)}.canvasWrapper svg.highlightOutline:not(.free).selected .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(var(--outline-width) + 2 * var(--outline-around-width))}.canvasWrapper svg.highlightOutline:not(.free).selected .secondaryOutline{stroke:var(--outline-color);stroke-width:var(--outline-width)}.canvasWrapper svg.highlightOutline.free.hovered:not(.selected){stroke:var(--hover-outline-color);stroke-width:calc(2 * var(--outline-width))}.canvasWrapper svg.highlightOutline.free.selected .mainOutline{stroke:var(--outline-around-color);stroke-width:calc(2 * (var(--outline-width) + var(--outline-around-width)))}.canvasWrapper svg.highlightOutline.free.selected .secondaryOutline{stroke:var(--outline-color);stroke-width:calc(2 * var(--outline-width))}.toggle-button{--toggle-background-color:var(--button-background-color,color-mix(in srgb, currentColor 7%, transparent));--toggle-background-color-hover:var(--button-background-color-hover,color-mix(in srgb, currentColor 14%, transparent));--toggle-background-color-active:var(--button-background-color-active,color-mix(in srgb, currentColor 21%, transparent));--toggle-background-color-pressed:var(--color-accent-primary,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--toggle-background-color-pressed-hover:var(--color-accent-primary-hover,var(--lightningcss-light,#0250bb)var(--lightningcss-dark,#80ebff));--toggle-background-color-pressed-active:var(--color-accent-primary-active,var(--lightningcss-light,#054096)var(--lightningcss-dark,#aaf2ff));--toggle-border-color:var(--border-color-interactive,var(--lightningcss-light,#8f8f9d)var(--lightningcss-dark,#f9f9fa));--toggle-border-color-hover:var(--toggle-border-color);--toggle-border-color-active:var(--toggle-border-color);--toggle-border-radius:var(--border-radius-circle,9999px);--toggle-border-width:var(--border-width,1px);--toggle-height:var(--size-item-small,16px);--toggle-width:var(--size-item-large,32px);--toggle-dot-background-color:var(--toggle-border-color);--toggle-dot-background-color-hover:var(--toggle-dot-background-color);--toggle-dot-background-color-active:var(--toggle-dot-background-color);--toggle-dot-background-color-on-pressed:var(--background-color-canvas,var(--lightningcss-light,#fff)var(--lightningcss-dark,#1c1b22));--toggle-dot-margin:1px;--toggle-dot-height:calc(var(--toggle-height) - 2 * var(--toggle-dot-margin) - 2 * var(--toggle-border-width));--toggle-dot-width:var(--toggle-dot-height);--toggle-dot-transform-x:calc(var(--toggle-width) - 4 * var(--toggle-dot-margin) - var(--toggle-dot-width));--input-width:var(--toggle-width);appearance:none;border:var(--toggle-border-width) solid var(--toggle-border-color);height:var(--toggle-height);width:var(--toggle-width);border-radius:var(--toggle-border-radius);background-color:var(--toggle-background-color);box-sizing:border-box;padding:0}.toggle-button:focus-visible{outline:var(--focus-ring-outline);outline-offset:var(--focus-outline-offset,2px)}.toggle-button:enabled:hover{background-color:var(--toggle-background-color-hover);border-color:var(--toggle-border-color)}.toggle-button:enabled:hover:active{background-color:var(--toggle-background-color-active);border-color:var(--toggle-border-color)}.toggle-button:before{content:"";background-color:var(--toggle-dot-background-color);height:var(--toggle-dot-height);width:var(--toggle-dot-width);margin:var(--toggle-dot-margin);border-radius:var(--toggle-border-radius);display:block;translate:0}.toggle-button[aria-pressed=true]{background-color:var(--toggle-background-color-pressed);border-color:#0000}.toggle-button[aria-pressed=true]:enabled:hover{background-color:var(--toggle-background-color-pressed-hover);border-color:#0000}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-background-color-pressed-active);border-color:#0000}.toggle-button[aria-pressed=true]:before{translate:var(--toggle-dot-transform-x);background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:enabled:hover:before,.toggle-button[aria-pressed=true]:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-on-pressed)}.toggle-button[aria-pressed=true]:-moz-locale-dir(rtl):before{translate:calc(-1 * var(--toggle-dot-transform-x))}.toggle-button[aria-pressed=true]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)):before{translate:calc(-1 * var(--toggle-dot-transform-x))}@media (prefers-reduced-motion:no-preference){.toggle-button:before{transition:translate .1s}}@media (prefers-contrast){.toggle-button:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button:enabled:hover:active{border-color:var(--toggle-border-color-active)}.toggle-button[aria-pressed=true]:enabled{border-color:var(--toggle-border-color);position:relative}.toggle-button[aria-pressed=true]:enabled:hover{border-color:var(--toggle-border-color-hover)}.toggle-button[aria-pressed=true]:enabled:hover:active{background-color:var(--toggle-dot-background-color-active);border-color:var(--toggle-dot-background-color-hover)}.toggle-button:enabled:hover:before,.toggle-button:enabled:hover:active:before{background-color:var(--toggle-dot-background-color-hover)}}@media (forced-colors){.toggle-button{--toggle-background-color:var(--button-background-color,ButtonFace);--toggle-background-color-pressed:var(--color-accent-primary,ButtonText);--toggle-background-color-pressed-hover:var(--color-accent-primary-hover,SelectedItem);--toggle-background-color-pressed-active:var(--color-accent-primary-active,SelectedItem);--toggle-border-color:var(--border-color-interactive,ButtonText);--toggle-dot-background-color:var(--color-accent-primary,ButtonText);--toggle-dot-background-color-hover:var(--color-accent-primary-hover,SelectedItem);--toggle-dot-background-color-active:var(--color-accent-primary-active,SelectedItem);--toggle-dot-background-color-on-pressed:var(--button-background-color,ButtonFace);--toggle-border-color-hover:var(--border-color-interactive-hover,SelectedItem);--toggle-border-color-active:var(--border-color-interactive-active,ButtonText)}.toggle-button[aria-pressed=true]:enabled:after{border:1px solid var(--button-background-color,ButtonFace);content:"";height:var(--toggle-height);width:var(--toggle-width);border-radius:var(--toggle-border-radius);display:block;position:absolute;inset:-2px}.toggle-button[aria-pressed=true]:enabled:hover:active:after{border-color:var(--toggle-border-color-active)}}:root{--clear-signature-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%203H13.6C14%203%2014.3%203.3%2014.3%203.6C14.3%203.9%2014%204.2%2013.7%204.2H13.3V14C13.3%2015.1%2012.4%2016%2011.3%2016H4.80005C3.70005%2016%202.80005%2015.1%202.80005%2014V4.2H2.40005C2.00005%204.2%201.80005%204%201.80005%203.6C1.80005%203.2%202.00005%203%202.40005%203H5.00005V2C5.00005%200.9%205.90005%200%207.00005%200H9.00005C10.1%200%2011%200.9%2011%202V3ZM6.90005%201.2L6.30005%201.8V3H9.80005V1.8L9.20005%201.2H6.90005ZM11.4%2014.7L12%2014.1V4.2H4.00005V14.1L4.60005%2014.7H11.4ZM7.00005%2012.4C7.00005%2012.7%206.70005%2013%206.40005%2013C6.10005%2013%205.80005%2012.7%205.80005%2012.4V7.6C5.70005%207.3%206.00005%207%206.40005%207C6.80005%207%207.00005%207.3%207.00005%207.6V12.4ZM10.2001%2012.4C10.2001%2012.7%209.90006%2013%209.60006%2013C9.30006%2013%209.00006%2012.7%209.00006%2012.4V7.6C9.00006%207.3%209.30006%207%209.60006%207C9.90006%207%2010.2001%207.3%2010.2001%207.6V12.4Z'%20fill='black'%20/%3e%3c/svg%3e");--signature-bg:var(--background-color-box-info,var(--lightningcss-light,#f9f9fb)var(--lightningcss-dark,#2b2a33));--signature-hover-bg:var(--button-background-color-hover,var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,var(--signature-bg)));--button-signature-bg:transparent;--button-signature-color:var(--main-color);--button-signature-active-bg:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#5b5b66);--button-signature-active-border:none;--button-signature-active-color:var(--button-signature-color);--button-signature-border:none;--button-signature-hover-bg:var(--lightningcss-light,#e0e0e6)var(--lightningcss-dark,#52525e);--button-signature-hover-color:var(--button-signature-color)}@media screen and (forced-colors:active){:root{--signature-bg:HighlightText;--signature-hover-bg:var(--signature-bg);--button-signature-bg:HighlightText;--button-signature-color:ButtonText;--button-signature-active-bg:ButtonText;--button-signature-active-color:HighlightText;--button-signature-border:1px solid ButtonText;--button-signature-hover-bg:Highlight;--button-signature-hover-color:HighlightText}}.signatureDialog{--primary-color:var(--text-primary-color);--signature-border-color:var(--border-color-interactive,#8f8f9d);--open-link-fg:var(--link-fg-color);--open-link-hover-fg:var(--link-hover-fg-color)}@media screen and (forced-colors:active){.signatureDialog{--primary-color:ButtonText;--signature-border-color:var(--border-color-interactive,ButtonText);--open-link-fg:ButtonText;--open-link-hover-fg:ButtonText}}.signatureDialog{width:570px;min-width:300px;max-width:100%;padding:16px 0}.signatureDialog .mainContainer{flex-direction:column;align-items:flex-start;gap:12px;width:100%;display:flex}.signatureDialog .mainContainer span:not([role=sectionhead]){font-size:13px;font-style:normal;font-weight:400;line-height:normal}.signatureDialog .mainContainer .title{margin-inline-start:16px}.signatureDialog .inputWithClearButton{--button-dimension:24px;--clear-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.85822%208.84922L4.85322%2011.8542C4.75891%2011.9453%204.63261%2011.9957%204.50151%2011.9946C4.37042%2011.9934%204.24501%2011.9408%204.15231%2011.8481C4.0596%2011.7554%204.00702%2011.63%204.00588%2011.4989C4.00474%2011.3678%204.05514%2011.2415%204.14622%2011.1472L7.15122%208.14222V7.85922L4.14622%204.85322C4.05514%204.75891%204.00474%204.63261%204.00588%204.50151C4.00702%204.37042%204.0596%204.24501%204.15231%204.15231C4.24501%204.0596%204.37042%204.00702%204.50151%204.00588C4.63261%204.00474%204.75891%204.05514%204.85322%204.14622L7.85822%207.15122H8.14122L11.1462%204.14622C11.2405%204.05514%2011.3668%204.00474%2011.4979%204.00588C11.629%204.00702%2011.7544%204.0596%2011.8471%204.15231C11.9398%204.24501%2011.9924%204.37042%2011.9936%204.50151C11.9947%204.63261%2011.9443%204.75891%2011.8532%204.85322L8.84822%207.85922V8.14222L11.8532%2011.1472C11.9443%2011.2415%2011.9947%2011.3678%2011.9936%2011.4989C11.9924%2011.63%2011.9398%2011.7554%2011.8471%2011.8481C11.7544%2011.9408%2011.629%2011.9934%2011.4979%2011.9946C11.3668%2011.9957%2011.2405%2011.9453%2011.1462%2011.8542L8.14122%208.84922L8.14222%208.85022L7.85822%208.84922Z'%20fill='black'/%3e%3c/svg%3e");justify-content:center;align-items:center;width:100%;display:flex;position:relative}.signatureDialog .inputWithClearButton>input{width:100%;height:var(--size-item-large,32px);padding-inline:8px calc(4px + var(--button-dimension));box-sizing:border-box;border-radius:var(--border-radius-small,4px);border:1px solid var(--signature-border-color)}.signatureDialog .inputWithClearButton .clearInputButton{width:var(--button-dimension);height:var(--button-dimension);background-color:var(--input-text-fg-color);-webkit-mask-size:cover;mask-size:cover;-webkit-mask-image:var(--clear-button-icon);-webkit-mask-image:var(--clear-button-icon);mask-image:var(--clear-button-icon);border:0;padding:0;display:inline-block;position:absolute;inset-block-start:4px;inset-inline-end:4px}#addSignatureDialog{--secondary-color:var(--text-secondary-color);--bg-hover:var(--button-background-color-hover,var(--lightningcss-light,#e0e0e6)var(--lightningcss-dark,#52525e));--tab-top-line-active-color:var(--color-accent-primary,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--tab-top-line-active-hover-color:var(--tab-text-hover-color);--tab-top-line-hover-color:var(--border-color-interactive,#8f8f9d);--tab-top-line-inactive-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#8f8f9d);--tab-bottom-line-active-color:var(--tab-top-line-inactive-color);--tab-bottom-line-hover-color:var(--tab-top-line-inactive-color);--tab-bottom-line-inactive-color:var(--tab-top-line-inactive-color);--tab-bg:var(--dialog-bg-color);--tab-bg-active-color:var(--tab-bg);--tab-bg-active-hover-color:var(--bg-hover);--tab-bg-hover:var(--bg-hover);--tab-panel-border:none;--tab-panel-border-radius:var(--border-radius-small,4px);--tab-text-color:var(--primary-color);--tab-text-active-color:var(--tab-top-line-active-color);--tab-text-active-hover-color:var(--tab-text-hover-color);--tab-text-hover-color:var(--tab-text-color);--signature-placeholder-color:var(--secondary-color);--signature-draw-placeholder-color:var(--primary-color);--signature-color:var(--primary-color);--save-warning-color:var(--secondary-color);--thickness-bg:var(--dialog-bg-color);--thickness-label-color:var(--primary-color);--thickness-slider-color:var(--primary-color);--thickness-border:none;--draw-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645Z'%20fill='white'/%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645ZM12.472%205.1965L13.632%204.0365L13.631%203.1885L11.811%201.3675L10.963%201.3685L9.80299%202.5285L12.472%205.1965ZM4.31099%2013.1585C4.47099%2013.1285%204.61799%2013.0515%204.73399%2012.9345L11.587%206.0815L8.91899%203.4135L2.06599%2010.2655C1.94899%2010.3835%201.87199%2010.5305%201.84099%2010.6915L1.36699%2013.2485L1.75199%2013.6335L4.31099%2013.1585Z'%20fill='black'/%3e%3c/svg%3e") 0 16, pointer}@media screen and (forced-colors:active){#addSignatureDialog{--secondary-color:ButtonText;--bg:HighlightText;--bg-hover:var(--bg);--tab-top-line-active-color:var(--color-accent-primary,ButtonText);--tab-top-line-active-hover-color:HighlightText;--tab-top-line-hover-color:var(--border-color-interactive,SelectedItem);--tab-top-line-inactive-color:ButtonText;--tab-bottom-line-active-color:var(--tab-top-line-active-color);--tab-bottom-line-hover-color:var(--tab-top-line-hover-color);--tab-bg:var(--bg);--tab-bg-active-color:SelectedItem;--tab-bg-active-hover-color:SelectedItem;--tab-panel-border:1px solid ButtonText;--tab-panel-border-radius:8px;--tab-text-color:ButtonText;--tab-text-active-color:HighlightText;--tab-text-active-hover-color:HighlightText;--tab-text-hover-color:SelectedItem;--signature-color:ButtonText;--thickness-bg:Canvas;--thickness-label-color:CanvasText;--thickness-slider-color:ButtonText;--thickness-border:1px solid var(--signature-border-color)}}#addSignatureDialog #addSignatureDialogLabel{width:0;height:0;position:absolute;inset:0;overflow:hidden}#addSignatureDialog.waiting:after{content:"";cursor:wait;width:100%;height:100%;position:absolute;inset:0}#addSignatureDialog .mainContainer [role=tablist]{align-items:flex-start;gap:0;width:100%;display:flex}#addSignatureDialog .mainContainer [role=tablist]>[role=tab]{background-color:var(--tab-bg);cursor:default;border-block-style:solid;border-block-width:1px;border-inline:0;border-block-start-color:var(--tab-top-line-inactive-color);border-block-end-color:var(--tab-bottom-line-inactive-color);font:menu;color:var(--tab-text-color);border-radius:0;flex:1 0 0;align-self:stretch;padding-inline:0;font-size:13px;font-style:normal;font-weight:400;line-height:normal}#addSignatureDialog .mainContainer [role=tablist]>[role=tab]:hover{border-block-start-width:2px;border-block-start-color:var(--tab-top-line-hover-color);border-block-end-color:var(--tab-bottom-line-hover-color);background-color:var(--tab-bg-hover);color:var(--tab-text-hover-color)}#addSignatureDialog .mainContainer [role=tablist]>[role=tab]:focus-visible{outline:2px solid var(--tab-top-line-active-color);outline-offset:-2px}#addSignatureDialog .mainContainer [role=tablist]>[role=tab][aria-selected=true]{border-block-start-width:2px;border-block-start-color:var(--tab-top-line-active-color);border-block-end-color:var(--tab-bottom-line-active-color);background-color:var(--tab-bg-active-color);color:var(--tab-text-active-color);font-weight:590}#addSignatureDialog .mainContainer [role=tablist]>[role=tab][aria-selected=true]:hover{border-block-start-color:var(--tab-top-line-active-hover-color);background-color:var(--tab-bg-active-hover-color);color:var(--tab-text-active-hover-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer{box-sizing:border-box;flex-direction:column;align-self:stretch;align-items:flex-end;gap:12px;width:100%;height:auto;padding-inline:16px;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]{background-color:var(--signature-bg);border:var(--tab-panel-border);border-radius:var(--tab-panel-border-radius);width:100%;height:220px;position:relative}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]>svg{background-color:#0000;width:100%;height:100%;position:absolute;inset:0}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureTypeContainer{display:none}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureTypeContainer #addSignatureTypeInput{text-align:center;width:100%;height:100%;color:var(--signature-color);border-radius:var(--tab-panel-border-radius);background-color:#0000;border:0;padding:0;font-family:Brush script,Apple Chancery,Segoe script,Freestyle Script,Palace Script MT,Brush Script MT,TK,cursive,serif;font-size:44px;font-style:italic;font-weight:400;position:absolute;inset:0}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureTypeContainer #addSignatureTypeInput::placeholder{color:var(--signature-placeholder-color);text-align:center;font:menu;font-size:44px;font-style:normal;font-weight:274;line-height:normal}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer{display:none}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer>span{width:100%;height:100%;color:var(--signature-placeholder-color);-webkit-user-select:none;user-select:none;background-color:#0000;justify-content:center;align-items:center;display:grid;position:absolute;top:0;left:0}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer>svg{stroke:var(--signature-color);fill:none;stroke-opacity:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer>svg:hover{cursor:var(--draw-cursor)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness{pointer-events:none;justify-content:center;align-items:center;width:100%;display:grid;position:absolute;inset-block-end:0}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>span{color:var(--signature-draw-placeholder-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div{background-color:var(--thickness-bg);border-inline:var(--thickness-border);border-top:var(--thickness-border);pointer-events:auto;border-radius:4px 4px 0 0;justify-content:center;align-items:center;gap:8px;width:auto;height:auto;margin:0;padding:6px 8px 7px;display:flex;position:relative;top:1px}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>label{color:var(--thickness-label-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input{background-color:#0000;width:100px;height:14px}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input::-webkit-slider-runnable-track{background-color:var(--thickness-slider-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input::-moz-range-track{background-color:var(--thickness-slider-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input::-moz-range-progress{background-color:var(--thickness-slider-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input::-webkit-slider-thumb{background-color:var(--thickness-bg)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input::-moz-range-thumb{background-color:var(--thickness-bg)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureDrawContainer #thickness>div>input{color:var(--signature-color);border:0;border-radius:4.5px}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer{display:none}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer>svg{stroke:none;stroke-width:0;fill:var(--signature-color);fill-opacity:1}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer #addSignatureImagePlaceholder{background-color:#0000;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer #addSignatureImagePlaceholder span{color:var(--signature-placeholder-color)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer #addSignatureImagePlaceholder a{color:var(--open-link-fg);cursor:pointer;text-decoration:underline}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer #addSignatureImagePlaceholder a:hover{color:var(--open-link-hover-fg)}#addSignatureDialog .mainContainer #addSignatureActionContainer>[role=tabpanel]#addSignatureImageContainer #addSignatureFilePicker{visibility:hidden;width:0;height:0;position:relative}#addSignatureDialog .mainContainer #addSignatureActionContainer[data-selected=type]>#addSignatureTypeContainer,#addSignatureDialog .mainContainer #addSignatureActionContainer[data-selected=draw]>#addSignatureDrawContainer,#addSignatureDialog .mainContainer #addSignatureActionContainer[data-selected=image]>#addSignatureImageContainer{display:block}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls{flex-direction:column;justify-content:center;align-self:stretch;align-items:flex-start;gap:12px;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer{align-self:stretch;align-items:flex-end;gap:16px;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #addSignatureDescriptionContainer{flex-direction:column;flex:1 0 0;align-items:flex-start;gap:4px;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #addSignatureDescriptionContainer:has(input:disabled)>label{opacity:.4}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #addSignatureDescriptionContainer>label{width:auto}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #clearSignatureButton{align-items:center;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #clearSignatureButton>span{flex-shrink:0;align-items:center;gap:4px;height:24px;display:flex}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #horizontalContainer #clearSignatureButton>span:after{content:"";width:16px;height:16px;-webkit-mask-image:var(--clear-signature-button-icon);-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon);background-color:currentColor;flex-shrink:0;display:inline-block;-webkit-mask-size:cover;mask-size:cover}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer{grid-template-columns:max-content auto;gap:4px;width:100%;display:grid}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer>input{margin:0}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer>input:disabled+label{opacity:.4}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer>label{-webkit-user-select:none;user-select:none}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer:not(.fullStorage) #addSignatureSaveWarning{display:none}#addSignatureDialog .mainContainer #addSignatureActionContainer #addSignatureControls #addSignatureSaveContainer.fullStorage #addSignatureSaveWarning{opacity:1;color:var(--save-warning-color);font-size:11px;display:block}#editSignatureDescriptionDialog .mainContainer{box-sizing:border-box;padding-inline:16px}#editSignatureDescriptionDialog .mainContainer .title{margin-inline-start:0}#editSignatureDescriptionDialog .mainContainer #editSignatureDescriptionAndView{justify-content:flex-end;align-self:stretch;align-items:flex-start;gap:12px;width:auto;display:flex}#editSignatureDescriptionDialog .mainContainer #editSignatureDescriptionAndView #editSignatureDescriptionContainer{flex-direction:column;flex:auto;align-items:flex-start;gap:4px;display:flex}#editSignatureDescriptionDialog .mainContainer #editSignatureDescriptionAndView>svg{background-color:var(--signature-bg);width:210px;height:180px;padding:8px}#editSignatureDescriptionDialog .mainContainer #editSignatureDescriptionAndView>svg>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}#editSignatureDescriptionDialog .mainContainer #editSignatureDescriptionAndView>svg>path.contours{fill:var(--button-signature-color);stroke-width:.5px}#editorSignatureParamsToolbar{padding:8px}#editorSignatureParamsToolbar #addSignatureDoorHanger{gap:8px;padding:2px}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer{justify-content:space-between;align-self:stretch;align-items:center;gap:8px;height:32px;display:flex}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button{border:var(--button-signature-border);background-color:var(--button-signature-bg);color:var(--button-signature-color);border-radius:4px}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button:hover{background-color:var(--button-signature-hover-bg)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button:active{border:var(--button-signature-active-border);background-color:var(--button-signature-active-bg);color:var(--button-signature-active-color)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button:active:before{background-color:var(--button-signature-active-color)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button:focus-visible{outline:var(--focus-ring-outline)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer button:focus-visible:before{background-color:var(--button-signature-color)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .deleteButton:before{-webkit-mask-image:var(--clear-signature-button-icon);-webkit-mask-image:var(--clear-signature-button-icon);mask-image:var(--clear-signature-button-icon)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton{width:calc(.8 * var(--editor-toolbar-min-width));height:100%;min-height:var(--menuitem-height);aspect-ratio:unset;box-sizing:border-box;font:message-box;text-align:start;white-space:normal;cursor:default;border-radius:4px;outline:none;flex:auto;justify-content:flex-start;align-items:center;gap:8px;padding:0;display:flex;position:relative;overflow:hidden}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton>svg{aspect-ratio:1;background-color:var(--signature-bg);box-sizing:border-box;border:none;border-radius:4px;flex:none;height:100%;padding:4px;display:inline-block}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton>svg>path{stroke:var(--button-signature-color);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;vector-effect:non-scaling-stroke;fill:none}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton>svg>path.contours{fill:var(--button-signature-color);stroke-width:.5px}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton:is(:hover,:active)>svg{background-color:var(--signature-hover-bg);border-radius:4px 0 0 4px}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton:hover>span{color:var(--button-signature-hover-color)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton:active{background-color:var(--button-signature-active-bg)}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton:is([disabled=disabled],[disabled]){opacity:.5;pointer-events:none}#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton>span{text-overflow:ellipsis;white-space:nowrap;height:auto;font:menu;flex:auto;font-size:13px;font-style:normal;font-weight:400;line-height:normal;overflow:hidden}.editDescription.altText{--alt-text-add-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.9815%2014.3461L14.3875%2011.1451C14.3125%2010.7361%2014.1155%2010.3621%2013.8195%2010.0641L5.0185%201.26214C4.2445%200.489141%202.9855%200.487141%202.2085%201.26214L0.5805%202.89014C-0.1935%203.66514%20-0.1935%204.92514%200.5805%205.70014L9.3845%2014.5031C9.6805%2014.7981%2010.0545%2014.9941%2010.4625%2015.0691L13.6645%2015.6631C13.7345%2015.6751%2013.8025%2015.6821%2013.8705%2015.6821C14.1675%2015.6821%2014.4555%2015.5651%2014.6695%2015.3511C14.9325%2015.0871%2015.0495%2014.7121%2014.9815%2014.3461ZM2.5285%205.87814L1.3685%204.71814L1.3695%203.87014L3.1895%202.04914L4.0375%202.05014L5.1975%203.21014L2.5285%205.87814ZM10.6895%2013.8401C10.5295%2013.8101%2010.3825%2013.7331%2010.2665%2013.6161L3.4135%206.76314L6.0815%204.09514L12.9345%2010.9471C13.0515%2011.0651%2013.1285%2011.2121%2013.1595%2011.3731L13.6335%2013.9301L13.2485%2014.3151L10.6895%2013.8401Z'%20fill='black'/%3e%3c/svg%3e")!important}.editDescription.altText:before{width:16px!important;height:16px!important}.commentPopup,#commentManagerDialog{box-sizing:border-box;border-radius:8px;width:360px;min-width:200px;max-width:100%;margin-top:0;margin-left:0;padding:8px 16px 16px;position:absolute}#commentManagerDialog{--comment-close-button-icon:url("data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.6241%2011.7759L18.3331%207.06694C18.4423%206.94811%2018.5015%206.79167%2018.4981%206.63028C18.4948%206.46889%2018.4292%206.31502%2018.3152%206.20081C18.2011%206.0866%2018.0473%206.02088%2017.8859%206.01736C17.7245%206.01384%2017.568%206.0728%2017.4491%206.18194L12.7601%2010.8709H12.2721L7.58306%206.18294C7.52495%206.12489%207.45598%206.07886%207.38008%206.04747C7.30418%206.01609%207.22284%205.99995%207.14071%206C7.05857%206.00005%206.97725%206.01627%206.90139%206.04774C6.82553%206.07922%206.75661%206.12533%206.69856%206.18344C6.64052%206.24155%206.59449%206.31052%206.5631%206.38642C6.53171%206.46232%206.51558%206.54366%206.51563%206.62579C6.51572%206.79167%206.5817%206.95071%206.69906%207.06794L11.3861%2011.7539V12.2449L6.69906%2016.9319C6.5898%2017.0508%206.53066%2017.2072%206.53399%2017.3686C6.53732%2017.53%206.60288%2017.6839%206.71696%2017.7981C6.83104%2017.9123%206.98483%2017.978%207.14622%2017.9815C7.3076%2017.985%207.46411%2017.9261%207.58306%2017.8169L12.2701%2013.1299H12.7611L17.4481%2017.8169C17.5656%2017.934%2017.7247%2017.9997%2017.8906%2017.9997C18.0564%2017.9997%2018.2155%2017.934%2018.3331%2017.8169C18.4504%2017.6996%2018.5163%2017.5404%2018.5163%2017.3744C18.5163%2017.2085%2018.4504%2017.0493%2018.3331%2016.9319L13.6241%2012.2229V11.7759Z'%20fill='black'/%3e%3c/svg%3e")}#commentManagerDialog .mainContainer{flex-direction:column;align-items:flex-start;gap:4px;width:100%;height:auto;display:flex}#commentManagerDialog .mainContainer #commentManagerToolbar{cursor:move;justify-content:flex-start;align-self:stretch;align-items:flex-start;gap:8px;width:100%;height:32px;display:flex}#commentManagerDialog .mainContainer #commentManagerTextInput{width:100%;min-height:132px;margin-bottom:12px}.annotationLayer.disabled .annotationCommentButton{display:none}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--comment-button-bg:var(--background-color-canvas,var(--lightningcss-light,#fff)var(--lightningcss-dark,#1c1b22));--comment-button-fg:var(--lightningcss-light,#5b5b66)var(--lightningcss-dark,#fbfbfe);--comment-button-active-bg:var(--lightningcss-light,#0041a4)var(--lightningcss-dark,#a6ecf4);--comment-button-active-fg:var(--button-text-color-primary,var(--lightningcss-light,#fff)var(--lightningcss-dark,#15141a));--comment-button-hover-bg:var(--color-accent-primary-hover,var(--lightningcss-light,#0053cb)var(--lightningcss-dark,#61dce9));--comment-button-hover-fg:var(--button-text-color-primary,var(--lightningcss-light,#fff)var(--lightningcss-dark,#15141a));--comment-button-selected-bg:var(--color-accent-primary,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--comment-button-border-color:var(--border-color-interactive,var(--lightningcss-light,#8f8f9d)var(--lightningcss-dark,#bfbfc9));--comment-button-active-border-color:var(--comment-button-active-bg);--comment-button-focus-border-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#3a3944);--comment-button-hover-border-color:var(--comment-button-hover-bg);--comment-button-selected-border-color:var(--comment-button-selected-bg);--comment-button-selected-fg:var(--button-text-color-primary,var(--lightningcss-light,#fff)var(--lightningcss-dark,#15141a));--comment-button-dim:24px;--comment-button-box-shadow:0 .25px .75px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 2px 6px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--comment-button-focus-outline-color:var(--focus-outline-color,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb))}@media (prefers-color-scheme:dark){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--lightningcss-light: ;--lightningcss-dark:initial}}@media screen and (forced-colors:active){:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{--comment-button-bg:var(--button-background-color,ButtonFace);--comment-button-fg:var(--button-text-color,ButtonText);--comment-button-hover-bg:var(--button-background-color-hover,SelectedItemText);--comment-button-hover-fg:var(--button-text-color-hover,SelectedItem);--comment-button-active-bg:var(--button-background-color-active,SelectedItemText);--comment-button-active-fg:var(--button-text-color-active,SelectedItem);--comment-button-border-color:var(--button-border-color,ButtonBorder);--comment-button-active-border-color:var(--button-border-color-active,ButtonBorder);--comment-button-hover-border-color:var(--button-border-color-hover,SelectedItem);--comment-button-box-shadow:none;--comment-button-focus-outline-color:var(--focus-outline-color,CanvasText);--comment-button-selected-bg:var(--button-background-color-primary,ButtonBorder);--comment-button-selected-fg:var(--button-text-color-primary,ButtonFace)}}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton{width:var(--comment-button-dim);height:var(--comment-button-dim);background-color:var(--comment-button-bg);border:1px solid var(--comment-button-border-color);box-shadow:var(--comment-button-box-shadow);cursor:auto;z-index:1;box-sizing:border-box;pointer-events:auto;border-radius:6px 6px 6px 0;margin:0;padding:4px;position:absolute}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-radius:6px 6px 0}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:before{content:"";width:100%;height:100%;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--comment-edit-button-icon);-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);background-color:var(--comment-button-fg);transform:scaleX(var(--dir-factor));margin:0;padding:0;display:inline-block}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:focus-visible{outline:2px solid var(--comment-button-focus-outline-color);outline-offset:1px;border-color:var(--comment-button-focus-border-color)}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:hover{border-color:var(--comment-button-hover-border-color);background-color:var(--comment-button-hover-bg)!important}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:hover:before{background-color:var(--comment-button-hover-fg)}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:active{border-color:var(--comment-button-active-border-color);background-color:var(--comment-button-active-bg)!important}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton:active:before{background-color:var(--comment-button-active-fg)}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton.selected{border-color:var(--comment-button-selected-border-color);background-color:var(--comment-button-selected-bg)!important}:is(.annotationLayer,.annotationEditorLayer) .annotationCommentButton.selected:before{background-color:var(--comment-button-selected-fg)}#editorCommentsSidebar,.commentPopup{--comment-close-button-icon:url("data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.6241%2011.7759L18.3331%207.06694C18.4423%206.94811%2018.5015%206.79167%2018.4981%206.63028C18.4948%206.46889%2018.4292%206.31502%2018.3152%206.20081C18.2011%206.0866%2018.0473%206.02088%2017.8859%206.01736C17.7245%206.01384%2017.568%206.0728%2017.4491%206.18194L12.7601%2010.8709H12.2721L7.58306%206.18294C7.52495%206.12489%207.45598%206.07886%207.38008%206.04747C7.30418%206.01609%207.22284%205.99995%207.14071%206C7.05857%206.00005%206.97725%206.01627%206.90139%206.04774C6.82553%206.07922%206.75661%206.12533%206.69856%206.18344C6.64052%206.24155%206.59449%206.31052%206.5631%206.38642C6.53171%206.46232%206.51558%206.54366%206.51563%206.62579C6.51572%206.79167%206.5817%206.95071%206.69906%207.06794L11.3861%2011.7539V12.2449L6.69906%2016.9319C6.5898%2017.0508%206.53066%2017.2072%206.53399%2017.3686C6.53732%2017.53%206.60288%2017.6839%206.71696%2017.7981C6.83104%2017.9123%206.98483%2017.978%207.14622%2017.9815C7.3076%2017.985%207.46411%2017.9261%207.58306%2017.8169L12.2701%2013.1299H12.7611L17.4481%2017.8169C17.5656%2017.934%2017.7247%2017.9997%2017.8906%2017.9997C18.0564%2017.9997%2018.2155%2017.934%2018.3331%2017.8169C18.4504%2017.6996%2018.5163%2017.5404%2018.5163%2017.3744C18.5163%2017.2085%2018.4504%2017.0493%2018.3331%2016.9319L13.6241%2012.2229V11.7759Z'%20fill='black'/%3e%3c/svg%3e");--comment-popup-edit-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645ZM12.472%205.1965L13.632%204.0365L13.631%203.1885L11.811%201.3675L10.963%201.3685L9.80299%202.5285L12.472%205.1965ZM4.31099%2013.1585C4.47099%2013.1285%204.61799%2013.0515%204.73399%2012.9345L11.587%206.0815L8.91899%203.4135L2.06599%2010.2655C1.94899%2010.3835%201.87199%2010.5305%201.84099%2010.6915L1.36699%2013.2485L1.75199%2013.6335L4.31099%2013.1585Z'%20fill='black'/%3e%3c/svg%3e%3c!--path%20d='M0.0189877%2014.1645L0.612989%2010.9635C0.687989%2010.5545%200.884989%2010.1805%201.18099%209.8825L9.98199%201.0805C10.756%200.3075%2012.015%200.3055%2012.792%201.0805L14.42%202.7085C15.194%203.4835%2015.194%204.7435%2014.42%205.5185L5.61599%2014.3215C5.31999%2014.6165%204.94599%2014.8125%204.53799%2014.8875L1.33599%2015.4815C1.26599%2015.4935%201.19799%2015.5005%201.12999%2015.5005C0.832989%2015.5005%200.544988%2015.3835%200.330988%2015.1695C0.0679874%2014.9055%20-0.0490122%2014.5305%200.0189877%2014.1645ZM12.472%205.6965L13.632%204.5365L13.631%203.6885L11.811%201.8675L10.963%201.8685L9.80299%203.0285L12.472%205.6965ZM4.31099%2013.6585C4.47099%2013.6285%204.61799%2013.5515%204.73399%2013.4345L11.587%206.5815L8.91899%203.9135L2.06599%2010.7655C1.94899%2010.8835%201.87199%2011.0305%201.84099%2011.1915L1.36699%2013.7485L1.75199%2014.1335L4.31099%2013.6585Z'%20fill='black'/--%3e");--comment-popup-delete-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%203H13.6C14%203%2014.3%203.3%2014.3%203.6C14.3%203.9%2014%204.2%2013.7%204.2H13.3V14C13.3%2015.1%2012.4%2016%2011.3%2016H4.80005C3.70005%2016%202.80005%2015.1%202.80005%2014V4.2H2.40005C2.00005%204.2%201.80005%204%201.80005%203.6C1.80005%203.2%202.00005%203%202.40005%203H5.00005V2C5.00005%200.9%205.90005%200%207.00005%200H9.00005C10.1%200%2011%200.9%2011%202V3ZM6.90005%201.2L6.30005%201.8V3H9.80005V1.8L9.20005%201.2H6.90005ZM11.4%2014.7L12%2014.1V4.2H4.00005V14.1L4.60005%2014.7H11.4ZM7.00005%2012.4C7.00005%2012.7%206.70005%2013%206.40005%2013C6.10005%2013%205.80005%2012.7%205.80005%2012.4V7.6C5.70005%207.3%206.00005%207%206.40005%207C6.80005%207%207.00005%207.3%207.00005%207.6V12.4ZM10.2001%2012.4C10.2001%2012.7%209.90006%2013%209.60006%2013C9.30006%2013%209.00006%2012.7%209.00006%2012.4V7.6C9.00006%207.3%209.30006%207%209.60006%207C9.90006%207%2010.2001%207.3%2010.2001%207.6V12.4Z'%20fill='black'%20/%3e%3c/svg%3e");--comment-date-fg-color:var(--lightningcss-light,#15141ab0)var(--lightningcss-dark,#fbfbfeb0);--comment-bg-color:var(--lightningcss-light,#f9f9fb)var(--lightningcss-dark,#1c1b22);--comment-hover-bg-color:var(--lightningcss-light,#e0e0e6)var(--lightningcss-dark,#2c2b33);--comment-active-bg-color:var(--lightningcss-light,#d1d1d9)var(--lightningcss-dark,#3a3944);--comment-hover-brightness:.89;--comment-hover-filter:brightness(var(--comment-hover-brightness));--comment-active-brightness:.825;--comment-active-filter:brightness(var(--comment-active-brightness));--comment-border-color:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#52525e);--comment-focus-outline-color:var(--focus-outline-color,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--comment-fg-color:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--comment-count-bg-color:var(--lightningcss-light,#e2f7ff)var(--lightningcss-dark,#00317e);--comment-indicator-active-fg-color:var(--lightningcss-light,#0041a4)var(--lightningcss-dark,#a6ecf4);--comment-indicator-active-filter:brightness(calc(1 / var(--comment-active-brightness)));--comment-indicator-focus-fg-color:var(--lightningcss-light,#5b5b66)var(--lightningcss-dark,#fbfbfe);--comment-indicator-hover-fg-color:var(--color-accent-primary-hover,var(--lightningcss-light,#0053cb)var(--lightningcss-dark,#61dce9));--comment-indicator-hover-filter:brightness(calc(1 / var(--comment-hover-brightness)));--comment-indicator-selected-fg-color:var(--color-accent-primary,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--button-comment-bg:transparent;--button-comment-color:var(--main-color);--button-comment-active-bg:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#5b5b66);--button-comment-active-border:none;--button-comment-active-color:var(--button-comment-color);--button-comment-border:none;--button-comment-hover-bg:var(--lightningcss-light,#e0e0e6)var(--lightningcss-dark,#52525e);--button-comment-hover-color:var(--button-comment-color)}@media screen and (forced-colors:active){#editorCommentsSidebar,.commentPopup{--comment-date-fg-color:CanvasText;--comment-bg-color:Canvas;--comment-hover-bg-color:Canvas;--comment-hover-filter:none;--comment-active-bg-color:Canvas;--comment-active-filter:none;--comment-border-color:CanvasText;--comment-fg-color:var(--text-color,CanvasText);--comment-count-bg-color:Canvas;--comment-indicator-active-fg-color:SelectedItem;--comment-indicator-focus-fg-color:var(--text-color,CanvasText);--comment-indicator-hover-fg-color:var(--text-color,CanvasText);--comment-indicator-selected-fg-color:SelectedItem;--button-comment-bg:ButtonFace;--button-comment-color:ButtonText;--button-comment-active-bg:Highlight;--button-comment-active-color:HighlightText;--button-comment-border:1px solid ButtonText;--button-comment-hover-bg:Highlight;--button-comment-hover-color:HighlightText}}#editorCommentsSidebar{flex-direction:column;align-items:flex-start;height:auto;padding-bottom:16px;display:flex;overflow-y:visible}#editorCommentsSidebar #editorCommentsSidebarHeader{box-sizing:border-box;justify-content:space-between;align-items:center;width:100%;padding:16px;display:flex}#editorCommentsSidebar #editorCommentsSidebarHeader .commentCount{-webkit-user-select:none;user-select:none;align-items:baseline;gap:6px;display:flex}#editorCommentsSidebar #editorCommentsSidebarHeader .commentCount #editorCommentsSidebarTitle{font:menu;color:var(--comment-fg-color);font-size:17px;font-style:normal;font-weight:590;line-height:normal}#editorCommentsSidebar #editorCommentsSidebarHeader .commentCount #editorCommentsSidebarCount{background-color:var(--comment-count-bg-color);color:var(--comment-fg-color);text-align:center;font:menu;border-radius:4px;padding:0 4px;font-size:13px;font-style:normal;font-weight:400;line-height:normal}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton{border:var(--button-comment-border);background-color:var(--button-comment-bg);cursor:pointer;border-radius:4px;width:32px;height:32px;padding:8px}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:before{content:"";width:100%;height:100%;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--comment-close-button-icon);-webkit-mask-image:var(--comment-close-button-icon);mask-image:var(--comment-close-button-icon);background-color:var(--button-comment-color);display:inline-block}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:hover{background-color:var(--button-comment-hover-bg)}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:hover:before{background-color:var(--button-comment-hover-color)}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:active{border:var(--button-comment-active-border);background-color:var(--button-comment-active-bg)}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:active:before{background-color:var(--button-comment-active-color)}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton:focus-visible{outline:var(--focus-ring-outline)}#editorCommentsSidebar #editorCommentsSidebarHeader #editorCommentsSidebarCloseButton>span{width:0;height:0;display:inline-block;overflow:hidden}#editorCommentsSidebar #editorCommentsSidebarListContainer{width:100%;overflow:auto}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList{flex-direction:column;align-items:flex-start;gap:10px;width:auto;padding:4px 16px;list-style-type:none;display:flex}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment{border:.5px solid var(--comment-border-color);background-color:var(--comment-bg-color);border-radius:8px;flex-direction:column;align-self:stretch;align-items:flex-start;gap:4px;width:auto;padding:8px 16px 16px;display:flex}@media screen and (forced-colors:active){#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):hover{background-color:var(--comment-hover-bg-color)}}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):hover{filter:var(--comment-hover-filter)}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):hover time:after{background-color:var(--comment-indicator-hover-fg-color);filter:var(--comment-indicator-hover-filter);display:inline-block}@media screen and (forced-colors:active){#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):active{background-color:var(--comment-active-bg-color)}}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):active{filter:var(--comment-active-filter)}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):active time:after{background-color:var(--comment-indicator-active-fg-color);filter:var(--comment-indicator-active-filter);display:inline-block}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):is(:focus,:focus-visible) time:after{background-color:var(--comment-indicator-focus-fg-color);display:inline-block}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments):focus-visible{outline:2px solid var(--comment-focus-outline-color);outline-offset:2px}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments).selected .sidebarCommentText{-webkit-line-clamp:unset;max-height:fit-content}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment:not(.noComments).selected time:after{background-color:var(--comment-indicator-selected-fg-color);display:inline-block}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment .sidebarCommentText{font:menu;-webkit-line-clamp:2;overflow-wrap:break-word;-webkit-box-orient:vertical;width:100%;height:fit-content;max-height:80px;font-size:15px;font-style:normal;font-weight:400;line-height:normal;display:-webkit-box;overflow:hidden}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment .sidebarCommentText .richText{--total-scale-factor:1.5}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment.noComments .sidebarCommentText{-webkit-line-clamp:unset;-webkit-user-select:none;user-select:none;max-height:fit-content}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment.noComments a{font:menu;overflow-wrap:break-word;width:100%;height:auto;color:var(--link-fg-color);margin-block-start:15px;font-size:15px;font-style:normal;font-weight:400;line-height:normal}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment.noComments a:focus-visible{outline:var(--focus-ring-outline)}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment.noComments a:hover{color:var(--link-hover-fg-color)}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment time{width:100%;font:menu;justify-content:space-between;align-items:center;font-size:13px;font-style:normal;font-weight:400;line-height:normal;display:inline-flex}#editorCommentsSidebar #editorCommentsSidebarListContainer #editorCommentsSidebarList .sidebarComment time:after{content:"";width:16px;height:16px;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--comment-edit-button-icon);-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);transform:scaleX(var(--dir-factor));display:none}.commentPopup{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--divider-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#3a3944);--comment-shadow:0 .5px 2px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 4px 16px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006)}@media (prefers-color-scheme:dark){.commentPopup{--lightningcss-light: ;--lightningcss-dark:initial}}@media screen and (forced-colors:active){.commentPopup{--divider-color:CanvasText;--comment-shadow:none}}.commentPopup{z-index:100001;pointer-events:auto;border:.5px solid var(--comment-border-color);background:var(--comment-bg-color);box-shadow:var(--comment-shadow);flex-direction:column;align-items:flex-start;gap:12px;margin-top:2px;display:flex}.commentPopup:focus-visible{outline:none}.commentPopup.dragging{cursor:move!important}.commentPopup.dragging *{cursor:move!important}.commentPopup.dragging button{pointer-events:none!important}.commentPopup:not(.selected) .commentPopupButtons{visibility:hidden!important}.commentPopup hr{border:none;border-top:1px solid var(--divider-color);width:100%;height:1px;margin:0;padding:0}.commentPopup .commentPopupTop{cursor:move;-webkit-user-select:none;user-select:none;justify-content:space-between;align-self:stretch;align-items:center;width:100%;height:auto;padding-bottom:4px;display:flex}.commentPopup .commentPopupTop .commentPopupTime{font:menu;color:var(--comment-date-fg-color);font-size:13px;font-style:normal;font-weight:400;line-height:normal}.commentPopup .commentPopupTop .commentPopupButtons{cursor:default;align-items:center;gap:2px;display:flex}.commentPopup .commentPopupTop .commentPopupButtons>button{border:var(--button-comment-border);background-color:var(--button-comment-bg);width:32px;height:32px;color:var(--button-comment-color);border-radius:4px;padding:8px}.commentPopup .commentPopupTop .commentPopupButtons>button:hover{background-color:var(--button-comment-hover-bg)}.commentPopup .commentPopupTop .commentPopupButtons>button:hover:before{background-color:var(--button-comment-hover-color)}.commentPopup .commentPopupTop .commentPopupButtons>button:active{border:var(--button-comment-active-border);background-color:var(--button-comment-active-bg);color:var(--button-comment-active-color)}.commentPopup .commentPopupTop .commentPopupButtons>button:active:before{background-color:var(--button-comment-active-color)}.commentPopup .commentPopupTop .commentPopupButtons>button:focus-visible{background-color:var(--button-comment-hover-bg);outline:2px solid var(--comment-focus-outline-color);outline-offset:0}.commentPopup .commentPopupTop .commentPopupButtons>button:before{content:"";width:100%;height:100%;display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.commentPopup .commentPopupTop .commentPopupButtons>button.commentPopupEdit:before{-webkit-mask-image:var(--comment-popup-edit-button-icon);-webkit-mask-image:var(--comment-popup-edit-button-icon);mask-image:var(--comment-popup-edit-button-icon)}.commentPopup .commentPopupTop .commentPopupButtons>button.commentPopupDelete:before{-webkit-mask-image:var(--comment-popup-delete-button-icon);-webkit-mask-image:var(--comment-popup-delete-button-icon);mask-image:var(--comment-popup-delete-button-icon)}.commentPopup .commentPopupText{width:100%;height:auto;font:menu;color:var(--comment-fg-color);font-size:15px;font-style:normal;font-weight:400;line-height:normal}.commentPopupText,.sidebarCommentText .richText{margin-block:0}:is(.commentPopupText,.sidebarCommentText .richText) p:first-of-type{margin-block:0}:is(.commentPopupText,.sidebarCommentText .richText)>*{white-space:pre-wrap;font-size:max(15px, calc(10px * var(--total-scale-factor)));overflow-wrap:break-word}:is(.commentPopupText,.sidebarCommentText .richText) span{color:var(--comment-fg-color)!important}:root{--editor-toolbar-vert-offset:6px;--outline-width:2px;--outline-color:var(--color-blue-60,#0060df);--outline-around-width:1px;--outline-around-color:var(--color-gray-20,#f0f0f4);--hover-outline-around-color:var(--outline-around-color);--editor-selection-outline:solid var(--outline-width) var(--outline-color);--unfocus-outline:solid var(--outline-width) transparent;--focus-outline-around:solid var(--outline-around-width) var(--outline-around-color);--hover-outline-color:var(--color-gray-60,#8f8f9d);--hover-outline:solid var(--outline-width) var(--hover-outline-color);--hover-outline-around:solid var(--outline-around-width) var(--hover-outline-around-color);--freetext-line-height:1.35;--freetext-padding:2px;--resizer-bg-color:var(--outline-color);--resizer-size:6px;--resizer-shift:calc(0px - (var(--outline-width) + var(--resizer-size)) / 2 - var(--outline-around-width));--editorFreeText-editing-cursor:text;--editorInk-editing-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645Z'%20fill='white'/%3e%3cpath%20d='M0.0189877%2013.6645L0.612989%2010.4635C0.687989%2010.0545%200.884989%209.6805%201.18099%209.3825L9.98199%200.5805C10.756%20-0.1925%2012.015%20-0.1945%2012.792%200.5805L14.42%202.2085C15.194%202.9835%2015.194%204.2435%2014.42%205.0185L5.61599%2013.8215C5.31999%2014.1165%204.94599%2014.3125%204.53799%2014.3875L1.33599%2014.9815C1.26599%2014.9935%201.19799%2015.0005%201.12999%2015.0005C0.832989%2015.0005%200.544988%2014.8835%200.330988%2014.6695C0.0679874%2014.4055%20-0.0490122%2014.0305%200.0189877%2013.6645ZM12.472%205.1965L13.632%204.0365L13.631%203.1885L11.811%201.3675L10.963%201.3685L9.80299%202.5285L12.472%205.1965ZM4.31099%2013.1585C4.47099%2013.1285%204.61799%2013.0515%204.73399%2012.9345L11.587%206.0815L8.91899%203.4135L2.06599%2010.2655C1.94899%2010.3835%201.87199%2010.5305%201.84099%2010.6915L1.36699%2013.2485L1.75199%2013.6335L4.31099%2013.1585Z'%20fill='black'/%3e%3c/svg%3e") 0 16, pointer;--editorHighlight-editing-cursor:url(/assets/cursor-editorTextHighlight-kG3uUOwL.svg) 24 24, text;--editorFreeHighlight-editing-cursor:url("data:image/svg+xml,%3csvg%20width='18'%20height='19'%20viewBox='0%200%2018%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2%203.09C12.28%203.01%2012.43%203%2012.43%203C12.48%203%2012.58%203.02%2012.66%203.1L14.45%204.89C14.58%205.02%2014.58%205.22%2014.45%205.35L11.7713%208.02872L9.51628%205.77372L12.2%203.09ZM13.2658%205.12L11.7713%206.6145L10.9305%205.77372L12.425%204.27921L13.2658%205.12Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.98%209.32L8.23%2011.57L10.7106%209.08938L8.45562%206.83438L5.98%209.31V9.32ZM8.23%2010.1558L9.29641%209.08938L8.45562%208.24859L7.38921%209.315L8.23%2010.1558Z'%20fill='%23FBFBFE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.1526%2013.1816L16.2125%207.1217C16.7576%206.58919%2017.05%205.8707%2017.05%205.12C17.05%204.36931%2016.7576%203.65084%2016.2126%203.11834L14.4317%201.33747C13.8992%200.79242%2013.1807%200.5%2012.43%200.5C11.6643%200.5%2010.9529%200.812929%2010.4329%201.33289L3.68289%208.08289C3.04127%208.72452%203.00459%209.75075%203.57288%2010.4363L1.29187%2012.7239C1.09186%2012.9245%200.990263%2013.1957%201.0007%2013.4685L1%2014.5C0.447715%2014.5%200%2014.9477%200%2015.5V17.5C0%2018.0523%200.447715%2018.5%201%2018.5H16C16.5523%2018.5%2017%2018.0523%2017%2017.5V15.5C17%2014.9477%2016.5523%2014.5%2016%2014.5H10.2325C9.83594%2014.5%209.39953%2013.9347%2010.1526%2013.1816ZM4.39%209.85L4.9807%2010.4407L2.39762%2013.0312H6.63877L7.10501%2012.565L7.57125%2013.0312H8.88875L15.51%206.41C15.86%206.07%2016.05%205.61%2016.05%205.12C16.05%204.63%2015.86%204.17%2015.51%203.83L13.72%202.04C13.38%201.69%2012.92%201.5%2012.43%201.5C11.94%201.5%2011.48%201.7%2011.14%202.04L4.39%208.79C4.1%209.08%204.1%209.56%204.39%209.85ZM16%2017.5V15.5H1V17.5H16Z'%20fill='%23FBFBFE'/%3e%3cpath%20d='M15.1616%206.05136L15.1616%206.05132L15.1564%206.05645L8.40645%2012.8064C8.35915%2012.8537%208.29589%2012.88%208.23%2012.88C8.16411%2012.88%208.10085%2012.8537%208.05355%2012.8064L7.45857%2012.2115L7.10501%2011.8579L6.75146%2012.2115L6.03289%2012.93H3.20465L5.33477%2010.7937L5.6873%2010.4402L5.33426%2010.0871L4.74355%209.49645C4.64882%209.40171%204.64882%209.23829%204.74355%209.14355L11.4936%202.39355C11.7436%202.14354%2012.0779%202%2012.43%202C12.7883%202%2013.1179%202.13776%2013.3614%202.38839L13.3613%202.38843L13.3664%202.39355L15.1564%204.18355L15.1564%204.18359L15.1616%204.18864C15.4122%204.43211%2015.55%204.76166%2015.55%205.12C15.55%205.47834%2015.4122%205.80789%2015.1616%206.05136ZM7.87645%2011.9236L8.23%2012.2771L8.58355%2011.9236L11.0642%209.44293L11.4177%209.08938L11.0642%208.73582L8.80918%206.48082L8.45562%206.12727L8.10207%206.48082L5.62645%208.95645L5.48%209.10289V9.31V9.32V9.52711L5.62645%209.67355L7.87645%2011.9236ZM11.4177%208.38227L11.7713%208.73582L12.1248%208.38227L14.8036%205.70355C15.1288%205.37829%2015.1288%204.86171%2014.8036%204.53645L13.0136%202.74645C12.8186%202.55146%2012.5792%202.5%2012.43%202.5H12.4134L12.3967%202.50111L12.43%203C12.3967%202.50111%2012.3966%202.50112%2012.3965%202.50112L12.3963%202.50114L12.3957%202.50117L12.3947%202.50125L12.3924%202.50142L12.387%202.50184L12.3732%202.50311C12.3628%202.50416%2012.3498%202.50567%2012.3346%202.50784C12.3049%202.51208%2012.2642%202.51925%2012.2178%202.53146C12.1396%202.55202%2011.9797%202.60317%2011.8464%202.73645L9.16273%205.42016L8.80918%205.77372L9.16273%206.12727L11.4177%208.38227ZM1.5%2016H15.5V17H1.5V16Z'%20stroke='%2315141A'/%3e%3c/svg%3e") 1 18, pointer;--new-alt-text-warning-image:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.78182%202.63903C8.58882%202.28803%208.25782%202.25003%208.12482%202.25003C7.99019%202.24847%207.85771%202.28393%207.74185%202.35253C7.62599%202.42113%207.5312%202.52023%207.46782%202.63903L1.97082%2012.639C1.90673%2012.7528%201.87406%2012.8816%201.87617%2013.0122C1.87828%2013.1427%201.91509%2013.2704%201.98282%2013.382C2.04798%2013.4951%202.14207%2013.5888%202.25543%2013.6535C2.36879%2013.7182%202.49732%2013.7515%202.62782%2013.75H13.6218C13.7523%2013.7515%2013.8809%2013.7182%2013.9942%2013.6535C14.1076%2013.5888%2014.2017%2013.4951%2014.2668%2013.382C14.3346%2013.2704%2014.3714%2013.1427%2014.3735%2013.0122C14.3756%2012.8816%2014.3429%2012.7528%2014.2788%2012.639L8.78182%202.63903ZM6.37282%202.03703C6.75182%201.34603%207.43882%201.00003%208.12482%201.00003C8.48341%200.997985%208.83583%201.09326%209.14454%201.2757C9.45325%201.45814%209.70668%201.72092%209.87782%202.03603L15.3748%2012.036C16.1078%2013.369%2015.1438%2015%2013.6228%2015H2.62782C1.10682%2015%200.141823%2013.37%200.875823%2012.037L6.37282%202.03703ZM8.74982%209.06203C8.74982%209.22779%208.68397%209.38676%208.56676%209.50397C8.44955%209.62118%208.29058%209.68703%208.12482%209.68703C7.95906%209.68703%207.80009%209.62118%207.68288%209.50397C7.56566%209.38676%207.49982%209.22779%207.49982%209.06203V5.62503C7.49982%205.45927%207.56566%205.3003%207.68288%205.18309C7.80009%205.06588%207.95906%205.00003%208.12482%205.00003C8.29058%205.00003%208.44955%205.06588%208.56676%205.18309C8.68397%205.3003%208.74982%205.45927%208.74982%205.62503V9.06203ZM7.74982%2012L7.49982%2011.75V11L7.74982%2010.75H8.49982L8.74982%2011V11.75L8.49982%2012H7.74982Z'%20fill='black'/%3e%3c/svg%3e")}.textLayer.highlighting{cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting:not(.free) span{cursor:var(--editorHighlight-editing-cursor)}.textLayer.highlighting:not(.free) span[role=img]{cursor:var(--editorFreeHighlight-editing-cursor)}.textLayer.highlighting.free span{cursor:var(--editorFreeHighlight-editing-cursor)}.page:has(.annotationEditorLayer.nonEditing) .annotationLayer .editorAnnotation{pointer-events:none;position:absolute}#viewerContainer.pdfPresentationMode:fullscreen .noAltTextBadge{display:none!important}.annotationEditorLayer.disabled .noAltTextBadge{display:none!important}@media (resolution>=1.1x){:root{--editorFreeText-editing-cursor:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%202.75H12.5V2.25V1V0.5H12H10.358C9.91165%200.5%209.47731%200.625661%209.09989%200.860442L9.09886%200.861087L8%201.54837L6.89997%200.860979L6.89911%200.860443C6.5218%200.625734%206.08748%200.5%205.642%200.5H4H3.5V1V2.25V2.75H4H5.642C5.66478%202.75%205.6885%202.75641%205.71008%202.76968C5.71023%202.76977%205.71038%202.76986%205.71053%202.76995L6.817%203.461C6.81704%203.46103%206.81709%203.46105%206.81713%203.46108C6.81713%203.46108%206.81713%203.46108%206.81714%203.46109C6.8552%203.48494%206.876%203.52285%206.876%203.567V8V12.433C6.876%2012.4771%206.85523%2012.515%206.81722%2012.5389C6.81715%2012.5389%206.81707%2012.539%206.817%2012.539L5.70953%2013.23C5.70941%2013.2301%205.70929%2013.2302%205.70917%2013.2303C5.68723%2013.2438%205.6644%2013.25%205.641%2013.25H4H3.5V13.75V15V15.5H4H5.642C6.08835%2015.5%206.52269%2015.3743%206.90011%2015.1396L6.90086%2015.1391L8%2014.4526L9.10003%2015.14L9.10089%2015.1406C9.47831%2015.3753%209.91265%2015.501%2010.359%2015.501H12H12.5V15.001V13.751V13.251H12H10.358C10.3352%2013.251%2010.3115%2013.2446%2010.2899%2013.2313C10.2897%2013.2312%2010.2896%2013.2311%2010.2895%2013.231L9.183%2012.54C9.18298%2012.54%209.18295%2012.54%209.18293%2012.54C9.18291%2012.5399%209.18288%2012.5399%209.18286%2012.5399C9.14615%2012.5169%209.125%2012.4797%209.125%2012.434V8V3.567C9.125%203.52266%209.14603%203.48441%209.18364%203.4606C9.18377%203.46052%209.1839%203.46043%209.18404%203.46035L10.2895%202.76995C10.2896%202.76985%2010.2898%202.76975%2010.2899%202.76966C10.3119%202.75619%2010.3346%202.75%2010.358%202.75H12Z'%20fill='black'%20stroke='white'/%3e%3c/svg%3e") 0 16, text}}@media screen and (forced-colors:active){:root{--outline-color:CanvasText;--outline-around-color:ButtonFace;--resizer-bg-color:ButtonText;--hover-outline-color:var(--color-accent-primary-hover,Highlight);--hover-outline-around-color:SelectedItemText}}[data-editor-rotation="90"]{transform:rotate(90deg)}[data-editor-rotation="180"]{transform:rotate(180deg)}[data-editor-rotation="270"]{transform:rotate(270deg)}.annotationEditorLayer{font-size:calc(100px * var(--total-scale-factor));transform-origin:0 0;cursor:auto;background:0 0;position:absolute;inset:0}.annotationEditorLayer .selectedEditor{z-index:100000!important}.annotationEditorLayer.drawing *{pointer-events:none!important}.annotationEditorLayer.getElements{pointer-events:auto!important}.annotationEditorLayer.getElements>div{pointer-events:auto!important}.annotationEditorLayer.waiting{content:"";cursor:wait;width:100%;height:100%;position:absolute;inset:0}.annotationEditorLayer.disabled{pointer-events:none}.annotationEditorLayer.disabled.highlightEditing :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor,.commentPopup){pointer-events:auto}.annotationEditorLayer.freetextEditing{cursor:var(--editorFreeText-editing-cursor)}.annotationEditorLayer.inkEditing{cursor:var(--editorInk-editing-cursor)}.annotationEditorLayer .draw{box-sizing:border-box}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor){z-index:1;transform-origin:0 0;cursor:auto;border:var(--unfocus-outline);background:0 0;max-width:100%;max-height:100%;position:absolute}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor).draggable.selectedEditor{cursor:move}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor).selectedEditor{border:var(--editor-selection-outline);outline:var(--focus-outline-around)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor).selectedEditor:before{content:"";border:var(--focus-outline-around);pointer-events:none;position:absolute;inset:0}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor):hover:not(.selectedEditor){border:var(--hover-outline);outline:var(--hover-outline-around)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor):hover:not(.selectedEditor):before{content:"";border:var(--focus-outline-around);position:absolute;inset:0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-delete-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%203H13.6C14%203%2014.3%203.3%2014.3%203.6C14.3%203.9%2014%204.2%2013.7%204.2H13.3V14C13.3%2015.1%2012.4%2016%2011.3%2016H4.80005C3.70005%2016%202.80005%2015.1%202.80005%2014V4.2H2.40005C2.00005%204.2%201.80005%204%201.80005%203.6C1.80005%203.2%202.00005%203%202.40005%203H5.00005V2C5.00005%200.9%205.90005%200%207.00005%200H9.00005C10.1%200%2011%200.9%2011%202V3ZM6.90005%201.2L6.30005%201.8V3H9.80005V1.8L9.20005%201.2H6.90005ZM11.4%2014.7L12%2014.1V4.2H4.00005V14.1L4.60005%2014.7H11.4ZM7.00005%2012.4C7.00005%2012.7%206.70005%2013%206.40005%2013C6.10005%2013%205.80005%2012.7%205.80005%2012.4V7.6C5.70005%207.3%206.00005%207%206.40005%207C6.80005%207%207.00005%207.3%207.00005%207.6V12.4ZM10.2001%2012.4C10.2001%2012.7%209.90006%2013%209.60006%2013C9.30006%2013%209.00006%2012.7%209.00006%2012.4V7.6C9.00006%207.3%209.30006%207%209.60006%207C9.90006%207%2010.2001%207.3%2010.2001%207.6V12.4Z'%20fill='black'%20/%3e%3c/svg%3e");--editor-toolbar-bg-color:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#2b2a33);--editor-toolbar-highlight-image:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.10918%2011.66C7.24918%2011.8%207.43918%2011.88%207.63918%2011.88C7.83918%2011.88%208.02918%2011.8%208.16918%2011.66L14.9192%204.91C15.2692%204.57%2015.4592%204.11%2015.4592%203.62C15.4592%203.13%2015.2692%202.67%2014.9192%202.33L13.1292%200.54C12.7892%200.19%2012.3292%200%2011.8392%200C11.3492%200%2010.8892%200.2%2010.5492%200.54L3.79918%207.29C3.50918%207.58%203.50918%208.06%203.79918%208.35L4.38988%208.9407L1.40918%2011.93H5.64918L6.51419%2011.065L7.10918%2011.66ZM7.63918%2010.07L5.38918%207.82V7.81L7.8648%205.33438L10.1198%207.58938L7.63918%2010.07ZM11.1805%206.52872L13.8592%203.85C13.9892%203.72%2013.9892%203.52%2013.8592%203.39L12.0692%201.6C11.9892%201.52%2011.8892%201.5%2011.8392%201.5C11.8392%201.5%2011.6892%201.51%2011.6092%201.59L8.92546%204.27372L11.1805%206.52872Z'%20fill='%23000'/%3e%3cpath%20d='M0.40918%2014H15.4092V16H0.40918V14Z'%20fill='%23000'/%3e%3c/g%3e%3c/svg%3e");--editor-toolbar-fg-color:var(--lightningcss-light,#2e2e56)var(--lightningcss-dark,#fbfbfe);--editor-toolbar-border-color:var(--border-color-interactive,#8f8f9d);--editor-toolbar-hover-border-color:var(--editor-toolbar-border-color);--editor-toolbar-hover-bg-color:var(--lightningcss-light,#e0e0e6)var(--lightningcss-dark,#52525e);--editor-toolbar-hover-fg-color:var(--editor-toolbar-fg-color);--editor-toolbar-hover-outline:none;--editor-toolbar-focus-outline-color:var(--focus-outline-color,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--editor-toolbar-shadow:0 2px 6px 0 #3a394433;--editor-toolbar-height:28px;--editor-toolbar-padding:2px;--alt-text-done-color:var(--color-accent-attention,var(--lightningcss-light,#2ac3a2)var(--lightningcss-dark,#54ffbd));--alt-text-warning-color:var(--lightningcss-light,#0090ed)var(--lightningcss-dark,#80ebff);--alt-text-hover-done-color:var(--alt-text-done-color);--alt-text-hover-warning-color:var(--alt-text-warning-color)}@media screen and (forced-colors:active){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{--editor-toolbar-bg-color:var(--button-background-color,ButtonFace);--editor-toolbar-fg-color:var(--button-text-color,ButtonText);--editor-toolbar-border-color:var(--button-border-color,ButtonText);--editor-toolbar-hover-border-color:var(--button-border-color-hover,AccentColor);--editor-toolbar-hover-bg-color:var(--button-background-color-hover,ButtonFace);--editor-toolbar-hover-fg-color:var(--button-text-color-hover,AccentColor);--editor-toolbar-hover-outline:2px solid var(--editor-toolbar-hover-border-color);--editor-toolbar-focus-outline-color:var(--button-border-color,ButtonBorder);--editor-toolbar-shadow:none;--alt-text-done-color:var(--editor-toolbar-fg-color);--alt-text-warning-color:var(--editor-toolbar-fg-color);--alt-text-hover-done-color:var(--editor-toolbar-hover-fg-color);--alt-text-hover-warning-color:var(--editor-toolbar-hover-fg-color)}}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar{width:fit-content;height:var(--editor-toolbar-height);cursor:default;pointer-events:auto;box-sizing:content-box;padding:var(--editor-toolbar-padding);-webkit-user-select:none;user-select:none;background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow);border-radius:6px;flex-direction:column;justify-content:center;align-items:center;display:flex;position:absolute;inset-block-start:calc(100% + var(--editor-toolbar-vert-offset));inset-inline-end:0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar.hidden{display:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar:has(:focus-visible){border-color:#0000}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){transform-origin:100% 0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){transform-origin:0 0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons{justify-content:center;align-items:center;gap:0;height:100%;display:flex}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons button{padding:0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .divider{width:0;height:calc(2 * var(--editor-toolbar-padding) + var(--editor-toolbar-height));border-left:1px solid var(--editor-toolbar-border-color);border-right:none;margin-inline:2px;display:inline-block}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic{width:var(--editor-toolbar-height)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic:before{content:"";background-color:var(--editor-toolbar-fg-color);width:100%;height:100%;display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic:hover:before{background-color:var(--editor-toolbar-hover-fg-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic.highlightButton:before{-webkit-mask-image:var(--editor-toolbar-highlight-image);-webkit-mask-image:var(--editor-toolbar-highlight-image);mask-image:var(--editor-toolbar-highlight-image)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic.commentButton:before{-webkit-mask-image:var(--comment-edit-button-icon);-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .basic.deleteButton:before{-webkit-mask-image:var(--editor-toolbar-delete-image);-webkit-mask-image:var(--editor-toolbar-delete-image);mask-image:var(--editor-toolbar-delete-image)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons>*{height:var(--editor-toolbar-height)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons>:not(.divider){cursor:pointer;background-color:#0000;border:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons>:not(.divider):hover{background-color:var(--editor-toolbar-hover-bg-color);color:var(--editor-toolbar-hover-fg-color);outline:var(--editor-toolbar-hover-outline);outline-offset:1px;border-radius:2px}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons>:not(.divider):hover:active{outline:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons>:not(.divider):focus-visible{outline:2px solid var(--editor-toolbar-focus-outline-color);border-radius:2px}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText{--alt-text-add-image:url("data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.375%207.625V11.875C5.375%2012.0408%205.44085%2012.1997%205.55806%2012.3169C5.67527%2012.4342%205.83424%2012.5%206%2012.5C6.16576%2012.5%206.32473%2012.4342%206.44194%2012.3169C6.55915%2012.1997%206.625%2012.0408%206.625%2011.875V7.625L7.125%207.125H11.375C11.5408%207.125%2011.6997%207.05915%2011.8169%206.94194C11.9342%206.82473%2012%206.66576%2012%206.5C12%206.33424%2011.9342%206.17527%2011.8169%206.05806C11.6997%205.94085%2011.5408%205.875%2011.375%205.875H7.125L6.625%205.375V1.125C6.625%200.95924%206.55915%200.800269%206.44194%200.683058C6.32473%200.565848%206.16576%200.5%206%200.5C5.83424%200.5%205.67527%200.565848%205.55806%200.683058C5.44085%200.800269%205.375%200.95924%205.375%201.125V5.375L4.875%205.875H0.625C0.45924%205.875%200.300269%205.94085%200.183058%206.05806C0.065848%206.17527%200%206.33424%200%206.5C0%206.66576%200.065848%206.82473%200.183058%206.94194C0.300269%207.05915%200.45924%207.125%200.625%207.125H4.762L5.375%207.625Z'%20fill='black'/%3e%3c/svg%3e");--alt-text-done-image:url("data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%200.5C5.21207%200.5%204.43185%200.655195%203.7039%200.956723C2.97595%201.25825%202.31451%201.70021%201.75736%202.25736C1.20021%202.81451%200.758251%203.47595%200.456723%204.2039C0.155195%204.93185%200%205.71207%200%206.5C0%207.28793%200.155195%208.06815%200.456723%208.7961C0.758251%209.52405%201.20021%2010.1855%201.75736%2010.7426C2.31451%2011.2998%202.97595%2011.7417%203.7039%2012.0433C4.43185%2012.3448%205.21207%2012.5%206%2012.5C7.5913%2012.5%209.11742%2011.8679%2010.2426%2010.7426C11.3679%209.61742%2012%208.0913%2012%206.5C12%204.9087%2011.3679%203.38258%2010.2426%202.25736C9.11742%201.13214%207.5913%200.5%206%200.5ZM5.06%208.9L2.9464%206.7856C2.85273%206.69171%202.80018%206.56446%202.80033%206.43183C2.80048%206.29921%202.85331%206.17207%202.9472%206.0784C3.04109%205.98473%203.16834%205.93218%203.30097%205.93233C3.43359%205.93248%203.56073%205.98531%203.6544%206.0792L5.3112%207.7368L8.3464%204.7008C8.44109%204.6109%208.56715%204.56153%208.69771%204.56322C8.82827%204.56492%208.95301%204.61754%209.04534%204.70986C9.13766%204.80219%209.19028%204.92693%209.19198%205.05749C9.19367%205.18805%209.1443%205.31411%209.0544%205.4088L5.5624%208.9H5.06Z'%20fill='%23FBFBFE'/%3e%3c/svg%3e");pointer-events:all;width:max-content;font:menu;color:var(--editor-toolbar-fg-color);justify-content:center;align-items:center;padding-inline:8px;font-size:12px;font-weight:590;display:flex}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText:disabled{pointer-events:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText:before{content:"";-webkit-mask-image:var(--alt-text-add-image);-webkit-mask-image:var(--alt-text-add-image);mask-image:var(--alt-text-add-image);background-color:var(--editor-toolbar-fg-color);width:12px;height:13px;margin-inline-end:4px;display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText:hover:before{background-color:var(--editor-toolbar-hover-fg-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText.done:before{-webkit-mask-image:var(--alt-text-done-image);-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText.new:before{width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);background-color:var(--alt-text-warning-color);-webkit-mask-size:cover;mask-size:cover}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText.new:hover:before{background-color:var(--alt-text-hover-warning-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText.new.done:before{-webkit-mask-image:var(--alt-text-done-image);-webkit-mask-image:var(--alt-text-done-image);mask-image:var(--alt-text-done-image);background-color:var(--alt-text-done-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText.new.done:hover:before{background-color:var(--alt-text-hover-done-color)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText .tooltip{word-wrap:anywhere;display:none}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText .tooltip.show{--alt-text-tooltip-bg:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#1c1b22);--alt-text-tooltip-fg:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--alt-text-tooltip-border:var(--border-color-interactive,#8f8f9d);--alt-text-tooltip-shadow:0 2px 6px 0 var(--lightningcss-light,#3a394433)var(--lightningcss-dark,#15141a)}@media screen and (forced-colors:active){:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText .tooltip.show{--alt-text-tooltip-bg:Canvas;--alt-text-tooltip-fg:var(--text-color,CanvasText);--alt-text-tooltip-border:var(--border-color,CanvasText);--alt-text-tooltip-shadow:none}}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .altText .tooltip.show{top:calc(100% + 2px);border:.5px solid var(--alt-text-tooltip-border);background:var(--alt-text-tooltip-bg);width:max-content;max-width:300px;height:auto;box-shadow:var(--alt-text-tooltip-shadow);color:var(--alt-text-tooltip-fg);pointer-events:none;flex-direction:column;justify-content:center;align-items:center;padding-block:2px 3px;padding-inline:3px;font-size:12px;display:inline-flex;position:absolute;inset-inline-start:0}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .comment{width:var(--editor-toolbar-height)}:is(.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.highlightEditor,.signatureEditor),.textLayer) .editToolbar .buttons .comment:before{content:"";-webkit-mask-image:var(--comment-edit-button-icon);-webkit-mask-image:var(--comment-edit-button-icon);mask-image:var(--comment-edit-button-icon);background-color:var(--editor-toolbar-fg-color);width:100%;height:100%;display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.annotationEditorLayer .freeTextEditor{padding:calc(var(--freetext-padding) * var(--total-scale-factor));touch-action:none;width:auto;height:auto}.annotationEditorLayer .freeTextEditor .internal{white-space:nowrap;font:10px sans-serif;line-height:var(--freetext-line-height);text-align:start;-webkit-user-select:none;user-select:none;background:0 0;border:none;inset:0;overflow:visible}.annotationEditorLayer .freeTextEditor .overlay{background:0 0;width:100%;height:100%;display:none;position:absolute;inset:0}.annotationEditorLayer freeTextEditor .overlay.enabled{display:block}.annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}.annotationEditorLayer .freeTextEditor .internal:focus{-webkit-user-select:auto;user-select:auto;outline:none}.annotationEditorLayer .inkEditor{width:100%;height:100%}.annotationEditorLayer .inkEditor.editing{cursor:inherit}.annotationEditorLayer .inkEditor .inkEditorCanvas{touch-action:none;width:100%;height:100%;position:absolute;inset:0}.annotationEditorLayer .stampEditor{width:auto;height:auto}.annotationEditorLayer .stampEditor canvas{width:100%;height:100%;margin:0;position:absolute;top:0;left:0}.annotationEditorLayer .stampEditor .noAltTextBadge{--no-alt-text-badge-border-color:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#52525e);--no-alt-text-badge-bg-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#fbfbfe);--no-alt-text-badge-fg-color:var(--lightningcss-light,#5b5b66)var(--lightningcss-dark,#15141a)}@media screen and (forced-colors:active){.annotationEditorLayer .stampEditor .noAltTextBadge{--no-alt-text-badge-border-color:ButtonText;--no-alt-text-badge-bg-color:ButtonFace;--no-alt-text-badge-fg-color:ButtonText}}.annotationEditorLayer .stampEditor .noAltTextBadge{pointer-events:none;z-index:1;border:1px solid var(--no-alt-text-badge-border-color);background:var(--no-alt-text-badge-bg-color);border-radius:2px;justify-content:center;align-items:center;width:32px;height:32px;padding:3px;display:inline-flex;position:absolute;inset-block-end:5px;inset-inline-end:5px}.annotationEditorLayer .stampEditor .noAltTextBadge:before{content:"";width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-warning-image);-webkit-mask-image:var(--new-alt-text-warning-image);mask-image:var(--new-alt-text-warning-image);background-color:var(--no-alt-text-badge-fg-color);display:inline-block;-webkit-mask-size:cover;mask-size:cover}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers{z-index:1;position:absolute;inset:0}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers.hidden{display:none}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer{width:var(--resizer-size);height:var(--resizer-size);background:content-box var(--resizer-bg-color);border:var(--focus-outline-around);border-radius:2px;position:absolute}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.topLeft{top:var(--resizer-shift);left:var(--resizer-shift)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.topMiddle{top:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.topRight{top:var(--resizer-shift);right:var(--resizer-shift)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.middleRight{top:calc(50% + var(--resizer-shift));right:var(--resizer-shift)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.bottomRight{bottom:var(--resizer-shift);right:var(--resizer-shift)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.bottomMiddle{bottom:var(--resizer-shift);left:calc(50% + var(--resizer-shift))}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.bottomLeft{bottom:var(--resizer-shift);left:var(--resizer-shift)}.annotationEditorLayer :is(.freeTextEditor,.inkEditor,.stampEditor,.signatureEditor)>.resizers>.resizer.middleLeft{top:calc(50% + var(--resizer-shift));left:var(--resizer-shift)}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.topLeft,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.bottomRight{cursor:nwse-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.topMiddle,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.bottomMiddle{cursor:ns-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.topRight,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.bottomLeft{cursor:nesw-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.middleRight,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]))>.resizers>.resizer.middleLeft{cursor:ew-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.topLeft,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.bottomRight{cursor:nesw-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.topMiddle,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.bottomMiddle{cursor:ew-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.topRight,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.bottomLeft{cursor:nwse-resize}:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.middleRight,:is(.annotationEditorLayer[data-main-rotation="0"] :is([data-editor-rotation="90"],[data-editor-rotation="270"]),.annotationEditorLayer[data-main-rotation="90"] :is([data-editor-rotation="0"],[data-editor-rotation="180"]),.annotationEditorLayer[data-main-rotation="180"] :is([data-editor-rotation="270"],[data-editor-rotation="90"]),.annotationEditorLayer[data-main-rotation="270"] :is([data-editor-rotation="180"],[data-editor-rotation="0"]))>.resizers>.resizer.middleLeft{cursor:ns-resize}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"]) .editToolbar{rotate:270deg}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"]) .editToolbar:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){inset-block-start:0;inset-inline-end:calc(0px - var(--editor-toolbar-vert-offset))}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="90"],[data-main-rotation="90"] [data-editor-rotation="0"],[data-main-rotation="180"] [data-editor-rotation="270"],[data-main-rotation="270"] [data-editor-rotation="180"]) .editToolbar:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){inset-block-start:0;inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset))}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="180"],[data-main-rotation="90"] [data-editor-rotation="90"],[data-main-rotation="180"] [data-editor-rotation="0"],[data-main-rotation="270"] [data-editor-rotation="270"]) .editToolbar{inset-block-start:calc(0px - var(--editor-toolbar-vert-offset));inset-inline-end:100%;rotate:180deg}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"]) .editToolbar{rotate:90deg}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"]) .editToolbar:not(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){inset-block-start:100%;inset-inline-end:calc(100% + var(--editor-toolbar-vert-offset))}.annotationEditorLayer :is([data-main-rotation="0"] [data-editor-rotation="270"],[data-main-rotation="90"] [data-editor-rotation="180"],[data-main-rotation="180"] [data-editor-rotation="90"],[data-main-rotation="270"] [data-editor-rotation="0"]) .editToolbar:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){inset-block-start:0;inset-inline-start:calc(0px - var(--editor-toolbar-vert-offset))}.dialog.altText::backdrop{-webkit-mask:url(#alttext-manager-mask);mask:url(#alttext-manager-mask)}.dialog.altText.positioned{margin:0}.dialog.altText #altTextContainer{flex-direction:column;align-items:flex-start;gap:16px;width:300px;height:fit-content;display:inline-flex}.dialog.altText #altTextContainer #overallDescription{flex-direction:column;align-self:stretch;align-items:flex-start;gap:4px;display:flex}.dialog.altText #altTextContainer #overallDescription span{align-self:stretch}.dialog.altText #altTextContainer #overallDescription .title{font-size:13px;font-style:normal;font-weight:590}.dialog.altText #altTextContainer #addDescription{flex-direction:column;align-items:stretch;gap:8px;display:flex}.dialog.altText #altTextContainer #addDescription .descriptionArea{flex:1;padding-inline:24px 10px}.dialog.altText #altTextContainer #addDescription .descriptionArea textarea{width:100%;min-height:75px}.dialog.altText #altTextContainer #buttons{justify-content:flex-end;align-self:stretch;align-items:flex-start;gap:8px;display:flex}.dialog.newAltText{--new-alt-text-ai-disclaimer-icon:url("data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.49073%201.3015L3.30873%202.1505C3.29349%202.22246%203.25769%202.28844%203.20568%202.34045C3.15368%202.39246%203.08769%202.42826%203.01573%202.4435L2.16673%202.6255C1.76473%202.7125%201.76473%203.2865%202.16673%203.3725L3.01573%203.5555C3.08769%203.57074%203.15368%203.60654%203.20568%203.65855C3.25769%203.71056%203.29349%203.77654%203.30873%203.8485L3.49073%204.6975C3.57773%205.0995%204.15173%205.0995%204.23773%204.6975L4.42073%203.8485C4.43598%203.77654%204.47177%203.71056%204.52378%203.65855C4.57579%203.60654%204.64178%203.57074%204.71373%203.5555L5.56173%203.3725C5.96373%203.2855%205.96373%202.7115%205.56173%202.6255L4.71273%202.4435C4.64083%202.42814%204.57491%202.3923%204.52292%202.34031C4.47093%202.28832%204.43509%202.2224%204.41973%202.1505L4.23773%201.3015C4.15073%200.8995%203.57673%200.8995%203.49073%201.3015ZM10.8647%2013.9995C10.4853%2014.0056%2010.1158%2013.8782%209.82067%2013.6397C9.52553%2013.4013%209.32347%2013.0667%209.24973%2012.6945L8.89273%2011.0275C8.83676%2010.7687%208.70738%2010.5316%208.52009%2010.3445C8.3328%2010.1574%208.09554%2010.0282%207.83673%209.9725L6.16973%209.6155C5.38873%209.4465%204.86473%208.7975%204.86473%207.9995C4.86473%207.2015%205.38873%206.5525%206.16973%206.3845L7.83673%206.0275C8.09551%205.97135%208.33267%205.84193%208.51992%205.65468C8.70716%205.46744%208.83658%205.23028%208.89273%204.9715L9.25073%203.3045C9.41773%202.5235%2010.0667%201.9995%2010.8647%201.9995C11.6627%201.9995%2012.3117%202.5235%2012.4797%203.3045L12.8367%204.9715C12.9507%205.4995%2013.3647%205.9135%2013.8927%206.0265L15.5597%206.3835C16.3407%206.5525%2016.8647%207.2015%2016.8647%207.9995C16.8647%208.7975%2016.3407%209.4465%2015.5597%209.6145L13.8927%209.9715C13.6337%2010.0275%2013.3963%2010.157%2013.209%2010.3445C13.0217%2010.5319%2012.8925%2010.7694%2012.8367%2011.0285L12.4787%2012.6945C12.4054%2013.0667%2012.2036%2013.4014%2011.9086%2013.6399C11.6135%2013.8784%2011.2441%2014.0057%2010.8647%2013.9995ZM10.8647%203.2495C10.7667%203.2495%2010.5337%203.2795%2010.4727%203.5655L10.1147%205.2335C10.0081%205.72777%209.76116%206.18082%209.40361%206.53837C9.04606%206.89593%208.59301%207.14283%208.09873%207.2495L6.43173%207.6065C6.14573%207.6685%206.11473%207.9015%206.11473%207.9995C6.11473%208.0975%206.14573%208.3305%206.43173%208.3925L8.09873%208.7495C8.59301%208.85617%209.04606%209.10307%209.40361%209.46062C9.76116%209.81817%2010.0081%2010.2712%2010.1147%2010.7655L10.4727%2012.4335C10.5337%2012.7195%2010.7667%2012.7495%2010.8647%2012.7495C10.9627%2012.7495%2011.1957%2012.7195%2011.2567%2012.4335L11.6147%2010.7665C11.7212%2010.272%2011.9681%209.81878%2012.3256%209.46103C12.6832%209.10329%2013.1363%208.85624%2013.6307%208.7495L15.2977%208.3925C15.5837%208.3305%2015.6147%208.0975%2015.6147%207.9995C15.6147%207.9015%2015.5837%207.6685%2015.2977%207.6065L13.6307%207.2495C13.1365%207.14283%2012.6834%206.89593%2012.3259%206.53837C11.9683%206.18082%2011.7214%205.72777%2011.6147%205.2335L11.2567%203.5655C11.1957%203.2795%2010.9627%203.2495%2010.8647%203.2495ZM3.30873%2012.1505L3.49073%2011.3015C3.57673%2010.8995%204.15073%2010.8995%204.23773%2011.3015L4.41973%2012.1505C4.43509%2012.2224%204.47093%2012.2883%204.52292%2012.3403C4.57491%2012.3923%204.64083%2012.4281%204.71273%2012.4435L5.56173%2012.6255C5.96373%2012.7115%205.96373%2013.2855%205.56173%2013.3725L4.71273%2013.5545C4.64083%2013.5699%204.57491%2013.6057%204.52292%2013.6577C4.47093%2013.7097%204.43509%2013.7756%204.41973%2013.8475L4.23773%2014.6965C4.15173%2015.0985%203.57773%2015.0985%203.49073%2014.6965L3.30873%2013.8475C3.29337%2013.7756%203.25754%2013.7097%203.20555%2013.6577C3.15356%2013.6057%203.08764%2013.5699%203.01573%2013.5545L2.16673%2013.3725C1.76473%2013.2865%201.76473%2012.7125%202.16673%2012.6255L3.01573%2012.4435C3.08769%2012.4283%203.15368%2012.3925%203.20568%2012.3405C3.25769%2012.2884%203.29349%2012.2225%203.30873%2012.1505Z'%20fill='black'/%3e%3c/svg%3e");--new-alt-text-spinner-icon:url("data:image/svg+xml,%3c!--%20This%20Source%20Code%20Form%20is%20subject%20to%20the%20terms%20of%20the%20Mozilla%20Public%20-%20License,%20v.%202.0.%20If%20a%20copy%20of%20the%20MPL%20was%20not%20distributed%20with%20this%20-%20file,%20You%20can%20obtain%20one%20at%20http://mozilla.org/MPL/2.0/.%20--%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cstyle%3e%20@media%20not%20(prefers-reduced-motion)%20{%20@keyframes%20loadingRotate%20{%20from%20{%20rotate:%200;%20}%20to%20{%20rotate:%20360deg%20}%20}%20%23circle-arrows%20{%20animation:%20loadingRotate%201.8s%20linear%20infinite;%20transform-origin:%2050%25%2050%25;%20}%20%23hourglass%20{%20display:%20none;%20}%20}%20@media%20(prefers-reduced-motion)%20{%20%23circle-arrows%20{%20display:%20none;%20}%20}%20%3c/style%3e%3cpath%20id='circle-arrows'%20d='M9%205.528c0%20.42.508.63.804.333l2.528-2.528a.47.47%200%200%200%200-.666L9.805.14A.471.471%200%200%200%209%20.472v1.866A5.756%205.756%200%200%200%202.25%208c0%20.942.232%201.83.635%202.615l1.143-1.143A4.208%204.208%200%200%201%203.75%208%204.254%204.254%200%200%201%208%203.75c.345%200%20.68.042%201%20.122v1.656zM7%2010.472v1.656c.32.08.655.122%201%20.122A4.254%204.254%200%200%200%2012.25%208c0-.52-.107-1.013-.279-1.474l1.143-1.143c.404.786.636%201.674.636%202.617A5.756%205.756%200%200%201%207%2013.662v1.866a.47.47%200%200%201-.804.333l-2.528-2.528a.47.47%200%200%201%200-.666l2.528-2.528a.47.47%200%200%201%20.804.333z'/%3e%3cg%20id='hourglass'%3e%3cpath%20d='M13,1%20C13.5522847,1%2014,1.44771525%2014,2%20C14,2.55228475%2013.5522847,3%2013,3%20L12.9854217,2.99990801%20C12.9950817,3.16495885%2013,3.33173274%2013,3.5%20C13,5.24679885%2010.9877318,6.01090495%2010.9877318,8.0017538%20C10.9877318,9.99260264%2013,10.7536922%2013,12.5%20C13,12.6686079%2012.9950617,12.8357163%2012.985363,13.0010943%20L13,13%20C13.5522847,13%2014,13.4477153%2014,14%20C14,14.5522847%2013.5522847,15%2013,15%20L3,15%20C2.44771525,15%202,14.5522847%202,14%20C2,13.4477153%202.44771525,13%203,13%20L3.01463704,13.0010943%20C3.00493827,12.8357163%203,12.6686079%203,12.5%20C3,10.7536922%204.9877318,9.99260264%205,8.0017538%20C5.0122682,6.01090495%203,5.24679885%203,3.5%20C3,3.33173274%203.00491834,3.16495885%203.01457832,2.99990801%20L3,3%20C2.44771525,3%202,2.55228475%202,2%20C2,1.44771525%202.44771525,1%203,1%20L13,1%20Z%20M10.987,3%20L5.012,3%20L5.00308914,3.24815712%20C5.00103707,3.33163368%205,3.4155948%205,3.5%20C5,5.36125069%206.99153646,6.01774089%206.99153646,8.0017538%20C6.99153646,9.98576671%205,10.6393737%205,12.5%20L5.00307746,12.7513676%20L5.01222201,12.9998392%20L5.60191711,12.9988344%20L6.0425138,12.2959826%20C7.02362731,10.7653275%207.67612271,10%208,10%20C8.37014547,10%209.16950644,10.9996115%2010.3980829,12.9988344%20L10.987778,12.9998392%20C10.9958674,12.8352104%2011,12.66849%2011,12.5%20C11,10.6393737%208.98689779,10.0147381%208.98689779,8.0017538%20C8.98689779,5.98876953%2011,5.36125069%2011,3.5%20L10.9969109,3.24815712%20L10.987,3%20Z'/%3e%3cpath%20d='M6,4%20L10,4%20C8.95166016,6%208.28499349,7%208,7%20C7.71500651,7%207.04833984,6%206,4%20Z'/%3e%3c/g%3e%3c/svg%3e");--preview-image-bg-color:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#2b2a33);--preview-image-border:none}@media screen and (forced-colors:active){.dialog.newAltText{--preview-image-bg-color:ButtonFace;--preview-image-border:1px solid ButtonText}}.dialog.newAltText{width:80%;min-width:300px;max-width:570px;padding:0}.dialog.newAltText.noAi #newAltTextDisclaimer,.dialog.newAltText.noAi #newAltTextCreateAutomatically{display:none!important}.dialog.newAltText.aiInstalling #newAltTextCreateAutomatically{display:none!important}.dialog.newAltText.aiInstalling #newAltTextDownloadModel{display:flex!important}.dialog.newAltText.error #newAltTextNotNow{display:none!important}.dialog.newAltText.error #newAltTextCancel{display:inline-block!important}.dialog.newAltText:not(.error) #newAltTextError{display:none!important}.dialog.newAltText #newAltTextContainer{flex-direction:column;flex:0 auto;justify-content:flex-end;align-items:flex-start;gap:12px;width:auto;padding:16px;line-height:normal;display:flex}.dialog.newAltText #newAltTextContainer #mainContent{flex:auto;justify-content:flex-end;align-self:stretch;align-items:flex-start;gap:12px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #descriptionAndSettings{flex-direction:column;flex:1 0 0;align-self:stretch;align-items:flex-start;gap:16px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction{flex-direction:column;flex:auto;align-self:stretch;align-items:flex-start;gap:8px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer{width:100%;height:70px;position:relative}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer textarea{width:100%;height:100%;padding:8px}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer textarea::placeholder{color:var(--text-secondary-color)}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer .altTextSpinner{background-color:var(--text-secondary-color);pointer-events:none;width:16px;height:16px;display:none;position:absolute;inset-block-start:8px;inset-inline-start:8px;-webkit-mask-size:cover;mask-size:cover}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer.loading textarea::placeholder{color:#0000}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescriptionContainer.loading .altTextSpinner{-webkit-mask-image:var(--new-alt-text-spinner-icon);-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon);display:inline-block}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDescription{font-size:11px}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDisclaimer{flex-direction:row;align-items:flex-start;gap:4px;font-size:11px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #descriptionInstruction #newAltTextDisclaimer:before{content:"";width:17px;height:16px;-webkit-mask-image:var(--new-alt-text-ai-disclaimer-icon);-webkit-mask-image:var(--new-alt-text-ai-disclaimer-icon);mask-image:var(--new-alt-text-ai-disclaimer-icon);background-color:var(--text-secondary-color);flex:1 0 auto;display:inline-block;-webkit-mask-size:cover;mask-size:cover}.dialog.newAltText #newAltTextContainer #mainContent #newAltTextDownloadModel{align-self:stretch;align-items:center;gap:4px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #newAltTextDownloadModel:before{content:"";width:16px;height:16px;-webkit-mask-image:var(--new-alt-text-spinner-icon);-webkit-mask-image:var(--new-alt-text-spinner-icon);mask-image:var(--new-alt-text-spinner-icon);background-color:var(--text-secondary-color);display:inline-block;-webkit-mask-size:cover;mask-size:cover}.dialog.newAltText #newAltTextContainer #mainContent #newAltTextImagePreview{aspect-ratio:1;background-color:var(--preview-image-bg-color);border:var(--preview-image-border);flex:none;justify-content:center;align-items:center;width:180px;display:flex}.dialog.newAltText #newAltTextContainer #mainContent #newAltTextImagePreview>canvas{max-width:100%;max-height:100%}.colorPicker{--hover-outline-color:var(--color-accent-primary-hover,var(--lightningcss-light,#0250bb)var(--lightningcss-dark,#80ebff));--selected-outline-color:var(--lightningcss-light,#0060df)var(--lightningcss-dark,#aaf2ff);--swatch-border-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#52525e)}@media screen and (forced-colors:active){.colorPicker{--hover-outline-color:Highlight;--selected-outline-color:var(--hover-outline-color);--swatch-border-color:ButtonText}}.colorPicker .swatch{border:1px solid var(--swatch-border-color);outline-offset:2px;box-sizing:border-box;forced-color-adjust:none;border-radius:100%;width:16px;height:16px}.colorPicker button:is(:hover,.selected)>.swatch{border:none}.basicColorPicker{width:28px}.basicColorPicker::-moz-color-swatch{border-radius:100%;margin:0}.basicColorPicker::-webkit-color-swatch{border-radius:100%;margin:0}.annotationEditorLayer[data-main-rotation="0"] .highlightEditor:not(.free)>.editToolbar{rotate:0deg}.annotationEditorLayer[data-main-rotation="90"] .highlightEditor:not(.free)>.editToolbar{rotate:270deg}.annotationEditorLayer[data-main-rotation="180"] .highlightEditor:not(.free)>.editToolbar{rotate:180deg}.annotationEditorLayer[data-main-rotation="270"] .highlightEditor:not(.free)>.editToolbar{rotate:90deg}.annotationEditorLayer .highlightEditor{z-index:1;cursor:auto;pointer-events:none;transform-origin:0 0;background:0 0;border:none;outline:none;max-width:100%;max-height:100%;position:absolute}.annotationEditorLayer .highlightEditor:not(.free){transform:none}.annotationEditorLayer .highlightEditor .internal{pointer-events:auto;width:100%;height:100%;position:absolute;top:0;left:0}.annotationEditorLayer .highlightEditor.disabled .internal{pointer-events:none}.annotationEditorLayer .highlightEditor.selectedEditor .internal{cursor:pointer}.annotationEditorLayer .highlightEditor .editToolbar{--editor-toolbar-colorpicker-arrow-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.23336%2010.4664L11.8474%206.85339C11.894%206.8071%2011.931%206.75203%2011.9563%206.69136C11.9816%206.63069%2011.9946%206.56562%2011.9946%206.49989C11.9946%206.43417%2011.9816%206.3691%2011.9563%206.30843C11.931%206.24776%2011.894%206.19269%2011.8474%206.14639C11.7536%206.05266%2011.6264%206%2011.4939%206C11.3613%206%2011.2341%206.05266%2011.1404%206.14639L7.99236%209.29339L4.84736%206.14739C4.75305%206.05631%204.62675%206.00592%204.49566%206.00706C4.36456%206.0082%204.23915%206.06078%204.14645%206.15348C4.05374%206.24619%204.00116%206.37159%204.00002%206.50269C3.99888%206.63379%204.04928%206.76009%204.14036%206.85439L7.75236%2010.4674L8.23336%2010.4664Z'%20fill='black'/%3e%3c/svg%3e");transform-origin:50%!important}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker{justify-content:center;align-items:center;gap:4px;width:auto;padding:4px;display:flex;position:relative}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker:after{content:"";-webkit-mask-image:var(--editor-toolbar-colorpicker-arrow-image);-webkit-mask-image:var(--editor-toolbar-colorpicker-arrow-image);mask-image:var(--editor-toolbar-colorpicker-arrow-image);background-color:var(--editor-toolbar-fg-color);width:12px;height:12px;display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker:hover:after{background-color:var(--editor-toolbar-hover-fg-color)}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker:has(.dropdown:not(.hidden)){background-color:var(--editor-toolbar-hover-bg-color)}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker:has(.dropdown:not(.hidden)):after{scale:-1}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown{background-color:var(--editor-toolbar-bg-color);border:1px solid var(--editor-toolbar-border-color);box-shadow:var(--editor-toolbar-shadow);width:calc(100% + 2 * var(--editor-toolbar-padding));border-radius:6px;flex-direction:column;justify-content:center;align-items:center;gap:11px;padding-block:8px;display:flex;position:absolute;inset-block-start:calc(100% + 4px)}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown button{cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:100%;height:auto;display:flex}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown button:is(:active,:focus-visible){outline:none}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown button>.swatch{outline-offset:2px}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown button[aria-selected=true]>.swatch{outline:2px solid var(--selected-outline-color)}.annotationEditorLayer .highlightEditor .editToolbar .buttons .colorPicker .dropdown button:is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}.editorParamsToolbar:has(#highlightParamsToolbarContainer){padding:unset}#highlightParamsToolbarContainer{gap:16px;padding-block-end:12px;padding-inline:10px}#highlightParamsToolbarContainer .colorPicker{flex-direction:column;gap:8px;display:flex}#highlightParamsToolbarContainer .colorPicker .dropdown{flex-direction:row;justify-content:space-between;align-items:center;height:auto;display:flex}#highlightParamsToolbarContainer .colorPicker .dropdown button{cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;width:auto;height:auto;padding:0;display:flex}#highlightParamsToolbarContainer .colorPicker .dropdown button .swatch{width:24px;height:24px}#highlightParamsToolbarContainer .colorPicker .dropdown button:is(:active,:focus-visible){outline:none}#highlightParamsToolbarContainer .colorPicker .dropdown button[aria-selected=true]>.swatch{outline:2px solid var(--selected-outline-color)}#highlightParamsToolbarContainer .colorPicker .dropdown button:is(:hover,:active,:focus-visible)>.swatch{outline:2px solid var(--hover-outline-color)}#highlightParamsToolbarContainer #editorHighlightThickness{flex-direction:column;align-self:stretch;align-items:center;gap:4px;display:flex}#highlightParamsToolbarContainer #editorHighlightThickness .editorParamsLabel{align-self:stretch;height:auto}#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker{--example-color:var(--lightningcss-light,#bfbfc9)var(--lightningcss-dark,#80808e);justify-content:space-between;align-self:stretch;align-items:center;display:flex}@media screen and (forced-colors:active){#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker{--example-color:CanvasText}}:is(#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker>.editorParamsSlider[disabled]){opacity:.4}#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker:before,#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker:after{content:"";aspect-ratio:1;background-color:var(--example-color);border-radius:100%;width:8px;display:block}#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker:after{width:24px}#highlightParamsToolbarContainer #editorHighlightThickness .thicknessPicker .editorParamsSlider{width:unset;height:14px}#highlightParamsToolbarContainer #editorHighlightVisibility{flex-direction:column;align-self:stretch;align-items:flex-start;gap:8px;display:flex}#highlightParamsToolbarContainer #editorHighlightVisibility .divider{--divider-color:var(--lightningcss-light,#d7d7db)var(--lightningcss-dark,#8f8f9d)}@media screen and (forced-colors:active){#highlightParamsToolbarContainer #editorHighlightVisibility .divider{--divider-color:CanvasText}}#highlightParamsToolbarContainer #editorHighlightVisibility .divider{background-color:var(--divider-color);width:100%;height:1px;margin-block:4px}#highlightParamsToolbarContainer #editorHighlightVisibility .toggler{justify-content:space-between;align-self:stretch;align-items:center;display:flex}#altTextSettingsDialog{padding:16px}#altTextSettingsDialog #altTextSettingsContainer{flex-direction:column;gap:16px;width:573px;display:flex}#altTextSettingsDialog #altTextSettingsContainer .mainContainer{gap:16px}#altTextSettingsDialog #altTextSettingsContainer .description{color:var(--text-secondary-color)}#altTextSettingsDialog #altTextSettingsContainer #aiModelSettings{flex-direction:column;gap:12px;display:flex}#altTextSettingsDialog #altTextSettingsContainer #automaticAltText,#altTextSettingsDialog #altTextSettingsContainer #altTextEditor{flex-direction:column;gap:8px;display:flex}#altTextSettingsDialog #altTextSettingsContainer #createModelDescription,#altTextSettingsDialog #altTextSettingsContainer #aiModelSettings,#altTextSettingsDialog #altTextSettingsContainer #showAltTextDialogDescription{padding-inline-start:40px}#altTextSettingsDialog #altTextSettingsContainer #automaticSettings{flex-direction:column;gap:16px;display:flex}button.hasPopupMenu[aria-expanded=true]+menu{visibility:visible}button.hasPopupMenu[aria-expanded=false]+menu{visibility:hidden}.popupMenu{--menuitem-checkmark-icon:url("data:image/svg+xml,%3csvg%20width='11'%20height='11'%20viewBox='0%200%2011%2011'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.79253%200.14683C10.2086%200.418844%2010.3253%200.976607%2010.0533%201.39263L4.56097%209.79263C4.4081%2010.0264%204.15533%2010.176%203.87682%2010.1974C3.5983%2010.2189%203.32561%2010.1098%203.13874%209.90217L0.231043%206.6714C-0.10147%206.30194%20-0.0715196%205.73288%200.29794%205.40037C0.667399%205.06786%201.23646%205.09781%201.56897%205.46727L3.69438%207.82883L8.54674%200.407579C8.81875%20-0.00844234%209.37651%20-0.125183%209.79253%200.14683Z'%20fill='black'/%3e%3c/g%3e%3c/svg%3e");--menu-mark-icon-size:0;--menu-icon-size:16px;--menuitem-gap:5px;--menuitem-border-color:transparent;--menuitem-active-bg:color-mix(in srgb, var(--menu-text-color), transparent 79%);--menuitem-text-active-fg:var(--menu-text-color);--menuitem-active-border-color:var(--menuitem-border-color);--menuitem-focus-bg:color-mix(in srgb, var(--menu-text-color), transparent 93%);--menuitem-focus-outline-color:var(--focus-outline-color,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--menuitem-focus-border-color:var(--lightningcss-light,#fff)var(--lightningcss-dark,#000);--menu-bg:var(--background-color-box,var(--lightningcss-light,#fff)var(--lightningcss-dark,#23222b));--menu-background-blend-mode:normal;--menu-box-shadow:0 .375px 1.5px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 3px 12px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--menu-border-color:var(--lightningcss-light,#15141a1a)var(--lightningcss-dark,#fbfbfe1a);--menuitem-border-radius:8px;--menu-backdrop-filter:none;--menu-text-color:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--menu-text-disabled-color:var(--menu-text-color);--menuitem-text-hover-fg:var(--menu-text-color);--menuitem-hover-bg:color-mix(in srgb, var(--menu-text-color), transparent 86%);--menuitem-hover-background-blend-mode:normal;--disabled-opacity:.62}@media screen and (forced-colors:active){.popupMenu{--menu-bg:var(--background-color-box,Canvas);--menu-background-blend-mode:normal;--menu-box-shadow:none;--menu-backdrop-filter:none;--menu-text-color:var(--text-color,ButtonText);--menu-text-disabled-color:GrayText;--menu-border-color:CanvasText;--menuitem-border-color:none;--menuitem-hover-bg:SelectedItemText;--menuitem-text-hover-fg:SelectedItem;--menuitem-active-bg:SelectedItemText;--menuitem-active-border-color:ButtonText;--menuitem-text-active-fg:SelectedItem;--menuitem-focus-bg:ButtonFace;--menuitem-focus-outline-color:var(--focus-outline-color,CanvasText);--menuitem-focus-border-color:none;--disabled-opacity:1}}.popupMenu{box-sizing:border-box;background:var(--menu-bg);background-blend-mode:var(--menu-background-blend-mode);width:max-content;height:auto;box-shadow:var(--menu-box-shadow);border:1px solid var(--menu-border-color);-webkit-backdrop-filter:var(--menu-backdrop-filter);backdrop-filter:var(--menu-backdrop-filter);border-radius:6px;flex-direction:column;margin:0;padding:5px;display:flex;position:relative;top:1px;left:0}.popupMenu.withMark{--menu-mark-icon-size:16px}.popupMenu>button{width:100%;height:26px;padding-inline:calc(var(--menu-mark-icon-size) + var(--menuitem-gap)) var(--menuitem-gap);align-items:center;gap:var(--menuitem-gap);box-sizing:border-box;border-radius:var(--menuitem-border-radius);border:1px solid var(--menuitem-border-color);background:0 0;display:flex;position:relative}.popupMenu>button.selected:after{content:"";width:11px;height:11px;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--menuitem-checkmark-icon);-webkit-mask-image:var(--menuitem-checkmark-icon);mask-image:var(--menuitem-checkmark-icon);background-color:var(--menu-text-color);inset-inline-start:var(--menuitem-gap);transform:translateY(-50%) scaleX(var(--dir-factor));display:inline-block;position:absolute;top:50%}.popupMenu>button:disabled{opacity:var(--disabled-opacity)}.popupMenu>button:disabled.selected:after,.popupMenu>button:disabled:not(.noIcon):before{background-color:var(--menu-text-disabled-color)}.popupMenu>button:disabled>span{color:var(--menu-text-disabled-color)}.popupMenu>button:not(:disabled):hover{background:var(--menuitem-hover-bg);background-blend-mode:var(--menuitem-hover-background-blend-mode)}.popupMenu>button:not(:disabled):hover:not(.noIcon):before{background-color:var(--menuitem-text-hover-fg)}.popupMenu>button:not(:disabled):hover>span{color:var(--menuitem-text-hover-fg)}.popupMenu>button:not(:disabled):hover.selected:after{background-color:var(--menuitem-text-hover-fg)}.popupMenu>button:not(:disabled):active{background-color:var(--menuitem-active-bg);border-color:var(--menuitem-active-border-color)}.popupMenu>button:not(:disabled):active>span{color:var(--menuitem-text-active-fg)}.popupMenu>button:not(:disabled):focus-visible{border-color:var(--menuitem-focus-border-color);background-color:var(--menuitem-focus-bg);outline:2px solid var(--menuitem-focus-outline-color);outline-offset:2px}.popupMenu>button:not(.noIcon):before{width:var(--menu-icon-size);height:var(--menu-icon-size);content:"";background-color:var(--menu-text-color);display:inline-block;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:cover;mask-size:cover}.popupMenu>button>span{text-align:start;width:100%;min-width:max-content;color:var(--menu-text-color);-webkit-user-select:none;user-select:none;font:menu;align-self:stretch;align-items:center;padding-inline-start:6px;font-size:13px;font-style:normal;font-weight:510;line-height:normal;display:flex}.treeView{--treeitem-color:var(--lightningcss-light,#000c)var(--lightningcss-dark,#fffc);--treeitem-bg-color:var(--lightningcss-light,#00000026)var(--lightningcss-dark,#ffffff26);--treeitem-hover-color:var(--lightningcss-light,#000000e6)var(--lightningcss-dark,#ffffffe6);--treeitem-selected-color:var(--lightningcss-light,#000000e6)var(--lightningcss-dark,#ffffffe6);--treeitem-selected-bg-color:var(--lightningcss-light,#00000040)var(--lightningcss-dark,#ffffff40);--treeitem-expanded-icon:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%3e%3cpath%20d='M10%2013l4-7H6z'/%3e%3c/svg%3e");--treeitem-collapsed-icon:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%3e%3cpath%20d='M13%209L6%205v8z'/%3e%3c/svg%3e")}.treeView.withNesting .treeItemToggler:before{content:"";background-color:var(--toolbar-icon-bg-color);width:16px;height:16px;-webkit-mask-image:var(--treeitem-expanded-icon);-webkit-mask-image:var(--treeitem-expanded-icon);mask-image:var(--treeitem-expanded-icon);display:inline-block;position:absolute;inset-inline-end:4px;-webkit-mask-size:cover;mask-size:cover}.treeView.withNesting .treeItemToggler{float:inline-start;color:#ffffff80;width:0;height:0;position:relative}.treeView.withNesting .treeItemToggler.treeItemsHidden:before{-webkit-mask-image:var(--treeitem-collapsed-icon);-webkit-mask-image:var(--treeitem-collapsed-icon);mask-image:var(--treeitem-collapsed-icon);transform:scaleX(var(--dir-factor))}.treeView.withNesting .treeItemToggler.treeItemsHidden~.treeItems{display:none}.treeView.withNesting .treeItemToggler:hover+a,.treeView.withNesting .treeItemToggler:hover~.treeItems{background-color:var(--treeitem-bg-color);color:var(--treeitem-hover-color);background-clip:padding-box;border-radius:2px}.treeView.withNesting>.treeItem,.treeView.withNesting .treeItem>.treeItems{margin-inline-start:20px}.treeView#layersView .treeItem>a *{cursor:pointer}.treeView#layersView .treeItem>a>label{align-items:center;padding-inline-start:4px;display:flex}.treeView#layersView .treeItem>a>label>input{margin-top:1px}.treeView .treeItem>a{min-width:calc(100% - 4px);height:auto;color:var(--treeitem-color);-webkit-user-select:none;user-select:none;white-space:normal;cursor:default;border-radius:2px;margin-bottom:1px;padding:2px 0 5px;padding-inline-start:4px;font-size:13px;line-height:15px;text-decoration:none;display:inline-block}.treeView .treeItem>a:hover{background-color:var(--treeitem-bg-color);color:var(--treeitem-hover-color);background-clip:padding-box;border-radius:2px}.treeView .treeItem.selected>a{background-color:var(--treeitem-selected-bg-color);color:var(--treeitem-selected-color)}#outerContainer.viewsManagerMoving #viewsManager{visibility:visible}#outerContainer.viewsManagerOpen #viewsManager{visibility:visible;inset-inline-start:8px}#outerContainer.viewsManagerOpen #viewerContainer:not(.pdfPresentationMode){transition-property:inset-inline-start;inset-inline-start:var(--viewsManager-width,0)}#outerContainer.viewsManagerResizing :is(#sidebarContainer,#viewerContainer,#loadingBar){transition-duration:0s}#viewsManager{--views-manager-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%207H5C5.53043%207%206.03914%206.78929%206.41421%206.41421C6.78929%206.03914%207%205.53043%207%205V3C7%202.46957%206.78929%201.96086%206.41421%201.58579C6.03914%201.21071%205.53043%201%205%201H3C2.46957%201%201.96086%201.21071%201.58579%201.58579C1.21071%201.96086%201%202.46957%201%203V5C1%205.53043%201.21071%206.03914%201.58579%206.41421C1.96086%206.78929%202.46957%207%203%207ZM11%207H13C13.5304%207%2014.0391%206.78929%2014.4142%206.41421C14.7893%206.03914%2015%205.53043%2015%205V3C15%202.46957%2014.7893%201.96086%2014.4142%201.58579C14.0391%201.21071%2013.5304%201%2013%201H11C10.4696%201%209.96086%201.21071%209.58579%201.58579C9.21071%201.96086%209%202.46957%209%203V5C9%205.53043%209.21071%206.03914%209.58579%206.41421C9.96086%206.78929%2010.4696%207%2011%207ZM5%2015H3C2.46957%2015%201.96086%2014.7893%201.58579%2014.4142C1.21071%2014.0391%201%2013.5304%201%2013V11C1%2010.4696%201.21071%209.96086%201.58579%209.58579C1.96086%209.21071%202.46957%209%203%209H5C5.53043%209%206.03914%209.21071%206.41421%209.58579C6.78929%209.96086%207%2010.4696%207%2011V13C7%2013.5304%206.78929%2014.0391%206.41421%2014.4142C6.03914%2014.7893%205.53043%2015%205%2015ZM11%2015H13C13.5304%2015%2014.0391%2014.7893%2014.4142%2014.4142C14.7893%2014.0391%2015%2013.5304%2015%2013V11C15%2010.4696%2014.7893%209.96086%2014.4142%209.58579C14.0391%209.21071%2013.5304%209%2013%209H11C10.4696%209%209.96086%209.21071%209.58579%209.58579C9.21071%209.96086%209%2010.4696%209%2011V13C9%2013.5304%209.21071%2014.0391%209.58579%2014.4142C9.96086%2014.7893%2010.4696%2015%2011%2015Z'%20fill='black'/%3e%3c/svg%3e");--views-manager-button-arrow-icon:url("data:image/svg+xml,%3csvg%20width='8'%20height='10'%20viewBox='0%200%208%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.23336%207.46639L7.84736%203.85339C7.89401%203.8071%207.93104%203.75203%207.9563%203.69136C7.98157%203.63069%207.99458%203.56562%207.99458%203.49989C7.99458%203.43417%207.98157%203.3691%207.9563%203.30843C7.93104%203.24776%207.89401%203.19269%207.84736%203.14639C7.75359%203.05266%207.62644%203%207.49386%203C7.36127%203%207.23412%203.05266%207.14036%203.14639L3.99236%206.29339L0.847356%203.14739C0.753055%203.05631%200.626754%203.00592%200.495655%203.00706C0.364557%203.0082%200.239151%203.06078%200.146447%203.15348C0.0537425%203.24619%200.00115811%203.37159%201.89013e-05%203.50269C-0.00112031%203.63379%200.0492769%203.76009%200.140356%203.85439L3.75236%207.46739L4.23336%207.46639Z'%20fill='black'/%3e%3c/svg%3e");--views-manager-add-file-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.00488%209.75V14C7.00488%2014.1658%207.07073%2014.3247%207.18794%2014.4419C7.30515%2014.5592%207.46412%2014.625%207.62988%2014.625C7.79564%2014.625%207.95461%2014.5592%208.07183%2014.4419C8.18904%2014.3247%208.25488%2014.1658%208.25488%2014V9.75L8.75488%209.25H13.0049C13.1706%209.25%2013.3296%209.18415%2013.4468%209.06694C13.564%208.94973%2013.6299%208.79076%2013.6299%208.625C13.6299%208.45924%2013.564%208.30027%2013.4468%208.18306C13.3296%208.06585%2013.1706%208%2013.0049%208H8.75488L8.25488%207.5V3.25C8.25488%203.08424%208.18904%202.92527%208.07183%202.80806C7.95461%202.69085%207.79564%202.625%207.62988%202.625C7.46412%202.625%207.30515%202.69085%207.18794%202.80806C7.07073%202.92527%207.00488%203.08424%207.00488%203.25V7.5L6.50488%208H2.25488C2.08912%208%201.93015%208.06585%201.81294%208.18306C1.69573%208.30027%201.62988%208.45924%201.62988%208.625C1.62988%208.79076%201.69573%208.94973%201.81294%209.06694C1.93015%209.18415%202.08912%209.25%202.25488%209.25H6.39188L7.00488%209.75Z'%20fill='black'/%3e%3c/svg%3e");--current-outline-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.803%204.74998V6.02436C10.803%206.39302%2010.3571%206.57793%2010.0967%206.31753L7.87716%204.098C7.71566%203.93649%207.71566%203.67434%207.87716%203.51283L10.0967%201.29329C10.3571%201.0329%2010.8036%201.21722%2010.8036%201.58588V3.24998H15V4.74998H10.803ZM8%201.24998H3V2.74998H6.5L8%201.24998ZM6.5%205.24998H3V6.74998H8L6.5%205.24998ZM3%2013.25H15V14.75H3V13.25ZM6%209.24998H15V10.75H6V9.24998ZM1.5%205.24998H0V6.74998H1.5V5.24998ZM0%2013.25H1.5V14.75H0V13.25ZM1.5%201.24998H0V2.74998H1.5V1.24998ZM3%209.24998H4.5V10.75H3V9.24998Z'%20fill='black'/%3e%3c/svg%3e");--menuitem-thumbnailsView-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%207H5C5.53043%207%206.03914%206.78929%206.41421%206.41421C6.78929%206.03914%207%205.53043%207%205V3C7%202.46957%206.78929%201.96086%206.41421%201.58579C6.03914%201.21071%205.53043%201%205%201H3C2.46957%201%201.96086%201.21071%201.58579%201.58579C1.21071%201.96086%201%202.46957%201%203V5C1%205.53043%201.21071%206.03914%201.58579%206.41421C1.96086%206.78929%202.46957%207%203%207ZM11%207H13C13.5304%207%2014.0391%206.78929%2014.4142%206.41421C14.7893%206.03914%2015%205.53043%2015%205V3C15%202.46957%2014.7893%201.96086%2014.4142%201.58579C14.0391%201.21071%2013.5304%201%2013%201H11C10.4696%201%209.96086%201.21071%209.58579%201.58579C9.21071%201.96086%209%202.46957%209%203V5C9%205.53043%209.21071%206.03914%209.58579%206.41421C9.96086%206.78929%2010.4696%207%2011%207ZM5%2015H3C2.46957%2015%201.96086%2014.7893%201.58579%2014.4142C1.21071%2014.0391%201%2013.5304%201%2013V11C1%2010.4696%201.21071%209.96086%201.58579%209.58579C1.96086%209.21071%202.46957%209%203%209H5C5.53043%209%206.03914%209.21071%206.41421%209.58579C6.78929%209.96086%207%2010.4696%207%2011V13C7%2013.5304%206.78929%2014.0391%206.41421%2014.4142C6.03914%2014.7893%205.53043%2015%205%2015ZM11%2015H13C13.5304%2015%2014.0391%2014.7893%2014.4142%2014.4142C14.7893%2014.0391%2015%2013.5304%2015%2013V11C15%2010.4696%2014.7893%209.96086%2014.4142%209.58579C14.0391%209.21071%2013.5304%209%2013%209H11C10.4696%209%209.96086%209.21071%209.58579%209.58579C9.21071%209.96086%209%2010.4696%209%2011V13C9%2013.5304%209.21071%2014.0391%209.58579%2014.4142C9.96086%2014.7893%2010.4696%2015%2011%2015Z'%20fill='black'/%3e%3c/svg%3e");--menuitem-outlinesView-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%201.25H15V2.75H3V1.25ZM15%205.25H3V6.75H15V5.25ZM15%2013.25H3V14.75H15V13.25ZM15%209.25H6V10.75H15V9.25ZM0%205.25H1.5V6.75H0V5.25ZM1.5%2013.25H0V14.75H1.5V13.25ZM0%201.25H1.5V2.75H0V1.25ZM4.5%209.25H3V10.75H4.5V9.25Z'%20fill='black'/%3e%3c/svg%3e");--menuitem-attachmentsView-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.5%203.75C3.5%201.67879%205.17879%200%207.25%200C9.32121%200%2011%201.67879%2011%203.75V10.25C11%2011.4922%209.99221%2012.5%208.75%2012.5C7.50779%2012.5%206.5%2011.4922%206.5%2010.25V3.5H8V10.25C8%2010.6638%208.33621%2011%208.75%2011C9.16379%2011%209.5%2010.6638%209.5%2010.25V3.75C9.5%202.50721%208.49279%201.5%207.25%201.5C6.00721%201.5%205%202.50721%205%203.75V10.75C5%2012.8208%206.67921%2014.5%208.75%2014.5C10.8208%2014.5%2012.5%2012.8208%2012.5%2010.75V3.5H14V10.75C14%2013.6492%2011.6492%2016%208.75%2016C5.85079%2016%203.5%2013.6492%203.5%2010.75V3.75Z'%20fill='black'/%3e%3c/svg%3e");--menuitem-layersView-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.36645%202.34562C8.13878%202.21813%207.86122%202.21813%207.63355%202.34562L1.38355%205.84562C1.14669%205.97826%201%206.22853%201%206.5C1%206.77147%201.14669%207.02174%201.38355%207.15438L7.63355%2010.6544C7.86122%2010.7819%208.13878%2010.7819%208.36645%2010.6544L14.6165%207.15438C14.8533%207.02174%2015%206.77147%2015%206.5C15%206.22853%2014.8533%205.97826%2014.6165%205.84562L8.36645%202.34562ZM8%209.14041L3.28499%206.5L8%203.85959L12.715%206.5L8%209.14041ZM1.63647%209.0766L7.99999%2012.6404L14.3255%209.09761L15.0585%2010.4063L8.36649%2014.1543C8.13881%2014.2818%207.86122%2014.2819%207.63353%2014.1543L0.903534%2010.3853L1.63647%209.0766Z'%20fill='black'/%3e%3c/svg%3e");--manage-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.35176%2010.9989L13.8178%205.53391C13.876%205.47594%2013.9222%205.40702%2013.9537%205.33113C13.9851%205.25524%2014.0013%205.17387%2014.0012%205.0917C14.0011%205.00954%2013.9848%204.9282%2013.9531%204.85238C13.9215%204.77656%2013.8751%204.70775%2013.8168%204.64991C13.6991%204.53309%2013.5401%204.46753%2013.3743%204.46753C13.2085%204.46753%2013.0494%204.53309%2012.9318%204.64991L7.99776%209.58491L3.06776%204.65091C2.9494%204.53853%202.79183%204.47682%202.62863%204.47894C2.46542%204.48106%202.3095%204.54683%202.19409%204.66224C2.07868%204.77765%202.01291%204.93357%202.01079%205.09677C2.00868%205.25997%202.07039%205.41754%202.18276%205.53591L7.64776%2010.9999L8.35176%2010.9989Z'%20fill='black'/%3e%3c/svg%3e");--close-button-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%203.06055L9.06055%208L14%2012.9385L12.9395%2014L8%209.06055L3.06152%2014L2.00098%2012.9395L6.93848%208L2%203.06152L3.06055%202.00098L7.99902%206.93945L12.9385%202L14%203.06055Z'%20fill='black'/%3e%3c/svg%3e");--undo-label-icon:url("data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%200.5C5.21207%200.5%204.43185%200.655195%203.7039%200.956723C2.97595%201.25825%202.31451%201.70021%201.75736%202.25736C1.20021%202.81451%200.758251%203.47595%200.456723%204.2039C0.155195%204.93185%200%205.71207%200%206.5C0%207.28793%200.155195%208.06815%200.456723%208.7961C0.758251%209.52405%201.20021%2010.1855%201.75736%2010.7426C2.31451%2011.2998%202.97595%2011.7417%203.7039%2012.0433C4.43185%2012.3448%205.21207%2012.5%206%2012.5C7.5913%2012.5%209.11742%2011.8679%2010.2426%2010.7426C11.3679%209.61742%2012%208.0913%2012%206.5C12%204.9087%2011.3679%203.38258%2010.2426%202.25736C9.11742%201.13214%207.5913%200.5%206%200.5ZM5.06%208.9L2.9464%206.7856C2.85273%206.69171%202.80018%206.56446%202.80033%206.43183C2.80048%206.29921%202.85331%206.17207%202.9472%206.0784C3.04109%205.98473%203.16834%205.93218%203.30097%205.93233C3.43359%205.93248%203.56073%205.98531%203.6544%206.0792L5.3112%207.7368L8.3464%204.7008C8.44109%204.6109%208.56715%204.56153%208.69771%204.56322C8.82827%204.56492%208.95301%204.61754%209.04534%204.70986C9.13766%204.80219%209.19028%204.92693%209.19198%205.05749C9.19367%205.18805%209.1443%205.31411%209.0544%205.4088L5.5624%208.9H5.06Z'%20fill='%23FBFBFE'/%3e%3c/svg%3e");--pages-selected-icon:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask'%3e%3crect%20width='16'%20height='16'%20rx='2'%20fill='white'/%3e%3cpath%20d='M12%208L4%208'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/mask%3e%3crect%20width='16'%20height='16'%20fill='black'%20mask='url(%23mask)'/%3e%3c/svg%3e");--spinner-icon:url("data:image/svg+xml,%3c!--%20This%20Source%20Code%20Form%20is%20subject%20to%20the%20terms%20of%20the%20Mozilla%20Public%20-%20License,%20v.%202.0.%20If%20a%20copy%20of%20the%20MPL%20was%20not%20distributed%20with%20this%20-%20file,%20You%20can%20obtain%20one%20at%20http://mozilla.org/MPL/2.0/.%20--%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20width='16'%20height='16'%3e%3cstyle%3e%20@media%20not%20(prefers-reduced-motion)%20{%20@keyframes%20loadingRotate%20{%20from%20{%20rotate:%200;%20}%20to%20{%20rotate:%20360deg%20}%20}%20%23circle-arrows%20{%20animation:%20loadingRotate%201.8s%20linear%20infinite;%20transform-origin:%2050%25%2050%25;%20}%20%23hourglass%20{%20display:%20none;%20}%20}%20@media%20(prefers-reduced-motion)%20{%20%23circle-arrows%20{%20display:%20none;%20}%20}%20%3c/style%3e%3cpath%20id='circle-arrows'%20d='M9%205.528c0%20.42.508.63.804.333l2.528-2.528a.47.47%200%200%200%200-.666L9.805.14A.471.471%200%200%200%209%20.472v1.866A5.756%205.756%200%200%200%202.25%208c0%20.942.232%201.83.635%202.615l1.143-1.143A4.208%204.208%200%200%201%203.75%208%204.254%204.254%200%200%201%208%203.75c.345%200%20.68.042%201%20.122v1.656zM7%2010.472v1.656c.32.08.655.122%201%20.122A4.254%204.254%200%200%200%2012.25%208c0-.52-.107-1.013-.279-1.474l1.143-1.143c.404.786.636%201.674.636%202.617A5.756%205.756%200%200%201%207%2013.662v1.866a.47.47%200%200%201-.804.333l-2.528-2.528a.47.47%200%200%201%200-.666l2.528-2.528a.47.47%200%200%201%20.804.333z'/%3e%3cg%20id='hourglass'%3e%3cpath%20d='M13,1%20C13.5522847,1%2014,1.44771525%2014,2%20C14,2.55228475%2013.5522847,3%2013,3%20L12.9854217,2.99990801%20C12.9950817,3.16495885%2013,3.33173274%2013,3.5%20C13,5.24679885%2010.9877318,6.01090495%2010.9877318,8.0017538%20C10.9877318,9.99260264%2013,10.7536922%2013,12.5%20C13,12.6686079%2012.9950617,12.8357163%2012.985363,13.0010943%20L13,13%20C13.5522847,13%2014,13.4477153%2014,14%20C14,14.5522847%2013.5522847,15%2013,15%20L3,15%20C2.44771525,15%202,14.5522847%202,14%20C2,13.4477153%202.44771525,13%203,13%20L3.01463704,13.0010943%20C3.00493827,12.8357163%203,12.6686079%203,12.5%20C3,10.7536922%204.9877318,9.99260264%205,8.0017538%20C5.0122682,6.01090495%203,5.24679885%203,3.5%20C3,3.33173274%203.00491834,3.16495885%203.01457832,2.99990801%20L3,3%20C2.44771525,3%202,2.55228475%202,2%20C2,1.44771525%202.44771525,1%203,1%20L13,1%20Z%20M10.987,3%20L5.012,3%20L5.00308914,3.24815712%20C5.00103707,3.33163368%205,3.4155948%205,3.5%20C5,5.36125069%206.99153646,6.01774089%206.99153646,8.0017538%20C6.99153646,9.98576671%205,10.6393737%205,12.5%20L5.00307746,12.7513676%20L5.01222201,12.9998392%20L5.60191711,12.9988344%20L6.0425138,12.2959826%20C7.02362731,10.7653275%207.67612271,10%208,10%20C8.37014547,10%209.16950644,10.9996115%2010.3980829,12.9988344%20L10.987778,12.9998392%20C10.9958674,12.8352104%2011,12.66849%2011,12.5%20C11,10.6393737%208.98689779,10.0147381%208.98689779,8.0017538%20C8.98689779,5.98876953%2011,5.36125069%2011,3.5%20L10.9969109,3.24815712%20L10.987,3%20Z'/%3e%3cpath%20d='M6,4%20L10,4%20C8.95166016,6%208.28499349,7%208,7%20C7.71500651,7%207.04833984,6%206,4%20Z'/%3e%3c/g%3e%3c/svg%3e");--sidebar-bg-color:var(--lightningcss-light,#ffffffeb)var(--lightningcss-dark,#42414deb);--sidebar-backdrop-filter:blur(7px);--sidebar-width:230px;--sidebar-min-width:min-content;--sidebar-max-width:50vw;--sidebar-block-padding:8px;--views-text-color:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--button-fg:var(--views-text-color);--button-no-bg:var(--button-background-color-toolbar,transparent);--button-bg:var(--button-background-color,var(--lightningcss-light,#15141a12)var(--lightningcss-dark,#fbfbfe12));--views-button-border-color:var(--button-border-color,transparent);--button-hover-bg:var(--button-background-color-hover,var(--lightningcss-light,#15141a24)var(--lightningcss-dark,#fbfbfe24));--button-hover-fg:var(--views-text-color);--button-hover-border-color:var(--views-button-border-color);--button-active-bg:var(--button-background-color-active,var(--lightningcss-light,#15141a36)var(--lightningcss-dark,#fbfbfe36));--button-active-fg:var(--views-text-color);--button-active-border-color:var(--views-button-border-color);--button-focus-no-bg:color-mix(in srgb, var(--views-text-color), transparent 93%);--button-focus-outline-color:var(--focus-outline-color,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--button-focus-border-color:var(--lightningcss-light,#fff)var(--lightningcss-dark,#000);--status-border-color:transparent;--status-actions-bg:var(--lightningcss-light,#15141a08)var(--lightningcss-dark,#fbfbfe08);--status-undo-bg:var(--lightningcss-light,#0062fa14)var(--lightningcss-dark,#00cadb14);--status-waiting-bg:var(--status-undo-bg);--indicator-color:var(--color-accent-primary,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb));--status-warning-bg:var(--lightningcss-light,#ffe8ea)var(--lightningcss-dark,#6e001f);--indicator-warning-color:var(--lightningcss-light,#b20037)var(--lightningcss-dark,#ffa0aa);--header-shadow:0 .25px .75px -.75px var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 2px 6px -6px var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--header-bg:var(--lightningcss-light,#ffffffeb)var(--lightningcss-dark,#42414e);--image-outline:none;--image-border-width:6px;--image-border-color:var(--lightningcss-light,#cfcfd8)var(--lightningcss-dark,#3a3944);--image-hover-border-color:#bfbfc9;--image-current-border-color:var(--button-focus-outline-color);--image-current-focused-outline-color:var(--image-hover-border-color);--image-page-number-bg:var(--lightningcss-light,#f0f0f4)var(--lightningcss-dark,#42414d);--image-page-number-fg:var(--views-text-color);--image-page-number-border-color:transparent;--image-hover-page-number-bg:var(--image-page-number-bg);--image-hover-page-number-fg:var(--image-page-number-fg);--image-current-page-number-bg:var(--image-current-border-color);--image-current-page-number-fg:var(--lightningcss-light,#fff)var(--lightningcss-dark,#15141a);--image-current-hover-page-number-bg:var(--image-current-page-number-bg);--image-current-hover-page-number-fg:var(--image-current-page-number-fg);--image-shadow:0 .375px 1.5px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 0 0 1px var(--image-border-color), 0 3px 12px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--image-hover-shadow:0 .375px 1.5px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 0 0 1px var(--lightningcss-light,#15141a1a)var(--lightningcss-dark,#fbfbfe1a), 0 0 0 var(--image-border-width) var(--image-hover-border-color), 0 3px 12px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--image-current-shadow:0 .375px 1.5px 0 var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 0 0 var(--image-border-width) var(--image-current-border-color), 0 3px 12px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--image-dragging-placeholder-bg:var(--lightningcss-light,#0062fa14)var(--lightningcss-dark,#00cadb14);--image-dragging-placeholder-border:var(--image-outline);--multiple-dragging-bg:white;--image-multiple-dragging-shadow:0 0 0 var(--image-border-width) var(--image-current-border-color), var(--image-border-width) var(--image-border-width) 0 calc(var(--image-border-width) / 2) var(--multiple-dragging-bg), var(--image-border-width) var(--image-border-width) 0 calc(3 * var(--image-border-width) / 2) var(--image-current-border-color);--image-dragging-shadow:0 0 0 var(--image-border-width) var(--image-current-border-color);--multiple-dragging-indicator-bg:var(--indicator-color);--multiple-dragging-text-color:var(--lightningcss-light,#fbfbfe)var(--lightningcss-dark,#15141a)}@media screen and (forced-colors:active){#viewsManager{--views-text-color:var(--text-color,CanvasText);--button-fg:var(--button-text-color,ButtonText);--button-bg:var(--button-background-color,ButtonFace);--button-no-bg:var(--button-background-color,ButtonFace);--views-button-border-color:var(--button-border-color,ButtonText);--button-hover-bg:var(--button-background-color-hover,SelectedItemText);--button-hover-fg:var(--button-text-color-hover,SelectedItem);--button-hover-border-color:var(--button-border-color-hover,SelectedItem);--button-active-bg:var(--button-background-color-active,SelectedItemText);--button-active-fg:var(--button-text-color-active,SelectedItem);--button-active-border-color:var(--button-border-color-active,ButtonText);--button-focus-no-bg:var(--button-background-color,ButtonFace);--button-focus-outline-color:var(--focus-outline-color,CanvasText);--button-focus-border-color:none;--status-border-color:CanvasText;--status-undo-bg:none;--indicator-color:var(--text-color,CanvasText);--status-warning-bg:none;--indicator-warning-color:CanvasText;--header-shadow:none;--image-shadow:none;--image-outline:1px solid ButtonText;--image-focus-outline-color:CanvasText;--image-hover-border-color:SelectedItem;--image-hover-page-number-bg:SelectedItemText;--image-hover-page-number-fg:SelectedItem;--image-current-page-number-bg:ButtonText;--image-current-page-number-fg:ButtonFace;--image-current-border-color:var(--border-color,ButtonText);--image-current-focused-outline-color:var(--image-hover-border-color);--image-current-hover-page-number-bg:SelectedItem;--image-current-hover-page-number-fg:SelectedItemText;--image-page-number-bg:ButtonFace;--image-page-number-fg:ButtonText;--image-page-number-border-color:var(--image-page-number-fg);--multiple-dragging-bg:Canvas;--multiple-dragging-indicator-bg:var(--text-color,ButtonBorder);--multiple-dragging-text-color:Canvas;--image-dragging-placeholder-bg:Canvas;--image-dragging-placeholder-border:1px GrayText solid}}#viewsManager{height:calc(var(--viewer-container-height) - 2 * var(--sidebar-block-padding));transition-property:inset-inline-start;transition-duration:var(--sidebar-transition-duration);transition-timing-function:var(--sidebar-transition-timing-function);flex-direction:column;align-items:flex-start;padding-block:0 16px;display:flex;position:absolute;inset-block-start:calc(100% + var(--sidebar-block-padding));inset-inline-start:calc(-1 * var(--viewsManager-width,--sidebar-width) - 1px)}#viewsManager .sidebarResizer{inset-inline-start:calc(100% + 4px)}#viewsManager .viewsManagerButton{width:auto;color:var(--button-fg);border-radius:var(--button-border-radius,8px);border:1px solid var(--views-button-border-color);background:var(--button-bg)}#viewsManager .viewsManagerButton:hover{background-color:var(--button-hover-bg)!important;color:var(--button-hover-fg)!important;border-color:var(--button-hover-border-color)!important}#viewsManager .viewsManagerButton:hover:before{background-color:var(--button-hover-fg)!important}#viewsManager .viewsManagerButton:active{background:var(--button-active-bg)!important;color:var(--button-active-fg)!important;border-color:var(--button-active-border-color)!important}#viewsManager .viewsManagerButton:active:before{background-color:var(--button-active-fg)!important}#viewsManager .viewsManagerButton:focus-visible{outline:2px solid var(--button-focus-outline-color);outline-offset:2px;border-color:var(--button-focus-border-color)}#viewsManager .viewsManagerButton.viewsCloseButton{width:var(--size-item-large,26px);height:var(--size-item-large,26px);border-radius:var(--button-border-radius,8px);background:0 0;justify-content:center;align-items:center;display:flex}#viewsManager .viewsManagerButton.viewsCloseButton:before{width:16px;height:16px;-webkit-mask-image:var(--close-button-icon);-webkit-mask-image:var(--close-button-icon);mask-image:var(--close-button-icon)}#viewsManager #viewsManagerHeader{width:100%;box-shadow:var(--header-shadow);background-color:var(--header-bg);border-start-start-radius:calc(var(--sidebar-border-radius) - 1px);border-start-end-radius:calc(var(--sidebar-border-radius) - 1px);flex-direction:column;flex:none;align-self:stretch;align-items:flex-start;display:flex}#viewsManager #viewsManagerHeader .viewsManagerLabel{color:var(--views-text-color);text-align:center;-webkit-user-select:none;user-select:none;width:fit-content;height:fit-content;font:menu;flex:auto;font-size:15px;font-style:normal;font-weight:400;line-height:normal}#viewsManager #viewsManagerHeader #viewsManagerTitle{flex-direction:row;justify-content:space-between;align-self:stretch;align-items:center;width:auto;padding-block:12px;padding-inline:8px 16px;display:flex}#viewsManager #viewsManagerHeader #viewsManagerTitle:not(:has(#viewsManagerHeaderLabel~button:not([hidden]))):after{content:"";pointer-events:none;flex:none;width:32px;height:32px}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector{width:48px;height:32px;display:block}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button{background:var(--button-no-bg);width:100%;height:100%}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:focus-visible{background-color:var(--button-focus-no-bg)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:before{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--views-manager-button-icon);-webkit-mask-image:var(--views-manager-button-icon);mask-image:var(--views-manager-button-icon);background-color:var(--button-fg)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:after{content:"";width:12px;height:12px;-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--views-manager-button-arrow-icon);-webkit-mask-image:var(--views-manager-button-arrow-icon);mask-image:var(--views-manager-button-arrow-icon);background-color:var(--button-fg);margin-inline-start:8px;display:inline-block}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:hover:before,#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:hover:after{background-color:var(--button-hover-fg)!important}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:active:before,#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>button:active:after{background-color:var(--button-active-fg)!important}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>.popupMenu{z-index:1;min-width:182px}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>.popupMenu>button#thumbnailsViewMenu:before{-webkit-mask-image:var(--menuitem-thumbnailsView-icon);-webkit-mask-image:var(--menuitem-thumbnailsView-icon);mask-image:var(--menuitem-thumbnailsView-icon)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>.popupMenu>button#outlinesViewMenu:before{-webkit-mask-image:var(--menuitem-outlinesView-icon);-webkit-mask-image:var(--menuitem-outlinesView-icon);mask-image:var(--menuitem-outlinesView-icon)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>.popupMenu>button#attachmentsViewMenu:before{-webkit-mask-image:var(--menuitem-attachmentsView-icon);-webkit-mask-image:var(--menuitem-attachmentsView-icon);mask-image:var(--menuitem-attachmentsView-icon)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerSelector>.popupMenu>button#layersViewMenu:before{-webkit-mask-image:var(--menuitem-layersView-icon);-webkit-mask-image:var(--menuitem-layersView-icon);mask-image:var(--menuitem-layersView-icon)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerAddFileButton{background:var(--button-no-bg);width:32px;height:32px}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerAddFileButton:focus-visible{background-color:var(--button-focus-no-bg)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerAddFileButton:before{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--views-manager-add-file-button-icon);-webkit-mask-image:var(--views-manager-add-file-button-icon);mask-image:var(--views-manager-add-file-button-icon);background-color:var(--button-fg)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerAddFileButton>input{display:none}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerCurrentOutlineButton{background:var(--button-no-bg);width:32px;height:32px}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerCurrentOutlineButton:focus-visible{background-color:var(--button-focus-no-bg)}#viewsManager #viewsManagerHeader #viewsManagerTitle #viewsManagerCurrentOutlineButton:before{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--current-outline-button-icon);-webkit-mask-image:var(--current-outline-button-icon);mask-image:var(--current-outline-button-icon);background-color:var(--button-fg)}#viewsManager #viewsManagerHeader #viewsManagerStatus{border:1px solid var(--status-border-color);width:100%;display:grid}#viewsManager #viewsManagerHeader #viewsManagerStatus>div{box-sizing:border-box;grid-area:1/1;width:100%;min-height:64px;padding-inline:16px}#viewsManager #viewsManagerHeader #viewsManagerStatus>div.hidden{visibility:hidden;display:unset!important}#viewsManager #viewsManagerHeader #viewsManagerStatus .viewsManagerStatusLabel{font:menu;align-items:center;gap:8px;font-size:13px;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction{background-color:var(--status-actions-bg);justify-content:space-between;align-self:stretch;align-items:center;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button{width:var(--icon-size);height:var(--icon-size);border:none;flex:none;padding:0;position:relative}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:before{content:"";background-color:var(--indicator-color);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--pages-selected-icon);-webkit-mask-image:var(--pages-selected-icon);mask-image:var(--pages-selected-icon);position:absolute;inset:0}@media screen and (forced-colors:active){#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button{background-color:var(--button-bg);border-radius:2px}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:before{background-color:var(--button-fg)}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:hover{background-color:var(--button-hover-bg)}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:hover:before{background-color:var(--button-hover-fg)}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:active{background-color:var(--button-active-bg)}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button:active:before{background-color:var(--button-active-fg)}}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #viewsManagerStatusActionLabelContainer>button#viewsManagerStatusActionDeselectButton:focus-visible{outline:2px solid var(--button-focus-outline-color);border:1px solid var(--button-focus-border-color);outline-offset:1px;border-radius:2px}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector{width:auto;min-width:115px;height:32px;display:block}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector #viewsManagerStatusActionButton{justify-content:space-between;align-items:center;gap:8px;width:100%;height:100%;padding:4px 16px;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector #viewsManagerStatusActionButton:after{content:"";width:var(--icon-size);height:var(--icon-size);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--manage-button-icon);-webkit-mask-image:var(--manage-button-icon);mask-image:var(--manage-button-icon);background-color:var(--button-fg);display:inline-block}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector #viewsManagerStatusActionButton:hover:after{background-color:var(--button-hover-fg)!important}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector #viewsManagerStatusActionButton:active:after{background-color:var(--button-active-fg)!important}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusAction #actionSelector>.popupMenu{z-index:1;width:100%;min-width:fit-content}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusUndo{background-color:var(--status-undo-bg);justify-content:space-between;align-self:stretch;align-items:center;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusUndo>span:before{content:"";width:var(--icon-size);height:var(--icon-size);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--undo-label-icon);-webkit-mask-image:var(--undo-label-icon);mask-image:var(--undo-label-icon);background-color:var(--indicator-color);display:inline-block}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusUndo>div{align-items:center;gap:8px;width:auto;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusUndo>div #viewsManagerStatusUndoButton{width:auto;min-height:24px;padding:4px 8px}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusWarning{background-color:var(--status-warning-bg);justify-content:space-between;align-items:center;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusWarning>span{align-items:flex-start}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusWarning>span:before{content:"";width:var(--icon-size);height:var(--icon-size);background-color:var(--indicator-warning-color);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--undo-label-icon);-webkit-mask-image:var(--undo-label-icon);mask-image:var(--undo-label-icon);flex:none;display:inline-block}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusWaiting{background-color:var(--status-waiting-bg);justify-content:space-between;align-items:center;display:flex}#viewsManager #viewsManagerHeader #viewsManagerStatus #viewsManagerStatusWaiting>span:before{content:"";width:var(--icon-size);height:var(--icon-size);background-color:var(--indicator-color);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--spinner-icon);-webkit-mask-image:var(--spinner-icon);mask-image:var(--spinner-icon);flex:none;display:inline-block}#viewsManager #viewsManagerContent{flex:1;width:100%;overflow:auto}#viewsManager #viewsManagerContent:has(#thumbnailsView.isDragging){overflow-x:hidden}#viewsManager #viewsManagerContent #thumbnailsView{--thumbnail-width:126px;--gap-between-input-and-thumbnail:16px;box-sizing:border-box;flex-flow:wrap;justify-content:space-evenly;align-items:center;gap:44px;width:100%;padding:20px 32px;display:flex;position:relative}#viewsManager #viewsManagerContent #thumbnailsView.isDragging{cursor:grabbing}#viewsManager #viewsManagerContent #thumbnailsView.isDragging>.thumbnail>.thumbnailImageContainer:hover{cursor:grabbing}#viewsManager #viewsManagerContent #thumbnailsView.isDragging>.thumbnail>.thumbnailImageContainer:hover:not([aria-current=page]){box-shadow:var(--image-shadow)}#viewsManager #viewsManagerContent #thumbnailsView.isDragging>.thumbnail>input{pointer-events:none}#viewsManager #viewsManagerContent #thumbnailsView.isDragging>.dragMarker,#viewsManager #viewsManagerContent #thumbnailsView.isDraggingFile>.dragMarker{border:2px solid var(--indicator-color);contain:strict;position:absolute;top:0;left:0}#viewsManager #viewsManagerContent #thumbnailsView.pasteMode{gap:var(--gap-between-input-and-thumbnail)}#viewsManager #viewsManagerContent #thumbnailsView.pasteMode>.thumbnail{flex-direction:column}#viewsManager #viewsManagerContent #thumbnailsView.pasteMode>.thumbnail>input{display:none}#viewsManager #viewsManagerContent #thumbnailsView.pasteMode>.thumbnail>.thumbnailPasteButton{min-height:24px;font:menu;border-radius:16px;justify-content:center;align-items:center;padding:4px 16px;font-size:13px;font-style:normal;font-weight:400;line-height:normal;display:flex}#viewsManager #viewsManagerContent #thumbnailsView:not(.pasteMode)>.thumbnail>.thumbnailPasteButton{display:none}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail{--input-dim:16px}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail:not(#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail:has(input)){--input-dim:0px;--gap-between-input-and-thumbnail:0px}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail{justify-content:flex-end;align-items:center;gap:var(--gap-between-input-and-thumbnail);width:calc(var(--thumbnail-width) + 2 * (var(--input-dim) + var(--gap-between-input-and-thumbnail)));flex-direction:row-reverse;height:auto;scroll-margin-top:20px;display:inline-flex;position:relative}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail .thumbnailPasteButton{text-align:center;padding:8px 0}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail:not(.isDragging)>.thumbnailImageContainer:after{content:attr(page-number);border:1px solid var(--image-page-number-border-color);background-color:var(--image-page-number-bg);color:var(--image-page-number-fg);bottom:5px;text-align:center;box-sizing:content-box;min-width:32px;height:16px;translate:calc(var(--dir-factor) * 50%);font:menu;pointer-events:none;-webkit-user-select:none;user-select:none;border-radius:8px;font-size:12px;font-style:normal;font-weight:400;line-height:normal;position:absolute;inset-inline-end:50%}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail:has([aria-current=page]):not(.isDragging)>.thumbnailImageContainer:after{background-color:var(--image-current-page-number-bg);color:var(--image-current-page-number-fg);outline:1px solid var(--image-current-border-color)}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail.isDragging>input{visibility:hidden}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>input{width:var(--input-dim);height:var(--input-dim);accent-color:var(--indicator-color);margin:0}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer{--thumbnail-dragging-scale:1.4;width:var(--thumbnail-width);box-shadow:var(--image-shadow);box-sizing:content-box;outline:var(--image-outline);-webkit-user-select:none;user-select:none;border:none;border-radius:8px;position:relative}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer img{-webkit-user-select:none;user-select:none;pointer-events:none;border:none;border-radius:8px;outline:none;width:100%;height:100%}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.missingThumbnailImage{content-visibility:hidden}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:hover{cursor:pointer;box-shadow:var(--image-hover-shadow)}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:hover:after{background-color:var(--image-hover-page-number-bg);color:var(--image-hover-page-number-fg)}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:hover{box-shadow:none;outline:var(--image-border-width) var(--image-hover-border-color) solid}}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible:not([aria-current=page]){box-shadow:var(--image-hover-shadow);outline:none}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible:not([aria-current=page]){box-shadow:none;outline:var(--image-border-width) var(--image-focus-outline-color) solid}}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible[aria-current=page]{outline:var(--image-border-width) solid var(--image-current-focused-outline-color);outline-offset:var(--image-border-width)}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible[aria-current=page]{box-shadow:none;outline:var(--image-border-width) var(--image-current-border-color) solid;outline-offset:0}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible[aria-current=page]>img{outline:var(--image-border-width) var(--image-focus-outline-color) solid;outline-offset:var(--image-border-width)}}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible{box-shadow:none;outline:var(--image-border-width) var(--image-current-border-color) solid}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer:focus-visible:hover>img{outline:var(--image-border-width) var(--image-hover-border-color) solid;outline-offset:var(--image-border-width)}}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer[aria-current=page]{box-shadow:var(--image-current-shadow)}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer[aria-current=page]:hover:after{background-color:var(--image-current-hover-page-number-bg);color:var(--image-current-hover-page-number-fg)}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer[aria-current=page]{box-shadow:none;outline:var(--image-border-width) var(--image-current-border-color) solid}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer[aria-current=page]:hover>img{outline:var(--image-border-width) var(--image-hover-border-color) solid;outline-offset:var(--image-border-width)}}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.placeholder{background-color:var(--image-dragging-placeholder-bg);outline:var(--image-dragging-placeholder-border);box-shadow:none!important}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.draggingThumbnail{z-index:1;transform-origin:0 0 0;scale:calc(1 / var(--thumbnail-dragging-scale));pointer-events:none;box-shadow:var(--image-dragging-shadow);position:absolute;top:0;left:0}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.draggingThumbnail.multiple{box-shadow:var(--image-multiple-dragging-shadow)}@media screen and (forced-colors:active){#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.draggingThumbnail.multiple{forced-color-adjust:none;box-shadow:var(--image-multiple-dragging-shadow)}}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.draggingThumbnail.multiple>.thumbnailImageContainer{width:var(--thumbnail-width);box-sizing:content-box;-webkit-user-select:none;user-select:none;border:none;border-radius:8px;outline:none;position:absolute;top:0;left:0}#viewsManager #viewsManagerContent #thumbnailsView>.thumbnail>.thumbnailImageContainer.draggingThumbnail.multiple:after{content:attr(data-multiple-count);border-radius:calc(8px * var(--thumbnail-dragging-scale));background-color:var(--multiple-dragging-indicator-bg);color:var(--multiple-dragging-text-color);min-width:calc(32px * var(--thumbnail-dragging-scale));height:calc(16px * var(--thumbnail-dragging-scale));text-align:center;font:menu;font-size:calc(13px * var(--thumbnail-dragging-scale));contain:strict;font-style:normal;font-weight:400;line-height:normal;position:absolute;inset-block-end:calc(4px * var(--thumbnail-dragging-scale));inset-inline-start:calc(4px * var(--thumbnail-dragging-scale))}#viewsManager #viewsManagerContent #attachmentsView{--attachment-color:var(--lightningcss-light,#000c)var(--lightningcss-dark,#fffc);--attachment-bg-color:var(--lightningcss-light,#00000026)var(--lightningcss-dark,#ffffff26);--attachment-hover-color:var(--lightningcss-light,#000000e6)var(--lightningcss-dark,#ffffffe6)}#viewsManager #viewsManagerContent #attachmentsView>ul{padding:0;list-style-type:none}#viewsManager #viewsManagerContent #attachmentsView>ul>li>a{min-width:calc(100% - 4px);height:auto;color:var(--attachment-color);-webkit-user-select:none;user-select:none;white-space:normal;cursor:pointer;border-radius:2px;margin-bottom:1px;padding:2px 0 5px;padding-inline-start:4px;font-size:13px;line-height:15px;text-decoration:none;display:inline-block}#viewsManager #viewsManagerContent #attachmentsView>ul>li>a:hover{background-color:var(--attachment-bg-color);color:var(--attachment-hover-color);background-clip:padding-box;border-radius:2px}.sidebar{--sidebar-bg-color:var(--background-color-box,var(--lightningcss-light,#fff)var(--lightningcss-dark,#23222b));--sidebar-border-color:var(--lightningcss-light,#15141a1a)var(--lightningcss-dark,#fbfbfe1a);--sidebar-box-shadow:0 .25px .75px var(--lightningcss-light,#0000000d)var(--lightningcss-dark,#0003), 0 2px 6px 0 var(--lightningcss-light,#0000001a)var(--lightningcss-dark,#0006);--sidebar-backdrop-filter:none;--sidebar-border-radius:8px;--sidebar-padding:5px;--sidebar-min-width:180px;--sidebar-max-width:632px;--sidebar-width:239px;--resizer-width:4px;--resizer-shift:calc(0px - var(--resizer-width) - 2px);--resizer-hover-bg-color:var(--color-accent-primary,var(--lightningcss-light,#0062fa)var(--lightningcss-dark,#00cadb))}@media screen and (forced-colors:active){.sidebar{--sidebar-bg-color:var(--background-color-box,Canvas);--sidebar-border-color:CanvasText;--sidebar-box-shadow:none;--resizer-hover-bg-color:var(--text-color,CanvasText)}}.sidebar{border-radius:var(--sidebar-border-radius);box-shadow:var(--sidebar-box-shadow);border:1px solid var(--sidebar-border-color);background-color:var(--sidebar-bg-color);padding-block:var(--sidebar-padding);width:var(--sidebar-width);min-width:var(--sidebar-min-width);max-width:var(--sidebar-max-width);-webkit-backdrop-filter:var(--sidebar-backdrop-filter);backdrop-filter:var(--sidebar-backdrop-filter);box-sizing:border-box;position:relative;inset-block-start:calc(100% + var(--doorhanger-height) - 2px)}.sidebar .sidebarResizer{width:var(--resizer-width);forced-color-adjust:none;cursor:ew-resize;box-sizing:border-box;border:1px solid #0000;background-color:#0000;background-clip:content-box;border-block-width:0;transition:background-color .5s ease-in-out,border-color .5s ease-in-out;position:absolute;inset-block:0;inset-inline-start:var(--resizer-shift)}.sidebar .sidebarResizer:hover{background-color:var(--resizer-hover-bg-color);border-color:#fff}.sidebar .sidebarResizer:focus-visible{background-color:var(--resizer-hover-bg-color);outline:none}.sidebar.resizing{cursor:ew-resize;-webkit-user-select:none;user-select:none}.sidebar.resizing :not(.sidebarResizer){pointer-events:none}.sidebar.resizing .sidebarResizer{background-color:var(--resizer-hover-bg-color)}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--viewer-container-height:0;--pdfViewer-padding-bottom:0;--page-margin:1px auto -8px;--page-border:9px solid transparent;--spreadHorizontalWrapped-margin-LR:-3.5px;--loading-icon-delay:.4s;--focus-ring-color:var(--focus-outline-color,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--focus-ring-outline:var(--focus-outline-width,2px) solid var(--focus-ring-color);--text-primary-color:var(--text-color,var(--lightningcss-light,#15141a)var(--lightningcss-dark,#fbfbfe));--link-fg-color:var(--link-color,var(--lightningcss-light,#0060df)var(--lightningcss-dark,#0df));--link-hover-fg-color:var(--link-color-hover,var(--lightningcss-light,#0250bb)var(--lightningcss-dark,#80ebff));--new-badge-bg:var(--lightningcss-light,#070)var(--lightningcss-dark,#37b847);--new-badge-color:var(--lightningcss-light,#fff)var(--lightningcss-dark,#15141a);--new-badge-border-color:var(--lightningcss-light,#fbfbfe / 40%)var(--lightningcss-dark,#15141a / 40%)}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}@media screen and (forced-colors:active){:root{--pdfViewer-padding-bottom:9px;--page-margin:8px auto -1px;--page-border:1px solid CanvasText;--spreadHorizontalWrapped-margin-LR:3.5px;--focus-ring-color:var(--focus-outline-color,CanvasText);--text-primary-color:var(--text-color,CanvasText);--link-fg-color:var(--link-color,LinkText);--link-hover-fg-color:var(--link-color-hover,LinkText);--new-badge-bg:AccentColor;--new-badge-color:ButtonFace;--new-badge-border-color:CanvasText}}.newBadge{background-color:var(--new-badge-bg);color:var(--new-badge-color);border:1px solid var(--new-badge-border-color);font:menu;flex:0 0 fit-content;-webkit-user-select:none;user-select:none;border-radius:4px;margin-inline:4px;padding-inline:4px;font-size:12px;font-style:normal;font-weight:400;line-height:normal}[data-main-rotation="90"]{transform:rotate(90deg)translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg)translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg)translate(-100%)}.pdfViewer{--scale-factor:1;--page-bg-color:unset;padding-bottom:var(--pdfViewer-padding-bottom);--hcm-highlight-filter:none;--hcm-highlight-selected-filter:none}@media screen and (forced-colors:active){.pdfViewer{--hcm-highlight-filter:invert(100%)}}.pdfViewer.copyAll{cursor:wait}.pdfViewer .canvasWrapper{width:100%;height:100%;overflow:hidden}.pdfViewer .canvasWrapper canvas{contain:content;width:100%;height:100%;margin:0;display:block;position:absolute;top:0;left:0}.pdfViewer .canvasWrapper canvas .structTree{contain:strict}.pdfViewer .canvasWrapper canvas.detailView{image-rendering:pixelated}.pdfViewer .canvasWrapper .selection{pointer-events:none;background:#005aff38;width:100%;height:100%;position:absolute;top:0;left:0}.pdfViewer .page{--user-unit:1;--total-scale-factor:calc(var(--scale-factor) * var(--user-unit));--scale-round-x:1px;--scale-round-y:1px;width:816px;height:1056px;margin:var(--page-margin);border:var(--page-border);background-clip:content-box;background-color:var(--page-bg-color,#fff);direction:ltr;position:relative;overflow:visible}.pdfViewer .dummyPage{width:0;height:var(--viewer-container-height);position:relative}.pdfViewer.noUserSelect{-webkit-user-select:none;user-select:none}.pdfViewer.removePageBorders .page{border:none;margin:0 auto 10px}.pdfViewer.singlePageView{display:inline-block}.pdfViewer.singlePageView .page{border:none;margin:0}.pdfViewer:is(.scrollHorizontal,.scrollWrapped),.spread{text-align:center;margin-inline:3.5px}.pdfViewer.scrollHorizontal,.spread{white-space:nowrap}.pdfViewer.removePageBorders,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .spread{margin-inline:0}.spread :is(.page,.dummyPage),.pdfViewer:is(.scrollHorizontal,.scrollWrapped) :is(.page,.spread){vertical-align:middle;display:inline-block}.spread .page,.pdfViewer:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:var(--spreadHorizontalWrapped-margin-LR)}.pdfViewer.removePageBorders .spread .page,.pdfViewer.removePageBorders:is(.scrollHorizontal,.scrollWrapped) .page{margin-inline:5px}.pdfViewer .page.loadingIcon:after{content:"";width:100%;height:100%;transition-property:display;transition-delay:var(--loading-icon-delay);z-index:5;contain:strict;background:url(data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjghOpCgz3LTBIxJ5kgwMBShACREHZ1V4Kg1rS44pBAgMDAg/Sw0GBAQGDZGTlY+YmpyPpSQDiqYiDQoCliqZBqkGAgKIS5kEjQ21VwCyp76dBHiNvz+MR74AqSOdVwbQuo+abppo10ssjdkAnc0rf8vgl8YqIQAh+QQJBwAAACwAAAAAGAAYAAAFrCAgjiQgCGVaDgZZFCQxqKNRKGOSjMjR0qLXTyciHA7AkaLACMIAiwOC1iAxCrMToHHYjWQiA4NBEA0Q1RpWxHg4cMXxNDk4OBxNUkPAQAEXDgllKgMzQA1pSYopBgonCj9JEA8REQ8QjY+RQJOVl4ugoYssBJuMpYYjDQSliwasiQOwNakALKqsqbWvIohFm7V6rQAGP6+JQLlFg7KDQLKJrLjBKbvAor3IKiEAIfkECQcAAAAsAAAAABgAGAAABbUgII4koChlmhokw5DEoI4NQ4xFMQoJO4uuhignMiQWvxGBIQC+AJBEUyUcIRiyE6CR0CllW4HABxBURTUw4nC4FcWo5CDBRpQaCoF7VjgsyCUDYDMNZ0mHdwYEBAaGMwwHDg4HDA2KjI4qkJKUiJ6faJkiA4qAKQkRB3E0i6YpAw8RERAjA4tnBoMApCMQDhFTuySKoSKMJAq6rD4GzASiJYtgi6PUcs9Kew0xh7rNJMqIhYchACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJEAQZZo2JIKQxqCOjWCMDDMqxT2LAgELkBMZCoXfyCBQiFwiRsGpku0EshNgUNAtrYPT0GQVNRBWwSKBMp98P24iISgNDAS4ipGA6JUpA2WAhDR4eWM/CAkHBwkIDYcGiTOLjY+FmZkNlCN3eUoLDmwlDW+AAwcODl5bYl8wCVYMDw5UWzBtnAANEQ8kBIM0oAAGPgcREIQnVloAChEOqARjzgAQEbczg8YkWJq8nSUhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJGAYZZoOpKKQqDoORDMKwkgwtiwSBBYAJ2owGL5RgxBziQQMgkwoMkhNqAEDARPSaiMDFdDIiRSFQowMXE8Z6RdpYHWnEAWGPVkajPmARVZMPUkCBQkJBQINgwaFPoeJi4GVlQ2Qc3VJBQcLV0ptfAMJBwdcIl+FYjALQgimoGNWIhAQZA4HXSpLMQ8PIgkOSHxAQhERPw7ASTSFyCMMDqBTJL8tf3y2fCEAIfkECQcAAAAsAAAAABgAGAAABa8gII4k0DRlmg6kYZCoOg5EDBDEaAi2jLO3nEkgkMEIL4BLpBAkVy3hCTAQKGAznM0AFNFGBAbj2cA9jQixcGZAGgECBu/9HnTp+FGjjezJFAwFBQwKe2Z+KoCChHmNjVMqA21nKQwJEJRlbnUFCQlFXlpeCWcGBUACCwlrdw8RKGImBwktdyMQEQciB7oACwcIeA4RVwAODiIGvHQKERAjxyMIB5QlVSTLYLZ0sW8hACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWPM5wNiV0UDUIBNkdoepTfMkA7thIECiyRtUAGq8fm2O4jIBgMBA1eAZ6Knx+gHaJR4QwdCMKBxEJRggFDGgQEREPjjAMBQUKIwIRDhBDC2QNDDEKoEkDoiMHDigICGkJBS2dDA6TAAnAEAkCdQ8ORQcHTAkLcQQODLPMIgIJaCWxJMIkPIoAt3EhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWHM5wNiV0UN3xdLiqr+mENcWpM9TIbrsBkEck8oC0DQqBQGGIz+t3eXtob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==) 50% no-repeat;display:none;position:absolute;top:0;left:0}.pdfViewer .page.loading:after{display:block}.pdfViewer .page:not(.loading):after{transition-property:none;display:none}.pdfPresentationMode .pdfViewer{padding-bottom:0}.pdfPresentationMode .spread{margin:0}.pdfPresentationMode .pdfViewer .page{border:2px solid #0000;margin:0 auto}`,uu=`/assets/pdf.worker.min-CjEcRF4W.mjs`,$=r();Kr.workerSrc=uu;var du=document.createElement(`style`);du.textContent=`@scope (.pdf-view) {${lu.replaceAll(`:root`,`:scope`).replace(/color-scheme:\s*light dark;?/g,``)}}`,document.head.append(du);var fu=e=>Math.min(1,Math.max(0,e)),pu=([e,t,n,r])=>({left:`${e*100}%`,top:`${t*100}%`,width:`${(n-e)*100}%`,height:`${(r-t)*100}%`}),mu=e=>[Math.min(...e.map(e=>e[0])),Math.min(...e.map(e=>e[1])),Math.max(...e.map(e=>e[2])),Math.max(...e.map(e=>e[3]))],hu=()=>[{value:`page-width`,label:n(`Fit width`)},{value:`page-fit`,label:n(`Fit page`)},...[.5,.75,1,1.25,1.5,2,3,4].map(e=>({value:String(e),label:`${e*100}%`}))];function gu(e){let t=e.cloneRange(),n=/[\p{L}\p{N}]/u,r=t.startContainer,i=t.endContainer,a=``,o=``;if(r.nodeType===Node.TEXT_NODE){let e=r.textContent||``,i=t.startOffset;if(n.test(e[i]||``))for(;i>0&&n.test(e[i-1]);)i--;a=e.slice(i,t.startOffset),t.setStart(r,i)}if(i.nodeType===Node.TEXT_NODE){let e=i.textContent||``,r=t.endOffset;if(r>0&&n.test(e[r-1]))for(;r<e.length&&n.test(e[r]);)r++;o=e.slice(t.endOffset,r),t.setEnd(i,r)}return{range:t,before:a,after:o}}function _u(e,t){let n=e.getPage.bind(e),r=new Map;e.getPage=e=>(r.has(e)||r.set(e,n(e).then(n=>{if(n.rotate%360!=0)return n;let r=n.getTextContent.bind(n),i=null,a=()=>i??=fetch(`${t}&page=${e-1}`).then(e=>e.ok?e.json():null).then(e=>e?vu(e,n.view):null,()=>null);return n.getTextContent=(async e=>await a()||r(e)),n.streamTextContent=(e=>new ReadableStream({async start(t){t.enqueue(await a()||await r(e)),t.close()}})),n})),r.get(e))}function vu({words:e},t){return{items:e.map(([n,r,i,a,o,s],c)=>{let l=e[c+1],u=!s&&l&&l[1]>r;return{str:u?n+` `:n,dir:`ltr`,width:u?l[1]-r:o,height:a,transform:[a,0,0,a,t[0]+r,t[3]-i],fontName:`exact`,hasEOL:!!s}}),styles:{exact:{fontFamily:`serif`,ascent:.8,descent:-.2,vertical:!1}},lang:null}}function yu(e){let t=[];return e.map(e=>{let n=(e[0]+e[2])/2>.5?`right`:`left`,r=(e[1]+e[3])/2,i=t.filter(e=>e.side===n&&Math.abs(e.top-r)<.015).length;return t.push({side:n,top:r}),{[n]:8+i*24,top:`${r*100}%`}})}async function bu(e){let t=[];async function n(r,i){for(let a of r||[]){let r=typeof a.dest==`string`?await e.getDestination(a.dest).catch(()=>null):a.dest,o=0,s=null;if(Array.isArray(r)&&r[0]!==void 0&&r[0]!==null){o=typeof r[0]==`number`?r[0]+1:await e.getPageIndex(r[0]).then(e=>e+1,()=>0);let t=r[1]?.name;s=t===`XYZ`&&typeof r[3]==`number`?r[3]:(t===`FitH`||t===`FitBH`)&&typeof r[2]==`number`?r[2]:null}o&&t.push({title:a.title.trim(),level:i,dest:a.dest,page:o,top:s}),await n(a.items,i+1)}}return await n(await e.getOutline(),0),t}var xu=(0,m.forwardRef)(function(t,r){let o=(0,m.useRef)(t);o.current=t;let g=(0,m.useRef)(null),_=(0,m.useRef)(null),v=(0,m.useRef)(null),y=(0,m.useRef)(null),b=(0,m.useRef)(null),x=(0,m.useRef)(null),C=(0,m.useRef)(new Map),[w,T]=(0,m.useState)(new Map),[E,D]=(0,m.useState)(0),[O,ee]=(0,m.useState)(1),[k,te]=(0,m.useState)(`1`),[ne,A]=(0,m.useState)({value:`page-width`,scale:1}),[re,j]=(0,m.useState)(!0),[M,ie]=(0,m.useState)(``),[ae,oe]=(0,m.useState)(!1),[N,P]=(0,m.useState)(``),[F,se]=(0,m.useState)({current:0,total:0}),[ce,le]=(0,m.useState)(!1),[I,L]=(0,m.useState)(null),[ue,de]=(0,m.useState)(null),[R,fe]=(0,m.useState)(null),pe=(0,m.useRef)(R);pe.current=R;let me=(0,m.useRef)(null),[he,ge]=(0,m.useState)(null),_e=(0,m.useRef)(he),z=e=>{_e.current=e,ge(e)},B=(0,m.useRef)(null),[ve,ye]=(0,m.useState)(!1),[be,xe]=(0,m.useState)(``),[Se,Ce]=(0,m.useState)({}),[we,Te]=(0,m.useState)(``),[Ee,De]=(0,m.useState)(null),V=t.notes.filter(({note:e})=>e.aiReview).sort((e,t)=>e.note.page-t.note.page||e.note.rect[1]-t.note.rect[1]||e.note.rect[0]-t.note.rect[0]),Oe=V.findIndex(({note:e})=>e.id===t.active),ke=V[Oe],Ae=t.notes.filter(({note:e})=>!e.aiReview).sort((e,t)=>e.note.page-t.note.page||e.note.rect[1]-t.note.rect[1]),je=Ae.findIndex(({note:e})=>e.id===t.active),Me=ke||Ae[je],Ne=ke?Oe:je,Pe=ke?V:Ae,Fe=ve||!!t.noteActions?.disabled,Ie=t.noteActions?.onBusy;(0,m.useEffect)(()=>(Ie?.(ve),()=>Ie?.(!1)),[ve,Ie]),(0,m.useEffect)(()=>{xe(``)},[t.active]),(0,m.useEffect)(()=>{Ee&&t.notes.some(({note:e})=>e.id===Ee.id)&&De(null)},[t.notes,Ee]);function Le(e=!0){if(o.current.active!==t.active)return;let n=g.current?.querySelector(`.note-tag[data-note="${t.active}"]`);t.onDeselect?.(),e&&(n||g.current)?.focus({preventScroll:!0})}function Re(e){let n=Pe[Ne+e];n&&!Fe&&(g.current?.focus({preventScroll:!0}),t.onSelect(n.note))}async function ze(e){if(t.noteActions&&!Fe){ye(!0),xe(``);try{await t.noteActions.remove(e),De(e),o.current.active===e.id&&o.current.onDeselect?.()}catch(e){xe(e instanceof Error?e.message:String(e))}finally{ye(!1)}}}async function Be(){if(t.noteActions&&Ee&&!Fe){ye(!0),xe(``);try{await t.noteActions.restore(Ee),De(null)}catch(e){xe(e instanceof Error?e.message:String(e))}finally{ye(!1)}}}async function Ve(e){if(t.noteActions?.copy&&!Fe){ye(!0),xe(``);try{await t.noteActions.copy(e)}catch(e){xe(e instanceof Error?e.message:String(e))}finally{ye(!1)}}}(0,m.useImperativeHandle)(r,()=>({focus(){g.current?.focus({preventScroll:!0})},fitWidth(){let e=y.current?.viewer;e&&e.currentScaleValue!==`page-width`&&(e.currentScaleValue=`page-width`)},goTo(e){o.current.onSection(o.current.outline.indexOf(e)),(async()=>{let t=y.current?.viewer,n=t?.pdfDocument;if(!t||!n)return;let r=typeof e.dest==`string`?await n.getDestination(e.dest):e.dest,i=Array.isArray(r)?r[0]:null,a=i&&typeof i==`object`?await n.getPageIndex(i):Number.isInteger(i)?i:-1;a<0||(t.scrollPageIntoView({pageNumber:a+1,destArray:r}),g.current?.focus({preventScroll:!0}))})().catch(()=>{})},goToNote(e){let t=y.current?.viewer.getPageView(e.page)?.div,n=g.current;t&&n&&n.scrollTo({top:n.scrollTop+t.getBoundingClientRect().top-n.getBoundingClientRect().top+e.rect[1]*t.offsetHeight-96,behavior:`smooth`})},showPlace(e,t){let n=y.current?.viewer.getPageView(e)?.div,r=g.current;if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=r.scrollTop+i.top-a.top+t[1]*n.offsetHeight-r.clientHeight/3,s=r.scrollLeft+i.left-a.left+(t[0]+t[2])/2*n.offsetWidth-r.clientWidth/2;r.scrollTo({top:o,left:r.scrollWidth>r.clientWidth?s:r.scrollLeft,behavior:Math.abs(o-r.scrollTop)>r.clientHeight*2?`instant`:`smooth`}),de({page:e,rect:t,id:Date.now()})}}),[]),(0,m.useEffect)(()=>{if(!ue)return;let e=setTimeout(()=>de(e=>e?.id===ue.id?null:e),2400);return()=>clearTimeout(e)},[ue]),(0,m.useEffect)(()=>{let t=g.current,n=new Gs,r=new Rs({eventBus:n,externalLinkTarget:Ls.BLANK,externalLinkRel:`noopener noreferrer`}),i=new Fs({eventBus:n,linkService:r}),a=new cu({container:t,viewer:_.current,eventBus:n,linkService:r,findController:i,removePageBorders:!0,annotationMode:S.ENABLE});r.setViewer(a),r.goToDestination=async e=>{let t=b.current;if(!t)return;let n=typeof e==`string`?await t.getDestination(e):await e;if(!Array.isArray(n))return;let[r]=n,i=null;if(r&&typeof r==`object`){let e=r;i=t.cachedPageNumber(e)??await t.getPageIndex(e).then(e=>e+1,()=>null)}else Number.isInteger(r)&&(i=r+1);i&&i>=1&&i<=a.pagesCount&&a.scrollPageIntoView({pageNumber:i,destArray:n})},y.current={bus:n,links:r,find:i,viewer:a};let l=({pageNumber:e,source:t})=>{let n=t?.div??a.getPageView(e-1)?.div;if(!n)return;let r=C.current.get(e);r||(r=document.createElement(`div`),r.className=`note-layer`,C.current.set(e,r),T(new Map(C.current))),r.parentElement!==n&&n.append(r)};n.on(`pagerendered`,l),n.on(`textlayerrendered`,l),n.on(`annotationlayerrendered`,l),n.on(`pagesinit`,()=>{let n=x.current;x.current=null,a.currentScaleValue=n?.scale||e.getItem(`papilot:pdf-zoom`)||`page-width`,n&&(t.scrollTop=n.top,t.scrollLeft=n.left)}),n.on(`pagechanging`,({pageNumber:e})=>{ee(e),te(String(e))}),n.on(`scalechanging`,({scale:t,presetValue:n})=>{A({value:n||String(t),scale:t}),n?e.setItem(`papilot:pdf-zoom`,n):e.setItem(`papilot:pdf-zoom`,String(Math.round(t*100)/100))});let u=0,d=new ResizeObserver(()=>{cancelAnimationFrame(u),u=requestAnimationFrame(()=>{if(!a.pagesCount||!t.clientWidth||!t.clientHeight)return;let e=a.currentScaleValue;(e===`page-width`||e===`page-fit`||e===`page-height`||e===`auto`)&&(a.currentScaleValue=e),a.update()})});d.observe(t),n.on(`updateviewarea`,({location:e})=>{if(!e)return;let n=o.current.outline,r=e.top-t.clientHeight*.4/(a.currentScale*96/72),i=-1;n.forEach((t,n)=>{(t.page<e.pageNumber||t.page===e.pageNumber&&(t.top===null||t.top>=r))&&(i=n)}),t.scrollTop+t.clientHeight>=t.scrollHeight-2&&n.length&&(i=n.length-1),i!==o.current.section&&o.current.onSection(i)}),n.on(`updatefindmatchescount`,({matchesCount:e})=>se(e)),n.on(`updatefindcontrolstate`,({state:e,matchesCount:t})=>{le(e===xs.NOT_FOUND),t&&se(t)});let f=e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),a.updateScale({drawingDelay:250,scaleFactor:Math.exp(-e.deltaY/100),origin:[e.clientX,e.clientY]}))},p=null,m=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY),h=e=>{e.touches.length===2&&(p=m(e.touches))},v=e=>{if(p===null||e.touches.length!==2)return;e.preventDefault();let t=m(e.touches);a.updateScale({drawingDelay:250,scaleFactor:t/p,origin:[(e.touches[0].clientX+e.touches[1].clientX)/2,(e.touches[0].clientY+e.touches[1].clientY)/2]}),p=t},w=e=>{e.touches.length<2&&(p=null)};t.addEventListener(`wheel`,f,{passive:!1}),t.addEventListener(`touchstart`,h,{passive:!0}),t.addEventListener(`touchmove`,v,{passive:!1}),t.addEventListener(`touchend`,w);let E=!1,D,O=()=>{if(me.current?.active())return;let e=document.getSelection();if(!e||e.isCollapsed||!e.rangeCount){L(null);return}let{range:n,before:r,after:i}=gu(e.getRangeAt(0)),a=n.startContainer,o=a instanceof Element?a:a.parentElement,c=o?.closest(`.page`);if(!c||!t.contains(c)||o?.closest(`.pdf-note-card`)){L(null);return}let l=c.getBoundingClientRect(),u=s(Array.from(n.getClientRects()).filter(e=>e.width>1&&e.height>1&&e.top>=l.top-1&&e.bottom<=l.bottom+1).map(e=>[fu((e.left-l.left)/l.width),fu((e.top-l.top)/l.height),fu((e.right-l.left)/l.width),fu((e.bottom-l.top)/l.height)])),d=(r+e.toString()+i).replace(/\s+/g,` `).trim(),f=u.length&&d?{page:Number(c.dataset.pageNumber)-1,rects:u,quote:d}:null;return L(f),f},k=()=>{clearTimeout(D),D=setTimeout(O,120)};document.addEventListener(`selectionchange`,k);let ne=e=>{!o.current.group||o.current.markingDisabled||pe.current||o.current.region||e.pointerType===`touch`||!t.contains(e.target)||e.target.closest(`button,input,select,.pdf-note-card`)||setTimeout(()=>{if(E)return;let e=O();e&&o.current.group&&We(e)},0)};document.addEventListener(`pointerup`,ne);let re=e=>{if(o.current.region||pe.current)return;let n=e.target instanceof Element?e.target:null;if(n?.closest(`button,a,input,textarea,select,[contenteditable],.select-handle,.pdf-note-card`))return;let r=n?.closest(`.page`);if(!r||!t.contains(r))return;let i=r.getBoundingClientRect(),a=(e.clientX-i.left)/i.width,s=(e.clientY-i.top)/i.height,c,l=1/0;for(let{note:e}of o.current.notes)if(e.page===Number(r.dataset.pageNumber)-1)for(let[t,n,r,i]of e.rects?.length?e.rects:[e.rect]){let o=(r-t)*(i-n);a>=t&&a<=r&&s>=n&&s<=i&&o<=l&&(c=e,l=o)}return c},j=null,M=()=>{j=null},ie=e=>{if(j=null,!e.isPrimary||e.button!==0)return;let t=re(e);t&&(j={id:t.id,x:e.clientX,y:e.clientY,time:e.timeStamp,touch:e.pointerType!==`mouse`})},ae=e=>{j&&Math.hypot(e.clientX-j.x,e.clientY-j.y)>(j.touch?10:4)&&M()},oe=e=>{let t=j;if(j=null,!t||e.defaultPrevented||e.button!==0||t.touch&&e.timeStamp-t.time>=450||document.getSelection()?.isCollapsed===!1)return;let n=re(e);n?.id===t.id&&(t.touch?setTimeout(()=>{!E&&!me.current?.active()&&o.current.onSelect(n)},0):o.current.onSelect(n))};return t.addEventListener(`pointerdown`,ie),t.addEventListener(`scroll`,M),document.addEventListener(`pointermove`,ae),document.addEventListener(`pointerup`,oe),document.addEventListener(`pointercancel`,M),me.current=c(t,{target:e=>e.closest(`.textLayer`)?.closest(`.page`)??void 0,units:e=>({units:Array.from(e.querySelectorAll(`.textLayer span`)).filter(e=>!e.firstElementChild),line:(e,t)=>t}),blocked:()=>o.current.region||!!pe.current,menu:`.add-note`,onSelect:({target:e,units:t,from:n,to:r})=>{let i=e.getBoundingClientRect(),a=document.createRange(),o=t[r].firstChild;a.setStart(t[n],0),o?.nodeType===Node.TEXT_NODE?a.setEnd(o,(o.textContent||``).trimEnd().length):a.setEnd(t[r],t[r].childNodes.length);let c=s(Array.from(a.getClientRects()).filter(e=>e.width>1&&e.height>1).map(e=>[fu((e.left-i.left)/i.width),fu((e.top-i.top)/i.height),fu((e.right-i.left)/i.width),fu((e.bottom-i.top)/i.height)])),l=t.slice(n,r+1).map(e=>e.textContent).join(` `).replace(/\s+/g,` `).trim();if(!c.length||!l)return;let[u,d]=[c[0],c[c.length-1]];L({page:Number(e.dataset.pageNumber)-1,rects:c,quote:l,handles:{from:[u[0],u[1],u[3]],to:[d[2],d[1],d[3]]}})},onClear:()=>L(null)}),()=>{E=!0,clearTimeout(D),me.current?.stop(),me.current=null,d.disconnect(),cancelAnimationFrame(u),document.removeEventListener(`selectionchange`,k),document.removeEventListener(`pointerup`,ne),t.removeEventListener(`pointerdown`,ie),t.removeEventListener(`scroll`,M),document.removeEventListener(`pointermove`,ae),document.removeEventListener(`pointerup`,oe),document.removeEventListener(`pointercancel`,M),t.removeEventListener(`wheel`,f),t.removeEventListener(`touchstart`,h),t.removeEventListener(`touchmove`,v),t.removeEventListener(`touchend`,w),a.cleanup(),b.current?.loadingTask.destroy(),b.current=null,y.current=null,C.current.clear()}},[]),(0,m.useEffect)(()=>{let e=y.current,n=g.current,r=!1,i=!1;b.current&&(x.current={scale:e.viewer.currentScaleValue,top:n.scrollTop,left:n.scrollLeft}),j(!b.current),ie(``);let a=ai({url:t.url,enableXfa:!1});return a.promise.then(async t=>{if(i=!0,r){t.loadingTask.destroy();return}let n=b.current;b.current=t,C.current.clear(),T(new Map),L(null),fe(null),o.current.words&&_u(t,o.current.words),e.viewer.setDocument(t),e.links.setDocument(t,null),D(t.numPages),j(!1),n?.loadingTask.destroy();let a=await bu(t).catch(()=>[]);r||o.current.onOutline(a)},e=>{i=!0,r||(ie(e instanceof Error?e.message:String(e)),j(!1))}),()=>{r=!0,i||a.destroy()}},[t.url]),(0,m.useEffect)(()=>{let e=()=>{let e=o.current.notes.find(({note:e})=>e.id===o.current.active),t=y.current?.viewer,n=g.current,r=e&&t?.getPageView(e.note.page)?.div;if(!e||!r||!n)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),s=i.top+e.note.rect[1]*i.height,c=i.top+e.note.rect[3]*i.height;(s<a.top+16||c>a.bottom-240)&&n.scrollTo({top:n.scrollTop+s-a.top-72})},t=y.current?.bus;return t?.on(`pagesinit`,e),e(),()=>t?.off(`pagesinit`,e)},[t.active,t.url,re]),(0,m.useEffect)(()=>{let e=e=>{let t=y.current?.viewer,n=e.metaKey||e.ctrlKey;t&&!e.defaultPrevented&&(n&&e.key.toLowerCase()===`f`?(e.preventDefault(),v.current?v.current.select():oe(!0)):n&&(e.key===`=`||e.key===`+`)?(e.preventDefault(),t.increaseScale()):n&&e.key===`-`?(e.preventDefault(),t.decreaseScale()):n&&e.key===`0`?(e.preventDefault(),t.currentScaleValue=`page-width`):e.key===`Escape`&&o.current.region&&o.current.setRegion(!1))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,m.useEffect)(()=>{let e=e=>{e.key===`Escape`&&o.current.group&&o.current.onGroupChange?.(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);function He(e,t=!1,n=N){y.current?.bus.dispatch(`find`,{source:null,type:e?`again`:``,query:n,caseSensitive:!1,entireWord:!1,highlightAll:!0,findPrevious:t,matchDiacritics:!1})}function H(){oe(!1),P(``),se({current:0,total:0}),le(!1),y.current?.bus.dispatch(`findbarclose`,{source:null})}function Ue(){let e=y.current?.viewer,t=Number.parseInt(k,10);e&&t>=1&&t<=E?e.currentPageNumber=t:te(String(O))}function We(e,t=mu(e.rects)){let n=o.current.group;if(!n||o.current.markingDisabled)return;let r=o.current.onCreate;document.getSelection()?.removeAllRanges(),me.current?.reset(),L(null),r(e.page,t,e.rects,e.quote,``,n).catch(e=>ie(e instanceof Error?e.message:String(e)))}function Ge(){I&&(t.group?We(I):(Te(``),xe(``),fe({page:I.page,rect:mu(I.rects),rects:I.rects,quote:I.quote}),document.getSelection()?.removeAllRanges(),me.current?.reset(),L(null)))}function Ke(e=!0){fe(null),o.current.setRegion(!1),e&&g.current?.focus({preventScroll:!0})}async function U(e,t){if(!R)return!1;ye(!0),xe(``);try{return await o.current.onCreate(R.page,R.rect,R.rects,R.quote,e,void 0,{reveal:t!==`close`,quote:t===`quote`}),fe(null),o.current.setRegion(!1),!0}catch(e){return xe(e instanceof Error?e.message:String(e)),!1}finally{ye(!1)}}let qe=t.outline[t.section],Je=hu(),Ye=Je.find(e=>e.value===ne.value)?ne.value:String(Math.round(ne.scale*100)/100),Xe=Je.some(e=>e.value===Ye)?Je:[...Je,{value:Ye,label:`${Math.round(ne.scale*100)}%`}];return(0,$.jsxs)(`div`,{className:`pdf-view`+(t.region?` marking`:``),onKeyDown:e=>{if(!ke||Fe||R||t.region||e.defaultPrevented||e.nativeEvent.isComposing||e.keyCode===229||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let n=e.target instanceof Element?e.target:null;if(!n||n.closest(`input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="textbox"],[role="combobox"],[role="menu"],[role="listbox"]`))return;let r=n.closest(`dialog,[role="dialog"]`);(!r||r.classList.contains(`pdf-suggestion`))&&window.getSelection()?.isCollapsed!==!1&&(e.preventDefault(),e.stopPropagation(),Re(e.key===`ArrowLeft`?-1:1))},children:[(0,$.jsxs)(`div`,{className:`pdf-toolbar`,role:`toolbar`,"aria-label":n(`PDF controls`),children:[t.lead,(0,$.jsx)(`div`,{className:`pdf-section`,title:qe?.title,children:qe?.title&&(0,$.jsx)(`span`,{className:`pdf-section-title`,children:qe.title})}),(0,$.jsxs)(`div`,{className:`pdf-pager`,children:[(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Previous page`),disabled:O<=1,onClick:()=>y.current?.viewer.previousPage(),children:(0,$.jsx)(d,{name:`chevronUp`,size:16})}),(0,$.jsx)(`input`,{"aria-label":n(`Page number`),inputMode:`numeric`,value:k,onChange:e=>te(e.target.value.replace(/\D/g,``)),onFocus:e=>e.currentTarget.select(),onBlur:()=>te(String(O)),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Ue(),e.currentTarget.blur())}}),(0,$.jsxs)(`span`,{className:`pdf-pages`,children:[`/ `,E||`–`]}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Next page`),disabled:O>=E,onClick:()=>y.current?.viewer.nextPage(),children:(0,$.jsx)(d,{name:`chevronDown`,size:16})})]}),(0,$.jsxs)(`div`,{className:`pdf-zoom`,children:[(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Zoom out`),title:n(`Zoom out (⌘−)`),onClick:()=>y.current?.viewer.decreaseScale(),children:(0,$.jsx)(d,{name:`minus`,size:16})}),(0,$.jsx)(l,{className:`zoom-chip`,label:n(`Zoom`),value:Ye,options:Xe,onChange:e=>{y.current&&(y.current.viewer.currentScaleValue=e)}}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Zoom in`),title:n(`Zoom in (⌘+)`),onClick:()=>y.current?.viewer.increaseScale(),children:(0,$.jsx)(d,{name:`plus`,size:16})})]}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`+(ae?` active`:``),"aria-label":n(`Find in PDF`),"aria-pressed":ae,title:n(`Find (⌘F)`),onClick:()=>{ae?H():oe(!0)},children:(0,$.jsx)(d,{name:`search`,size:16})}),!t.readOnly&&(0,$.jsx)(`button`,{type:`button`,className:`icon-button region-toggle`+(t.region?` active`:``),"aria-label":n(`Mark region`),"aria-pressed":t.region,title:n(`Mark a figure or region`),onClick:()=>t.setRegion(!t.region),children:(0,$.jsx)(d,{name:`region`,size:16})}),t.onGroupChange&&(0,$.jsx)(p,{value:t.group||null,onChange:t.onGroupChange,disabled:t.markingDisabled||!!R}),V.length>0&&(0,$.jsxs)(`button`,{type:`button`,className:`pdf-suggestion-trigger`,"aria-label":n(`AI suggestions`),title:n(`AI suggestions`),"aria-pressed":!!ke,disabled:Fe,onClick:()=>ke?Le():t.onSelect(V.find(({note:e})=>e.page>=O-1)?.note||V[0].note),children:[(0,$.jsx)(d,{name:`spark`,size:15}),(0,$.jsx)(`span`,{children:V.length})]}),t.tools]}),ae&&(0,$.jsxs)(`div`,{className:`pdf-find`,children:[(0,$.jsx)(d,{name:`search`,size:15}),(0,$.jsx)(`input`,{ref:v,autoFocus:!0,"aria-label":n(`Search the PDF`),placeholder:n(`Find in PDF`),value:N,onChange:e=>{P(e.target.value),He(!1,!1,e.target.value)},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),He(!0,e.shiftKey)):e.key===`Escape`&&(e.preventDefault(),H())}}),(0,$.jsx)(`span`,{className:`pdf-find-count`,"aria-live":`polite`,children:N?ce?n(`No matches`):F.total?n(`{current} of {total}`,{current:F.current,total:F.total}):``:``}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Previous match`),disabled:!F.total,onClick:()=>He(!0,!0),children:(0,$.jsx)(d,{name:`chevronUp`,size:16})}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Next match`),disabled:!F.total,onClick:()=>He(!0),children:(0,$.jsx)(d,{name:`chevronDown`,size:16})}),(0,$.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`Close search`),onClick:H,children:(0,$.jsx)(d,{name:`close`,size:15})})]}),(0,$.jsxs)(`div`,{className:`pdf-scroll-host`,children:[(0,$.jsx)(`div`,{ref:g,className:`pdf-container`,tabIndex:0,"aria-label":n(`PDF pages`),children:(0,$.jsx)(`div`,{ref:_,className:`pdfViewer`})}),(re||M)&&(0,$.jsx)(`div`,{className:`review-loading`,children:(0,$.jsx)(`p`,{role:M?`alert`:`status`,children:M?n(`The PDF could not be opened: {error}`,{error:M}):n(`Opening the PDF…`)})}),Ee&&(0,$.jsxs)(`div`,{className:`pdf-suggestion-undo`,role:`status`,children:[Ee.aiReview?n(`Suggestion ignored.`):n(`Note deleted.`),(0,$.jsx)(`button`,{type:`button`,disabled:Fe,onClick:()=>void Be(),children:n(`Undo`)}),be&&(0,$.jsx)(`p`,{role:`alert`,children:be})]})]}),[...w].map(([e,r])=>(0,h.createPortal)((0,$.jsxs)(m.Fragment,{children:[(()=>{let r=t.notes.filter(({note:t})=>t.page===e-1),i=yu(r.map(({note:e})=>(e.rects?.length?e.rects:[e.rect])[0]));return r.map(({note:e,number:r},o)=>(0,$.jsxs)(m.Fragment,{children:[(e.rects?.length?e.rects:[e.rect]).map((n,r)=>(0,$.jsx)(`div`,{className:(e.rects?.length?`note-mark`:`note-box`)+(t.active===e.id?` active`:``),"data-note":e.id,"data-group":e.group,"data-review":e.aiReview?!0:void 0,style:{...pu(n),...f(e.group)}},r)),(0,$.jsx)(`button`,{type:`button`,className:`note-tag`+(t.active===e.id?` active`:``),"data-note":e.id,"data-group":e.group,"data-review":e.aiReview?!0:void 0,style:{...i[o],...f(e.group)},"aria-label":e.aiReview?n(`Suggestion {n}: {comment}`,{n:r,comment:e.comment}):n(`Note {n}: {comment}`,{n:r,comment:e.group?a(e.group):e.comment}),"aria-expanded":t.noteActions?t.active===e.id:void 0,title:e.group?n(`Annotation groups`):e.comment,onClick:()=>t.onSelect(e),children:r})]},e.id))})(),Me?.note.page===e-1&&t.noteActions&&!R&&!t.region&&(0,$.jsx)(i,{note:Me.note,number:Me.number,index:Ne,total:Pe.length,selected:t.noteActions.has(Me.note.id),busy:Fe,error:be,draft:Se[Me.note.id]??null,onDraftChange:e=>Ce(t=>{let n={...t};return e===null?delete n[Me.note.id]:n[Me.note.id]=e,n}),destination:t.noteActions.copy?`manuscript`:void 0,onToggle:()=>t.noteActions.copy?void Ve(Me.note):t.noteActions.toggle(Me.note),onDismiss:()=>void ze(Me.note),onClose:Le,onEditing:t.noteActions.onEditing,onSave:async(e,n)=>{ye(!0),xe(``);try{return await t.noteActions.edit(Me.note,e),n===`quote`&&t.noteActions.toggle(Me.note),!0}catch(e){return xe(e instanceof Error?e.message:String(e)),!1}finally{ye(!1)}},onPrevious:()=>Re(-1),onNext:()=>Re(1)},Me.note.id),t.region&&(0,$.jsx)(`div`,{className:`region-capture`,onPointerDown:t=>{if(R||t.button>0)return;t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),r=fu((t.clientX-n.left)/n.width),i=fu((t.clientY-n.top)/n.height);B.current={page:e-1,x:r,y:i,box:n},z({page:e-1,rect:[r,i,r,i]})},onPointerMove:e=>{let t=B.current;if(!t)return;let n=fu((e.clientX-t.box.left)/t.box.width),r=fu((e.clientY-t.box.top)/t.box.height);z({page:t.page,rect:[Math.min(t.x,n),Math.min(t.y,r),Math.max(t.x,n),Math.max(t.y,r)]})},onPointerUp:()=>{let e=_e.current;B.current=null,z(null),e&&(e.rect[2]-e.rect[0]>.015||e.rect[3]-e.rect[1]>.01)&&(o.current.group?We({page:e.page,rects:[],quote:``},e.rect):(Te(``),xe(``),fe({page:e.page,rect:e.rect,rects:[],quote:``})))}}),he?.page===e-1&&(0,$.jsx)(`div`,{className:`note-box draft`,style:pu(he.rect)}),ue?.page===e-1&&(0,$.jsx)(`div`,{className:`problem-flash`,style:pu(ue.rect)},ue.id),I?.handles&&I.page===e-1&&!R&&(0,$.jsxs)($.Fragment,{children:[I.rects.map((e,t)=>(0,$.jsx)(`div`,{className:`note-mark draft`,style:pu(e)},t)),[`from`,`to`].map(e=>{let[t,n,r]=I.handles[e];return(0,$.jsx)(`span`,{className:`select-handle`,"data-end":e,style:{left:`${t*100}%`,top:`${n*100}%`,height:`${(r-n)*100}%`}},e)})]}),!t.readOnly&&I?.page===e-1&&!R&&(0,$.jsxs)(`button`,{type:`button`,className:`add-note`+(I.handles?` touch`:``),"aria-label":t.group?n(`Add to {group}`,{group:a(t.group)}):n(`Add note`),style:{left:`${I.rects[I.rects.length-1][2]*100}%`,top:`${I.rects[I.rects.length-1][3]*100}%`},onPointerDown:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onClick:Ge,children:[(0,$.jsx)(d,{name:`pencil`,size:14}),(0,$.jsx)(u,{group:t.group})]}),R?.page===e-1&&(0,$.jsxs)($.Fragment,{children:[(R.rects.length?R.rects:[R.rect]).map((e,t)=>(0,$.jsx)(`div`,{className:(R.rects.length?`note-mark`:`note-box`)+` draft`,style:pu(e)},t)),(0,$.jsx)(i,{note:{rect:R.rect,comment:``},number:t.notes.length+1,index:0,total:1,selected:!1,busy:Fe,error:be,draft:we,onDraftChange:e=>Te(e??``),onDismiss:Ke,onClose:Ke,onEditing:t.noteActions?.onEditing,onSave:U})]})]}),r,`layer-${e}`))]})});export{xu as PdfView};